2 Bool_t kPrint = kFALSE;
3 Bool_t kSimulation = kFALSE;
4 Bool_t kUseKinematics = kFALSE;
5 Bool_t kOutputAOD = kFALSE;
8 TString kCollisions = "pp";
9 TString kTrig = "EMC7" ;
10 TString kClusterArray = "";
11 TString kData = "ESD";
12 TString kInputDataType = "ESD";
13 TString kCalorimeter = "EMCAL";
15 AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(
16 const TString data = "AOD",
17 const TString calorimeter = "EMCAL",
18 const Bool_t printSettings = kFALSE,
19 const Bool_t simulation = kFALSE,
20 const Bool_t outputAOD = kFALSE,
21 const TString outputfile = "",
22 const Int_t year = 2010,
24 const TString col = "pp",
25 const TString trigger = "MB",
26 const TString clustersArray = "V1"
29 // Creates a PartCorr task, configures it and adds it to the analysis manager.
31 kPrint = printSettings;
32 kSimulation = simulation;
37 kClusterArray = clustersArray;
39 kCalorimeter = calorimeter;
40 kOutputAOD = outputAOD;
42 // Get the pointer to the existing analysis manager via the static access method.
44 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
46 ::Error("AddTask", "No analysis manager to connect to.");
50 // Check the analysis type using the event handlers connected to the analysis manager.
52 if (!mgr->GetInputEventHandler()) {
53 ::Error("AddTask", "This task requires an input event handler");
56 kInputDataType = "AOD";
57 if(!kData.Contains("delta"))
58 kInputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
61 kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
62 if (!kUseKinematics && data=="AOD" && kInputDataType != "ESD") kUseKinematics = kTRUE; //AOD primary should be available ...
65 cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl;
67 // #### Configure analysis ####
69 AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker();
71 // General frame setting and configuration
72 maker->SetReader (ConfigureReader() );
73 maker->SetCaloUtils(ConfigureCaloUtils());
75 // Analysis tasks setting and configuration
76 Int_t n = 0;//Analysis number, order is important
78 maker->AddAnalysis(ConfigureQAAnalysis() , n++);
81 Int_t partInCone = AliIsolationCut::kNeutralAndCharged;//kOnlyCharged;
82 Int_t thresType = AliIsolationCut::kSumPtFracIC; // kPtThresIC;
84 if(kClusterArray=="" && kCalorimeter!="PHOS")
86 //Trigger on tracks, do only once, tracks do not depend on clusterizer
87 maker->AddAnalysis(ConfigureChargedAnalysis(), n++); // track selection
88 maker->AddAnalysis(ConfigureIsolationAnalysis("Hadron",partInCone,thresType), n++); // track isolation
89 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Hadron",kFALSE), n++); // track-track correlation
90 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Hadron",kTRUE) , n++); // Isolated track-track correlation
94 maker->AddAnalysis(ConfigurePhotonAnalysis(), n++); // Photon cluster selection
95 maker->AddAnalysis(ConfigurePi0Analysis() , n++); // Pi0 invariant mass analysis
96 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Pi0", AliAnaPi0EbE::kIMCalo), n++); // Pi0 event by event selection, and photon tagging from decay
97 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Eta", AliAnaPi0EbE::kIMCalo), n++); // Eta event by event selection, and photon tagging from decay
99 //maker->AddAnalysis(ConfigurePi0EbEAnalysis("Pi0", AliAnaPi0EbE::kIMCaloTracks), n++); // Pi0 (calo+conversion) event by event selection,
100 // and photon tagging from decay, need to execute at the same time conversions analysis
102 maker->AddAnalysis(ConfigureIsolationAnalysis("Photon",partInCone,thresType), n++); // Photon isolation
103 maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0", partInCone,thresType), n++); // Pi0 isolation
105 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Photon",kFALSE), n++); // Gamma hadron correlation
106 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Photon",kTRUE) , n++); // Isolated gamma hadron correlation
107 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0" ,kFALSE), n++); // Pi0 hadron correlation
108 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0" ,kTRUE) , n++); // Isolated pi0 hadron correlation
112 maker->SetAnaDebug(-1) ;
113 maker->SwitchOnHistogramsMaker() ;
114 if(kData.Contains("delta")) maker->SwitchOffAODsMaker() ;
115 else maker->SwitchOnAODsMaker() ;
117 if(kPrint) maker->Print("");
119 printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, kCalorimeter.Data());
123 AliAnalysisTaskParticleCorrelation * task = new AliAnalysisTaskParticleCorrelation (Form("PartCorr%s_Trig%s_Cl%s",kCalorimeter.Data(),kTrig.Data(),kClusterArray.Data()));
124 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
125 //task->SetDebugLevel(-1);
126 task->SetBranches("ESD:AliESDRun.,AliESDHeader"); //just a trick to get Constantin's analysis to work
127 task->SetAnalysisMaker(maker);
132 if(outputfile.Length()==0)outputfile = AliAnalysisManager::GetCommonFileName();
134 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form("%s_Trig%s_Cl%s",kCalorimeter.Data(),kTrig.Data(),kClusterArray.Data()), TList::Class(),
135 AliAnalysisManager::kOutputContainer,
136 Form("%s",outputfile.Data()));
138 AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("%sCuts_Trig%s_Cl%s",kCalorimeter.Data(),kTrig.Data(), kClusterArray.Data()), TList::Class(),
139 AliAnalysisManager::kParamContainer,
140 Form("%s",outputfile.Data()));
141 // Create ONLY the output containers for the data produced by the task.
142 // Get and connect other common input/output containers via the manager as below
143 //==============================================================================
144 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
145 // AOD output slot will be used in a different way in future
146 if(!kData.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
147 mgr->ConnectOutput (task, 1, cout_pc);
148 mgr->ConnectOutput (task, 2, cout_cuts);
152 printf("PartCorr trigger EMC7\n");
153 task->SelectCollisionCandidates(AliVEvent::kEMC7);
155 else if (kTrig=="INT7"){
156 printf("PartCorr trigger INT7\n");
157 task->SelectCollisionCandidates(AliVEvent::kINT7);
159 else if(kTrig=="EMC1"){
160 printf("PartCorr trigger EMC1\n");
161 task->SelectCollisionCandidates(AliVEvent::kEMC1);
163 else if(kTrig=="MB"){
164 printf("PartCorr trigger MB\n");
165 task->SelectCollisionCandidates(AliVEvent::kMB);
167 else if(kTrig=="PHOS"){
168 printf("PartCorr trigger PHOS\n");
169 task->SelectCollisionCandidates(AliVEvent::kPHI7);
175 //____________________________________
176 AliCaloTrackReader * ConfigureReader()
179 AliCaloTrackReader * reader = 0;
180 if (kData.Contains("AOD")) reader = new AliCaloTrackAODReader();
181 else if(kData=="ESD") reader = new AliCaloTrackESDReader();
182 else if(kData=="MC" &&
183 kInputDataType == "ESD") reader = new AliCaloTrackMCReader();
185 reader->SetDebug(-1);//10 for lots of messages
188 //reader->SetDeltaAODFileName("");
189 if(kOutputAOD) reader->SwitchOnWriteDeltaAOD() ;
193 if(kInputDataType == "ESD"){
194 reader->SwitchOnStack();
195 reader->SwitchOffAODMCParticles();
197 else if(kInputDataType == "AOD"){
198 reader->SwitchOffStack();
199 reader->SwitchOnAODMCParticles();
203 //------------------------
204 // Detector input filling
205 //------------------------
207 //Min cluster/track E
208 reader->SetEMCALEMin(0.5);
209 reader->SetEMCALEMax(1000);
210 reader->SetPHOSEMin(0.3);
211 reader->SetPHOSEMax(1000);
212 reader->SetCTSPtMin(0.1);
213 reader->SetCTSPtMax(1000);
215 reader->SwitchOffFiducialCut();
218 reader->SwitchOnCTS();
219 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/CreateTrackCutsPWG4.C");
220 AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWG4(10041004); //no ITSrefit
221 reader->SetTrackCuts(esdTrackCuts);
225 reader->SetEMCALClusterListName(kClusterArray);
226 if(kClusterArray == "") {
227 printf("**************** Standard EMCAL clusters branch analysis **************** \n");
228 reader->SwitchOnClusterRecalculation();
229 // Check in ConfigureCaloUtils that the recalibration and bad map are ON
232 printf("**************** Input for analysis is Clusterizer %s **************** \n", kClusterArray.Data());
233 reader->SwitchOffClusterRecalculation();
236 //if(kCalorimeter == "EMCAL") {
237 reader->SwitchOnEMCALCells();
238 reader->SwitchOnEMCAL();
240 //if(kCalorimeter == "PHOS") {
241 reader->SwitchOnPHOSCells();
242 reader->SwitchOnPHOS();
245 // for case data="deltaAOD", no need to fill the EMCAL/PHOS cluster lists
246 if(kData.Contains("delta")){
247 reader->SwitchOffEMCAL();
248 reader->SwitchOffPHOS();
249 reader->SwitchOffEMCALCells();
250 reader->SwitchOffPHOSCells();
257 // Settings for LHC11a
258 if(kRunNumber > 140000 && kRunNumber < = 146860){
259 if(kClusterArray == "") reader->SwitchOnLEDEventsRemoval();
260 reader->RejectFastClusterEvents();
261 printf("Reader: Reject LED events and Fast cluster\n");
264 //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
266 if (kCollisions=="pp" ) {
267 if(kRunNumber < 140000) reader->SwitchOnEventSelection(); // remove pileup by default
268 else reader->SwitchOffEventSelection();
269 reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
270 reader->SwitchOffPrimaryVertexSelection(); // and besides primary vertex
271 reader->SetZvertexCut(50.); // Open cut
273 else if(kCollisions=="PbPb") {
274 reader->SwitchOffEventSelection(); // remove pileup by default
275 reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
276 reader->SwitchOffPrimaryVertexSelection(); // and besides primary vertex
277 reader->SetZvertexCut(10.); // Centrality defined in this range.
280 reader->SetCentralityClass("V0M");
281 reader->SetCentralityOpt("10"); // 10 centrality bins
282 reader->SetCentralityBin(-1,-1); // Accept all events, if not select range
284 // Event plane (only used in AliAnaPi0 for the moment)
285 reader->SetEventPlaneMethod("Q");
288 reader->SetImportGeometryFromFile(kTRUE);
290 if(kPrint) reader->Print("");
296 //_______________________________________
297 AliCalorimeterUtils* ConfigureCaloUtils()
300 AliCalorimeterUtils *cu = new AliCalorimeterUtils;
303 // Remove clusters close to borders, at least max energy cell is 1 cell away
304 cu->SetNumberOfCellsFromEMCALBorder(1);
305 cu->SetNumberOfCellsFromPHOSBorder(2);
307 if(kClusterArray == "")
308 cu->SwitchOffRecalculateClusterTrackMatching(); // Done in clusterization
310 cu->SwitchOnRecalculateClusterTrackMatching();
312 cu->SwitchOnBadChannelsRemoval() ;
315 if(kCalorimeter=="EMCAL"){
317 if(kYears==2010) cu->SetEMCALGeometryName("EMCAL_FIRSTYEARV1");
318 else cu->SetEMCALGeometryName("EMCAL_COMPLETEV1");
320 AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
322 Bool_t bCalib = kTRUE;
323 Bool_t bBadMap= kTRUE;
324 cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering
326 TGeoHMatrix* matrix[12];
327 gROOT->LoadMacro("ConfigureEMCALRecoUtils.C");
328 ConfigureEMCALRecoUtils(
332 "",//AODB path, default
339 printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
340 printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
343 cu->SwitchOffLoadOwnEMCALGeometryMatrices();
345 for (Int_t mod=0;mod<12;mod++)
347 //((TGeoHMatrix*) mobj->At(mod))->Print();
348 cu->SetEMCALGeometryMatrixInSM(matrix[mod],mod);
353 if(kCollisions=="pp" ) { // Do only for pp for the moment
354 cu->SwitchOnCorrectClusterLinearity();
355 if(!kSimulation) recou->SetNonLinearityFunction(AliEMCALRecoUtils::kBeamTestCorrected);
356 else recou->SetNonLinearityFunction(AliEMCALRecoUtils::kPi0MC);
359 recou->SwitchOnRejectExoticCell();
360 if(kClusterArray == "") recou->SwitchOnRejectExoticCluster();
361 else recou->SwitchOffRejectExoticCluster();
364 else { // PHOS settings
366 Int_t run2010 = kRunNumber;
367 //Use a fixed run number from year 2010 for 2011 runs, not available yet.
368 if(kRunNumber > 140000) run2010 = 139000;
372 AliOADBContainer badmapContainer(Form("phosBadMap"));
373 TString fileName="$ALICE_ROOT/OADB/PHOS/PHOSBadMaps.root";
374 //if(path!="") fileName=path+"PHOSBadMaps.root";
375 badmapContainer.InitFromFile((char*)fileName.Data(),"phosBadMap");
376 //Use a fixed run number from year 2010, this year not available yet.
377 TObjArray *maps = (TObjArray*)badmapContainer.GetObject(run2010,"phosBadMap");
379 printf("Can not read Bad map for run %d. \n You may choose to use your map with ForceUsingBadMap()\n",run2010) ;
382 printf("Setting PHOS bad map with name %s \n",maps->GetName()) ;
383 for(Int_t mod=1; mod<5;mod++){
384 TH2I *hbmPH = cu->GetPHOSChannelStatusMap(mod);
388 hbmPH=(TH2I*)maps->At(mod);
390 if(hbmPH) hbmPH->SetDirectory(0);
392 cu->SetPHOSChannelStatusMap(mod-1,hbmPH);
397 cu->SwitchOffLoadOwnPHOSGeometryMatrices();
399 fileName="$ALICE_ROOT/OADB/PHOS/PHOSGeometry.root";
400 //if(path!="") fileName=path+"PHOSGeometry.root";
401 AliOADBContainer geomContainer("phosGeo");
402 geomContainer.InitFromFile((char*)fileName.Data(),"PHOSRotationMatrixes");
403 TObjArray *matrixes = (TObjArray*)geomContainer.GetObject(run2010,"PHOSRotationMatrixes");
404 for (Int_t mod=0;mod<5;mod++)
406 printf("PHOS matrices mod %d, %p\n",mod,((TGeoHMatrix*)matrixes->At(mod)));
407 //((TGeoHMatrix*) mobj->At(mod))->Print();
408 cu->SetPHOSGeometryMatrixInSM(((TGeoHMatrix*)matrixes->At(mod)),mod);
413 if(kPrint) cu->Print("");
419 //_____________________________________
420 AliAnaPhoton* ConfigurePhotonAnalysis()
423 AliAnaPhoton *anaphoton = new AliAnaPhoton();
424 anaphoton->SetDebug(-1); //10 for lots of messages
426 // cluster selection cuts
428 anaphoton->SwitchOffFiducialCut();
430 anaphoton->SetCalorimeter(kCalorimeter);
432 if(kCalorimeter == "PHOS"){
433 anaphoton->SetNCellCut(2);// At least 2 cells
434 anaphoton->SetMinPt(0.3);
435 anaphoton->SetMinDistanceToBadChannel(2, 4, 5);
436 anaphoton->SetTimeCut(-2000,2000); // open cut, usual time window of [425-825] ns if time recalibration is off
439 anaphoton->SetNCellCut(1);// At least 2 cells
440 anaphoton->SetMinPt(0.5); // avoid mip peak at E = 260 MeV
441 anaphoton->SetMaxPt(1000);
442 anaphoton->SetTimeCut(-1000,1000); // open cut, usual time window of [425-825] ns if time recalibration is off
443 // restrict to less than 100 ns when time calibration is on
444 anaphoton->SetMinDistanceToBadChannel(1, 2, 3); // For filtered AODs, new releases.
447 anaphoton->SwitchOnTrackMatchRejection() ;
449 //PID cuts (shower shape)
450 anaphoton->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
451 AliCaloPID* caloPID = anaphoton->GetCaloPID();
452 //Not used in bayesian
455 caloPID->SetEMCALLambda0CutMax(0.30);
456 caloPID->SetEMCALLambda0CutMin(0.10);
458 caloPID->SetEMCALDEtaCut(0.025);
459 caloPID->SetEMCALDPhiCut(0.05);
460 // In case of official AODs when dX and dZ was not stored, open the cuts
461 // and rely on having a match recorded. In case of reclusterization, try.
462 if(kData=="AOD" && kClusterArray==""){
463 caloPID->SetEMCALDEtaCut(2000);
464 caloPID->SetEMCALDPhiCut(2000);
468 caloPID->SetPHOSDispersionCut(2.5);
469 caloPID->SetPHOSRCut(2.);
470 if(kData=="AOD") caloPID->SetPHOSRCut(2000.); // Open cut since dX, dZ not stored
472 if(kCalorimeter=="PHOS"){
473 caloPID->SetHistoDEtaRangeAndNBins(-200, 200, 200); // dZ
474 caloPID->SetHistoDPhiRangeAndNBins(-200, 200, 200); // dX
477 //caloPID->SetTOFCut(10000000); // Not used, only to set PID bits
479 anaphoton->SwitchOffFillShowerShapeHistograms(); // Filled before photon shower shape selection
481 // Input / output delta AOD settings
483 if(!kData.Contains("delta")) {
484 anaphoton->SetOutputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
485 anaphoton->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
486 //anaphoton->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done
488 else anaphoton->SetInputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
490 //Set Histograms name tag, bins and ranges
492 anaphoton->AddToHistogramsName("AnaPhoton_");
493 SetHistoRangeAndNBins(anaphoton); // see method below
495 // Number of particle type MC histograms
496 anaphoton->FillNOriginHistograms(8);
497 anaphoton->FillNPrimaryHistograms(4);
499 if(kPrint) anaphoton->Print("");
505 //_______________________________________________
506 AliAnaChargedParticles* ConfigureChargedAnalysis()
509 AliAnaChargedParticles *anatrack = new AliAnaChargedParticles();
510 anatrack->SetDebug(-1); //10 for lots of messages
514 anatrack->SetDebug(-1);//10 for lots of messages
515 anatrack->SetMinPt(5.);
516 anatrack->SwitchOffFiducialCut();
518 // Input / output delta AOD settings
520 if(!kData.Contains("delta")) {
521 anatrack->SetOutputAODName(Form("Hadron%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
522 anatrack->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
523 //anaphoton->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done
525 else anatrack->SetInputAODName(Form("Hadron%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
526 printf("Set Hadron%s_Trig%s_Cl%s\n",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data());
527 //Set Histograms name tag, bins and ranges
529 anatrack->AddToHistogramsName("AnaHadrons_");
530 SetHistoRangeAndNBins(anatrack); // see method below
532 if(kPrint) anatrack->Print("");
539 //_______________________________
540 AliAnaPi0* ConfigurePi0Analysis()
543 AliAnaPi0 *anapi0 = new AliAnaPi0();
545 anapi0->SetDebug(-1);//10 for lots of messages
546 if(kPrint) anapi0->Print("");
548 // Input delta AOD settings
549 anapi0->SetInputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
551 // Calorimeter settings
552 anapi0->SetCalorimeter(kCalorimeter);
553 if(kCalorimeter=="PHOS") anapi0->SetNumberOfModules(3); //PHOS first year
555 if(kYears==2010) anapi0->SetNumberOfModules(4); //EMCAL first year
556 else anapi0->SetNumberOfModules(10);
559 //settings for pp collision mixing
560 anapi0->SwitchOnOwnMix(); //Off when mixing done with general mixing frame
563 if(kCalorimeter=="EMCAL") anapi0->SetPairTimeCut(70);
565 if (kCollisions=="pp" ) {
566 anapi0->SetNCentrBin(1);
567 anapi0->SetNZvertBin(10);
568 anapi0->SetNRPBin(1);
569 anapi0->SetNMaxEvMix(100);
570 anapi0->SwitchOffSMCombinations();
571 anapi0->SwitchOffMultipleCutAnalysis();
573 else if(kCollisions=="PbPb") {
574 anapi0->SetNCentrBin(10);
575 anapi0->SetNZvertBin(10);
576 anapi0->SetNRPBin(4);
577 anapi0->SetNMaxEvMix(10);
578 anapi0->SwitchOffSMCombinations();
581 //Set Histograms name tag, bins and ranges
583 anapi0->AddToHistogramsName("AnaPi0_");
584 SetHistoRangeAndNBins(anapi0); // see method below
590 //_____________________________________________________
591 AliAnaPi0EbE* ConfigurePi0EbEAnalysis(TString particle,
595 AliAnaPi0EbE *anapi0ebe = new AliAnaPi0EbE();
596 anapi0ebe->SetDebug(-1);//10 for lots of messages
598 anapi0ebe->SetAnalysisType(analysis);
600 if(analysis==AliAnaPi0EbE::kIMCaloTracks) opt = "Conv";
601 if(analysis==AliAnaPi0EbE::kSSCalo) opt = "SS";
603 anapi0ebe->SwitchOffFillWeightHistograms();
604 anapi0ebe->SetMinPt(0.5);
605 if(kCalorimeter=="EMCAL")anapi0ebe->SetPairTimeCut(20);
606 anapi0ebe->SetCalorimeter(kCalorimeter);
608 // Input / output delta AOD settings
610 anapi0ebe->SetInputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
611 if(!kInputDataType.Contains("delta")) {
612 anapi0ebe->SetOutputAODName(Form("%s%s%s_Trig%s_Cl%s",particle.Data(), opt.Data(), kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
613 anapi0ebe->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
615 else anapi0ebe->SetInputAODName(Form("%s%s%s_Trig%s_Cl%s",particle.Data(),opt.Data(),kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
617 if(analysis == AliAnaPi0EbE::kIMCaloTracks) anapi0ebe->SetInputAODGammaConvName("PhotonsCTS");
619 if(analysis!=AliAnaPi0EbE::kSSCalo){
621 AliNeutralMesonSelection *nms = anapi0ebe->GetNeutralMesonSelection();
622 nms->SetParticle(particle);
623 nms->SwitchOffAngleSelection();
624 nms->KeepNeutralMesonSelectionHistos(kTRUE);
625 //nms->SetAngleMaxParam(2,0.2);
626 nms->SetHistoERangeAndNBins(0, 20, 100) ;
627 //nms->SetHistoIMRangeAndNBins(0, 1, 400);
630 //Set Histograms name tag, bins and ranges
632 anapi0ebe->AddToHistogramsName(Form("Ana%s%sEbE_",particle.Data(),opt.Data()));
633 SetHistoRangeAndNBins(anapi0ebe); // see method below
635 if(kPrint) anapi0ebe->Print("");
641 //___________________________________________________________________
642 AliAnaParticleIsolation* ConfigureIsolationAnalysis(TString particle="Photon",
643 Int_t partInCone = AliIsolationCut::kOnlyCharged,
644 Int_t thresType = AliIsolationCut::kSumPtFracIC,
645 Bool_t multi = kFALSE)
648 AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation();
649 anaisol->SetDebug(-1);
651 anaisol->SetMinPt(5);
653 // Input / output delta AOD settings
655 anaisol->SetInputAODName(Form("%s%s_Trig%s_Cl%s",particle.Data(),kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
656 anaisol->SetAODObjArrayName(Form("IC%s",particle.Data()));
658 anaisol->SetCalorimeter(kCalorimeter);
660 //Do settings for main isolation cut class
661 AliIsolationCut * ic = anaisol->GetIsolationCut();
662 ic->SetConeSize(0.4);
663 ic->SetPtThreshold(0.5);
664 ic->SetPtFraction(0.1);
665 ic->SetSumPtThreshold(1.0) ;
666 ic->SetParticleTypeInCone(partInCone);
667 ic->SetICMethod(thresType);
669 //Do or not do isolation with previously produced AODs.
670 //No effect if use of SwitchOnSeveralIsolation()
671 anaisol->SwitchOffReIsolation();
673 if(multi) anaisol->SwitchOnSeveralIsolation() ;
674 else anaisol->SwitchOffSeveralIsolation() ;
676 //Set Histograms name tag, bins and ranges
678 anaisol->AddToHistogramsName(Form("AnaIsol%s_",particle.Data()));
679 SetHistoRangeAndNBins(anaisol); // see method below
681 if(kPrint) ic ->Print("");
682 if(kPrint) anaisol->Print("");
688 //___________________________________________________________________________________
689 AliAnaParticleHadronCorrelation* ConfigureHadronCorrelationAnalysis(TString particle,
693 AliAnaParticleHadronCorrelation *anacorrhadron = new AliAnaParticleHadronCorrelation();
694 anacorrhadron->SetDebug(-1);
696 anacorrhadron->SetPtCutRange(5,200);
698 // Input / output delta AOD settings
700 anacorrhadron->SetInputAODName(Form("%s%s_Trig%s_Cl%s",particle.Data(),kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
701 anacorrhadron->AddToHistogramsName(Form("Ana%sHadronCorrIso%d_",particle.Data(),bIsolated));
702 anacorrhadron->SetAODObjArrayName(Form("%sHadronCorrIso%d",particle.Data(),bIsolated));
704 anacorrhadron->SelectIsolated(bIsolated); // do correlation with isolated photons
706 anacorrhadron->SwitchOnDecayCorr();
707 anacorrhadron->SetMultiBin(1);
708 anacorrhadron->SwitchOffNeutralCorr();
709 anacorrhadron->SwitchOffEventSelection();
710 anacorrhadron->SetDeltaPhiCutRange(1.5,4.5);
712 anacorrhadron->SwitchOnSeveralUECalculation();
713 anacorrhadron->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3);
715 //if(kCalorimeter=="PHOS"){
716 //Correlate with particles in EMCAL
717 //anacorrhadron->SwitchOnCaloPID();
718 //anacorrhadron->SwitchOnCaloPIDRecalculation();
721 //Set Histograms name tag, bins and ranges
723 anacorrhadron->AddToHistogramsName(Form("Ana%sHadronCorr_Iso%d_",particle.Data(),bIsolated));
724 SetHistoRangeAndNBins(anacorrhadron); // see method below
726 if(kPrint) anacorrhadron->Print("");
728 return anacorrhadron;
732 //________________________________________
733 AliAnaCalorimeterQA* ConfigureQAAnalysis()
736 AliAnaCalorimeterQA *anaQA = new AliAnaCalorimeterQA();
737 //anaQA->SetDebug(10); //10 for lots of messages
738 anaQA->SetCalorimeter(kCalorimeter);
740 anaQA->SetTimeCut(-1000,1000); // Open time cut
742 if(kCalorimeter=="EMCAL" && kClusterArray=="")
743 anaQA->SwitchOnCorrelation(); // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON
745 anaQA->SwitchOffCorrelation();
747 anaQA->SwitchOffFiducialCut();
748 anaQA->SwitchOffFillAllTH3Histogram();
749 anaQA->SwitchOffFillAllPositionHistogram();
750 anaQA->SwitchOffFillAllPositionHistogram2();
752 anaQA->SwitchOffStudyBadClusters() ; // On only for EMCAL
753 anaQA->SwitchOffStudyClustersAsymmetry();
754 anaQA->SwitchOffStudyWeight();
755 anaQA->SwitchOffFillAllTrackMatchingHistogram();
757 if(kCalorimeter=="EMCAL")
760 anaQA->SetNumberOfModules(4);
762 anaQA->SetNumberOfModules(10);
767 anaQA->SetNumberOfModules(3);
770 anaQA->AddToHistogramsName("QA_"); //Begining of histograms name
771 SetHistoRangeAndNBins(anaQA); // see method below
773 if(kPrint) anaQA->Print("");
779 //________________________________________________________
780 void SetHistoRangeAndNBins (AliAnaPartCorrBaseClass* ana)
782 // Set common bins for all analysis and MC histograms filling
784 if(kSimulation) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
785 else ana->SwitchOffDataMC() ;
787 ana->SetHistoPtRangeAndNBins(0, 100, 250) ; // Energy and pt histograms
789 if(kCalorimeter=="EMCAL"){
791 ana->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
792 ana->SetHistoXRangeAndNBins(-230,90,120); // QA
793 ana->SetHistoYRangeAndNBins(370,450,40); // QA
796 ana->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
797 ana->SetHistoXRangeAndNBins(-600,90,200); // QA
798 ana->SetHistoYRangeAndNBins(100,450,100); // QA
801 ana->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
804 ana->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ;
805 ana->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
809 ana->SetHistoShowerShapeRangeAndNBins(0, 3, 300);
811 // Invariant mass analysis
812 ana->SetHistoMassRangeAndNBins(0., 1., 200) ;
813 ana->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
815 // check if time calibration is on
816 ana->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
817 ana->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
819 // QA, electron, charged
820 ana->SetHistoPOverERangeAndNBins(0,10.,100);
821 ana->SetHistodEdxRangeAndNBins(0.,200.,200);
824 ana->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
825 ana->SetHistodRRangeAndNBins(0.,TMath::Pi(),150);
826 ana->SetHistoRatioRangeAndNBins(0.,2.,100);
827 ana->SetHistoVertexDistRangeAndNBins(0.,500.,500);
828 ana->SetHistoNClusterCellRangeAndNBins(0,500,500);
829 ana->SetHistoZRangeAndNBins(-400,400,200);
830 ana->SetHistoRRangeAndNBins(400,450,25);
831 ana->SetHistoV0SignalRangeAndNBins(0,5000,500);
832 ana->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
833 ana->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);