PandaRoot
PndPidCandidate.h
Go to the documentation of this file.
1 #ifndef PNDPIDCANDIDATE_H
2 #define PNDPIDCANDIDATE_H
3 // //
5 // PndPidCandidate //
6 // //
7 // Definition of the Panda pid candidate. //
8 // //
9 // Author: Klaus Goetzen, GSI, 12.06.08 //
10 // Copyright (C) 2008, GSI Darmstadt. //
11 // //
13 
14 #include <iostream>
15 
16 #include <assert.h>
17 
18 #include "FairTimeStamp.h"
19 #include "TArrayI.h"
20 #include "TMatrixD.h"
21 #include "TVector3.h"
22 #include "TLorentzVector.h"
23 #include "PndTrack.h"
24 
25 // class VAbsPidInfo;
26 
27 // ========================================================================
28 // ===== PndPidCandidate - Class definig the AOD interface ====
29 // ========================================================================
30 
31 class PndPidCandidate : public FairTimeStamp {
32 
33  public:
35  PndPidCandidate(Int_t charge, TVector3 &pos, TLorentzVector &p4, TMatrixD &cov7);
36  PndPidCandidate(Int_t charge, TVector3 &pos, TLorentzVector &p4);
37 
39 
40  // ************************
41  // ACCESSOR METHODS
42  // ************************
43 
44  // ************************
45  // basic properties:
46  // ************************
47 
48  Int_t GetCharge() const { return fCharge; }
49  TVector3 GetPosition() const { return TVector3(fXposition, fYposition, fZposition); }
50  TVector3 GetMomentum() const { return TVector3(fXmomentum, fYmomentum, fZmomentum); }
51  Double_t GetEnergy() const { return fEnergy; }
52  TLorentzVector GetLorentzVector() const { return TLorentzVector(fXmomentum, fYmomentum, fZmomentum, fEnergy); }
53 
54  TVector3 GetFirstHit() const { return TVector3(fFirstHitX, fFirstHitX, fFirstHitX); }
55  TVector3 GetLastHit() const { return TVector3(fLastHitX, fLastHitY, fLastHitZ); }
56 
57  const Float_t *GetErrorP7() const { return fErrP7; }
58  const Float_t *GetParams() const { return fParams; }
59  const Float_t *GetCov() const { return fCov; }
60  TMatrixD &Cov7() const;
61  TMatrixD &P4Cov() const;
62  Int_t GetMcIndex() const { return fMcIndex; }
63  Int_t GetTrackIndex() const { return fTrackIndex; }
64  Int_t GetTrackBranch() const { return fTrackBranch; }
66 
67  // ************************
68  // detector specific stuff
69  // ************************
70 
71  // MVD
72  Float_t GetMvdDEDX() const { return fMvdDEDX; }
73  Int_t GetMvdHits() const { return fMvdHits; }
74  // const Int_t* GetMvdHitIndexArray() {return fMvdHitIndexArray.GetArray();}
75 
76  // STT
77  Float_t GetSttMeanDEDX() const { return fSttMeanDEDX; }
78  Int_t GetSttHits() const { return fSttHits; }
79  // const Int_t* GetSttHitIndexArray() {return fSttHitIndexArray.GetArray();}
80 
81  // GEM
82  Int_t GetGemHits() const { return fGemHits; }
83 
84  // TOF
85  Float_t GetTofStopTime() const { return fTofStopTime; }
86  Float_t GetTofM2() const { return fTofM2; }
87  Float_t GetTofTrackLength() const { return fTofTrackLength; }
88  Float_t GetTofQuality() const { return fTofQuality; }
89  Int_t GetTofIndex() const { return fTofIndex; }
90  Float_t GetTofBeta() const { return (fTofStopTime > 0. && fTofTrackLength > 0.) ? fTofTrackLength / (30. * fTofStopTime) : -1.; }
91 
92  // Barrel DIRC
93  Float_t GetDrcThetaC() const { return fDrcThetaC; }
94  Float_t GetDrcThetaCErr() const { return fDrcThetaCErr; }
95  Float_t GetDrcQuality() const { return fDrcQuality; }
96  Int_t GetDrcNumberOfPhotons() const { return fDrcNumberOfPhotons; }
97  Int_t GetDrcIndex() const { return fDrcIndex; }
98 
99  // Disc DIRC
100  Float_t GetDiscThetaC() const { return fDiscThetaC; }
101  Float_t GetDiscThetaCErr() const { return fDiscThetaCErr; }
102  Float_t GetDiscQuality() const { return fDiscQuality; }
104  Int_t GetDiscIndex() const { return fDiscIndex; }
105 
106  // RICH
107  Float_t GetRichThetaC() const { return fRichThetaC; }
108  Float_t GetRichThetaCErr() const { return fRichThetaCErr; }
109  Float_t GetRichQuality() const { return fRichQuality; }
111  Int_t GetRichIndex() const { return fRichIndex; }
112 
113  // EMC
114  Float_t GetEmcRawEnergy() const { return fEmcRawEnergy; }
115  Float_t GetEmcCalEnergy() const { return fEmcCalEnergy; }
116  Float_t GetEmcQuality() const { return fEmcQuality; }
118  Int_t GetEmcNumberOfBumps() const { return fEmcNumberOfBumps; }
119  Int_t GetEmcModule() const { return fEmcModule; }
120  Int_t GetEmcIndex() const { return fEmcIndex; }
121  Float_t GetEmcTimeStamp() const { return fEmcTimeStamp; }
122 
123  // EMC Cluster properties.
124  Double_t GetEmcClusterZ20() const { return fEmcZ20; }
125  Double_t GetEmcClusterZ53() const { return fEmcZ53; }
126  Double_t GetEmcClusterLat() const { return fEmcLat; }
127  Double_t GetEmcClusterE1() const { return fEmcE1; }
128  Double_t GetEmcClusterE9() const { return fEmcE9; }
129  Double_t GetEmcClusterE25() const { return fEmcE25; }
130 
131  // MUO
132  Int_t GetMuoNumberOfLayers() const { return fMuoNumberOfLayers; }
133  Float_t GetMuoProbability() const { return fMuoProbability; }
134  Float_t GetMuoQuality() const { return fMuoQuality; }
135  Float_t GetMuoIron() const { return fMuoIron; }
136  Float_t GetMuoMomentumIn() const { return fMuoMomentumIn; }
137  Int_t GetMuoModule() const { return fMuoModule; }
138  Int_t GetMuoHits() const { return fMuoHits; }
139  Int_t GetMuoIndex() const { return fMuoIndex; }
140 
141  // Tracking
142 
143  Int_t GetDegreesOfFreedom() const { return fDegreesOfFreedom; }
144  Int_t GetFitStatus() const { return fFitStatus; }
145  Float_t GetChiSquared() const { return fChiSquared; }
146  Int_t GetPidHypo() const { return fPidHyp; }
147 
148  // ************************
149  // MODIFIER METHODS
150  // ************************
151 
152  void Lock() { fLocked = true; }
153  void Unlock() { fLocked = false; }
154  bool IsLocked() { return fLocked; }
155 
156  // ************************
157  // basic properties:
158  // ************************
159 
160  void SetCharge(Int_t charge) { fCharge = charge; }
161  void SetPosition(TVector3 &pos)
162  {
163  fXposition = pos.X();
164  fYposition = pos.Y();
165  fZposition = pos.Z();
166  }
167  void SetMomentum(TVector3 &mom)
168  {
169  fXmomentum = mom.X();
170  fYmomentum = mom.Y();
171  fZmomentum = mom.Z();
172  }
173  void SetEnergy(Double_t en) { fEnergy = (Float_t)en; }
174  void SetLorentzVector(TLorentzVector &p4);
175 
176  void SetFirstHit(TVector3 &pos)
177  {
178  fFirstHitX = pos.X();
179  fFirstHitY = pos.Y();
180  fFirstHitZ = pos.Z();
181  }
182  void SetLastHit(TVector3 &pos)
183  {
184  fLastHitX = pos.X();
185  fLastHitY = pos.Y();
186  fLastHitZ = pos.Z();
187  }
188 
189  void SetCov7(const TMatrixD &cov7);
190  void SetP4Cov(const TMatrixD &covP4);
191  void SetMcIndex(int idx) { fMcIndex = idx; }
192  void SetTrackIndex(int idx) { fTrackIndex = idx; }
193  void SetTrackBranch(int idx) { fTrackBranch = idx; }
195 
196  void SetHelixParams(Double_t *par)
197  {
198  if (par != 0)
199  for (int i = 0; i < 5; i++)
200  fParams[i] = (Float_t)par[i];
201  }
202  void SetHelixCov(Double_t *cov)
203  {
204  if (cov != 0)
205  for (int i = 0; i < 15; i++)
206  fCov[i] = (Float_t)cov[i];
207  }
208 
209  // ************************
210  // detector specific stuff
211  // ************************
212 
213  // MVD
214  void SetMvdDEDX(Double_t val) { fMvdDEDX = (Float_t)val; }
215  void SetMvdHits(Int_t val) { fMvdHits = val; }
216  // void SetMvdHitIndexArray(Int_t n, Int_t* arr) { fMvdHits=n; fMvdHitIndexArray.Set(n,arr);}
217 
218  // STT
219  void SetSttMeanDEDX(Double_t val) { fSttMeanDEDX = (Float_t)val; }
220  void SetSttHits(Int_t val) { fSttHits = val; }
221  // void SetSttHitIndexArray(Int_t n, Int_t* arr) { fSttHits=n; fSttHitIndexArray.Set(n,arr);}
222 
223  void SetGemHits(Int_t val) { fGemHits = val; }
224  // TOF
225  void SetTofStopTime(Double_t val) { fTofStopTime = (Float_t)val; }
226  void SetTofM2(Double_t val) { fTofM2 = (Float_t)val; }
227  void SetTofTrackLength(Double_t val) { fTofTrackLength = val; }
228  void SetTofQuality(Double_t val) { fTofQuality = val; }
229  void SetTofIndex(Int_t val) { fTofIndex = val; }
230 
231  // Barrel DIRC
232  void SetDrcThetaC(Double_t val) { fDrcThetaC = (Float_t)val; }
233  void SetDrcThetaCErr(Double_t val) { fDrcThetaCErr = (Float_t)val; }
234  void SetDrcQuality(Double_t val) { fDrcQuality = (Float_t)val; }
235  void SetDrcNumberOfPhotons(Int_t val) { fDrcNumberOfPhotons = val; }
236  void SetDrcIndex(Int_t val) { fDrcIndex = val; }
237 
238  // Disc DIRC
239  void SetDiscThetaC(Double_t val) { fDiscThetaC = (Float_t)val; }
240  void SetDiscThetaCErr(Double_t val) { fDiscThetaCErr = (Float_t)val; }
241  void SetDiscQuality(Double_t val) { fDiscQuality = (Float_t)val; }
242  void SetDiscNumberOfPhotons(Int_t val) { fDiscNumberOfPhotons = val; }
243  void SetDiscIndex(Int_t val) { fDiscIndex = val; }
244 
245  // RICH
246  void SetRichThetaC(Double_t val) { fRichThetaC = (Float_t)val; }
247  void SetRichThetaCErr(Double_t val) { fRichThetaCErr = (Float_t)val; }
248  void SetRichQuality(Double_t val) { fRichQuality = (Float_t)val; }
249  void SetRichNumberOfPhotons(Int_t val) { fRichNumberOfPhotons = val; }
250  void SetRichIndex(Int_t val) { fRichIndex = val; }
251 
252  // EMC
253  void SetEmcRawEnergy(Double_t val) { fEmcRawEnergy = (Float_t)val; }
254  void SetEmcCalEnergy(Double_t val) { fEmcCalEnergy = (Float_t)val; }
255  void SetEmcQuality(Double_t val) { fEmcQuality = (Float_t)val; }
256  void SetEmcNumberOfCrystals(Int_t val) { fEmcNumberOfCrystals = val; }
257  void SetEmcNumberOfBumps(Int_t val) { fEmcNumberOfBumps = val; }
258  void SetEmcModule(Int_t val) { fEmcModule = val; }
259  void SetEmcIndex(Int_t val) { fEmcIndex = val; }
260 
261  void SetEmcClusterZ20(Double_t val) { fEmcZ20 = val; }
262  void SetEmcClusterZ53(Double_t val) { fEmcZ53 = val; }
263  void SetEmcClusterLat(Double_t val) { fEmcLat = val; }
264  void SetEmcClusterE1(Double_t val) { fEmcE1 = val; }
265  void SetEmcClusterE9(Double_t val) { fEmcE9 = val; }
266  void SetEmcClusterE25(Double_t val) { fEmcE25 = val; }
267 
268  void SetEmcTimeStamp(Double_t val) { fEmcTimeStamp = val; }
269 
270  // MUO
271  void SetMuoNumberOfLayers(Int_t val) { fMuoNumberOfLayers = val; }
272  void SetMuoProbability(Double_t val) { fMuoProbability = (Float_t)val; }
273  void SetMuoQuality(Double_t val) { fMuoQuality = (Float_t)val; }
274  void SetMuoIron(Double_t val) { fMuoIron = (Float_t)val; }
275  void SetMuoMomentumIn(Double_t val) { fMuoMomentumIn = (Float_t)val; }
276  void SetMuoModule(Int_t val) { fMuoModule = val; }
277  void SetMuoHits(Int_t val) { fMuoHits = val; }
278  void SetMuoIndex(Int_t val) { fMuoIndex = val; }
279 
280  // Tracking
281  void SetDegreesOfFreedom(Int_t val) { fDegreesOfFreedom = val; }
282  void SetFitStatus(Int_t val) { fFitStatus = val; }
283  void SetChiSquared(Double_t val) { fChiSquared = (Float_t)val; }
284  void SetPidHypo(int hyp) { fPidHyp = hyp; }
285  void SetDefault();
286  void PrintOn(std::ostream &o) const;
287 
288  protected:
289  // Candidate lock
290  Bool_t fLocked;
291 
292  // the basic params
293  Char_t fCharge; // The electrical charge
294  Float_t fXposition, // The origin in x
295  fYposition, // The origin in y
296  fZposition; // The origin in z
297  Double_t fXmomentum, // The momentum in x
298  fYmomentum, // The momentum in y
299  fZmomentum, // The momentum in z
300  fEnergy; // The total energy
301 
303 
305 
306  Int_t fMcIndex; // MC truth index
307  Int_t fTrackIndex; // PndTrack index
308  Int_t fTrackBranch; // index of PndTrack TClonesArray
309  PndTrack::TrackType fTrackType = PndTrack::TrackType::kUndefined; // type of PndTrack (forward, barrel, combined)
310  Float_t fErrP7[28]; // The symmetric 7*7 error matrix
311  Float_t fParams[5]; // The helix fit parameters
312  Float_t fCov[15]; // The helix error matrix
313 
314  // detector quantities
315  // MVD
316  Float_t fMvdDEDX;
317  Int_t fMvdHits;
318  // TArrayI fMvdHitIndexArray;
319 
320  // STT
321  Float_t fSttMeanDEDX;
322  Int_t fSttHits;
323  // TArrayI fSttHitIndexArray;
324 
325  // GEM
326  Int_t fGemHits;
327 
328  // TOF
329  Float_t fTofStopTime;
330  Float_t fTofM2;
332  Float_t fTofQuality;
333  Int_t fTofIndex;
334 
335  // Barrel DIRC
336  Float_t fDrcThetaC;
337  Float_t fDrcThetaCErr;
338  Float_t fDrcQuality;
340  Int_t fDrcIndex;
341 
342  // Disc DIRC
343  Float_t fDiscThetaC;
344  Float_t fDiscThetaCErr;
345  Float_t fDiscQuality;
347  Int_t fDiscIndex;
348 
349  // RICH
350  Float_t fRichThetaC;
351  Float_t fRichThetaCErr;
352  Float_t fRichQuality;
354  Int_t fRichIndex;
355 
356  // EMC
357  Float_t fEmcRawEnergy;
358  Float_t fEmcCalEnergy;
359  Float_t fEmcQuality;
360  Float_t fEmcTimeStamp;
363  Int_t fEmcModule;
364  Int_t fEmcIndex;
365  Double_t fEmcZ20;
366  Double_t fEmcZ53;
367  Double_t fEmcLat;
368  Double_t fEmcE1;
369  Double_t fEmcE9;
370  Double_t fEmcE25;
371 
372  // MUO
375  Float_t fMuoQuality;
376  Float_t fMuoIron;
377  Float_t fMuoMomentumIn;
378  Int_t fMuoModule;
379  Int_t fMuoHits;
380  Int_t fMuoIndex;
381 
382  // Tracking
384  Int_t fFitStatus;
385  Float_t fChiSquared;
386  Int_t fPidHyp;
387 
388  ClassDef(PndPidCandidate, 6) // Abstract base class for MicroDST candidates
389 };
390 
391 std::ostream &operator<<(std::ostream &o, const PndPidCandidate &);
392 
393 #endif
const Float_t * GetParams() const
Float_t GetMuoProbability() const
void SetRichQuality(Double_t val)
void SetMomentum(TVector3 &mom)
void SetTrackIndex(int idx)
Float_t GetMvdDEDX() const
TMatrixD & P4Cov() const
Int_t GetMuoHits() const
void SetEmcNumberOfCrystals(Int_t val)
void SetGemHits(Int_t val)
void SetP4Cov(const TMatrixD &covP4)
Int_t GetEmcNumberOfBumps() const
Int_t GetRichNumberOfPhotons() const
Double_t GetEmcClusterE9() const
void SetTofStopTime(Double_t val)
Int_t GetMcIndex() const
PndTrack::TrackType fTrackType
Int_t GetDegreesOfFreedom() const
Int_t GetTofIndex() const
void SetEmcNumberOfBumps(Int_t val)
void SetEmcModule(Int_t val)
void PrintOn(std::ostream &o) const
void SetMuoProbability(Double_t val)
Double_t GetEnergy() const
Float_t GetTofQuality() const
const Float_t * GetCov() const
TVector3 GetLastHit() const
Float_t GetEmcCalEnergy() const
Int_t GetPidHypo() const
void SetEmcClusterE1(Double_t val)
void SetPosition(TVector3 &pos)
void SetEmcCalEnergy(Double_t val)
void SetCov7(const TMatrixD &cov7)
Float_t fErrP7[28]
void SetMcIndex(int idx)
Float_t GetDrcThetaCErr() const
Double_t GetEmcClusterLat() const
void SetDiscQuality(Double_t val)
void SetEmcQuality(Double_t val)
void SetHelixCov(Double_t *cov)
void SetTofM2(Double_t val)
void SetMvdHits(Int_t val)
Double_t GetEmcClusterE25() const
void SetDiscThetaC(Double_t val)
void SetMuoNumberOfLayers(Int_t val)
Float_t GetRichQuality() const
Double_t GetEmcClusterZ20() const
Float_t GetTofBeta() const
void SetFirstHit(TVector3 &pos)
Int_t GetEmcNumberOfCrystals() const
unsigned int i
Definition: P4_F32vec4.h:21
TVector3 GetMomentum() const
Float_t GetEmcRawEnergy() const
Float_t GetDiscThetaCErr() const
TLorentzVector GetLorentzVector() const
Int_t GetEmcIndex() const
Float_t fParams[5]
void SetTofTrackLength(Double_t val)
Int_t GetDrcIndex() const
Int_t GetMuoNumberOfLayers() const
Float_t GetDrcThetaC() const
void SetTrackBranch(int idx)
Float_t GetChiSquared() const
Int_t GetTrackBranch() const
void SetRichIndex(Int_t val)
void SetEnergy(Double_t en)
void SetDrcThetaCErr(Double_t val)
Float_t GetEmcQuality() const
void SetMuoQuality(Double_t val)
void SetHelixParams(Double_t *par)
Int_t GetGemHits() const
std::ostream & operator<<(std::ostream &o, const PndPidCandidate &)
Float_t GetMuoMomentumIn() const
Int_t GetSttHits() const
void SetMuoIron(Double_t val)
void SetEmcClusterE9(Double_t val)
void SetEmcIndex(Int_t val)
Float_t fEmcTimeStamp
TimeStamp at the cluster or bump position no track length correction done at this stage...
Float_t GetMuoQuality() const
Float_t GetTofStopTime() const
void SetDrcNumberOfPhotons(Int_t val)
void SetRichNumberOfPhotons(Int_t val)
void SetLorentzVector(TLorentzVector &p4)
void SetChiSquared(Double_t val)
Float_t GetEmcTimeStamp() const
const Float_t * GetErrorP7() const
Float_t GetTofTrackLength() const
void SetDiscIndex(Int_t val)
Int_t GetDiscIndex() const
void SetEmcClusterE25(Double_t val)
TVector3 GetPosition() const
void SetDrcQuality(Double_t val)
void SetMuoMomentumIn(Double_t val)
void SetCharge(Int_t charge)
void SetDrcIndex(Int_t val)
void SetSttMeanDEDX(Double_t val)
void SetFitStatus(Int_t val)
void SetEmcClusterLat(Double_t val)
Int_t GetMuoModule() const
TVector3 GetFirstHit() const
Float_t GetSttMeanDEDX() const
Int_t GetCharge() const
Float_t GetTofM2() const
void SetTofQuality(Double_t val)
Float_t GetRichThetaCErr() const
Double_t GetEmcClusterE1() const
void SetRichThetaC(Double_t val)
void SetDrcThetaC(Double_t val)
void SetDiscNumberOfPhotons(Int_t val)
Int_t GetDiscNumberOfPhotons() const
void SetMuoModule(Int_t val)
void SetEmcTimeStamp(Double_t val)
Float_t GetDrcQuality() const
Int_t GetMuoIndex() const
void SetLastHit(TVector3 &pos)
Int_t GetFitStatus() const
void SetTofIndex(Int_t val)
void SetEmcClusterZ20(Double_t val)
Float_t GetRichThetaC() const
PndTrack::TrackType GetTrackType() const
Float_t fCov[15]
void SetTrackType(PndTrack::TrackType type)
Double_t GetEmcClusterZ53() const
void SetPidHypo(int hyp)
void SetEmcClusterZ53(Double_t val)
void SetDegreesOfFreedom(Int_t val)
Float_t GetMuoIron() const
void SetDiscThetaCErr(Double_t val)
TMatrixD & Cov7() const
void SetMuoIndex(Int_t val)
Int_t GetMvdHits() const
Int_t GetDrcNumberOfPhotons() const
void SetEmcRawEnergy(Double_t val)
Int_t GetEmcModule() const
Float_t GetDiscThetaC() const
Int_t GetRichIndex() const
TMatrixT< double > TMatrixD
Definition: PndLmdDim.h:52
void SetMvdDEDX(Double_t val)
void SetSttHits(Int_t val)
void SetRichThetaCErr(Double_t val)
Int_t GetTrackIndex() const
Float_t GetDiscQuality() const
void SetMuoHits(Int_t val)