AliPhysics  vAN-20150717 (04f1bdd)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
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 
37 
38 //__________________________________________________
41 //__________________________________________________
43 TObject(),
44 fReader(0), fCaloUtils(0),
45 fOutputContainer(new TList ), fAnalysisContainer(new TList ),
46 fMakeHisto(kFALSE), fMakeAOD(kFALSE),
47 fAnaDebug(0), fCuts(new TList),
48 fScaleFactor(-1),
49 fFillDataControlHisto(kTRUE), fSumw2(0),
50 // Control histograms
51 fhNEventsIn(0), fhNEvents(0),
52 fhNExoticEvents(0), fhNEventsNoTriggerFound(0),
53 fhNPileUpEvents(0), fhNPileUpEventsTriggerBC0(0),
54 fhXVertex(0), fhYVertex(0), fhZVertex(0),
55 fhXVertexExotic(0), fhYVertexExotic(0), fhZVertexExotic(0),
56 fhPileUpClusterMult(0), fhPileUpClusterMultAndSPDPileUp(0),
57 fhTrackMult(0),
58 fhCentrality(0), fhEventPlaneAngle(0),
59 fhNEventsWeighted(0), fhTrackMultWeighted(0),
60 fhCentralityWeighted(0), fhEventPlaneAngleWeighted(0),
61 fhNMergedFiles(0), fhScaleFactor(0),
62 fhEMCalBCEvent(0), fhEMCalBCEventCut(0),
63 fhTrackBCEvent(0), fhTrackBCEventCut(0),
64 fhPrimaryVertexBC(0), fhTimeStampFraction(0),
65 fhNPileUpVertSPD(0), fhNPileUpVertTracks(0),
66 // EMCal trigger control histograms
67 fhClusterTriggerBC(0), fhClusterTriggerBCExotic(0),
68 fhClusterTriggerBCBadCell(0), fhClusterTriggerBCBadCellExotic(0),
69 fhClusterTriggerBCBadCluster(0), fhClusterTriggerBCBadClusterExotic(0),
70 fhClusterTriggerBCUnMatch(0), fhClusterTriggerBCExoticUnMatch(0),
71 fhClusterTriggerBCBadCellUnMatch(0), fhClusterTriggerBCBadCellExoticUnMatch(0),
72 fhClusterTriggerBCBadClusterUnMatch(0), fhClusterTriggerBCBadClusterExoticUnMatch(0),
73 fhClusterTriggerBCEventBC(0), fhClusterTriggerBCEventBCUnMatch(0),
74 fhClusterTriggerBCExoticEventBC(0), fhClusterTriggerBCExoticEventBCUnMatch(0)
75 {
76  AliDebug(1,"*** Analysis Maker Constructor ***");
77 
78  for(Int_t i = 0; i < 3; i++)
79  {
82  }
83 
85 }
86 
87 //________________________________________________________________________________________
89 //________________________________________________________________________________________
91 TObject(),
92 fReader(), //(new AliCaloTrackReader(*maker.fReader)),
93 fCaloUtils(),//(new AliCalorimeterUtils(*maker.fCaloUtils)),
94 fOutputContainer(new TList()), fAnalysisContainer(new TList()),
95 fMakeHisto(maker.fMakeHisto), fMakeAOD(maker.fMakeAOD),
96 fAnaDebug(maker.fAnaDebug), fCuts(new TList()),
97 fScaleFactor(maker.fScaleFactor),
98 fFillDataControlHisto(maker.fFillDataControlHisto),
99 fSumw2(maker.fSumw2),
100 fhNEventsIn(maker.fhNEventsIn),
101 fhNEvents(maker.fhNEvents),
102 fhNExoticEvents(maker.fhNExoticEvents),
103 fhNEventsNoTriggerFound(maker.fhNEventsNoTriggerFound),
104 fhNPileUpEvents(maker.fhNPileUpEvents),
105 fhNPileUpEventsTriggerBC0(maker.fhNPileUpEventsTriggerBC0),
106 fhXVertex(maker.fhXVertex),
107 fhYVertex(maker.fhYVertex),
108 fhZVertex(maker.fhZVertex),
109 fhXVertexExotic(maker.fhXVertexExotic),
110 fhYVertexExotic(maker.fhYVertexExotic),
111 fhZVertexExotic(maker.fhZVertexExotic),
112 fhPileUpClusterMult(maker.fhPileUpClusterMult),
113 fhPileUpClusterMultAndSPDPileUp(maker.fhPileUpClusterMultAndSPDPileUp),
114 fhTrackMult(maker.fhTrackMult),
115 fhCentrality(maker.fhCentrality),
116 fhEventPlaneAngle(maker.fhEventPlaneAngle),
117 fhNEventsWeighted(maker.fhNEventsWeighted),
118 fhTrackMultWeighted(maker.fhTrackMultWeighted),
119 fhCentralityWeighted(maker.fhCentralityWeighted),
120 fhEventPlaneAngleWeighted(maker.fhEventPlaneAngleWeighted),
121 fhNMergedFiles(maker.fhNMergedFiles),
122 fhScaleFactor(maker.fhScaleFactor),
123 fhEMCalBCEvent(maker.fhEMCalBCEvent),
124 fhEMCalBCEventCut(maker.fhEMCalBCEventCut),
125 fhTrackBCEvent(maker.fhTrackBCEvent),
126 fhTrackBCEventCut(maker.fhTrackBCEventCut),
127 fhPrimaryVertexBC(maker.fhPrimaryVertexBC),
128 fhTimeStampFraction(maker.fhTimeStampFraction),
129 fhNPileUpVertSPD(maker.fhNPileUpVertSPD),
130 fhNPileUpVertTracks(maker.fhNPileUpVertTracks),
131 fhClusterTriggerBC(maker.fhClusterTriggerBC),
132 fhClusterTriggerBCExotic(maker.fhClusterTriggerBCExotic),
133 fhClusterTriggerBCBadCell(maker.fhClusterTriggerBCBadCell),
134 fhClusterTriggerBCBadCellExotic(maker.fhClusterTriggerBCBadCellExotic),
135 fhClusterTriggerBCBadCluster(maker.fhClusterTriggerBCBadCluster),
136 fhClusterTriggerBCBadClusterExotic(maker.fhClusterTriggerBCBadClusterExotic),
137 fhClusterTriggerBCUnMatch(maker.fhClusterTriggerBCUnMatch),
138 fhClusterTriggerBCExoticUnMatch(maker.fhClusterTriggerBCExoticUnMatch),
139 fhClusterTriggerBCBadCellUnMatch(maker.fhClusterTriggerBCBadCellUnMatch),
140 fhClusterTriggerBCBadCellExoticUnMatch(maker.fhClusterTriggerBCBadCellExoticUnMatch),
141 fhClusterTriggerBCBadClusterUnMatch(maker.fhClusterTriggerBCBadClusterUnMatch),
142 fhClusterTriggerBCBadClusterExoticUnMatch(maker.fhClusterTriggerBCBadClusterExoticUnMatch),
143 fhClusterTriggerBCEventBC(maker.fhClusterTriggerBCEventBC),
144 fhClusterTriggerBCEventBCUnMatch(maker.fhClusterTriggerBCEventBCUnMatch),
145 fhClusterTriggerBCExoticEventBC(maker.fhClusterTriggerBCExoticEventBC),
146 fhClusterTriggerBCExoticEventBCUnMatch(maker.fhClusterTriggerBCExoticEventBCUnMatch)
147 {
148  for(Int_t i = 0; i < 3; i++)
149  {
152  }
153 }
154 
155 //___________________________________________________
157 //___________________________________________________
159 {
160  // Do not delete it here, already done somewhere else, need to understand where.
161  // if (fOutputContainer) {
162  // fOutputContainer->Clear();
163  // delete fOutputContainer ;
164  // }
165 
166  if (fAnalysisContainer)
167  {
168  fAnalysisContainer->Delete();
169  delete fAnalysisContainer ;
170  }
171 
172  if (fReader) delete fReader ;
173  if (fCaloUtils) delete fCaloUtils ;
174 
175  if(fCuts)
176  {
177  fCuts->Delete();
178  delete fCuts;
179  }
180 }
181 
182 //__________________________________________________________________
184 //__________________________________________________________________
186 {
187  if ( fAnalysisContainer)
188  {
189  fAnalysisContainer->AddAt(ana,n);
190  }
191  else
192  {
193  AliFatal("AnalysisContainer not initialized");
194  }
195 }
196 
197 //_________________________________________________________
201 //_________________________________________________________
203 {
204  TList *aodBranchList = fReader->GetAODBranchList() ;
205 
206  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
207  {
209  if(ana->NewOutputAOD()) aodBranchList->Add(ana->GetCreateOutputAODBranch());
210  }
211 
212  return aodBranchList ;
213 }
214 
215 //____________________________________________________
217 //____________________________________________________
219 {
220  AliVEvent* event = fReader->GetInputEvent();
221  AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (event);
222  AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (event);
223 
224  fhNEvents ->Fill(0); // Number of events analyzed
225 
226  Double_t v[3];
227  event->GetPrimaryVertex()->GetXYZ(v) ;
228  fhXVertex->Fill(v[0]);
229  fhYVertex->Fill(v[1]);
230  fhZVertex->Fill(v[2]);
231 
235 
237  {
238  Float_t eventWeight = GetReader()->GetEventWeight();
239 
240  fhNEventsWeighted ->Fill(0., eventWeight);
241  fhTrackMultWeighted ->Fill(fReader->GetTrackMultiplicity(),eventWeight);
242  fhCentralityWeighted ->Fill(fReader->GetEventCentrality (),eventWeight);
244  }
245 
247  {
248  if( fReader->IsPileUpFromSPD())
249  fhNPileUpEvents->Fill(0.5);
250  //if( event->IsPileupFromSPDInMultBins())
251  // fhNPileUpEvents->Fill(1.5);
252  if( fReader->IsPileUpFromEMCal())
253  fhNPileUpEvents->Fill(2.5);
255  fhNPileUpEvents->Fill(3.5);
257  fhNPileUpEvents->Fill(4.5);
259  fhNPileUpEvents->Fill(5.5);
261  fhNPileUpEvents->Fill(6.5);
263  fhNPileUpEvents->Fill(7.5);
264 
265  Int_t triggerBC = fReader->GetTriggerClusterBC() ;
266  if( triggerBC == 0 &&
267  !fReader->IsExoticEvent() &&
269  {
270  if( fReader->IsPileUpFromSPD())
271  fhNPileUpEventsTriggerBC0->Fill(0.5);
272  //if( event->IsPileupFromSPDInMultBins())
273  // fhNPileUpEventsTriggerBC0->Fill(1.5);
274  if( fReader->IsPileUpFromEMCal())
275  fhNPileUpEventsTriggerBC0->Fill(2.5);
277  fhNPileUpEventsTriggerBC0->Fill(3.5);
279  fhNPileUpEventsTriggerBC0->Fill(4.5);
281  fhNPileUpEventsTriggerBC0->Fill(5.5);
283  fhNPileUpEventsTriggerBC0->Fill(6.5);
285  fhNPileUpEventsTriggerBC0->Fill(7.5);
286  }
287 
288  if(fReader->IsPileUpFromSPD())
290 
292 
293  for(Int_t i = 0; i < 19; i++)
294  {
296  {
297  if(fReader->GetTrackEventBC(i)) fhTrackBCEvent ->Fill(i);
299  }
300  if(fReader->GetEMCalEventBC(i)) fhEMCalBCEvent ->Fill(i);
302  }
303 
304  Int_t bc = fReader->GetVertexBC();
305  if(bc!=AliVTrack::kTOFBCNA) fhPrimaryVertexBC->Fill(bc);
306 
307  // N pile up vertices
308  Int_t nVerticesSPD = -1;
309  Int_t nVerticesTracks = -1;
310 
311  if (esdevent)
312  {
313  nVerticesSPD = esdevent->GetNumberOfPileupVerticesSPD();
314  nVerticesTracks = esdevent->GetNumberOfPileupVerticesTracks();
315 
316  }//ESD
317  else if (aodevent)
318  {
319  nVerticesSPD = aodevent->GetNumberOfPileupVerticesSPD();
320  nVerticesTracks = aodevent->GetNumberOfPileupVerticesTracks();
321  }//AOD
322 
323  fhNPileUpVertSPD ->Fill(nVerticesSPD);
324  fhNPileUpVertTracks->Fill(nVerticesTracks);
325 
326  // Time stamp
327  if(fReader->IsSelectEventTimeStampOn() && esdevent)
328  {
329  Int_t timeStamp = esdevent->GetTimeStamp();
330  Float_t timeStampFrac = 1.*(timeStamp-fReader->GetRunTimeStampMin()) /
332 
333  //printf("stamp %d, min %d, max %d, frac %f\n", timeStamp, fReader->GetRunTimeStampMin(), fReader->GetRunTimeStampMax(), timeStampFrac);
334 
335  fhTimeStampFraction->Fill(timeStampFrac);
336  }
337  }
338 }
339 
340 //___________________________________________________________
342 //___________________________________________________________
344 {
345  if(!fFillDataControlHisto) return;
346 
347  Int_t triggerBC = fReader->GetTriggerClusterBC() ;
348  Bool_t exotic = fReader->IsExoticEvent();
349  Bool_t badCluster = fReader->IsBadCellTriggerEvent();
350  Bool_t badCell = fReader->IsBadMaxCellTriggerEvent();
351  Bool_t triggerMatch= fReader->IsTriggerMatched();
352  Bool_t triggerBCOK = kTRUE;
353  Int_t triggerId = fReader->GetTriggerClusterId() ;
354 
355  Bool_t reMatchOpenTime = fReader->IsTriggerMatchedOpenCuts(0);
356  Bool_t reMatchNeigbour = fReader->IsTriggerMatchedOpenCuts(1);
357  Bool_t reMatchBoth = fReader->IsTriggerMatchedOpenCuts(2);
358 
359  if(triggerId < 0)
360  {
361  //printf("Trigger id %d\n",triggerId);
362  if(triggerId == -2) fhNEventsNoTriggerFound->Fill(0);
363  triggerBCOK = kFALSE;
364  }
365 
366  if(exotic)
367  {
368  fhNExoticEvents->Fill(0) ;
369  Double_t v[3];
370  fReader->GetInputEvent()->GetPrimaryVertex()->GetXYZ(v) ;
371  fhXVertexExotic->Fill(v[0]);
372  fhYVertexExotic->Fill(v[1]);
373  fhZVertexExotic->Fill(v[2]);
374  }
375  //if(fReader->IsExoticEvent()) printf("Maker: EXOTIC Cluster trigger\n");
376 
377  if(!triggerBCOK) return;
378 
379  Int_t eventBC = fReader->GetInputEvent()->GetBunchCrossNumber();
380  if(eventBC%4 < 0 || eventBC%4 > 3 )
381  AliWarning(Form("STRANGE: Trigger BC %d - Event BC %d, modulo4 %d",triggerBC,eventBC,eventBC%4));
382 
383  if(triggerMatch)
384  {
385  if (!exotic && !badCluster) fhClusterTriggerBC->Fill(triggerBC);
386  else if( exotic && badCluster)
387  {
388  fhClusterTriggerBCBadClusterExotic->Fill(triggerBC);
389  if(badCell) fhClusterTriggerBCBadCellExotic->Fill(triggerBC);
390  }
391  else if( exotic && !badCluster) fhClusterTriggerBCExotic->Fill(triggerBC);
392  else if( badCluster && !exotic )
393  {
394  fhClusterTriggerBCBadCluster ->Fill(triggerBC);
395  if(badCell) fhClusterTriggerBCBadCell->Fill(triggerBC);
396  }
397 
398  if(!exotic) fhClusterTriggerBCEventBC ->Fill(triggerBC,eventBC%4);
399  else fhClusterTriggerBCExoticEventBC->Fill(triggerBC,eventBC%4);
400  }
401  else
402  {
403  if (!exotic && !badCluster)
404  {
405  fhClusterTriggerBCUnMatch->Fill(triggerBC);
406  if(reMatchOpenTime) fhClusterTriggerBCUnMatchReMatch[0]->Fill(triggerBC);
407  if(reMatchNeigbour) fhClusterTriggerBCUnMatchReMatch[1]->Fill(triggerBC);
408  if(reMatchBoth) fhClusterTriggerBCUnMatchReMatch[2]->Fill(triggerBC);
409  }
410  else if( exotic && badCluster)
411  {
413  if(badCell) fhClusterTriggerBCBadCellExoticUnMatch ->Fill(triggerBC);
414  }
415  else if( exotic && !badCluster)
416  {
417  fhClusterTriggerBCExoticUnMatch->Fill(triggerBC);
418  if(reMatchOpenTime) fhClusterTriggerBCExoticUnMatchReMatch[0]->Fill(triggerBC);
419  if(reMatchNeigbour) fhClusterTriggerBCExoticUnMatchReMatch[1]->Fill(triggerBC);
420  if(reMatchBoth) fhClusterTriggerBCExoticUnMatchReMatch[2]->Fill(triggerBC);
421  }
422  else if( badCluster && !exotic )
423  {
424  fhClusterTriggerBCBadClusterUnMatch->Fill(triggerBC);
425  if(badCell)fhClusterTriggerBCBadCellUnMatch->Fill(triggerBC);
426  }
427 
428  if(!exotic) fhClusterTriggerBCEventBCUnMatch ->Fill(triggerBC,eventBC%4);
429  else fhClusterTriggerBCExoticEventBCUnMatch->Fill(triggerBC,eventBC%4);
430  }
431 }
432 
433 //_______________________________________________________
436 //_______________________________________________________
438 {
439  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
440  {
442  TObjString * objstring = ana->GetAnalysisCuts();
443 
444  if(objstring)fCuts->Add(objstring);
445  }
446 
447  return fCuts ;
448 }
449 
450 //___________________________________________________
454 //___________________________________________________
456 {
457  // General event histograms
458 
459  fhNEventsIn = new TH1F("hNEventsIn", "Number of input events" , 1 , 0 , 1 ) ;
460  fhNEventsIn->SetYTitle("# events");
462 
463  fhNEvents = new TH1F("hNEvents", "Number of analyzed events" , 1 , 0 , 1 ) ;
464  fhNEvents->SetYTitle("# events");
466 
467  fhXVertex = new TH1F("hXVertex", " X vertex distribution" , 200 , -4 , 4 ) ;
468  fhXVertex->SetXTitle("v_{x} (cm)");
470 
471  fhYVertex = new TH1F("hYVertex", " Y vertex distribution" , 200 , -4 , 4 ) ;
472  fhYVertex->SetXTitle("v_{y} (cm)");
474 
475  fhZVertex = new TH1F("hZVertex", " Z vertex distribution" , 200 , -50 , 50 ) ;
476  fhZVertex->SetXTitle("v_{z} (cm)");
478 
479  fhCentrality = new TH1F("hCentrality","Number of events in centrality bin", 100, 0., 100) ;
480  fhCentrality->SetXTitle("Centrality bin");
482 
483  fhEventPlaneAngle = new TH1F("hEventPlaneAngle","Number of events in event plane", 100, 0., TMath::Pi()) ;
484  fhEventPlaneAngle->SetXTitle("EP angle (rad)");
486 
487  fhTrackMult = new TH1F("hTrackMult", "Number of tracks per events", 2000 , 0 , 2000) ;
488  fhTrackMult->SetXTitle("# tracks");
490 
491  if ( GetReader()->GetWeightUtils()->IsCentralityWeightOn() )
492  {
493  fhNEventsWeighted = new TH1F("hNEventsWeighted", "Number of analyzed events weighted by centrality", 1 , 0 , 1 ) ;
494  fhNEventsWeighted->SetYTitle("# events");
496 
497  fhCentralityWeighted = new TH1F("hCentralityWeighted","Number of events in centrality bin weighted by centrality", 100, 0.,100) ;
498  fhCentralityWeighted->SetXTitle("Centrality bin");
500 
501  fhEventPlaneAngleWeighted = new TH1F("hEventPlaneAngleWeighted","Number of events in event plane weighted by centrality",100, 0., TMath::Pi()) ;
502  fhEventPlaneAngleWeighted->SetXTitle("EP angle (rad)");
504 
505  fhTrackMultWeighted = new TH1F("hTrackMultWeighted", "Number of tracks per events weighted by centrality", 2000 , 0 , 2000) ;
506  fhTrackMultWeighted->SetXTitle("# tracks");
508  }
509 
511  {
512  fhNExoticEvents = new TH1F("hNExoticEvents", "Number of analyzed events triggered by exotic cluster" , 1 , 0 , 1 ) ;
513  fhNExoticEvents->SetYTitle("# exotic events");
515 
516  fhNEventsNoTriggerFound = new TH1F("hNEventsNoTriggerFound", "Number of analyzed events triggered but no trigger found" , 1 , 0 , 1 ) ;
517  fhNEventsNoTriggerFound->SetYTitle("# exotic events");
519 
520 
521  Int_t nbin = 11;
522  Float_t minbin =-5.5;
523  Float_t maxbin = 5.5;
524  Int_t labelshift = 6;
525 
526  fhClusterTriggerBCEventBC = new TH2F("hClusterTriggerBCEventBC", "Found trigger BC and Event BC",
527  nbin , minbin ,maxbin,4,0, 4) ;
528  fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
529  for(Int_t i = 0; i < 4; i++)
530  fhClusterTriggerBCEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
531  fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
532  for(Int_t i = 1; i < 12; i++)
533  fhClusterTriggerBCEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
534  fhClusterTriggerBCEventBC->SetYTitle("Event BC%4");
536 
537  fhClusterTriggerBCExoticEventBC = new TH2F("hClusterTriggerBCExoticEventBC", "Found exotic trigger BC and Event BC",
538  nbin , minbin ,maxbin,4,1, 4) ;
539  for(Int_t i = 0; i < 4; i++)
540  fhClusterTriggerBCExoticEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
541  fhClusterTriggerBCExoticEventBC->SetXTitle("cluster trigger BC");
542  for(Int_t i = 1; i < 12; i++)
543  fhClusterTriggerBCExoticEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
544  fhClusterTriggerBCExoticEventBC->SetYTitle("Event BC%4");
546 
547  fhClusterTriggerBCEventBCUnMatch = new TH2F("hClusterTriggerBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
548  nbin , minbin ,maxbin,4,1, 4) ;
549  for(Int_t i = 0; i < 4; i++)
550  fhClusterTriggerBCEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
551  fhClusterTriggerBCEventBCUnMatch->SetXTitle("cluster trigger BC");
552  for(Int_t i = 1; i < 12; i++)
553  fhClusterTriggerBCEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
554  fhClusterTriggerBCEventBCUnMatch->SetYTitle("Event BC%4");
556 
557  fhClusterTriggerBCExoticEventBCUnMatch = new TH2F("hClusterTriggerExoticBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
558  nbin , minbin ,maxbin,4,1, 4) ;
559  for(Int_t i = 0; i < 4; i++)
560  fhClusterTriggerBCExoticEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
561  fhClusterTriggerBCExoticEventBCUnMatch->SetXTitle("cluster trigger BC");
562  for(Int_t i = 1; i < 12; i++)
563  fhClusterTriggerBCExoticEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
564  fhClusterTriggerBCExoticEventBCUnMatch->SetYTitle("Event BC%4");
566 
567  fhClusterTriggerBC = new TH1F("hClusterTriggerBC",
568  "Number of analyzed events triggered by a cluster in a given BC",
569  nbin , minbin ,maxbin) ;
570  fhClusterTriggerBC->SetYTitle("# events");
571  for(Int_t i = 1; i < 12; i++)
572  fhClusterTriggerBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
574 
575  fhClusterTriggerBCExotic = new TH1F("hClusterTriggerBCExotic",
576  "Number of analyzed events triggered by a exotic cluster in a given BC",
577  nbin , minbin ,maxbin) ;
578  fhClusterTriggerBCExotic->SetYTitle("# events");
579  for(Int_t i = 1; i < 12; i++)
580  fhClusterTriggerBCExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
582 
583 
584  fhClusterTriggerBCBadCell = new TH1F("hClusterTriggerBCBadCell",
585  "Number of analyzed events triggered by a bad cell in a given BC",
586  nbin , minbin ,maxbin) ;
587 
588  fhClusterTriggerBCBadCell->SetYTitle("# events");
589  for(Int_t i = 1; i < 12; i++)
590  fhClusterTriggerBCBadCell->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
592 
593  fhClusterTriggerBCBadCellExotic = new TH1F("hClusterTriggerBCBadCellExotic",
594  "Number of analyzed events triggered by a bad cell & exotic cluster in a given BC",
595  nbin , minbin ,maxbin) ;
596  fhClusterTriggerBCBadCellExotic->SetYTitle("# events");
597  for(Int_t i = 1; i < 12; i++)
598  fhClusterTriggerBCBadCellExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
600 
601  fhClusterTriggerBCBadCluster = new TH1F("hClusterTriggerBCBadCluster",
602  "Number of analyzed events triggered by a bad cluster in a given BC",
603  nbin , minbin ,maxbin) ;
604 
605  fhClusterTriggerBCBadCluster->SetYTitle("# events");
606  for(Int_t i = 1; i < 12; i++)
607  fhClusterTriggerBCBadCluster->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
609 
610 
611  fhClusterTriggerBCBadClusterExotic = new TH1F("hClusterTriggerBCBadClusterExotic",
612  "Number of analyzed events triggered by a bad cluster & exotic cluster in a given BC",
613  nbin , minbin ,maxbin) ;
614 
615  fhClusterTriggerBCBadClusterExotic->SetYTitle("# events");
616  for(Int_t i = 1; i < 12; i++)
617  fhClusterTriggerBCBadClusterExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
619 
620  fhClusterTriggerBCUnMatch = new TH1F("hClusterTriggerBCUnMatch",
621  "Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC",
622  nbin , minbin ,maxbin) ;
623  fhClusterTriggerBCUnMatch->SetYTitle("# events");
624  for(Int_t i = 1; i < 12; i++)
625  fhClusterTriggerBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
627 
628  fhClusterTriggerBCExoticUnMatch = new TH1F("hClusterTriggerBCExoticUnMatch",
629  "Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC",
630  nbin , minbin ,maxbin) ;
631  fhClusterTriggerBCExoticUnMatch->SetYTitle("# events");
632  for(Int_t i = 1; i < 12; i++)
633  fhClusterTriggerBCExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
635 
636 
637  fhClusterTriggerBCBadCellUnMatch = new TH1F("hClusterTriggerBCBadCellUnMatch",
638  "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
639  nbin , minbin ,maxbin) ;
640  fhClusterTriggerBCBadCellUnMatch->SetYTitle("# events");
641  for(Int_t i = 1; i < 12; i++)
642  fhClusterTriggerBCBadCellUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
644 
645 
646  fhClusterTriggerBCBadCellExoticUnMatch = new TH1F("hClusterTriggerBCBadCellExoticUnMatch",
647  "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
648  nbin , minbin ,maxbin) ;
649  fhClusterTriggerBCBadCellExoticUnMatch->SetYTitle("# events");
650  for(Int_t i = 1; i < 12; i++)
651  fhClusterTriggerBCBadCellExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
653 
654 
655  fhClusterTriggerBCBadClusterUnMatch = new TH1F("hClusterTriggerBCBadClusterUnMatch",
656  "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
657  nbin , minbin ,maxbin) ;
658  fhClusterTriggerBCBadClusterUnMatch->SetYTitle("# events");
659  for(Int_t i = 1; i < 12; i++)
660  fhClusterTriggerBCBadClusterUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
662 
663 
664  fhClusterTriggerBCBadClusterExoticUnMatch = new TH1F("hClusterTriggerBCBadClusterExoticUnMatch",
665  "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
666  nbin , minbin ,maxbin) ;
667  fhClusterTriggerBCBadClusterExoticUnMatch->SetYTitle("# events");
668  for(Int_t i = 1; i < 12; i++)
669  fhClusterTriggerBCBadClusterExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
671 
672  TString rematch[] = {"OpenTime","CheckNeighbours","Both"};
673  for(Int_t j = 0; j < 3; j++)
674  {
675  fhClusterTriggerBCUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCUnMatch_ReMatch_%s",rematch[j].Data()),
676  Form("Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
677  nbin , minbin ,maxbin) ;
678  fhClusterTriggerBCUnMatchReMatch[j]->SetYTitle("# events");
679  for(Int_t i = 1; i < 12; i++)
680  fhClusterTriggerBCUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
682 
683  fhClusterTriggerBCExoticUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCExoticUnMatch_ReMatch_%s",rematch[j].Data()),
684  Form("Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
685  nbin , minbin ,maxbin) ;
686  fhClusterTriggerBCExoticUnMatchReMatch[j]->SetYTitle("# events");
687  for(Int_t i = 1; i < 12; i++)
688  fhClusterTriggerBCExoticUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
690  }
691 
692  fhNPileUpEvents = new TH1F("hNPileUpEvents", "Number of events considered as pile-up", 8 , 0 , 8 ) ;
693  fhNPileUpEvents->SetYTitle("# events");
694  fhNPileUpEvents->GetXaxis()->SetBinLabel(1 ,"SPD");
695  fhNPileUpEvents->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
696  fhNPileUpEvents->GetXaxis()->SetBinLabel(3 ,"EMCal");
697  fhNPileUpEvents->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
698  fhNPileUpEvents->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
699  fhNPileUpEvents->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
700  fhNPileUpEvents->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
701  fhNPileUpEvents->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
703 
704  fhNPileUpEventsTriggerBC0 = new TH1F("hNPileUpEventsTriggerBC0","Number of events considered as pile-up, trigger cluster in BC=0", 8 , 0 , 8 ) ;
705  fhNPileUpEventsTriggerBC0->SetYTitle("# events");
706  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(1 ,"SPD");
707  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
708  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(3 ,"EMCal");
709  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
710  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
711  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
712  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
713  fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
715 
717  {
718  fhTrackBCEvent = new TH1F("hTrackBCEvent", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
719  fhTrackBCEvent->SetYTitle("# events");
720  fhTrackBCEvent->SetXTitle("Bunch crossing");
721  for(Int_t i = 1; i < 20; i++)
722  fhTrackBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
724 
725  fhTrackBCEventCut = new TH1F("hTrackBCEventCut", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
726  fhTrackBCEventCut->SetYTitle("# events");
727  fhTrackBCEventCut->SetXTitle("Bunch crossing");
728  for(Int_t i = 1; i < 20; i++)
729  fhTrackBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
731  }
732 
733  fhPrimaryVertexBC = new TH1F("hPrimaryVertexBC", "Number of primary vertex per bunch crossing ", 41 , -20 , 20 ) ;
734  fhPrimaryVertexBC->SetYTitle("# events");
735  fhPrimaryVertexBC->SetXTitle("Bunch crossing");
737 
738  fhEMCalBCEvent = new TH1F("hEMCalBCEvent", "Number of events with at least 1 cluster in a bunch crossing ", 19 , 0 , 19 ) ;
739  fhEMCalBCEvent->SetYTitle("# events");
740  fhEMCalBCEvent->SetXTitle("Bunch crossing");
741  for(Int_t i = 1; i < 20; i++)
742  fhEMCalBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
744 
745  fhEMCalBCEventCut = new TH1F("hEMCalBCEventCut", "Number of events with at least 1 cluster in a bunch crossing", 19 , 0 , 19 ) ;
746  fhEMCalBCEventCut->SetYTitle("# events");
747  fhEMCalBCEventCut->SetXTitle("Bunch crossing");
748  for(Int_t i = 1; i < 20; i++)
749  fhEMCalBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
751 
752  fhXVertexExotic = new TH1F("hXVertexExotic", " X vertex distribution in exotic events" , 200 , -4 , 4 ) ;
753  fhXVertexExotic->SetXTitle("v_{x} (cm)");
755 
756  fhYVertexExotic = new TH1F("hYVertexExotic", " Y vertex distribution in exotic events" , 200 , -4 , 4 ) ;
757  fhYVertexExotic->SetXTitle("v_{y} (cm)");
759 
760  fhZVertexExotic = new TH1F("hZVertexExotic", " Z vertex distribution in exotic events" , 200 , -50 , 50 ) ;
761  fhZVertexExotic->SetXTitle("v_{z} (cm)");
763 
764  fhPileUpClusterMult = new TH1F("hPileUpClusterMult", "Number of clusters per event with large time (|t| > 20 ns)" , 100 , 0 , 100 ) ;
765  fhPileUpClusterMult->SetXTitle("# clusters");
767 
768  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 ) ;
769  fhPileUpClusterMultAndSPDPileUp->SetXTitle("# clusters");
771 
772  fhNPileUpVertSPD = new TH1F ("hNPileUpVertSPD","N pile-up SPD vertex", 50,0,50);
773  fhNPileUpVertSPD->SetYTitle("# vertex ");
775 
776  fhNPileUpVertTracks = new TH1F ("hNPileUpVertTracks","N pile-up Tracks vertex", 50,0,50);
777  fhNPileUpVertTracks->SetYTitle("# vertex ");
779 
781  {
782  fhTimeStampFraction = new TH1F("hTimeStampFraction","Fraction of events within a given time stamp range",150, -1, 2) ;
783  fhTimeStampFraction->SetXTitle("fraction");
785  }
786  }
787 
788  fhNMergedFiles = new TH1F("hNMergedFiles", "Number of merged output files" , 1 , 0 , 1 ) ;
789  fhNMergedFiles->SetYTitle("# files");
790  fhNMergedFiles->Fill(1); // Fill here with one entry, while merging it will count the rest
792 
793  if(fScaleFactor > 0)
794  {
795  fhScaleFactor = new TH1F("hScaleFactor", "Number of merged output files" , 1 , 0 , 1 ) ;
796  fhScaleFactor->SetYTitle("scale factor");
797  fhScaleFactor->SetBinContent(1,fScaleFactor); // Fill here
799  }
800 
801  // Histograms defined and filled in this class, just get the pointers
802  // and add them to the list.
803  if(GetReader()->GetWeightUtils()->IsMCCrossSectionCalculationOn())
804  {
805  TList * templist = GetReader()->GetWeightUtils()->GetCreateOutputHistograms();
806 
807  if ( templist && templist->GetEntries() == 2 )
808  {
809  templist->SetOwner(kFALSE); //Owner is fOutputContainer.
810 
811  fOutputContainer->Add(templist->At(0));
812  fOutputContainer->Add(templist->At(1));
813  }
814  }
815 
816  if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
817  {
818  AliWarning("Analysis job list not initialized!!!");
819  return fOutputContainer;
820  }
821 
822  const Int_t buffersize = 255;
823  char newname[buffersize];
824  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
825  {
827 
828  if(fMakeHisto) // Analysis with histograms as output on
829  {
830  //Fill container with appropriate histograms
831  TList * templist = ana->GetCreateOutputObjects();
832  templist->SetOwner(kFALSE); //Owner is fOutputContainer.
833 
834  for(Int_t i = 0; i < templist->GetEntries(); i++)
835  {
836  //Add only to the histogram name the name of the task
837  if( strcmp((templist->At(i))->ClassName(),"TObjString") )
838  {
839  snprintf(newname,buffersize, "%s%s", (ana->GetAddedHistogramsStringToName()).Data(), (templist->At(i))->GetName());
840  //printf("name %s, new name %s\n",(templist->At(i))->GetName(),newname);
841 
842  ((TH1*) templist->At(i))->SetName(newname);
843 
844  if ( fSumw2 ) ((TH1*) templist->At(i))->Sumw2();
845  }
846 
847  //Add histogram to general container
848  fOutputContainer->Add(templist->At(i)) ;
849  }
850 
851  delete templist;
852 
853  }// Analysis with histograms as output on
854 
855  }//Loop on analysis defined
856 
857  // Initialize calorimeters geometry pointers
858  //GetCaloUtils()->InitPHOSGeometry();
859  //GetCaloUtils()->InitEMCALGeometry();
860 
861  return fOutputContainer;
862 
863 }
864 
865 //___________________________________
870 //___________________________________
872 {
873  // Activate debug level in maker
874  if( fAnaDebug >= 0 )
875  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(this->ClassName(),fAnaDebug);
876 
877  //Initialize reader
878  GetReader()->Init();
879  GetReader()->SetCaloUtils(GetCaloUtils()); // pass the calo utils pointer to the reader
880 
881  // Activate debug level in reader
882  if( fReader->GetDebug() >= 0 )
883  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(fReader->ClassName(), fReader->GetDebug());
884 
885  // Activate debug level in calo utils
886  if( fCaloUtils->GetDebug() >= 0 )
887  (AliAnalysisManager::GetAnalysisManager())->AddClassDebug(fCaloUtils->ClassName(), fCaloUtils->GetDebug());
888 
889  if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
890  {
891  AliWarning("Analysis job list not initialized");
892  return;
893  }
894 
895  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
896  {
898 
899  ana->SetReader(fReader); // Set Reader for each analysis
900  ana->SetCaloUtils(fCaloUtils); // Set CaloUtils for each analysis
901 
902  ana->Init();
903  ana->InitDebug();
904  }//Loop on analysis defined
905 }
906 
907 //_____________________________________________
909 //_____________________________________________
911 {
912  fMakeHisto = kTRUE;
913  fMakeAOD = kTRUE;
914  fAnaDebug = 0; // No debugging info displayed by default
915 }
916 
917 //______________________________________________________________
919 //______________________________________________________________
920 void AliAnaCaloTrackCorrMaker::Print(const Option_t * opt) const
921 {
922  if(! opt)
923  return;
924 
925  printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
926  printf("Debug level = %d\n", fAnaDebug ) ;
927  printf("Produce Histo = %d\n", fMakeHisto ) ;
928  printf("Produce AOD = %d\n", fMakeAOD ) ;
929  printf("Number of analysis tasks = %d\n", fAnalysisContainer->GetEntries()) ;
930 
931  if(!strcmp("all",opt))
932  {
933  printf("Print analysis Tasks settings :\n") ;
934  for(Int_t iana = 0; iana<fAnalysisContainer->GetEntries(); iana++)
935  {
937  }
938 
939  printf("Print analysis Reader settings :\n") ;
940  fReader->Print("");
941  printf("Print analysis Calorimeter Utils settings :\n") ;
942  fCaloUtils->Print("");
943  }
944 }
945 
946 //_____________________________________________________________________________________
956 //_____________________________________________________________________________________
957 void AliAnaCaloTrackCorrMaker::ProcessEvent(Int_t iEntry, const char * currentFileName)
958 {
960  AliFatal("Histograms not initialized");
961 
962  AliDebug(1,Form("*** AliAnaCaloTrackCorrMaker::ProcessEvent() Event %d ***",iEntry));
963  AliDebug(2,Form("Current File Name : %s", currentFileName));
964  //printf("fAODBranchList %p, entries %d\n",fAODBranchList,fAODBranchList->GetEntries());
965 
966  // Each event needs an empty branch
967  TList * aodList = fReader->GetAODBranchList();
968  Int_t nAODBranches = aodList->GetEntries();
969  for(Int_t iaod = 0; iaod < nAODBranches; iaod++)
970  {
971  TClonesArray *tca = dynamic_cast<TClonesArray*> (aodList->At(iaod));
972  if(tca) tca->Clear("C");
973  }
974 
975  // Set geometry matrices before filling arrays, in case recalibration/position calculation etc is needed
977 
978  // Set the AODB calibration, bad channels etc. parameters at least once
980 
981  // Tell the reader to fill the data in the 3 detector lists
982  Bool_t ok = fReader->FillInputEvent(iEntry, currentFileName);
983 
984  // Access pointers, and trigger mask check needed in mixing case
985  AliAnalysisManager *manager = AliAnalysisManager::GetAnalysisManager();
986  AliInputEventHandler *inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
987 
988  UInt_t isMBTrigger = kFALSE;
989  UInt_t isTrigger = kFALSE;
990  if(inputHandler)
991  {
992  isMBTrigger = inputHandler->IsEventSelected() & fReader->GetMixEventTriggerMask();
993  isTrigger = inputHandler->IsEventSelected() & fReader->GetEventTriggerMask();
994  }
995 
996  //Fill trigger control histograms, make sure it is only for triggered events and
997  // not the MB events used for mixing
998  if(fReader->IsEventTriggerAtSEOn() || isTrigger)
999  {
1000  fhNEventsIn->Fill(0);
1002  }
1003 
1004  if(!ok)
1005  {
1006  AliDebug(1,Form("*** Skip event *** %d",iEntry));
1007  fReader->ResetLists();
1008  return ;
1009  }
1010 
1011  // Magic line to write events to file
1012  if(fReader->WriteDeltaAODToFile())AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
1013 
1014  //printf(">>>>>>>>>> BEFORE >>>>>>>>>>>\n");
1015  //gObjectTable->Print();
1016 
1017  // Init mag field for tracks in case of ESDs, not really necessary
1018  if ( !TGeoGlobalMagField::Instance()->GetField() && fReader->GetInputEvent() )
1019  (fReader->GetInputEvent())->InitMagneticField();
1020 
1021  // Loop on analysis algorithms
1022 
1023  AliDebug(1,"*** Begin analysis ***");
1024 
1025  Int_t nana = fAnalysisContainer->GetEntries() ;
1026  for(Int_t iana = 0; iana < nana; iana++)
1027  {
1029 
1030  ana->ConnectInputOutputAODBranches(); // Sets branches for each analysis
1031 
1032  //Fill pool for mixed event for the analysis that need it
1033  if(!fReader->IsEventTriggerAtSEOn() && isMBTrigger)
1034  {
1035  ana->FillEventMixPool();
1036  if(!isTrigger) continue; // pool filled do not try to fill AODs or histograms if trigger is not MB
1037  }
1038 
1039  //Make analysis, create aods in aod branch and in some cases fill histograms
1040  if(fMakeAOD ) ana->MakeAnalysisFillAOD() ;
1041 
1042  //Make further analysis with aod branch and fill histograms
1044 
1045  }
1046 
1047  fReader->ResetLists();
1048 
1049  // In case of mixing analysis, non triggered events are used,
1050  // do not fill control histograms for a non requested triggered event
1051  if(!fReader->IsEventTriggerAtSEOn() && !isTrigger)
1052  {
1053  AliDebug(1,"*** End analysis, MB for mixing ***");
1054  return;
1055  }
1056 
1058 
1059  //printf(">>>>>>>>>> AFTER >>>>>>>>>>>\n");
1060  //gObjectTable->Print();
1061 
1062  AliDebug(1,"*** End analysis ***");
1063 }
1064 
1065 //__________________________________________________________
1068 //__________________________________________________________
1069 void AliAnaCaloTrackCorrMaker::Terminate(TList * outputList)
1070 {
1071  if (!outputList)
1072  {
1073  AliError("No output list");
1074  return;
1075  }
1076 
1077  for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
1078  {
1080  if(ana->MakePlotsOn())ana->Terminate(outputList);
1081  } // Loop on analysis defined
1082 }
1083 
1084 
1085 
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.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
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 * 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
Bool_t IsCentralityWeightOn() const
Definition: AliAnaWeights.h:52
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
TH1F * fhTrackMultWeighted
! Number of tracks per event histogram. After centrality weight.
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
TH1F * fhPileUpClusterMult
! N clusters with high time.
TH1F * fhTrackMult
! Number of tracks per event histogram.
Int_t GetEMCalEventBC(Int_t bc) const
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 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.
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.
AliCaloTrackReader * GetReader()
void AccessGeometry(AliVEvent *inputEvent)
Int_t GetTrackMultiplicity() const
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.