AliPhysics  bf041da (bf041da)
 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 fhNEventsIn(maker.fhNEventsIn),
104 fhNEvents(maker.fhNEvents),
105 fhNExoticEvents(maker.fhNExoticEvents),
106 fhNEventsNoTriggerFound(maker.fhNEventsNoTriggerFound),
107 fhNPileUpEvents(maker.fhNPileUpEvents),
108 fhNPileUpEventsTriggerBC0(maker.fhNPileUpEventsTriggerBC0),
109 fhXVertex(maker.fhXVertex),
110 fhYVertex(maker.fhYVertex),
111 fhZVertex(maker.fhZVertex),
112 fhXVertexExotic(maker.fhXVertexExotic),
113 fhYVertexExotic(maker.fhYVertexExotic),
114 fhZVertexExotic(maker.fhZVertexExotic),
115 fhPileUpClusterMult(maker.fhPileUpClusterMult),
116 fhPileUpClusterMultAndSPDPileUp(maker.fhPileUpClusterMultAndSPDPileUp),
117 fhTrackMult(maker.fhTrackMult),
118 fhCentrality(maker.fhCentrality),
119 fhEventPlaneAngle(maker.fhEventPlaneAngle),
120 fhNEventsWeighted(maker.fhNEventsWeighted),
121 fhTrackMultWeighted(maker.fhTrackMultWeighted),
122 fhCentralityWeighted(maker.fhCentralityWeighted),
123 fhEventPlaneAngleWeighted(maker.fhEventPlaneAngleWeighted),
124 fhNMergedFiles(maker.fhNMergedFiles),
125 fhScaleFactor(maker.fhScaleFactor),
126 fhEMCalBCEvent(maker.fhEMCalBCEvent),
127 fhEMCalBCEventCut(maker.fhEMCalBCEventCut),
128 fhTrackBCEvent(maker.fhTrackBCEvent),
129 fhTrackBCEventCut(maker.fhTrackBCEventCut),
130 fhPrimaryVertexBC(maker.fhPrimaryVertexBC),
131 fhTimeStampFraction(maker.fhTimeStampFraction),
132 fhNPileUpVertSPD(maker.fhNPileUpVertSPD),
133 fhNPileUpVertTracks(maker.fhNPileUpVertTracks),
134 fhClusterTriggerBC(maker.fhClusterTriggerBC),
135 fhClusterTriggerBCExotic(maker.fhClusterTriggerBCExotic),
136 fhClusterTriggerBCBadCell(maker.fhClusterTriggerBCBadCell),
137 fhClusterTriggerBCBadCellExotic(maker.fhClusterTriggerBCBadCellExotic),
138 fhClusterTriggerBCBadCluster(maker.fhClusterTriggerBCBadCluster),
139 fhClusterTriggerBCBadClusterExotic(maker.fhClusterTriggerBCBadClusterExotic),
140 fhClusterTriggerBCUnMatch(maker.fhClusterTriggerBCUnMatch),
141 fhClusterTriggerBCExoticUnMatch(maker.fhClusterTriggerBCExoticUnMatch),
142 fhClusterTriggerBCBadCellUnMatch(maker.fhClusterTriggerBCBadCellUnMatch),
143 fhClusterTriggerBCBadCellExoticUnMatch(maker.fhClusterTriggerBCBadCellExoticUnMatch),
144 fhClusterTriggerBCBadClusterUnMatch(maker.fhClusterTriggerBCBadClusterUnMatch),
145 fhClusterTriggerBCBadClusterExoticUnMatch(maker.fhClusterTriggerBCBadClusterExoticUnMatch),
146 fhClusterTriggerBCEventBC(maker.fhClusterTriggerBCEventBC),
147 fhClusterTriggerBCEventBCUnMatch(maker.fhClusterTriggerBCEventBCUnMatch),
148 fhClusterTriggerBCExoticEventBC(maker.fhClusterTriggerBCExoticEventBC),
149 fhClusterTriggerBCExoticEventBCUnMatch(maker.fhClusterTriggerBCExoticEventBCUnMatch)
150 {
151  for(Int_t i = 0; i < 3; i++)
152  {
155  }
156 }
157 
158 //___________________________________________________
160 //___________________________________________________
162 {
163  // Do not delete it here, already done somewhere else, need to understand where.
164  // if (fOutputContainer) {
165  // fOutputContainer->Clear();
166  // delete fOutputContainer ;
167  // }
168 
169  if (fAnalysisContainer)
170  {
171  fAnalysisContainer->Delete();
172  delete fAnalysisContainer ;
173  }
174 
175  if (fReader) delete fReader ;
176  if (fCaloUtils) delete fCaloUtils ;
177 
178  if(fCuts)
179  {
180  fCuts->Delete();
181  delete fCuts;
182  }
183 }
184 
185 //__________________________________________________________________
187 //__________________________________________________________________
189 {
190  if ( fAnalysisContainer)
191  {
192  fAnalysisContainer->AddAt(ana,n);
193  }
194  else
195  {
196  AliFatal("AnalysisContainer not initialized");
197  }
198 }
199 
200 //_________________________________________________________
204 //_________________________________________________________
206 {
207  TList *aodBranchList = fReader->GetAODBranchList() ;
208 
209  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
210  {
212  if(ana->NewOutputAOD()) aodBranchList->Add(ana->GetCreateOutputAODBranch());
213  }
214 
215  return aodBranchList ;
216 }
217 
218 //____________________________________________________
220 //____________________________________________________
222 {
223  AliVEvent* event = fReader->GetInputEvent();
224  AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (event);
225  AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (event);
226 
227  fhNEvents ->Fill(0); // Number of events analyzed
228 
229  Double_t v[3];
230  event->GetPrimaryVertex()->GetXYZ(v) ;
231  fhXVertex->Fill(v[0]);
232  fhYVertex->Fill(v[1]);
233  fhZVertex->Fill(v[2]);
234 
238 
240  {
241  Float_t eventWeight = fReader->GetEventWeight();
242 
243  fhNEventsWeighted ->Fill(0., eventWeight);
244  fhTrackMultWeighted ->Fill(fReader->GetTrackMultiplicity(),eventWeight);
245  fhCentralityWeighted ->Fill(fReader->GetEventCentrality (),eventWeight);
247  }
248 
249  // Check the pT hard in MC
251  {
252  if(!strcmp(fReader->GetGenEventHeader()->ClassName(), "AliGenPythiaEventHeader"))
253  {
254  AliGenPythiaEventHeader* pygeh= (AliGenPythiaEventHeader*) fReader->GetGenEventHeader();
255 
256  Float_t pTHard = pygeh->GetPtHard();
257 
258  //printf("pT hard %f, event weight %e\n",pTHard,fReader->GetEventWeight());
259 
260  fhPtHard->Fill(pTHard);
261 
264  fhPtHardWeighted->Fill(pTHard,fReader->GetEventWeight());
265  }
266  }
267 
269  {
270  if( fReader->IsPileUpFromSPD())
271  fhNPileUpEvents->Fill(0.5);
272  //if( event->IsPileupFromSPDInMultBins())
273  // fhNPileUpEvents->Fill(1.5);
274  if( fReader->IsPileUpFromEMCal())
275  fhNPileUpEvents->Fill(2.5);
277  fhNPileUpEvents->Fill(3.5);
279  fhNPileUpEvents->Fill(4.5);
281  fhNPileUpEvents->Fill(5.5);
283  fhNPileUpEvents->Fill(6.5);
285  fhNPileUpEvents->Fill(7.5);
286 
287  Int_t triggerBC = fReader->GetTriggerClusterBC() ;
288  if( triggerBC == 0 &&
289  !fReader->IsExoticEvent() &&
291  {
292  if( fReader->IsPileUpFromSPD())
293  fhNPileUpEventsTriggerBC0->Fill(0.5);
294  //if( event->IsPileupFromSPDInMultBins())
295  // fhNPileUpEventsTriggerBC0->Fill(1.5);
296  if( fReader->IsPileUpFromEMCal())
297  fhNPileUpEventsTriggerBC0->Fill(2.5);
299  fhNPileUpEventsTriggerBC0->Fill(3.5);
301  fhNPileUpEventsTriggerBC0->Fill(4.5);
303  fhNPileUpEventsTriggerBC0->Fill(5.5);
305  fhNPileUpEventsTriggerBC0->Fill(6.5);
307  fhNPileUpEventsTriggerBC0->Fill(7.5);
308  }
309 
310  if(fReader->IsPileUpFromSPD())
312 
314 
315  for(Int_t i = 0; i < 19; i++)
316  {
318  {
319  if(fReader->GetTrackEventBC(i)) fhTrackBCEvent ->Fill(i);
321  }
322  if(fReader->GetEMCalEventBC(i)) fhEMCalBCEvent ->Fill(i);
324  }
325 
326  Int_t bc = fReader->GetVertexBC();
327  if(bc!=AliVTrack::kTOFBCNA) fhPrimaryVertexBC->Fill(bc);
328 
329  // N pile up vertices
330  Int_t nVerticesSPD = -1;
331  Int_t nVerticesTracks = -1;
332 
333  if (esdevent)
334  {
335  nVerticesSPD = esdevent->GetNumberOfPileupVerticesSPD();
336  nVerticesTracks = esdevent->GetNumberOfPileupVerticesTracks();
337 
338  }//ESD
339  else if (aodevent)
340  {
341  nVerticesSPD = aodevent->GetNumberOfPileupVerticesSPD();
342  nVerticesTracks = aodevent->GetNumberOfPileupVerticesTracks();
343  }//AOD
344 
345  fhNPileUpVertSPD ->Fill(nVerticesSPD);
346  fhNPileUpVertTracks->Fill(nVerticesTracks);
347 
348  // Time stamp
349  if(fReader->IsSelectEventTimeStampOn() && esdevent)
350  {
351  Int_t timeStamp = esdevent->GetTimeStamp();
352  Float_t timeStampFrac = 1.*(timeStamp-fReader->GetRunTimeStampMin()) /
354 
355  //printf("stamp %d, min %d, max %d, frac %f\n", timeStamp, fReader->GetRunTimeStampMin(), fReader->GetRunTimeStampMax(), timeStampFrac);
356 
357  fhTimeStampFraction->Fill(timeStampFrac);
358  }
359  }
360 }
361 
362 //___________________________________________________________
364 //___________________________________________________________
366 {
367  if(!fFillDataControlHisto) return;
368 
369  Int_t triggerBC = fReader->GetTriggerClusterBC() ;
370  Bool_t exotic = fReader->IsExoticEvent();
371  Bool_t badCluster = fReader->IsBadCellTriggerEvent();
372  Bool_t badCell = fReader->IsBadMaxCellTriggerEvent();
373  Bool_t triggerMatch= fReader->IsTriggerMatched();
374  Bool_t triggerBCOK = kTRUE;
375  Int_t triggerId = fReader->GetTriggerClusterId() ;
376 
377  Bool_t reMatchOpenTime = fReader->IsTriggerMatchedOpenCuts(0);
378  Bool_t reMatchNeigbour = fReader->IsTriggerMatchedOpenCuts(1);
379  Bool_t reMatchBoth = fReader->IsTriggerMatchedOpenCuts(2);
380 
381  if(triggerId < 0)
382  {
383  //printf("Trigger id %d\n",triggerId);
384  if(triggerId == -2) fhNEventsNoTriggerFound->Fill(0);
385  triggerBCOK = kFALSE;
386  }
387 
388  if(exotic)
389  {
390  fhNExoticEvents->Fill(0) ;
391  Double_t v[3];
392  fReader->GetInputEvent()->GetPrimaryVertex()->GetXYZ(v) ;
393  fhXVertexExotic->Fill(v[0]);
394  fhYVertexExotic->Fill(v[1]);
395  fhZVertexExotic->Fill(v[2]);
396  }
397  //if(fReader->IsExoticEvent()) printf("Maker: EXOTIC Cluster trigger\n");
398 
399  if(!triggerBCOK) return;
400 
401  Int_t eventBC = fReader->GetInputEvent()->GetBunchCrossNumber();
402  if(eventBC%4 < 0 || eventBC%4 > 3 )
403  AliWarning(Form("STRANGE: Trigger BC %d - Event BC %d, modulo4 %d",triggerBC,eventBC,eventBC%4));
404 
405  if(triggerMatch)
406  {
407  if (!exotic && !badCluster) fhClusterTriggerBC->Fill(triggerBC);
408  else if( exotic && badCluster)
409  {
410  fhClusterTriggerBCBadClusterExotic->Fill(triggerBC);
411  if(badCell) fhClusterTriggerBCBadCellExotic->Fill(triggerBC);
412  }
413  else if( exotic && !badCluster) fhClusterTriggerBCExotic->Fill(triggerBC);
414  else if( badCluster && !exotic )
415  {
416  fhClusterTriggerBCBadCluster ->Fill(triggerBC);
417  if(badCell) fhClusterTriggerBCBadCell->Fill(triggerBC);
418  }
419 
420  if(!exotic) fhClusterTriggerBCEventBC ->Fill(triggerBC,eventBC%4);
421  else fhClusterTriggerBCExoticEventBC->Fill(triggerBC,eventBC%4);
422  }
423  else
424  {
425  if (!exotic && !badCluster)
426  {
427  fhClusterTriggerBCUnMatch->Fill(triggerBC);
428  if(reMatchOpenTime) fhClusterTriggerBCUnMatchReMatch[0]->Fill(triggerBC);
429  if(reMatchNeigbour) fhClusterTriggerBCUnMatchReMatch[1]->Fill(triggerBC);
430  if(reMatchBoth) fhClusterTriggerBCUnMatchReMatch[2]->Fill(triggerBC);
431  }
432  else if( exotic && badCluster)
433  {
435  if(badCell) fhClusterTriggerBCBadCellExoticUnMatch ->Fill(triggerBC);
436  }
437  else if( exotic && !badCluster)
438  {
439  fhClusterTriggerBCExoticUnMatch->Fill(triggerBC);
440  if(reMatchOpenTime) fhClusterTriggerBCExoticUnMatchReMatch[0]->Fill(triggerBC);
441  if(reMatchNeigbour) fhClusterTriggerBCExoticUnMatchReMatch[1]->Fill(triggerBC);
442  if(reMatchBoth) fhClusterTriggerBCExoticUnMatchReMatch[2]->Fill(triggerBC);
443  }
444  else if( badCluster && !exotic )
445  {
446  fhClusterTriggerBCBadClusterUnMatch->Fill(triggerBC);
447  if(badCell)fhClusterTriggerBCBadCellUnMatch->Fill(triggerBC);
448  }
449 
450  if(!exotic) fhClusterTriggerBCEventBCUnMatch ->Fill(triggerBC,eventBC%4);
451  else fhClusterTriggerBCExoticEventBCUnMatch->Fill(triggerBC,eventBC%4);
452  }
453 }
454 
455 //_______________________________________________________
458 //_______________________________________________________
460 {
461  // Reader cuts
462  TObjString * objstring = fReader->GetListOfParameters();
463  fCuts->Add(objstring);
464 
465  // Analysis wagons cuts
466  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
467  {
469  objstring = ana->GetAnalysisCuts();
470 
471  if ( objstring ) fCuts->Add(objstring);
472  }
473 
474  return fCuts ;
475 }
476 
477 //___________________________________________________
481 //___________________________________________________
483 {
484  // General event histograms
485 
486  fhNEventsIn = new TH1F("hNEventsIn", "Number of input events" , 1 , 0 , 1 ) ;
487  fhNEventsIn->SetYTitle("# events");
489 
490  fhNEvents = new TH1F("hNEvents", "Number of analyzed events" , 1 , 0 , 1 ) ;
491  fhNEvents->SetYTitle("# events");
493 
494  fhXVertex = new TH1F("hXVertex", " X vertex distribution" , 200 , -4 , 4 ) ;
495  fhXVertex->SetXTitle("v_{x} (cm)");
497 
498  fhYVertex = new TH1F("hYVertex", " Y vertex distribution" , 200 , -4 , 4 ) ;
499  fhYVertex->SetXTitle("v_{y} (cm)");
501 
502  fhZVertex = new TH1F("hZVertex", " Z vertex distribution" , 200 , -50 , 50 ) ;
503  fhZVertex->SetXTitle("v_{z} (cm)");
505 
506  fhCentrality = new TH1F("hCentrality","Number of events in centrality bin", 100, 0., 100) ;
507  fhCentrality->SetXTitle("Centrality bin");
509 
510  fhEventPlaneAngle = new TH1F("hEventPlaneAngle","Number of events in event plane", 100, 0., TMath::Pi()) ;
511  fhEventPlaneAngle->SetXTitle("EP angle (rad)");
513 
514  fhTrackMult = new TH1F("hTrackMult", "Number of tracks per events", 2000 , 0 , 2000) ;
515  fhTrackMult->SetXTitle("# tracks");
517 
518  if(fCheckPtHard)
519  {
520  fhPtHard = new TH1F("hPtHard"," #it{p}_{T}-hard for selected triggers",300,0,300);
521  fhPtHard->SetXTitle("#it{p}_{T}^{hard} (GeV/#it{c})");
523 
526  {
527  fhPtHardWeighted = new TH1F("hPtHardWeighted"," #it{p}_{T}-hard for selected triggers, weighted by cross section",300,0,300);
528  fhPtHardWeighted->SetXTitle("#it{p}_{T}^{hard} (GeV/#it{c})");
530  }
531  }
532 
533  if ( GetReader()->GetWeightUtils()->IsCentralityWeightOn() )
534  {
535  fhNEventsWeighted = new TH1F("hNEventsWeighted", "Number of analyzed events weighted by centrality", 1 , 0 , 1 ) ;
536  fhNEventsWeighted->SetYTitle("# events");
538 
539  fhCentralityWeighted = new TH1F("hCentralityWeighted","Number of events in centrality bin weighted by centrality", 100, 0.,100) ;
540  fhCentralityWeighted->SetXTitle("Centrality bin");
542 
543  fhEventPlaneAngleWeighted = new TH1F("hEventPlaneAngleWeighted","Number of events in event plane weighted by centrality",100, 0., TMath::Pi()) ;
544  fhEventPlaneAngleWeighted->SetXTitle("EP angle (rad)");
546 
547  fhTrackMultWeighted = new TH1F("hTrackMultWeighted", "Number of tracks per events weighted by centrality", 2000 , 0 , 2000) ;
548  fhTrackMultWeighted->SetXTitle("# tracks");
550  }
551 
553  {
554  fhNExoticEvents = new TH1F("hNExoticEvents", "Number of analyzed events triggered by exotic cluster" , 1 , 0 , 1 ) ;
555  fhNExoticEvents->SetYTitle("# exotic events");
557 
558  fhNEventsNoTriggerFound = new TH1F("hNEventsNoTriggerFound", "Number of analyzed events triggered but no trigger found" , 1 , 0 , 1 ) ;
559  fhNEventsNoTriggerFound->SetYTitle("# exotic events");
561 
562 
563  Int_t nbin = 11;
564  Float_t minbin =-5.5;
565  Float_t maxbin = 5.5;
566  Int_t labelshift = 6;
567 
568  fhClusterTriggerBCEventBC = new TH2F("hClusterTriggerBCEventBC", "Found trigger BC and Event BC",
569  nbin , minbin ,maxbin,4,0, 4) ;
570  fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
571  for(Int_t i = 0; i < 4; i++)
572  fhClusterTriggerBCEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
573  fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
574  for(Int_t i = 1; i < 12; i++)
575  fhClusterTriggerBCEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
576  fhClusterTriggerBCEventBC->SetYTitle("Event BC%4");
578 
579  fhClusterTriggerBCExoticEventBC = new TH2F("hClusterTriggerBCExoticEventBC", "Found exotic trigger BC and Event BC",
580  nbin , minbin ,maxbin,4,1, 4) ;
581  for(Int_t i = 0; i < 4; i++)
582  fhClusterTriggerBCExoticEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
583  fhClusterTriggerBCExoticEventBC->SetXTitle("cluster trigger BC");
584  for(Int_t i = 1; i < 12; i++)
585  fhClusterTriggerBCExoticEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
586  fhClusterTriggerBCExoticEventBC->SetYTitle("Event BC%4");
588 
589  fhClusterTriggerBCEventBCUnMatch = new TH2F("hClusterTriggerBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
590  nbin , minbin ,maxbin,4,1, 4) ;
591  for(Int_t i = 0; i < 4; i++)
592  fhClusterTriggerBCEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
593  fhClusterTriggerBCEventBCUnMatch->SetXTitle("cluster trigger BC");
594  for(Int_t i = 1; i < 12; i++)
595  fhClusterTriggerBCEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
596  fhClusterTriggerBCEventBCUnMatch->SetYTitle("Event BC%4");
598 
599  fhClusterTriggerBCExoticEventBCUnMatch = new TH2F("hClusterTriggerExoticBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
600  nbin , minbin ,maxbin,4,1, 4) ;
601  for(Int_t i = 0; i < 4; i++)
602  fhClusterTriggerBCExoticEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
603  fhClusterTriggerBCExoticEventBCUnMatch->SetXTitle("cluster trigger BC");
604  for(Int_t i = 1; i < 12; i++)
605  fhClusterTriggerBCExoticEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
606  fhClusterTriggerBCExoticEventBCUnMatch->SetYTitle("Event BC%4");
608 
609  fhClusterTriggerBC = new TH1F("hClusterTriggerBC",
610  "Number of analyzed events triggered by a cluster in a given BC",
611  nbin , minbin ,maxbin) ;
612  fhClusterTriggerBC->SetYTitle("# events");
613  for(Int_t i = 1; i < 12; i++)
614  fhClusterTriggerBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
616 
617  fhClusterTriggerBCExotic = new TH1F("hClusterTriggerBCExotic",
618  "Number of analyzed events triggered by a exotic cluster in a given BC",
619  nbin , minbin ,maxbin) ;
620  fhClusterTriggerBCExotic->SetYTitle("# events");
621  for(Int_t i = 1; i < 12; i++)
622  fhClusterTriggerBCExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
624 
625 
626  fhClusterTriggerBCBadCell = new TH1F("hClusterTriggerBCBadCell",
627  "Number of analyzed events triggered by a bad cell in a given BC",
628  nbin , minbin ,maxbin) ;
629 
630  fhClusterTriggerBCBadCell->SetYTitle("# events");
631  for(Int_t i = 1; i < 12; i++)
632  fhClusterTriggerBCBadCell->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
634 
635  fhClusterTriggerBCBadCellExotic = new TH1F("hClusterTriggerBCBadCellExotic",
636  "Number of analyzed events triggered by a bad cell & exotic cluster in a given BC",
637  nbin , minbin ,maxbin) ;
638  fhClusterTriggerBCBadCellExotic->SetYTitle("# events");
639  for(Int_t i = 1; i < 12; i++)
640  fhClusterTriggerBCBadCellExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
642 
643  fhClusterTriggerBCBadCluster = new TH1F("hClusterTriggerBCBadCluster",
644  "Number of analyzed events triggered by a bad cluster in a given BC",
645  nbin , minbin ,maxbin) ;
646 
647  fhClusterTriggerBCBadCluster->SetYTitle("# events");
648  for(Int_t i = 1; i < 12; i++)
649  fhClusterTriggerBCBadCluster->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
651 
652 
653  fhClusterTriggerBCBadClusterExotic = new TH1F("hClusterTriggerBCBadClusterExotic",
654  "Number of analyzed events triggered by a bad cluster & exotic cluster in a given BC",
655  nbin , minbin ,maxbin) ;
656 
657  fhClusterTriggerBCBadClusterExotic->SetYTitle("# events");
658  for(Int_t i = 1; i < 12; i++)
659  fhClusterTriggerBCBadClusterExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
661 
662  fhClusterTriggerBCUnMatch = new TH1F("hClusterTriggerBCUnMatch",
663  "Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC",
664  nbin , minbin ,maxbin) ;
665  fhClusterTriggerBCUnMatch->SetYTitle("# events");
666  for(Int_t i = 1; i < 12; i++)
667  fhClusterTriggerBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
669 
670  fhClusterTriggerBCExoticUnMatch = new TH1F("hClusterTriggerBCExoticUnMatch",
671  "Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC",
672  nbin , minbin ,maxbin) ;
673  fhClusterTriggerBCExoticUnMatch->SetYTitle("# events");
674  for(Int_t i = 1; i < 12; i++)
675  fhClusterTriggerBCExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
677 
678 
679  fhClusterTriggerBCBadCellUnMatch = new TH1F("hClusterTriggerBCBadCellUnMatch",
680  "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
681  nbin , minbin ,maxbin) ;
682  fhClusterTriggerBCBadCellUnMatch->SetYTitle("# events");
683  for(Int_t i = 1; i < 12; i++)
684  fhClusterTriggerBCBadCellUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
686 
687 
688  fhClusterTriggerBCBadCellExoticUnMatch = new TH1F("hClusterTriggerBCBadCellExoticUnMatch",
689  "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
690  nbin , minbin ,maxbin) ;
691  fhClusterTriggerBCBadCellExoticUnMatch->SetYTitle("# events");
692  for(Int_t i = 1; i < 12; i++)
693  fhClusterTriggerBCBadCellExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
695 
696 
697  fhClusterTriggerBCBadClusterUnMatch = new TH1F("hClusterTriggerBCBadClusterUnMatch",
698  "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
699  nbin , minbin ,maxbin) ;
700  fhClusterTriggerBCBadClusterUnMatch->SetYTitle("# events");
701  for(Int_t i = 1; i < 12; i++)
702  fhClusterTriggerBCBadClusterUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
704 
705 
706  fhClusterTriggerBCBadClusterExoticUnMatch = new TH1F("hClusterTriggerBCBadClusterExoticUnMatch",
707  "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
708  nbin , minbin ,maxbin) ;
709  fhClusterTriggerBCBadClusterExoticUnMatch->SetYTitle("# events");
710  for(Int_t i = 1; i < 12; i++)
711  fhClusterTriggerBCBadClusterExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
713 
714  TString rematch[] = {"OpenTime","CheckNeighbours","Both"};
715  for(Int_t j = 0; j < 3; j++)
716  {
717  fhClusterTriggerBCUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCUnMatch_ReMatch_%s",rematch[j].Data()),
718  Form("Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
719  nbin , minbin ,maxbin) ;
720  fhClusterTriggerBCUnMatchReMatch[j]->SetYTitle("# events");
721  for(Int_t i = 1; i < 12; i++)
722  fhClusterTriggerBCUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
724 
725  fhClusterTriggerBCExoticUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCExoticUnMatch_ReMatch_%s",rematch[j].Data()),
726  Form("Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
727  nbin , minbin ,maxbin) ;
728  fhClusterTriggerBCExoticUnMatchReMatch[j]->SetYTitle("# events");
729  for(Int_t i = 1; i < 12; i++)
730  fhClusterTriggerBCExoticUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
732  }
733 
734  fhNPileUpEvents = new TH1F("hNPileUpEvents", "Number of events considered as pile-up", 8 , 0 , 8 ) ;
735  fhNPileUpEvents->SetYTitle("# events");
736  fhNPileUpEvents->GetXaxis()->SetBinLabel(1 ,"SPD");
737  fhNPileUpEvents->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
738  fhNPileUpEvents->GetXaxis()->SetBinLabel(3 ,"EMCal");
739  fhNPileUpEvents->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
740  fhNPileUpEvents->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
741  fhNPileUpEvents->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
742  fhNPileUpEvents->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
743  fhNPileUpEvents->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
745 
746  fhNPileUpEventsTriggerBC0 = new TH1F("hNPileUpEventsTriggerBC0","Number of events considered as pile-up, trigger cluster in BC=0", 8 , 0 , 8 ) ;
747  fhNPileUpEventsTriggerBC0->SetYTitle("# events");
748  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(1 ,"SPD");
749  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
750  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(3 ,"EMCal");
751  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
752  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
753  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
754  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
755  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
757 
759  {
760  fhTrackBCEvent = new TH1F("hTrackBCEvent", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
761  fhTrackBCEvent->SetYTitle("# events");
762  fhTrackBCEvent->SetXTitle("Bunch crossing");
763  for(Int_t i = 1; i < 20; i++)
764  fhTrackBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
766 
767  fhTrackBCEventCut = new TH1F("hTrackBCEventCut", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
768  fhTrackBCEventCut->SetYTitle("# events");
769  fhTrackBCEventCut->SetXTitle("Bunch crossing");
770  for(Int_t i = 1; i < 20; i++)
771  fhTrackBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
773  }
774 
775  fhPrimaryVertexBC = new TH1F("hPrimaryVertexBC", "Number of primary vertex per bunch crossing ", 41 , -20 , 20 ) ;
776  fhPrimaryVertexBC->SetYTitle("# events");
777  fhPrimaryVertexBC->SetXTitle("Bunch crossing");
779 
780  fhEMCalBCEvent = new TH1F("hEMCalBCEvent", "Number of events with at least 1 cluster in a bunch crossing ", 19 , 0 , 19 ) ;
781  fhEMCalBCEvent->SetYTitle("# events");
782  fhEMCalBCEvent->SetXTitle("Bunch crossing");
783  for(Int_t i = 1; i < 20; i++)
784  fhEMCalBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
786 
787  fhEMCalBCEventCut = new TH1F("hEMCalBCEventCut", "Number of events with at least 1 cluster in a bunch crossing", 19 , 0 , 19 ) ;
788  fhEMCalBCEventCut->SetYTitle("# events");
789  fhEMCalBCEventCut->SetXTitle("Bunch crossing");
790  for(Int_t i = 1; i < 20; i++)
791  fhEMCalBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
793 
794  fhXVertexExotic = new TH1F("hXVertexExotic", " X vertex distribution in exotic events" , 200 , -4 , 4 ) ;
795  fhXVertexExotic->SetXTitle("v_{x} (cm)");
797 
798  fhYVertexExotic = new TH1F("hYVertexExotic", " Y vertex distribution in exotic events" , 200 , -4 , 4 ) ;
799  fhYVertexExotic->SetXTitle("v_{y} (cm)");
801 
802  fhZVertexExotic = new TH1F("hZVertexExotic", " Z vertex distribution in exotic events" , 200 , -50 , 50 ) ;
803  fhZVertexExotic->SetXTitle("v_{z} (cm)");
805 
806  fhPileUpClusterMult = new TH1F("hPileUpClusterMult", "Number of clusters per event with large time (|t| > 20 ns)" , 100 , 0 , 100 ) ;
807  fhPileUpClusterMult->SetXTitle("# clusters");
809 
810  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 ) ;
811  fhPileUpClusterMultAndSPDPileUp->SetXTitle("# clusters");
813 
814  fhNPileUpVertSPD = new TH1F ("hNPileUpVertSPD","N pile-up SPD vertex", 50,0,50);
815  fhNPileUpVertSPD->SetYTitle("# vertex ");
817 
818  fhNPileUpVertTracks = new TH1F ("hNPileUpVertTracks","N pile-up Tracks vertex", 50,0,50);
819  fhNPileUpVertTracks->SetYTitle("# vertex ");
821 
823  {
824  fhTimeStampFraction = new TH1F("hTimeStampFraction","Fraction of events within a given time stamp range",150, -1, 2) ;
825  fhTimeStampFraction->SetXTitle("fraction");
827  }
828  }
829 
830  fhNMergedFiles = new TH1F("hNMergedFiles", "Number of merged output files" , 1 , 0 , 1 ) ;
831  fhNMergedFiles->SetYTitle("# files");
832  fhNMergedFiles->Fill(1); // Fill here with one entry, while merging it will count the rest
834 
835  if(fScaleFactor > 0)
836  {
837  fhScaleFactor = new TH1F("hScaleFactor", "Number of merged output files" , 1 , 0 , 1 ) ;
838  fhScaleFactor->SetYTitle("scale factor");
839  fhScaleFactor->SetBinContent(1,fScaleFactor); // Fill here
841  }
842 
843  // Histograms defined and filled in this class, just get the pointers
844  // and add them to the list.
845  if(GetReader()->GetWeightUtils()->IsMCCrossSectionCalculationOn())
846  {
847  TList * templist = GetReader()->GetWeightUtils()->GetCreateOutputHistograms();
848 
849  if ( templist && templist->GetEntries() == 2 )
850  {
851  templist->SetOwner(kFALSE); //Owner is fOutputContainer.
852 
853  fOutputContainer->Add(templist->At(0));
854  fOutputContainer->Add(templist->At(1));
855  }
856  }
857 
858  // --------------------------------
859  // Add control histograms in Reader
860  // --------------------------------
861 
862  TList * templist = fReader->GetCreateControlHistograms();
863  templist->SetOwner(kFALSE); //Owner is fOutputContainer.
864 
865  for(Int_t ih = 0; ih < templist->GetEntries() ; ih++)
866  {
867  //if ( fSumw2 ) ((TH1*) templist->At(ih))->Sumw2();
868 
869  //printf("histo %d %p %s\n",ih,templist->At(ih), templist->At(ih)->GetName());
870 
871  //Add histogram to general container
872  fOutputContainer->Add(templist->At(ih)) ;
873  }
874 
875  delete templist;
876 
877  // ------------------------
878  // Add analysis histograms
879  // ------------------------
880 
881  if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
882  {
883  AliWarning("Analysis job list not initialized!!!");
884  return fOutputContainer;
885  }
886 
887  const Int_t buffersize = 255;
888  char newname[buffersize];
889 
890  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
891  {
893 
894  if(fMakeHisto) // Analysis with histograms as output on
895  {
896  //Fill container with appropriate histograms
897  templist = ana->GetCreateOutputObjects();
898  templist->SetOwner(kFALSE); //Owner is fOutputContainer.
899 
900  for(Int_t i = 0; i < templist->GetEntries(); i++)
901  {
902  //Add only to the histogram name the name of the task
903  if( strcmp((templist->At(i))->ClassName(),"TObjString") )
904  {
905  snprintf(newname,buffersize, "%s%s", (ana->GetAddedHistogramsStringToName()).Data(), (templist->At(i))->GetName());
906  //printf("name %s, new name %s\n",(templist->At(i))->GetName(),newname);
907 
908  ((TH1*) templist->At(i))->SetName(newname);
909 
910  if ( fSumw2 ) ((TH1*) templist->At(i))->Sumw2();
911  }
912 
913  //Add histogram to general container
914  fOutputContainer->Add(templist->At(i)) ;
915  }
916 
917  delete templist;
918 
919  }// Analysis with histograms as output on
920 
921  }//Loop on analysis defined
922 
923  // Initialize calorimeters geometry pointers
924  //GetCaloUtils()->InitPHOSGeometry();
925  //GetCaloUtils()->InitEMCALGeometry();
926 
927  return fOutputContainer;
928 }
929 
930 //___________________________________
935 //___________________________________
937 {
938  // Activate debug level in maker
939  if( fAnaDebug >= 0 )
940  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(this->ClassName(),fAnaDebug);
941 
942  //Initialize reader
943  GetReader()->Init();
944  GetReader()->SetCaloUtils(GetCaloUtils()); // pass the calo utils pointer to the reader
945 
946  // Activate debug level in reader
947  if( fReader->GetDebug() >= 0 )
948  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(fReader->ClassName(), fReader->GetDebug());
949 
950  // Activate debug level in calo utils
951  if( fCaloUtils->GetDebug() >= 0 )
952  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(fCaloUtils->ClassName(), fCaloUtils->GetDebug());
953 
954  if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
955  {
956  AliWarning("Analysis job list not initialized");
957  return;
958  }
959 
960  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
961  {
963 
964  ana->SetReader(fReader); // Set Reader for each analysis
965  ana->SetCaloUtils(fCaloUtils); // Set CaloUtils for each analysis
966 
967  ana->Init();
968  ana->InitDebug();
969  }//Loop on analysis defined
970 }
971 
972 //_____________________________________________
974 //_____________________________________________
976 {
977  fMakeHisto = kTRUE;
978  fMakeAOD = kTRUE;
979  fAnaDebug = 0; // No debugging info displayed by default
980 }
981 
982 //______________________________________________________________
984 //______________________________________________________________
985 void AliAnaCaloTrackCorrMaker::Print(const Option_t * opt) const
986 {
987  if(! opt)
988  return;
989 
990  printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
991  printf("Debug level = %d\n", fAnaDebug ) ;
992  printf("Produce Histo = %d\n", fMakeHisto ) ;
993  printf("Produce AOD = %d\n", fMakeAOD ) ;
994  printf("Number of analysis tasks = %d\n", fAnalysisContainer->GetEntries()) ;
995 
996  if(!strcmp("all",opt))
997  {
998  printf("Print analysis Tasks settings :\n") ;
999  for(Int_t iana = 0; iana<fAnalysisContainer->GetEntries(); iana++)
1000  {
1002  }
1003 
1004  printf("Print analysis Reader settings :\n") ;
1005  fReader->Print("");
1006  printf("Print analysis Calorimeter Utils settings :\n") ;
1007  fCaloUtils->Print("");
1008  }
1009 }
1010 
1011 //_____________________________________________________________________________________
1021 //_____________________________________________________________________________________
1022 void AliAnaCaloTrackCorrMaker::ProcessEvent(Int_t iEntry, const char * currentFileName)
1023 {
1025  AliFatal("Histograms not initialized");
1026 
1027  AliDebug(1,Form("*** AliAnaCaloTrackCorrMaker::ProcessEvent() Event %d ***",iEntry));
1028  AliDebug(2,Form("Current File Name : %s", currentFileName));
1029  //printf("fAODBranchList %p, entries %d\n",fAODBranchList,fAODBranchList->GetEntries());
1030 
1031  // Each event needs an empty branch
1032  TList * aodList = fReader->GetAODBranchList();
1033  Int_t nAODBranches = aodList->GetEntries();
1034  for(Int_t iaod = 0; iaod < nAODBranches; iaod++)
1035  {
1036  TClonesArray *tca = dynamic_cast<TClonesArray*> (aodList->At(iaod));
1037  if(tca) tca->Clear("C");
1038  }
1039 
1040  // Set geometry matrices before filling arrays, in case recalibration/position calculation etc is needed
1042 
1043  // Set the AODB calibration, bad channels etc. parameters at least once
1045 
1046  // Tell the reader to fill the data in the 3 detector lists
1047  Bool_t ok = fReader->FillInputEvent(iEntry, currentFileName);
1048 
1049  // Access pointers, and trigger mask check needed in mixing case
1050  AliAnalysisManager *manager = AliAnalysisManager::GetAnalysisManager();
1051  AliInputEventHandler *inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
1052 
1053  UInt_t isMBTrigger = kFALSE;
1054  UInt_t isTrigger = kFALSE;
1055  if(inputHandler)
1056  {
1057  isMBTrigger = inputHandler->IsEventSelected() & fReader->GetMixEventTriggerMask();
1058  isTrigger = inputHandler->IsEventSelected() & fReader->GetEventTriggerMask();
1059  }
1060 
1061  //Fill trigger control histograms, make sure it is only for triggered events and
1062  // not the MB events used for mixing
1063  if(fReader->IsEventTriggerAtSEOn() || isTrigger)
1064  {
1065  fhNEventsIn->Fill(0);
1067  }
1068 
1069  if(!ok)
1070  {
1071  AliDebug(1,Form("*** Skip event *** %d",iEntry));
1072  fReader->ResetLists();
1073  return ;
1074  }
1075 
1076  // Magic line to write events to file
1077  if(fReader->WriteDeltaAODToFile())AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
1078 
1079  //printf(">>>>>>>>>> BEFORE >>>>>>>>>>>\n");
1080  //gObjectTable->Print();
1081 
1082  // Init mag field for tracks in case of ESDs, not really necessary
1083  if ( !TGeoGlobalMagField::Instance()->GetField() && fReader->GetInputEvent() )
1084  (fReader->GetInputEvent())->InitMagneticField();
1085 
1086  // Loop on analysis algorithms
1087 
1088  AliDebug(1,"*** Begin analysis ***");
1089 
1090  Int_t nana = fAnalysisContainer->GetEntries() ;
1091  for(Int_t iana = 0; iana < nana; iana++)
1092  {
1094 
1095  ana->ConnectInputOutputAODBranches(); // Sets branches for each analysis
1096 
1097  //Fill pool for mixed event for the analysis that need it
1098  if(!fReader->IsEventTriggerAtSEOn() && isMBTrigger)
1099  {
1100  ana->FillEventMixPool();
1101  if(!isTrigger) continue; // pool filled do not try to fill AODs or histograms if trigger is not MB
1102  }
1103 
1104  //Make analysis, create aods in aod branch and in some cases fill histograms
1105  if(fMakeAOD ) ana->MakeAnalysisFillAOD() ;
1106 
1107  //Make further analysis with aod branch and fill histograms
1109 
1110  }
1111 
1112  fReader->ResetLists();
1113 
1114  // In case of mixing analysis, non triggered events are used,
1115  // do not fill control histograms for a non requested triggered event
1116  if(!fReader->IsEventTriggerAtSEOn() && !isTrigger)
1117  {
1118  AliDebug(1,"*** End analysis, MB for mixing ***");
1119  return;
1120  }
1121 
1123 
1124  //printf(">>>>>>>>>> AFTER >>>>>>>>>>>\n");
1125  //gObjectTable->Print();
1126 
1127  AliDebug(1,"*** End analysis ***");
1128 }
1129 
1130 //__________________________________________________________
1133 //__________________________________________________________
1134 void AliAnaCaloTrackCorrMaker::Terminate(TList * outputList)
1135 {
1136  if (!outputList)
1137  {
1138  AliError("No output list");
1139  return;
1140  }
1141 
1142  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
1143  {
1145  if(ana->MakePlotsOn())ana->Terminate(outputList);
1146  } // Loop on analysis defined
1147 }
1148 
1149 
1150 
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()
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.
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:53
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.
virtual TList * GetAODBranchList() const
Bool_t IsTriggerMatched() const
virtual Int_t GetDebug() const
Bool_t IsMCCrossSectionJustHistoFillOn() const
Definition: AliAnaWeights.h:72
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:71
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
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.
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.
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.