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>
32 #include <TGeoGlobalMagField.h>
34 //---- AliRoot system ----
35 #include "AliAnalysisManager.h"
36 #include "AliInputEventHandler.h"
37 #include "AliESDEvent.h"
38 #include "AliAODEvent.h"
39 #include "AliAnaCaloTrackCorrBaseClass.h"
40 #include "AliAnaCaloTrackCorrMaker.h"
42 ClassImp(AliAnaCaloTrackCorrMaker)
45 //__________________________________________________
46 AliAnaCaloTrackCorrMaker::AliAnaCaloTrackCorrMaker() :
48 fReader(0), fCaloUtils(0),
49 fOutputContainer(new TList ), fAnalysisContainer(new TList ),
50 fMakeHisto(kFALSE), fMakeAOD(kFALSE),
51 fAnaDebug(0), fCuts(new TList),
53 fFillDataControlHisto(kTRUE),
55 fhNEvents(0), fhNExoticEvents(0),
56 fhNEventsNoTriggerFound(0),
57 fhNPileUpEvents(0), fhNPileUpEventsTriggerBC0(0),
58 fhXVertex(0), fhYVertex(0), fhZVertex(0),
59 fhXVertexExotic(0), fhYVertexExotic(0), fhZVertexExotic(0),
60 fhPileUpClusterMult(0), fhPileUpClusterMultAndSPDPileUp(0),
62 fhCentrality(0), fhEventPlaneAngle(0),
63 fhNMergedFiles(0), fhScaleFactor(0),
64 fhEMCalBCEvent(0), fhEMCalBCEventCut(0),
65 fhTrackBCEvent(0), fhTrackBCEventCut(0),
66 fhPrimaryVertexBC(0), fhTimeStampFraction(0),
67 fhNPileUpVertSPD(0), fhNPileUpVertTracks(0),
69 fhClusterTriggerBC(0), fhClusterTriggerBCExotic(0),
70 fhClusterTriggerBCBadCell(0), fhClusterTriggerBCBadCellExotic(0),
71 fhClusterTriggerBCBadCluster(0), fhClusterTriggerBCBadClusterExotic(0),
72 fhClusterTriggerBCUnMatch(0), fhClusterTriggerBCExoticUnMatch(0),
73 fhClusterTriggerBCBadCellUnMatch(0), fhClusterTriggerBCBadCellExoticUnMatch(0),
74 fhClusterTriggerBCBadClusterUnMatch(0), fhClusterTriggerBCBadClusterExoticUnMatch(0),
75 fhClusterTriggerBCEventBC(0), fhClusterTriggerBCEventBCUnMatch(0),
76 fhClusterTriggerBCExoticEventBC(0), fhClusterTriggerBCExoticEventBCUnMatch(0)
79 if(fAnaDebug > 1 ) printf("*** Analysis Maker Constructor *** \n");
81 for(Int_t i = 0; i < 3; i++)
83 fhClusterTriggerBCUnMatchReMatch [0] = 0;
84 fhClusterTriggerBCExoticUnMatchReMatch[0] = 0;
87 //Initialize parameters, pointers and histograms
91 //________________________________________________________________________________________
92 AliAnaCaloTrackCorrMaker::AliAnaCaloTrackCorrMaker(const AliAnaCaloTrackCorrMaker & maker) :
94 fReader(), //(new AliCaloTrackReader(*maker.fReader)),
95 fCaloUtils(),//(new AliCalorimeterUtils(*maker.fCaloUtils)),
96 fOutputContainer(new TList()), fAnalysisContainer(new TList()),
97 fMakeHisto(maker.fMakeHisto), fMakeAOD(maker.fMakeAOD),
98 fAnaDebug(maker.fAnaDebug), fCuts(new TList()),
99 fScaleFactor(maker.fScaleFactor),
100 fFillDataControlHisto(maker.fFillDataControlHisto),
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 fhNMergedFiles(maker.fhNMergedFiles),
118 fhScaleFactor(maker.fhScaleFactor),
119 fhEMCalBCEvent(maker.fhEMCalBCEvent),
120 fhEMCalBCEventCut(maker.fhEMCalBCEventCut),
121 fhTrackBCEvent(maker.fhTrackBCEvent),
122 fhTrackBCEventCut(maker.fhTrackBCEventCut),
123 fhPrimaryVertexBC(maker.fhPrimaryVertexBC),
124 fhTimeStampFraction(maker.fhTimeStampFraction),
125 fhNPileUpVertSPD(maker.fhNPileUpVertSPD),
126 fhNPileUpVertTracks(maker.fhNPileUpVertTracks),
127 fhClusterTriggerBC(maker.fhClusterTriggerBC),
128 fhClusterTriggerBCExotic(maker.fhClusterTriggerBCExotic),
129 fhClusterTriggerBCBadCell(maker.fhClusterTriggerBCBadCell),
130 fhClusterTriggerBCBadCellExotic(maker.fhClusterTriggerBCBadCellExotic),
131 fhClusterTriggerBCBadCluster(maker.fhClusterTriggerBCBadCluster),
132 fhClusterTriggerBCBadClusterExotic(maker.fhClusterTriggerBCBadClusterExotic),
133 fhClusterTriggerBCUnMatch(maker.fhClusterTriggerBCUnMatch),
134 fhClusterTriggerBCExoticUnMatch(maker.fhClusterTriggerBCExoticUnMatch),
135 fhClusterTriggerBCBadCellUnMatch(maker.fhClusterTriggerBCBadCellUnMatch),
136 fhClusterTriggerBCBadCellExoticUnMatch(maker.fhClusterTriggerBCBadCellExoticUnMatch),
137 fhClusterTriggerBCBadClusterUnMatch(maker.fhClusterTriggerBCBadClusterUnMatch),
138 fhClusterTriggerBCBadClusterExoticUnMatch(maker.fhClusterTriggerBCBadClusterExoticUnMatch),
139 fhClusterTriggerBCEventBC(maker.fhClusterTriggerBCEventBC),
140 fhClusterTriggerBCEventBCUnMatch(maker.fhClusterTriggerBCEventBCUnMatch),
141 fhClusterTriggerBCExoticEventBC(maker.fhClusterTriggerBCExoticEventBC),
142 fhClusterTriggerBCExoticEventBCUnMatch(maker.fhClusterTriggerBCExoticEventBCUnMatch)
145 for(Int_t i = 0; i < 3; i++)
147 fhClusterTriggerBCUnMatchReMatch [i] = maker.fhClusterTriggerBCUnMatchReMatch [i];
148 fhClusterTriggerBCExoticUnMatchReMatch[i] = maker.fhClusterTriggerBCExoticUnMatchReMatch[i];
153 //___________________________________________________
154 AliAnaCaloTrackCorrMaker::~AliAnaCaloTrackCorrMaker()
156 // Remove all owned pointers.
158 // Do not delete it here, already done somewhere else, need to understand where.
159 // if (fOutputContainer) {
160 // fOutputContainer->Clear();
161 // delete fOutputContainer ;
164 if (fAnalysisContainer)
166 fAnalysisContainer->Delete();
167 delete fAnalysisContainer ;
170 if (fReader) delete fReader ;
171 if (fCaloUtils) delete fCaloUtils ;
181 //__________________________________________________________________
182 void AliAnaCaloTrackCorrMaker::AddAnalysis(TObject* ana, Int_t n)
184 // Add analysis depending on AliAnaCaloTrackCorrBaseClass to list
186 if ( fAnalysisContainer)
188 fAnalysisContainer->AddAt(ana,n);
192 printf("AliAnaCaloTrackCorrMaker::AddAnalysis() - AnalysisContainer not initialized\n");
197 //_________________________________________________________
198 TList * AliAnaCaloTrackCorrMaker::FillAndGetAODBranchList()
201 // Get any new output AOD branches from analysis and put them in a list
202 // The list is filled in the maker, and new branch passed to the analysis frame
203 // AliAnalysisTaskCaloTrackCorrelation
205 TList *aodBranchList = fReader->GetAODBranchList() ;
207 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
209 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
210 if(ana->NewOutputAOD()) aodBranchList->Add(ana->GetCreateOutputAODBranch());
213 return aodBranchList ;
217 //____________________________________________________
218 void AliAnaCaloTrackCorrMaker::FillControlHistograms()
220 // Event control histograms
222 AliVEvent* event = fReader->GetInputEvent();
223 AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (event);
224 AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (event);
226 fhNEvents ->Fill(0); // Number of events analyzed
229 event->GetPrimaryVertex()->GetXYZ(v) ;
230 fhXVertex->Fill(v[0]);
231 fhYVertex->Fill(v[1]);
232 fhZVertex->Fill(v[2]);
234 fhTrackMult ->Fill(fReader->GetTrackMultiplicity());
235 fhCentrality ->Fill(fReader->GetEventCentrality ());
236 fhEventPlaneAngle ->Fill(fReader->GetEventPlaneAngle ());
238 if(fFillDataControlHisto)
240 if( fReader->IsPileUpFromSPD())
241 fhNPileUpEvents->Fill(0.5);
242 //if( event->IsPileupFromSPDInMultBins())
243 // fhNPileUpEvents->Fill(1.5);
244 if( fReader->IsPileUpFromEMCal())
245 fhNPileUpEvents->Fill(2.5);
246 if( fReader->IsPileUpFromSPDOrEMCal() )
247 fhNPileUpEvents->Fill(3.5);
248 if( fReader->IsPileUpFromSPDAndEMCal() )
249 fhNPileUpEvents->Fill(4.5);
250 if( fReader->IsPileUpFromSPDAndNotEMCal() )
251 fhNPileUpEvents->Fill(5.5);
252 if( fReader->IsPileUpFromEMCalAndNotSPD() )
253 fhNPileUpEvents->Fill(6.5);
254 if( fReader->IsPileUpFromNotSPDAndNotEMCal() )
255 fhNPileUpEvents->Fill(7.5);
257 Int_t triggerBC = fReader->GetTriggerClusterBC() ;
258 if( triggerBC == 0 &&
259 !fReader->IsExoticEvent() &&
260 !fReader->IsBadCellTriggerEvent())
262 if( fReader->IsPileUpFromSPD())
263 fhNPileUpEventsTriggerBC0->Fill(0.5);
264 //if( event->IsPileupFromSPDInMultBins())
265 // fhNPileUpEventsTriggerBC0->Fill(1.5);
266 if( fReader->IsPileUpFromEMCal())
267 fhNPileUpEventsTriggerBC0->Fill(2.5);
268 if( fReader->IsPileUpFromSPDOrEMCal() )
269 fhNPileUpEventsTriggerBC0->Fill(3.5);
270 if( fReader->IsPileUpFromSPDAndEMCal() )
271 fhNPileUpEventsTriggerBC0->Fill(4.5);
272 if( fReader->IsPileUpFromSPDAndNotEMCal() )
273 fhNPileUpEventsTriggerBC0->Fill(5.5);
274 if( fReader->IsPileUpFromEMCalAndNotSPD() )
275 fhNPileUpEventsTriggerBC0->Fill(6.5);
276 if( fReader->IsPileUpFromNotSPDAndNotEMCal() )
277 fhNPileUpEventsTriggerBC0->Fill(7.5);
280 if(fReader->IsPileUpFromSPD())
281 fhPileUpClusterMultAndSPDPileUp ->Fill(fReader->GetNPileUpClusters());
283 fhPileUpClusterMult ->Fill(fReader->GetNPileUpClusters ());
285 for(Int_t i = 0; i < 19; i++)
287 if(fReader->GetTrackEventBC(i)) fhTrackBCEvent ->Fill(i);
288 if(fReader->GetTrackEventBCcut(i))fhTrackBCEventCut->Fill(i);
289 if(fReader->GetEMCalEventBC(i)) fhEMCalBCEvent ->Fill(i);
290 if(fReader->GetEMCalEventBCcut(i))fhEMCalBCEventCut->Fill(i);
293 Int_t bc = fReader->GetVertexBC();
294 if(bc!=AliVTrack::kTOFBCNA)fhPrimaryVertexBC->Fill(bc);
297 // N pile up vertices
298 Int_t nVerticesSPD = -1;
299 Int_t nVerticesTracks = -1;
303 nVerticesSPD = esdevent->GetNumberOfPileupVerticesSPD();
304 nVerticesTracks = esdevent->GetNumberOfPileupVerticesTracks();
309 nVerticesSPD = aodevent->GetNumberOfPileupVerticesSPD();
310 nVerticesTracks = aodevent->GetNumberOfPileupVerticesTracks();
313 fhNPileUpVertSPD ->Fill(nVerticesSPD);
314 fhNPileUpVertTracks->Fill(nVerticesTracks);
317 if(fReader->IsSelectEventTimeStampOn() && esdevent)
319 Int_t timeStamp = esdevent->GetTimeStamp();
320 Float_t timeStampFrac = 1.*(timeStamp-fReader->GetRunTimeStampMin()) /
321 (fReader->GetRunTimeStampMax()-fReader->GetRunTimeStampMin());
323 //printf("stamp %d, min %d, max %d, frac %f\n", timeStamp, fReader->GetRunTimeStampMin(), fReader->GetRunTimeStampMax(), timeStampFrac);
325 fhTimeStampFraction->Fill(timeStampFrac);
330 //___________________________________________________________
331 void AliAnaCaloTrackCorrMaker::FillTriggerControlHistograms()
333 if(!fFillDataControlHisto) return;
335 Int_t triggerBC = fReader->GetTriggerClusterBC() ;
336 Bool_t exotic = fReader->IsExoticEvent();
337 Bool_t badCluster = fReader->IsBadCellTriggerEvent();
338 Bool_t badCell = fReader->IsBadMaxCellTriggerEvent();
339 Bool_t triggerMatch= fReader->IsTriggerMatched();
340 Bool_t triggerBCOK = kTRUE;
341 Int_t triggerId = fReader->GetTriggerClusterId() ;
342 Bool_t reMatchOpenTime = fReader->IsTriggerMatchedOpenCuts(0);
343 Bool_t reMatchNeigbour = fReader->IsTriggerMatchedOpenCuts(1);
344 Bool_t reMatchBoth = fReader->IsTriggerMatchedOpenCuts(2);
348 //printf("Trigger id %d\n",triggerId);
349 if(triggerId == -2)fhNEventsNoTriggerFound->Fill(0);
350 triggerBCOK = kFALSE;
355 fhNExoticEvents->Fill(0) ;
357 fReader->GetInputEvent()->GetPrimaryVertex()->GetXYZ(v) ;
358 fhXVertexExotic->Fill(v[0]);
359 fhYVertexExotic->Fill(v[1]);
360 fhZVertexExotic->Fill(v[2]);
362 //if(fReader->IsExoticEvent()) printf("Maker: EXOTIC Cluster trigger\n");
364 if(!triggerBCOK) return;
366 Int_t eventBC = fReader->GetInputEvent()->GetBunchCrossNumber();
367 if(eventBC%4 < 0 || eventBC%4 > 3 )
368 printf("AliAnaCaloTrackCorrMaker::ProcessEvent() - STRANGE: Trigger BC %d - Event BC %d, modulo4 %d \n",triggerBC,eventBC,eventBC%4);
372 if (!exotic && !badCluster) fhClusterTriggerBC->Fill(triggerBC);
373 else if( exotic && badCluster)
375 fhClusterTriggerBCBadClusterExotic->Fill(triggerBC);
376 if(badCell) fhClusterTriggerBCBadCellExotic->Fill(triggerBC);
378 else if( exotic && !badCluster) fhClusterTriggerBCExotic->Fill(triggerBC);
379 else if( badCluster && !exotic )
381 fhClusterTriggerBCBadCluster ->Fill(triggerBC);
382 if(badCell) fhClusterTriggerBCBadCell->Fill(triggerBC);
385 if(!exotic) fhClusterTriggerBCEventBC ->Fill(triggerBC,eventBC%4);
386 else fhClusterTriggerBCExoticEventBC->Fill(triggerBC,eventBC%4);
390 if (!exotic && !badCluster)
392 fhClusterTriggerBCUnMatch->Fill(triggerBC);
393 if(reMatchOpenTime) fhClusterTriggerBCUnMatchReMatch[0]->Fill(triggerBC);
394 if(reMatchNeigbour) fhClusterTriggerBCUnMatchReMatch[1]->Fill(triggerBC);
395 if(reMatchBoth) fhClusterTriggerBCUnMatchReMatch[2]->Fill(triggerBC);
397 else if( exotic && badCluster)
399 fhClusterTriggerBCBadClusterExoticUnMatch->Fill(triggerBC);
400 if(badCell) fhClusterTriggerBCBadCellExoticUnMatch ->Fill(triggerBC);
402 else if( exotic && !badCluster)
404 fhClusterTriggerBCExoticUnMatch->Fill(triggerBC);
405 if(reMatchOpenTime) fhClusterTriggerBCExoticUnMatchReMatch[0]->Fill(triggerBC);
406 if(reMatchNeigbour) fhClusterTriggerBCExoticUnMatchReMatch[1]->Fill(triggerBC);
407 if(reMatchBoth) fhClusterTriggerBCExoticUnMatchReMatch[2]->Fill(triggerBC);
409 else if( badCluster && !exotic )
411 fhClusterTriggerBCBadClusterUnMatch->Fill(triggerBC);
412 if(badCell)fhClusterTriggerBCBadCellUnMatch->Fill(triggerBC);
415 if(!exotic) fhClusterTriggerBCEventBCUnMatch ->Fill(triggerBC,eventBC%4);
416 else fhClusterTriggerBCExoticEventBCUnMatch->Fill(triggerBC,eventBC%4);
422 //_______________________________________________________
423 TList * AliAnaCaloTrackCorrMaker::GetListOfAnalysisCuts()
426 // Get the list of the cuts used for the analysis
427 // The list is filled in the maker, called by the task in LocalInit() and posted there
429 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
431 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
432 TObjString * objstring = ana->GetAnalysisCuts();
434 if(objstring)fCuts->Add(objstring);
441 //___________________________________________________
442 TList *AliAnaCaloTrackCorrMaker::GetOutputContainer()
444 // Fill the output list of histograms during the CreateOutputObjects stage.
446 //Initialize calorimeters geometry pointers
447 //GetCaloUtils()->InitPHOSGeometry();
448 //GetCaloUtils()->InitEMCALGeometry();
450 //General event histograms
452 fhNEvents = new TH1F("hNEvents", "Number of analyzed events" , 1 , 0 , 1 ) ;
453 fhNEvents->SetYTitle("# events");
454 fOutputContainer->Add(fhNEvents);
456 fhXVertex = new TH1F("hXVertex", " X vertex distribution" , 200 , -4 , 4 ) ;
457 fhXVertex->SetXTitle("v_{x} (cm)");
458 fOutputContainer->Add(fhXVertex);
460 fhYVertex = new TH1F("hYVertex", " Y vertex distribution" , 200 , -4 , 4 ) ;
461 fhYVertex->SetXTitle("v_{y} (cm)");
462 fOutputContainer->Add(fhYVertex);
464 fhZVertex = new TH1F("hZVertex", " Z vertex distribution" , 200 , -50 , 50 ) ;
465 fhZVertex->SetXTitle("v_{z} (cm)");
466 fOutputContainer->Add(fhZVertex);
468 fhCentrality = new TH1F("hCentrality","Number of events in centrality bin",100,0.,100) ;
469 fhCentrality->SetXTitle("Centrality bin");
470 fOutputContainer->Add(fhCentrality) ;
472 fhEventPlaneAngle=new TH1F("hEventPlaneAngle","Number of events in event plane",100,0.,TMath::Pi()) ;
473 fhEventPlaneAngle->SetXTitle("EP angle (rad)");
474 fOutputContainer->Add(fhEventPlaneAngle) ;
476 fhTrackMult = new TH1F("hTrackMult", "Number of tracks per events" , 2000 , 0 , 2000 ) ;
477 fhTrackMult->SetXTitle("# tracks");
478 fOutputContainer->Add(fhTrackMult);
480 if(fFillDataControlHisto)
482 fhNExoticEvents = new TH1F("hNExoticEvents", "Number of analyzed events triggered by exotic cluster" , 1 , 0 , 1 ) ;
483 fhNExoticEvents->SetYTitle("# exotic events");
484 fOutputContainer->Add(fhNExoticEvents);
486 fhNEventsNoTriggerFound = new TH1F("hNEventsNoTriggerFound", "Number of analyzed events triggered but no trigger found" , 1 , 0 , 1 ) ;
487 fhNEventsNoTriggerFound->SetYTitle("# exotic events");
488 fOutputContainer->Add(fhNEventsNoTriggerFound);
492 Float_t minbin =-5.5;
493 Float_t maxbin = 5.5;
494 Int_t labelshift = 6;
496 fhClusterTriggerBCEventBC = new TH2F("hClusterTriggerBCEventBC", "Found trigger BC and Event BC",
497 nbin , minbin ,maxbin,4,0, 4) ;
498 fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
499 for(Int_t i = 0; i < 4; i++)
500 fhClusterTriggerBCEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
501 fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
502 for(Int_t i = 1; i < 12; i++)
503 fhClusterTriggerBCEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
504 fhClusterTriggerBCEventBC->SetYTitle("Event BC%4");
505 fOutputContainer->Add(fhClusterTriggerBCEventBC);
507 fhClusterTriggerBCExoticEventBC = new TH2F("hClusterTriggerBCExoticEventBC", "Found exotic trigger BC and Event BC",
508 nbin , minbin ,maxbin,4,1, 4) ;
509 for(Int_t i = 0; i < 4; i++)
510 fhClusterTriggerBCExoticEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
511 fhClusterTriggerBCExoticEventBC->SetXTitle("cluster trigger BC");
512 for(Int_t i = 1; i < 12; i++)
513 fhClusterTriggerBCExoticEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
514 fhClusterTriggerBCExoticEventBC->SetYTitle("Event BC%4");
515 fOutputContainer->Add(fhClusterTriggerBCExoticEventBC);
517 fhClusterTriggerBCEventBCUnMatch = new TH2F("hClusterTriggerBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
518 nbin , minbin ,maxbin,4,1, 4) ;
519 for(Int_t i = 0; i < 4; i++)
520 fhClusterTriggerBCEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
521 fhClusterTriggerBCEventBCUnMatch->SetXTitle("cluster trigger BC");
522 for(Int_t i = 1; i < 12; i++)
523 fhClusterTriggerBCEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
524 fhClusterTriggerBCEventBCUnMatch->SetYTitle("Event BC%4");
525 fOutputContainer->Add(fhClusterTriggerBCEventBCUnMatch);
527 fhClusterTriggerBCExoticEventBCUnMatch = new TH2F("hClusterTriggerExoticBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
528 nbin , minbin ,maxbin,4,1, 4) ;
529 for(Int_t i = 0; i < 4; i++)
530 fhClusterTriggerBCExoticEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
531 fhClusterTriggerBCExoticEventBCUnMatch->SetXTitle("cluster trigger BC");
532 for(Int_t i = 1; i < 12; i++)
533 fhClusterTriggerBCExoticEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
534 fhClusterTriggerBCExoticEventBCUnMatch->SetYTitle("Event BC%4");
535 fOutputContainer->Add(fhClusterTriggerBCExoticEventBCUnMatch);
537 fhClusterTriggerBC = new TH1F("hClusterTriggerBC",
538 "Number of analyzed events triggered by a cluster in a given BC",
539 nbin , minbin ,maxbin) ;
540 fhClusterTriggerBC->SetYTitle("# events");
541 for(Int_t i = 1; i < 12; i++)
542 fhClusterTriggerBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
543 fOutputContainer->Add(fhClusterTriggerBC);
545 fhClusterTriggerBCExotic = new TH1F("hClusterTriggerBCExotic",
546 "Number of analyzed events triggered by a exotic cluster in a given BC",
547 nbin , minbin ,maxbin) ;
548 fhClusterTriggerBCExotic->SetYTitle("# events");
549 for(Int_t i = 1; i < 12; i++)
550 fhClusterTriggerBCExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
551 fOutputContainer->Add(fhClusterTriggerBCExotic);
554 fhClusterTriggerBCBadCell = new TH1F("hClusterTriggerBCBadCell",
555 "Number of analyzed events triggered by a bad cell in a given BC",
556 nbin , minbin ,maxbin) ;
558 fhClusterTriggerBCBadCell->SetYTitle("# events");
559 for(Int_t i = 1; i < 12; i++)
560 fhClusterTriggerBCBadCell->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
561 fOutputContainer->Add(fhClusterTriggerBCBadCell);
563 fhClusterTriggerBCBadCellExotic = new TH1F("hClusterTriggerBCBadCellExotic",
564 "Number of analyzed events triggered by a bad cell & exotic cluster in a given BC",
565 nbin , minbin ,maxbin) ;
566 fhClusterTriggerBCBadCellExotic->SetYTitle("# events");
567 for(Int_t i = 1; i < 12; i++)
568 fhClusterTriggerBCBadCellExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
569 fOutputContainer->Add(fhClusterTriggerBCBadCellExotic);
571 fhClusterTriggerBCBadCluster = new TH1F("hClusterTriggerBCBadCluster",
572 "Number of analyzed events triggered by a bad cluster in a given BC",
573 nbin , minbin ,maxbin) ;
575 fhClusterTriggerBCBadCluster->SetYTitle("# events");
576 for(Int_t i = 1; i < 12; i++)
577 fhClusterTriggerBCBadCluster->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
578 fOutputContainer->Add(fhClusterTriggerBCBadCluster);
581 fhClusterTriggerBCBadClusterExotic = new TH1F("hClusterTriggerBCBadClusterExotic",
582 "Number of analyzed events triggered by a bad cluster & exotic cluster in a given BC",
583 nbin , minbin ,maxbin) ;
585 fhClusterTriggerBCBadClusterExotic->SetYTitle("# events");
586 for(Int_t i = 1; i < 12; i++)
587 fhClusterTriggerBCBadClusterExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
588 fOutputContainer->Add(fhClusterTriggerBCBadClusterExotic);
590 fhClusterTriggerBCUnMatch = new TH1F("hClusterTriggerBCUnMatch",
591 "Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC",
592 nbin , minbin ,maxbin) ;
593 fhClusterTriggerBCUnMatch->SetYTitle("# events");
594 for(Int_t i = 1; i < 12; i++)
595 fhClusterTriggerBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
596 fOutputContainer->Add(fhClusterTriggerBCUnMatch);
598 fhClusterTriggerBCExoticUnMatch = new TH1F("hClusterTriggerBCExoticUnMatch",
599 "Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC",
600 nbin , minbin ,maxbin) ;
601 fhClusterTriggerBCExoticUnMatch->SetYTitle("# events");
602 for(Int_t i = 1; i < 12; i++)
603 fhClusterTriggerBCExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
604 fOutputContainer->Add(fhClusterTriggerBCExoticUnMatch);
607 fhClusterTriggerBCBadCellUnMatch = new TH1F("hClusterTriggerBCBadCellUnMatch",
608 "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
609 nbin , minbin ,maxbin) ;
610 fhClusterTriggerBCBadCellUnMatch->SetYTitle("# events");
611 for(Int_t i = 1; i < 12; i++)
612 fhClusterTriggerBCBadCellUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
613 fOutputContainer->Add(fhClusterTriggerBCBadCellUnMatch);
616 fhClusterTriggerBCBadCellExoticUnMatch = new TH1F("hClusterTriggerBCBadCellExoticUnMatch",
617 "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
618 nbin , minbin ,maxbin) ;
619 fhClusterTriggerBCBadCellExoticUnMatch->SetYTitle("# events");
620 for(Int_t i = 1; i < 12; i++)
621 fhClusterTriggerBCBadCellExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
622 fOutputContainer->Add(fhClusterTriggerBCBadCellExoticUnMatch);
625 fhClusterTriggerBCBadClusterUnMatch = new TH1F("hClusterTriggerBCBadClusterUnMatch",
626 "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
627 nbin , minbin ,maxbin) ;
628 fhClusterTriggerBCBadClusterUnMatch->SetYTitle("# events");
629 for(Int_t i = 1; i < 12; i++)
630 fhClusterTriggerBCBadClusterUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
631 fOutputContainer->Add(fhClusterTriggerBCBadClusterUnMatch);
634 fhClusterTriggerBCBadClusterExoticUnMatch = new TH1F("hClusterTriggerBCBadClusterExoticUnMatch",
635 "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
636 nbin , minbin ,maxbin) ;
637 fhClusterTriggerBCBadClusterExoticUnMatch->SetYTitle("# events");
638 for(Int_t i = 1; i < 12; i++)
639 fhClusterTriggerBCBadClusterExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
640 fOutputContainer->Add(fhClusterTriggerBCBadClusterExoticUnMatch);
642 TString rematch[] = {"OpenTime","CheckNeighbours","Both"};
643 for(Int_t j = 0; j < 3; j++)
645 fhClusterTriggerBCUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCUnMatch_ReMatch_%s",rematch[j].Data()),
646 Form("Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
647 nbin , minbin ,maxbin) ;
648 fhClusterTriggerBCUnMatchReMatch[j]->SetYTitle("# events");
649 for(Int_t i = 1; i < 12; i++)
650 fhClusterTriggerBCUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
651 fOutputContainer->Add(fhClusterTriggerBCUnMatchReMatch[j]);
653 fhClusterTriggerBCExoticUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCExoticUnMatch_ReMatch_%s",rematch[j].Data()),
654 Form("Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
655 nbin , minbin ,maxbin) ;
656 fhClusterTriggerBCExoticUnMatchReMatch[j]->SetYTitle("# events");
657 for(Int_t i = 1; i < 12; i++)
658 fhClusterTriggerBCExoticUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
659 fOutputContainer->Add(fhClusterTriggerBCExoticUnMatchReMatch[j]);
662 fhNPileUpEvents = new TH1F("hNPileUpEvents", "Number of events considered as pile-up", 8 , 0 , 8 ) ;
663 fhNPileUpEvents->SetYTitle("# events");
664 fhNPileUpEvents->GetXaxis()->SetBinLabel(1 ,"SPD");
665 fhNPileUpEvents->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
666 fhNPileUpEvents->GetXaxis()->SetBinLabel(3 ,"EMCal");
667 fhNPileUpEvents->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
668 fhNPileUpEvents->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
669 fhNPileUpEvents->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
670 fhNPileUpEvents->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
671 fhNPileUpEvents->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
672 fOutputContainer->Add(fhNPileUpEvents);
674 fhNPileUpEventsTriggerBC0 = new TH1F("hNPileUpEventsTriggerBC0","Number of events considered as pile-up, trigger cluster in BC=0", 8 , 0 , 8 ) ;
675 fhNPileUpEventsTriggerBC0->SetYTitle("# events");
676 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(1 ,"SPD");
677 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
678 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(3 ,"EMCal");
679 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
680 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
681 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
682 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
683 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
684 fOutputContainer->Add(fhNPileUpEventsTriggerBC0);
687 fhTrackBCEvent = new TH1F("hTrackBCEvent", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
688 fhTrackBCEvent->SetYTitle("# events");
689 fhTrackBCEvent->SetXTitle("Bunch crossing");
690 for(Int_t i = 1; i < 20; i++)
691 fhTrackBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
692 fOutputContainer->Add(fhTrackBCEvent);
694 fhTrackBCEventCut = new TH1F("hTrackBCEventCut", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
695 fhTrackBCEventCut->SetYTitle("# events");
696 fhTrackBCEventCut->SetXTitle("Bunch crossing");
697 for(Int_t i = 1; i < 20; i++)
698 fhTrackBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
699 fOutputContainer->Add(fhTrackBCEventCut);
701 fhPrimaryVertexBC = new TH1F("hPrimaryVertexBC", "Number of primary vertex per bunch crossing ", 41 , -20 , 20 ) ;
702 fhPrimaryVertexBC->SetYTitle("# events");
703 fhPrimaryVertexBC->SetXTitle("Bunch crossing");
704 fOutputContainer->Add(fhPrimaryVertexBC);
706 fhEMCalBCEvent = new TH1F("hEMCalBCEvent", "Number of events with at least 1 cluster in a bunch crossing ", 19 , 0 , 19 ) ;
707 fhEMCalBCEvent->SetYTitle("# events");
708 fhEMCalBCEvent->SetXTitle("Bunch crossing");
709 for(Int_t i = 1; i < 20; i++)
710 fhEMCalBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
711 fOutputContainer->Add(fhEMCalBCEvent);
713 fhEMCalBCEventCut = new TH1F("hEMCalBCEventCut", "Number of events with at least 1 cluster in a bunch crossing", 19 , 0 , 19 ) ;
714 fhEMCalBCEventCut->SetYTitle("# events");
715 fhEMCalBCEventCut->SetXTitle("Bunch crossing");
716 for(Int_t i = 1; i < 20; i++)
717 fhEMCalBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
718 fOutputContainer->Add(fhEMCalBCEventCut);
720 fhXVertexExotic = new TH1F("hXVertexExotic", " X vertex distribution in exotic events" , 200 , -4 , 4 ) ;
721 fhXVertexExotic->SetXTitle("v_{x} (cm)");
722 fOutputContainer->Add(fhXVertexExotic);
724 fhYVertexExotic = new TH1F("hYVertexExotic", " Y vertex distribution in exotic events" , 200 , -4 , 4 ) ;
725 fhYVertexExotic->SetXTitle("v_{y} (cm)");
726 fOutputContainer->Add(fhYVertexExotic);
728 fhZVertexExotic = new TH1F("hZVertexExotic", " Z vertex distribution in exotic events" , 200 , -50 , 50 ) ;
729 fhZVertexExotic->SetXTitle("v_{z} (cm)");
730 fOutputContainer->Add(fhZVertexExotic);
732 fhPileUpClusterMult = new TH1F("hPileUpClusterMult", "Number of clusters per event with large time (|t| > 20 ns)" , 100 , 0 , 100 ) ;
733 fhPileUpClusterMult->SetXTitle("# clusters");
734 fOutputContainer->Add(fhPileUpClusterMult);
736 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 ) ;
737 fhPileUpClusterMultAndSPDPileUp->SetXTitle("# clusters");
738 fOutputContainer->Add(fhPileUpClusterMultAndSPDPileUp);
740 fhNPileUpVertSPD = new TH1F ("hNPileUpVertSPD","N pile-up SPD vertex", 50,0,50);
741 fhNPileUpVertSPD->SetYTitle("# vertex ");
742 fOutputContainer->Add(fhNPileUpVertSPD);
744 fhNPileUpVertTracks = new TH1F ("hNPileUpVertTracks","N pile-up Tracks vertex", 50,0,50);
745 fhNPileUpVertTracks->SetYTitle("# vertex ");
746 fOutputContainer->Add(fhNPileUpVertTracks);
748 if(fReader->IsSelectEventTimeStampOn())
750 fhTimeStampFraction = new TH1F("hTimeStampFraction","Fraction of events within a given time stamp range",150, -1, 2) ;
751 fhTimeStampFraction->SetXTitle("fraction");
752 fOutputContainer->Add(fhTimeStampFraction) ;
758 fhNMergedFiles = new TH1F("hNMergedFiles", "Number of merged output files" , 1 , 0 , 1 ) ;
759 fhNMergedFiles->SetYTitle("# files");
760 fhNMergedFiles->Fill(1); // Fill here with one entry, while merging it will count the rest
761 fOutputContainer->Add(fhNMergedFiles);
763 fhScaleFactor = new TH1F("hScaleFactor", "Number of merged output files" , 1 , 0 , 1 ) ;
764 fhScaleFactor->SetYTitle("scale factor");
765 fhScaleFactor->SetBinContent(1,fScaleFactor); // Fill here
766 fOutputContainer->Add(fhScaleFactor);
769 if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
771 printf("AliAnaCaloTrackCorrMaker::GetOutputContainer() - Analysis job list not initialized!!!\n");
772 return fOutputContainer;
775 const Int_t buffersize = 255;
776 char newname[buffersize];
777 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
780 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
782 if(fMakeHisto) // Analysis with histograms as output on
785 //Fill container with appropriate histograms
786 TList * templist = ana ->GetCreateOutputObjects();
787 templist->SetOwner(kFALSE); //Owner is fOutputContainer.
789 for(Int_t i = 0; i < templist->GetEntries(); i++)
792 //Add only to the histogram name the name of the task
793 if( strcmp((templist->At(i))->ClassName(),"TObjString") )
795 snprintf(newname,buffersize, "%s%s", (ana->GetAddedHistogramsStringToName()).Data(), (templist->At(i))->GetName());
796 //printf("name %s, new name %s\n",(templist->At(i))->GetName(),newname);
797 ((TH1*) templist->At(i))->SetName(newname);
800 //Add histogram to general container
801 fOutputContainer->Add(templist->At(i)) ;
807 }// Analysis with histograms as output on
809 }//Loop on analysis defined
811 return fOutputContainer;
815 //___________________________________
816 void AliAnaCaloTrackCorrMaker::Init()
818 //Init container histograms and other common variables
819 // Fill the output list of histograms during the CreateOutputObjects stage.
823 GetReader()->SetCaloUtils(GetCaloUtils()); // pass the calo utils pointer to the reader
826 if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
828 printf("AliAnaCaloTrackCorrMaker::GetOutputInit() - Analysis job list not initialized!!!\n");
832 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
835 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
837 ana->SetReader(fReader); // Set Reader for each analysis
838 ana->SetCaloUtils(fCaloUtils); // Set CaloUtils for each analysis
842 }//Loop on analysis defined
846 //_____________________________________________
847 void AliAnaCaloTrackCorrMaker::InitParameters()
853 fAnaDebug = 0; // No debugging info displayed by default
857 //______________________________________________________________
858 void AliAnaCaloTrackCorrMaker::Print(const Option_t * opt) const
860 //Print some relevant parameters set for the analysis
865 printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
866 printf("Debug level = %d\n", fAnaDebug ) ;
867 printf("Produce Histo = %d\n", fMakeHisto ) ;
868 printf("Produce AOD = %d\n", fMakeAOD ) ;
869 printf("Number of analysis tasks = %d\n", fAnalysisContainer->GetEntries()) ;
871 if(!strcmp("all",opt))
873 printf("Print analysis Tasks settings :\n") ;
874 for(Int_t iana = 0; iana<fAnalysisContainer->GetEntries(); iana++)
876 ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana))->Print("");
879 printf("Print analysis Reader settings :\n") ;
881 printf("Print analysis Calorimeter Utils settings :\n") ;
882 fCaloUtils->Print("");
888 //_____________________________________________________________________________________
889 void AliAnaCaloTrackCorrMaker::ProcessEvent(Int_t iEntry, 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 // Init mag field for tracks in case of ESDs, not really necessary
955 if (!TGeoGlobalMagField::Instance()->GetField() && ((AliESDEvent*) fReader->GetInputEvent()))
956 ((AliESDEvent*)fReader->GetInputEvent())->InitMagneticField();
958 //Loop on analysis algorithms
960 if(fAnaDebug > 0 ) printf("*** Begin analysis *** \n");
962 Int_t nana = fAnalysisContainer->GetEntries() ;
963 for(Int_t iana = 0; iana < nana; iana++)
965 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
967 ana->ConnectInputOutputAODBranches(); //Sets branches for each analysis
969 //Fill pool for mixed event for the analysis that need it
970 if(!fReader->IsEventTriggerAtSEOn() && isMBTrigger)
972 ana->FillEventMixPool();
973 continue; // pool filled do not try to fill AODs or histograms
976 //Make analysis, create aods in aod branch and in some cases fill histograms
977 if(fMakeAOD ) ana->MakeAnalysisFillAOD() ;
979 //Make further analysis with aod branch and fill histograms
980 if(fMakeHisto) ana->MakeAnalysisFillHistograms() ;
984 fReader->ResetLists();
986 // In case of mixing analysis, non triggered events are used,
987 // do not fill control histograms for a non requested triggered event
988 if(!fReader->IsEventTriggerAtSEOn() && !isTrigger)
990 if(fAnaDebug > 0 ) printf("AliAnaCaloTrackMaker::ProcessEvent() - *** End analysis, MB for mixing *** \n");
994 FillControlHistograms();
996 //printf(">>>>>>>>>> AFTER >>>>>>>>>>>\n");
997 //gObjectTable->Print();
999 if(fAnaDebug > 0 ) printf("AliAnaCaloTrackMaker::ProcessEvent() - *** End analysis *** \n");
1003 //__________________________________________________________
1004 void AliAnaCaloTrackCorrMaker::Terminate(TList * outputList)
1006 //Execute Terminate of analysis
1007 //Do some final plots.
1011 Error("Terminate", "No output list");
1015 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
1018 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
1019 if(ana->MakePlotsOn())ana->Terminate(outputList);
1021 }//Loop on analysis defined