StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPicoBbcHit.h
1 #ifndef StPicoBbcHit_h
2 #define StPicoBbcHit_h
3 
4 // ROOT headers
5 #include "TObject.h"
6 
7 //
8 // \class StPicoBbcHit
9 // \author Mike Lisa
10 // \date 6 March 2018
11 // \brief Holds signals for ***phototubes*** in INNER STAR
12 // Beam-beam counter (BBC)
13 
14 /*************************************************
15  * Hit Class for the STAR Beam-Beam Counter (BBC)
16  * There is one "hit" for each (good) *phototube* in the detector
17  * that has a nonzero ADC value
18  *
19  * Total size of this object is 6 bytes
20  * This object contains only
21  * 1) the id of the PMT, compacted into a Short_t
22  * 2) the QT information (ADC, TDC, TAC, hasTac flag, status flag)
23  * compacted into 32 bits (Int_t)
24  *
25  *
26  * The BBC is a painful detector, because it has 16 phototubes
27  * distributed to 18 tiles, per side. This class stores the
28  * data by phototube (as it must).
29  *
30  * To access GEOMETRICAL information (e.g. location of a tile, etc)
31  * use the StBbcGeom class. All you have to do is send StBbcGeom
32  * the StPicoBbcHit::id(), and you'll get all you want.
33  *
34  * - Mike Lisa March 2018
35  ************************************************/
36 
37 //_________________
38 class StPicoBbcHit : public TObject {
39 
40  public:
41 
43  StPicoBbcHit();
52  StPicoBbcHit(Int_t PMTnumber, Int_t EW, Int_t ADC, Int_t TAC,
53  Int_t TDC, Bool_t hasTAC, Bool_t statusIsGood);
57  virtual ~StPicoBbcHit();
58  // Print BBC hit information
59  virtual void Print(const Char_t *option = "") const;
60 
62  Bool_t hasTac() const { return (mQTdata >> 29) & 0x1; }
64  Int_t adc() const { return mQTdata & 0x0FFF; }
66  Int_t tac() const { return (mQTdata >> 12) & 0x0FFF; }
68  Int_t tdc() const { return (mQTdata >> 24) & 0x001F; }
70  Short_t side() const { return mId < 0 ? -1 : +1;}
71 
75  Short_t id() const { return mId; }
79  Int_t qtData() const { return mQTdata; }
81  Bool_t isGood() const { return (mQTdata >> 30) & 0x1; }
82 
83 
89  void setQTdata(Int_t packedData) { mQTdata=packedData; }
92  void setId(Short_t id) { mId = id; }
93 
94  protected:
95 
99  Short_t mId;
100 
104  Int_t mQTdata;
105 
106  ClassDef(StPicoBbcHit, 1)
107 };
108 
109 #endif
virtual ~StPicoBbcHit()
Destructor.
Short_t mId
Definition: StPicoBbcHit.h:99
void setId(Short_t id)
Definition: StPicoBbcHit.h:92
Bool_t hasTac() const
True if this channel has a valid TAC value.
Definition: StPicoBbcHit.h:62
Bool_t isGood() const
false if tile is bad or missing, according to (time-dependent) database
Definition: StPicoBbcHit.h:81
StPicoBbcHit()
Default constructor. sets all values empty.
Short_t side() const
+1 if tile is on West side; -1 if on East side
Definition: StPicoBbcHit.h:70
Short_t id() const
Definition: StPicoBbcHit.h:75
Int_t tac() const
TAC value [0,4095].
Definition: StPicoBbcHit.h:66
Int_t qtData() const
Definition: StPicoBbcHit.h:79
Int_t tdc() const
TDC value [0,31].
Definition: StPicoBbcHit.h:68
Int_t adc() const
ADC value [0,4095].
Definition: StPicoBbcHit.h:64
void setQTdata(Int_t packedData)
Definition: StPicoBbcHit.h:89