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 Bool_t trackTcut = kFALSE,
27 const Int_t disttobad = 2,
28 const Int_t nlmMax = 20,
29 const Bool_t qaan = kFALSE,
30 const Bool_t primvtx = kTRUE,
31 const Bool_t notrackcut = kTRUE,
32 const Bool_t rdmtrigger = kFALSE,
33 const TString tag = "",
34 const Int_t debug = -1,
35 const Bool_t print = kFALSE
39 kCalorimeter = calorimeter ;
41 // Creates a CaloTrackCorr task, configures it and adds it to the analysis manager.
43 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",
44 cone, pth, timecut , nlmMax, calorimeter.Data(),simu, exotic, nonlin, trigger.Data(), tm, qaan, debug, minCen, maxCen );
46 // Get the pointer to the existing analysis manager via the static access method.
48 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
51 ::Error("AddTask", "No analysis manager to connect to.");
55 // Check the analysis type using the event handlers connected to the analysis manager.
57 if (!mgr->GetInputEventHandler())
59 ::Error("AddTask", "This task requires an input event handler");
63 // Make sure the B field is enabled for track selection, some cuts need it
64 ((AliInputEventHandler*)mgr->GetInputEventHandler())->SetNeedField(kTRUE);
66 Bool_t useKinematics = kFALSE;
67 useKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
69 // Name for containers
72 kAnaIsoPhotonName = Form("%s_Trig%s_TM%d_%1.3f_dB%d_R%1.1f_Pt%1.1f_%s",calorimeter.Data(), trigger.Data(),tm,deltaphicut,disttobad,cone,pth,tag.Data());
74 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);
76 if(maxCen>=0) kAnaIsoPhotonName+=Form("Cen%d_%d",minCen,maxCen);
78 printf("<<<< NAME: %s >>>>>\n",kAnaIsoPhotonName.Data());
80 // #### Configure analysis ####
82 AliAnaCaloTrackCorrMaker * maker = new AliAnaCaloTrackCorrMaker();
84 //maker->SetScaleFactor(scaleFactor); // for MC, negative (not scaled) by default
86 // General frame setting and configuration
87 maker->SetReader (ConfigureReader (mgr->GetInputEventHandler()->GetDataType(),useKinematics,simu,
88 calorimeter,nonlin, timecut, primvtx, notrackcut,tmin,tmax,trackTcut,minCen, maxCen, debug,print));
89 maker->SetCaloUtils(ConfigureCaloUtils(nonlin,exotic,simu,timecut,debug,print));
91 // Analysis tasks setting and configuration
92 Int_t n = 0;//Analysis number, order is important
95 Int_t partInCone = AliIsolationCut::kNeutralAndCharged; // kOnlyCharged;
96 // Int_t thresType = AliIsolationCut::kPtThresIC;// AliIsolationCut::kSumPtFracIC ;
97 Int_t thresType = AliIsolationCut::kSumPtIC ;
102 maker->AddAnalysis(ConfigurePhotonAnalysis(calorimeter,tm,deltaphicut,deltaetacut,disttobad,nlmMax,simu,debug,print), n++); // Photon cluster selection
104 // Isolation analysis
105 maker->AddAnalysis(ConfigureIsolationAnalysis(calorimeter,"Photon", partInCone,thresType,cone, pth,tm,leading,kFALSE,simu,debug,print), n++); // Photon isolation
109 maker->AddAnalysis(ConfigureRandomTriggerAnalysis(), n++);
110 maker->AddAnalysis(ConfigureIsolationAnalysis(calorimeter,Form("RandomTrigger%s",kCalorimeter.Data()), partInCone,thresType,cone, pth,tm,leading,kFALSE,simu,debug,print), n++);// Ghost trigger isolation
114 // QA histograms on clusters or tracks
117 maker->AddAnalysis(ConfigureQAAnalysis(calorimeter,simu,debug,print),n++);
118 maker->AddAnalysis(ConfigureChargedAnalysis(simu,debug), n++); // charged tracks plots
121 maker->SetAnaDebug(debug) ;
122 maker->SwitchOnHistogramsMaker() ;
123 maker->SwitchOnAODsMaker() ;
125 if(print) maker->Print("");
127 maker->SwitchOffDataControlHistograms();
129 printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, calorimeter.Data());
133 AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("CaloTrackCorr%s",kAnaIsoPhotonName.Data()));
134 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
135 task->SetDebugLevel(debug);
136 task->SetBranches("ESD:AliESDRun.,AliESDHeader");
137 task->SetAnalysisMaker(maker);
142 TString outputfile = AliAnalysisManager::GetCommonFileName();
144 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(kAnaIsoPhotonName, TList::Class(),
145 AliAnalysisManager::kOutputContainer,
146 Form("%s",outputfile.Data()));
148 AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Param_%s",kAnaIsoPhotonName.Data()), TList::Class(),
149 AliAnalysisManager::kParamContainer,
150 "AnalysisParameters.root");
152 // Create ONLY the output containers for the data produced by the task.
153 // Get and connect other common input/output containers via the manager as below
154 //==============================================================================
155 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
156 // AOD output slot will be used in a different way in future
157 mgr->ConnectOutput (task, 1, cout_pc);
158 mgr->ConnectOutput (task, 2, cout_cuts);
160 // Set the trigger selection
161 UInt_t mask = SetTriggerMaskFromName(trigger);
162 task->SelectCollisionCandidates(mask);
167 //____________________________________
168 AliCaloTrackReader * ConfigureReader(TString inputDataType = "AOD", Bool_t useKinematics = kFALSE, Bool_t simu = kFALSE,
169 TString calorimeter = "EMCAL", Bool_t nonlin = kTRUE, Bool_t timecut = kFALSE,
170 Bool_t primvtx = kFALSE, Bool_t notrackcut = kFALSE, Float_t tmin, Float_t tmax,
171 Bool_t trackTcut = kFALSE, Float_t minCen = -1, Float_t maxCen = -1,
172 Int_t debug = -1, Bool_t print = kFALSE)
174 // Init reader settings: event selection, basic cluster track cuts, etc
178 if (!useKinematics && inputDataType=="AOD") useKinematics = kTRUE; //AOD primary should be available ...
181 cout<<"********* ACCESS KINE? "<<useKinematics<< endl;
183 AliCaloTrackReader * reader = 0;
184 if (inputDataType=="AOD") reader = new AliCaloTrackAODReader();
185 else if(inputDataType=="ESD") reader = new AliCaloTrackESDReader();
186 else printf("AliCaloTrackReader::ConfigureReader() - Data not known inputData=%s\n",inputDataType.Data());
188 reader->SetDebug(debug);//10 for lots of messages
190 reader->SwitchOffTriggerPatchMatching();
191 reader->SwitchOffBadTriggerEventsRemoval();
193 reader->SwitchOffWriteDeltaAOD() ;
198 if(inputDataType == "ESD")
200 reader->SwitchOnStack();
201 reader->SwitchOffAODMCParticles();
203 else if(inputDataType == "AOD")
205 reader->SwitchOffStack();
206 reader->SwitchOnAODMCParticles();
210 //------------------------
211 // Detector input filling
212 //------------------------
214 //Min cluster/track E
215 reader->SetEMCALEMin(0.3);
216 reader->SetEMCALEMax(1000);
217 reader->SetPHOSEMin(0.3);
218 reader->SetPHOSEMax(1000);
219 reader->SetCTSPtMin(0.2);
220 reader->SetCTSPtMax(1000);
225 reader->SwitchOffUseTrackTimeCut();
226 reader->SwitchOffUseParametrizedTimeCut();
227 reader->SwitchOffUseEMCALTimeCut();
228 reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
232 reader->SwitchOffUseParametrizedTimeCut();
236 printf("Set time cut \n");
237 reader->SwitchOnUseEMCALTimeCut();
239 reader->SetEMCALTimeCut(tmin,tmax); // default is -25ns-20ns
243 printf("Off time cuts time cut \n");
244 reader->SwitchOffUseEMCALTimeCut();
246 reader->SetEMCALTimeCut(-1.e6,1.e6);
250 reader->SwitchOffFiducialCut();
251 reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
254 reader->SwitchOnCTS();
257 reader->SwitchOffRecalculateVertexBC();
258 reader->SwitchOffVertexBCEventSelection();
261 reader->SwitchOnUseTrackTimeCut();
263 reader->SwitchOffUseTrackTimeCut();
265 reader->SetTrackTimeCut(0,50);
267 reader->SwitchOffUseTrackDCACut();
268 //reader->SetTrackDCACut(0,0.0105);
269 //reader->SetTrackDCACut(1,0.035);
270 //reader->SetTrackDCACut(2,1.1);
272 if(inputDataType=="ESD")
274 gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");
275 //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
276 //reader->SetTrackCuts(esdTrackCuts);
277 //reader->SwitchOnConstrainTrackToVertex();
282 AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
283 reader->SetTrackCuts(esdTrackCuts);
284 AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
285 reader->SetTrackComplementaryCuts(esdTrackCuts2);
290 // AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001006);
291 // reader->SetTrackCuts(esdTrackCuts);
292 // AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10041006);
293 // reader->SetTrackComplementaryCuts(esdTrackCuts2);
296 else if(inputDataType=="AOD")
298 //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid
299 reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
300 reader->SetTrackStatus(AliVTrack::kITSrefit);
301 //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
306 reader->SwitchOffClusterRecalculation();
310 if(!nonlin) reader->SwitchOffClusterELinearityCorrection();
311 else reader->SwitchOnClusterELinearityCorrection();
313 if(calorimeter == "EMCAL") {
314 reader->SwitchOnEMCALCells();
315 reader->SwitchOnEMCAL();
317 if(calorimeter == "PHOS") { // Should be on if QA is activated with correlation on
318 reader->SwitchOffPHOSCells();
319 reader->SwitchOffPHOS();
326 //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
328 // reader->RejectFastClusterEvents() ;
330 reader->SwitchOnEventTriggerAtSE();
332 reader->SetZvertexCut(10.); // Open cut
334 reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
336 reader->SwitchOffPrimaryVertexSelection();
338 reader->SwitchOnRejectNoTrackEvents();
340 reader->SwitchOffRejectNoTrackEvents();
342 reader->SwitchOffPileUpEventRejection(); // remove pileup
343 reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
348 reader->SetCentralityClass("V0M");
349 reader->SetCentralityOpt(100); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
350 reader->SetCentralityBin(minCen,maxCen); // Accept all events, if not select range
352 // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
353 reader->SetEventPlaneMethod("V0");
356 if(print) reader->Print("");
362 //_______________________________________
363 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)
366 AliCalorimeterUtils *cu = new AliCalorimeterUtils;
369 // Remove clusters close to borders, at least max energy cell is 1 cell away
370 cu->SetNumberOfCellsFromEMCALBorder(0);//this was originally set to one
371 cu->SetNumberOfCellsFromPHOSBorder(2);
373 cu->SwitchOffRecalculateClusterTrackMatching();
375 cu->SwitchOffBadChannelsRemoval() ;
380 cu->SwitchOnLoadOwnEMCALGeometryMatrices();
382 /* AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
384 cu->SwitchOffRecalibration();
385 cu->SwitchOffRunDepCorrection();
387 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/ConfigureEMCALRecoUtils.C");
388 ConfigureEMCALRecoUtils(recou,
394 kFALSE); // time calib
395 if(timecut) recou->SetExoticCellDiffTimeCut(50.);
399 printf("ConfigureCaloUtils() - Apply non linearity to EMCAL\n");
400 cu->SwitchOnCorrectClusterLinearity();
403 printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
404 printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
406 cu->SetNumberOfSuperModulesUsed(10);
408 if(print) cu->Print("");
414 //_____________________________________
415 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)
418 AliAnaPhoton *ana = new AliAnaPhoton();
419 ana->SetDebug(debug); //10 for lots of messages
421 // cluster selection cuts
423 ana->SwitchOffFiducialCut();
425 ana->SetCalorimeter(calorimeter);
427 if(calorimeter == "PHOS")
429 ana->SetNCellCut(2);// At least 3 cells
431 ana->SetMinDistanceToBadChannel(2, 4, 5);
432 ana->SetTimeCut(-1e10,1e10); // open cut
436 ana->SetNCellCut(1);// At least 2 cells
437 ana->SetMinEnergy(0.3); // avoid mip peak at E = 260 MeV
438 ana->SetMaxEnergy(1000);
439 // ana->SetTimeCut(-1e10,1e10); // open cut, usual time window of [425-825] ns if time recalibration is off
440 // restrict to less than 100 ns when time calibration is on
441 ana->SetMinDistanceToBadChannel(disttobad, 4, 6);
443 // NLM cut, used in all, exclude clusters with more than 2 maxima
444 // Not needed if M02 cut is already strong or clusterizer V2
445 ana->SetNLMCut(1, nlmMax) ;
450 ana->SwitchOnTrackMatchRejection() ;
451 ana->SwitchOffTMHistoFill() ;
455 ana->SwitchOffTrackMatchRejection() ;
456 ana->SwitchOnTMHistoFill() ;
459 //PID cuts (shower shape)
460 ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
461 AliCaloPID* caloPID = ana->GetCaloPID();
462 //Not used in bayesian
465 caloPID->SetEMCALLambda0CutMax(1000.);
466 caloPID->SetEMCALLambda0CutMin(0.);
468 // caloPID->SetEMCALDEtaCut(0.025);
469 // caloPID->SetEMCALDPhiCut(0.030);
470 caloPID->SetEMCALDEtaCut(deltaetacut);
471 caloPID->SetEMCALDPhiCut(deltaphicut);
473 ana->SwitchOnFillShowerShapeHistograms(); // Filled before photon shower shape selection
474 if(!simu) ana->SwitchOnFillPileUpHistograms();
476 // Input / output delta AOD settings
478 ana->SetOutputAODName(Form("Photon%s",kAnaIsoPhotonName.Data()));
479 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
481 //Set Histograms name tag, bins and ranges
483 ana->AddToHistogramsName(Form("AnaPhoton_TM%d_",tm));
484 SetHistoRangeAndNBins(ana->GetHistogramRanges(), calorimeter); // see method below
486 // Number of particle type MC histograms
487 ana->FillNOriginHistograms(20);
488 ana->FillNPrimaryHistograms(20);
490 ConfigureMC(ana,simu);
492 if(print) ana->Print("");
498 //____________________________________________________________________________________________________
499 AliAnaParticleIsolation* ConfigureIsolationAnalysis(TString calorimeter = "EMCAL", TString particle="Photon",
500 Int_t partInCone = AliIsolationCut::kOnlyCharged,
501 Int_t thresType = AliIsolationCut::kSumPtFracIC,
505 Bool_t leading = kTRUE,
506 Bool_t multi = kFALSE, Bool_t simu = kFALSE,
507 Int_t debug = -1, Bool_t print = kFALSE)
510 AliAnaParticleIsolation *ana = new AliAnaParticleIsolation();
511 ana->SetDebug(debug);
513 ana->SwitchOnFiducialCut();
514 //Avoid borders of EMCal
515 if(calorimeter=="EMCAL")
517 //ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
518 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.27, 103, 157) ;
523 // Input / output delta AOD settings
525 ana->SetInputAODName(Form("%s%s",particle.Data(),kAnaIsoPhotonName.Data()));
526 ana->SetAODObjArrayName(Form("IC%s_%s",particle.Data(),kAnaIsoPhotonName.Data()));
528 ana->SetCalorimeter(calorimeter);
530 if(!tm) ana->SwitchOnTMHistoFill();
531 else ana->SwitchOffTMHistoFill();
532 // ana->SwitchOnTMHistoFill();
534 // ana->SwitchOffSSHistoFill();
535 // if(!kSimulation) ana->SwitchOnFillPileUpHistograms();
536 ana->SwitchOnSSHistoFill();
537 if(leading) ana->SwitchOnLeadingOnly();
538 else ana->SwitchOffLeadingOnly();
539 if(!simu) ana->SwitchOnFillPileUpHistograms();
541 //Do settings for main isolation cut class
542 AliIsolationCut * ic = ana->GetIsolationCut();
545 printf("\t *** Set: R = %2.2f, Threshold %2.2f, Method %d, Neutral/Charged option %d ***\n",cone,pth,thresType,partInCone);
549 ic->SetConeSize(cone);
551 ic->SetPtFraction (0.1);
552 ic->SetPtThreshold (pth);
553 ic->SetSumPtThreshold(pth);
555 ic->SetParticleTypeInCone(partInCone);
557 ic->SetICMethod(thresType);
560 //Do or not do isolation with previously produced AODs.
561 //No effect if use of SwitchOnSeveralIsolation()
562 ana->SwitchOffReIsolation();
567 ic->SetConeSize(1.); // Take all for first iteration
568 ic->SetPtThreshold(100);// Take all for first iteration
569 ana->SwitchOnSeveralIsolation() ;
570 ana->SetAODObjArrayName(Form("MultiIC%sTM%d",particle.Data(),tm));
573 ana->SetNPtThresFrac(4);
574 ana->SetConeSizes(0,0.3); ana->SetConeSizes(1,0.4);
575 ana->SetConeSizes(2,0.5); ana->SetConeSizes(3,0.6);
576 ana->SetPtThresholds(0, 0.5); ana->SetPtThresholds(1, 1); ana->SetPtThresholds(2, 2);
577 ana->SetPtFractions (0, 0.05) ; ana->SetPtFractions (1, 0.1); ana->SetPtFractions (2, 0.2) ; ana->SetPtFractions (3, 0.3) ;
578 ana->SetSumPtThresholds(0, 1) ; ana->SetSumPtThresholds(1, 3) ; ana->SetSumPtThresholds(2, 5); ana->SetSumPtThresholds(3, 7) ;
580 ana->SwitchOffTMHistoFill();
581 ana->SwitchOffSSHistoFill();
584 ana->SwitchOffSeveralIsolation() ;
586 AliCaloPID* caloPID = ana->GetCaloPID();
587 caloPID->SetEMCALDEtaCut(0.02);
588 caloPID->SetEMCALDPhiCut(0.030);
590 //Set Histograms name tag, bins and ranges
592 if(!multi)ana->AddToHistogramsName(Form("AnaIsol%s_TM%d_",particle.Data(),tm));
593 else ana->AddToHistogramsName(Form("AnaMultiIsol%s_TM%d_",particle.Data(),tm));
595 SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
597 if(particle=="Hadron" || particle.Contains("CTS"))
599 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
600 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
603 ConfigureMC(ana,simu);
605 if(print) ic ->Print("");
606 if(print) ana->Print("");
613 //________________________________________
614 AliAnaCalorimeterQA* ConfigureQAAnalysis(TString calorimeter = "EMCAL", Bool_t simu = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
617 AliAnaCalorimeterQA *ana = new AliAnaCalorimeterQA();
618 ana->SetDebug(debug); //10 for lots of messages
619 ana->SetCalorimeter(calorimeter);
621 ana->SetTimeCut(-1e10,1e10); // Open time cut
622 ana->SwitchOffCorrelation();
624 // Study exotic clusters PHOS and EMCAL
625 ana->SwitchOffStudyBadClusters() ;
628 ana->SwitchOffFiducialCut();
629 ana->SwitchOffFillAllTH3Histogram();
630 ana->SwitchOffFillAllPositionHistogram();
631 ana->SwitchOffFillAllPositionHistogram2();
632 ana->SwitchOffStudyBadClusters();
633 ana->SwitchOffStudyClustersAsymmetry();
634 ana->SwitchOffStudyWeight();
635 ana->SwitchOnFillAllTrackMatchingHistogram();
636 ana->SwitchOnFillAllCellTimeHisto() ;
639 ana->AddToHistogramsName("QA_"); //Begining of histograms name
640 SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
642 ConfigureMC(ana,simu);
644 if(print) ana->Print("");
650 //___________________________________________________________________________________
651 AliAnaChargedParticles* ConfigureChargedAnalysis(Bool_t simulation, Int_t debugLevel)
654 AliAnaChargedParticles *ana = new AliAnaChargedParticles();
655 ana->SetDebug(debugLevel); //10 for lots of messages
660 ana->SwitchOnFiducialCut();
661 ana->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ; //more restrictive cut in reader and after in isolation
663 ana->SwitchOffFillVertexBC0Histograms() ;
664 //if(!simulation) ana->SwitchOnFillPileUpHistograms();
666 // Input / output delta AOD settings
668 ana->SetOutputAODName(Form("Hadron%s",kAnaIsoPhotonName.Data()));
669 ana->SetOutputAODClassName("AliAODPWG4Particle");
670 ana->SetInputAODName(Form("Hadron%s",kAnaIsoPhotonName.Data()));
672 //Set Histograms name tag, bins and ranges
674 ana->AddToHistogramsName("AnaHadrons_");
675 SetHistoRangeAndNBins(ana->GetHistogramRanges(),""); // see method below
677 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
678 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
680 if(debugLevel > 0) ana->Print("");
686 AliAnaRandomTrigger* ConfigureRandomTriggerAnalysis(TString detector = "")
689 AliAnaRandomTrigger *ana = new AliAnaRandomTrigger();
690 ana->SetDebug(kDebug); //10 for lots of messages
692 if(detector=="") detector = kCalorimeter;
693 ana->SetDetector(detector);
699 if (detector=="EMCAL")
701 ana->SetEtaCut(-0.27,0.27);
702 ana->SetPhiCut(103*TMath::DegToRad(), 157*TMath::DegToRad());
704 else if(detector=="PHOS")
706 ana->SetEtaCut(-0.13,0.13);
707 ana->SetPhiCut(260*TMath::DegToRad(), 320*TMath::DegToRad());
709 else if(detector=="CTS")
711 ana->SetEtaCut(-0.9,0.9);
712 ana->SetPhiCut(0, TMath::TwoPi());
716 if(!kData.Contains("delta"))
718 ana->SetOutputAODName(Form("RandomTrigger%s%s",detector.Data(),kAnaIsoPhotonName.Data()));
719 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
722 ana->SetInputAODName(Form("RandomTrigger%s%s",detector.Data(),kAnaIsoPhotonName.Data()));
724 printf("Set RandomTrigger%s%s\n",detector.Data(),kAnaIsoPhotonName.Data());
726 //Set Histograms name tag, bins and ranges
728 ana->AddToHistogramsName(Form("AnaRandomTrigger%s_",detector.Data()));
730 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
734 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
735 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
738 if(kPrint) ana->Print("");
746 //________________________________________________________
747 void ConfigureMC(AliAnaCaloTrackCorrBaseClass* ana, Bool_t simu = kFALSE)
749 if(simu) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
750 else ana->SwitchOffDataMC() ;
752 //Set here generator name, default pythia
753 //ana->GetMCAnalysisUtils()->SetMCGenerator("");
756 //________________________________________________________
757 void SetHistoRangeAndNBins (AliHistogramRanges* histoRanges, TString calorimeter = "EMCAL")
759 // Set common bins for all analysis and MC histograms filling
761 histoRanges->SetHistoPtRangeAndNBins(0., 100., 200) ; // Energy and pt histograms
763 if(calorimeter=="EMCAL")
766 histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
767 histoRanges->SetHistoXRangeAndNBins(-600,90,200); // QA
768 histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
770 histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
774 histoRanges->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ;
775 histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
778 histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
780 // Invariant mass histoRangeslysis
781 histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
782 histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
784 // check if time calibration is on
785 histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
786 histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
788 // track-cluster residuals
789 histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
790 histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
791 histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
793 // QA, electron, charged
794 histoRanges->SetHistoPOverERangeAndNBins(0, 2.5 ,500);
795 histoRanges->SetHistodEdxRangeAndNBins (0.,250.0,500);
798 histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
799 histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
800 histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
801 histoRanges->SetHistoNClusterCellRangeAndNBins(0,50,50);
802 histoRanges->SetHistoZRangeAndNBins(-400,400,200);
803 histoRanges->SetHistoRRangeAndNBins(400,450,25);
804 histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
805 histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
806 histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
809 histoRanges->SetHistoPtInConeRangeAndNBins(0, 50 , 250);
810 histoRanges->SetHistoPtSumRangeAndNBins (0, 100, 250);
814 //_____________________________
815 UInt_t SetTriggerMaskFromName(TString trigger)
819 printf("CaloTrackCorr trigger EMC7\n");
820 return AliVEvent::kEMC7;
822 else if (trigger=="INT7")
824 printf("CaloTrackCorr trigger INT7\n");
825 return AliVEvent::kINT7;
827 else if(trigger=="EMC1")
829 printf("CaloTrackCorr trigger EMC1\n");
830 return AliVEvent::kEMC1;
832 else if(trigger=="MB")
834 printf("CaloTrackCorr trigger MB\n");
835 return AliVEvent::kMB;
837 else if(trigger=="PHOS")
839 printf("CaloTrackCorr trigger PHOS\n");
840 return AliVEvent::kPHI7;
842 else if(trigger=="PHOSPb")
844 printf("CaloTrackCorr trigger PHOSPb\n");
845 return AliVEvent::kPHOSPb;
847 else if(trigger=="AnyINT")
849 printf("CaloTrackCorr trigger AnyINT\n");
850 return AliVEvent::kAnyINT;
852 else if(trigger=="INT")
854 printf("CaloTrackCorr trigger AnyINT\n");
855 return AliVEvent::kAny;
857 else if(trigger=="EMCEGA")
859 printf("CaloTrackCorr trigger EMC Gamma\n");
860 return AliVEvent::kEMCEGA;
862 else if(trigger=="EMCEJE")
864 printf("CaloTrackCorr trigger EMC Jet\n");
865 return AliVEvent::kEMCEJE;
867 else if(trigger=="Central")
869 printf("CaloTrackCorr trigger Central\n");
870 return (AliVEvent::kCentral | AliVEvent::kMB);
872 else if(trigger=="CentralEGA")
874 printf("CaloTrackCorr trigger Central+EMCEGA\n");
875 return (AliVEvent::kCentral | AliVEvent::kEMCEGA);
877 else if(trigger=="SemiCentral")
879 printf("CaloTrackCorr trigger SemiCentral\n");
880 return (AliVEvent::kSemiCentral | AliVEvent::kMB);
882 else if(trigger=="SemiOrCentral")
884 printf("CaloTrackCorr trigger SemiCentral Or Central\n");
885 return (AliVEvent::kSemiCentral | AliVEvent::kCentral | AliVEvent::kMB);