StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEpdHit.h
1 
7 /***************************************************************************
8  *
9  * $Id: StEpdHit.h,v 2.1 2018/02/08 17:35:02 ullrich Exp $
10  *
11  * Author: Mike Lisa, Jan 2018
12  ***************************************************************************
13  *
14  * Description:
15  *
16  * Hit Class for the STAR Event Plane Detector.
17  * There is one "hit" for each (good) tile in the detector
18  *
19  * Total size of this object is 10 bytes
20  * This object contains only
21  * 1) the id of the tile, compacted into a Short_t
22  * 2) the QT information (ADC, TDC, TAC, hasTac flag, status flag)
23  * compacted into 32 bits (int
24  * 3) the gain-corrected energy loss, in units of the
25  * most probable value (MPV) of a single MIP in the tile,
26  * according to a Landau distribution. Stored as Float_t
27  *
28  * - Mike Lisa Jan 2018
29  *
30  ***************************************************************************
31  *
32  * $Log: StEpdHit.h,v $
33  * Revision 2.1 2018/02/08 17:35:02 ullrich
34  * Initial Revision.
35  *
36  **************************************************************************/
37 #ifndef StEpdHit_h
38 #define StEpdHit_h
39 
40 #include <cstdlib>
41 #include "StObject.h"
42 
43 class StEpdHit : public StObject
44 {
45 public:
46 
48  StEpdHit();
49 
61  StEpdHit(int position, int tile, short EW, int ADC, int TAC, int TDC, bool hasTAC, float nMIP, bool statusIsGood, int truthId);
62 
63  // virtual void Print(const char *option = "") const;
64 
66  bool hasTac() const;
67 
69  int adc() const;
70 
72  int tac() const;
73 
75  int tdc() const;
76 
78  short side() const;
79 
83  short id() const;
84 
86  int position() const; // 1...12
87 
89  int tile() const; // 1...31
90 
94  int qtData() const;
95 
97  float nMIP() const;
98 
100  bool isGood() const;
101 
107  void setQTdata(int packedData);
108 
110  void setnMIP(float nMIP);
111 
113  void setIdTruth(int id);
114 
116  int idTruth() const;
117 
118 protected:
119 
123  Short_t mId;
124 
128  Int_t mQTdata;
129 
131  Float_t mnMIP;
132 
134  Int_t mTruthId;
135 
136  ClassDef(StEpdHit, 1)
137 };
138 
139 inline int StEpdHit::qtData() const {return mQTdata;}
140 inline float StEpdHit::nMIP() const {return mnMIP;}
141 inline void StEpdHit::setQTdata(int packedData) {mQTdata=packedData;}
142 inline void StEpdHit::setnMIP(float nMIP) {mnMIP = nMIP;}
143 inline void StEpdHit::setIdTruth(int id) {mTruthId = id;}
144 inline int StEpdHit::idTruth() const {return mTruthId;}
145 inline short StEpdHit::side() const { return mId < 0 ? -1 : +1;}
146 inline short StEpdHit::id() const { return mId; }
147 inline int StEpdHit::position() const { return std::abs(mId / 100); }
148 inline int StEpdHit::tile() const { return std::abs(mId % 100); }
149 inline int StEpdHit::adc() const { return mQTdata & 0x0FFF; }
150 inline int StEpdHit::tac() const { return (mQTdata >> 12) & 0x0FFF; }
151 inline int StEpdHit::tdc() const { return (mQTdata >> 24) & 0x001F; }
152 inline bool StEpdHit::hasTac() const { return (mQTdata >> 29) & 0x1; }
153 inline bool StEpdHit::isGood() const { return (mQTdata >> 30) & 0x1; }
154 #endif
bool hasTac() const
true if this channel has a valid TAC value
Definition: StEpdHit.h:152
Int_t mQTdata
Definition: StEpdHit.h:128
short side() const
+1 if tile is on West side; -1 if on East side
Definition: StEpdHit.h:145
Short_t mId
Definition: StEpdHit.h:123
Int_t mTruthId
identifier of particle most responsible for energy loss (simulation)
Definition: StEpdHit.h:134
void setnMIP(float nMIP)
Definition: StEpdHit.h:142
int position() const
position of supersector on a wheel [1,12]
Definition: StEpdHit.h:147
float nMIP() const
gain calibrated energy loss in tile, in units of Landau MPV for one MIP
Definition: StEpdHit.h:140
int idTruth() const
identifier of particle most responsible for energy loss (simulation)
Definition: StEpdHit.h:144
int qtData() const
Definition: StEpdHit.h:139
int adc() const
ADC value [0,4095].
Definition: StEpdHit.h:149
int tdc() const
TDC value [0,31].
Definition: StEpdHit.h:151
Stores information for tiles in STAR Event Plane Detector.
Definition: StEpdHit.h:43
int tile() const
tile on the supersector [1,31]
Definition: StEpdHit.h:148
StEpdHit()
default constructor. sets all values empty
Definition: StEpdHit.cxx:27
void setIdTruth(int id)
set identifier of particle most responsible for energy loss (simulation)
Definition: StEpdHit.h:143
bool isGood() const
false if tile is bad or missing, according to (time-dependent) database
Definition: StEpdHit.h:153
void setQTdata(int packedData)
Definition: StEpdHit.h:141
short id() const
Definition: StEpdHit.h:146
Float_t mnMIP
gain calibrated energy loss in tile, in units of Landau MPV for one MIP
Definition: StEpdHit.h:131
int tac() const
TAC value [0,4095].
Definition: StEpdHit.h:150