1 AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calorimeter)
3 // Creates a PartCorr task, configures it and adds it to the analysis manager.
5 // Get the pointer to the existing analysis manager via the static access method.
6 //==============================================================================
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
9 ::Error("AddTaskPartCorr", "No analysis manager to connect to.");
13 // Check the analysis type using the event handlers connected to the analysis manager.
14 //==============================================================================
15 if (!mgr->GetInputEventHandler()) {
16 ::Error("AddTaskPartCorr", "This task requires an input event handler");
19 //TString dataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
22 //===========================================================================
25 AliCaloTrackReader * reader = 0x0;
26 if(data=="AOD") reader = new AliCaloTrackAODReader();
27 else if(data=="ESD") reader = new AliCaloTrackESDReader();
28 else if(data=="MC") reader = new AliCaloTrackMCReader();
29 reader->SetDebug(-1);//10 for lots of messages
30 if(calorimeter == "EMCAL") reader->SwitchOnEMCALCells();
31 if(calorimeter == "PHOS") reader->SwitchOnPHOSCells();
33 reader->SetEMCALPtMin(0.2);
34 reader->SetPHOSPtMin(0.2);
35 reader->SetCTSPtMin(0.2);
38 // ##### Analysis algorithm settings ####
40 // --------------------
41 // --- Pi0 Analysis ---
42 // --------------------
44 AliCaloPID * pid = new AliCaloPID();
45 pid->SetDispersionCut(1.5);
46 pid->SetTOFCut(5.e-9);
50 AliFidutialCut * fidCut = new AliFidutialCut();
51 fidCut->DoCTSFidutialCut(kFALSE) ;
52 fidCut->DoEMCALFidutialCut(kTRUE) ;
53 fidCut->DoPHOSFidutialCut(kTRUE) ;
55 AliAnaCalorimeterQA *qa = new AliAnaCalorimeterQA();
56 qa->SetDebug(-1); //10 for lots of messages
57 qa->SetCalorimeter(calorimeter);
58 qa->SwitchOnDataMC() ;//Access MC stack and fill more histograms
59 qa->AddToHistogramsName("AnaCaloQA_"+calorimeter);
60 qa->SetFidutialCut(fidCut);
61 qa->SwitchOnFidutialCut();
64 AliAnaPhoton *anaphoton1 = new AliAnaPhoton();
65 anaphoton1->SetDebug(-1); //10 for lots of messages
66 //anaphoton->SetMinPt(0.5);
67 anaphoton1->SetMinDistanceToBadChannel(2, 4, 5);
68 anaphoton1->SetCaloPID(pid);
69 anaphoton1->SetCalorimeter(calorimeter);
70 anaphoton1->SwitchOffDataMC() ;//Access MC stack and fill more histograms
71 anaphoton1->SwitchOffCaloPID();
72 anaphoton1->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL
73 anaphoton1->SwitchOffFidutialCut();
74 anaphoton1->SetOutputAODName("PhotonsForIM"+calorimeter);
75 anaphoton1->Print("");
77 AliAnaPi0 *anapi0 = new AliAnaPi0();
78 anapi0->SetDebug(-1);//10 for lots of messages
79 anapi0->SetInputAODName("PhotonsForIM"+calorimeter);
80 anapi0->SetCaloPID(pid);
81 anapi0->SetCalorimeter(calorimeter);
82 anapi0->SwitchOnFidutialCut();
83 anapi0->SwitchOffDataMC() ;//Access MC stack and fill more histograms
86 // AliAnaNeutralMeson *ananeutral = new AliAnaNeutralMeson();
87 // ananeutral->SetDebug(-1);//10 for lots of messages
88 // ananeutral->SetInputAODName("PhotonsForIM"+calorimeter);
89 // ananeutral->SetCaloPID(pid);
90 // // ananeutral->SetNCentrBin(5); //number of bins in centrality
91 // // ananeutral->SetNZvertBin(5); //number of bins for vertex position
92 // // ananeutral->SetNRPBin(6); //number of bins in reaction plain
93 // ananeutral->SetAnaPi0Eta(kTRUE); //whether analysis pi0 and eta
94 // ananeutral->SetAnaOmega(kTRUE); //whether analysis omega
95 // ananeutral->SetNPID(3);
96 // ananeutral->SetInvMassCut(1.);
97 // ananeutral->SetNEventsMixed(6);
98 // ananeutral->SetNAsyBinsMinMax(200,0,1.);
99 // ananeutral->SetNPtBinsMinMax(200,0,20.);
100 // ananeutral->SetNMassBinsMinMas(200,0,1.);
101 // ananeutral->SetPi0MassPeakWidthCut(0.015);
102 // ananeutral->SetCalorimeter(calorimeter);
103 // ananeutral->SwitchOnFidutialCut();
104 // ananeutral->SwitchOffDataMC() ;//Access MC stack and fill more histograms
105 // ananeutral->AddToHistogramsName("AnaNeutralMeson_");
106 // ananeutral->Print("");
108 // -------------------------------------------------
109 // --- Photon Isolation and Correlation Analysis ---
110 // -------------------------------------------------
112 AliAnaPhoton *anaphoton2 = new AliAnaPhoton();
113 anaphoton2->SetDebug(-1); //10 for lots of messages
114 anaphoton2->SetMinPt(5);
115 anaphoton2->SetCaloPID(pid);
116 anaphoton2->SetCalorimeter(calorimeter);
117 anaphoton2->SwitchOffDataMC() ;//Access MC stack and fill more histograms
118 anaphoton2->SwitchOnCaloPID();
119 if(calorimeter == "EMCAL") anaphoton2->SwitchOnCaloPIDRecalculation();
120 anaphoton2->SwitchOffFidutialCut();
121 anaphoton2->SetOutputAODName("DirectPhotons"+calorimeter);
122 anaphoton2->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
123 anaphoton2->AddToHistogramsName("AnaPhotonCorr_");
124 anaphoton2->Print("");
125 // ### Isolation analysis ###
127 AliIsolationCut * ic = new AliIsolationCut();
128 ic->SetConeSize(0.5);
129 ic->SetPtThreshold(1.);
130 ic->SetICMethod(AliIsolationCut::kPtThresIC);
133 AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation();
134 anaisol->SetDebug(-1);
135 //anaisol->SetMinPt(5);
136 anaisol->SetInputAODName("DirectPhotons"+calorimeter);
137 anaisol->SetCalorimeter(calorimeter);
138 anaisol->SwitchOffDataMC() ;//Access MC stack and fill more histograms
139 //Select clusters with no pair, if both clusters with pi0 mass
140 anaisol->SwitchOffInvariantMass();
141 //anaisol->SetNeutralMesonSelection(nms);
143 anaisol->SetIsolationCut(ic);
144 //Do or not do isolation with previously produced AODs.
145 //No effect if use of SwitchOnSeveralIsolation()
146 anaisol->SwitchOffReIsolation();
148 anaisol->SwitchOffSeveralIsolation() ;
151 // ### Correlation with Jet Finder AOD output
152 AliAnaParticleJetFinderCorrelation *anacorrjet = new AliAnaParticleJetFinderCorrelation();
153 anacorrjet->SetInputAODName("DirectPhotons"+calorimeter);
154 anacorrjet->SwitchOffFidutialCut();
155 anacorrjet->SetDebug(-1);
156 anacorrjet->SetConeSize(1);
157 anacorrjet->SelectIsolated(kTRUE); // do correlation with isolated photons
158 anacorrjet->SetPtThresholdInCone(0.2);
159 anacorrjet->SetDeltaPhiCutRange(0.5,5.5);//Mostly Open Cuts
160 anacorrjet->SetRatioCutRange(0.01,3); //Mostly Open Cuts
161 anacorrjet->UseJetRefTracks(kFALSE); //Not working now
162 anacorrjet->Print("");
164 // ### Correlation with hadrons
165 AliAnaParticleHadronCorrelation *anacorrhadron = new AliAnaParticleHadronCorrelation();
166 anacorrhadron->SetInputAODName("DirectPhotons"+calorimeter);
167 anacorrhadron->SetOutputAODName("CorrelatedPi0s"+calorimeter);
168 anacorrhadron->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
169 anacorrhadron->SetDebug(-1);
170 anacorrhadron->SwitchOffCaloPID();
171 anacorrhadron->SwitchOffFidutialCut();
172 anacorrhadron->SetPtCutRange(1,100);
173 anacorrhadron->SetDeltaPhiCutRange(1.5,4.5);
174 anacorrhadron->SelectIsolated(kTRUE); // do correlation with isolated photons
175 if(calorimeter=="PHOS"){
176 //Correlate with particles in EMCAL
177 anacorrhadron->SwitchOnCaloPID();
178 anacorrhadron->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL
180 anacorrhadron->Print("");
182 // #### Configure Maker ####
183 AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker();
184 maker->SetReader(reader);//pointer to reader
185 maker->AddAnalysis(qa,0);
186 maker->AddAnalysis(anaphoton1,1);
187 maker->AddAnalysis(anapi0,2);
188 maker->AddAnalysis(anaphoton2,3);
189 maker->AddAnalysis(anaisol,4);
190 maker->AddAnalysis(anacorrjet,5);
191 maker->AddAnalysis(anacorrhadron,6);
192 //maker->AddAnalysis(ananeutral,7);
193 maker->SetAnaDebug(-1) ;
194 maker->SwitchOnHistogramsMaker() ;
195 maker->SwitchOnAODsMaker() ;
198 printf("======================== \n");
199 printf(" End Configuration of PartCorr analysis with detector %s \n",calorimeter.Data());
200 printf("======================== \n");
203 //===========================================================================
204 AliAnalysisTaskParticleCorrelation * task = new AliAnalysisTaskParticleCorrelation ("PartCorr"+calorimeter);
205 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
206 //task->SetDebugLevel(-1);
207 task->SetAnalysisMaker(maker);
211 sprintf(name,"PartCorr_%s",calorimeter.Data());
212 cout<<"Name of task "<<name<<endl;
213 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form(name),TList::Class(),
214 AliAnalysisManager::kOutputContainer, Form("PartCorr_%s.root",calorimeter.Data()));
216 // Create ONLY the output containers for the data produced by the task.
217 // Get and connect other common input/output containers via the manager as below
218 //==============================================================================
219 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
220 // AOD output slot will be used in a different way in future
221 mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
222 mgr->ConnectOutput (task, 1, cout_pc);