AliPhysics  95775ff (95775ff)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnaCaloTrackCorrMaker.cxx
Go to the documentation of this file.
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 #include <cstdlib>
17 
18 // --- ROOT system ---
19 #include <TClonesArray.h>
20 #include <TList.h>
21 #include <TH1F.h>
22 //#include <TObjectTable.h>
23 #include <TGeoGlobalMagField.h>
24 
25 //---- AliRoot system ----
26 #include "AliAnalysisManager.h"
27 #include "AliInputEventHandler.h"
28 #include "AliESDEvent.h"
29 #include "AliAODEvent.h"
32 #include "AliLog.h"
33 #include "AliGenPythiaEventHeader.h"
34 
38 
39 //__________________________________________________
42 //__________________________________________________
44 TObject(),
45 fReader(0), fCaloUtils(0),
46 fOutputContainer(new TList ), fAnalysisContainer(new TList ),
47 fMakeHisto(kFALSE), fMakeAOD(kFALSE),
48 fAnaDebug(0), fCuts(new TList),
49 fScaleFactor(-1),
50 fFillDataControlHisto(kTRUE), fSumw2(0),
51 fCheckPtHard(0),
52 // Control histograms
53 fhNEventsIn(0), fhNEvents(0),
54 fhNExoticEvents(0), fhNEventsNoTriggerFound(0),
55 fhNPileUpEvents(0), fhNPileUpEventsTriggerBC0(0),
56 fhXVertex(0), fhYVertex(0), fhZVertex(0),
57 fhXVertexExotic(0), fhYVertexExotic(0), fhZVertexExotic(0),
58 fhPtHard(0), fhPtHardWeighted(0),
59 fhPileUpClusterMult(0), fhPileUpClusterMultAndSPDPileUp(0),
60 fhTrackMult(0),
61 fhCentrality(0), fhEventPlaneAngle(0),
62 fhNEventsWeighted(0), fhTrackMultWeighted(0),
63 fhCentralityWeighted(0), fhEventPlaneAngleWeighted(0),
64 fhNMergedFiles(0), fhScaleFactor(0),
65 fhEMCalBCEvent(0), fhEMCalBCEventCut(0),
66 fhTrackBCEvent(0), fhTrackBCEventCut(0),
67 fhPrimaryVertexBC(0), fhTimeStampFraction(0),
68 fhNPileUpVertSPD(0), fhNPileUpVertTracks(0),
69 // EMCal trigger control histograms
70 fhClusterTriggerBC(0), fhClusterTriggerBCExotic(0),
71 fhClusterTriggerBCBadCell(0), fhClusterTriggerBCBadCellExotic(0),
72 fhClusterTriggerBCBadCluster(0), fhClusterTriggerBCBadClusterExotic(0),
73 fhClusterTriggerBCUnMatch(0), fhClusterTriggerBCExoticUnMatch(0),
74 fhClusterTriggerBCBadCellUnMatch(0), fhClusterTriggerBCBadCellExoticUnMatch(0),
75 fhClusterTriggerBCBadClusterUnMatch(0), fhClusterTriggerBCBadClusterExoticUnMatch(0),
76 fhClusterTriggerBCEventBC(0), fhClusterTriggerBCEventBCUnMatch(0),
77 fhClusterTriggerBCExoticEventBC(0), fhClusterTriggerBCExoticEventBCUnMatch(0)
78 {
79  AliDebug(1,"*** Analysis Maker Constructor ***");
80 
81  for(Int_t i = 0; i < 3; i++)
82  {
85  }
86 
88 }
89 
90 //________________________________________________________________________________________
92 //________________________________________________________________________________________
94 TObject(),
95 fReader(), //(new AliCaloTrackReader(*maker.fReader)),
96 fCaloUtils(),//(new AliCalorimeterUtils(*maker.fCaloUtils)),
97 fOutputContainer(new TList()), fAnalysisContainer(new TList()),
98 fMakeHisto(maker.fMakeHisto), fMakeAOD(maker.fMakeAOD),
99 fAnaDebug(maker.fAnaDebug), fCuts(new TList()),
100 fScaleFactor(maker.fScaleFactor),
101 fFillDataControlHisto(maker.fFillDataControlHisto),
102 fSumw2(maker.fSumw2),
103 fCheckPtHard(maker.fCheckPtHard),
104 fhNEventsIn(maker.fhNEventsIn),
105 fhNEvents(maker.fhNEvents),
106 fhNExoticEvents(maker.fhNExoticEvents),
107 fhNEventsNoTriggerFound(maker.fhNEventsNoTriggerFound),
108 fhNPileUpEvents(maker.fhNPileUpEvents),
109 fhNPileUpEventsTriggerBC0(maker.fhNPileUpEventsTriggerBC0),
110 fhXVertex(maker.fhXVertex),
111 fhYVertex(maker.fhYVertex),
112 fhZVertex(maker.fhZVertex),
113 fhXVertexExotic(maker.fhXVertexExotic),
114 fhYVertexExotic(maker.fhYVertexExotic),
115 fhZVertexExotic(maker.fhZVertexExotic),
116 fhPtHard(maker.fhPtHard),
117 fhPtHardWeighted(maker.fhPtHardWeighted),
118 fhPileUpClusterMult(maker.fhPileUpClusterMult),
119 fhPileUpClusterMultAndSPDPileUp(maker.fhPileUpClusterMultAndSPDPileUp),
120 fhTrackMult(maker.fhTrackMult),
121 fhCentrality(maker.fhCentrality),
122 fhEventPlaneAngle(maker.fhEventPlaneAngle),
123 fhNEventsWeighted(maker.fhNEventsWeighted),
124 fhTrackMultWeighted(maker.fhTrackMultWeighted),
125 fhCentralityWeighted(maker.fhCentralityWeighted),
126 fhEventPlaneAngleWeighted(maker.fhEventPlaneAngleWeighted),
127 fhNMergedFiles(maker.fhNMergedFiles),
128 fhScaleFactor(maker.fhScaleFactor),
129 fhEMCalBCEvent(maker.fhEMCalBCEvent),
130 fhEMCalBCEventCut(maker.fhEMCalBCEventCut),
131 fhTrackBCEvent(maker.fhTrackBCEvent),
132 fhTrackBCEventCut(maker.fhTrackBCEventCut),
133 fhPrimaryVertexBC(maker.fhPrimaryVertexBC),
134 fhTimeStampFraction(maker.fhTimeStampFraction),
135 fhNPileUpVertSPD(maker.fhNPileUpVertSPD),
136 fhNPileUpVertTracks(maker.fhNPileUpVertTracks),
137 fhClusterTriggerBC(maker.fhClusterTriggerBC),
138 fhClusterTriggerBCExotic(maker.fhClusterTriggerBCExotic),
139 fhClusterTriggerBCBadCell(maker.fhClusterTriggerBCBadCell),
140 fhClusterTriggerBCBadCellExotic(maker.fhClusterTriggerBCBadCellExotic),
141 fhClusterTriggerBCBadCluster(maker.fhClusterTriggerBCBadCluster),
142 fhClusterTriggerBCBadClusterExotic(maker.fhClusterTriggerBCBadClusterExotic),
143 fhClusterTriggerBCUnMatch(maker.fhClusterTriggerBCUnMatch),
144 fhClusterTriggerBCExoticUnMatch(maker.fhClusterTriggerBCExoticUnMatch),
145 fhClusterTriggerBCBadCellUnMatch(maker.fhClusterTriggerBCBadCellUnMatch),
146 fhClusterTriggerBCBadCellExoticUnMatch(maker.fhClusterTriggerBCBadCellExoticUnMatch),
147 fhClusterTriggerBCBadClusterUnMatch(maker.fhClusterTriggerBCBadClusterUnMatch),
148 fhClusterTriggerBCBadClusterExoticUnMatch(maker.fhClusterTriggerBCBadClusterExoticUnMatch),
149 fhClusterTriggerBCEventBC(maker.fhClusterTriggerBCEventBC),
150 fhClusterTriggerBCEventBCUnMatch(maker.fhClusterTriggerBCEventBCUnMatch),
151 fhClusterTriggerBCExoticEventBC(maker.fhClusterTriggerBCExoticEventBC),
152 fhClusterTriggerBCExoticEventBCUnMatch(maker.fhClusterTriggerBCExoticEventBCUnMatch)
153 {
154  for(Int_t i = 0; i < 3; i++)
155  {
158  }
159 }
160 
161 //___________________________________________________
163 //___________________________________________________
165 {
166  // Do not delete it here, already done somewhere else, need to understand where.
167  // if (fOutputContainer) {
168  // fOutputContainer->Clear();
169  // delete fOutputContainer ;
170  // }
171 
172  if (fAnalysisContainer)
173  {
174  fAnalysisContainer->Delete();
175  delete fAnalysisContainer ;
176  }
177 
178  if (fReader) delete fReader ;
179  if (fCaloUtils) delete fCaloUtils ;
180 
181  if(fCuts)
182  {
183  fCuts->Delete();
184  delete fCuts;
185  }
186 }
187 
188 //__________________________________________________________________
190 //__________________________________________________________________
192 {
193  if ( fAnalysisContainer)
194  {
195  fAnalysisContainer->AddAt(ana,n);
196  }
197  else
198  {
199  AliFatal("AnalysisContainer not initialized");
200  }
201 }
202 
203 //_________________________________________________________
207 //_________________________________________________________
209 {
210  TList *aodBranchList = fReader->GetAODBranchList() ;
211 
212  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
213  {
215  if(ana->NewOutputAOD()) aodBranchList->Add(ana->GetCreateOutputAODBranch());
216  }
217 
218  return aodBranchList ;
219 }
220 
221 //____________________________________________________
223 //____________________________________________________
225 {
226  AliVEvent* event = fReader->GetInputEvent();
227  AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (event);
228  AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (event);
229 
230  fhNEvents ->Fill(0); // Number of events analyzed
231 
232  Double_t v[3];
233  event->GetPrimaryVertex()->GetXYZ(v) ;
234  fhXVertex->Fill(v[0]);
235  fhYVertex->Fill(v[1]);
236  fhZVertex->Fill(v[2]);
237 
241 
243  {
244  Float_t eventWeight = fReader->GetEventWeight();
245 
246  fhNEventsWeighted ->Fill(0., eventWeight);
247  fhTrackMultWeighted ->Fill(fReader->GetTrackMultiplicity(),eventWeight);
248  fhCentralityWeighted ->Fill(fReader->GetEventCentrality (),eventWeight);
250  }
251 
252  // Check the pT hard in MC
254  {
255  if(!strcmp(fReader->GetGenEventHeader()->ClassName(), "AliGenPythiaEventHeader"))
256  {
257  AliGenPythiaEventHeader* pygeh= (AliGenPythiaEventHeader*) fReader->GetGenEventHeader();
258 
259  Float_t pTHard = pygeh->GetPtHard();
260 
261  //printf("pT hard %f, event weight %e\n",pTHard,fReader->GetEventWeight());
262 
263  fhPtHard->Fill(pTHard);
264 
267  fhPtHardWeighted->Fill(pTHard,fReader->GetEventWeight());
268  }
269  }
270 
272  {
273  if( fReader->IsPileUpFromSPD())
274  fhNPileUpEvents->Fill(0.5);
275  //if( event->IsPileupFromSPDInMultBins())
276  // fhNPileUpEvents->Fill(1.5);
277  if( fReader->IsPileUpFromEMCal())
278  fhNPileUpEvents->Fill(2.5);
280  fhNPileUpEvents->Fill(3.5);
282  fhNPileUpEvents->Fill(4.5);
284  fhNPileUpEvents->Fill(5.5);
286  fhNPileUpEvents->Fill(6.5);
288  fhNPileUpEvents->Fill(7.5);
289 
290  Int_t triggerBC = fReader->GetTriggerClusterBC() ;
291  if( triggerBC == 0 &&
292  !fReader->IsExoticEvent() &&
294  {
295  if( fReader->IsPileUpFromSPD())
296  fhNPileUpEventsTriggerBC0->Fill(0.5);
297  //if( event->IsPileupFromSPDInMultBins())
298  // fhNPileUpEventsTriggerBC0->Fill(1.5);
299  if( fReader->IsPileUpFromEMCal())
300  fhNPileUpEventsTriggerBC0->Fill(2.5);
302  fhNPileUpEventsTriggerBC0->Fill(3.5);
304  fhNPileUpEventsTriggerBC0->Fill(4.5);
306  fhNPileUpEventsTriggerBC0->Fill(5.5);
308  fhNPileUpEventsTriggerBC0->Fill(6.5);
310  fhNPileUpEventsTriggerBC0->Fill(7.5);
311  }
312 
313  if(fReader->IsPileUpFromSPD())
315 
317 
318  for(Int_t i = 0; i < 19; i++)
319  {
321  {
322  if(fReader->GetTrackEventBC(i)) fhTrackBCEvent ->Fill(i);
324  }
325  if(fReader->GetEMCalEventBC(i)) fhEMCalBCEvent ->Fill(i);
327  }
328 
329  Int_t bc = fReader->GetVertexBC();
330  if(bc!=AliVTrack::kTOFBCNA) fhPrimaryVertexBC->Fill(bc);
331 
332  // N pile up vertices
333  Int_t nVerticesSPD = -1;
334  Int_t nVerticesTracks = -1;
335 
336  if (esdevent)
337  {
338  nVerticesSPD = esdevent->GetNumberOfPileupVerticesSPD();
339  nVerticesTracks = esdevent->GetNumberOfPileupVerticesTracks();
340 
341  }//ESD
342  else if (aodevent)
343  {
344  nVerticesSPD = aodevent->GetNumberOfPileupVerticesSPD();
345  nVerticesTracks = aodevent->GetNumberOfPileupVerticesTracks();
346  }//AOD
347 
348  fhNPileUpVertSPD ->Fill(nVerticesSPD);
349  fhNPileUpVertTracks->Fill(nVerticesTracks);
350 
351  // Time stamp
352  if(fReader->IsSelectEventTimeStampOn() && esdevent)
353  {
354  Int_t timeStamp = esdevent->GetTimeStamp();
355  Float_t timeStampFrac = 1.*(timeStamp-fReader->GetRunTimeStampMin()) /
357 
358  //printf("stamp %d, min %d, max %d, frac %f\n", timeStamp, fReader->GetRunTimeStampMin(), fReader->GetRunTimeStampMax(), timeStampFrac);
359 
360  fhTimeStampFraction->Fill(timeStampFrac);
361  }
362  }
363 }
364 
365 //___________________________________________________________
367 //___________________________________________________________
369 {
370  if(!fFillDataControlHisto) return;
371 
372  Int_t triggerBC = fReader->GetTriggerClusterBC() ;
373  Bool_t exotic = fReader->IsExoticEvent();
374  Bool_t badCluster = fReader->IsBadCellTriggerEvent();
376  Bool_t triggerMatch= fReader->IsTriggerMatched();
377  Bool_t triggerBCOK = kTRUE;
378  Int_t triggerId = fReader->GetTriggerClusterId() ;
379 
380  Bool_t reMatchOpenTime = fReader->IsTriggerMatchedOpenCuts(0);
381  Bool_t reMatchNeigbour = fReader->IsTriggerMatchedOpenCuts(1);
382  Bool_t reMatchBoth = fReader->IsTriggerMatchedOpenCuts(2);
383 
384  if(triggerId < 0)
385  {
386  //printf("Trigger id %d\n",triggerId);
387  if(triggerId == -2) fhNEventsNoTriggerFound->Fill(0);
388  triggerBCOK = kFALSE;
389  }
390 
391  if(exotic)
392  {
393  fhNExoticEvents->Fill(0) ;
394  Double_t v[3];
395  fReader->GetInputEvent()->GetPrimaryVertex()->GetXYZ(v) ;
396  fhXVertexExotic->Fill(v[0]);
397  fhYVertexExotic->Fill(v[1]);
398  fhZVertexExotic->Fill(v[2]);
399  }
400  //if(fReader->IsExoticEvent()) printf("Maker: EXOTIC Cluster trigger\n");
401 
402  if(!triggerBCOK) return;
403 
404  Int_t eventBC = fReader->GetInputEvent()->GetBunchCrossNumber();
405  if(eventBC%4 < 0 || eventBC%4 > 3 )
406  AliWarning(Form("STRANGE: Trigger BC %d - Event BC %d, modulo4 %d",triggerBC,eventBC,eventBC%4));
407 
408  if(triggerMatch)
409  {
410  if (!exotic && !badCluster) fhClusterTriggerBC->Fill(triggerBC);
411  else if( exotic && badCluster)
412  {
413  fhClusterTriggerBCBadClusterExotic->Fill(triggerBC);
414  if(badCell) fhClusterTriggerBCBadCellExotic->Fill(triggerBC);
415  }
416  else if( exotic && !badCluster) fhClusterTriggerBCExotic->Fill(triggerBC);
417  else if( badCluster && !exotic )
418  {
419  fhClusterTriggerBCBadCluster ->Fill(triggerBC);
420  if(badCell) fhClusterTriggerBCBadCell->Fill(triggerBC);
421  }
422 
423  if(!exotic) fhClusterTriggerBCEventBC ->Fill(triggerBC,eventBC%4);
424  else fhClusterTriggerBCExoticEventBC->Fill(triggerBC,eventBC%4);
425  }
426  else
427  {
428  if (!exotic && !badCluster)
429  {
430  fhClusterTriggerBCUnMatch->Fill(triggerBC);
431  if(reMatchOpenTime) fhClusterTriggerBCUnMatchReMatch[0]->Fill(triggerBC);
432  if(reMatchNeigbour) fhClusterTriggerBCUnMatchReMatch[1]->Fill(triggerBC);
433  if(reMatchBoth) fhClusterTriggerBCUnMatchReMatch[2]->Fill(triggerBC);
434  }
435  else if( exotic && badCluster)
436  {
438  if(badCell) fhClusterTriggerBCBadCellExoticUnMatch ->Fill(triggerBC);
439  }
440  else if( exotic && !badCluster)
441  {
442  fhClusterTriggerBCExoticUnMatch->Fill(triggerBC);
443  if(reMatchOpenTime) fhClusterTriggerBCExoticUnMatchReMatch[0]->Fill(triggerBC);
444  if(reMatchNeigbour) fhClusterTriggerBCExoticUnMatchReMatch[1]->Fill(triggerBC);
445  if(reMatchBoth) fhClusterTriggerBCExoticUnMatchReMatch[2]->Fill(triggerBC);
446  }
447  else if( badCluster && !exotic )
448  {
449  fhClusterTriggerBCBadClusterUnMatch->Fill(triggerBC);
450  if(badCell)fhClusterTriggerBCBadCellUnMatch->Fill(triggerBC);
451  }
452 
453  if(!exotic) fhClusterTriggerBCEventBCUnMatch ->Fill(triggerBC,eventBC%4);
454  else fhClusterTriggerBCExoticEventBCUnMatch->Fill(triggerBC,eventBC%4);
455  }
456 }
457 
458 //_______________________________________________________
461 //_______________________________________________________
463 {
464  // Reader cuts
465  TObjString * objstring = fReader->GetListOfParameters();
466  fCuts->Add(objstring);
467 
468  // Analysis wagons cuts
469  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
470  {
472  objstring = ana->GetAnalysisCuts();
473 
474  if ( objstring ) fCuts->Add(objstring);
475  }
476 
477  return fCuts ;
478 }
479 
480 //___________________________________________________
484 //___________________________________________________
486 {
487  // General event histograms
488 
489  fhNEventsIn = new TH1F("hNEventsIn", "Number of input events" , 1 , 0 , 1 ) ;
490  fhNEventsIn->SetYTitle("# events");
492 
493  fhNEvents = new TH1F("hNEvents", "Number of analyzed events" , 1 , 0 , 1 ) ;
494  fhNEvents->SetYTitle("# events");
496 
497  fhXVertex = new TH1F("hXVertex", " X vertex distribution" , 200 , -4 , 4 ) ;
498  fhXVertex->SetXTitle("v_{x} (cm)");
500 
501  fhYVertex = new TH1F("hYVertex", " Y vertex distribution" , 200 , -4 , 4 ) ;
502  fhYVertex->SetXTitle("v_{y} (cm)");
504 
505  fhZVertex = new TH1F("hZVertex", " Z vertex distribution" , 200 , -50 , 50 ) ;
506  fhZVertex->SetXTitle("v_{z} (cm)");
508 
509  fhCentrality = new TH1F("hCentrality","Number of events in centrality bin", 100, 0., 100) ;
510  fhCentrality->SetXTitle("Centrality bin");
512 
513  fhEventPlaneAngle = new TH1F("hEventPlaneAngle","Number of events in event plane", 100, 0., TMath::Pi()) ;
514  fhEventPlaneAngle->SetXTitle("EP angle (rad)");
516 
517  fhTrackMult = new TH1F("hTrackMult", "Number of tracks per events", 2000 , 0 , 2000) ;
518  fhTrackMult->SetXTitle("# tracks");
520 
521  if(fCheckPtHard)
522  {
523  fhPtHard = new TH1F("hPtHard"," #it{p}_{T}-hard for selected triggers",300,0,300);
524  fhPtHard->SetXTitle("#it{p}_{T}^{hard} (GeV/#it{c})");
526 
529  {
530  fhPtHardWeighted = new TH1F("hPtHardWeighted"," #it{p}_{T}-hard for selected triggers, weighted by cross section",300,0,300);
531  fhPtHardWeighted->SetXTitle("#it{p}_{T}^{hard} (GeV/#it{c})");
533  }
534  }
535 
536  if ( GetReader()->GetWeightUtils()->IsCentralityWeightOn() )
537  {
538  fhNEventsWeighted = new TH1F("hNEventsWeighted", "Number of analyzed events weighted by centrality", 1 , 0 , 1 ) ;
539  fhNEventsWeighted->SetYTitle("# events");
541 
542  fhCentralityWeighted = new TH1F("hCentralityWeighted","Number of events in centrality bin weighted by centrality", 100, 0.,100) ;
543  fhCentralityWeighted->SetXTitle("Centrality bin");
545 
546  fhEventPlaneAngleWeighted = new TH1F("hEventPlaneAngleWeighted","Number of events in event plane weighted by centrality",100, 0., TMath::Pi()) ;
547  fhEventPlaneAngleWeighted->SetXTitle("EP angle (rad)");
549 
550  fhTrackMultWeighted = new TH1F("hTrackMultWeighted", "Number of tracks per events weighted by centrality", 2000 , 0 , 2000) ;
551  fhTrackMultWeighted->SetXTitle("# tracks");
553  }
554 
556  {
557  fhNExoticEvents = new TH1F("hNExoticEvents", "Number of analyzed events triggered by exotic cluster" , 1 , 0 , 1 ) ;
558  fhNExoticEvents->SetYTitle("# exotic events");
560 
561  fhNEventsNoTriggerFound = new TH1F("hNEventsNoTriggerFound", "Number of analyzed events triggered but no trigger found" , 1 , 0 , 1 ) ;
562  fhNEventsNoTriggerFound->SetYTitle("# exotic events");
564 
565 
566  Int_t nbin = 11;
567  Float_t minbin =-5.5;
568  Float_t maxbin = 5.5;
569  Int_t labelshift = 6;
570 
571  fhClusterTriggerBCEventBC = new TH2F("hClusterTriggerBCEventBC", "Found trigger BC and Event BC",
572  nbin , minbin ,maxbin,4,0, 4) ;
573  fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
574  for(Int_t i = 0; i < 4; i++)
575  fhClusterTriggerBCEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
576  fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
577  for(Int_t i = 1; i < 12; i++)
578  fhClusterTriggerBCEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
579  fhClusterTriggerBCEventBC->SetYTitle("Event BC%4");
581 
582  fhClusterTriggerBCExoticEventBC = new TH2F("hClusterTriggerBCExoticEventBC", "Found exotic trigger BC and Event BC",
583  nbin , minbin ,maxbin,4,1, 4) ;
584  for(Int_t i = 0; i < 4; i++)
585  fhClusterTriggerBCExoticEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
586  fhClusterTriggerBCExoticEventBC->SetXTitle("cluster trigger BC");
587  for(Int_t i = 1; i < 12; i++)
588  fhClusterTriggerBCExoticEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
589  fhClusterTriggerBCExoticEventBC->SetYTitle("Event BC%4");
591 
592  fhClusterTriggerBCEventBCUnMatch = new TH2F("hClusterTriggerBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
593  nbin , minbin ,maxbin,4,1, 4) ;
594  for(Int_t i = 0; i < 4; i++)
595  fhClusterTriggerBCEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
596  fhClusterTriggerBCEventBCUnMatch->SetXTitle("cluster trigger BC");
597  for(Int_t i = 1; i < 12; i++)
598  fhClusterTriggerBCEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
599  fhClusterTriggerBCEventBCUnMatch->SetYTitle("Event BC%4");
601 
602  fhClusterTriggerBCExoticEventBCUnMatch = new TH2F("hClusterTriggerExoticBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
603  nbin , minbin ,maxbin,4,1, 4) ;
604  for(Int_t i = 0; i < 4; i++)
605  fhClusterTriggerBCExoticEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
606  fhClusterTriggerBCExoticEventBCUnMatch->SetXTitle("cluster trigger BC");
607  for(Int_t i = 1; i < 12; i++)
608  fhClusterTriggerBCExoticEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
609  fhClusterTriggerBCExoticEventBCUnMatch->SetYTitle("Event BC%4");
611 
612  fhClusterTriggerBC = new TH1F("hClusterTriggerBC",
613  "Number of analyzed events triggered by a cluster in a given BC",
614  nbin , minbin ,maxbin) ;
615  fhClusterTriggerBC->SetYTitle("# events");
616  for(Int_t i = 1; i < 12; i++)
617  fhClusterTriggerBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
619 
620  fhClusterTriggerBCExotic = new TH1F("hClusterTriggerBCExotic",
621  "Number of analyzed events triggered by a exotic cluster in a given BC",
622  nbin , minbin ,maxbin) ;
623  fhClusterTriggerBCExotic->SetYTitle("# events");
624  for(Int_t i = 1; i < 12; i++)
625  fhClusterTriggerBCExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
627 
628 
629  fhClusterTriggerBCBadCell = new TH1F("hClusterTriggerBCBadCell",
630  "Number of analyzed events triggered by a bad cell in a given BC",
631  nbin , minbin ,maxbin) ;
632 
633  fhClusterTriggerBCBadCell->SetYTitle("# events");
634  for(Int_t i = 1; i < 12; i++)
635  fhClusterTriggerBCBadCell->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
637 
638  fhClusterTriggerBCBadCellExotic = new TH1F("hClusterTriggerBCBadCellExotic",
639  "Number of analyzed events triggered by a bad cell & exotic cluster in a given BC",
640  nbin , minbin ,maxbin) ;
641  fhClusterTriggerBCBadCellExotic->SetYTitle("# events");
642  for(Int_t i = 1; i < 12; i++)
643  fhClusterTriggerBCBadCellExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
645 
646  fhClusterTriggerBCBadCluster = new TH1F("hClusterTriggerBCBadCluster",
647  "Number of analyzed events triggered by a bad cluster in a given BC",
648  nbin , minbin ,maxbin) ;
649 
650  fhClusterTriggerBCBadCluster->SetYTitle("# events");
651  for(Int_t i = 1; i < 12; i++)
652  fhClusterTriggerBCBadCluster->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
654 
655 
656  fhClusterTriggerBCBadClusterExotic = new TH1F("hClusterTriggerBCBadClusterExotic",
657  "Number of analyzed events triggered by a bad cluster & exotic cluster in a given BC",
658  nbin , minbin ,maxbin) ;
659 
660  fhClusterTriggerBCBadClusterExotic->SetYTitle("# events");
661  for(Int_t i = 1; i < 12; i++)
662  fhClusterTriggerBCBadClusterExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
664 
665  fhClusterTriggerBCUnMatch = new TH1F("hClusterTriggerBCUnMatch",
666  "Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC",
667  nbin , minbin ,maxbin) ;
668  fhClusterTriggerBCUnMatch->SetYTitle("# events");
669  for(Int_t i = 1; i < 12; i++)
670  fhClusterTriggerBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
672 
673  fhClusterTriggerBCExoticUnMatch = new TH1F("hClusterTriggerBCExoticUnMatch",
674  "Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC",
675  nbin , minbin ,maxbin) ;
676  fhClusterTriggerBCExoticUnMatch->SetYTitle("# events");
677  for(Int_t i = 1; i < 12; i++)
678  fhClusterTriggerBCExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
680 
681 
682  fhClusterTriggerBCBadCellUnMatch = new TH1F("hClusterTriggerBCBadCellUnMatch",
683  "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
684  nbin , minbin ,maxbin) ;
685  fhClusterTriggerBCBadCellUnMatch->SetYTitle("# events");
686  for(Int_t i = 1; i < 12; i++)
687  fhClusterTriggerBCBadCellUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
689 
690 
691  fhClusterTriggerBCBadCellExoticUnMatch = new TH1F("hClusterTriggerBCBadCellExoticUnMatch",
692  "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
693  nbin , minbin ,maxbin) ;
694  fhClusterTriggerBCBadCellExoticUnMatch->SetYTitle("# events");
695  for(Int_t i = 1; i < 12; i++)
696  fhClusterTriggerBCBadCellExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
698 
699 
700  fhClusterTriggerBCBadClusterUnMatch = new TH1F("hClusterTriggerBCBadClusterUnMatch",
701  "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
702  nbin , minbin ,maxbin) ;
703  fhClusterTriggerBCBadClusterUnMatch->SetYTitle("# events");
704  for(Int_t i = 1; i < 12; i++)
705  fhClusterTriggerBCBadClusterUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
707 
708 
709  fhClusterTriggerBCBadClusterExoticUnMatch = new TH1F("hClusterTriggerBCBadClusterExoticUnMatch",
710  "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
711  nbin , minbin ,maxbin) ;
712  fhClusterTriggerBCBadClusterExoticUnMatch->SetYTitle("# events");
713  for(Int_t i = 1; i < 12; i++)
714  fhClusterTriggerBCBadClusterExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
716 
717  TString rematch[] = {"OpenTime","CheckNeighbours","Both"};
718  for(Int_t j = 0; j < 3; j++)
719  {
720  fhClusterTriggerBCUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCUnMatch_ReMatch_%s",rematch[j].Data()),
721  Form("Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
722  nbin , minbin ,maxbin) ;
723  fhClusterTriggerBCUnMatchReMatch[j]->SetYTitle("# events");
724  for(Int_t i = 1; i < 12; i++)
725  fhClusterTriggerBCUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
727 
728  fhClusterTriggerBCExoticUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCExoticUnMatch_ReMatch_%s",rematch[j].Data()),
729  Form("Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
730  nbin , minbin ,maxbin) ;
731  fhClusterTriggerBCExoticUnMatchReMatch[j]->SetYTitle("# events");
732  for(Int_t i = 1; i < 12; i++)
733  fhClusterTriggerBCExoticUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
735  }
736 
737  fhNPileUpEvents = new TH1F("hNPileUpEvents", "Number of events considered as pile-up", 8 , 0 , 8 ) ;
738  fhNPileUpEvents->SetYTitle("# events");
739  fhNPileUpEvents->GetXaxis()->SetBinLabel(1 ,"SPD");
740  fhNPileUpEvents->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
741  fhNPileUpEvents->GetXaxis()->SetBinLabel(3 ,"EMCal");
742  fhNPileUpEvents->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
743  fhNPileUpEvents->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
744  fhNPileUpEvents->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
745  fhNPileUpEvents->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
746  fhNPileUpEvents->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
748 
749  fhNPileUpEventsTriggerBC0 = new TH1F("hNPileUpEventsTriggerBC0","Number of events considered as pile-up, trigger cluster in BC=0", 8 , 0 , 8 ) ;
750  fhNPileUpEventsTriggerBC0->SetYTitle("# events");
751  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(1 ,"SPD");
752  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
753  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(3 ,"EMCal");
754  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
755  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
756  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
757  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
758  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
760 
762  {
763  fhTrackBCEvent = new TH1F("hTrackBCEvent", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
764  fhTrackBCEvent->SetYTitle("# events");
765  fhTrackBCEvent->SetXTitle("Bunch crossing");
766  for(Int_t i = 1; i < 20; i++)
767  fhTrackBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
769 
770  fhTrackBCEventCut = new TH1F("hTrackBCEventCut", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
771  fhTrackBCEventCut->SetYTitle("# events");
772  fhTrackBCEventCut->SetXTitle("Bunch crossing");
773  for(Int_t i = 1; i < 20; i++)
774  fhTrackBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
776  }
777 
778  fhPrimaryVertexBC = new TH1F("hPrimaryVertexBC", "Number of primary vertex per bunch crossing ", 41 , -20 , 20 ) ;
779  fhPrimaryVertexBC->SetYTitle("# events");
780  fhPrimaryVertexBC->SetXTitle("Bunch crossing");
782 
783  fhEMCalBCEvent = new TH1F("hEMCalBCEvent", "Number of events with at least 1 cluster in a bunch crossing ", 19 , 0 , 19 ) ;
784  fhEMCalBCEvent->SetYTitle("# events");
785  fhEMCalBCEvent->SetXTitle("Bunch crossing");
786  for(Int_t i = 1; i < 20; i++)
787  fhEMCalBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
789 
790  fhEMCalBCEventCut = new TH1F("hEMCalBCEventCut", "Number of events with at least 1 cluster in a bunch crossing", 19 , 0 , 19 ) ;
791  fhEMCalBCEventCut->SetYTitle("# events");
792  fhEMCalBCEventCut->SetXTitle("Bunch crossing");
793  for(Int_t i = 1; i < 20; i++)
794  fhEMCalBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
796 
797  fhXVertexExotic = new TH1F("hXVertexExotic", " X vertex distribution in exotic events" , 200 , -4 , 4 ) ;
798  fhXVertexExotic->SetXTitle("v_{x} (cm)");
800 
801  fhYVertexExotic = new TH1F("hYVertexExotic", " Y vertex distribution in exotic events" , 200 , -4 , 4 ) ;
802  fhYVertexExotic->SetXTitle("v_{y} (cm)");
804 
805  fhZVertexExotic = new TH1F("hZVertexExotic", " Z vertex distribution in exotic events" , 200 , -50 , 50 ) ;
806  fhZVertexExotic->SetXTitle("v_{z} (cm)");
808 
809  fhPileUpClusterMult = new TH1F("hPileUpClusterMult", "Number of clusters per event with large time (|t| > 20 ns)" , 100 , 0 , 100 ) ;
810  fhPileUpClusterMult->SetXTitle("# clusters");
812 
813  fhPileUpClusterMultAndSPDPileUp = new TH1F("hPileUpClusterMultAndSPDPileUp", "Number of clusters per event with large time (|t| > 20 ns, events tagged as pile-up by SPD)" , 100 , 0 , 100 ) ;
814  fhPileUpClusterMultAndSPDPileUp->SetXTitle("# clusters");
816 
817  fhNPileUpVertSPD = new TH1F ("hNPileUpVertSPD","N pile-up SPD vertex", 50,0,50);
818  fhNPileUpVertSPD->SetYTitle("# vertex ");
820 
821  fhNPileUpVertTracks = new TH1F ("hNPileUpVertTracks","N pile-up Tracks vertex", 50,0,50);
822  fhNPileUpVertTracks->SetYTitle("# vertex ");
824 
826  {
827  fhTimeStampFraction = new TH1F("hTimeStampFraction","Fraction of events within a given time stamp range",150, -1, 2) ;
828  fhTimeStampFraction->SetXTitle("fraction");
830  }
831  }
832 
833  fhNMergedFiles = new TH1F("hNMergedFiles", "Number of merged output files" , 1 , 0 , 1 ) ;
834  fhNMergedFiles->SetYTitle("# files");
835  fhNMergedFiles->Fill(1); // Fill here with one entry, while merging it will count the rest
837 
838  if(fScaleFactor > 0)
839  {
840  fhScaleFactor = new TH1F("hScaleFactor", "Number of merged output files" , 1 , 0 , 1 ) ;
841  fhScaleFactor->SetYTitle("scale factor");
842  fhScaleFactor->SetBinContent(1,fScaleFactor); // Fill here
844  }
845 
846  // Histograms defined and filled in this class, just get the pointers
847  // and add them to the list.
848  if(GetReader()->GetWeightUtils()->IsMCCrossSectionCalculationOn())
849  {
851 
852  if ( templist && templist->GetEntries() == 2 )
853  {
854  templist->SetOwner(kFALSE); //Owner is fOutputContainer.
855 
856  fOutputContainer->Add(templist->At(0));
857  fOutputContainer->Add(templist->At(1));
858  }
859  }
860 
861  // --------------------------------
862  // Add control histograms in Reader
863  // --------------------------------
864 
865  TList * templist = fReader->GetCreateControlHistograms();
866  templist->SetOwner(kFALSE); //Owner is fOutputContainer.
867 
868  for(Int_t ih = 0; ih < templist->GetEntries() ; ih++)
869  {
870  //if ( fSumw2 ) ((TH1*) templist->At(ih))->Sumw2();
871 
872  //printf("histo %d %p %s\n",ih,templist->At(ih), templist->At(ih)->GetName());
873 
874  //Add histogram to general container
875  fOutputContainer->Add(templist->At(ih)) ;
876  }
877 
878  delete templist;
879 
880  // ------------------------
881  // Add analysis histograms
882  // ------------------------
883 
884  if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
885  {
886  AliWarning("Analysis job list not initialized!!!");
887  return fOutputContainer;
888  }
889 
890  const Int_t buffersize = 255;
891  char newname[buffersize];
892 
893  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
894  {
896 
897  if(fMakeHisto) // Analysis with histograms as output on
898  {
899  //Fill container with appropriate histograms
900  templist = ana->GetCreateOutputObjects();
901  templist->SetOwner(kFALSE); //Owner is fOutputContainer.
902 
903  for(Int_t i = 0; i < templist->GetEntries(); i++)
904  {
905  //Add only to the histogram name the name of the task
906  if( strcmp((templist->At(i))->ClassName(),"TObjString") )
907  {
908  snprintf(newname,buffersize, "%s%s", (ana->GetAddedHistogramsStringToName()).Data(), (templist->At(i))->GetName());
909  //printf("name %s, new name %s\n",(templist->At(i))->GetName(),newname);
910 
911  ((TH1*) templist->At(i))->SetName(newname);
912 
913  if ( fSumw2 ) ((TH1*) templist->At(i))->Sumw2();
914  }
915 
916  //Add histogram to general container
917  fOutputContainer->Add(templist->At(i)) ;
918  }
919 
920  delete templist;
921 
922  }// Analysis with histograms as output on
923 
924  }//Loop on analysis defined
925 
926  // Initialize calorimeters geometry pointers
927  //GetCaloUtils()->InitPHOSGeometry();
928  //GetCaloUtils()->InitEMCALGeometry();
929 
930  return fOutputContainer;
931 }
932 
933 //___________________________________
938 //___________________________________
940 {
941  // Activate debug level in maker
942  if( fAnaDebug >= 0 )
943  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(this->ClassName(),fAnaDebug);
944 
945  //Initialize reader
946  GetReader()->Init();
947  GetReader()->SetCaloUtils(GetCaloUtils()); // pass the calo utils pointer to the reader
948 
949  // Activate debug level in reader
950  if( fReader->GetDebug() >= 0 )
951  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(fReader->ClassName(), fReader->GetDebug());
952 
953  // Activate debug level in calo utils
954  if( fCaloUtils->GetDebug() >= 0 )
955  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(fCaloUtils->ClassName(), fCaloUtils->GetDebug());
956 
957  if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
958  {
959  AliWarning("Analysis job list not initialized");
960  return;
961  }
962 
963  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
964  {
966 
967  ana->SetReader(fReader); // Set Reader for each analysis
968  ana->SetCaloUtils(fCaloUtils); // Set CaloUtils for each analysis
969 
970  ana->Init();
971  ana->InitDebug();
972  }//Loop on analysis defined
973 }
974 
975 //_____________________________________________
977 //_____________________________________________
979 {
980  fMakeHisto = kTRUE;
981  fMakeAOD = kTRUE;
982  fAnaDebug = 0; // No debugging info displayed by default
983 }
984 
985 //______________________________________________________________
987 //______________________________________________________________
989 {
990  if(! opt)
991  return;
992 
993  printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
994  printf("Debug level = %d\n", fAnaDebug ) ;
995  printf("Produce Histo = %d\n", fMakeHisto ) ;
996  printf("Produce AOD = %d\n", fMakeAOD ) ;
997  printf("Number of analysis tasks = %d\n", fAnalysisContainer->GetEntries()) ;
998 
999  if(!strcmp("all",opt))
1000  {
1001  printf("Print analysis Tasks settings :\n") ;
1002  for(Int_t iana = 0; iana<fAnalysisContainer->GetEntries(); iana++)
1003  {
1005  }
1006 
1007  printf("Print analysis Reader settings :\n") ;
1008  fReader->Print("");
1009  printf("Print analysis Calorimeter Utils settings :\n") ;
1010  fCaloUtils->Print("");
1011  }
1012 }
1013 
1014 //_____________________________________________________________________________________
1024 //_____________________________________________________________________________________
1025 void AliAnaCaloTrackCorrMaker::ProcessEvent(Int_t iEntry, const char * currentFileName)
1026 {
1028  AliFatal("Histograms not initialized");
1029 
1030  AliDebug(1,Form("*** AliAnaCaloTrackCorrMaker::ProcessEvent() Event %d ***",iEntry));
1031  AliDebug(2,Form("Current File Name : %s", currentFileName));
1032  //printf("fAODBranchList %p, entries %d\n",fAODBranchList,fAODBranchList->GetEntries());
1033 
1034  // Each event needs an empty branch
1035  TList * aodList = fReader->GetAODBranchList();
1036  Int_t nAODBranches = aodList->GetEntries();
1037  for(Int_t iaod = 0; iaod < nAODBranches; iaod++)
1038  {
1039  TClonesArray *tca = dynamic_cast<TClonesArray*> (aodList->At(iaod));
1040  if(tca) tca->Clear("C");
1041  }
1042 
1043  // Set geometry matrices before filling arrays, in case recalibration/position calculation etc is needed
1045 
1046  // Set the AODB calibration, bad channels etc. parameters at least once
1048 
1049  // Tell the reader to fill the data in the 3 detector lists
1050  Bool_t ok = fReader->FillInputEvent(iEntry, currentFileName);
1051 
1052  // Access pointers, and trigger mask check needed in mixing case
1053  AliAnalysisManager *manager = AliAnalysisManager::GetAnalysisManager();
1054  AliInputEventHandler *inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
1055 
1056  UInt_t isMBTrigger = kFALSE;
1057  UInt_t isTrigger = kFALSE;
1058  if(inputHandler)
1059  {
1060  isMBTrigger = inputHandler->IsEventSelected() & fReader->GetMixEventTriggerMask();
1061  isTrigger = inputHandler->IsEventSelected() & fReader->GetEventTriggerMask();
1062  }
1063 
1064  //Fill trigger control histograms, make sure it is only for triggered events and
1065  // not the MB events used for mixing
1066  if(fReader->IsEventTriggerAtSEOn() || isTrigger)
1067  {
1068  fhNEventsIn->Fill(0);
1070  }
1071 
1072  if(!ok)
1073  {
1074  AliDebug(1,Form("*** Skip event *** %d",iEntry));
1075  fReader->ResetLists();
1076  return ;
1077  }
1078 
1079  // Magic line to write events to file
1080  if(fReader->WriteDeltaAODToFile())AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
1081 
1082  //printf(">>>>>>>>>> BEFORE >>>>>>>>>>>\n");
1083  //gObjectTable->Print();
1084 
1085  // Init mag field for tracks in case of ESDs, not really necessary
1086  if ( !TGeoGlobalMagField::Instance()->GetField() && fReader->GetInputEvent() )
1087  (fReader->GetInputEvent())->InitMagneticField();
1088 
1089  // Loop on analysis algorithms
1090 
1091  AliDebug(1,"*** Begin analysis ***");
1092 
1093  Int_t nana = fAnalysisContainer->GetEntries() ;
1094  for(Int_t iana = 0; iana < nana; iana++)
1095  {
1097 
1098  ana->ConnectInputOutputAODBranches(); // Sets branches for each analysis
1099 
1100  //Fill pool for mixed event for the analysis that need it
1101  if(!fReader->IsEventTriggerAtSEOn() && isMBTrigger)
1102  {
1103  ana->FillEventMixPool();
1104  if(!isTrigger) continue; // pool filled do not try to fill AODs or histograms if trigger is not MB
1105  }
1106 
1107  //Make analysis, create aods in aod branch and in some cases fill histograms
1108  if(fMakeAOD ) ana->MakeAnalysisFillAOD() ;
1109 
1110  //Make further analysis with aod branch and fill histograms
1112 
1113  }
1114 
1115  fReader->ResetLists();
1116 
1117  // In case of mixing analysis, non triggered events are used,
1118  // do not fill control histograms for a non requested triggered event
1119  if(!fReader->IsEventTriggerAtSEOn() && !isTrigger)
1120  {
1121  AliDebug(1,"*** End analysis, MB for mixing ***");
1122  return;
1123  }
1124 
1126 
1127  //printf(">>>>>>>>>> AFTER >>>>>>>>>>>\n");
1128  //gObjectTable->Print();
1129 
1130  AliDebug(1,"*** End analysis ***");
1131 }
1132 
1133 //__________________________________________________________
1136 //__________________________________________________________
1138 {
1139  if (!outputList)
1140  {
1141  AliError("No output list");
1142  return;
1143  }
1144 
1145  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
1146  {
1148  if(ana->MakePlotsOn())ana->Terminate(outputList);
1149  } // Loop on analysis defined
1150 }
1151 
1152 
1153 
TH2F * fhClusterTriggerBCExoticEventBCUnMatch
! Correlate the found BC in the exotic trigger and the event BC, when there was no match with the tri...
Bool_t IsPileUpFromSPD() const
TH1F * fhTimeStampFraction
! event fraction depending on Time Stamp, only if activated on reader.
TH1F * fhNEvents
! Number of acepted events counter histogram.
virtual void SetCaloUtils(AliCalorimeterUtils *caloutils)
virtual Int_t GetDebug() const
Bool_t IsBadMaxCellTriggerEvent() const
TH2F * fhClusterTriggerBCEventBC
! Correlate the found BC in the trigger and the event BC.
TH1F * fhEMCalBCEventCut
! N events depending on the existence of a cluster above acceptance and E cut in a given bunch crossi...
void ana(Int_t mode=mGRID)
Definition: ana.C:86
TH1F * fhClusterTriggerBCUnMatchReMatch[3]
! Number of events triggered, depending on BC of the cluster, not matched, open cuts and rematch...
TList * GetCreateOutputHistograms()
double Double_t
Definition: External.C:58
TH2F * fhClusterTriggerBCExoticEventBC
! Correlate the found BC in the exotic trigger and the event BC.
TList * fCuts
! List with analysis cuts.
TH1F * fhClusterTriggerBCBadClusterUnMatch
! Number of events triggered, depending on BC of the cluster.
Definition: External.C:236
TH1F * fhPtHardWeighted
! pt of parton, only for MC generation (pythia jet-jet/gamma-jet), weighted by cross section ...
TH1F * fhZVertexExotic
! Z Vertex distribution of exotic event.
TH1F * fhNPileUpVertTracks
! Number of pile-up vertices from tracks.
TH1F * fhClusterTriggerBCBadCell
! Number of events triggered, depending on BC of the cluster.
TH1F * fhNEventsIn
! Number of input events counter histogram.
void InitParameters()
Init data members.
TH1F * fhClusterTriggerBCBadCluster
! Number of events triggered, depending on BC of the cluster.
AliCalorimeterUtils * fCaloUtils
Pointer to AliCalorimeterUtils.
Bool_t WriteDeltaAODToFile() const
Int_t GetVertexBC(const AliVVertex *vtx)
TH1F * fhScaleFactor
! Factor to scale histograms.
virtual AliVEvent * GetInputEvent() const
TH1F * fhTrackBCEventCut
! N events depending on the existence of a track above acceptance and pt cut in a given bunch crossin...
Bool_t IsPileUpFromSPDAndNotEMCal() const
Check if event is from pile-up determined by SPD and not by EMCal.
void AddAnalysis(TObject *ana, Int_t n)
Add analysis depending on AliAnaCaloTrackCorrBaseClass to list.
TH1F * fhClusterTriggerBCBadCellExoticUnMatch
! Number of events triggered, depending on BC of the cluster.
TH1F * fhNEventsWeighted
! Number of acepted events counter histogram. After centrality weight.
TH1F * fhEMCalBCEvent
! N events depending on the existence of a cluster in a given bunch crossing.
Double_t GetRunTimeStampMin() const
Double_t fScaleFactor
Scaling factor needed for normalization.
TH1F * fhXVertexExotic
! X Vertex distribution of exotic event.
TH2F * fhClusterTriggerBCEventBCUnMatch
! Correlate the found BC in the trigger and the event BC, when there was no match with the trigger BC...
virtual Int_t GetEventCentrality() const
virtual AliGenEventHeader * GetGenEventHeader() const
Bool_t IsCentralityWeightOn() const
Definition: AliAnaWeights.h:62
Bool_t IsTriggerMatchedOpenCuts(Int_t i) const
Bool_t IsPileUpFromNotSPDAndNotEMCal() const
Check if event not from pile-up determined neither by SPD nor by EMCal.
void FillTriggerControlHistograms()
Fill here EMCal triggered events control histograms.
TH1F * fhTrackBCEvent
! N events depending on the existence of a track in a given bunch crossing.
TH1F * fhNPileUpEventsTriggerBC0
! N events pasing pile up cut.
TH1F * fhNMergedFiles
! Number of files merged.
virtual Bool_t FillInputEvent(Int_t iEntry, const char *currentFileName)
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
TH1F * fhXVertex
! X Vertex distribution of accepted event.
Bool_t IsPileUpFromSPDOrEMCal() const
Check if event is from pile-up determined by SPD or EMCal.
Bool_t IsPileUpFromEMCalAndNotSPD() const
Check if event is from pile-up determined by EMCal, not by SPD.
Double_t GetRunTimeStampMax() const
TH1F * fhClusterTriggerBC
! Number of events triggered, depending on BC of the cluster.
Base class for CaloTrackCorr analysis algorithms.
TH1F * fhClusterTriggerBCBadClusterExoticUnMatch
! Number of events triggered, depending on BC of the cluster.
int Int_t
Definition: External.C:63
unsigned int UInt_t
Definition: External.C:33
virtual TList * GetAODBranchList() const
float Float_t
Definition: External.C:68
Bool_t IsTriggerMatched() const
virtual Int_t GetDebug() const
Bool_t IsMCCrossSectionJustHistoFillOn() const
Definition: AliAnaWeights.h:80
TH1F * fhTrackMultWeighted
! Number of tracks per event histogram. After centrality weight.
virtual TObjString * GetListOfParameters()
Save parameters used for analysis in a string.
Bool_t fMakeHisto
If true makes final analysis with histograms as output.
Bool_t fSumw2
Call the histograms method Sumw2() after initialization, off by default, too large memory booking...
TH1F * fhNExoticEvents
! Number of events triggered by exotic, counter histogram.
TH1F * fhClusterTriggerBCExoticUnMatch
! Number of events triggered, depending on BC of the cluster.
Int_t GetTriggerClusterBC() const
Double_t GetEventWeight() const
UInt_t GetEventTriggerMask() const
Bool_t fFillDataControlHisto
Fill histograms only interesting with data.
TH1F * fhYVertex
! Y Vertex distribution of accepted event.
virtual void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
virtual TString GetAddedHistogramsStringToName() const
Bool_t IsMCCrossSectionCalculationOn() const
Definition: AliAnaWeights.h:79
TH1F * fhPileUpClusterMult
! N clusters with high time.
TH1F * fhTrackMult
! Number of tracks per event histogram.
Int_t GetEMCalEventBC(Int_t bc) const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
void ProcessEvent(Int_t iEntry, const char *currentFileName)
TH1F * fhClusterTriggerBCBadCellExotic
! Number of events triggered, depending on BC of the cluster.
TH1F * fhNPileUpEvents
! N events pasing pile up cut.
void SetCaloUtils(AliCalorimeterUtils *caloutils)
Bool_t fCheckPtHard
For MC done in pT-Hard bins, plot specific histogram.
Bool_t IsAccessToTrackTimeOn() const
TH1F * fhClusterTriggerBCBadCellUnMatch
! Number of events triggered, depending on BC of the cluster.
TH1F * fhNEventsNoTriggerFound
! Number of events where whatever was done, no trigger is found.
virtual ~AliAnaCaloTrackCorrMaker()
Destructor. Remove only owned pointers.
TH1F * fhEventPlaneAngle
! Histogram with Event plane angle.
virtual void SetReader(AliCaloTrackReader *reader)
UInt_t GetMixEventTriggerMask() const
virtual void ResetLists()
Reset lists, called in AliAnaCaloTrackCorrMaker.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Bool_t IsExoticEvent() const
TH1F * fhClusterTriggerBCExotic
! Number of events triggered, depending on BC of the cluster.
virtual TClonesArray * GetCreateOutputAODBranch()
Create AOD branch filled in the analysis.
Bool_t IsEventTriggerAtSEOn() const
TH1F * fhCentrality
! Histogram with centrality bins.
TH1F * fhZVertex
! Z Vertex distribution of accepted event.
virtual Double_t GetEventPlaneAngle() const
const char Option_t
Definition: External.C:48
TH1F * fhClusterTriggerBCExoticUnMatchReMatch[3]
! Number of events triggered by exotic, depending on BC of the clusterm not matched, open cuts and rematch.
Int_t GetTrackEventBC(Int_t bc) const
Bool_t IsPileUpFromEMCal() const
Check if event is from pile-up determined by EMCal.
TH1F * fhClusterTriggerBCBadClusterExotic
! Number of events triggered, depending on BC of the cluster.
void FillControlHistograms()
Fill here event control histograms.
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
bool Bool_t
Definition: External.C:53
TH1F * fhYVertexExotic
! Y Vertex distribution of exotic event.
TH1F * fhPtHard
! pt of parton, only for MC generation (pythia jet-jet/gamma-jet)
AliCaloTrackReader * GetReader()
void AccessGeometry(AliVEvent *inputEvent)
Int_t GetTrackMultiplicity() const
virtual TList * GetCreateControlHistograms()
AliCalorimeterUtils * GetCaloUtils()
AliAnaWeights * GetWeightUtils()
TH1F * fhCentralityWeighted
! Histogram with centrality bins. After centrality weight.
Bool_t fMakeAOD
If true makes analysis generating AODs.
void AccessOADB(AliVEvent *event)
TH1F * fhPrimaryVertexBC
! Primary vertex BC.
TList * fOutputContainer
! Output histograms container.
Int_t GetEMCalEventBCcut(Int_t bc) const
TH1F * fhPileUpClusterMultAndSPDPileUp
! N clusters with high time in events tagged as pile-up by SPD.
Bool_t IsBadCellTriggerEvent() const
AliCaloTrackReader * fReader
Pointer to AliCaloTrackReader.
TList * fAnalysisContainer
List with analysis pointers.
Definition: External.C:196
TH1F * fhNPileUpVertSPD
! Number of pile-up vertices from SPD.
Int_t GetTrackEventBCcut(Int_t bc) const
Bool_t IsPileUpFromSPDAndEMCal() const
Check if event is from pile-up determined by SPD and EMCal.
TH1F * fhClusterTriggerBCUnMatch
! Number of events triggered, depending on BC of the cluster.
Int_t GetTriggerClusterId() const
TH1F * fhEventPlaneAngleWeighted
! Histogram with Event plane angle. After centrality weight.
Steering class of package CaloTrackCorrelartions.