1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //_____________________________________________________________________________
17 // Steering class for particle (gamma, hadron) identification and correlation
18 // analysis. It is called by the task class AliAnalysisTaskCaloTrackCorrelation
19 // and it connects the input (ESD/AOD/MonteCarlo) got with AliCaloTrackReader
20 // (produces TClonesArrays of AODs (TParticles in MC case if requested)), with
21 // the analysis classes that derive from AliAnaCaloTrackCorrBaseClass
23 // -- Author: Gustavo Conesa (INFN-LNF, LPSC-Grenoble)
27 // --- ROOT system ---
28 #include "TClonesArray.h"
31 //#include <TObjectTable.h>
33 //---- AliRoot system ----
34 #include "AliAnalysisManager.h"
35 #include "AliInputEventHandler.h"
36 #include "AliESDEvent.h"
37 #include "AliAODEvent.h"
38 #include "AliAnaCaloTrackCorrBaseClass.h"
39 #include "AliAnaCaloTrackCorrMaker.h"
41 ClassImp(AliAnaCaloTrackCorrMaker)
44 //__________________________________________________
45 AliAnaCaloTrackCorrMaker::AliAnaCaloTrackCorrMaker() :
47 fReader(0), fCaloUtils(0),
48 fOutputContainer(new TList ), fAnalysisContainer(new TList ),
49 fMakeHisto(kFALSE), fMakeAOD(kFALSE),
50 fAnaDebug(0), fCuts(new TList),
52 fFillDataControlHisto(kTRUE),
54 fhNEvents(0), fhNExoticEvents(0),
55 fhNEventsNoTriggerFound(0),
56 fhNPileUpEvents(0), fhNPileUpEventsTriggerBC0(0),
57 fhXVertex(0), fhYVertex(0), fhZVertex(0),
58 fhXVertexExotic(0), fhYVertexExotic(0), fhZVertexExotic(0),
59 fhPileUpClusterMult(0), fhPileUpClusterMultAndSPDPileUp(0),
61 fhCentrality(0), fhEventPlaneAngle(0),
62 fhNMergedFiles(0), fhScaleFactor(0),
63 fhEMCalBCEvent(0), fhEMCalBCEventCut(0),
64 fhTrackBCEvent(0), fhTrackBCEventCut(0),
65 fhPrimaryVertexBC(0), fhTimeStampFraction(0),
66 fhNPileUpVertSPD(0), fhNPileUpVertTracks(0),
68 fhClusterTriggerBC(0), fhClusterTriggerBCExotic(0),
69 fhClusterTriggerBCBadCell(0), fhClusterTriggerBCBadCellExotic(0),
70 fhClusterTriggerBCBadCluster(0), fhClusterTriggerBCBadClusterExotic(0),
71 fhClusterTriggerBCUnMatch(0), fhClusterTriggerBCExoticUnMatch(0),
72 fhClusterTriggerBCBadCellUnMatch(0), fhClusterTriggerBCBadCellExoticUnMatch(0),
73 fhClusterTriggerBCBadClusterUnMatch(0), fhClusterTriggerBCBadClusterExoticUnMatch(0),
74 fhClusterTriggerBCEventBC(0), fhClusterTriggerBCEventBCUnMatch(0),
75 fhClusterTriggerBCExoticEventBC(0), fhClusterTriggerBCExoticEventBCUnMatch(0)
78 if(fAnaDebug > 1 ) printf("*** Analysis Maker Constructor *** \n");
80 for(Int_t i = 0; i < 3; i++)
82 fhClusterTriggerBCUnMatchReMatch [0] = 0;
83 fhClusterTriggerBCExoticUnMatchReMatch[0] = 0;
86 //Initialize parameters, pointers and histograms
90 //________________________________________________________________________________________
91 AliAnaCaloTrackCorrMaker::AliAnaCaloTrackCorrMaker(const AliAnaCaloTrackCorrMaker & maker) :
93 fReader(), //(new AliCaloTrackReader(*maker.fReader)),
94 fCaloUtils(),//(new AliCalorimeterUtils(*maker.fCaloUtils)),
95 fOutputContainer(new TList()), fAnalysisContainer(new TList()),
96 fMakeHisto(maker.fMakeHisto), fMakeAOD(maker.fMakeAOD),
97 fAnaDebug(maker.fAnaDebug), fCuts(new TList()),
98 fScaleFactor(maker.fScaleFactor),
99 fFillDataControlHisto(maker.fFillDataControlHisto),
100 fhNEvents(maker.fhNEvents),
101 fhNExoticEvents(maker.fhNExoticEvents),
102 fhNEventsNoTriggerFound(maker.fhNEventsNoTriggerFound),
103 fhNPileUpEvents(maker.fhNPileUpEvents),
104 fhNPileUpEventsTriggerBC0(maker.fhNPileUpEventsTriggerBC0),
105 fhXVertex(maker.fhXVertex),
106 fhYVertex(maker.fhYVertex),
107 fhZVertex(maker.fhZVertex),
108 fhXVertexExotic(maker.fhXVertexExotic),
109 fhYVertexExotic(maker.fhYVertexExotic),
110 fhZVertexExotic(maker.fhZVertexExotic),
111 fhPileUpClusterMult(maker.fhPileUpClusterMult),
112 fhPileUpClusterMultAndSPDPileUp(maker.fhPileUpClusterMultAndSPDPileUp),
113 fhTrackMult(maker.fhTrackMult),
114 fhCentrality(maker.fhCentrality),
115 fhEventPlaneAngle(maker.fhEventPlaneAngle),
116 fhNMergedFiles(maker.fhNMergedFiles),
117 fhScaleFactor(maker.fhScaleFactor),
118 fhEMCalBCEvent(maker.fhEMCalBCEvent),
119 fhEMCalBCEventCut(maker.fhEMCalBCEventCut),
120 fhTrackBCEvent(maker.fhTrackBCEvent),
121 fhTrackBCEventCut(maker.fhTrackBCEventCut),
122 fhPrimaryVertexBC(maker.fhPrimaryVertexBC),
123 fhTimeStampFraction(maker.fhTimeStampFraction),
124 fhNPileUpVertSPD(maker.fhNPileUpVertSPD),
125 fhNPileUpVertTracks(maker.fhNPileUpVertTracks),
126 fhClusterTriggerBC(maker.fhClusterTriggerBC),
127 fhClusterTriggerBCExotic(maker.fhClusterTriggerBCExotic),
128 fhClusterTriggerBCBadCell(maker.fhClusterTriggerBCBadCell),
129 fhClusterTriggerBCBadCellExotic(maker.fhClusterTriggerBCBadCellExotic),
130 fhClusterTriggerBCBadCluster(maker.fhClusterTriggerBCBadCluster),
131 fhClusterTriggerBCBadClusterExotic(maker.fhClusterTriggerBCBadClusterExotic),
132 fhClusterTriggerBCUnMatch(maker.fhClusterTriggerBCUnMatch),
133 fhClusterTriggerBCExoticUnMatch(maker.fhClusterTriggerBCExoticUnMatch),
134 fhClusterTriggerBCBadCellUnMatch(maker.fhClusterTriggerBCBadCellUnMatch),
135 fhClusterTriggerBCBadCellExoticUnMatch(maker.fhClusterTriggerBCBadCellExoticUnMatch),
136 fhClusterTriggerBCBadClusterUnMatch(maker.fhClusterTriggerBCBadClusterUnMatch),
137 fhClusterTriggerBCBadClusterExoticUnMatch(maker.fhClusterTriggerBCBadClusterExoticUnMatch),
138 fhClusterTriggerBCEventBC(maker.fhClusterTriggerBCEventBC),
139 fhClusterTriggerBCEventBCUnMatch(maker.fhClusterTriggerBCEventBCUnMatch),
140 fhClusterTriggerBCExoticEventBC(maker.fhClusterTriggerBCExoticEventBC),
141 fhClusterTriggerBCExoticEventBCUnMatch(maker.fhClusterTriggerBCExoticEventBCUnMatch)
144 for(Int_t i = 0; i < 3; i++)
146 fhClusterTriggerBCUnMatchReMatch [i] = maker.fhClusterTriggerBCUnMatchReMatch [i];
147 fhClusterTriggerBCExoticUnMatchReMatch[i] = maker.fhClusterTriggerBCExoticUnMatchReMatch[i];
152 //___________________________________________________
153 AliAnaCaloTrackCorrMaker::~AliAnaCaloTrackCorrMaker()
155 // Remove all owned pointers.
157 // Do not delete it here, already done somewhere else, need to understand where.
158 // if (fOutputContainer) {
159 // fOutputContainer->Clear();
160 // delete fOutputContainer ;
163 if (fAnalysisContainer)
165 fAnalysisContainer->Delete();
166 delete fAnalysisContainer ;
169 if (fReader) delete fReader ;
170 if (fCaloUtils) delete fCaloUtils ;
180 //__________________________________________________________________
181 void AliAnaCaloTrackCorrMaker::AddAnalysis(TObject* ana, Int_t n)
183 // Add analysis depending on AliAnaCaloTrackCorrBaseClass to list
185 if ( fAnalysisContainer)
187 fAnalysisContainer->AddAt(ana,n);
191 printf("AliAnaCaloTrackCorrMaker::AddAnalysis() - AnalysisContainer not initialized\n");
196 //_________________________________________________________
197 TList * AliAnaCaloTrackCorrMaker::FillAndGetAODBranchList()
200 // Get any new output AOD branches from analysis and put them in a list
201 // The list is filled in the maker, and new branch passed to the analysis frame
202 // AliAnalysisTaskCaloTrackCorrelation
204 TList *aodBranchList = fReader->GetAODBranchList() ;
206 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
208 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
209 if(ana->NewOutputAOD()) aodBranchList->Add(ana->GetCreateOutputAODBranch());
212 return aodBranchList ;
216 //____________________________________________________
217 void AliAnaCaloTrackCorrMaker::FillControlHistograms()
219 // Event control histograms
221 AliVEvent* event = fReader->GetInputEvent();
222 AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (event);
223 AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (event);
225 fhNEvents ->Fill(0); // Number of events analyzed
228 event->GetPrimaryVertex()->GetXYZ(v) ;
229 fhXVertex->Fill(v[0]);
230 fhYVertex->Fill(v[1]);
231 fhZVertex->Fill(v[2]);
233 fhTrackMult ->Fill(fReader->GetTrackMultiplicity());
234 fhCentrality ->Fill(fReader->GetEventCentrality ());
235 fhEventPlaneAngle ->Fill(fReader->GetEventPlaneAngle ());
237 if(fFillDataControlHisto)
239 if( fReader->IsPileUpFromSPD())
240 fhNPileUpEvents->Fill(0.5);
241 //if( event->IsPileupFromSPDInMultBins())
242 // fhNPileUpEvents->Fill(1.5);
243 if( fReader->IsPileUpFromEMCal())
244 fhNPileUpEvents->Fill(2.5);
245 if( fReader->IsPileUpFromSPDOrEMCal() )
246 fhNPileUpEvents->Fill(3.5);
247 if( fReader->IsPileUpFromSPDAndEMCal() )
248 fhNPileUpEvents->Fill(4.5);
249 if( fReader->IsPileUpFromSPDAndNotEMCal() )
250 fhNPileUpEvents->Fill(5.5);
251 if( fReader->IsPileUpFromEMCalAndNotSPD() )
252 fhNPileUpEvents->Fill(6.5);
253 if( fReader->IsPileUpFromNotSPDAndNotEMCal() )
254 fhNPileUpEvents->Fill(7.5);
256 Int_t triggerBC = fReader->GetTriggerClusterBC() ;
257 if( triggerBC == 0 &&
258 !fReader->IsExoticEvent() &&
259 !fReader->IsBadCellTriggerEvent())
261 if( fReader->IsPileUpFromSPD())
262 fhNPileUpEventsTriggerBC0->Fill(0.5);
263 //if( event->IsPileupFromSPDInMultBins())
264 // fhNPileUpEventsTriggerBC0->Fill(1.5);
265 if( fReader->IsPileUpFromEMCal())
266 fhNPileUpEventsTriggerBC0->Fill(2.5);
267 if( fReader->IsPileUpFromSPDOrEMCal() )
268 fhNPileUpEventsTriggerBC0->Fill(3.5);
269 if( fReader->IsPileUpFromSPDAndEMCal() )
270 fhNPileUpEventsTriggerBC0->Fill(4.5);
271 if( fReader->IsPileUpFromSPDAndNotEMCal() )
272 fhNPileUpEventsTriggerBC0->Fill(5.5);
273 if( fReader->IsPileUpFromEMCalAndNotSPD() )
274 fhNPileUpEventsTriggerBC0->Fill(6.5);
275 if( fReader->IsPileUpFromNotSPDAndNotEMCal() )
276 fhNPileUpEventsTriggerBC0->Fill(7.5);
279 if(fReader->IsPileUpFromSPD())
280 fhPileUpClusterMultAndSPDPileUp ->Fill(fReader->GetNPileUpClusters());
282 fhPileUpClusterMult ->Fill(fReader->GetNPileUpClusters ());
284 for(Int_t i = 0; i < 19; i++)
286 if(fReader->GetTrackEventBC(i)) fhTrackBCEvent ->Fill(i);
287 if(fReader->GetTrackEventBCcut(i))fhTrackBCEventCut->Fill(i);
288 if(fReader->GetEMCalEventBC(i)) fhEMCalBCEvent ->Fill(i);
289 if(fReader->GetEMCalEventBCcut(i))fhEMCalBCEventCut->Fill(i);
292 Int_t bc = fReader->GetVertexBC();
293 if(bc!=AliVTrack::kTOFBCNA)fhPrimaryVertexBC->Fill(bc);
296 // N pile up vertices
297 Int_t nVerticesSPD = -1;
298 Int_t nVerticesTracks = -1;
302 nVerticesSPD = esdevent->GetNumberOfPileupVerticesSPD();
303 nVerticesTracks = esdevent->GetNumberOfPileupVerticesTracks();
308 nVerticesSPD = aodevent->GetNumberOfPileupVerticesSPD();
309 nVerticesTracks = aodevent->GetNumberOfPileupVerticesTracks();
312 fhNPileUpVertSPD ->Fill(nVerticesSPD);
313 fhNPileUpVertTracks->Fill(nVerticesTracks);
316 if(fReader->IsSelectEventTimeStampOn() && esdevent)
318 Int_t timeStamp = esdevent->GetTimeStamp();
319 Float_t timeStampFrac = 1.*(timeStamp-fReader->GetRunTimeStampMin()) /
320 (fReader->GetRunTimeStampMax()-fReader->GetRunTimeStampMin());
322 //printf("stamp %d, min %d, max %d, frac %f\n", timeStamp, fReader->GetRunTimeStampMin(), fReader->GetRunTimeStampMax(), timeStampFrac);
324 fhTimeStampFraction->Fill(timeStampFrac);
329 //___________________________________________________________
330 void AliAnaCaloTrackCorrMaker::FillTriggerControlHistograms()
332 if(!fFillDataControlHisto) return;
334 Int_t triggerBC = fReader->GetTriggerClusterBC() ;
335 Bool_t exotic = fReader->IsExoticEvent();
336 Bool_t badCluster = fReader->IsBadCellTriggerEvent();
337 Bool_t badCell = fReader->IsBadMaxCellTriggerEvent();
338 Bool_t triggerMatch= fReader->IsTriggerMatched();
339 Bool_t triggerBCOK = kTRUE;
340 Int_t triggerId = fReader->GetTriggerClusterId() ;
341 Bool_t reMatchOpenTime = fReader->IsTriggerMatchedOpenCuts(0);
342 Bool_t reMatchNeigbour = fReader->IsTriggerMatchedOpenCuts(1);
343 Bool_t reMatchBoth = fReader->IsTriggerMatchedOpenCuts(2);
347 //printf("Trigger id %d\n",triggerId);
348 if(triggerId == -2)fhNEventsNoTriggerFound->Fill(0);
349 triggerBCOK = kFALSE;
354 fhNExoticEvents->Fill(0) ;
356 fReader->GetInputEvent()->GetPrimaryVertex()->GetXYZ(v) ;
357 fhXVertexExotic->Fill(v[0]);
358 fhYVertexExotic->Fill(v[1]);
359 fhZVertexExotic->Fill(v[2]);
361 //if(fReader->IsExoticEvent()) printf("Maker: EXOTIC Cluster trigger\n");
363 if(!triggerBCOK) return;
365 Int_t eventBC = fReader->GetInputEvent()->GetBunchCrossNumber();
366 if(eventBC%4 < 0 || eventBC%4 > 3 )
367 printf("AliAnaCaloTrackCorrMaker::ProcessEvent() - STRANGE: Trigger BC %d - Event BC %d, modulo4 %d \n",triggerBC,eventBC,eventBC%4);
371 if (!exotic && !badCluster) fhClusterTriggerBC->Fill(triggerBC);
372 else if( exotic && badCluster)
374 fhClusterTriggerBCBadClusterExotic->Fill(triggerBC);
375 if(badCell) fhClusterTriggerBCBadCellExotic->Fill(triggerBC);
377 else if( exotic && !badCluster) fhClusterTriggerBCExotic->Fill(triggerBC);
378 else if( badCluster && !exotic )
380 fhClusterTriggerBCBadCluster ->Fill(triggerBC);
381 if(badCell) fhClusterTriggerBCBadCell->Fill(triggerBC);
384 if(!exotic) fhClusterTriggerBCEventBC ->Fill(triggerBC,eventBC%4);
385 else fhClusterTriggerBCExoticEventBC->Fill(triggerBC,eventBC%4);
389 if (!exotic && !badCluster)
391 fhClusterTriggerBCUnMatch->Fill(triggerBC);
392 if(reMatchOpenTime) fhClusterTriggerBCUnMatchReMatch[0]->Fill(triggerBC);
393 if(reMatchNeigbour) fhClusterTriggerBCUnMatchReMatch[1]->Fill(triggerBC);
394 if(reMatchBoth) fhClusterTriggerBCUnMatchReMatch[2]->Fill(triggerBC);
396 else if( exotic && badCluster)
398 fhClusterTriggerBCBadClusterExoticUnMatch->Fill(triggerBC);
399 if(badCell) fhClusterTriggerBCBadCellExoticUnMatch ->Fill(triggerBC);
401 else if( exotic && !badCluster)
403 fhClusterTriggerBCExoticUnMatch->Fill(triggerBC);
404 if(reMatchOpenTime) fhClusterTriggerBCExoticUnMatchReMatch[0]->Fill(triggerBC);
405 if(reMatchNeigbour) fhClusterTriggerBCExoticUnMatchReMatch[1]->Fill(triggerBC);
406 if(reMatchBoth) fhClusterTriggerBCExoticUnMatchReMatch[2]->Fill(triggerBC);
408 else if( badCluster && !exotic )
410 fhClusterTriggerBCBadClusterUnMatch->Fill(triggerBC);
411 if(badCell)fhClusterTriggerBCBadCellUnMatch->Fill(triggerBC);
414 if(!exotic) fhClusterTriggerBCEventBCUnMatch ->Fill(triggerBC,eventBC%4);
415 else fhClusterTriggerBCExoticEventBCUnMatch->Fill(triggerBC,eventBC%4);
421 //_______________________________________________________
422 TList * AliAnaCaloTrackCorrMaker::GetListOfAnalysisCuts()
425 // Get the list of the cuts used for the analysis
426 // The list is filled in the maker, called by the task in LocalInit() and posted there
428 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
430 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
431 TObjString * objstring = ana->GetAnalysisCuts();
433 if(objstring)fCuts->Add(objstring);
440 //___________________________________________________
441 TList *AliAnaCaloTrackCorrMaker::GetOutputContainer()
443 // Fill the output list of histograms during the CreateOutputObjects stage.
445 //Initialize calorimeters geometry pointers
446 //GetCaloUtils()->InitPHOSGeometry();
447 //GetCaloUtils()->InitEMCALGeometry();
449 //General event histograms
451 fhNEvents = new TH1F("hNEvents", "Number of analyzed events" , 1 , 0 , 1 ) ;
452 fhNEvents->SetYTitle("# events");
453 fOutputContainer->Add(fhNEvents);
455 fhXVertex = new TH1F("hXVertex", " X vertex distribution" , 200 , -4 , 4 ) ;
456 fhXVertex->SetXTitle("v_{x} (cm)");
457 fOutputContainer->Add(fhXVertex);
459 fhYVertex = new TH1F("hYVertex", " Y vertex distribution" , 200 , -4 , 4 ) ;
460 fhYVertex->SetXTitle("v_{y} (cm)");
461 fOutputContainer->Add(fhYVertex);
463 fhZVertex = new TH1F("hZVertex", " Z vertex distribution" , 200 , -50 , 50 ) ;
464 fhZVertex->SetXTitle("v_{z} (cm)");
465 fOutputContainer->Add(fhZVertex);
467 fhCentrality = new TH1F("hCentrality","Number of events in centrality bin",100,0.,100) ;
468 fhCentrality->SetXTitle("Centrality bin");
469 fOutputContainer->Add(fhCentrality) ;
471 fhEventPlaneAngle=new TH1F("hEventPlaneAngle","Number of events in event plane",100,0.,TMath::Pi()) ;
472 fhEventPlaneAngle->SetXTitle("EP angle (rad)");
473 fOutputContainer->Add(fhEventPlaneAngle) ;
475 fhTrackMult = new TH1F("hTrackMult", "Number of tracks per events" , 2000 , 0 , 2000 ) ;
476 fhTrackMult->SetXTitle("# tracks");
477 fOutputContainer->Add(fhTrackMult);
479 if(fFillDataControlHisto)
481 fhNExoticEvents = new TH1F("hNExoticEvents", "Number of analyzed events triggered by exotic cluster" , 1 , 0 , 1 ) ;
482 fhNExoticEvents->SetYTitle("# exotic events");
483 fOutputContainer->Add(fhNExoticEvents);
485 fhNEventsNoTriggerFound = new TH1F("hNEventsNoTriggerFound", "Number of analyzed events triggered but no trigger found" , 1 , 0 , 1 ) ;
486 fhNEventsNoTriggerFound->SetYTitle("# exotic events");
487 fOutputContainer->Add(fhNEventsNoTriggerFound);
491 Float_t minbin =-5.5;
492 Float_t maxbin = 5.5;
493 Int_t labelshift = 6;
495 fhClusterTriggerBCEventBC = new TH2F("hClusterTriggerBCEventBC", "Found trigger BC and Event BC",
496 nbin , minbin ,maxbin,4,0, 4) ;
497 fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
498 for(Int_t i = 0; i < 4; i++)
499 fhClusterTriggerBCEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
500 fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
501 for(Int_t i = 1; i < 12; i++)
502 fhClusterTriggerBCEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
503 fhClusterTriggerBCEventBC->SetYTitle("Event BC%4");
504 fOutputContainer->Add(fhClusterTriggerBCEventBC);
506 fhClusterTriggerBCExoticEventBC = new TH2F("hClusterTriggerBCExoticEventBC", "Found exotic trigger BC and Event BC",
507 nbin , minbin ,maxbin,4,1, 4) ;
508 for(Int_t i = 0; i < 4; i++)
509 fhClusterTriggerBCExoticEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
510 fhClusterTriggerBCExoticEventBC->SetXTitle("cluster trigger BC");
511 for(Int_t i = 1; i < 12; i++)
512 fhClusterTriggerBCExoticEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
513 fhClusterTriggerBCExoticEventBC->SetYTitle("Event BC%4");
514 fOutputContainer->Add(fhClusterTriggerBCExoticEventBC);
516 fhClusterTriggerBCEventBCUnMatch = new TH2F("hClusterTriggerBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
517 nbin , minbin ,maxbin,4,1, 4) ;
518 for(Int_t i = 0; i < 4; i++)
519 fhClusterTriggerBCEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
520 fhClusterTriggerBCEventBCUnMatch->SetXTitle("cluster trigger BC");
521 for(Int_t i = 1; i < 12; i++)
522 fhClusterTriggerBCEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
523 fhClusterTriggerBCEventBCUnMatch->SetYTitle("Event BC%4");
524 fOutputContainer->Add(fhClusterTriggerBCEventBCUnMatch);
526 fhClusterTriggerBCExoticEventBCUnMatch = new TH2F("hClusterTriggerExoticBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
527 nbin , minbin ,maxbin,4,1, 4) ;
528 for(Int_t i = 0; i < 4; i++)
529 fhClusterTriggerBCExoticEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
530 fhClusterTriggerBCExoticEventBCUnMatch->SetXTitle("cluster trigger BC");
531 for(Int_t i = 1; i < 12; i++)
532 fhClusterTriggerBCExoticEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
533 fhClusterTriggerBCExoticEventBCUnMatch->SetYTitle("Event BC%4");
534 fOutputContainer->Add(fhClusterTriggerBCExoticEventBCUnMatch);
536 fhClusterTriggerBC = new TH1F("hClusterTriggerBC",
537 "Number of analyzed events triggered by a cluster in a given BC",
538 nbin , minbin ,maxbin) ;
539 fhClusterTriggerBC->SetYTitle("# events");
540 for(Int_t i = 1; i < 12; i++)
541 fhClusterTriggerBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
542 fOutputContainer->Add(fhClusterTriggerBC);
544 fhClusterTriggerBCExotic = new TH1F("hClusterTriggerBCExotic",
545 "Number of analyzed events triggered by a exotic cluster in a given BC",
546 nbin , minbin ,maxbin) ;
547 fhClusterTriggerBCExotic->SetYTitle("# events");
548 for(Int_t i = 1; i < 12; i++)
549 fhClusterTriggerBCExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
550 fOutputContainer->Add(fhClusterTriggerBCExotic);
553 fhClusterTriggerBCBadCell = new TH1F("hClusterTriggerBCBadCell",
554 "Number of analyzed events triggered by a bad cell in a given BC",
555 nbin , minbin ,maxbin) ;
557 fhClusterTriggerBCBadCell->SetYTitle("# events");
558 for(Int_t i = 1; i < 12; i++)
559 fhClusterTriggerBCBadCell->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
560 fOutputContainer->Add(fhClusterTriggerBCBadCell);
562 fhClusterTriggerBCBadCellExotic = new TH1F("hClusterTriggerBCBadCellExotic",
563 "Number of analyzed events triggered by a bad cell & exotic cluster in a given BC",
564 nbin , minbin ,maxbin) ;
565 fhClusterTriggerBCBadCellExotic->SetYTitle("# events");
566 for(Int_t i = 1; i < 12; i++)
567 fhClusterTriggerBCBadCellExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
568 fOutputContainer->Add(fhClusterTriggerBCBadCellExotic);
570 fhClusterTriggerBCBadCluster = new TH1F("hClusterTriggerBCBadCluster",
571 "Number of analyzed events triggered by a bad cluster in a given BC",
572 nbin , minbin ,maxbin) ;
574 fhClusterTriggerBCBadCluster->SetYTitle("# events");
575 for(Int_t i = 1; i < 12; i++)
576 fhClusterTriggerBCBadCluster->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
577 fOutputContainer->Add(fhClusterTriggerBCBadCluster);
580 fhClusterTriggerBCBadClusterExotic = new TH1F("hClusterTriggerBCBadClusterExotic",
581 "Number of analyzed events triggered by a bad cluster & exotic cluster in a given BC",
582 nbin , minbin ,maxbin) ;
584 fhClusterTriggerBCBadClusterExotic->SetYTitle("# events");
585 for(Int_t i = 1; i < 12; i++)
586 fhClusterTriggerBCBadClusterExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
587 fOutputContainer->Add(fhClusterTriggerBCBadClusterExotic);
589 fhClusterTriggerBCUnMatch = new TH1F("hClusterTriggerBCUnMatch",
590 "Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC",
591 nbin , minbin ,maxbin) ;
592 fhClusterTriggerBCUnMatch->SetYTitle("# events");
593 for(Int_t i = 1; i < 12; i++)
594 fhClusterTriggerBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
595 fOutputContainer->Add(fhClusterTriggerBCUnMatch);
597 fhClusterTriggerBCExoticUnMatch = new TH1F("hClusterTriggerBCExoticUnMatch",
598 "Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC",
599 nbin , minbin ,maxbin) ;
600 fhClusterTriggerBCExoticUnMatch->SetYTitle("# events");
601 for(Int_t i = 1; i < 12; i++)
602 fhClusterTriggerBCExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
603 fOutputContainer->Add(fhClusterTriggerBCExoticUnMatch);
606 fhClusterTriggerBCBadCellUnMatch = new TH1F("hClusterTriggerBCBadCellUnMatch",
607 "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
608 nbin , minbin ,maxbin) ;
609 fhClusterTriggerBCBadCellUnMatch->SetYTitle("# events");
610 for(Int_t i = 1; i < 12; i++)
611 fhClusterTriggerBCBadCellUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
612 fOutputContainer->Add(fhClusterTriggerBCBadCellUnMatch);
615 fhClusterTriggerBCBadCellExoticUnMatch = new TH1F("hClusterTriggerBCBadCellExoticUnMatch",
616 "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
617 nbin , minbin ,maxbin) ;
618 fhClusterTriggerBCBadCellExoticUnMatch->SetYTitle("# events");
619 for(Int_t i = 1; i < 12; i++)
620 fhClusterTriggerBCBadCellExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
621 fOutputContainer->Add(fhClusterTriggerBCBadCellExoticUnMatch);
624 fhClusterTriggerBCBadClusterUnMatch = new TH1F("hClusterTriggerBCBadClusterUnMatch",
625 "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
626 nbin , minbin ,maxbin) ;
627 fhClusterTriggerBCBadClusterUnMatch->SetYTitle("# events");
628 for(Int_t i = 1; i < 12; i++)
629 fhClusterTriggerBCBadClusterUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
630 fOutputContainer->Add(fhClusterTriggerBCBadClusterUnMatch);
633 fhClusterTriggerBCBadClusterExoticUnMatch = new TH1F("hClusterTriggerBCBadClusterExoticUnMatch",
634 "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
635 nbin , minbin ,maxbin) ;
636 fhClusterTriggerBCBadClusterExoticUnMatch->SetYTitle("# events");
637 for(Int_t i = 1; i < 12; i++)
638 fhClusterTriggerBCBadClusterExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
639 fOutputContainer->Add(fhClusterTriggerBCBadClusterExoticUnMatch);
641 TString rematch[] = {"OpenTime","CheckNeighbours","Both"};
642 for(Int_t j = 0; j < 3; j++)
644 fhClusterTriggerBCUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCUnMatch_ReMatch_%s",rematch[j].Data()),
645 Form("Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
646 nbin , minbin ,maxbin) ;
647 fhClusterTriggerBCUnMatchReMatch[j]->SetYTitle("# events");
648 for(Int_t i = 1; i < 12; i++)
649 fhClusterTriggerBCUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
650 fOutputContainer->Add(fhClusterTriggerBCUnMatchReMatch[j]);
652 fhClusterTriggerBCExoticUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCExoticUnMatch_ReMatch_%s",rematch[j].Data()),
653 Form("Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
654 nbin , minbin ,maxbin) ;
655 fhClusterTriggerBCExoticUnMatchReMatch[j]->SetYTitle("# events");
656 for(Int_t i = 1; i < 12; i++)
657 fhClusterTriggerBCExoticUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
658 fOutputContainer->Add(fhClusterTriggerBCExoticUnMatchReMatch[j]);
661 fhNPileUpEvents = new TH1F("hNPileUpEvents", "Number of events considered as pile-up", 8 , 0 , 8 ) ;
662 fhNPileUpEvents->SetYTitle("# events");
663 fhNPileUpEvents->GetXaxis()->SetBinLabel(1 ,"SPD");
664 fhNPileUpEvents->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
665 fhNPileUpEvents->GetXaxis()->SetBinLabel(3 ,"EMCal");
666 fhNPileUpEvents->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
667 fhNPileUpEvents->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
668 fhNPileUpEvents->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
669 fhNPileUpEvents->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
670 fhNPileUpEvents->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
671 fOutputContainer->Add(fhNPileUpEvents);
673 fhNPileUpEventsTriggerBC0 = new TH1F("hNPileUpEventsTriggerBC0","Number of events considered as pile-up, trigger cluster in BC=0", 8 , 0 , 8 ) ;
674 fhNPileUpEventsTriggerBC0->SetYTitle("# events");
675 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(1 ,"SPD");
676 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
677 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(3 ,"EMCal");
678 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
679 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
680 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
681 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
682 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
683 fOutputContainer->Add(fhNPileUpEventsTriggerBC0);
686 fhTrackBCEvent = new TH1F("hTrackBCEvent", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
687 fhTrackBCEvent->SetYTitle("# events");
688 fhTrackBCEvent->SetXTitle("Bunch crossing");
689 for(Int_t i = 1; i < 20; i++)
690 fhTrackBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
691 fOutputContainer->Add(fhTrackBCEvent);
693 fhTrackBCEventCut = new TH1F("hTrackBCEventCut", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
694 fhTrackBCEventCut->SetYTitle("# events");
695 fhTrackBCEventCut->SetXTitle("Bunch crossing");
696 for(Int_t i = 1; i < 20; i++)
697 fhTrackBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
698 fOutputContainer->Add(fhTrackBCEventCut);
700 fhPrimaryVertexBC = new TH1F("hPrimaryVertexBC", "Number of primary vertex per bunch crossing ", 41 , -20 , 20 ) ;
701 fhPrimaryVertexBC->SetYTitle("# events");
702 fhPrimaryVertexBC->SetXTitle("Bunch crossing");
703 fOutputContainer->Add(fhPrimaryVertexBC);
705 fhEMCalBCEvent = new TH1F("hEMCalBCEvent", "Number of events with at least 1 cluster in a bunch crossing ", 19 , 0 , 19 ) ;
706 fhEMCalBCEvent->SetYTitle("# events");
707 fhEMCalBCEvent->SetXTitle("Bunch crossing");
708 for(Int_t i = 1; i < 20; i++)
709 fhEMCalBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
710 fOutputContainer->Add(fhEMCalBCEvent);
712 fhEMCalBCEventCut = new TH1F("hEMCalBCEventCut", "Number of events with at least 1 cluster in a bunch crossing", 19 , 0 , 19 ) ;
713 fhEMCalBCEventCut->SetYTitle("# events");
714 fhEMCalBCEventCut->SetXTitle("Bunch crossing");
715 for(Int_t i = 1; i < 20; i++)
716 fhEMCalBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
717 fOutputContainer->Add(fhEMCalBCEventCut);
719 fhXVertexExotic = new TH1F("hXVertexExotic", " X vertex distribution in exotic events" , 200 , -4 , 4 ) ;
720 fhXVertexExotic->SetXTitle("v_{x} (cm)");
721 fOutputContainer->Add(fhXVertexExotic);
723 fhYVertexExotic = new TH1F("hYVertexExotic", " Y vertex distribution in exotic events" , 200 , -4 , 4 ) ;
724 fhYVertexExotic->SetXTitle("v_{y} (cm)");
725 fOutputContainer->Add(fhYVertexExotic);
727 fhZVertexExotic = new TH1F("hZVertexExotic", " Z vertex distribution in exotic events" , 200 , -50 , 50 ) ;
728 fhZVertexExotic->SetXTitle("v_{z} (cm)");
729 fOutputContainer->Add(fhZVertexExotic);
731 fhPileUpClusterMult = new TH1F("hPileUpClusterMult", "Number of clusters per event with large time (|t| > 20 ns)" , 100 , 0 , 100 ) ;
732 fhPileUpClusterMult->SetXTitle("# clusters");
733 fOutputContainer->Add(fhPileUpClusterMult);
735 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 ) ;
736 fhPileUpClusterMultAndSPDPileUp->SetXTitle("# clusters");
737 fOutputContainer->Add(fhPileUpClusterMultAndSPDPileUp);
739 fhNPileUpVertSPD = new TH1F ("hNPileUpVertSPD","N pile-up SPD vertex", 50,0,50);
740 fhNPileUpVertSPD->SetYTitle("# vertex ");
741 fOutputContainer->Add(fhNPileUpVertSPD);
743 fhNPileUpVertTracks = new TH1F ("hNPileUpVertTracks","N pile-up Tracks vertex", 50,0,50);
744 fhNPileUpVertTracks->SetYTitle("# vertex ");
745 fOutputContainer->Add(fhNPileUpVertTracks);
747 if(fReader->IsSelectEventTimeStampOn())
749 fhTimeStampFraction = new TH1F("hTimeStampFraction","Fraction of events within a given time stamp range",150, -1, 2) ;
750 fhTimeStampFraction->SetXTitle("fraction");
751 fOutputContainer->Add(fhTimeStampFraction) ;
757 fhNMergedFiles = new TH1F("hNMergedFiles", "Number of merged output files" , 1 , 0 , 1 ) ;
758 fhNMergedFiles->SetYTitle("# files");
759 fhNMergedFiles->Fill(1); // Fill here with one entry, while merging it will count the rest
760 fOutputContainer->Add(fhNMergedFiles);
762 fhScaleFactor = new TH1F("hScaleFactor", "Number of merged output files" , 1 , 0 , 1 ) ;
763 fhScaleFactor->SetYTitle("scale factor");
764 fhScaleFactor->SetBinContent(1,fScaleFactor); // Fill here
765 fOutputContainer->Add(fhScaleFactor);
768 if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
770 printf("AliAnaCaloTrackCorrMaker::GetOutputContainer() - Analysis job list not initialized!!!\n");
771 return fOutputContainer;
774 const Int_t buffersize = 255;
775 char newname[buffersize];
776 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
779 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
781 if(fMakeHisto) // Analysis with histograms as output on
784 //Fill container with appropriate histograms
785 TList * templist = ana ->GetCreateOutputObjects();
786 templist->SetOwner(kFALSE); //Owner is fOutputContainer.
788 for(Int_t i = 0; i < templist->GetEntries(); i++)
791 //Add only to the histogram name the name of the task
792 if( strcmp((templist->At(i))->ClassName(),"TObjString") )
794 snprintf(newname,buffersize, "%s%s", (ana->GetAddedHistogramsStringToName()).Data(), (templist->At(i))->GetName());
795 //printf("name %s, new name %s\n",(templist->At(i))->GetName(),newname);
796 ((TH1*) templist->At(i))->SetName(newname);
799 //Add histogram to general container
800 fOutputContainer->Add(templist->At(i)) ;
806 }// Analysis with histograms as output on
808 }//Loop on analysis defined
810 return fOutputContainer;
814 //___________________________________
815 void AliAnaCaloTrackCorrMaker::Init()
817 //Init container histograms and other common variables
818 // Fill the output list of histograms during the CreateOutputObjects stage.
822 GetReader()->SetCaloUtils(GetCaloUtils()); // pass the calo utils pointer to the reader
825 if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
827 printf("AliAnaCaloTrackCorrMaker::GetOutputInit() - Analysis job list not initialized!!!\n");
831 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
834 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
836 ana->SetReader(fReader); // Set Reader for each analysis
837 ana->SetCaloUtils(fCaloUtils); // Set CaloUtils for each analysis
841 }//Loop on analysis defined
845 //_____________________________________________
846 void AliAnaCaloTrackCorrMaker::InitParameters()
852 fAnaDebug = 0; // No debugging info displayed by default
856 //______________________________________________________________
857 void AliAnaCaloTrackCorrMaker::Print(const Option_t * opt) const
859 //Print some relevant parameters set for the analysis
864 printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
865 printf("Debug level = %d\n", fAnaDebug ) ;
866 printf("Produce Histo = %d\n", fMakeHisto ) ;
867 printf("Produce AOD = %d\n", fMakeAOD ) ;
868 printf("Number of analysis tasks = %d\n", fAnalysisContainer->GetEntries()) ;
870 if(!strcmp("all",opt))
872 printf("Print analysis Tasks settings :\n") ;
873 for(Int_t iana = 0; iana<fAnalysisContainer->GetEntries(); iana++)
875 ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana))->Print("");
878 printf("Print analysis Reader settings :\n") ;
880 printf("Print analysis Calorimeter Utils settings :\n") ;
881 fCaloUtils->Print("");
887 //_______________________________________________________________________
888 void AliAnaCaloTrackCorrMaker::ProcessEvent(const Int_t iEntry,
889 const char * currentFileName)
891 //Process analysis for this event
893 if(fMakeHisto && !fOutputContainer)
895 printf("AliAnaCaloTrackCorrMaker::ProcessEvent() - Histograms not initialized\n");
901 printf("*** AliAnaCaloTrackCorrMaker::ProcessEvent() Event %d *** \n",iEntry);
904 printf("AliAnaCaloTrackCorrMaker::ProcessEvent() - Current File Name : %s\n", currentFileName);
905 //printf("fAODBranchList %p, entries %d\n",fAODBranchList,fAODBranchList->GetEntries());
909 //Each event needs an empty branch
910 TList * aodList = fReader->GetAODBranchList();
911 Int_t nAODBranches = aodList->GetEntries();
912 for(Int_t iaod = 0; iaod < nAODBranches; iaod++)
914 TClonesArray *tca = dynamic_cast<TClonesArray*> (aodList->At(iaod));
915 if(tca) tca->Clear("C");
918 //Set geometry matrices before filling arrays, in case recalibration/position calculation etc is needed
919 fCaloUtils->AccessGeometry(fReader->GetInputEvent());
921 //Set the AODB calibration, bad channels etc. parameters at least once
922 fCaloUtils->AccessOADB(fReader->GetInputEvent());
924 //Tell the reader to fill the data in the 3 detector lists
925 Bool_t ok = fReader->FillInputEvent(iEntry, currentFileName);
927 FillTriggerControlHistograms();
931 if(fAnaDebug >= 1 )printf("*** Skip event *** %d \n",iEntry);
932 fReader->ResetLists();
936 //Magic line to write events to file
937 if(fReader->WriteDeltaAODToFile())AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
939 //printf(">>>>>>>>>> BEFORE >>>>>>>>>>>\n");
940 //gObjectTable->Print();
942 //Access pointers, and trigger mask check needed in mixing case
943 AliAnalysisManager *manager = AliAnalysisManager::GetAnalysisManager();
944 AliInputEventHandler *inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
946 UInt_t isMBTrigger = kFALSE;
947 UInt_t isTrigger = kFALSE;
950 isMBTrigger = inputHandler->IsEventSelected() & fReader->GetMixEventTriggerMask();
951 isTrigger = inputHandler->IsEventSelected() & fReader->GetEventTriggerMask();
954 //Loop on analysis algorithms
956 if(fAnaDebug > 0 ) printf("*** Begin analysis *** \n");
958 Int_t nana = fAnalysisContainer->GetEntries() ;
959 for(Int_t iana = 0; iana < nana; iana++)
961 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
963 ana->ConnectInputOutputAODBranches(); //Sets branches for each analysis
965 //Fill pool for mixed event for the analysis that need it
966 if(!fReader->IsEventTriggerAtSEOn() && isMBTrigger)
968 ana->FillEventMixPool();
969 continue; // pool filled do not try to fill AODs or histograms
972 //Make analysis, create aods in aod branch and in some cases fill histograms
973 if(fMakeAOD ) ana->MakeAnalysisFillAOD() ;
975 //Make further analysis with aod branch and fill histograms
976 if(fMakeHisto) ana->MakeAnalysisFillHistograms() ;
980 fReader->ResetLists();
982 // In case of mixing analysis, non triggered events are used,
983 // do not fill control histograms for a non requested triggered event
984 if(!fReader->IsEventTriggerAtSEOn() && !isTrigger)
986 if(fAnaDebug > 0 ) printf("AliAnaCaloTrackMaker::ProcessEvent() - *** End analysis, MB for mixing *** \n");
990 FillControlHistograms();
992 //printf(">>>>>>>>>> AFTER >>>>>>>>>>>\n");
993 //gObjectTable->Print();
995 if(fAnaDebug > 0 ) printf("AliAnaCaloTrackMaker::ProcessEvent() - *** End analysis *** \n");
999 //__________________________________________________________
1000 void AliAnaCaloTrackCorrMaker::Terminate(TList * outputList)
1002 //Execute Terminate of analysis
1003 //Do some final plots.
1007 Error("Terminate", "No output list");
1011 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
1014 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
1015 if(ana->MakePlotsOn())ana->Terminate(outputList);
1017 }//Loop on analysis defined