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 AliAnalysisTaskCaloTrackCorrelation *AddTaskCaloTrackCorr(
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 AliAnaCaloTrackCorrMaker * maker = new AliAnaCaloTrackCorrMaker();
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
77 maker->AddAnalysis(ConfigureQAAnalysis() , n++);
80 Int_t partInCone = AliIsolationCut::kNeutralAndCharged; // kOnlyCharged;
81 Int_t thresType = AliIsolationCut::kSumPtFracIC; // kPtThresIC;
83 if(kClusterArray=="" && kCalorimeter!="PHOS")
85 //Trigger on tracks, do only once, tracks do not depend on clusterizer
86 maker->AddAnalysis(ConfigureChargedAnalysis(), n++); // track selection
87 maker->AddAnalysis(ConfigureIsolationAnalysis("Hadron",partInCone,thresType), n++); // track isolation
88 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Hadron",kFALSE), n++); // track-track correlation
89 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Hadron",kTRUE) , n++); // Isolated track-track correlation
93 maker->AddAnalysis(ConfigurePhotonAnalysis(), n++); // Photon cluster selection
94 maker->AddAnalysis(ConfigurePi0Analysis() , n++); // Pi0 invariant mass analysis
95 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Pi0", AliAnaPi0EbE::kIMCalo), n++); // Pi0 event by event selection, and photon tagging from decay
96 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Eta", AliAnaPi0EbE::kIMCalo), n++); // Eta event by event selection, and photon tagging from decay
98 maker->AddAnalysis(ConfigureIsolationAnalysis("Photon", partInCone,thresType), n++); // Photon isolation
99 maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0", partInCone,thresType), n++); // Pi0 isolation
101 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Photon",kFALSE), n++); // Gamma hadron correlation
102 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Photon",kTRUE) , n++); // Isolated gamma hadron correlation
103 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0" ,kFALSE), n++); // Pi0 hadron correlation
104 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0" ,kTRUE) , n++); // Isolated pi0 hadron correlation
106 if(kInputDataType=="ESD"){
107 printf("* Configure conversion analysis in part corr\n");
108 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Pi0", AliAnaPi0EbE::kIMCaloTracks), n++); // Pi0 (calo+conversion) event by event selection,
109 // and photon tagging from decay, need to execute at the same time conversions analysis
110 maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0Conv",partInCone,thresType), n++); // Pi0 (Calo+Conv) isolation
115 maker->SetAnaDebug(-1) ;
116 maker->SwitchOnHistogramsMaker() ;
117 if(kData.Contains("delta")) maker->SwitchOffAODsMaker() ;
118 else maker->SwitchOnAODsMaker() ;
120 if(kPrint) maker->Print("");
122 printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, kCalorimeter.Data());
126 AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("PartCorr%s_Trig%s_Cl%s",kCalorimeter.Data(),kTrig.Data(),kClusterArray.Data()));
127 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
128 //task->SetDebugLevel(-1);
129 task->SetBranches("ESD:AliESDRun.,AliESDHeader"); //just a trick to get Constantin's analysis to work
130 task->SetAnalysisMaker(maker);
135 if(outputfile.Length()==0)outputfile = AliAnalysisManager::GetCommonFileName();
137 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form("%s_Trig%s_Cl%s",kCalorimeter.Data(),kTrig.Data(),kClusterArray.Data()), TList::Class(),
138 AliAnalysisManager::kOutputContainer,
139 Form("%s",outputfile.Data()));
141 AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("%sCuts_Trig%s_Cl%s",kCalorimeter.Data(),kTrig.Data(), kClusterArray.Data()), TList::Class(),
142 AliAnalysisManager::kParamContainer,
143 Form("%s",outputfile.Data()));
144 // Create ONLY the output containers for the data produced by the task.
145 // Get and connect other common input/output containers via the manager as below
146 //==============================================================================
147 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
148 // AOD output slot will be used in a different way in future
149 if(!kData.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
150 mgr->ConnectOutput (task, 1, cout_pc);
151 mgr->ConnectOutput (task, 2, cout_cuts);
155 printf("PartCorr trigger EMC7\n");
156 task->SelectCollisionCandidates(AliVEvent::kEMC7);
158 else if (kTrig=="INT7"){
159 printf("PartCorr trigger INT7\n");
160 task->SelectCollisionCandidates(AliVEvent::kINT7);
162 else if(kTrig=="EMC1"){
163 printf("PartCorr trigger EMC1\n");
164 task->SelectCollisionCandidates(AliVEvent::kEMC1);
166 else if(kTrig=="MB"){
167 printf("PartCorr trigger MB\n");
168 task->SelectCollisionCandidates(AliVEvent::kMB);
170 else if(kTrig=="PHOS"){
171 printf("PartCorr trigger PHOS\n");
172 task->SelectCollisionCandidates(AliVEvent::kPHI7);
178 //____________________________________
179 AliCaloTrackReader * ConfigureReader()
182 AliCaloTrackReader * reader = 0;
183 if (kData.Contains("AOD")) reader = new AliCaloTrackAODReader();
184 else if(kData=="ESD") reader = new AliCaloTrackESDReader();
185 else if(kData=="MC" &&
186 kInputDataType == "ESD") reader = new AliCaloTrackMCReader();
188 reader->SetDebug(-1);//10 for lots of messages
191 //reader->SetDeltaAODFileName("");
192 if(kOutputAOD) reader->SwitchOnWriteDeltaAOD() ;
196 if(kInputDataType == "ESD"){
197 reader->SwitchOnStack();
198 reader->SwitchOffAODMCParticles();
200 else if(kInputDataType == "AOD"){
201 reader->SwitchOffStack();
202 reader->SwitchOnAODMCParticles();
206 //------------------------
207 // Detector input filling
208 //------------------------
210 //Min cluster/track E
211 reader->SetEMCALEMin(0.5);
212 reader->SetEMCALEMax(1000);
213 reader->SetPHOSEMin(0.3);
214 reader->SetPHOSEMax(1000);
215 reader->SetCTSPtMin(0.1);
216 reader->SetCTSPtMax(1000);
218 reader->SwitchOffFiducialCut();
221 reader->SwitchOnCTS();
222 if(kInputDataType=="ESD"){
223 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/CreateTrackCutsPWG4.C");
224 AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWG4(10041004); //no ITSrefit
225 reader->SetTrackCuts(esdTrackCuts);
227 else if(kInputDataType=="AOD"){
228 reader->SetTrackFilterMask(128); // Filter bit, not mask
233 reader->SetEMCALClusterListName(kClusterArray);
234 if(kClusterArray == "") {
235 printf("**************** Standard EMCAL clusters branch analysis **************** \n");
236 reader->SwitchOnClusterRecalculation();
237 // Check in ConfigureCaloUtils that the recalibration and bad map are ON
240 printf("**************** Input for analysis is Clusterizer %s **************** \n", kClusterArray.Data());
241 reader->SwitchOffClusterRecalculation();
244 //if(kCalorimeter == "EMCAL") {
245 reader->SwitchOnEMCALCells();
246 reader->SwitchOnEMCAL();
248 //if(kCalorimeter == "PHOS") {
249 reader->SwitchOnPHOSCells();
250 reader->SwitchOnPHOS();
253 // for case data="deltaAOD", no need to fill the EMCAL/PHOS cluster lists
254 if(kData.Contains("delta")){
255 reader->SwitchOffEMCAL();
256 reader->SwitchOffPHOS();
257 reader->SwitchOffEMCALCells();
258 reader->SwitchOffPHOSCells();
265 // Settings for LHC11a
266 if(kRunNumber > 140000 && kRunNumber < = 146860){
267 if(kClusterArray == "") reader->SwitchOnLEDEventsRemoval();
268 reader->RejectFastClusterEvents();
269 printf("Reader: Reject LED events and Fast cluster\n");
272 //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
274 if (kCollisions=="pp" ) {
275 if(kRunNumber < 140000) reader->SwitchOnEventSelection(); // remove pileup by default
276 else reader->SwitchOffEventSelection();
277 reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
278 reader->SwitchOffPrimaryVertexSelection(); // and besides primary vertex
279 reader->SetZvertexCut(50.); // Open cut
281 else if(kCollisions=="PbPb") {
282 reader->SwitchOffEventSelection(); // remove pileup by default
283 reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
284 reader->SwitchOffPrimaryVertexSelection(); // and besides primary vertex
285 reader->SetZvertexCut(10.); // Centrality defined in this range.
288 reader->SetCentralityClass("V0M");
289 reader->SetCentralityOpt(10); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
290 reader->SetCentralityBin(-1,-1); // Accept all events, if not select range
292 // Event plane (only used in AliAnaPi0 for the moment)
293 reader->SetEventPlaneMethod("Q");
296 reader->SetImportGeometryFromFile(kTRUE);
298 if(kPrint) reader->Print("");
304 //_______________________________________
305 AliCalorimeterUtils* ConfigureCaloUtils()
308 AliCalorimeterUtils *cu = new AliCalorimeterUtils;
311 // Remove clusters close to borders, at least max energy cell is 1 cell away
312 cu->SetNumberOfCellsFromEMCALBorder(1);
313 cu->SetNumberOfCellsFromPHOSBorder(2);
315 if(kClusterArray == "")
316 cu->SwitchOffRecalculateClusterTrackMatching(); // Done in clusterization
318 cu->SwitchOnRecalculateClusterTrackMatching();
320 cu->SwitchOnBadChannelsRemoval() ;
323 if(kCalorimeter=="EMCAL"){
325 if(kYears==2010) cu->SetEMCALGeometryName("EMCAL_FIRSTYEARV1");
326 else cu->SetEMCALGeometryName("EMCAL_COMPLETEV1");
328 AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
330 Bool_t bCalib = kTRUE;
331 Bool_t bBadMap= kTRUE;
332 cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering
334 TGeoHMatrix* matrix[12];
335 gROOT->LoadMacro("ConfigureEMCALRecoUtils.C");
336 ConfigureEMCALRecoUtils(
340 "",//AODB path, default
347 printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
348 printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
351 cu->SwitchOffLoadOwnEMCALGeometryMatrices();
353 for (Int_t mod=0;mod<12;mod++)
355 //((TGeoHMatrix*) mobj->At(mod))->Print();
356 cu->SetEMCALGeometryMatrixInSM(matrix[mod],mod);
361 if(kCollisions=="pp" ) { // Do only for pp for the moment
362 cu->SwitchOnCorrectClusterLinearity();
363 if(!kSimulation) recou->SetNonLinearityFunction(AliEMCALRecoUtils::kBeamTestCorrected);
364 else recou->SetNonLinearityFunction(AliEMCALRecoUtils::kPi0MC);
367 recou->SwitchOnRejectExoticCell(); // on for QA cells
368 recou->SwitchOffRejectExoticCluster(); // Done in clusterizer
371 else { // PHOS settings
373 Int_t run2010 = kRunNumber;
374 //Use a fixed run number from year 2010 for 2011 runs, not available yet.
375 if(kRunNumber > 140000) run2010 = 139000;
379 AliOADBContainer badmapContainer(Form("phosBadMap"));
380 TString fileName="$ALICE_ROOT/OADB/PHOS/PHOSBadMaps.root";
381 //if(path!="") fileName=path+"PHOSBadMaps.root";
382 badmapContainer.InitFromFile((char*)fileName.Data(),"phosBadMap");
383 //Use a fixed run number from year 2010, this year not available yet.
384 TObjArray *maps = (TObjArray*)badmapContainer.GetObject(run2010,"phosBadMap");
386 printf("Can not read Bad map for run %d. \n You may choose to use your map with ForceUsingBadMap()\n",run2010) ;
389 printf("Setting PHOS bad map with name %s \n",maps->GetName()) ;
390 for(Int_t mod=1; mod<5;mod++){
391 TH2I *hbmPH = cu->GetPHOSChannelStatusMap(mod);
395 hbmPH=(TH2I*)maps->At(mod);
397 if(hbmPH) hbmPH->SetDirectory(0);
399 cu->SetPHOSChannelStatusMap(mod-1,hbmPH);
404 cu->SwitchOffLoadOwnPHOSGeometryMatrices();
406 fileName="$ALICE_ROOT/OADB/PHOS/PHOSGeometry.root";
407 //if(path!="") fileName=path+"PHOSGeometry.root";
408 AliOADBContainer geomContainer("phosGeo");
409 geomContainer.InitFromFile((char*)fileName.Data(),"PHOSRotationMatrixes");
410 TObjArray *matrixes = (TObjArray*)geomContainer.GetObject(run2010,"PHOSRotationMatrixes");
411 for (Int_t mod=0;mod<5;mod++)
413 printf("PHOS matrices mod %d, %p\n",mod,((TGeoHMatrix*)matrixes->At(mod)));
414 //((TGeoHMatrix*) mobj->At(mod))->Print();
415 cu->SetPHOSGeometryMatrixInSM(((TGeoHMatrix*)matrixes->At(mod)),mod);
420 if(kPrint) cu->Print("");
426 //_____________________________________
427 AliAnaPhoton* ConfigurePhotonAnalysis()
430 AliAnaPhoton *anaphoton = new AliAnaPhoton();
431 anaphoton->SetDebug(-1); //10 for lots of messages
433 // cluster selection cuts
435 anaphoton->SwitchOffFiducialCut();
437 anaphoton->SetCalorimeter(kCalorimeter);
439 if(kCalorimeter == "PHOS"){
440 anaphoton->SetNCellCut(2);// At least 2 cells
441 anaphoton->SetMinPt(0.3);
442 anaphoton->SetMinDistanceToBadChannel(2, 4, 5);
443 anaphoton->SetTimeCut(-2000,2000); // open cut
446 anaphoton->SetNCellCut(1);// At least 2 cells
447 anaphoton->SetMinPt(0.5); // avoid mip peak at E = 260 MeV
448 anaphoton->SetMaxPt(1000);
449 anaphoton->SetTimeCut(-1000,1000); // open cut, usual time window of [425-825] ns if time recalibration is off
450 // restrict to less than 100 ns when time calibration is on
451 anaphoton->SetMinDistanceToBadChannel(1, 2, 3); // For filtered AODs, new releases.
454 anaphoton->SwitchOnTrackMatchRejection() ;
456 //PID cuts (shower shape)
457 anaphoton->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
458 AliCaloPID* caloPID = anaphoton->GetCaloPID();
459 //Not used in bayesian
462 caloPID->SetEMCALLambda0CutMax(0.30);
463 caloPID->SetEMCALLambda0CutMin(0.10);
465 caloPID->SetEMCALDEtaCut(0.025);
466 caloPID->SetEMCALDPhiCut(0.05);
467 // In case of official AODs when dX and dZ was not stored, open the cuts
468 // and rely on having a match recorded. In case of reclusterization, try.
469 if(kData=="AOD" && kClusterArray==""){
470 caloPID->SetEMCALDEtaCut(2000);
471 caloPID->SetEMCALDPhiCut(2000);
475 caloPID->SetPHOSDispersionCut(2.5);
476 caloPID->SetPHOSRCut(2.);
477 if(kData=="AOD") caloPID->SetPHOSRCut(2000.); // Open cut since dX, dZ not stored
479 if(kCalorimeter=="PHOS"){
480 caloPID->SetHistoDEtaRangeAndNBins(-200, 200, 200); // dZ
481 caloPID->SetHistoDPhiRangeAndNBins(-200, 200, 200); // dX
484 //caloPID->SetTOFCut(10000000); // Not used, only to set PID bits
486 anaphoton->SwitchOffFillShowerShapeHistograms(); // Filled before photon shower shape selection
488 // Input / output delta AOD settings
490 if(!kData.Contains("delta")) {
491 anaphoton->SetOutputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
492 anaphoton->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
493 //anaphoton->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done
495 else anaphoton->SetInputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
497 //Set Histograms name tag, bins and ranges
499 anaphoton->AddToHistogramsName("AnaPhoton_");
500 SetHistoRangeAndNBins(anaphoton->GetHistogramRanges()); // see method below
502 // Number of particle type MC histograms
503 anaphoton->FillNOriginHistograms(8);
504 anaphoton->FillNPrimaryHistograms(4);
506 if(kSimulation) anaphoton->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
507 else anaphoton->SwitchOffDataMC() ;
509 if(kPrint) anaphoton->Print("");
515 //_______________________________________________
516 AliAnaChargedParticles* ConfigureChargedAnalysis()
519 AliAnaChargedParticles *anatrack = new AliAnaChargedParticles();
520 anatrack->SetDebug(-1); //10 for lots of messages
524 anatrack->SetDebug(-1);//10 for lots of messages
525 anatrack->SetMinPt(5.);
526 anatrack->SwitchOffFiducialCut();
528 // Input / output delta AOD settings
530 if(!kData.Contains("delta")) {
531 anatrack->SetOutputAODName(Form("Hadron%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
532 anatrack->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
533 //anaphoton->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done
535 else anatrack->SetInputAODName(Form("Hadron%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
536 printf("Set Hadron%s_Trig%s_Cl%s\n",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data());
537 //Set Histograms name tag, bins and ranges
539 anatrack->AddToHistogramsName("AnaHadrons_");
540 SetHistoRangeAndNBins(anatrack->GetHistogramRanges()); // see method below
542 if(kSimulation) anatrack->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
543 else anatrack->SwitchOffDataMC() ;
545 if(kPrint) anatrack->Print("");
552 //_______________________________
553 AliAnaPi0* ConfigurePi0Analysis()
556 AliAnaPi0 *anapi0 = new AliAnaPi0();
558 anapi0->SetDebug(-1);//10 for lots of messages
559 if(kPrint) anapi0->Print("");
561 // Input delta AOD settings
562 anapi0->SetInputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
564 // Calorimeter settings
565 anapi0->SetCalorimeter(kCalorimeter);
566 if(kCalorimeter=="PHOS") anapi0->SetNumberOfModules(3); //PHOS first year
568 if(kYears==2010) anapi0->SetNumberOfModules(4); //EMCAL first year
569 else anapi0->SetNumberOfModules(10);
572 //settings for pp collision mixing
573 anapi0->SwitchOnOwnMix(); //Off when mixing done with general mixing frame
576 if(kCalorimeter=="EMCAL") anapi0->SetPairTimeCut(70);
578 if (kCollisions=="pp" ) {
579 anapi0->SetNCentrBin(1);
580 anapi0->SetNZvertBin(10);
581 anapi0->SetNRPBin(1);
582 anapi0->SetNMaxEvMix(100);
583 anapi0->SwitchOffSMCombinations();
584 anapi0->SwitchOffMultipleCutAnalysis();
586 else if(kCollisions=="PbPb") {
587 anapi0->SetNCentrBin(10);
588 anapi0->SetNZvertBin(10);
589 anapi0->SetNRPBin(4);
590 anapi0->SetNMaxEvMix(10);
591 anapi0->SwitchOffSMCombinations();
594 //Set Histograms name tag, bins and ranges
596 anapi0->AddToHistogramsName("AnaPi0_");
597 SetHistoRangeAndNBins(anapi0->GetHistogramRanges()); // see method below
599 if(kSimulation) anapi0->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
600 else anapi0->SwitchOffDataMC() ;
606 //_____________________________________________________
607 AliAnaPi0EbE* ConfigurePi0EbEAnalysis(TString particle,
611 AliAnaPi0EbE *anapi0ebe = new AliAnaPi0EbE();
612 anapi0ebe->SetDebug(-1);//10 for lots of messages
614 anapi0ebe->SetAnalysisType(analysis);
616 if(analysis==AliAnaPi0EbE::kIMCaloTracks) opt = "Conv";
617 if(analysis==AliAnaPi0EbE::kSSCalo) opt = "SS";
619 anapi0ebe->SwitchOffFillWeightHistograms();
620 anapi0ebe->SetMinPt(0.5);
621 if(kCalorimeter=="EMCAL")anapi0ebe->SetPairTimeCut(20);
622 anapi0ebe->SetCalorimeter(kCalorimeter);
624 // Input / output delta AOD settings
626 anapi0ebe->SetInputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
627 if(!kInputDataType.Contains("delta")) {
628 anapi0ebe->SetOutputAODName(Form("%s%s%s_Trig%s_Cl%s",particle.Data(), opt.Data(), kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
629 anapi0ebe->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
631 else anapi0ebe->SetInputAODName(Form("%s%s%s_Trig%s_Cl%s",particle.Data(),opt.Data(),kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
633 if(analysis == AliAnaPi0EbE::kIMCaloTracks) anapi0ebe->SetInputAODGammaConvName("PhotonsCTS");
635 if(analysis!=AliAnaPi0EbE::kSSCalo){
637 AliNeutralMesonSelection *nms = anapi0ebe->GetNeutralMesonSelection();
638 nms->SetParticle(particle);
639 nms->SwitchOffAngleSelection();
640 nms->KeepNeutralMesonSelectionHistos(kTRUE);
641 //nms->SetAngleMaxParam(2,0.2);
642 nms->SetHistoERangeAndNBins(0, 20, 100) ;
643 //nms->SetHistoIMRangeAndNBins(0, 1, 400);
646 //Set Histograms name tag, bins and ranges
648 anapi0ebe->AddToHistogramsName(Form("Ana%s%sEbE_",particle.Data(),opt.Data()));
649 SetHistoRangeAndNBins(anapi0ebe->GetHistogramRanges()); // see method below
651 if(kSimulation) anapi0ebe->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
652 else anapi0ebe->SwitchOffDataMC() ;
654 if(kPrint) anapi0ebe->Print("");
660 //___________________________________________________________________
661 AliAnaParticleIsolation* ConfigureIsolationAnalysis(TString particle="Photon",
662 Int_t partInCone = AliIsolationCut::kOnlyCharged,
663 Int_t thresType = AliIsolationCut::kSumPtFracIC,
664 Bool_t multi = kFALSE)
667 AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation();
668 anaisol->SetDebug(-1);
670 anaisol->SetMinPt(5);
672 // Input / output delta AOD settings
674 anaisol->SetInputAODName(Form("%s%s_Trig%s_Cl%s",particle.Data(),kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
675 anaisol->SetAODObjArrayName(Form("IC%s",particle.Data()));
677 anaisol->SetCalorimeter(kCalorimeter);
679 //Do settings for main isolation cut class
680 AliIsolationCut * ic = anaisol->GetIsolationCut();
681 ic->SetConeSize(0.4);
682 ic->SetPtThreshold(0.5);
683 ic->SetPtFraction(0.1);
684 ic->SetSumPtThreshold(1.0) ;
685 ic->SetParticleTypeInCone(partInCone);
686 ic->SetICMethod(thresType);
688 //Do or not do isolation with previously produced AODs.
689 //No effect if use of SwitchOnSeveralIsolation()
690 anaisol->SwitchOffReIsolation();
692 if(multi) anaisol->SwitchOnSeveralIsolation() ;
693 else anaisol->SwitchOffSeveralIsolation() ;
695 //Set Histograms name tag, bins and ranges
697 anaisol->AddToHistogramsName(Form("AnaIsol%s_",particle.Data()));
698 SetHistoRangeAndNBins(anaisol->GetHistogramRanges()); // see method below
700 if(kPrint) ic ->Print("");
701 if(kPrint) anaisol->Print("");
703 if(kSimulation) anaisol->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
704 else anaisol->SwitchOffDataMC() ;
710 //___________________________________________________________________________________
711 AliAnaParticleHadronCorrelation* ConfigureHadronCorrelationAnalysis(TString particle,
715 AliAnaParticleHadronCorrelation *anacorrhadron = new AliAnaParticleHadronCorrelation();
716 anacorrhadron->SetDebug(-1);
718 anacorrhadron->SetMinimumTriggerPt(5);
719 anacorrhadron->SetAssociatedPtRange(0.2,200);
721 // Input / output delta AOD settings
723 anacorrhadron->SetInputAODName(Form("%s%s_Trig%s_Cl%s",particle.Data(),kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()));
724 anacorrhadron->AddToHistogramsName(Form("Ana%sHadronCorrIso%d_",particle.Data(),bIsolated));
725 anacorrhadron->SetAODObjArrayName(Form("%sHadronCorrIso%d",particle.Data(),bIsolated));
727 anacorrhadron->SelectIsolated(bIsolated); // do correlation with isolated photons
729 anacorrhadron->SwitchOnDecayCorr();
730 anacorrhadron->SetMultiBin(1);
731 anacorrhadron->SwitchOffNeutralCorr();
732 anacorrhadron->SwitchOffEventSelection();
733 anacorrhadron->SetDeltaPhiCutRange(1.5,4.5);
735 anacorrhadron->SwitchOnSeveralUECalculation();
736 anacorrhadron->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3);
738 //if(kCalorimeter=="PHOS"){
739 //Correlate with particles in EMCAL
740 //anacorrhadron->SwitchOnCaloPID();
741 //anacorrhadron->SwitchOnCaloPIDRecalculation();
744 //Set Histograms name tag, bins and ranges
746 anacorrhadron->AddToHistogramsName(Form("Ana%sHadronCorr_Iso%d_",particle.Data(),bIsolated));
747 SetHistoRangeAndNBins(anacorrhadron->GetHistogramRanges()); // see method below
749 if(kSimulation) anacorrhadron->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
750 else anacorrhadron->SwitchOffDataMC() ;
752 if(kPrint) anacorrhadron->Print("");
754 return anacorrhadron;
758 //________________________________________
759 AliAnaCalorimeterQA* ConfigureQAAnalysis()
762 AliAnaCalorimeterQA *anaQA = new AliAnaCalorimeterQA();
763 //anaQA->SetDebug(10); //10 for lots of messages
764 anaQA->SetCalorimeter(kCalorimeter);
766 anaQA->SetTimeCut(-1000,1000); // Open time cut
768 // Study inter detector correlation (PHOS, EMCAL, Tracks, V0)
769 if(kCalorimeter=="PHOS" && kTrig=="PHOS"){
770 anaQA->SwitchOnCorrelation(); // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON
772 if(kCalorimeter=="EMCAL" && kClusterArray==""){
773 anaQA->SwitchOnCorrelation(); // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON
776 anaQA->SwitchOffCorrelation();
779 // Study exotic clusters PHOS and EMCAL
780 if(kClusterArray==""){
781 anaQA->SwitchOnStudyBadClusters() ;
784 anaQA->SwitchOffStudyBadClusters() ;
787 anaQA->SwitchOffFiducialCut();
788 anaQA->SwitchOffFillAllTH3Histogram();
789 anaQA->SwitchOffFillAllPositionHistogram();
790 anaQA->SwitchOffFillAllPositionHistogram2();
791 anaQA->SwitchOffStudyBadClusters();
792 anaQA->SwitchOffStudyClustersAsymmetry();
793 anaQA->SwitchOffStudyWeight();
794 anaQA->SwitchOffFillAllTrackMatchingHistogram();
796 if(kCalorimeter=="EMCAL")
799 anaQA->SetNumberOfModules(4);
801 anaQA->SetNumberOfModules(10);
806 anaQA->SetNumberOfModules(3);
809 anaQA->AddToHistogramsName("QA_"); //Begining of histograms name
810 SetHistoRangeAndNBins(anaQA->GetHistogramRanges()); // see method below
812 if(kSimulation) anaQA->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
813 else anaQA->SwitchOffDataMC() ;
815 if(kPrint) anaQA->Print("");
821 //________________________________________________________
822 void SetHistoRangeAndNBins (AliHistogramRanges* ana)
824 // Set common bins for all analysis and MC histograms filling
826 ana->SetHistoPtRangeAndNBins(0, 100, 250) ; // Energy and pt histograms
828 if(kCalorimeter=="EMCAL"){
830 ana->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
831 ana->SetHistoXRangeAndNBins(-230,90,120); // QA
832 ana->SetHistoYRangeAndNBins(370,450,40); // QA
835 ana->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
836 ana->SetHistoXRangeAndNBins(-600,90,200); // QA
837 ana->SetHistoYRangeAndNBins(100,450,100); // QA
840 ana->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
843 ana->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ;
844 ana->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
848 if(kClusterArray=="" && kCalorimeter!="PHOS"){ // Tracks analysis
849 ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
850 ana->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
853 ana->SetHistoShowerShapeRangeAndNBins(0, 3, 300);
855 // Invariant mass analysis
856 ana->SetHistoMassRangeAndNBins(0., 1., 200) ;
857 ana->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
859 // check if time calibration is on
860 ana->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
861 ana->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
863 // QA, electron, charged
864 ana->SetHistoPOverERangeAndNBins(0,10.,100);
865 ana->SetHistodEdxRangeAndNBins(0.,200.,200);
868 ana->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
869 ana->SetHistodRRangeAndNBins(0.,TMath::Pi(),150);
870 ana->SetHistoRatioRangeAndNBins(0.,2.,100);
871 ana->SetHistoVertexDistRangeAndNBins(0.,500.,500);
872 ana->SetHistoNClusterCellRangeAndNBins(0,500,500);
873 ana->SetHistoZRangeAndNBins(-400,400,200);
874 ana->SetHistoRRangeAndNBins(400,450,25);
875 ana->SetHistoV0SignalRangeAndNBins(0,5000,500);
876 ana->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
877 ana->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);