CbmRoot
CbmLitAcceptanceFunction.h
Go to the documentation of this file.
1 
8 #ifndef CBMLITACCEPTANCEFUNCTION_H_
9 #define CBMLITACCEPTANCEFUNCTION_H_
10 
11 #include "CbmGlobalTrack.h"
12 #include "CbmMCDataArray.h"
13 #include "CbmMCTrack.h"
14 #include "CbmTrackMatchNew.h"
15 #include "TClonesArray.h"
16 #include "TDatabasePDG.h"
17 #include "TMCProcess.h"
18 #include "TMath.h"
19 //#include <cmath>
20 //using std::abs;
21 
22 
24 public:
26  Int_t eventNo,
27  Int_t index) {
28  return true;
29  }
30 
32  Int_t eventNo,
33  Int_t index) {
34  if (index < 0) return false;
35  const CbmMCTrack* mcTrack =
36  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
37  const TParticlePDG* particle =
38  TDatabasePDG::Instance()->GetParticle(mcTrack->GetPdgCode());
39  if (particle == NULL) return false;
40  return particle->Charge() < 0;
41  }
42 
44  Int_t eventNo,
45  Int_t index) {
46  if (index < 0) return false;
47  const CbmMCTrack* mcTrack =
48  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
49  const TParticlePDG* particle =
50  TDatabasePDG::Instance()->GetParticle(mcTrack->GetPdgCode());
51  if (particle == NULL) return false;
52  return particle->Charge() > 0;
53  }
54 
56  Int_t eventNo,
57  Int_t index) {
58  if (index < 0) return false;
59  const CbmMCTrack* mcTrack =
60  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
61  return (mcTrack->GetMotherId() == -1);
62  //return (mcTrack->GetGeantProcessId() == kPPrimary);
63  }
64 
66  Int_t eventNo,
67  Int_t index) {
68  if (index < 0) return false;
69  const CbmMCTrack* mcTrack =
70  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
71  return (mcTrack->GetMotherId() == -1) && (mcTrack->GetP() > 1.);
72  }
73 
75  Int_t eventNo,
76  Int_t index) {
77  if (index < 0) return false;
78  const CbmMCTrack* mcTrack =
79  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
80  return (mcTrack->GetMotherId() != -1);
81  }
82 
84  Int_t eventNo,
85  Int_t index) {
86  if (index < 0) return false;
87  const CbmMCTrack* mcTrack =
88  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
89  //return (TMath::Abs(mcTrack->GetPdgCode()) == 11) && (mcTrack->GetMotherId() == -1);
90  return (TMath::Abs(mcTrack->GetPdgCode()) == 11)
91  && (mcTrack->GetGeantProcessId() == kPPrimary);
92  }
93 
95  Int_t eventNo,
96  Int_t index) {
97  if (index < 0) return false;
98  const CbmMCTrack* mcTrack =
99  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
100  //return (TMath::Abs(mcTrack->GetPdgCode()) == 13) && (mcTrack->GetMotherId() == -1);
101  return (TMath::Abs(mcTrack->GetPdgCode()) == 13)
102  && (mcTrack->GetGeantProcessId() == kPPrimary);
103  }
104 
106  Int_t eventNo,
107  Int_t index) {
108  if (index < 0) return false;
109  const CbmMCTrack* mcTrack =
110  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
111  return TMath::Abs(mcTrack->GetPdgCode()) == 11;
112  }
113 
115  Int_t eventNo,
116  Int_t index) {
117  if (index < 0) return false;
118  const CbmMCTrack* mcTrack =
119  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
120  return TMath::Abs(mcTrack->GetPdgCode()) == 13;
121  }
122 
124  Int_t eventNo,
125  Int_t index) {
126  if (index < 0) return false;
127  const CbmMCTrack* mcTrack =
128  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
129  return (TMath::Abs(mcTrack->GetPdgCode()) == 2212);
130  }
131 
133  Int_t eventNo,
134  Int_t index) {
135  if (index < 0) return false;
136  const CbmMCTrack* mcTrack =
137  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
138  return mcTrack->GetPdgCode() == -2212;
139  }
140 
142  Int_t eventNo,
143  Int_t index) {
144  if (index < 0) return false;
145  const CbmMCTrack* mcTrack =
146  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
147  return (TMath::Abs(mcTrack->GetPdgCode()) == 211);
148  }
149 
151  Int_t eventNo,
152  Int_t index) {
153  if (index < 0) return false;
154  const CbmMCTrack* mcTrack =
155  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
156  return (mcTrack->GetPdgCode() == 211);
157  }
158 
160  Int_t eventNo,
161  Int_t index) {
162  if (index < 0) return false;
163  const CbmMCTrack* mcTrack =
164  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
165  return (mcTrack->GetPdgCode() == -211);
166  }
167 
169  Int_t eventNo,
170  Int_t index) {
171  if (index < 0) return false;
172  const CbmMCTrack* mcTrack =
173  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
174  return (TMath::Abs(mcTrack->GetPdgCode()) == 321);
175  }
176 
178  Int_t eventNo,
179  Int_t index) {
180  if (index < 0) return false;
181  const CbmMCTrack* mcTrack =
182  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
183  return (mcTrack->GetPdgCode() == 321);
184  }
185 
187  Int_t eventNo,
188  Int_t index) {
189  if (index < 0) return false;
190  const CbmMCTrack* mcTrack =
191  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
192  return (mcTrack->GetPdgCode() == -321);
193  }
194 
196  Int_t eventNo,
197  Int_t index,
198  Int_t nofHitsInRing) {
199  return true;
200  }
201 
203  Int_t eventNo,
204  Int_t index,
205  Int_t nofHitsInRing) {
206  if (index < 0) return false;
207  const CbmMCTrack* mcTrack =
208  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
209  return (mcTrack->GetMotherId() == -1) && (nofHitsInRing >= 15);
210  }
211 
213  Int_t eventNo,
214  Int_t index,
215  Int_t nofHitsInRing) {
216  if (index < 0) return false;
217  const CbmMCTrack* mcTrack =
218  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
219  //return (mcTrack->GetMotherId() == -1) && (TMath::Abs(mcTrack->GetPdgCode()) == 11);
220  return (mcTrack->GetGeantProcessId() == kPPrimary)
221  && (TMath::Abs(mcTrack->GetPdgCode()) == 11);
222  }
223 
224  static Bool_t
226  Int_t eventNo,
227  Int_t index,
228  Int_t nofHitsInRing) {
229  if (index < 0) return false;
230  const CbmMCTrack* mcTrack =
231  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
232  // return (mcTrack->GetMotherId() == -1) && (TMath::Abs(mcTrack->GetPdgCode()) == 11) && (nofHitsInRing >= 15);
233  return (mcTrack->GetGeantProcessId() == kPPrimary)
234  && (TMath::Abs(mcTrack->GetPdgCode()) == 11)
235  && (nofHitsInRing >= 15);
236  }
237 
239  Int_t eventNo,
240  Int_t index,
241  Int_t nofHitsInRing) {
242  if (index < 0) return false;
243  const CbmMCTrack* mcTrack =
244  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
245  return (TMath::Abs(mcTrack->GetPdgCode()) == 211);
246  }
247 
249  Int_t eventNo,
250  Int_t index,
251  Int_t nofHitsInRing) {
252  if (index < 0) return false;
253  const CbmMCTrack* mcTrack =
254  static_cast<const CbmMCTrack*>(mcTracks->Get(0, eventNo, index));
255  return (TMath::Abs(mcTrack->GetPdgCode()) == 211) && (nofHitsInRing >= 15);
256  }
257 
258  static Bool_t AllPiSuppAcceptanceFunction(const TClonesArray* globalTracks,
259  const TClonesArray* stsMatches,
260  const TClonesArray* richMatches,
261  Int_t index) {
262  return true;
263  }
264 
265  static Bool_t
266  TrueMatchPiSuppAcceptanceFunction(const TClonesArray* globalTracks,
267  const TClonesArray* stsMatches,
268  const TClonesArray* richMatches,
269  Int_t index) {
270  const CbmGlobalTrack* gTrack =
271  static_cast<const CbmGlobalTrack*>(globalTracks->At(index));
272  Int_t stsInd = gTrack->GetStsTrackIndex();
273  Int_t richInd = gTrack->GetRichRingIndex();
274  if (stsInd == -1 || richInd == -1) return false;
275  const CbmTrackMatchNew* stsMatch =
276  static_cast<const CbmTrackMatchNew*>(stsMatches->At(stsInd));
277  const CbmTrackMatchNew* richMatch =
278  static_cast<const CbmTrackMatchNew*>(richMatches->At(richInd));
279  if (NULL == stsMatch || NULL == richMatch) return false;
280 
281  if (stsMatch->GetMatchedLink().GetIndex()
282  == richMatch->GetMatchedLink().GetIndex())
283  return true;
284  return false;
285  }
286 
287  static Bool_t
288  WrongMatchPiSuppAcceptanceFunction(const TClonesArray* globalTracks,
289  const TClonesArray* stsMatches,
290  const TClonesArray* richMatches,
291  Int_t index) {
293  globalTracks, stsMatches, richMatches, index);
294  }
295 };
296 
297 #endif /* CBMLITACCEPTANCEFUNCTION_H_ */
CbmMCTrack::GetMotherId
Int_t GetMotherId() const
Definition: CbmMCTrack.h:71
CbmMatch::GetMatchedLink
const CbmLink & GetMatchedLink() const
Definition: CbmMatch.h:37
CbmLitAcceptanceFunction::NegativeTrackAcceptanceFunction
static Bool_t NegativeTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:31
CbmLitAcceptanceFunction::KaonPlusTrackAcceptanceFunction
static Bool_t KaonPlusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:177
CbmGlobalTrack::GetRichRingIndex
Int_t GetRichRingIndex() const
Definition: CbmGlobalTrack.h:41
CbmLitAcceptanceFunction::AllTrackAcceptanceFunction
static Bool_t AllTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:25
CbmMCTrack::GetPdgCode
Int_t GetPdgCode() const
Definition: CbmMCTrack.h:70
CbmLitAcceptanceFunction::PionTrackAcceptanceFunction
static Bool_t PionTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:141
CbmLitAcceptanceFunction
Definition: CbmLitAcceptanceFunction.h:23
CbmMCDataArray.h
CbmLitAcceptanceFunction::PrimaryElectronReferenceRingAcceptanceFunction
static Bool_t PrimaryElectronReferenceRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:225
CbmGlobalTrack.h
CbmMCDataArray
Access to a MC data branch for time-based analysis.
Definition: CbmMCDataArray.h:35
CbmLitAcceptanceFunction::PrimaryElectronRingAcceptanceFunction
static Bool_t PrimaryElectronRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:212
CbmLitAcceptanceFunction::AllPiSuppAcceptanceFunction
static Bool_t AllPiSuppAcceptanceFunction(const TClonesArray *globalTracks, const TClonesArray *stsMatches, const TClonesArray *richMatches, Int_t index)
Definition: CbmLitAcceptanceFunction.h:258
CbmLitAcceptanceFunction::PrimaryTrackAcceptanceFunction
static Bool_t PrimaryTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:55
CbmLitAcceptanceFunction::ProtonTrackAcceptanceFunction
static Bool_t ProtonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:123
CbmLitAcceptanceFunction::KaonTrackAcceptanceFunction
static Bool_t KaonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:168
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
CbmLitAcceptanceFunction::PionReferenceRingAcceptanceFunction
static Bool_t PionReferenceRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:248
mcTracks
static vector< vector< QAMCTrack > > mcTracks
Definition: CbmTofHitFinderTBQA.cxx:112
CbmLitAcceptanceFunction::PionRingAcceptanceFunction
static Bool_t PionRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:238
CbmTrackMatchNew.h
CbmLitAcceptanceFunction::AntiProtonTrackAcceptanceFunction
static Bool_t AntiProtonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:132
CbmLitAcceptanceFunction::TrueMatchPiSuppAcceptanceFunction
static Bool_t TrueMatchPiSuppAcceptanceFunction(const TClonesArray *globalTracks, const TClonesArray *stsMatches, const TClonesArray *richMatches, Int_t index)
Definition: CbmLitAcceptanceFunction.h:266
CbmMCTrack::GetGeantProcessId
UInt_t GetGeantProcessId() const
Definition: CbmMCTrack.h:69
CbmLitAcceptanceFunction::PrimaryElectronTrackAcceptanceFunction
static Bool_t PrimaryElectronTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:83
CbmLitAcceptanceFunction::MuonTrackAcceptanceFunction
static Bool_t MuonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:114
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmLitAcceptanceFunction::PositiveTrackAcceptanceFunction
static Bool_t PositiveTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:43
CbmMCTrack.h
CbmLitAcceptanceFunction::AllReferenceRingAcceptanceFunction
static Bool_t AllReferenceRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:202
CbmMCTrack
Definition: CbmMCTrack.h:34
CbmLitAcceptanceFunction::PionMinusTrackAcceptanceFunction
static Bool_t PionMinusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:159
CbmLitAcceptanceFunction::SecondaryTrackAcceptanceFunction
static Bool_t SecondaryTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:74
CbmLitAcceptanceFunction::KaonMinusTrackAcceptanceFunction
static Bool_t KaonMinusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:186
CbmLitAcceptanceFunction::PionPlusTrackAcceptanceFunction
static Bool_t PionPlusTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:150
CbmTrackMatchNew
Definition: CbmTrackMatchNew.h:19
CbmLitAcceptanceFunction::AllRingAcceptanceFunction
static Bool_t AllRingAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index, Int_t nofHitsInRing)
Definition: CbmLitAcceptanceFunction.h:195
CbmLitAcceptanceFunction::ElectronTrackAcceptanceFunction
static Bool_t ElectronTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:105
CbmLitAcceptanceFunction::WrongMatchPiSuppAcceptanceFunction
static Bool_t WrongMatchPiSuppAcceptanceFunction(const TClonesArray *globalTracks, const TClonesArray *stsMatches, const TClonesArray *richMatches, Int_t index)
Definition: CbmLitAcceptanceFunction.h:288
CbmLitAcceptanceFunction::PrimaryMuonTrackAcceptanceFunction
static Bool_t PrimaryMuonTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:94
CbmMCTrack::GetP
Double_t GetP() const
Definition: CbmMCTrack.h:100
CbmLitAcceptanceFunction::ReferenceTrackAcceptanceFunction
static Bool_t ReferenceTrackAcceptanceFunction(CbmMCDataArray *mcTracks, Int_t eventNo, Int_t index)
Definition: CbmLitAcceptanceFunction.h:65