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 fhNEventsIn(0), fhNEvents(0),
56 fhNExoticEvents(0), 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 fhNEventsIn(maker.fhNEventsIn),
102 fhNEvents(maker.fhNEvents),
103 fhNExoticEvents(maker.fhNExoticEvents),
104 fhNEventsNoTriggerFound(maker.fhNEventsNoTriggerFound),
105 fhNPileUpEvents(maker.fhNPileUpEvents),
106 fhNPileUpEventsTriggerBC0(maker.fhNPileUpEventsTriggerBC0),
107 fhXVertex(maker.fhXVertex),
108 fhYVertex(maker.fhYVertex),
109 fhZVertex(maker.fhZVertex),
110 fhXVertexExotic(maker.fhXVertexExotic),
111 fhYVertexExotic(maker.fhYVertexExotic),
112 fhZVertexExotic(maker.fhZVertexExotic),
113 fhPileUpClusterMult(maker.fhPileUpClusterMult),
114 fhPileUpClusterMultAndSPDPileUp(maker.fhPileUpClusterMultAndSPDPileUp),
115 fhTrackMult(maker.fhTrackMult),
116 fhCentrality(maker.fhCentrality),
117 fhEventPlaneAngle(maker.fhEventPlaneAngle),
118 fhNMergedFiles(maker.fhNMergedFiles),
119 fhScaleFactor(maker.fhScaleFactor),
120 fhEMCalBCEvent(maker.fhEMCalBCEvent),
121 fhEMCalBCEventCut(maker.fhEMCalBCEventCut),
122 fhTrackBCEvent(maker.fhTrackBCEvent),
123 fhTrackBCEventCut(maker.fhTrackBCEventCut),
124 fhPrimaryVertexBC(maker.fhPrimaryVertexBC),
125 fhTimeStampFraction(maker.fhTimeStampFraction),
126 fhNPileUpVertSPD(maker.fhNPileUpVertSPD),
127 fhNPileUpVertTracks(maker.fhNPileUpVertTracks),
128 fhClusterTriggerBC(maker.fhClusterTriggerBC),
129 fhClusterTriggerBCExotic(maker.fhClusterTriggerBCExotic),
130 fhClusterTriggerBCBadCell(maker.fhClusterTriggerBCBadCell),
131 fhClusterTriggerBCBadCellExotic(maker.fhClusterTriggerBCBadCellExotic),
132 fhClusterTriggerBCBadCluster(maker.fhClusterTriggerBCBadCluster),
133 fhClusterTriggerBCBadClusterExotic(maker.fhClusterTriggerBCBadClusterExotic),
134 fhClusterTriggerBCUnMatch(maker.fhClusterTriggerBCUnMatch),
135 fhClusterTriggerBCExoticUnMatch(maker.fhClusterTriggerBCExoticUnMatch),
136 fhClusterTriggerBCBadCellUnMatch(maker.fhClusterTriggerBCBadCellUnMatch),
137 fhClusterTriggerBCBadCellExoticUnMatch(maker.fhClusterTriggerBCBadCellExoticUnMatch),
138 fhClusterTriggerBCBadClusterUnMatch(maker.fhClusterTriggerBCBadClusterUnMatch),
139 fhClusterTriggerBCBadClusterExoticUnMatch(maker.fhClusterTriggerBCBadClusterExoticUnMatch),
140 fhClusterTriggerBCEventBC(maker.fhClusterTriggerBCEventBC),
141 fhClusterTriggerBCEventBCUnMatch(maker.fhClusterTriggerBCEventBCUnMatch),
142 fhClusterTriggerBCExoticEventBC(maker.fhClusterTriggerBCExoticEventBC),
143 fhClusterTriggerBCExoticEventBCUnMatch(maker.fhClusterTriggerBCExoticEventBCUnMatch)
146 for(Int_t i = 0; i < 3; i++)
148 fhClusterTriggerBCUnMatchReMatch [i] = maker.fhClusterTriggerBCUnMatchReMatch [i];
149 fhClusterTriggerBCExoticUnMatchReMatch[i] = maker.fhClusterTriggerBCExoticUnMatchReMatch[i];
154 //___________________________________________________
155 AliAnaCaloTrackCorrMaker::~AliAnaCaloTrackCorrMaker()
157 // Remove all owned pointers.
159 // Do not delete it here, already done somewhere else, need to understand where.
160 // if (fOutputContainer) {
161 // fOutputContainer->Clear();
162 // delete fOutputContainer ;
165 if (fAnalysisContainer)
167 fAnalysisContainer->Delete();
168 delete fAnalysisContainer ;
171 if (fReader) delete fReader ;
172 if (fCaloUtils) delete fCaloUtils ;
182 //__________________________________________________________________
183 void AliAnaCaloTrackCorrMaker::AddAnalysis(TObject* ana, Int_t n)
185 // Add analysis depending on AliAnaCaloTrackCorrBaseClass to list
187 if ( fAnalysisContainer)
189 fAnalysisContainer->AddAt(ana,n);
193 printf("AliAnaCaloTrackCorrMaker::AddAnalysis() - AnalysisContainer not initialized\n");
198 //_________________________________________________________
199 TList * AliAnaCaloTrackCorrMaker::FillAndGetAODBranchList()
202 // Get any new output AOD branches from analysis and put them in a list
203 // The list is filled in the maker, and new branch passed to the analysis frame
204 // AliAnalysisTaskCaloTrackCorrelation
206 TList *aodBranchList = fReader->GetAODBranchList() ;
208 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
210 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
211 if(ana->NewOutputAOD()) aodBranchList->Add(ana->GetCreateOutputAODBranch());
214 return aodBranchList ;
218 //____________________________________________________
219 void AliAnaCaloTrackCorrMaker::FillControlHistograms()
221 // Event control histograms
223 AliVEvent* event = fReader->GetInputEvent();
224 AliESDEvent* esdevent = dynamic_cast<AliESDEvent*> (event);
225 AliAODEvent* aodevent = dynamic_cast<AliAODEvent*> (event);
227 fhNEvents ->Fill(0); // Number of events analyzed
230 event->GetPrimaryVertex()->GetXYZ(v) ;
231 fhXVertex->Fill(v[0]);
232 fhYVertex->Fill(v[1]);
233 fhZVertex->Fill(v[2]);
235 fhTrackMult ->Fill(fReader->GetTrackMultiplicity());
236 fhCentrality ->Fill(fReader->GetEventCentrality ());
237 fhEventPlaneAngle ->Fill(fReader->GetEventPlaneAngle ());
239 if(fFillDataControlHisto)
241 if( fReader->IsPileUpFromSPD())
242 fhNPileUpEvents->Fill(0.5);
243 //if( event->IsPileupFromSPDInMultBins())
244 // fhNPileUpEvents->Fill(1.5);
245 if( fReader->IsPileUpFromEMCal())
246 fhNPileUpEvents->Fill(2.5);
247 if( fReader->IsPileUpFromSPDOrEMCal() )
248 fhNPileUpEvents->Fill(3.5);
249 if( fReader->IsPileUpFromSPDAndEMCal() )
250 fhNPileUpEvents->Fill(4.5);
251 if( fReader->IsPileUpFromSPDAndNotEMCal() )
252 fhNPileUpEvents->Fill(5.5);
253 if( fReader->IsPileUpFromEMCalAndNotSPD() )
254 fhNPileUpEvents->Fill(6.5);
255 if( fReader->IsPileUpFromNotSPDAndNotEMCal() )
256 fhNPileUpEvents->Fill(7.5);
258 Int_t triggerBC = fReader->GetTriggerClusterBC() ;
259 if( triggerBC == 0 &&
260 !fReader->IsExoticEvent() &&
261 !fReader->IsBadCellTriggerEvent())
263 if( fReader->IsPileUpFromSPD())
264 fhNPileUpEventsTriggerBC0->Fill(0.5);
265 //if( event->IsPileupFromSPDInMultBins())
266 // fhNPileUpEventsTriggerBC0->Fill(1.5);
267 if( fReader->IsPileUpFromEMCal())
268 fhNPileUpEventsTriggerBC0->Fill(2.5);
269 if( fReader->IsPileUpFromSPDOrEMCal() )
270 fhNPileUpEventsTriggerBC0->Fill(3.5);
271 if( fReader->IsPileUpFromSPDAndEMCal() )
272 fhNPileUpEventsTriggerBC0->Fill(4.5);
273 if( fReader->IsPileUpFromSPDAndNotEMCal() )
274 fhNPileUpEventsTriggerBC0->Fill(5.5);
275 if( fReader->IsPileUpFromEMCalAndNotSPD() )
276 fhNPileUpEventsTriggerBC0->Fill(6.5);
277 if( fReader->IsPileUpFromNotSPDAndNotEMCal() )
278 fhNPileUpEventsTriggerBC0->Fill(7.5);
281 if(fReader->IsPileUpFromSPD())
282 fhPileUpClusterMultAndSPDPileUp ->Fill(fReader->GetNPileUpClusters());
284 fhPileUpClusterMult ->Fill(fReader->GetNPileUpClusters ());
286 for(Int_t i = 0; i < 19; i++)
288 if(fReader->IsAccessToTrackTimeOn())
290 if(fReader->GetTrackEventBC(i)) fhTrackBCEvent ->Fill(i);
291 if(fReader->GetTrackEventBCcut(i))fhTrackBCEventCut->Fill(i);
293 if(fReader->GetEMCalEventBC(i)) fhEMCalBCEvent ->Fill(i);
294 if(fReader->GetEMCalEventBCcut(i))fhEMCalBCEventCut->Fill(i);
297 Int_t bc = fReader->GetVertexBC();
298 if(bc!=AliVTrack::kTOFBCNA) fhPrimaryVertexBC->Fill(bc);
300 // N pile up vertices
301 Int_t nVerticesSPD = -1;
302 Int_t nVerticesTracks = -1;
306 nVerticesSPD = esdevent->GetNumberOfPileupVerticesSPD();
307 nVerticesTracks = esdevent->GetNumberOfPileupVerticesTracks();
312 nVerticesSPD = aodevent->GetNumberOfPileupVerticesSPD();
313 nVerticesTracks = aodevent->GetNumberOfPileupVerticesTracks();
316 fhNPileUpVertSPD ->Fill(nVerticesSPD);
317 fhNPileUpVertTracks->Fill(nVerticesTracks);
320 if(fReader->IsSelectEventTimeStampOn() && esdevent)
322 Int_t timeStamp = esdevent->GetTimeStamp();
323 Float_t timeStampFrac = 1.*(timeStamp-fReader->GetRunTimeStampMin()) /
324 (fReader->GetRunTimeStampMax()-fReader->GetRunTimeStampMin());
326 //printf("stamp %d, min %d, max %d, frac %f\n", timeStamp, fReader->GetRunTimeStampMin(), fReader->GetRunTimeStampMax(), timeStampFrac);
328 fhTimeStampFraction->Fill(timeStampFrac);
333 //___________________________________________________________
334 void AliAnaCaloTrackCorrMaker::FillTriggerControlHistograms()
336 if(!fFillDataControlHisto) return;
338 Int_t triggerBC = fReader->GetTriggerClusterBC() ;
339 Bool_t exotic = fReader->IsExoticEvent();
340 Bool_t badCluster = fReader->IsBadCellTriggerEvent();
341 Bool_t badCell = fReader->IsBadMaxCellTriggerEvent();
342 Bool_t triggerMatch= fReader->IsTriggerMatched();
343 Bool_t triggerBCOK = kTRUE;
344 Int_t triggerId = fReader->GetTriggerClusterId() ;
346 Bool_t reMatchOpenTime = fReader->IsTriggerMatchedOpenCuts(0);
347 Bool_t reMatchNeigbour = fReader->IsTriggerMatchedOpenCuts(1);
348 Bool_t reMatchBoth = fReader->IsTriggerMatchedOpenCuts(2);
352 //printf("Trigger id %d\n",triggerId);
353 if(triggerId == -2) fhNEventsNoTriggerFound->Fill(0);
354 triggerBCOK = kFALSE;
359 fhNExoticEvents->Fill(0) ;
361 fReader->GetInputEvent()->GetPrimaryVertex()->GetXYZ(v) ;
362 fhXVertexExotic->Fill(v[0]);
363 fhYVertexExotic->Fill(v[1]);
364 fhZVertexExotic->Fill(v[2]);
366 //if(fReader->IsExoticEvent()) printf("Maker: EXOTIC Cluster trigger\n");
368 if(!triggerBCOK) return;
370 Int_t eventBC = fReader->GetInputEvent()->GetBunchCrossNumber();
371 if(eventBC%4 < 0 || eventBC%4 > 3 )
372 printf("AliAnaCaloTrackCorrMaker::ProcessEvent() - STRANGE: Trigger BC %d - Event BC %d, modulo4 %d \n",triggerBC,eventBC,eventBC%4);
376 if (!exotic && !badCluster) fhClusterTriggerBC->Fill(triggerBC);
377 else if( exotic && badCluster)
379 fhClusterTriggerBCBadClusterExotic->Fill(triggerBC);
380 if(badCell) fhClusterTriggerBCBadCellExotic->Fill(triggerBC);
382 else if( exotic && !badCluster) fhClusterTriggerBCExotic->Fill(triggerBC);
383 else if( badCluster && !exotic )
385 fhClusterTriggerBCBadCluster ->Fill(triggerBC);
386 if(badCell) fhClusterTriggerBCBadCell->Fill(triggerBC);
389 if(!exotic) fhClusterTriggerBCEventBC ->Fill(triggerBC,eventBC%4);
390 else fhClusterTriggerBCExoticEventBC->Fill(triggerBC,eventBC%4);
394 if (!exotic && !badCluster)
396 fhClusterTriggerBCUnMatch->Fill(triggerBC);
397 if(reMatchOpenTime) fhClusterTriggerBCUnMatchReMatch[0]->Fill(triggerBC);
398 if(reMatchNeigbour) fhClusterTriggerBCUnMatchReMatch[1]->Fill(triggerBC);
399 if(reMatchBoth) fhClusterTriggerBCUnMatchReMatch[2]->Fill(triggerBC);
401 else if( exotic && badCluster)
403 fhClusterTriggerBCBadClusterExoticUnMatch->Fill(triggerBC);
404 if(badCell) fhClusterTriggerBCBadCellExoticUnMatch ->Fill(triggerBC);
406 else if( exotic && !badCluster)
408 fhClusterTriggerBCExoticUnMatch->Fill(triggerBC);
409 if(reMatchOpenTime) fhClusterTriggerBCExoticUnMatchReMatch[0]->Fill(triggerBC);
410 if(reMatchNeigbour) fhClusterTriggerBCExoticUnMatchReMatch[1]->Fill(triggerBC);
411 if(reMatchBoth) fhClusterTriggerBCExoticUnMatchReMatch[2]->Fill(triggerBC);
413 else if( badCluster && !exotic )
415 fhClusterTriggerBCBadClusterUnMatch->Fill(triggerBC);
416 if(badCell)fhClusterTriggerBCBadCellUnMatch->Fill(triggerBC);
419 if(!exotic) fhClusterTriggerBCEventBCUnMatch ->Fill(triggerBC,eventBC%4);
420 else fhClusterTriggerBCExoticEventBCUnMatch->Fill(triggerBC,eventBC%4);
426 //_______________________________________________________
427 TList * AliAnaCaloTrackCorrMaker::GetListOfAnalysisCuts()
430 // Get the list of the cuts used for the analysis
431 // The list is filled in the maker, called by the task in LocalInit() and posted there
433 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
435 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
436 TObjString * objstring = ana->GetAnalysisCuts();
438 if(objstring)fCuts->Add(objstring);
445 //___________________________________________________
446 TList *AliAnaCaloTrackCorrMaker::GetOutputContainer()
448 // Fill the output list of histograms during the CreateOutputObjects stage.
450 //Initialize calorimeters geometry pointers
451 //GetCaloUtils()->InitPHOSGeometry();
452 //GetCaloUtils()->InitEMCALGeometry();
454 //General event histograms
456 fhNEventsIn = new TH1F("hNEventsIn", "Number of input events" , 1 , 0 , 1 ) ;
457 fhNEventsIn->SetYTitle("# events");
458 fOutputContainer->Add(fhNEventsIn);
460 fhNEvents = new TH1F("hNEvents", "Number of analyzed events" , 1 , 0 , 1 ) ;
461 fhNEvents->SetYTitle("# events");
462 fOutputContainer->Add(fhNEvents);
464 fhXVertex = new TH1F("hXVertex", " X vertex distribution" , 200 , -4 , 4 ) ;
465 fhXVertex->SetXTitle("v_{x} (cm)");
466 fOutputContainer->Add(fhXVertex);
468 fhYVertex = new TH1F("hYVertex", " Y vertex distribution" , 200 , -4 , 4 ) ;
469 fhYVertex->SetXTitle("v_{y} (cm)");
470 fOutputContainer->Add(fhYVertex);
472 fhZVertex = new TH1F("hZVertex", " Z vertex distribution" , 200 , -50 , 50 ) ;
473 fhZVertex->SetXTitle("v_{z} (cm)");
474 fOutputContainer->Add(fhZVertex);
476 fhCentrality = new TH1F("hCentrality","Number of events in centrality bin",100,0.,100) ;
477 fhCentrality->SetXTitle("Centrality bin");
478 fOutputContainer->Add(fhCentrality) ;
480 fhEventPlaneAngle=new TH1F("hEventPlaneAngle","Number of events in event plane",100,0.,TMath::Pi()) ;
481 fhEventPlaneAngle->SetXTitle("EP angle (rad)");
482 fOutputContainer->Add(fhEventPlaneAngle) ;
484 fhTrackMult = new TH1F("hTrackMult", "Number of tracks per events" , 2000 , 0 , 2000 ) ;
485 fhTrackMult->SetXTitle("# tracks");
486 fOutputContainer->Add(fhTrackMult);
488 if(fFillDataControlHisto)
490 fhNExoticEvents = new TH1F("hNExoticEvents", "Number of analyzed events triggered by exotic cluster" , 1 , 0 , 1 ) ;
491 fhNExoticEvents->SetYTitle("# exotic events");
492 fOutputContainer->Add(fhNExoticEvents);
494 fhNEventsNoTriggerFound = new TH1F("hNEventsNoTriggerFound", "Number of analyzed events triggered but no trigger found" , 1 , 0 , 1 ) ;
495 fhNEventsNoTriggerFound->SetYTitle("# exotic events");
496 fOutputContainer->Add(fhNEventsNoTriggerFound);
500 Float_t minbin =-5.5;
501 Float_t maxbin = 5.5;
502 Int_t labelshift = 6;
504 fhClusterTriggerBCEventBC = new TH2F("hClusterTriggerBCEventBC", "Found trigger BC and Event BC",
505 nbin , minbin ,maxbin,4,0, 4) ;
506 fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
507 for(Int_t i = 0; i < 4; i++)
508 fhClusterTriggerBCEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
509 fhClusterTriggerBCEventBC->SetXTitle("cluster trigger BC");
510 for(Int_t i = 1; i < 12; i++)
511 fhClusterTriggerBCEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
512 fhClusterTriggerBCEventBC->SetYTitle("Event BC%4");
513 fOutputContainer->Add(fhClusterTriggerBCEventBC);
515 fhClusterTriggerBCExoticEventBC = new TH2F("hClusterTriggerBCExoticEventBC", "Found exotic trigger BC and Event BC",
516 nbin , minbin ,maxbin,4,1, 4) ;
517 for(Int_t i = 0; i < 4; i++)
518 fhClusterTriggerBCExoticEventBC->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
519 fhClusterTriggerBCExoticEventBC->SetXTitle("cluster trigger BC");
520 for(Int_t i = 1; i < 12; i++)
521 fhClusterTriggerBCExoticEventBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
522 fhClusterTriggerBCExoticEventBC->SetYTitle("Event BC%4");
523 fOutputContainer->Add(fhClusterTriggerBCExoticEventBC);
525 fhClusterTriggerBCEventBCUnMatch = new TH2F("hClusterTriggerBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
526 nbin , minbin ,maxbin,4,1, 4) ;
527 for(Int_t i = 0; i < 4; i++)
528 fhClusterTriggerBCEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
529 fhClusterTriggerBCEventBCUnMatch->SetXTitle("cluster trigger BC");
530 for(Int_t i = 1; i < 12; i++)
531 fhClusterTriggerBCEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
532 fhClusterTriggerBCEventBCUnMatch->SetYTitle("Event BC%4");
533 fOutputContainer->Add(fhClusterTriggerBCEventBCUnMatch);
535 fhClusterTriggerBCExoticEventBCUnMatch = new TH2F("hClusterTriggerExoticBCEventBCUnMatch", "Found unmatched trigger BC and Event BC",
536 nbin , minbin ,maxbin,4,1, 4) ;
537 for(Int_t i = 0; i < 4; i++)
538 fhClusterTriggerBCExoticEventBCUnMatch->GetYaxis()->SetBinLabel(i+1 ,Form("BC/4=%d",i));
539 fhClusterTriggerBCExoticEventBCUnMatch->SetXTitle("cluster trigger BC");
540 for(Int_t i = 1; i < 12; i++)
541 fhClusterTriggerBCExoticEventBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
542 fhClusterTriggerBCExoticEventBCUnMatch->SetYTitle("Event BC%4");
543 fOutputContainer->Add(fhClusterTriggerBCExoticEventBCUnMatch);
545 fhClusterTriggerBC = new TH1F("hClusterTriggerBC",
546 "Number of analyzed events triggered by a cluster in a given BC",
547 nbin , minbin ,maxbin) ;
548 fhClusterTriggerBC->SetYTitle("# events");
549 for(Int_t i = 1; i < 12; i++)
550 fhClusterTriggerBC->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
551 fOutputContainer->Add(fhClusterTriggerBC);
553 fhClusterTriggerBCExotic = new TH1F("hClusterTriggerBCExotic",
554 "Number of analyzed events triggered by a exotic cluster in a given BC",
555 nbin , minbin ,maxbin) ;
556 fhClusterTriggerBCExotic->SetYTitle("# events");
557 for(Int_t i = 1; i < 12; i++)
558 fhClusterTriggerBCExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
559 fOutputContainer->Add(fhClusterTriggerBCExotic);
562 fhClusterTriggerBCBadCell = new TH1F("hClusterTriggerBCBadCell",
563 "Number of analyzed events triggered by a bad cell in a given BC",
564 nbin , minbin ,maxbin) ;
566 fhClusterTriggerBCBadCell->SetYTitle("# events");
567 for(Int_t i = 1; i < 12; i++)
568 fhClusterTriggerBCBadCell->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
569 fOutputContainer->Add(fhClusterTriggerBCBadCell);
571 fhClusterTriggerBCBadCellExotic = new TH1F("hClusterTriggerBCBadCellExotic",
572 "Number of analyzed events triggered by a bad cell & exotic cluster in a given BC",
573 nbin , minbin ,maxbin) ;
574 fhClusterTriggerBCBadCellExotic->SetYTitle("# events");
575 for(Int_t i = 1; i < 12; i++)
576 fhClusterTriggerBCBadCellExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
577 fOutputContainer->Add(fhClusterTriggerBCBadCellExotic);
579 fhClusterTriggerBCBadCluster = new TH1F("hClusterTriggerBCBadCluster",
580 "Number of analyzed events triggered by a bad cluster in a given BC",
581 nbin , minbin ,maxbin) ;
583 fhClusterTriggerBCBadCluster->SetYTitle("# events");
584 for(Int_t i = 1; i < 12; i++)
585 fhClusterTriggerBCBadCluster->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
586 fOutputContainer->Add(fhClusterTriggerBCBadCluster);
589 fhClusterTriggerBCBadClusterExotic = new TH1F("hClusterTriggerBCBadClusterExotic",
590 "Number of analyzed events triggered by a bad cluster & exotic cluster in a given BC",
591 nbin , minbin ,maxbin) ;
593 fhClusterTriggerBCBadClusterExotic->SetYTitle("# events");
594 for(Int_t i = 1; i < 12; i++)
595 fhClusterTriggerBCBadClusterExotic->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
596 fOutputContainer->Add(fhClusterTriggerBCBadClusterExotic);
598 fhClusterTriggerBCUnMatch = new TH1F("hClusterTriggerBCUnMatch",
599 "Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC",
600 nbin , minbin ,maxbin) ;
601 fhClusterTriggerBCUnMatch->SetYTitle("# events");
602 for(Int_t i = 1; i < 12; i++)
603 fhClusterTriggerBCUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
604 fOutputContainer->Add(fhClusterTriggerBCUnMatch);
606 fhClusterTriggerBCExoticUnMatch = new TH1F("hClusterTriggerBCExoticUnMatch",
607 "Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC",
608 nbin , minbin ,maxbin) ;
609 fhClusterTriggerBCExoticUnMatch->SetYTitle("# events");
610 for(Int_t i = 1; i < 12; i++)
611 fhClusterTriggerBCExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
612 fOutputContainer->Add(fhClusterTriggerBCExoticUnMatch);
615 fhClusterTriggerBCBadCellUnMatch = new TH1F("hClusterTriggerBCBadCellUnMatch",
616 "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
617 nbin , minbin ,maxbin) ;
618 fhClusterTriggerBCBadCellUnMatch->SetYTitle("# events");
619 for(Int_t i = 1; i < 12; i++)
620 fhClusterTriggerBCBadCellUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
621 fOutputContainer->Add(fhClusterTriggerBCBadCellUnMatch);
624 fhClusterTriggerBCBadCellExoticUnMatch = new TH1F("hClusterTriggerBCBadCellExoticUnMatch",
625 "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
626 nbin , minbin ,maxbin) ;
627 fhClusterTriggerBCBadCellExoticUnMatch->SetYTitle("# events");
628 for(Int_t i = 1; i < 12; i++)
629 fhClusterTriggerBCBadCellExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
630 fOutputContainer->Add(fhClusterTriggerBCBadCellExoticUnMatch);
633 fhClusterTriggerBCBadClusterUnMatch = new TH1F("hClusterTriggerBCBadClusterUnMatch",
634 "Number of analyzed events triggered by a bad cluster (no trigger patch match) in a given BC",
635 nbin , minbin ,maxbin) ;
636 fhClusterTriggerBCBadClusterUnMatch->SetYTitle("# events");
637 for(Int_t i = 1; i < 12; i++)
638 fhClusterTriggerBCBadClusterUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
639 fOutputContainer->Add(fhClusterTriggerBCBadClusterUnMatch);
642 fhClusterTriggerBCBadClusterExoticUnMatch = new TH1F("hClusterTriggerBCBadClusterExoticUnMatch",
643 "Number of analyzed events triggered by a bad&exotic cluster (no trigger patch match) in a given BC",
644 nbin , minbin ,maxbin) ;
645 fhClusterTriggerBCBadClusterExoticUnMatch->SetYTitle("# events");
646 for(Int_t i = 1; i < 12; i++)
647 fhClusterTriggerBCBadClusterExoticUnMatch->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
648 fOutputContainer->Add(fhClusterTriggerBCBadClusterExoticUnMatch);
650 TString rematch[] = {"OpenTime","CheckNeighbours","Both"};
651 for(Int_t j = 0; j < 3; j++)
653 fhClusterTriggerBCUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCUnMatch_ReMatch_%s",rematch[j].Data()),
654 Form("Number of analyzed events triggered by a cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
655 nbin , minbin ,maxbin) ;
656 fhClusterTriggerBCUnMatchReMatch[j]->SetYTitle("# events");
657 for(Int_t i = 1; i < 12; i++)
658 fhClusterTriggerBCUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
659 fOutputContainer->Add(fhClusterTriggerBCUnMatchReMatch[j]);
661 fhClusterTriggerBCExoticUnMatchReMatch[j] = new TH1F(Form("hClusterTriggerBCExoticUnMatch_ReMatch_%s",rematch[j].Data()),
662 Form("Number of analyzed events triggered by a exotic cluster (no trigger patch match) in a given BC, re-match %s",rematch[j].Data()),
663 nbin , minbin ,maxbin) ;
664 fhClusterTriggerBCExoticUnMatchReMatch[j]->SetYTitle("# events");
665 for(Int_t i = 1; i < 12; i++)
666 fhClusterTriggerBCExoticUnMatchReMatch[j]->GetXaxis()->SetBinLabel(i ,Form("BC%d",i-labelshift));
667 fOutputContainer->Add(fhClusterTriggerBCExoticUnMatchReMatch[j]);
670 fhNPileUpEvents = new TH1F("hNPileUpEvents", "Number of events considered as pile-up", 8 , 0 , 8 ) ;
671 fhNPileUpEvents->SetYTitle("# events");
672 fhNPileUpEvents->GetXaxis()->SetBinLabel(1 ,"SPD");
673 fhNPileUpEvents->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
674 fhNPileUpEvents->GetXaxis()->SetBinLabel(3 ,"EMCal");
675 fhNPileUpEvents->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
676 fhNPileUpEvents->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
677 fhNPileUpEvents->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
678 fhNPileUpEvents->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
679 fhNPileUpEvents->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
680 fOutputContainer->Add(fhNPileUpEvents);
682 fhNPileUpEventsTriggerBC0 = new TH1F("hNPileUpEventsTriggerBC0","Number of events considered as pile-up, trigger cluster in BC=0", 8 , 0 , 8 ) ;
683 fhNPileUpEventsTriggerBC0->SetYTitle("# events");
684 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(1 ,"SPD");
685 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(2 ,"Multi SPD");
686 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(3 ,"EMCal");
687 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(4 ,"EMCal || SPD");
688 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(5 ,"EMCal && SPD");
689 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(6 ,"!EMCal && SPD");
690 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(7 ,"EMCal && !SPD");
691 fhNPileUpEventsTriggerBC0->GetXaxis()->SetBinLabel(8 ,"!EMCal && !SPD");
692 fOutputContainer->Add(fhNPileUpEventsTriggerBC0);
694 if(fReader->IsAccessToTrackTimeOn())
696 fhTrackBCEvent = new TH1F("hTrackBCEvent", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
697 fhTrackBCEvent->SetYTitle("# events");
698 fhTrackBCEvent->SetXTitle("Bunch crossing");
699 for(Int_t i = 1; i < 20; i++)
700 fhTrackBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
701 fOutputContainer->Add(fhTrackBCEvent);
703 fhTrackBCEventCut = new TH1F("hTrackBCEventCut", "Number of events with at least 1 track in a bunch crossing ", 19 , 0 , 19 ) ;
704 fhTrackBCEventCut->SetYTitle("# events");
705 fhTrackBCEventCut->SetXTitle("Bunch crossing");
706 for(Int_t i = 1; i < 20; i++)
707 fhTrackBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
708 fOutputContainer->Add(fhTrackBCEventCut);
711 fhPrimaryVertexBC = new TH1F("hPrimaryVertexBC", "Number of primary vertex per bunch crossing ", 41 , -20 , 20 ) ;
712 fhPrimaryVertexBC->SetYTitle("# events");
713 fhPrimaryVertexBC->SetXTitle("Bunch crossing");
714 fOutputContainer->Add(fhPrimaryVertexBC);
716 fhEMCalBCEvent = new TH1F("hEMCalBCEvent", "Number of events with at least 1 cluster in a bunch crossing ", 19 , 0 , 19 ) ;
717 fhEMCalBCEvent->SetYTitle("# events");
718 fhEMCalBCEvent->SetXTitle("Bunch crossing");
719 for(Int_t i = 1; i < 20; i++)
720 fhEMCalBCEvent->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
721 fOutputContainer->Add(fhEMCalBCEvent);
723 fhEMCalBCEventCut = new TH1F("hEMCalBCEventCut", "Number of events with at least 1 cluster in a bunch crossing", 19 , 0 , 19 ) ;
724 fhEMCalBCEventCut->SetYTitle("# events");
725 fhEMCalBCEventCut->SetXTitle("Bunch crossing");
726 for(Int_t i = 1; i < 20; i++)
727 fhEMCalBCEventCut->GetXaxis()->SetBinLabel(i ,Form("%d",i-10));
728 fOutputContainer->Add(fhEMCalBCEventCut);
730 fhXVertexExotic = new TH1F("hXVertexExotic", " X vertex distribution in exotic events" , 200 , -4 , 4 ) ;
731 fhXVertexExotic->SetXTitle("v_{x} (cm)");
732 fOutputContainer->Add(fhXVertexExotic);
734 fhYVertexExotic = new TH1F("hYVertexExotic", " Y vertex distribution in exotic events" , 200 , -4 , 4 ) ;
735 fhYVertexExotic->SetXTitle("v_{y} (cm)");
736 fOutputContainer->Add(fhYVertexExotic);
738 fhZVertexExotic = new TH1F("hZVertexExotic", " Z vertex distribution in exotic events" , 200 , -50 , 50 ) ;
739 fhZVertexExotic->SetXTitle("v_{z} (cm)");
740 fOutputContainer->Add(fhZVertexExotic);
742 fhPileUpClusterMult = new TH1F("hPileUpClusterMult", "Number of clusters per event with large time (|t| > 20 ns)" , 100 , 0 , 100 ) ;
743 fhPileUpClusterMult->SetXTitle("# clusters");
744 fOutputContainer->Add(fhPileUpClusterMult);
746 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 ) ;
747 fhPileUpClusterMultAndSPDPileUp->SetXTitle("# clusters");
748 fOutputContainer->Add(fhPileUpClusterMultAndSPDPileUp);
750 fhNPileUpVertSPD = new TH1F ("hNPileUpVertSPD","N pile-up SPD vertex", 50,0,50);
751 fhNPileUpVertSPD->SetYTitle("# vertex ");
752 fOutputContainer->Add(fhNPileUpVertSPD);
754 fhNPileUpVertTracks = new TH1F ("hNPileUpVertTracks","N pile-up Tracks vertex", 50,0,50);
755 fhNPileUpVertTracks->SetYTitle("# vertex ");
756 fOutputContainer->Add(fhNPileUpVertTracks);
758 if(fReader->IsSelectEventTimeStampOn())
760 fhTimeStampFraction = new TH1F("hTimeStampFraction","Fraction of events within a given time stamp range",150, -1, 2) ;
761 fhTimeStampFraction->SetXTitle("fraction");
762 fOutputContainer->Add(fhTimeStampFraction) ;
768 fhNMergedFiles = new TH1F("hNMergedFiles", "Number of merged output files" , 1 , 0 , 1 ) ;
769 fhNMergedFiles->SetYTitle("# files");
770 fhNMergedFiles->Fill(1); // Fill here with one entry, while merging it will count the rest
771 fOutputContainer->Add(fhNMergedFiles);
773 fhScaleFactor = new TH1F("hScaleFactor", "Number of merged output files" , 1 , 0 , 1 ) ;
774 fhScaleFactor->SetYTitle("scale factor");
775 fhScaleFactor->SetBinContent(1,fScaleFactor); // Fill here
776 fOutputContainer->Add(fhScaleFactor);
779 if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
781 printf("AliAnaCaloTrackCorrMaker::GetOutputContainer() - Analysis job list not initialized!!!\n");
782 return fOutputContainer;
785 const Int_t buffersize = 255;
786 char newname[buffersize];
787 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
790 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
792 if(fMakeHisto) // Analysis with histograms as output on
795 //Fill container with appropriate histograms
796 TList * templist = ana ->GetCreateOutputObjects();
797 templist->SetOwner(kFALSE); //Owner is fOutputContainer.
799 for(Int_t i = 0; i < templist->GetEntries(); i++)
802 //Add only to the histogram name the name of the task
803 if( strcmp((templist->At(i))->ClassName(),"TObjString") )
805 snprintf(newname,buffersize, "%s%s", (ana->GetAddedHistogramsStringToName()).Data(), (templist->At(i))->GetName());
806 //printf("name %s, new name %s\n",(templist->At(i))->GetName(),newname);
807 ((TH1*) templist->At(i))->SetName(newname);
810 //Add histogram to general container
811 fOutputContainer->Add(templist->At(i)) ;
817 }// Analysis with histograms as output on
819 }//Loop on analysis defined
821 return fOutputContainer;
825 //___________________________________
826 void AliAnaCaloTrackCorrMaker::Init()
828 //Init container histograms and other common variables
829 // Fill the output list of histograms during the CreateOutputObjects stage.
833 GetReader()->SetCaloUtils(GetCaloUtils()); // pass the calo utils pointer to the reader
836 if(!fAnalysisContainer || fAnalysisContainer->GetEntries()==0)
838 printf("AliAnaCaloTrackCorrMaker::GetOutputInit() - Analysis job list not initialized!!!\n");
842 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
845 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
847 ana->SetReader(fReader); // Set Reader for each analysis
848 ana->SetCaloUtils(fCaloUtils); // Set CaloUtils for each analysis
852 }//Loop on analysis defined
856 //_____________________________________________
857 void AliAnaCaloTrackCorrMaker::InitParameters()
863 fAnaDebug = 0; // No debugging info displayed by default
867 //______________________________________________________________
868 void AliAnaCaloTrackCorrMaker::Print(const Option_t * opt) const
870 //Print some relevant parameters set for the analysis
875 printf("***** Print: %s %s ******\n", GetName(), GetTitle() ) ;
876 printf("Debug level = %d\n", fAnaDebug ) ;
877 printf("Produce Histo = %d\n", fMakeHisto ) ;
878 printf("Produce AOD = %d\n", fMakeAOD ) ;
879 printf("Number of analysis tasks = %d\n", fAnalysisContainer->GetEntries()) ;
881 if(!strcmp("all",opt))
883 printf("Print analysis Tasks settings :\n") ;
884 for(Int_t iana = 0; iana<fAnalysisContainer->GetEntries(); iana++)
886 ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana))->Print("");
889 printf("Print analysis Reader settings :\n") ;
891 printf("Print analysis Calorimeter Utils settings :\n") ;
892 fCaloUtils->Print("");
898 //_____________________________________________________________________________________
899 void AliAnaCaloTrackCorrMaker::ProcessEvent(Int_t iEntry, const char * currentFileName)
901 //Process analysis for this event
903 if(fMakeHisto && !fOutputContainer)
905 printf("AliAnaCaloTrackCorrMaker::ProcessEvent() - Histograms not initialized\n");
911 printf("*** AliAnaCaloTrackCorrMaker::ProcessEvent() Event %d *** \n",iEntry);
914 printf("AliAnaCaloTrackCorrMaker::ProcessEvent() - Current File Name : %s\n", currentFileName);
915 //printf("fAODBranchList %p, entries %d\n",fAODBranchList,fAODBranchList->GetEntries());
919 //Each event needs an empty branch
920 TList * aodList = fReader->GetAODBranchList();
921 Int_t nAODBranches = aodList->GetEntries();
922 for(Int_t iaod = 0; iaod < nAODBranches; iaod++)
924 TClonesArray *tca = dynamic_cast<TClonesArray*> (aodList->At(iaod));
925 if(tca) tca->Clear("C");
928 //Set geometry matrices before filling arrays, in case recalibration/position calculation etc is needed
929 fCaloUtils->AccessGeometry(fReader->GetInputEvent());
931 //Set the AODB calibration, bad channels etc. parameters at least once
932 fCaloUtils->AccessOADB(fReader->GetInputEvent());
934 //Tell the reader to fill the data in the 3 detector lists
935 Bool_t ok = fReader->FillInputEvent(iEntry, currentFileName);
937 //Access pointers, and trigger mask check needed in mixing case
938 AliAnalysisManager *manager = AliAnalysisManager::GetAnalysisManager();
939 AliInputEventHandler *inputHandler = dynamic_cast<AliInputEventHandler*>(manager->GetInputEventHandler());
941 UInt_t isMBTrigger = kFALSE;
942 UInt_t isTrigger = kFALSE;
945 isMBTrigger = inputHandler->IsEventSelected() & fReader->GetMixEventTriggerMask();
946 isTrigger = inputHandler->IsEventSelected() & fReader->GetEventTriggerMask();
949 //Fill trigger control histograms, make sure it is only for triggered events and
950 // not the MB events used for mixing
951 if(fReader->IsEventTriggerAtSEOn() || isTrigger)
953 fhNEventsIn->Fill(0);
954 FillTriggerControlHistograms();
959 if(fAnaDebug >= 1 )printf("*** Skip event *** %d \n",iEntry);
960 fReader->ResetLists();
964 //Magic line to write events to file
965 if(fReader->WriteDeltaAODToFile())AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
967 //printf(">>>>>>>>>> BEFORE >>>>>>>>>>>\n");
968 //gObjectTable->Print();
970 // Init mag field for tracks in case of ESDs, not really necessary
971 if (!TGeoGlobalMagField::Instance()->GetField() && ((AliESDEvent*) fReader->GetInputEvent()))
972 ((AliESDEvent*)fReader->GetInputEvent())->InitMagneticField();
974 //Loop on analysis algorithms
976 if(fAnaDebug > 0 ) printf("*** Begin analysis *** \n");
978 Int_t nana = fAnalysisContainer->GetEntries() ;
979 for(Int_t iana = 0; iana < nana; iana++)
981 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
983 ana->ConnectInputOutputAODBranches(); //Sets branches for each analysis
985 //Fill pool for mixed event for the analysis that need it
986 if(!fReader->IsEventTriggerAtSEOn() && isMBTrigger)
988 ana->FillEventMixPool();
989 if(!isTrigger) continue; // pool filled do not try to fill AODs or histograms if trigger is not MB
992 //Make analysis, create aods in aod branch and in some cases fill histograms
993 if(fMakeAOD ) ana->MakeAnalysisFillAOD() ;
995 //Make further analysis with aod branch and fill histograms
996 if(fMakeHisto) ana->MakeAnalysisFillHistograms() ;
1000 fReader->ResetLists();
1002 // In case of mixing analysis, non triggered events are used,
1003 // do not fill control histograms for a non requested triggered event
1004 if(!fReader->IsEventTriggerAtSEOn() && !isTrigger)
1006 if(fAnaDebug > 0 ) printf("AliAnaCaloTrackMaker::ProcessEvent() - *** End analysis, MB for mixing *** \n");
1010 FillControlHistograms();
1012 //printf(">>>>>>>>>> AFTER >>>>>>>>>>>\n");
1013 //gObjectTable->Print();
1015 if(fAnaDebug > 0 ) printf("AliAnaCaloTrackMaker::ProcessEvent() - *** End analysis *** \n");
1019 //__________________________________________________________
1020 void AliAnaCaloTrackCorrMaker::Terminate(TList * outputList)
1022 //Execute Terminate of analysis
1023 //Do some final plots.
1027 Error("Terminate", "No output list");
1031 for(Int_t iana = 0; iana < fAnalysisContainer->GetEntries(); iana++)
1034 AliAnaCaloTrackCorrBaseClass * ana = ((AliAnaCaloTrackCorrBaseClass *) fAnalysisContainer->At(iana)) ;
1035 if(ana->MakePlotsOn())ana->Terminate(outputList);
1037 }//Loop on analysis defined