Hidden symbols removed (Marian)
[u/mrichter/AliRoot.git] / CORRFW / AliCFEventClassCuts.cxx
CommitLineData
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// To select on the Event Class: look at the Trigger mask and the ZDC info.
16// Only pp-running trigger types implemented so far
17// handles all masks for the trigger description
9baeb4ef 18// and some general combinations like MB1,MB2,MB3,MB4 and MB5.
563113d0 19// The argument of IsSelected member function (passed object) is cast into
20// an AliVEvent, but cuts have a true meaning only for AliESD(AOD)Event
21// type objects.
22// The class derives from AliCFCutBase
23// Author:S.Arcelli Silvia.Arcelli@cern.ch
24//
25//
26#include "TH1F.h"
27#include "TList.h"
28#include "AliLog.h"
29#include "TMath.h"
30#include "AliVEvent.h"
31#include "AliCFEventClassCuts.h"
32ClassImp(AliCFEventClassCuts)
33//____________________________________________________________________
34AliCFEventClassCuts::AliCFEventClassCuts() :
35 AliCFCutBase(),
36 fTriggerType(0),
37 fTriggerAND(kFALSE),
38 fZDCN1EnergyMin(-1.e99),
39 fZDCP1EnergyMin(-1.e99),
40 fZDCN2EnergyMin(-1.e99),
41 fZDCP2EnergyMin(-1.e99),
42 fZDCEM1EnergyMin(-1.e99),
43 fZDCEM2EnergyMin(-1.e99),
44 fZDCN1EnergyMax(1.e99),
45 fZDCP1EnergyMax(1.e99),
46 fZDCN2EnergyMax(1.e99),
47 fZDCP2EnergyMax(1.e99),
48 fZDCEM1EnergyMax(1.e99),
49 fZDCEM2EnergyMax(1.e99),
50 fBitMap(0x0),
51 fhNBinsTrigger(0),
52 fhBinLimTrigger(0),
53 fhNBinsZDCEnN1(0),
54 fhBinLimZDCEnN1(0),
55 fhNBinsZDCEnP1(0),
56 fhBinLimZDCEnP1(0),
57 fhNBinsZDCEnN2(0),
58 fhBinLimZDCEnN2(0),
59 fhNBinsZDCEnP2(0),
60 fhBinLimZDCEnP2(0),
61 fhNBinsZDCEnEM1(0),
62 fhBinLimZDCEnEM1(0),
63 fhNBinsZDCEnEM2(0),
64 fhBinLimZDCEnEM2(0)
65{
66 //
67 //ctor
68 //
69
70 fBitMap=new TBits(0);
71 Initialise();
72}
9baeb4ef 73
563113d0 74//____________________________________________________________________
75AliCFEventClassCuts::AliCFEventClassCuts(Char_t* name, Char_t* title) :
76 AliCFCutBase(name,title),
77 fTriggerType(0),
78 fTriggerAND(kFALSE),
79 fZDCN1EnergyMin(-1.e99),
80 fZDCP1EnergyMin(-1.e99),
81 fZDCN2EnergyMin(-1.e99),
82 fZDCP2EnergyMin(-1.e99),
83 fZDCEM1EnergyMin(-1.e99),
84 fZDCEM2EnergyMin(-1.e99),
85 fZDCN1EnergyMax(1.e99),
86 fZDCP1EnergyMax(1.e99),
87 fZDCN2EnergyMax(1.e99),
88 fZDCP2EnergyMax(1.e99),
89 fZDCEM1EnergyMax(1.e99),
90 fZDCEM2EnergyMax(1.e99),
91 fBitMap(0x0),
92 fhNBinsTrigger(0),
93 fhBinLimTrigger(0),
94 fhNBinsZDCEnN1(0),
95 fhBinLimZDCEnN1(0),
96 fhNBinsZDCEnP1(0),
97 fhBinLimZDCEnP1(0),
98 fhNBinsZDCEnN2(0),
99 fhBinLimZDCEnN2(0),
100 fhNBinsZDCEnP2(0),
101 fhBinLimZDCEnP2(0),
102 fhNBinsZDCEnEM1(0),
103 fhBinLimZDCEnEM1(0),
104 fhNBinsZDCEnEM2(0),
105 fhBinLimZDCEnEM2(0)
106{
107 //
108 //ctor
109 //
110 fBitMap=new TBits(0);
111 Initialise();
112 }
9baeb4ef 113
114//_____________________________________________________________________________
563113d0 115AliCFEventClassCuts::AliCFEventClassCuts(const AliCFEventClassCuts& c) :
116 AliCFCutBase(c),
117 fTriggerType(c.fTriggerType),
118 fTriggerAND(c.fTriggerAND),
119 fZDCN1EnergyMin(c.fZDCN1EnergyMin),
120 fZDCP1EnergyMin(c.fZDCP1EnergyMin),
121 fZDCN2EnergyMin(c.fZDCN2EnergyMin),
122 fZDCP2EnergyMin(c.fZDCP2EnergyMin),
123 fZDCEM1EnergyMin(c.fZDCEM1EnergyMin),
124 fZDCEM2EnergyMin(c.fZDCEM2EnergyMin),
125 fZDCN1EnergyMax(c.fZDCN1EnergyMax),
126 fZDCP1EnergyMax(c.fZDCP1EnergyMax),
127 fZDCN2EnergyMax(c.fZDCN2EnergyMax),
128 fZDCP2EnergyMax(c.fZDCP2EnergyMax),
129 fZDCEM1EnergyMax(c.fZDCEM1EnergyMax),
130 fZDCEM2EnergyMax(c.fZDCEM2EnergyMax),
131 fBitMap(c.fBitMap),
132 fhNBinsTrigger(c.fhNBinsTrigger),
133 fhBinLimTrigger(c.fhBinLimTrigger ),
134 fhNBinsZDCEnN1(c.fhNBinsZDCEnN1),
135 fhBinLimZDCEnN1(c.fhBinLimZDCEnN1),
136 fhNBinsZDCEnP1(c.fhNBinsZDCEnP1),
137 fhBinLimZDCEnP1(c.fhBinLimZDCEnP1),
138 fhNBinsZDCEnN2(c.fhNBinsZDCEnN2),
139 fhBinLimZDCEnN2(c.fhBinLimZDCEnN2),
140 fhNBinsZDCEnP2(c.fhNBinsZDCEnP2),
141 fhBinLimZDCEnP2(c.fhBinLimZDCEnP2),
142 fhNBinsZDCEnEM1(c.fhNBinsZDCEnEM1),
143 fhBinLimZDCEnEM1(c.fhBinLimZDCEnEM1),
144 fhNBinsZDCEnEM2(c.fhNBinsZDCEnEM2),
145 fhBinLimZDCEnEM2(c.fhBinLimZDCEnEM2)
146
147{
148 //
149 //copy constructor
150 //
151}
9baeb4ef 152
153//_____________________________________________________________________________
563113d0 154AliCFEventClassCuts& AliCFEventClassCuts::operator=(const AliCFEventClassCuts& c){
155 //
156 // Assignment operator
157 //
158 if (this != &c) {
159 AliCFCutBase::operator=(c) ;
160 fTriggerType = c.fTriggerType ;
161 fTriggerAND = c.fTriggerAND ;
162 fZDCN1EnergyMin = c.fZDCN1EnergyMin;
163 fZDCP1EnergyMin = c.fZDCP1EnergyMin;
164 fZDCN2EnergyMin = c.fZDCN2EnergyMin;
165 fZDCP2EnergyMin = c.fZDCP2EnergyMin;
166 fZDCEM1EnergyMin = c.fZDCEM1EnergyMin;
167 fZDCEM2EnergyMin = c.fZDCEM2EnergyMin;
168 fZDCN1EnergyMax = c.fZDCN1EnergyMax;
169 fZDCP1EnergyMax = c.fZDCP1EnergyMax;
170 fZDCN2EnergyMax = c.fZDCN2EnergyMax;
171 fZDCP2EnergyMax = c.fZDCP2EnergyMax;
172 fZDCEM1EnergyMax = c.fZDCEM1EnergyMax;
173 fZDCEM2EnergyMax = c.fZDCEM2EnergyMax;
174 fBitMap = c.fBitMap;
175 fhNBinsTrigger = c.fhNBinsTrigger;
176 fhBinLimTrigger = c.fhBinLimTrigger ;
177 fhNBinsZDCEnN1 = c.fhNBinsZDCEnN1;
178 fhBinLimZDCEnN1 = c.fhBinLimZDCEnN1;
179 fhNBinsZDCEnP1 = c.fhNBinsZDCEnP1;
180 fhBinLimZDCEnP1 = c.fhBinLimZDCEnP1;
181 fhNBinsZDCEnN2 = c.fhNBinsZDCEnN2;
182 fhBinLimZDCEnN2 = c.fhBinLimZDCEnN2;
183 fhNBinsZDCEnP2 = c.fhNBinsZDCEnP2;
184 fhBinLimZDCEnP2 = c.fhBinLimZDCEnP2;
185 fhNBinsZDCEnEM1 = c.fhNBinsZDCEnEM1;
186 fhBinLimZDCEnEM1 = c.fhBinLimZDCEnEM1;
187 fhNBinsZDCEnEM2 = c.fhNBinsZDCEnEM2;
188 fhBinLimZDCEnEM2 = c.fhBinLimZDCEnEM2;
189 }
190
191
192 for (Int_t i=0; i<c.kNCuts; i++){
193 for (Int_t j=0; j<c.kNStepQA; j++){
194 if(c.fhQA[i][j]) fhQA[i][j] = (TH1F*)c.fhQA[i][j]->Clone();
195 }
196 }
197
198 return *this ;
199}
200
9baeb4ef 201//_____________________________________________________________________________
563113d0 202AliCFEventClassCuts::~AliCFEventClassCuts()
203{
204 //
205 // destructor
206 //
207 for (Int_t i=0; i<kNCuts; i++){
208 for (Int_t j=0; j<kNStepQA; j++){
209 if(fhQA[i][j]) delete fhQA[i][j];
210 }
211 }
212
213 if(fBitMap)delete fBitMap;
214 if(fhBinLimTrigger)delete fhBinLimTrigger;
215 if(fhBinLimZDCEnN1)delete fhBinLimZDCEnN1;
216 if(fhBinLimZDCEnP1)delete fhBinLimZDCEnP1;
217 if(fhBinLimZDCEnN2)delete fhBinLimZDCEnN2;
218 if(fhBinLimZDCEnP2)delete fhBinLimZDCEnP2;
219 if(fhBinLimZDCEnEM1)delete fhBinLimZDCEnEM1;
220 if(fhBinLimZDCEnEM2)delete fhBinLimZDCEnEM2;
221
222}
9baeb4ef 223
224//_____________________________________________________________________________
563113d0 225void AliCFEventClassCuts::Init() {
226 //
9baeb4ef 227 // initialises all QA histograms
563113d0 228 //
229 if(fIsQAOn)
230 DefineHistograms();
231}
9baeb4ef 232
233//_____________________________________________________________________________
563113d0 234void AliCFEventClassCuts::Initialise()
235{
236 //
237 //initialization
238 //
239
9baeb4ef 240
563113d0 241 //
242 // sets pointers to histos to zero
243 //
244
245 for(Int_t i=0; i<kNCuts; i++){
246 for(Int_t j =0; j<kNStepQA; j++){
247 fhQA[i][j]=0x0;
248 }
249 }
250
251 //set default bin number/ranges for QA histograms
252
253 SetHistogramBins(kTrigger,23,-0.5,22.5);
254 SetHistogramBins(kZDCEnergyN1,800,-500,7500);
255 SetHistogramBins(kZDCEnergyP1,800,-500,7500);
256 SetHistogramBins(kZDCEnergyN2,800,-500,7500);
257 SetHistogramBins(kZDCEnergyP2,800,-500,7500);
258 SetHistogramBins(kZDCEnergyEM1,800,-500,7500);
259 SetHistogramBins(kZDCEnergyEM2,800,-500,7500);
260
261}
9baeb4ef 262
563113d0 263//____________________________________________________________________
264Bool_t AliCFEventClassCuts::IsSelected(TObject* obj) {
265 //
266 //Check if the requested cuts are passed
267 //
268
269 TBits* bitmap = SelectionBitMap(obj);
270
271 Bool_t isSelected = kTRUE;
272
273 for (UInt_t icut=0; icut<bitmap->GetNbits();icut++)
274 if(!bitmap->TestBitNumber(icut)) isSelected = kFALSE;
275
276 return isSelected;
277}
278
279//____________________________________________________________________
280TBits *AliCFEventClassCuts::SelectionBitMap(TObject* obj) {
281 //
282 //cut on trigger type (just pp running trigger types implemented so far)
283 //and on the energy observed in the ZDC. The argument is cast into
284 //an AliVEvent, but has true meaning only for AliESDEvent type objects.
285 //Check if the requested cuts are passed and return a bitmap
286 //
287
288 for(Int_t j=0;j<kNCuts;j++)fBitMap->SetBitNumber(j,kFALSE);
289 AliVEvent* esd = dynamic_cast<AliVEvent *>(obj);
290 if (!esd ) return fBitMap ;
291
292
293 //now start checking the cuts
294 //first assume the event will be accepted:
295 for(Int_t j=0;j<kNCuts;j++)fBitMap->SetBitNumber(j,kTRUE);
296
297
298 //Check the trigger:
299
300 //look at the Trigger mask in current event
301 TBits *triggerBitMap=new TBits(0);
302 TriggerBitMap(esd,triggerBitMap);
303 //now compare to what was requested as a Trigger:
304 if(fTriggerType.GetNbits()>0)fBitMap->SetBitNumber(0,kFALSE); //trigger required, initialize to false
305 for(Int_t j=0;j<kNTriggers+kNTriggersMB;j++){
306 if(fTriggerType.TestBitNumber(j)){
307 if(!fTriggerAND){
308 if(triggerBitMap->TestBitNumber(j) == fTriggerType.TestBitNumber(j)){
309 fBitMap->SetBitNumber(0,kTRUE);
310
311 break;// @least one requested bit fired, ok
312 }
313 }else{
314 if(!triggerBitMap->TestBitNumber(j)){
315 break;
316 }
317 }
318 }
319 }
320
321 delete triggerBitMap;
322 //Then, cut on the energy observed in the ZDC
323
324 if( esd->GetZDCN1Energy()<fZDCN1EnergyMin || esd->GetZDCN1Energy()>fZDCN1EnergyMax)fBitMap->SetBitNumber(1,kFALSE);
325 if( esd->GetZDCP1Energy()<fZDCP1EnergyMin || esd->GetZDCP1Energy()>fZDCP1EnergyMax)fBitMap->SetBitNumber(2,kFALSE);
326 if( esd->GetZDCN2Energy()<fZDCN2EnergyMin || esd->GetZDCN2Energy()>fZDCN2EnergyMax)fBitMap->SetBitNumber(3,kFALSE);
327 if( esd->GetZDCP2Energy()<fZDCP2EnergyMin || esd->GetZDCP2Energy()>fZDCP2EnergyMax)fBitMap->SetBitNumber(4,kFALSE);
328 if( esd->GetZDCEMEnergy(0)<fZDCEM1EnergyMin || esd->GetZDCEMEnergy(0)>fZDCEM1EnergyMax)fBitMap->SetBitNumber(5,kFALSE);
329 if( esd->GetZDCEMEnergy(1)<fZDCEM2EnergyMin || esd->GetZDCEMEnergy(1)>fZDCEM2EnergyMax)fBitMap->SetBitNumber(6,kFALSE);
330 return fBitMap;
331
332}
9baeb4ef 333
563113d0 334//_____________________________________________________________________________
335Bool_t AliCFEventClassCuts::IsTriggered(AliVEvent* ev, TriggerType trigger) {
336 //
337 //look at the Trigger mask in current event
338 TBits *triggerBitMap=new TBits(0);
339 TriggerBitMap(ev,triggerBitMap);
340 Bool_t isTriggered=kFALSE;
341 if(triggerBitMap->TestBitNumber(trigger))isTriggered=kTRUE;
342 delete triggerBitMap;
343 return isTriggered;
344
345}
9baeb4ef 346
563113d0 347//_____________________________________________________________________________
348void AliCFEventClassCuts::TriggerBitMap(AliVEvent* ev, TBits *bitmapT ) {
349 //
350
351 for(Int_t itrig=0;itrig<kNTriggers+kNTriggersMB;itrig++)bitmapT->SetBitNumber(itrig,kFALSE);
352 if (!ev ) return;
353
354 ULong64_t triggerMask = ev->GetTriggerMask();
355 //run over the different triggers in the mask, and check which bits have fired
356 for(Int_t itrig=0;itrig<kNTriggers;itrig++){
357 bitmapT->SetBitNumber(itrig,kFALSE);
358 if (triggerMask&(0x1 <<itrig)){
359 bitmapT->SetBitNumber(itrig,kTRUE);
360 }
361 }
362
363 //Trigger combinations, Minimum bias triggers
364
365 //MB1 case: (GFO || V0OR) && !BG
366 if((bitmapT->TestBitNumber(5) || (bitmapT->TestBitNumber(0) || bitmapT->TestBitNumber(1))) && !bitmapT->TestBitNumber(2)) bitmapT->SetBitNumber(17,kTRUE);
367
368 //MB2 case: (GFO && V0OR) && !BG
369 if((bitmapT->TestBitNumber(5) && (bitmapT->TestBitNumber(0) || bitmapT->TestBitNumber(1))) && !bitmapT->TestBitNumber(2)) bitmapT->SetBitNumber(18,kTRUE);
370
371 //MB3 case : (GFO && V0AND) && !BG
372 if((bitmapT->TestBitNumber(5) && (bitmapT->TestBitNumber(0) && bitmapT->TestBitNumber(1))) && !bitmapT->TestBitNumber(2)) bitmapT->SetBitNumber(19,kTRUE);
373
374 //MB4 case: (GFO || V0AND) && !BG
375 if((bitmapT->TestBitNumber(5) || (bitmapT->TestBitNumber(0) && bitmapT->TestBitNumber(1))) && !bitmapT->TestBitNumber(2)) bitmapT->SetBitNumber(20,kTRUE);
376
377 //MB5 case:: GFO && !BG
378 if(bitmapT->TestBitNumber(5) && !bitmapT->TestBitNumber(2)) bitmapT->SetBitNumber(21,kTRUE);
379
380 return;
381}
9baeb4ef 382
383//_____________________________________________________________________________
563113d0 384void AliCFEventClassCuts::GetBitMap(TObject* obj, TBits* bitmap){
385 //
386 // retrieve the pointer to the bitmap
387 //
388
389 bitmap = SelectionBitMap(obj);
390
391}
9baeb4ef 392
393//_____________________________________________________________________________
563113d0 394void AliCFEventClassCuts::SetHistogramBins(Int_t index, Int_t nbins, Double_t *bins)
395{
396 //
397 // QA histogram axis parameters
398 // variable bin size:user inputs nbins and the vector of bin limits
399 //
400
401 switch(index){
402 case kTrigger:
db6722a5 403 fhNBinsTrigger=nbins+1;
563113d0 404 fhBinLimTrigger=new Double_t[nbins+1];
405 for(Int_t i=0;i<nbins+1;i++)fhBinLimTrigger[i]=bins[i];
406 break;
407
408 case kZDCEnergyN1:
db6722a5 409 fhNBinsZDCEnN1=nbins+1;
563113d0 410 fhBinLimZDCEnN1=new Double_t[nbins+1];
411 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnN1[i]=bins[i];
412 break;
413
414 case kZDCEnergyP1:
db6722a5 415 fhNBinsZDCEnP1=nbins+1;
563113d0 416 fhBinLimZDCEnP1=new Double_t[nbins+1];
417 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnP1[i]=bins[i];
418 break;
419
420 case kZDCEnergyN2:
db6722a5 421 fhNBinsZDCEnN2=nbins+1;
563113d0 422 fhBinLimZDCEnN2=new Double_t[nbins+1];
423 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnN2[i]=bins[i];
424 break;
425
426 case kZDCEnergyP2:
db6722a5 427 fhNBinsZDCEnP2=nbins+1;
563113d0 428 fhBinLimZDCEnP2=new Double_t[nbins+1];
429 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnP2[i]=bins[i];
430 break;
431
432 case kZDCEnergyEM1:
db6722a5 433 fhNBinsZDCEnEM1=nbins+1;
563113d0 434 fhBinLimZDCEnEM1=new Double_t[nbins+1];
435 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnEM1[i]=bins[i];
436 break;
437
438 case kZDCEnergyEM2:
db6722a5 439 fhNBinsZDCEnEM2=nbins+1;
563113d0 440 fhBinLimZDCEnEM2=new Double_t[nbins+1];
441 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnEM2[i]=bins[i];
442 break;
443
444 }
445
446}
9baeb4ef 447
448//_____________________________________________________________________________
563113d0 449void AliCFEventClassCuts::SetHistogramBins(Int_t index, Int_t nbins, Double_t xmin, Double_t xmax)
450{
451 //
452 // QA histogram axis parameters
453 // fixed bin size: user inputs nbins, xmin and xmax
454 //
455 switch(index){
456 case kTrigger:
db6722a5 457 fhNBinsTrigger=nbins+1;
563113d0 458 fhBinLimTrigger=new Double_t[nbins+1];
459 for(Int_t i=0;i<nbins+1;i++)fhBinLimTrigger[i]=xmin+i*(xmax-xmin)/Double_t(nbins);
460 break;
461
462 case kZDCEnergyN1:
db6722a5 463 fhNBinsZDCEnN1=nbins+1;
563113d0 464 fhBinLimZDCEnN1=new Double_t[nbins+1];
465 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnN1[i]=xmin+i*(xmax-xmin)/Double_t(nbins);
466 break;
467
468 case kZDCEnergyP1:
db6722a5 469 fhNBinsZDCEnP1=nbins+1;
563113d0 470 fhBinLimZDCEnP1=new Double_t[nbins+1];
471 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnP1[i]=xmin+i*(xmax-xmin)/Double_t(nbins);
472 break;
473
474 case kZDCEnergyN2:
db6722a5 475 fhNBinsZDCEnN2=nbins+1;
563113d0 476 fhBinLimZDCEnN2=new Double_t[nbins+1];
477 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnN2[i]=xmin+i*(xmax-xmin)/Double_t(nbins);
478 break;
479
480 case kZDCEnergyP2:
db6722a5 481 fhNBinsZDCEnP2=nbins+1;
563113d0 482 fhBinLimZDCEnP2=new Double_t[nbins+1];
483 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnP2[i]=xmin+i*(xmax-xmin)/Double_t(nbins);
484 break;
485
486 case kZDCEnergyEM1:
db6722a5 487 fhNBinsZDCEnEM1=nbins+1;
563113d0 488 fhBinLimZDCEnEM1=new Double_t[nbins+1];
489 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnEM1[i]=xmin+i*(xmax-xmin)/Double_t(nbins);
490 break;
491
492 case kZDCEnergyEM2:
db6722a5 493 fhNBinsZDCEnEM2=nbins+1;
563113d0 494 fhBinLimZDCEnEM2=new Double_t[nbins+1];
495 for(Int_t i=0;i<nbins+1;i++)fhBinLimZDCEnEM2[i]=xmin+i*(xmax-xmin)/Double_t(nbins);
496 break;
497 }
498}
9baeb4ef 499
500//_____________________________________________________________________________
563113d0 501 void AliCFEventClassCuts::DefineHistograms() {
502 //
503 // histograms for cut variables
504 //
505 Int_t color = 2;
506
507 if(!fIsQAOn) {
508 AliInfo(Form("Nn QA histos requested, Please first set the QA flag on!"));
509 return;
510 }
511
512 // book QA histograms
513
514 Char_t str[256];
515 for (Int_t i=0; i<kNStepQA; i++) {
516 if (i==0) sprintf(str," ");
517 else sprintf(str,"_cut");
518
db6722a5 519 fhQA[kTrigger][i] = new TH1F(Form("%s_TriggerBits%s",GetName(),str), "",fhNBinsTrigger-1,fhBinLimTrigger);
520 fhQA[kZDCEnergyN1][i] = new TH1F(Form("%s_ZDC_Energy_N1%s",GetName(),str), "",fhNBinsZDCEnN1-1,fhBinLimZDCEnN1);
521 fhQA[kZDCEnergyP1][i] = new TH1F(Form("%s_ZDC_Energy_P1%s",GetName(),str), "",fhNBinsZDCEnP1-1,fhBinLimZDCEnP1);
522 fhQA[kZDCEnergyN2][i] = new TH1F(Form("%s_ZDC_Energy_N2%s",GetName(),str), "",fhNBinsZDCEnN2-1,fhBinLimZDCEnN2);
523 fhQA[kZDCEnergyP2][i] = new TH1F(Form("%s_ZDC_Energy_P2%s",GetName(),str), "",fhNBinsZDCEnP2-1,fhBinLimZDCEnP2);
524 fhQA[kZDCEnergyEM1][i] = new TH1F(Form("%s_ZDC_Energy_EM1%s",GetName(),str), "",fhNBinsZDCEnEM1-1,fhBinLimZDCEnEM1);
525 fhQA[kZDCEnergyEM2][i] = new TH1F(Form("%s_ZDC_Energy_EM2%s",GetName(),str), "",fhNBinsZDCEnEM2-1,fhBinLimZDCEnEM2);
563113d0 526
527
528 fhQA[kTrigger][i] ->SetXTitle("Trigger Bits");
529 fhQA[kZDCEnergyN1][i] ->SetXTitle("ZDC Energy N1 (GeV)");
530 fhQA[kZDCEnergyP1][i] ->SetXTitle("ZDC Energy P1 (GeV)");
531 fhQA[kZDCEnergyN2][i] ->SetXTitle("ZDC Energy N2 (GeV)");
532 fhQA[kZDCEnergyP2][i] ->SetXTitle("ZDC Energy P2 (GeV)");
533 fhQA[kZDCEnergyEM1][i] ->SetXTitle("ZDC Energy EM1 (GeV)");
534 fhQA[kZDCEnergyEM2][i] ->SetXTitle("ZDC Energy EM2 (GeV)");
535
536 }
537
538 for(Int_t i=0; i<kNCuts; i++) fhQA[i][1]->SetLineColor(color);
539
540}
9baeb4ef 541
542//_____________________________________________________________________________
563113d0 543void AliCFEventClassCuts::FillHistograms(TObject* obj, Bool_t b)
544{
545 //
546 // fill the QA histograms
547 //
548 if(!fIsQAOn) return;
549
550 // cast TObject into VParticle
551 AliVEvent* esd = dynamic_cast<AliVEvent *>(obj);
552 if (!esd ) return ;
553
554 // index = 0: fill histograms before cuts
555 // index = 1: fill histograms after cuts
556 Int_t index = -1;
557 index = ((b) ? 1 : 0);
558
559
560 //look at the Trigger mask in current event
561 TBits *triggerBitMap=new TBits(0);
562 TriggerBitMap(esd, triggerBitMap);
563
564 //trigger Mask
565 for(Int_t itrig=0;itrig<kNTriggers+kNTriggersMB;itrig++){
566 if(triggerBitMap->TestBitNumber(itrig)){
567 fhQA[kTrigger][index]->Fill(itrig);
568 }
569 }
570
571 delete triggerBitMap;
572
573 //ZDC Quantities
574 fhQA[kZDCEnergyN1][index]->Fill(esd->GetZDCN1Energy());
575 fhQA[kZDCEnergyP1][index]->Fill(esd->GetZDCP1Energy());
576 fhQA[kZDCEnergyN2][index]->Fill(esd->GetZDCN2Energy());
577 fhQA[kZDCEnergyP2][index]->Fill(esd->GetZDCP2Energy());
578 fhQA[kZDCEnergyEM1][index]->Fill(esd->GetZDCEMEnergy(0));
579 fhQA[kZDCEnergyEM2][index]->Fill(esd->GetZDCEMEnergy(1));
580
581}
9baeb4ef 582
583//_____________________________________________________________________________
563113d0 584void AliCFEventClassCuts::AddQAHistograms(TList *list) const {
585 //
586 // saves the histograms in a TList
587 //
588 if(!fIsQAOn) return;
589
590 for (Int_t j=0; j<kNStepQA; j++) {
591 for(Int_t i=0; i<kNCuts; i++)
592 list->Add(fhQA[i][j]);
593 }
594}