]>
Commit | Line | Data |
---|---|---|
563113d0 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | //////////////////////////////////////////////////////////////////////////// | |
17 | // ---- CORRECTION FRAMEWORK ---- | |
18 | // class AliCFParticleGenCuts implementation | |
19 | // Using this class a user may define selections relative to | |
20 | // MC particle (AliMCParticle) using generation-level information. | |
21 | //////////////////////////////////////////////////////////////////////////// | |
22 | // author : R. Vernet (renaud.vernet@cern.ch) | |
23 | //////////////////////////////////////////////////////////////////////////// | |
24 | ||
25 | #include "AliLog.h" | |
26 | #include "AliCFParticleGenCuts.h" | |
27 | #include "TParticle.h" | |
28 | #include "TParticlePDG.h" | |
563113d0 | 29 | #include "AliMCEvent.h" |
30 | #include "TObject.h" | |
31 | #include "AliStack.h" | |
107a3100 | 32 | #include "TH1F.h" |
33 | #include "TH2F.h" | |
34 | #include "TBits.h" | |
35 | #include "TList.h" | |
c7803356 | 36 | #include "TArrayF.h" |
563113d0 | 37 | |
38 | ClassImp(AliCFParticleGenCuts) | |
39 | ||
40 | //______________________________ | |
41 | AliCFParticleGenCuts::AliCFParticleGenCuts() : | |
42 | AliCFCutBase(), | |
43 | fMCInfo(0x0), | |
44 | fRequireIsCharged(0), | |
107a3100 | 45 | fRequireIsNeutral(0), |
563113d0 | 46 | fRequireIsPrimary(0), |
47 | fRequireIsSecondary(0), | |
48 | fRequirePdgCode(0), | |
49 | fPdgCode(0), | |
50 | fProdVtxXMin (-1.e+09), | |
51 | fProdVtxYMin (-1.e+09), | |
52 | fProdVtxZMin (-1.e+09), | |
53 | fProdVtxXMax ( 1.e+09), | |
54 | fProdVtxYMax ( 1.e+09), | |
55 | fProdVtxZMax ( 1.e+09), | |
56 | fDecayVtxXMin(-1.e+09), | |
57 | fDecayVtxYMin(-1.e+09), | |
58 | fDecayVtxZMin(-1.e+09), | |
59 | fDecayVtxXMax( 1.e+09), | |
60 | fDecayVtxYMax( 1.e+09), | |
61 | fDecayVtxZMax( 1.e+09), | |
107a3100 | 62 | fDecayLengthMin(-1.), |
563113d0 | 63 | fDecayLengthMax(1.e+09), |
107a3100 | 64 | fDecayRxyMin(-1), |
65 | fDecayRxyMax(1.e+09), | |
66 | fhCutStatistics(0x0), | |
67 | fhCutCorrelation(0x0), | |
c7803356 | 68 | fCutValues(new TArrayF(kNCuts)), |
107a3100 | 69 | fBitmap(new TBits(0)) |
563113d0 | 70 | { |
71 | // | |
72 | //ctor | |
73 | // | |
107a3100 | 74 | for (int i=0; i<kNCuts; i++) |
75 | for (int j=0; j<kNStepQA; j++) | |
76 | fhQA[i][j]=0x0; | |
563113d0 | 77 | } |
78 | ||
79 | //______________________________ | |
80 | AliCFParticleGenCuts::AliCFParticleGenCuts(const Char_t* name, const Char_t* title) : | |
81 | AliCFCutBase(name,title), | |
82 | fMCInfo(0x0), | |
83 | fRequireIsCharged(0), | |
107a3100 | 84 | fRequireIsNeutral(0), |
563113d0 | 85 | fRequireIsPrimary(0), |
86 | fRequireIsSecondary(0), | |
87 | fRequirePdgCode(0), | |
88 | fPdgCode(0), | |
89 | fProdVtxXMin (-1.e+09), | |
90 | fProdVtxYMin (-1.e+09), | |
91 | fProdVtxZMin (-1.e+09), | |
92 | fProdVtxXMax ( 1.e+09), | |
93 | fProdVtxYMax ( 1.e+09), | |
94 | fProdVtxZMax ( 1.e+09), | |
95 | fDecayVtxXMin(-1.e+09), | |
96 | fDecayVtxYMin(-1.e+09), | |
97 | fDecayVtxZMin(-1.e+09), | |
98 | fDecayVtxXMax( 1.e+09), | |
99 | fDecayVtxYMax( 1.e+09), | |
100 | fDecayVtxZMax( 1.e+09), | |
107a3100 | 101 | fDecayLengthMin(-1.), |
563113d0 | 102 | fDecayLengthMax(1.e+09), |
107a3100 | 103 | fDecayRxyMin(-1.), |
104 | fDecayRxyMax(1.e+09), | |
105 | fhCutStatistics(0x0), | |
106 | fhCutCorrelation(0x0), | |
c7803356 | 107 | fCutValues(new TArrayF(kNCuts)), |
107a3100 | 108 | fBitmap(new TBits(0)) |
563113d0 | 109 | { |
110 | // | |
111 | //ctor | |
112 | // | |
107a3100 | 113 | for (int i=0; i<kNCuts; i++) |
114 | for (int j=0; j<kNStepQA; j++) | |
115 | fhQA[i][j]=0x0; | |
563113d0 | 116 | } |
117 | ||
118 | //______________________________ | |
119 | AliCFParticleGenCuts::AliCFParticleGenCuts(const AliCFParticleGenCuts& c) : | |
120 | AliCFCutBase(c), | |
121 | fMCInfo(c.fMCInfo), | |
122 | fRequireIsCharged(c.fRequireIsCharged), | |
107a3100 | 123 | fRequireIsNeutral(c.fRequireIsNeutral), |
563113d0 | 124 | fRequireIsPrimary(c.fRequireIsPrimary), |
125 | fRequireIsSecondary(c.fRequireIsSecondary), | |
126 | fRequirePdgCode(c.fRequirePdgCode), | |
127 | fPdgCode(c.fPdgCode), | |
128 | fProdVtxXMin (c.fProdVtxXMin), | |
129 | fProdVtxYMin (c.fProdVtxYMin), | |
130 | fProdVtxZMin (c.fProdVtxZMin), | |
131 | fProdVtxXMax (c.fProdVtxXMax), | |
132 | fProdVtxYMax (c.fProdVtxYMax), | |
133 | fProdVtxZMax (c.fProdVtxZMax), | |
134 | fDecayVtxXMin(c.fDecayVtxXMin), | |
135 | fDecayVtxYMin(c.fDecayVtxYMin), | |
136 | fDecayVtxZMin(c.fDecayVtxZMin), | |
137 | fDecayVtxXMax(c.fDecayVtxXMax), | |
138 | fDecayVtxYMax(c.fDecayVtxYMax), | |
139 | fDecayVtxZMax(c.fDecayVtxZMax), | |
140 | fDecayLengthMin(c.fDecayLengthMin), | |
141 | fDecayLengthMax(c.fDecayLengthMin), | |
142 | fDecayRxyMin(c.fDecayLengthMin), | |
107a3100 | 143 | fDecayRxyMax(c.fDecayLengthMin), |
144 | fhCutStatistics(new TH1F(*c.fhCutStatistics)), | |
145 | fhCutCorrelation(new TH2F(*c.fhCutCorrelation)), | |
c7803356 | 146 | fCutValues(new TArrayF(*c.fCutValues)), |
107a3100 | 147 | fBitmap(new TBits(*c.fBitmap)) |
563113d0 | 148 | { |
149 | // | |
150 | //copy ctor | |
151 | // | |
107a3100 | 152 | for (int i=0; i<kNCuts; i++) |
153 | for (int j=0; j<kNStepQA; j++) | |
154 | fhQA[i][j]=(TH1F*)c.fhQA[i][j]->Clone(); | |
563113d0 | 155 | } |
156 | ||
157 | //______________________________ | |
158 | AliCFParticleGenCuts& AliCFParticleGenCuts::operator=(const AliCFParticleGenCuts& c) | |
159 | { | |
160 | // | |
161 | // Assignment operator | |
162 | // | |
163 | if (this != &c) { | |
164 | AliCFCutBase::operator=(c) ; | |
165 | fMCInfo=c.fMCInfo; | |
166 | fRequireIsCharged=c.fRequireIsCharged; | |
107a3100 | 167 | fRequireIsNeutral=c.fRequireIsNeutral; |
563113d0 | 168 | fRequireIsPrimary=c.fRequireIsPrimary; |
169 | fRequireIsSecondary=c.fRequireIsSecondary; | |
170 | fRequirePdgCode=c.fRequirePdgCode; | |
171 | fPdgCode=c.fPdgCode; | |
172 | fProdVtxXMin=c.fProdVtxXMin; | |
173 | fProdVtxYMin=c.fProdVtxYMin; | |
174 | fProdVtxZMin=c.fProdVtxZMin; | |
175 | fProdVtxXMax=c.fProdVtxXMax; | |
176 | fProdVtxYMax=c.fProdVtxYMax; | |
177 | fProdVtxZMax=c.fProdVtxZMax; | |
178 | fDecayVtxXMin=c.fDecayVtxXMin; | |
179 | fDecayVtxYMin=c.fDecayVtxYMin; | |
180 | fDecayVtxZMin=c.fDecayVtxZMin; | |
181 | fDecayVtxXMax=c.fDecayVtxXMax; | |
182 | fDecayVtxYMax=c.fDecayVtxYMax; | |
183 | fDecayVtxZMax=c.fDecayVtxZMax; | |
184 | fDecayLengthMin=c.fDecayVtxZMax; | |
185 | fDecayLengthMax=c.fDecayLengthMax; | |
186 | fDecayRxyMin=c.fDecayRxyMin; | |
187 | fDecayRxyMax=c.fDecayRxyMax; | |
c7803356 | 188 | fCutValues=new TArrayF(*c.fCutValues); |
107a3100 | 189 | fBitmap=new TBits(*c.fBitmap); |
190 | ||
191 | if (fhCutStatistics) fhCutStatistics =new TH1F(*c.fhCutStatistics) ; | |
192 | if (fhCutCorrelation) fhCutCorrelation=new TH2F(*c.fhCutCorrelation); | |
193 | ||
194 | for (int i=0; i<kNCuts; i++) | |
195 | for (int j=0; j<kNStepQA; j++) | |
196 | fhQA[i][j]=(TH1F*)c.fhQA[i][j]->Clone(); | |
563113d0 | 197 | } |
198 | return *this ; | |
199 | } | |
200 | ||
201 | //______________________________ | |
202 | Bool_t AliCFParticleGenCuts::IsSelected(TObject* obj) { | |
203 | // | |
204 | // check if selections on 'obj' are passed | |
205 | // 'obj' must be an AliMCParticle | |
206 | // | |
207 | ||
107a3100 | 208 | SelectionBitMap(obj); |
209 | ||
210 | if (fIsQAOn) FillHistograms(obj,0); | |
211 | ||
212 | for (UInt_t icut=0; icut<fBitmap->GetNbits();icut++) | |
213 | if (!fBitmap->TestBitNumber(icut)) return kFALSE ; | |
214 | ||
215 | if (fIsQAOn) FillHistograms(obj,1); | |
216 | return kTRUE; | |
217 | } | |
c7803356 | 218 | |
107a3100 | 219 | //__________________________________________________________________________________ |
220 | void AliCFParticleGenCuts::SelectionBitMap(TObject* obj) | |
221 | { | |
222 | // | |
223 | // test if the track passes the single cuts | |
224 | // and store the information in a bitmap | |
225 | // | |
c7803356 | 226 | |
227 | for (UInt_t i=0; i<kNCuts; i++) { | |
228 | fBitmap->SetBitNumber(i,kFALSE); | |
229 | fCutValues->SetAt((Double32_t)0,i) ; | |
230 | } | |
107a3100 | 231 | |
232 | if (!obj) return ; | |
563113d0 | 233 | TString className(obj->ClassName()); |
234 | if (className.CompareTo("AliMCParticle") != 0) { | |
235 | AliError("argument must point to an AliMCParticle !"); | |
107a3100 | 236 | return ; |
563113d0 | 237 | } |
c7803356 | 238 | |
239 | AliMCParticle* mcPart = dynamic_cast<AliMCParticle*>(obj) ; | |
563113d0 | 240 | TParticle* part = mcPart->Particle(); |
107a3100 | 241 | AliStack* stack = fMCInfo->Stack(); |
563113d0 | 242 | |
c7803356 | 243 | |
244 | // fill the cut array | |
107a3100 | 245 | Double32_t partVx=(Double32_t)part->Vx(); |
246 | Double32_t partVy=(Double32_t)part->Vy(); | |
247 | Double32_t partVz=(Double32_t)part->Vz(); | |
248 | ||
249 | TParticle* daughter=0x0; | |
250 | Double32_t decayVx=0.; | |
251 | Double32_t decayVy=0.; | |
252 | Double32_t decayVz=0.; | |
253 | Double32_t decayL=0.; | |
254 | Double32_t decayRxy=0.; | |
255 | ||
256 | if ( part->GetNDaughters() > 0 ) { | |
257 | daughter = stack->Particle(part->GetFirstDaughter()) ; | |
258 | decayVx=(Double32_t)daughter->Vx(); | |
259 | decayVy=(Double32_t)daughter->Vy(); | |
260 | decayVz=(Double32_t)daughter->Vz(); | |
261 | decayL = TMath::Sqrt(TMath::Power(partVx-decayVx,2) + | |
262 | TMath::Power(partVy-decayVy,2) + | |
263 | TMath::Power(partVz-decayVz,2) ) ; | |
264 | decayRxy = TMath::Sqrt(TMath::Power(decayVx,2) + TMath::Power(decayVy,2) ) ; | |
265 | } | |
266 | ||
c7803356 | 267 | fCutValues->SetAt(partVx ,kCutProdVtxXMin) ; |
268 | fCutValues->SetAt(partVy ,kCutProdVtxYMin) ; | |
269 | fCutValues->SetAt(partVz ,kCutProdVtxZMin) ; | |
270 | fCutValues->SetAt(partVx ,kCutProdVtxXMax) ; | |
271 | fCutValues->SetAt(partVy ,kCutProdVtxYMax) ; | |
272 | fCutValues->SetAt(partVz ,kCutProdVtxZMax) ; | |
273 | fCutValues->SetAt(decayVx ,kCutDecVtxXMin) ; | |
274 | fCutValues->SetAt(decayVy ,kCutDecVtxYMin) ; | |
275 | fCutValues->SetAt(decayVz ,kCutDecVtxZMin) ; | |
276 | fCutValues->SetAt(decayVx ,kCutDecVtxXMax) ; | |
277 | fCutValues->SetAt(decayVy ,kCutDecVtxYMax) ; | |
278 | fCutValues->SetAt(decayVz ,kCutDecVtxZMax) ; | |
279 | fCutValues->SetAt(decayL ,kCutDecLgthMin) ; | |
280 | fCutValues->SetAt(decayL ,kCutDecLgthMax) ; | |
281 | fCutValues->SetAt(decayRxy,kCutDecRxyMin) ; | |
282 | fCutValues->SetAt(decayRxy,kCutDecRxyMax) ; | |
283 | ||
107a3100 | 284 | // cut on charge |
285 | if ( fRequireIsCharged || fRequireIsNeutral ) { | |
c7803356 | 286 | if (fRequireIsCharged && IsCharged(mcPart)) fCutValues->SetAt((Double32_t)kTRUE,kCutCharge) ; |
287 | if (fRequireIsNeutral && !IsCharged(mcPart)) fCutValues->SetAt((Double32_t)kTRUE,kCutCharge) ; | |
563113d0 | 288 | } |
c7803356 | 289 | else fCutValues->SetAt((Double32_t)kTRUE,kCutCharge) ; |
563113d0 | 290 | |
107a3100 | 291 | // cut on primary/secondary |
292 | if ( fRequireIsPrimary || fRequireIsSecondary) { | |
c7803356 | 293 | if (fRequireIsPrimary && IsPrimary(mcPart,stack)) fCutValues->SetAt((Double32_t)kTRUE,kCutPrimSec); |
294 | if (fRequireIsSecondary && !IsPrimary(mcPart,stack)) fCutValues->SetAt((Double32_t)kTRUE,kCutPrimSec); | |
563113d0 | 295 | } |
c7803356 | 296 | else fCutValues->SetAt((Double32_t)kTRUE,kCutPrimSec); |
297 | ||
107a3100 | 298 | // cut on PDG code |
c7803356 | 299 | if ( fRequirePdgCode ) { |
300 | if (IsA(mcPart,fPdgCode,kFALSE)) fCutValues->SetAt((Double32_t)kTRUE,kCutPDGCode); | |
563113d0 | 301 | } |
c7803356 | 302 | else fCutValues->SetAt((Double32_t)kTRUE,kCutPDGCode); |
107a3100 | 303 | |
107a3100 | 304 | |
c7803356 | 305 | // now array of cut is build, fill the bitmap consequently |
306 | Int_t iCutBit = -1; | |
307 | if ( fCutValues->At(++iCutBit) !=0 ) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
308 | if ( fCutValues->At(++iCutBit) !=0 ) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
309 | if ( fCutValues->At(++iCutBit) !=0 ) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
310 | if ( fCutValues->At(++iCutBit) > fProdVtxXMin) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
311 | if ( fCutValues->At(++iCutBit) < fProdVtxXMax) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
312 | if ( fCutValues->At(++iCutBit) > fProdVtxYMin) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
313 | if ( fCutValues->At(++iCutBit) < fProdVtxYMax) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
314 | if ( fCutValues->At(++iCutBit) > fProdVtxZMin) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
315 | if ( fCutValues->At(++iCutBit) < fProdVtxZMax) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
316 | if ( fCutValues->At(++iCutBit) > fDecayVtxXMin) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
317 | if ( fCutValues->At(++iCutBit) < fDecayVtxXMax) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
318 | if ( fCutValues->At(++iCutBit) > fDecayVtxYMin) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
319 | if ( fCutValues->At(++iCutBit) < fDecayVtxYMax) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
320 | if ( fCutValues->At(++iCutBit) > fDecayVtxZMin) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
321 | if ( fCutValues->At(++iCutBit) < fDecayVtxZMax) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
322 | if ( fCutValues->At(++iCutBit) > fDecayLengthMin) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
323 | if ( fCutValues->At(++iCutBit) < fDecayLengthMax) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
324 | if ( fCutValues->At(++iCutBit) > fDecayRxyMin) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
325 | if ( fCutValues->At(++iCutBit) < fDecayRxyMax) fBitmap->SetBitNumber(iCutBit,kTRUE); | |
107a3100 | 326 | } |
327 | ||
c7803356 | 328 | |
107a3100 | 329 | //__________________________________________________________________________________ |
033789c9 | 330 | void AliCFParticleGenCuts::FillHistograms(TObject* /*obj*/, Bool_t afterCuts) |
107a3100 | 331 | { |
332 | // | |
333 | // fill the QA histograms | |
334 | // | |
335 | ||
336 | for (int iCutNumber = 0; iCutNumber < kNCuts; iCutNumber++) | |
c7803356 | 337 | fhQA[iCutNumber][afterCuts]->Fill(fCutValues->At(iCutNumber)); |
107a3100 | 338 | |
339 | // fill cut statistics and cut correlation histograms with information from the bitmap | |
340 | if (afterCuts) return; | |
341 | ||
342 | // Number of single cuts in this class | |
343 | UInt_t ncuts = fBitmap->GetNbits(); | |
344 | for(UInt_t bit=0; bit<ncuts;bit++) { | |
c7803356 | 345 | if (!fBitmap->TestBitNumber(bit)) { |
107a3100 | 346 | fhCutStatistics->Fill(bit+1); |
347 | for (UInt_t bit2=bit; bit2<ncuts;bit2++) { | |
348 | if (!fBitmap->TestBitNumber(bit2)) | |
349 | fhCutCorrelation->Fill(bit+1,bit2+1); | |
350 | } | |
351 | } | |
563113d0 | 352 | } |
107a3100 | 353 | } |
354 | ||
355 | //__________________________________________________________________________________ | |
356 | void AliCFParticleGenCuts::AddQAHistograms(TList *qaList) { | |
357 | // | |
358 | // saves the histograms in a TList | |
359 | // | |
563113d0 | 360 | |
107a3100 | 361 | DefineHistograms(); |
563113d0 | 362 | |
107a3100 | 363 | qaList->Add(fhCutStatistics); |
364 | qaList->Add(fhCutCorrelation); | |
365 | ||
366 | for (Int_t j=0; j<kNStepQA; j++) { | |
367 | for(Int_t i=0; i<kNCuts; i++) | |
368 | qaList->Add(fhQA[i][j]); | |
369 | } | |
370 | } | |
371 | ||
372 | //__________________________________________________________________________________ | |
373 | void AliCFParticleGenCuts::DefineHistograms() { | |
374 | // | |
375 | // histograms for cut variables, cut statistics and cut correlations | |
376 | // | |
377 | Int_t color = 2; | |
378 | ||
379 | // book cut statistics and cut correlation histograms | |
380 | fhCutStatistics = new TH1F(Form("%s_cut_statistics",GetName()),"",kNCuts,0.5,kNCuts+0.5); | |
381 | fhCutStatistics->SetLineWidth(2); | |
382 | int k = 1; | |
383 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"charge") ; k++; | |
384 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"prim/sec") ; k++; | |
385 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"PDG") ; k++; | |
386 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"VtxXMin") ; k++; | |
387 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"VtxXMax") ; k++; | |
388 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"VtxYMin") ; k++; | |
389 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"VtxYMax") ; k++; | |
390 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"VtxZMin") ; k++; | |
391 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecZMax") ; k++; | |
392 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecXMin") ; k++; | |
393 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecXMax") ; k++; | |
394 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecYMin") ; k++; | |
395 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecYMax") ; k++; | |
396 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecZMin") ; k++; | |
397 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecZMax") ; k++; | |
398 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecLgthMin") ; k++; | |
399 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecLgthMax") ; k++; | |
400 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecRxyMin") ; k++; | |
401 | fhCutStatistics->GetXaxis()->SetBinLabel(k,"DecRxyMax") ; k++; | |
402 | ||
403 | ||
404 | fhCutCorrelation = new TH2F(Form("%s_cut_correlation",GetName()),"",kNCuts,0.5,kNCuts+0.5,kNCuts,0.5,kNCuts+0.5); | |
405 | fhCutCorrelation->SetLineWidth(2); | |
406 | for (k=1; k<=kNCuts; k++) { | |
407 | fhCutCorrelation->GetXaxis()->SetBinLabel(k,fhCutStatistics->GetXaxis()->GetBinLabel(k)); | |
408 | fhCutCorrelation->GetYaxis()->SetBinLabel(k,fhCutStatistics->GetXaxis()->GetBinLabel(k)); | |
409 | } | |
410 | ||
411 | Char_t str[256]; | |
412 | for (int i=0; i<kNStepQA; i++) { | |
413 | if (i==0) sprintf(str," "); | |
414 | else sprintf(str,"_cut"); | |
c7803356 | 415 | fhQA[kCutCharge] [i] = new TH1F(Form("%s_charge%s" ,GetName(),str),"",2,0,2); |
416 | fhQA[kCutPrimSec] [i] = new TH1F(Form("%s_primSec%s" ,GetName(),str),"",2,0,2); | |
417 | fhQA[kCutPDGCode] [i] = new TH1F(Form("%s_pdgCode%s" ,GetName(),str),"",2,0,2); | |
107a3100 | 418 | fhQA[kCutProdVtxXMin][i] = new TH1F(Form("%s_prodVtxXMin%s" ,GetName(),str),"",100,0,10); |
419 | fhQA[kCutProdVtxXMax][i] = new TH1F(Form("%s_prodVtxXMax%s" ,GetName(),str),"",100,0,10); | |
420 | fhQA[kCutProdVtxYMin][i] = new TH1F(Form("%s_prodVtxYMin%s" ,GetName(),str),"",100,0,10); | |
421 | fhQA[kCutProdVtxYMax][i] = new TH1F(Form("%s_prodVtxYMax%s" ,GetName(),str),"",100,0,10); | |
422 | fhQA[kCutProdVtxZMin][i] = new TH1F(Form("%s_prodVtxZMin%s" ,GetName(),str),"",100,0,10); | |
423 | fhQA[kCutProdVtxZMax][i] = new TH1F(Form("%s_prodVtxZMax%s" ,GetName(),str),"",100,0,10); | |
424 | fhQA[kCutDecVtxXMin] [i] = new TH1F(Form("%s_decVtxXMin%s" ,GetName(),str),"",100,0,10); | |
425 | fhQA[kCutDecVtxXMax] [i] = new TH1F(Form("%s_decVtxXMax%s" ,GetName(),str),"",100,0,10); | |
426 | fhQA[kCutDecVtxYMin] [i] = new TH1F(Form("%s_decVtxYMin%s" ,GetName(),str),"",100,0,10); | |
427 | fhQA[kCutDecVtxYMax] [i] = new TH1F(Form("%s_decVtxYMax%s" ,GetName(),str),"",100,0,10); | |
428 | fhQA[kCutDecVtxZMin] [i] = new TH1F(Form("%s_decVtxZMin%s" ,GetName(),str),"",100,0,10); | |
429 | fhQA[kCutDecVtxZMax] [i] = new TH1F(Form("%s_decVtxZMax%s" ,GetName(),str),"",100,0,10); | |
430 | fhQA[kCutDecLgthMin] [i] = new TH1F(Form("%s_decLengthMin%s",GetName(),str),"",100,0,10); | |
431 | fhQA[kCutDecLgthMax] [i] = new TH1F(Form("%s_decLengthMax%s",GetName(),str),"",100,0,10); | |
432 | fhQA[kCutDecRxyMin] [i] = new TH1F(Form("%s_decRxyMin%s" ,GetName(),str),"",100,0,10); | |
433 | fhQA[kCutDecRxyMax] [i] = new TH1F(Form("%s_decRxyMax%s" ,GetName(),str),"",100,0,10); | |
434 | } | |
435 | for(Int_t i=0; i<kNCuts; i++) fhQA[i][1]->SetLineColor(color); | |
563113d0 | 436 | } |
107a3100 | 437 | |
438 | ||
563113d0 | 439 | //______________________________ |
440 | Bool_t AliCFParticleGenCuts::IsCharged(AliMCParticle *mcPart) { | |
441 | // | |
442 | //check if particle is charged. | |
443 | // | |
444 | TParticle* part = mcPart->Particle(); | |
445 | TParticlePDG* pdgPart = part->GetPDG(); | |
446 | if(!pdgPart)return kFALSE; | |
447 | if (pdgPart->Charge() == 0) return kFALSE; | |
448 | return kTRUE; | |
449 | } | |
450 | //______________________________ | |
451 | Bool_t AliCFParticleGenCuts::IsPrimary(AliMCParticle *mcPart, AliStack *stack) { | |
452 | // | |
453 | //check if particle is primary (standard definition) | |
454 | // | |
455 | if (!stack->IsPhysicalPrimary(mcPart->Label())) return kFALSE ; | |
456 | return kTRUE; | |
457 | } | |
458 | //______________________________ | |
459 | Bool_t AliCFParticleGenCuts::IsPrimaryCharged(AliMCParticle *mcPart, AliStack *stack) { | |
460 | // | |
461 | //check if a charged particle is primary (standard definition) | |
462 | // | |
463 | if (!stack->IsPhysicalPrimary(mcPart->Label()) || !IsCharged(mcPart)) return kFALSE ; | |
464 | return kTRUE; | |
465 | } | |
466 | //______________________________ | |
467 | Bool_t AliCFParticleGenCuts::IsA(AliMCParticle *mcPart, Int_t pdg, Bool_t abs) { | |
468 | // | |
469 | //Check on the pdg code of the MC particle. if abs=kTRUE then check on the | |
470 | //absolute value. By default is set to kFALSE. | |
471 | // | |
472 | TParticle* part = mcPart->Particle(); | |
473 | Int_t pdgCode = part->GetPdgCode(); | |
fc01457a | 474 | if (abs) { |
475 | pdgCode = TMath::Abs(pdgCode); | |
476 | pdg = TMath::Abs(pdg); | |
477 | } | |
107a3100 | 478 | if (pdgCode != pdg ) return kFALSE; |
563113d0 | 479 | return kTRUE; |
480 | } | |
481 | //______________________________ | |
107a3100 | 482 | void AliCFParticleGenCuts::SetEvtInfo(TObject* mcEvent) { |
563113d0 | 483 | // |
107a3100 | 484 | // Sets pointer to MC event information (AliMCEvent) |
563113d0 | 485 | // |
486 | ||
107a3100 | 487 | if (!mcEvent) { |
488 | AliError("Pointer to MC Event is null !"); | |
563113d0 | 489 | return; |
490 | } | |
491 | ||
107a3100 | 492 | TString className(mcEvent->ClassName()); |
493 | if (className.CompareTo("AliMCEvent") != 0) { | |
494 | AliError("argument must point to an AliMCEvent !"); | |
563113d0 | 495 | return ; |
496 | } | |
497 | ||
107a3100 | 498 | fMCInfo = (AliMCEvent*) mcEvent ; |
563113d0 | 499 | } |