// Author: Andrew M. Rogers, NSCL 07/01/2006
//* Copyright (C) 2006-2008 Andrew M. Rogers

#ifndef __THIRASIDET_H
#define __THIRASIDET_H

#include <iostream>
#include <bitset>

#include <TROOT.h>
#include <TBranch.h>
#include <TTree.h>
#include <TObject.h>

#ifndef  __ROOTDEFINE_H
#include "rootDefine.h"
#define  __ROOTDEFINE_H
#endif

using namespace std;


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// THiRASiDet                                                           //
//                                                                      //
// A THiRASiDet class derives from TObject.  This Class provides the    //
// structure for the Ef Si detectors in the HiRA device.  Raw event     //
// data is filled as branches on the tree.                              //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class THiRASiDet : public TObject {
 protected:
  TString      fName;                                  //! Object identifier
  TString      fTitle;                                 //! Object title

 public:
  THiRASiDet  *fCon;                                   //!

  bitset<THIRA_SI_CHANNELS> fBadStrips;                //! Problem strips that can be excluded.

  Bool_t       fAddRndm;                               //! Add random number to convert from short data types to double.
  Short_t      fMb;                                    //! ASIC motherboard number.
  Short_t      fSlot;                                  //! ASIC slot number.

  Short_t      fCbSequence;                            //  MB chip board readout sequence. Number of CB read (inclusive).
  Short_t      fChSequence;                            //  MB channel readout sequence. Number of ch's read prior to and including this CB.
  UInt_t       fHitSequence;                           //  CB strips fired. Also can be used as bitmask.

  Short_t      ERaw[THIRA_SI_CHANNELS];                // Raw energy deposited in a Ef Si strip.
  Short_t      TRaw[THIRA_SI_CHANNELS];                // Raw time values.
  Double_t     E[THIRA_SI_CHANNELS];                   // Energy deposited in a Ef Si strip.
  Double_t     T[THIRA_SI_CHANNELS];                   // Time value.
  Double_t     Emax;                                   // Maximum energy deposited in a Si strip for each telescope.
  Short_t      Emaxch;                                 // Channel number corresponding to the channel with the maximum energy.
  Short_t      rawMult;                                // Multiplicity of Si for each telescope.

  TBranch      *b_fCbSequence;                         //!
  TBranch      *b_fChSequence;                         //!
  TBranch      *b_fHitSequence;                        //!
  TBranch      *b_ERaw;                                //! Energy Branch.
  TBranch      *b_TRaw;                                //! Time Branch.
  TBranch      *b_E;                                   //! Energy Branch.
  TBranch      *b_T;                                   //! Time Branch.
  TBranch      *b_Emax;                                //! Emax Branch.
  TBranch      *b_Emaxch;                              //! Emaxch Branch.
  TBranch      *b_rawMult;                             //! Raw Multiplicity Branch.


  TTree        *fChain;                                //! Pointer to the analyzed TTree or TChain
  Int_t        fCurrent;                               //! Current Tree number in a TChain


 public:
  THiRASiDet(): fName(), fTitle() {}
  ~THiRASiDet() {}
  THiRASiDet(const THiRASiDet &);                // The copy constructor.


  const Char_t  *GetName() const { return fName; }
  const Char_t  *GetTitle() const { return fTitle; }
  void           SetName(const Char_t *name);
  void           SetNameTitle(const Char_t *name, const Char_t *title);
  void           SetTitle(const Char_t *title=""); 

  virtual void   Calculate();                               // Calculate quantities.
  virtual void   Calibrate();                               // Calibrate detector.
  virtual void   Clear(Option_t *option="");                // Clear all members.
  void           Copy(TObject &det) const;                  // The copy method.
  Int_t          GetEntry(Long64_t entry=0,Int_t getall=0); // Get entry for all branches.
  virtual void   InitClass(TString name);                   // Initialize the class.
  virtual void   InitTree(TTree *tree);                     // Initialize the tree.
  Bool_t         IsBad(Int_t strip);                        // Check if the strip is marked as "bad".

  
  Short_t        GetMB(){return fMb;}                       // Get the motherboard number for this silicon.
  Short_t        GetSlot(){return fSlot;}                   // Get the chipboard slot for this silicon.

  Short_t        GetCbReadOrder(){return fCbSequence;}      // Get the order of the current CB.
  Short_t        GetChReadOrder(Int_t strip);               // Get the order of a readout strip.
  Short_t        GetChPriorReadOrder(){return fChSequence;} // Get the number of channels read prior to this CB.
  Short_t        GetHitReadOrder(Int_t strip);              // Get the order of a hit strip on a CB.

  void           SetBad(Int_t strip, Int_t bitValue=1);     // Set bad segment.
 

  ClassDef(THiRASiDet,4)     // HiRA Silicon Strip Detector.

};

#endif


Last change: Sun Dec 21 12:38:49 2008
Last generated: 2008-12-21 12:38

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.