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