StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuEpdHit.h
1 #ifndef StMuEpdHit_h
2 #define StMuEpdHit_h
3 
4 #include <cstdlib>
5 #include "StObject.h"
6 
7 //
8 // \class StMuEpdHit
9 // \author Mike Lisa
10 // \date 14 Jan 2018
11 // \brief Holds signals for tiles in STAR Event Plane Detector
12 
13 /*************************************************
14  * Hit Class for the STAR Event Plane Detector.
15  * There is one "hit" for each (good) tile in the detector
16  *
17  * Total size of this object is 10 bytes
18  * This object contains only
19  * 1) the id of the tile, compacted into a Short_t
20  * 2) the QT information (ADC, TDC, TAC, hasTac flag, status flag)
21  * compacted into 32 bits (Int_t
22  * 3) the gain-corrected energy loss, in units of the
23  * most probable value (MPV) of a single MIP in the tile,
24  * according to a Landau distribution. Stored as Float_t
25  *
26  * The StMuEpdHit in the StMuDST is basically the same as
27  * the StEpdHit object in StEvent
28  *
29  * - Mike Lisa Jan 2018
30  ************************************************/
31 class StEpdHit;
32 
33 class StMuEpdHit : public StObject
34 {
35 public:
36 
38  StMuEpdHit();
50  StMuEpdHit(Int_t position, Int_t tile, Short_t EW, Int_t ADC, Int_t TAC, Int_t TDC, bool hasTAC, Float_t nMIP, bool statusIsGood, Int_t truthId);
51 
55  StMuEpdHit(StEpdHit* epdHit);
56 
58  bool hasTac() const;
60  Int_t adc() const;
62  Int_t tac() const;
64  Int_t tdc() const;
66  Short_t side() const;
67 
71  Short_t id() const;
73  Int_t position() const; // 1...12
75  Int_t tile() const; // 1...31
79  Int_t qtData() {return mQTdata;}
81  Float_t nMIP() {return mnMIP;}
83  bool isGood() const;
84 
91  void setQTdata(Int_t packedData){mQTdata=packedData;}
94  void setId(Short_t id){mId = id;}
96  void SetnMIP(Float_t nMIP){mnMIP = nMIP;}
97 
99  void setIdTruth(Int_t id){mTruthId = id;}
100 
102  Int_t idTruth(){return mTruthId;}
103 
104 protected:
105 
109  Short_t mId;
110 
114  Int_t mQTdata;
115 
117  Float_t mnMIP;
118 
120  Int_t mTruthId;
121 
122  ClassDef(StMuEpdHit, 1)
123 };
124 
125 inline Short_t StMuEpdHit::side() const { return mId < 0 ? -1 : +1;}
126 
127 inline Short_t StMuEpdHit::id() const { return mId; }
128 inline Int_t StMuEpdHit::position() const { return std::abs(mId / 100); }
129 inline Int_t StMuEpdHit::tile() const { return std::abs(mId % 100); }
130 
131 inline Int_t StMuEpdHit::adc() const { return mQTdata & 0x0FFF; }
132 inline Int_t StMuEpdHit::tac() const { return (mQTdata >> 12) & 0x0FFF; }
133 inline Int_t StMuEpdHit::tdc() const { return (mQTdata >> 24) & 0x001F; }
134 inline bool StMuEpdHit::hasTac() const { return (mQTdata >> 29) & 0x1; }
135 inline bool StMuEpdHit::isGood() const { return (mQTdata >> 30) & 0x1; }
136 #endif
Int_t adc() const
ADC value [0,4095].
Definition: StMuEpdHit.h:131
Int_t mQTdata
Definition: StMuEpdHit.h:114
Float_t mnMIP
gain calibrated energy loss in tile, in units of Landau MPV for one MIP
Definition: StMuEpdHit.h:117
Short_t mId
Definition: StMuEpdHit.h:109
StMuEpdHit()
default constructor. sets all values empty
Definition: StMuEpdHit.cxx:34
Int_t tdc() const
TDC value [0,31].
Definition: StMuEpdHit.h:133
Short_t id() const
Definition: StMuEpdHit.h:127
Int_t tac() const
TAC value [0,4095].
Definition: StMuEpdHit.h:132
void setId(Short_t id)
Definition: StMuEpdHit.h:94
Int_t idTruth()
returns the particle number for the particle most responsible for energy loss (monte carlo) ...
Definition: StMuEpdHit.h:102
void setIdTruth(Int_t id)
set the id of particle most responsible for energy loss in tile (monte carlo)
Definition: StMuEpdHit.h:99
bool hasTac() const
true if this channel has a valid TAC value
Definition: StMuEpdHit.h:134
bool isGood() const
false if tile is bad or missing, according to (time-dependent) database
Definition: StMuEpdHit.h:135
Short_t side() const
+1 if tile is on West side; -1 if on East side
Definition: StMuEpdHit.h:125
void SetnMIP(Float_t nMIP)
Definition: StMuEpdHit.h:96
Stores information for tiles in STAR Event Plane Detector.
Definition: StEpdHit.h:43
Int_t tile() const
tile on the supersector [1,31]
Definition: StMuEpdHit.h:129
Float_t nMIP()
gain calibrated energy loss in tile, in units of Landau MPV for one MIP
Definition: StMuEpdHit.h:81
Int_t position() const
position of supersector on a wheel [1,12]
Definition: StMuEpdHit.h:128
void setQTdata(Int_t packedData)
Definition: StMuEpdHit.h:91
Int_t mTruthId
greatest contributer to energy deposition (MC)
Definition: StMuEpdHit.h:120
Int_t qtData()
Definition: StMuEpdHit.h:79