1 // Configuration macro for analysis of isolated photon spectra
2 // Author : Gustavo Conesa; Marie Germain.
4 TString kAnaIsoPhotonName = "";
6 TString kCalorimeter = "EMCAL";
10 AliAnalysisTaskCaloTrackCorrelation *AddTaskIsoPhoton(const Float_t cone = 0.4,
11 const Float_t pth = 2.,
12 const Bool_t leading = kFALSE,
13 const Bool_t timecut = kFALSE,
14 const TString calorimeter = "EMCAL",
15 const Bool_t simu = kFALSE,
16 const Bool_t exotic = kTRUE,
17 const Bool_t nonlin = kFALSE,
18 const TString trigger = "EMC7",
19 const Bool_t tm = kTRUE,
20 const Int_t minCen = -1,
21 const Int_t maxCen = -1,
22 const Float_t deltaphicut = 0.03,
23 const Float_t deltaetacut = 0.02,
24 const Float_t tmin = -30.,
25 const Float_t tmax = 30.,
26 const Int_t disttobad = 2,
27 const Int_t nlmMax = 20,
28 const Bool_t qaan = kFALSE,
29 const Bool_t primvtx = kTRUE,
30 const Bool_t notrackcut = kTRUE,
31 const Bool_t rdmtrigger = kFALSE,
32 const Int_t debug = -1,
33 const Bool_t print = kFALSE
37 kCalorimeter = calorimeter ;
39 // Creates a CaloTrackCorr task, configures it and adds it to the analysis manager.
41 printf("AddTaskIsoPhoton() - Settings: cone %2.2f, pth %2.2f, timeCut On %d, NLM max cut %d, calorimeter %s, simu %d, exotic %d, non lin %d, trigger %s, TM %d, qa %d, debug %d, centrality %d-%d\n",
42 cone, pth, timecut , nlmMax, calorimeter.Data(),simu, exotic, nonlin, trigger.Data(), tm, qaan, debug, minCen, maxCen );
44 // Get the pointer to the existing analysis manager via the static access method.
46 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
49 ::Error("AddTask", "No analysis manager to connect to.");
53 // Check the analysis type using the event handlers connected to the analysis manager.
55 if (!mgr->GetInputEventHandler())
57 ::Error("AddTask", "This task requires an input event handler");
61 // Make sure the B field is enabled for track selection, some cuts need it
62 ((AliInputEventHandler*)mgr->GetInputEventHandler())->SetNeedField(kTRUE);
64 Bool_t useKinematics = kFALSE;
65 useKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
67 // Name for containers
69 kAnaIsoPhotonName = Form("%s_Trig%s_TM%d_%1.3f_dB%d_R%1.1f_Pt%1.1f",calorimeter.Data(), trigger.Data(),tm,deltaphicut,disttobad,cone,pth);
71 if(maxCen>=0) kAnaIsoPhotonName+=Form("Cen%d_%d",minCen,maxCen);
73 printf("<<<< NAME: %s >>>>>\n",kAnaIsoPhotonName.Data());
75 // #### Configure analysis ####
77 AliAnaCaloTrackCorrMaker * maker = new AliAnaCaloTrackCorrMaker();
79 //maker->SetScaleFactor(scaleFactor); // for MC, negative (not scaled) by default
81 // General frame setting and configuration
82 maker->SetReader (ConfigureReader (mgr->GetInputEventHandler()->GetDataType(),useKinematics,simu,
83 calorimeter,nonlin, timecut, primvtx, notrackcut,tmin,tmax,minCen, maxCen, debug,print));
84 maker->SetCaloUtils(ConfigureCaloUtils(nonlin,exotic,simu,timecut,debug,print));
86 // Analysis tasks setting and configuration
87 Int_t n = 0;//Analysis number, order is important
90 Int_t partInCone = AliIsolationCut::kNeutralAndCharged; // kOnlyCharged;
91 // Int_t thresType = AliIsolationCut::kPtThresIC;// AliIsolationCut::kSumPtFracIC ;
92 Int_t thresType = AliIsolationCut::kSumPtIC ;
97 maker->AddAnalysis(ConfigurePhotonAnalysis(calorimeter,tm,deltaphicut,deltaetacut,disttobad,nlmMax,simu,debug,print), n++); // Photon cluster selection
100 maker->AddAnalysis(ConfigureIsolationAnalysis(calorimeter,"Photon", partInCone,thresType,cone, pth,tm,leading,kFALSE,simu,debug,print), n++); // Photon isolation
104 maker->AddAnalysis(ConfigureRandomTriggerAnalysis(), n++);
105 maker->AddAnalysis(ConfigureIsolationAnalysis(calorimeter,Form("RandomTrigger%s",kCalorimeter.Data()), partInCone,thresType,cone, pth,tm,leading,kFALSE,simu,debug,print), n++);// Ghost trigger isolation
109 // QA histograms on clusters or tracks
112 maker->AddAnalysis(ConfigureQAAnalysis(calorimeter,simu,debug,print),n++);
113 maker->AddAnalysis(ConfigureChargedAnalysis(simu,debug), n++); // charged tracks plots
116 maker->SetAnaDebug(debug) ;
117 maker->SwitchOnHistogramsMaker() ;
118 maker->SwitchOnAODsMaker() ;
120 if(print) maker->Print("");
122 maker->SwitchOffDataControlHistograms();
124 printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, calorimeter.Data());
128 AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("CaloTrackCorr%s",kAnaIsoPhotonName.Data()));
129 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
130 task->SetDebugLevel(debug);
131 task->SetBranches("ESD:AliESDRun.,AliESDHeader");
132 task->SetAnalysisMaker(maker);
137 TString outputfile = AliAnalysisManager::GetCommonFileName();
139 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(kAnaIsoPhotonName, TList::Class(),
140 AliAnalysisManager::kOutputContainer,
141 Form("%s",outputfile.Data()));
143 AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Param_%s",kAnaIsoPhotonName.Data()), TList::Class(),
144 AliAnalysisManager::kParamContainer,
145 "AnalysisParameters.root");
147 // Create ONLY the output containers for the data produced by the task.
148 // Get and connect other common input/output containers via the manager as below
149 //==============================================================================
150 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
151 // AOD output slot will be used in a different way in future
152 mgr->ConnectOutput (task, 1, cout_pc);
153 mgr->ConnectOutput (task, 2, cout_cuts);
155 // Set the trigger selection
156 UInt_t mask = SetTriggerMaskFromName(trigger);
157 task->SelectCollisionCandidates(mask);
162 //____________________________________
163 AliCaloTrackReader * ConfigureReader(TString inputDataType = "AOD", Bool_t useKinematics = kFALSE, Bool_t simu = kFALSE,
164 TString calorimeter = "EMCAL", Bool_t nonlin = kTRUE, Bool_t timecut = kFALSE,
165 Bool_t primvtx = kFALSE, Bool_t notrackcut = kFALSE, Float_t tmin, Float_t tmax,
166 Float_t minCen = -1, Float_t maxCen = -1, Int_t debug = -1, Bool_t print = kFALSE)
168 // Init reader settings: event selection, basic cluster track cuts, etc
172 if (!useKinematics && inputDataType=="AOD") useKinematics = kTRUE; //AOD primary should be available ...
175 cout<<"********* ACCESS KINE? "<<useKinematics<< endl;
177 AliCaloTrackReader * reader = 0;
178 if (inputDataType=="AOD") reader = new AliCaloTrackAODReader();
179 else if(inputDataType=="ESD") reader = new AliCaloTrackESDReader();
180 else printf("AliCaloTrackReader::ConfigureReader() - Data not known inputData=%s\n",inputDataType.Data());
182 reader->SetDebug(debug);//10 for lots of messages
184 reader->SwitchOffTriggerPatchMatching();
185 reader->SwitchOffBadTriggerEventsRemoval();
187 reader->SwitchOffWriteDeltaAOD() ;
192 if(inputDataType == "ESD")
194 reader->SwitchOnStack();
195 reader->SwitchOffAODMCParticles();
197 else if(inputDataType == "AOD")
199 reader->SwitchOffStack();
200 reader->SwitchOnAODMCParticles();
204 //------------------------
205 // Detector input filling
206 //------------------------
208 //Min cluster/track E
209 reader->SetEMCALEMin(0.3);
210 reader->SetEMCALEMax(1000);
211 reader->SetPHOSEMin(0.3);
212 reader->SetPHOSEMax(1000);
213 reader->SetCTSPtMin(0.2);
214 reader->SetCTSPtMax(1000);
219 reader->SwitchOffUseTrackTimeCut();
220 reader->SwitchOffUseParametrizedTimeCut();
221 reader->SwitchOffUseEMCALTimeCut();
222 reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
226 reader->SwitchOffUseParametrizedTimeCut();
230 printf("Set time cut \n");
231 reader->SwitchOnUseEMCALTimeCut();
233 reader->SetEMCALTimeCut(tmin,tmax); // default is -25ns-20ns
237 printf("Off time cuts time cut \n");
238 reader->SwitchOffUseEMCALTimeCut();
240 reader->SetEMCALTimeCut(-1.e6,1.e6);
244 reader->SwitchOffFiducialCut();
245 reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
248 reader->SwitchOnCTS();
251 reader->SwitchOffRecalculateVertexBC();
252 reader->SwitchOffVertexBCEventSelection();
254 reader->SwitchOffUseTrackTimeCut();
255 reader->SetTrackTimeCut(0,50);
257 reader->SwitchOffUseTrackDCACut();
258 //reader->SetTrackDCACut(0,0.0105);
259 //reader->SetTrackDCACut(1,0.035);
260 //reader->SetTrackDCACut(2,1.1);
262 if(inputDataType=="ESD")
264 gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");
265 //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
266 //reader->SetTrackCuts(esdTrackCuts);
267 //reader->SwitchOnConstrainTrackToVertex();
272 AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
273 reader->SetTrackCuts(esdTrackCuts);
274 AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
275 reader->SetTrackComplementaryCuts(esdTrackCuts2);
280 // AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001006);
281 // reader->SetTrackCuts(esdTrackCuts);
282 // AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10041006);
283 // reader->SetTrackComplementaryCuts(esdTrackCuts2);
286 else if(inputDataType=="AOD")
288 //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid
289 reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
290 reader->SetTrackStatus(AliVTrack::kITSrefit);
291 //reader->SwitchOnTrackHitSPDSelection(); // Check that the track has at least a hit on the SPD, not much sense to use for hybrid or TPC only tracks
296 reader->SwitchOffClusterRecalculation();
300 if(!nonlin) reader->SwitchOffClusterELinearityCorrection();
301 else reader->SwitchOnClusterELinearityCorrection();
303 if(calorimeter == "EMCAL") {
304 reader->SwitchOnEMCALCells();
305 reader->SwitchOnEMCAL();
307 if(calorimeter == "PHOS") { // Should be on if QA is activated with correlation on
308 reader->SwitchOffPHOSCells();
309 reader->SwitchOffPHOS();
316 //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
318 // reader->RejectFastClusterEvents() ;
320 reader->SwitchOnEventTriggerAtSE();
322 reader->SetZvertexCut(10.); // Open cut
324 reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
326 reader->SwitchOffPrimaryVertexSelection();
328 reader->SwitchOnRejectNoTrackEvents();
330 reader->SwitchOffRejectNoTrackEvents();
332 reader->SwitchOffPileUpEventRejection(); // remove pileup
333 reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
338 reader->SetCentralityClass("V0M");
339 reader->SetCentralityOpt(100); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
340 reader->SetCentralityBin(minCen,maxCen); // Accept all events, if not select range
342 // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
343 reader->SetEventPlaneMethod("V0");
346 if(print) reader->Print("");
352 //_______________________________________
353 AliCalorimeterUtils* ConfigureCaloUtils(Bool_t nonlin = kTRUE, Bool_t exotic = kTRUE ,Bool_t simu = kFALSE, Bool_t timecut = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
356 AliCalorimeterUtils *cu = new AliCalorimeterUtils;
359 // Remove clusters close to borders, at least max energy cell is 1 cell away
360 cu->SetNumberOfCellsFromEMCALBorder(0);//this was originally set to one
361 cu->SetNumberOfCellsFromPHOSBorder(2);
363 cu->SwitchOffRecalculateClusterTrackMatching();
365 cu->SwitchOffBadChannelsRemoval() ;
370 cu->SwitchOnLoadOwnEMCALGeometryMatrices();
372 /* AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
374 cu->SwitchOffRecalibration();
375 cu->SwitchOffRunDepCorrection();
377 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/ConfigureEMCALRecoUtils.C");
378 ConfigureEMCALRecoUtils(recou,
384 kFALSE); // time calib
385 if(timecut) recou->SetExoticCellDiffTimeCut(50.);
389 printf("ConfigureCaloUtils() - Apply non linearity to EMCAL\n");
390 cu->SwitchOnCorrectClusterLinearity();
393 printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
394 printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
396 cu->SetNumberOfSuperModulesUsed(10);
398 if(print) cu->Print("");
404 //_____________________________________
405 AliAnaPhoton* ConfigurePhotonAnalysis(TString calorimeter = "EMCAL", Bool_t tm = kFALSE, Float_t deltaphicut = 0.02, Float_t deltaetacut = 0.03,Int_t disttobad=0,Int_t nlmMax = 2, Bool_t simu = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
408 AliAnaPhoton *ana = new AliAnaPhoton();
409 ana->SetDebug(debug); //10 for lots of messages
411 // cluster selection cuts
413 ana->SwitchOffFiducialCut();
415 ana->SetCalorimeter(calorimeter);
417 if(calorimeter == "PHOS")
419 ana->SetNCellCut(2);// At least 3 cells
421 ana->SetMinDistanceToBadChannel(2, 4, 5);
422 ana->SetTimeCut(-1e10,1e10); // open cut
426 ana->SetNCellCut(1);// At least 2 cells
427 ana->SetMinEnergy(0.3); // avoid mip peak at E = 260 MeV
428 ana->SetMaxEnergy(1000);
429 // ana->SetTimeCut(-1e10,1e10); // open cut, usual time window of [425-825] ns if time recalibration is off
430 // restrict to less than 100 ns when time calibration is on
431 ana->SetMinDistanceToBadChannel(disttobad, 4, 6);
433 // NLM cut, used in all, exclude clusters with more than 2 maxima
434 // Not needed if M02 cut is already strong or clusterizer V2
435 ana->SetNLMCut(1, nlmMax) ;
440 ana->SwitchOnTrackMatchRejection() ;
441 ana->SwitchOffTMHistoFill() ;
445 ana->SwitchOffTrackMatchRejection() ;
446 ana->SwitchOnTMHistoFill() ;
449 //PID cuts (shower shape)
450 ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
451 AliCaloPID* caloPID = ana->GetCaloPID();
452 //Not used in bayesian
455 caloPID->SetEMCALLambda0CutMax(1000.);
456 caloPID->SetEMCALLambda0CutMin(0.);
458 // caloPID->SetEMCALDEtaCut(0.025);
459 // caloPID->SetEMCALDPhiCut(0.030);
460 caloPID->SetEMCALDEtaCut(deltaetacut);
461 caloPID->SetEMCALDPhiCut(deltaphicut);
463 ana->SwitchOnFillShowerShapeHistograms(); // Filled before photon shower shape selection
464 if(!simu) ana->SwitchOnFillPileUpHistograms();
466 // Input / output delta AOD settings
468 ana->SetOutputAODName(Form("Photon%s",kAnaIsoPhotonName.Data()));
469 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
471 //Set Histograms name tag, bins and ranges
473 ana->AddToHistogramsName(Form("AnaPhoton_TM%d_",tm));
474 SetHistoRangeAndNBins(ana->GetHistogramRanges(), calorimeter); // see method below
476 // Number of particle type MC histograms
477 ana->FillNOriginHistograms(20);
478 ana->FillNPrimaryHistograms(20);
480 ConfigureMC(ana,simu);
482 if(print) ana->Print("");
488 //____________________________________________________________________________________________________
489 AliAnaParticleIsolation* ConfigureIsolationAnalysis(TString calorimeter = "EMCAL", TString particle="Photon",
490 Int_t partInCone = AliIsolationCut::kOnlyCharged,
491 Int_t thresType = AliIsolationCut::kSumPtFracIC,
495 Bool_t leading = kTRUE,
496 Bool_t multi = kFALSE, Bool_t simu = kFALSE,
497 Int_t debug = -1, Bool_t print = kFALSE)
500 AliAnaParticleIsolation *ana = new AliAnaParticleIsolation();
501 ana->SetDebug(debug);
503 ana->SwitchOnFiducialCut();
504 //Avoid borders of EMCal
505 if(calorimeter=="EMCAL")
507 //ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
508 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.27, 103, 157) ;
513 // Input / output delta AOD settings
515 ana->SetInputAODName(Form("%s%s",particle.Data(),kAnaIsoPhotonName.Data()));
516 ana->SetAODObjArrayName(Form("IC%s_%s",particle.Data(),kAnaIsoPhotonName.Data()));
518 ana->SetCalorimeter(calorimeter);
520 if(!tm) ana->SwitchOnTMHistoFill();
521 else ana->SwitchOffTMHistoFill();
522 // ana->SwitchOnTMHistoFill();
524 // ana->SwitchOffSSHistoFill();
525 // if(!kSimulation) ana->SwitchOnFillPileUpHistograms();
526 ana->SwitchOnSSHistoFill();
527 if(leading) ana->SwitchOnLeadingOnly();
528 else ana->SwitchOffLeadingOnly();
529 if(!simu) ana->SwitchOnFillPileUpHistograms();
531 //Do settings for main isolation cut class
532 AliIsolationCut * ic = ana->GetIsolationCut();
535 printf("\t *** Set: R = %2.2f, Threshold %2.2f, Method %d, Neutral/Charged option %d ***\n",cone,pth,thresType,partInCone);
539 ic->SetConeSize(cone);
541 ic->SetPtFraction (0.1);
542 ic->SetPtThreshold (pth);
543 ic->SetSumPtThreshold(pth);
545 ic->SetParticleTypeInCone(partInCone);
547 ic->SetICMethod(thresType);
550 //Do or not do isolation with previously produced AODs.
551 //No effect if use of SwitchOnSeveralIsolation()
552 ana->SwitchOffReIsolation();
557 ic->SetConeSize(1.); // Take all for first iteration
558 ic->SetPtThreshold(100);// Take all for first iteration
559 ana->SwitchOnSeveralIsolation() ;
560 ana->SetAODObjArrayName(Form("MultiIC%sTM%d",particle.Data(),tm));
563 ana->SetNPtThresFrac(4);
564 ana->SetConeSizes(0,0.3); ana->SetConeSizes(1,0.4);
565 ana->SetConeSizes(2,0.5); ana->SetConeSizes(3,0.6);
566 ana->SetPtThresholds(0, 0.5); ana->SetPtThresholds(1, 1); ana->SetPtThresholds(2, 2);
567 ana->SetPtFractions (0, 0.05) ; ana->SetPtFractions (1, 0.1); ana->SetPtFractions (2, 0.2) ; ana->SetPtFractions (3, 0.3) ;
568 ana->SetSumPtThresholds(0, 1) ; ana->SetSumPtThresholds(1, 3) ; ana->SetSumPtThresholds(2, 5); ana->SetSumPtThresholds(3, 7) ;
570 ana->SwitchOffTMHistoFill();
571 ana->SwitchOffSSHistoFill();
574 ana->SwitchOffSeveralIsolation() ;
576 AliCaloPID* caloPID = ana->GetCaloPID();
577 caloPID->SetEMCALDEtaCut(0.02);
578 caloPID->SetEMCALDPhiCut(0.030);
580 //Set Histograms name tag, bins and ranges
582 if(!multi)ana->AddToHistogramsName(Form("AnaIsol%s_TM%d_",particle.Data(),tm));
583 else ana->AddToHistogramsName(Form("AnaMultiIsol%s_TM%d_",particle.Data(),tm));
585 SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
587 if(particle=="Hadron" || particle.Contains("CTS"))
589 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
590 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
593 ConfigureMC(ana,simu);
595 if(print) ic ->Print("");
596 if(print) ana->Print("");
603 //________________________________________
604 AliAnaCalorimeterQA* ConfigureQAAnalysis(TString calorimeter = "EMCAL", Bool_t simu = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
607 AliAnaCalorimeterQA *ana = new AliAnaCalorimeterQA();
608 ana->SetDebug(debug); //10 for lots of messages
609 ana->SetCalorimeter(calorimeter);
611 ana->SetTimeCut(-1e10,1e10); // Open time cut
612 ana->SwitchOffCorrelation();
614 // Study exotic clusters PHOS and EMCAL
615 ana->SwitchOffStudyBadClusters() ;
618 ana->SwitchOffFiducialCut();
619 ana->SwitchOffFillAllTH3Histogram();
620 ana->SwitchOffFillAllPositionHistogram();
621 ana->SwitchOffFillAllPositionHistogram2();
622 ana->SwitchOffStudyBadClusters();
623 ana->SwitchOffStudyClustersAsymmetry();
624 ana->SwitchOffStudyWeight();
625 ana->SwitchOnFillAllTrackMatchingHistogram();
626 ana->SwitchOnFillAllCellTimeHisto() ;
629 ana->AddToHistogramsName("QA_"); //Begining of histograms name
630 SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
632 ConfigureMC(ana,simu);
634 if(print) ana->Print("");
640 //___________________________________________________________________________________
641 AliAnaChargedParticles* ConfigureChargedAnalysis(Bool_t simulation, Int_t debugLevel)
644 AliAnaChargedParticles *ana = new AliAnaChargedParticles();
645 ana->SetDebug(debugLevel); //10 for lots of messages
650 ana->SwitchOnFiducialCut();
651 ana->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ; //more restrictive cut in reader and after in isolation
653 ana->SwitchOffFillVertexBC0Histograms() ;
654 //if(!simulation) ana->SwitchOnFillPileUpHistograms();
656 // Input / output delta AOD settings
658 ana->SetOutputAODName(Form("Hadron%s",kAnaIsoPhotonName.Data()));
659 ana->SetOutputAODClassName("AliAODPWG4Particle");
660 ana->SetInputAODName(Form("Hadron%s",kAnaIsoPhotonName.Data()));
662 //Set Histograms name tag, bins and ranges
664 ana->AddToHistogramsName("AnaHadrons_");
665 SetHistoRangeAndNBins(ana->GetHistogramRanges(),""); // see method below
667 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
668 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
670 if(debugLevel > 0) ana->Print("");
676 AliAnaRandomTrigger* ConfigureRandomTriggerAnalysis(TString detector = "")
679 AliAnaRandomTrigger *ana = new AliAnaRandomTrigger();
680 ana->SetDebug(kDebug); //10 for lots of messages
682 if(detector=="") detector = kCalorimeter;
683 ana->SetDetector(detector);
689 if (detector=="EMCAL")
691 ana->SetEtaCut(-0.27,0.27);
692 ana->SetPhiCut(103*TMath::DegToRad(), 157*TMath::DegToRad());
694 else if(detector=="PHOS")
696 ana->SetEtaCut(-0.13,0.13);
697 ana->SetPhiCut(260*TMath::DegToRad(), 320*TMath::DegToRad());
699 else if(detector=="CTS")
701 ana->SetEtaCut(-0.9,0.9);
702 ana->SetPhiCut(0, TMath::TwoPi());
706 if(!kData.Contains("delta"))
708 ana->SetOutputAODName(Form("RandomTrigger%s%s",detector.Data(),kAnaIsoPhotonName.Data()));
709 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
712 ana->SetInputAODName(Form("RandomTrigger%s%s",detector.Data(),kAnaIsoPhotonName.Data()));
714 printf("Set RandomTrigger%s%s\n",detector.Data(),kAnaIsoPhotonName.Data());
716 //Set Histograms name tag, bins and ranges
718 ana->AddToHistogramsName(Form("AnaRandomTrigger%s_",detector.Data()));
720 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
724 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
725 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
728 if(kPrint) ana->Print("");
736 //________________________________________________________
737 void ConfigureMC(AliAnaCaloTrackCorrBaseClass* ana, Bool_t simu = kFALSE)
739 if(simu) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
740 else ana->SwitchOffDataMC() ;
742 //Set here generator name, default pythia
743 //ana->GetMCAnalysisUtils()->SetMCGenerator("");
746 //________________________________________________________
747 void SetHistoRangeAndNBins (AliHistogramRanges* histoRanges, TString calorimeter = "EMCAL")
749 // Set common bins for all analysis and MC histograms filling
751 histoRanges->SetHistoPtRangeAndNBins(0., 100., 200) ; // Energy and pt histograms
753 if(calorimeter=="EMCAL")
756 histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
757 histoRanges->SetHistoXRangeAndNBins(-600,90,200); // QA
758 histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
760 histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
764 histoRanges->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ;
765 histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
768 histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
770 // Invariant mass histoRangeslysis
771 histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
772 histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
774 // check if time calibration is on
775 histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
776 histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
778 // track-cluster residuals
779 histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
780 histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
781 histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
783 // QA, electron, charged
784 histoRanges->SetHistoPOverERangeAndNBins(0, 2.5 ,500);
785 histoRanges->SetHistodEdxRangeAndNBins (0.,250.0,500);
788 histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
789 histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
790 histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
791 histoRanges->SetHistoNClusterCellRangeAndNBins(0,50,50);
792 histoRanges->SetHistoZRangeAndNBins(-400,400,200);
793 histoRanges->SetHistoRRangeAndNBins(400,450,25);
794 histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
795 histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
796 histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
799 histoRanges->SetHistoPtInConeRangeAndNBins(0, 50 , 250);
800 histoRanges->SetHistoPtSumRangeAndNBins (0, 100, 250);
804 //_____________________________
805 UInt_t SetTriggerMaskFromName(TString trigger)
809 printf("CaloTrackCorr trigger EMC7\n");
810 return AliVEvent::kEMC7;
812 else if (trigger=="INT7")
814 printf("CaloTrackCorr trigger INT7\n");
815 return AliVEvent::kINT7;
817 else if(trigger=="EMC1")
819 printf("CaloTrackCorr trigger EMC1\n");
820 return AliVEvent::kEMC1;
822 else if(trigger=="MB")
824 printf("CaloTrackCorr trigger MB\n");
825 return AliVEvent::kMB;
827 else if(trigger=="PHOS")
829 printf("CaloTrackCorr trigger PHOS\n");
830 return AliVEvent::kPHI7;
832 else if(trigger=="PHOSPb")
834 printf("CaloTrackCorr trigger PHOSPb\n");
835 return AliVEvent::kPHOSPb;
837 else if(trigger=="AnyINT")
839 printf("CaloTrackCorr trigger AnyINT\n");
840 return AliVEvent::kAnyINT;
842 else if(trigger=="INT")
844 printf("CaloTrackCorr trigger AnyINT\n");
845 return AliVEvent::kAny;
847 else if(trigger=="EMCEGA")
849 printf("CaloTrackCorr trigger EMC Gamma\n");
850 return AliVEvent::kEMCEGA;
852 else if(trigger=="EMCEJE")
854 printf("CaloTrackCorr trigger EMC Jet\n");
855 return AliVEvent::kEMCEJE;
857 else if(trigger=="Central")
859 printf("CaloTrackCorr trigger Central\n");
860 return (AliVEvent::kCentral | AliVEvent::kMB);
862 else if(trigger=="CentralEGA")
864 printf("CaloTrackCorr trigger Central+EMCEGA\n");
865 return (AliVEvent::kCentral | AliVEvent::kEMCEGA);
867 else if(trigger=="SemiCentral")
869 printf("CaloTrackCorr trigger SemiCentral\n");
870 return (AliVEvent::kSemiCentral | AliVEvent::kMB);
872 else if(trigger=="SemiOrCentral")
874 printf("CaloTrackCorr trigger SemiCentral Or Central\n");
875 return (AliVEvent::kSemiCentral | AliVEvent::kCentral | AliVEvent::kMB);