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