StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPicoEpdHit.h
1 #ifndef StPicoEpdHit_h
2 #define StPicoEpdHit_h
3 
4 // C++ headers
5 #include <cstdlib>
6 
7 // ROOT headers
8 #include "TObject.h"
9 
10 //
11 // \class StPicoEpdHit
12 // \author Mike Lisa
13 // \date 6 March 2018
14 // \brief Holds signals for tiles in STAR Event Plane Detector
15 
16 /*************************************************
17  * Hit Class for the STAR Event Plane Detector.
18  * There is one "hit" for each (good) tile in the detector
19  * that has a nonzero ADC value
20  *
21  * Total size of this object is 10 bytes
22  * This object contains only
23  * 1) the id of the tile, compacted into a Short_t
24  * 2) the QT information (ADC, TDC, TAC, hasTac flag, status flag)
25  * compacted into 32 bits (Int_t
26  * 3) the gain-corrected energy loss, in units of the
27  * most probable value (MPV) of a single MIP in the tile,
28  * according to a Landau distribution. Stored as Float_t
29  *
30  * The StPicoEpdHit in the StMuDST is basically the same as
31  * the StMuEpdHit object in the muDst and
32  * the StEpdHit object in StEvent
33  * Except
34  * 1) it does not inherit from StObject, so can be used in "vanilla root"
35  * 2) there is no "Truth ID" which is used for simulations.
36  *
37  *
38  * To access GEOMETRICAL information (e.g. location of a tile, etc)
39  * use the StEpdGeom class. All you have to do is send StEpdGeom
40  * the StPicoEpdHit::id(), and you'll get all you want.
41  * (Also works for StEpdHit::id() and StMuEpdHit::id())
42  *
43  * - Mike Lisa March 2018
44  ************************************************/
45 
46 class StPicoEpdHit : public TObject {
47 
48  public:
49 
51  StPicoEpdHit();
62  StPicoEpdHit(Int_t position, Int_t tile, Int_t EW, Int_t ADC, Int_t TAC, Int_t TDC,
63  Bool_t hasTAC, Float_t nMIP, Bool_t statusIsGood);
68  StPicoEpdHit(Short_t id, Int_t QTdata, Float_t nMIP);
72  virtual ~StPicoEpdHit();
74  virtual void Print(const Char_t *option = "") const;
75 
77  Bool_t hasTac() const { return (mQTdata >> 29) & 0x1; }
79  Int_t adc() const { return mQTdata & 0x0FFF; }
81  Int_t tac() const { return (mQTdata >> 12) & 0x0FFF; }
83  Int_t tdc() const { return (mQTdata >> 24) & 0x001F; }
85  Short_t side() const { return mId < 0 ? -1 : +1;}
86 
90  Short_t id() const { return mId; }
92  Int_t position() const { return std::abs(mId / 100); }
94  Int_t tile() const { return std::abs(mId % 100); }
96  Int_t row() const { return (std::abs(mId % 100))/2 + 1; }
100  Int_t qtData() const { return mQTdata; }
104  Float_t nMIP() const { return this->isGood() ? mnMIP : 0.0; }
106  Bool_t isGood() const { return (mQTdata >> 30) & 0x1; }
111  Float_t TnMIP(float MAX=2.0, float thresh=0.3) const {float nm = this->nMIP(); if (nm<thresh) return 0.0; else return nm<MAX ? nm : MAX;}
112 
118  void setQTdata(Int_t packedData) { mQTdata=packedData; }
121  void setId(Short_t id) { mId = id; }
123  void setnMIP(Float_t nMIP) { mnMIP = nMIP; }
124 
125  protected:
126 
130  Short_t mId;
131 
135  Int_t mQTdata;
136 
138  Float_t mnMIP;
139 
140  ClassDef(StPicoEpdHit, 1)
141 };
142 
143 #endif
Float_t mnMIP
gain calibrated energy loss in tile, in units of Landau MPV for one MIP
Definition: StPicoEpdHit.h:138
Int_t tdc() const
TDC value [0,31].
Definition: StPicoEpdHit.h:83
Short_t id() const
Definition: StPicoEpdHit.h:90
Bool_t hasTac() const
true if this channel has a valid TAC value
Definition: StPicoEpdHit.h:77
Int_t qtData() const
Definition: StPicoEpdHit.h:100
Int_t tac() const
TAC value [0,4095].
Definition: StPicoEpdHit.h:81
virtual void Print(const Char_t *option="") const
Print EPD hit information.
Int_t tile() const
tile on the supersector [1,31]
Definition: StPicoEpdHit.h:94
virtual ~StPicoEpdHit()
Destructor.
StPicoEpdHit()
default constructor. sets all values empty
void setnMIP(Float_t nMIP)
Definition: StPicoEpdHit.h:123
Float_t TnMIP(float MAX=2.0, float thresh=0.3) const
Definition: StPicoEpdHit.h:111
Int_t position() const
position of supersector on a wheel [1,12]
Definition: StPicoEpdHit.h:92
void setId(Short_t id)
Definition: StPicoEpdHit.h:121
Int_t row() const
row number [1,16]
Definition: StPicoEpdHit.h:96
Int_t adc() const
ADC value [0,4095].
Definition: StPicoEpdHit.h:79
void setQTdata(Int_t packedData)
Definition: StPicoEpdHit.h:118
Float_t nMIP() const
Definition: StPicoEpdHit.h:104
Short_t side() const
+1 if tile is on West side; -1 if on East side
Definition: StPicoEpdHit.h:85
Bool_t isGood() const
false if tile is bad or missing, according to (time-dependent) database
Definition: StPicoEpdHit.h:106