StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuETofHit.h
1 /***************************************************************************
2  *
3  * $Id: StMuETofHit.h,v 1.1 2019/02/21 13:32:54 jdb Exp $
4  *
5  * Author: Florian Seck, October 2018
6  ***************************************************************************
7  *
8  * Description: Data class for expanded digital eTOF information in MuDsts:
9  * eTOF hits created out of 2 or more eTOF digis from different sides of the
10  * MRPC counters
11  *
12  ***************************************************************************
13  *
14  * $Log: StMuETofHit.h,v $
15  * Revision 1.1 2019/02/21 13:32:54 jdb
16  * Inclusion of ETOF MuDst code. This code adds support for the full set of ETOF data which includes EtofDigi, EtofHit, EtofHeader. The code essentially copies similar structures from StEvent and additionally rebuilds the maps between Digis and Hits. Accessor methods are added based on the pattern from BTOF to provide access to data at various levels. The code for accessing the PID traits provided by ETOF is also provided
17  *
18  *
19  ***************************************************************************/
20 #ifndef STMUETOFHIT_H
21 #define STMUETOFHIT_H
22 
23 #include "TObject.h"
24 #include "StMuDst.h"
25 
26 class StETofHit;
27 class StMuTrack;
28 
29 
30 class StMuETofHit : public TObject {
31 public:
35  StMuETofHit();
36 
37 
49  StMuETofHit( const unsigned int sector, const unsigned int zPlane, const unsigned int counter,
50  const double& time, const double& tot, const unsigned int clusterSize,
51  const double& localX, const double& localY );
52 
53 
57  StMuETofHit( const StMuETofHit& );
58 
62  StMuETofHit( const StETofHit* );
63 
64 
68  ~StMuETofHit();
69 
70 
74  unsigned int sector() const;
78  unsigned int zPlane() const;
82  unsigned int counter() const;
83 
84 
88  double time() const;
89 
93  double totalTot() const;
94 
95 
99  unsigned int clusterSize() const;
100 
101 
105  double localX() const;
109  double localY() const;
110 
111 
115  int associatedTrackId() const;
116 
117  int index2Primary() const;
118  int index2Global() const;
119 
120  StMuTrack* primaryTrack() const;
121  StMuTrack* globalTrack() const;
122 
126  unsigned int idTruth() const;
130  unsigned int qaTruth() const;
131 
132 
136  bool operator<( const StMuETofHit& rhs ) const;
137 
138  int compare( const TObject* obj ) const;
139  int compare( const StMuETofHit* hit ) const;
140 
141 
143  void setHwAddress( const unsigned int iSector, const unsigned int iZPlane, const unsigned int iCounter );
144 
145  void setSector( const unsigned int sector );
146  void setZPlane( const unsigned int zPlane );
147  void setCounter( const unsigned int counter );
148 
149  void setTotalTot ( const double& tot );
150  void setTime ( const double& time );
151 
152  void setClusterSize( const unsigned int clustSize );
153 
154  void setLocalX ( const double& X );
155  void setLocalY ( const double& Y );
156 
157  void setAssociatedTrackId( const int& id );
158  void setIndex2Primary( const int& id );
159  void setIndex2Global( const int& id );
160 
161  void setIdTruth( unsigned short idtruth, unsigned short qatruth=0 );
162 
163 
164 private:
165  UInt_t mSector;
166  UInt_t mZPlane;
167  UInt_t mCounter;
168 
169  Double_t mTime;
170  Double_t mTotalTot;
171 
172  UInt_t mClusterSize;
173 
174  Double_t mLocalX;
175  Double_t mLocalY;
176 
177  Int_t mAssociatedTrackId;
178  Int_t mIndex2Primary;
179  Int_t mIndex2Global;
180 
181  UShort_t mIdTruth;
182  UShort_t mQuality;
183 
184  friend class StMuDst;
185 
186 
187 
188  ClassDef( StMuETofHit, 1 );
189 };
190 
191 
192 
193 inline unsigned int StMuETofHit::sector() const { return mSector; }
194 inline unsigned int StMuETofHit::zPlane() const { return mZPlane; }
195 inline unsigned int StMuETofHit::counter() const { return mCounter; }
196 
197 inline double StMuETofHit::time() const { return mTime; }
198 inline double StMuETofHit::totalTot() const { return mTotalTot; }
199 
200 inline unsigned int StMuETofHit::clusterSize() const { return mClusterSize; }
201 
202 inline double StMuETofHit::localX() const { return mLocalX; }
203 inline double StMuETofHit::localY() const { return mLocalY; }
204 
205 inline int StMuETofHit::associatedTrackId() const { return mAssociatedTrackId; }
206 inline int StMuETofHit::index2Primary() const { return mIndex2Primary; }
207 inline int StMuETofHit::index2Global() const { return mIndex2Global; }
208 
209 inline StMuTrack* StMuETofHit::primaryTrack() const { return ( mIndex2Primary>=0 ) ? ( StMuTrack* ) StMuDst::array( muPrimary )->UncheckedAt( mIndex2Primary ) : 0; }
210 inline StMuTrack* StMuETofHit::globalTrack() const { return ( mIndex2Global >=0 ) ? ( StMuTrack* ) StMuDst::array( muGlobal )->UncheckedAt( mIndex2Global ) : 0; }
211 
212 inline unsigned int StMuETofHit::idTruth() const { return mIdTruth; }
213 inline unsigned int StMuETofHit::qaTruth() const { return mQuality; }
214 
215 
216 inline void StMuETofHit::setSector( const unsigned int sector ) { mSector = sector; }
217 inline void StMuETofHit::setZPlane( const unsigned int zPlane ) { mZPlane = zPlane; }
218 inline void StMuETofHit::setCounter( const unsigned int counter ) { mCounter = counter; }
219 
220 inline void StMuETofHit::setTotalTot ( const double& tot ) { mTotalTot = tot; }
221 inline void StMuETofHit::setTime ( const double& time ) { mTime = time; }
222 
223 inline void StMuETofHit::setClusterSize( const unsigned int clustSize ) { mClusterSize = clustSize; }
224 
225 inline void StMuETofHit::setLocalX ( const double& X ) { mLocalX = X; }
226 inline void StMuETofHit::setLocalY ( const double& Y ) { mLocalY = Y; }
227 
228 inline void StMuETofHit::setAssociatedTrackId( const int& id ) { mAssociatedTrackId = id; }
229 inline void StMuETofHit::setIndex2Primary( const int& id ) { mIndex2Primary = id; }
230 inline void StMuETofHit::setIndex2Global( const int& id ) { mIndex2Global = id; }
231 
232 
233 #endif // STMUETOFHIT_H
unsigned int qaTruth() const
quality of this information (percentage of charge produced by mIdTruth)
Definition: StMuETofHit.h:213
double localY() const
Y-position.
Definition: StMuETofHit.h:203
unsigned int zPlane() const
ZPlane.
Definition: StMuETofHit.h:194
unsigned int idTruth() const
mc-true associated track id in simulation
Definition: StMuETofHit.h:212
unsigned int clusterSize() const
Cluster size.
Definition: StMuETofHit.h:200
double time() const
Time.
Definition: StMuETofHit.h:197
unsigned int counter() const
Counter.
Definition: StMuETofHit.h:195
unsigned int sector() const
Sector.
Definition: StMuETofHit.h:193
void setHwAddress(const unsigned int iSector, const unsigned int iZPlane, const unsigned int iCounter)
~StMuETofHit()
Destructor.
StMuETofHit()
Default constructor.
Definition: StMuETofHit.cxx:25
int associatedTrackId() const
id to the track which has been matched to this hit
Definition: StMuETofHit.h:205
double localX() const
X-position.
Definition: StMuETofHit.h:202
double totalTot() const
Total Tot.
Definition: StMuETofHit.h:198
bool operator<(const StMuETofHit &rhs) const
Sorting using the time, assumes Digis are in same reference frame (e.g. same epoch).
static TClonesArray * array(int type)
returns pointer to the n-th TClonesArray
Definition: StMuDst.h:262