]>
Commit | Line | Data |
---|---|---|
cd54ca47 | 1 | |
2 | Bool_t kPrint = kFALSE; | |
193828fd | 3 | Bool_t kSimulation = kFALSE; |
4 | Bool_t kUseKinematics = kFALSE; | |
5 | Bool_t kOutputAOD = kFALSE; | |
6 | Int_t kRunNumber = 0; | |
7 | Int_t kYears = 2011; | |
cd54ca47 | 8 | TString kCollisions = "pp"; |
9 | TString kTrig = "EMC7" ; | |
193828fd | 10 | TString kClusterArray = ""; |
11 | TString kData = "ESD"; | |
12 | TString kInputDataType = "ESD"; | |
13 | TString kCalorimeter = "EMCAL"; | |
69652c63 | 14 | |
193828fd | 15 | AliAnalysisTaskParticleCorrelation *AddTaskPartCorr( |
cd54ca47 | 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, | |
23 | const Int_t run = 0, | |
24 | const TString col = "pp", | |
25 | const TString trigger = "MB", | |
26 | const TString clustersArray = "V1" | |
27 | ) | |
193828fd | 28 | { |
90eb3a19 | 29 | // Creates a PartCorr task, configures it and adds it to the analysis manager. |
30 | ||
cd54ca47 | 31 | kPrint = printSettings; |
193828fd | 32 | kSimulation = simulation; |
33 | kRunNumber = run; | |
34 | kYears = year; | |
35 | kCollisions = col; | |
36 | kTrig = trigger; | |
37 | kClusterArray = clustersArray; | |
38 | kData = data; | |
39 | kCalorimeter = calorimeter; | |
40 | kOutputAOD = outputAOD; | |
41 | ||
90eb3a19 | 42 | // Get the pointer to the existing analysis manager via the static access method. |
193828fd | 43 | |
90eb3a19 | 44 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); |
45 | if (!mgr) { | |
193828fd | 46 | ::Error("AddTask", "No analysis manager to connect to."); |
90eb3a19 | 47 | return NULL; |
48 | } | |
193828fd | 49 | |
50 | // Check the analysis type using the event handlers connected to the analysis manager. | |
51 | ||
52 | if (!mgr->GetInputEventHandler()) { | |
53 | ::Error("AddTask", "This task requires an input event handler"); | |
54 | return NULL; | |
55 | } | |
56 | kInputDataType = "AOD"; | |
57 | if(!kData.Contains("delta")) | |
58 | kInputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
59 | ||
1e3689fa | 60 | if(kSimulation) { |
61 | kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE; | |
193828fd | 62 | if (!kUseKinematics && data=="AOD" && kInputDataType != "ESD") kUseKinematics = kTRUE; //AOD primary should be available ... |
1e3689fa | 63 | } |
64 | ||
65 | cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl; | |
66 | ||
193828fd | 67 | // #### Configure analysis #### |
cd54ca47 | 68 | |
193828fd | 69 | AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker(); |
70 | ||
71 | // General frame setting and configuration | |
72 | maker->SetReader (ConfigureReader() ); | |
73 | maker->SetCaloUtils(ConfigureCaloUtils()); | |
74 | ||
75 | // Analysis tasks setting and configuration | |
76 | Int_t n = 0;//Analysis number, order is important | |
77 | ||
cd54ca47 | 78 | maker->AddAnalysis(ConfigureQAAnalysis() , n++); |
193828fd | 79 | |
cd54ca47 | 80 | // Isolation settings |
5eef1db1 | 81 | Int_t partInCone = AliIsolationCut::kNeutralAndCharged;//kOnlyCharged; |
82 | Int_t thresType = AliIsolationCut::kSumPtFracIC; // kPtThresIC; | |
193828fd | 83 | |
8f880b6e | 84 | if(kClusterArray=="" && kCalorimeter!="PHOS") |
85 | { | |
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 | |
91 | } | |
92 | else | |
93 | { | |
cd54ca47 | 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 | |
98 | ||
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 | |
101 | ||
102 | maker->AddAnalysis(ConfigureIsolationAnalysis("Photon",partInCone,thresType), n++); // Photon isolation | |
103 | maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0", partInCone,thresType), n++); // Pi0 isolation | |
104 | ||
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 | |
109 | } | |
8f880b6e | 110 | |
193828fd | 111 | |
112 | maker->SetAnaDebug(-1) ; | |
113 | maker->SwitchOnHistogramsMaker() ; | |
114 | if(kData.Contains("delta")) maker->SwitchOffAODsMaker() ; | |
115 | else maker->SwitchOnAODsMaker() ; | |
116 | ||
117 | if(kPrint) maker->Print(""); | |
118 | ||
cd54ca47 | 119 | printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, kCalorimeter.Data()); |
193828fd | 120 | |
121 | // Create task | |
122 | ||
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); | |
128 | mgr->AddTask(task); | |
129 | ||
130 | //Create containers | |
131 | ||
132 | if(outputfile.Length()==0)outputfile = AliAnalysisManager::GetCommonFileName(); | |
133 | ||
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())); | |
137 | ||
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); | |
149 | ||
150 | ||
151 | if(kTrig=="EMC7"){ | |
152 | printf("PartCorr trigger EMC7\n"); | |
153 | task->SelectCollisionCandidates(AliVEvent::kEMC7); | |
154 | } | |
155 | else if (kTrig=="INT7"){ | |
156 | printf("PartCorr trigger INT7\n"); | |
157 | task->SelectCollisionCandidates(AliVEvent::kINT7); | |
158 | } | |
cd54ca47 | 159 | else if(kTrig=="EMC1"){ |
193828fd | 160 | printf("PartCorr trigger EMC1\n"); |
161 | task->SelectCollisionCandidates(AliVEvent::kEMC1); | |
162 | } | |
163 | else if(kTrig=="MB"){ | |
164 | printf("PartCorr trigger MB\n"); | |
165 | task->SelectCollisionCandidates(AliVEvent::kMB); | |
166 | } | |
cd54ca47 | 167 | else if(kTrig=="PHOS"){ |
168 | printf("PartCorr trigger PHOS\n"); | |
169 | task->SelectCollisionCandidates(AliVEvent::kPHI7); | |
170 | } | |
193828fd | 171 | |
172 | return task; | |
173 | } | |
174 | ||
175 | //____________________________________ | |
176 | AliCaloTrackReader * ConfigureReader() | |
177 | { | |
178 | ||
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(); | |
1e3689fa | 184 | |
1e3689fa | 185 | reader->SetDebug(-1);//10 for lots of messages |
193828fd | 186 | |
cd54ca47 | 187 | //Delta AOD? |
188 | //reader->SetDeltaAODFileName(""); | |
189 | if(kOutputAOD) reader->SwitchOnWriteDeltaAOD() ; | |
190 | ||
191 | // MC settings | |
192 | if(kUseKinematics){ | |
193 | if(kInputDataType == "ESD"){ | |
194 | reader->SwitchOnStack(); | |
195 | reader->SwitchOffAODMCParticles(); | |
196 | } | |
197 | else if(kInputDataType == "AOD"){ | |
198 | reader->SwitchOffStack(); | |
199 | reader->SwitchOnAODMCParticles(); | |
200 | } | |
201 | } | |
202 | ||
203 | //------------------------ | |
204 | // Detector input filling | |
205 | //------------------------ | |
206 | ||
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); | |
214 | ||
215 | reader->SwitchOffFiducialCut(); | |
216 | ||
217 | // Tracks | |
218 | reader->SwitchOnCTS(); | |
219 | gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/CreateTrackCutsPWG4.C"); | |
15882d9f | 220 | AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWG4(10041004); //no ITSrefit |
cd54ca47 | 221 | reader->SetTrackCuts(esdTrackCuts); |
222 | ||
223 | // Calorimeter | |
224 | ||
193828fd | 225 | reader->SetEMCALClusterListName(kClusterArray); |
226 | if(kClusterArray == "") { | |
5eef1db1 | 227 | printf("**************** Standard EMCAL clusters branch analysis **************** \n"); |
cd54ca47 | 228 | reader->SwitchOnClusterRecalculation(); |
5eef1db1 | 229 | // Check in ConfigureCaloUtils that the recalibration and bad map are ON |
193828fd | 230 | } |
231 | else { | |
232 | printf("**************** Input for analysis is Clusterizer %s **************** \n", kClusterArray.Data()); | |
cd54ca47 | 233 | reader->SwitchOffClusterRecalculation(); |
234 | } | |
193828fd | 235 | |
cd54ca47 | 236 | //if(kCalorimeter == "EMCAL") { |
afabc52f | 237 | reader->SwitchOnEMCALCells(); |
69652c63 | 238 | reader->SwitchOnEMCAL(); |
cd54ca47 | 239 | //} |
240 | //if(kCalorimeter == "PHOS") { | |
afabc52f | 241 | reader->SwitchOnPHOSCells(); |
242 | reader->SwitchOnPHOS(); | |
cd54ca47 | 243 | //} |
1e3689fa | 244 | |
193828fd | 245 | // for case data="deltaAOD", no need to fill the EMCAL/PHOS cluster lists |
246 | if(kData.Contains("delta")){ | |
1e3689fa | 247 | reader->SwitchOffEMCAL(); |
248 | reader->SwitchOffPHOS(); | |
249 | reader->SwitchOffEMCALCells(); | |
250 | reader->SwitchOffPHOSCells(); | |
1e86c71e | 251 | } |
1e3689fa | 252 | |
cd54ca47 | 253 | //----------------- |
254 | // Event selection | |
255 | //----------------- | |
256 | ||
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"); | |
262 | } | |
263 | ||
264 | //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma | |
193828fd | 265 | |
193828fd | 266 | if (kCollisions=="pp" ) { |
267 | if(kRunNumber < 140000) reader->SwitchOnEventSelection(); // remove pileup by default | |
cd54ca47 | 268 | else reader->SwitchOffEventSelection(); |
193828fd | 269 | reader->SwitchOffV0ANDSelection() ; // and besides v0 AND |
270 | reader->SwitchOffPrimaryVertexSelection(); // and besides primary vertex | |
cd54ca47 | 271 | reader->SetZvertexCut(50.); // Open cut |
193828fd | 272 | } |
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 | |
cd54ca47 | 277 | reader->SetZvertexCut(10.); // Centrality defined in this range. |
278 | ||
279 | // Centrality | |
280 | reader->SetCentralityClass("V0M"); | |
281 | reader->SetCentralityOpt("10"); // 10 centrality bins | |
282 | reader->SetCentralityBin(-1,-1); // Accept all events, if not select range | |
283 | ||
284 | // Event plane (only used in AliAnaPi0 for the moment) | |
285 | reader->SetEventPlaneMethod("Q"); | |
69652c63 | 286 | } |
afabc52f | 287 | |
8f880b6e | 288 | reader->SetImportGeometryFromFile(kTRUE); |
289 | ||
193828fd | 290 | if(kPrint) reader->Print(""); |
291 | ||
292 | return reader; | |
293 | ||
294 | } | |
69652c63 | 295 | |
193828fd | 296 | //_______________________________________ |
297 | AliCalorimeterUtils* ConfigureCaloUtils() | |
298 | { | |
299 | ||
fa991e42 | 300 | AliCalorimeterUtils *cu = new AliCalorimeterUtils; |
cd54ca47 | 301 | cu->SetDebug(-1); |
69652c63 | 302 | |
193828fd | 303 | // Remove clusters close to borders, at least max energy cell is 1 cell away |
fa991e42 | 304 | cu->SetNumberOfCellsFromEMCALBorder(1); |
1e3689fa | 305 | cu->SetNumberOfCellsFromPHOSBorder(2); |
1e3689fa | 306 | |
193828fd | 307 | if(kClusterArray == "") |
308 | cu->SwitchOffRecalculateClusterTrackMatching(); // Done in clusterization | |
309 | else | |
310 | cu->SwitchOnRecalculateClusterTrackMatching(); | |
1e3689fa | 311 | |
15882d9f | 312 | cu->SwitchOnBadChannelsRemoval() ; |
1e3689fa | 313 | |
15882d9f | 314 | //EMCAL settings |
315 | if(kCalorimeter=="EMCAL"){ | |
316 | ||
317 | if(kYears==2010) cu->SetEMCALGeometryName("EMCAL_FIRSTYEARV1"); | |
318 | else cu->SetEMCALGeometryName("EMCAL_COMPLETEV1"); | |
319 | ||
320 | AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils(); | |
321 | ||
322 | Bool_t bCalib = kTRUE; | |
323 | Bool_t bBadMap= kTRUE; | |
324 | cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering | |
325 | ||
326 | TGeoHMatrix* matrix[12]; | |
327 | gROOT->LoadMacro("ConfigureEMCALRecoUtils.C"); | |
328 | ConfigureEMCALRecoUtils( | |
329 | recou, | |
330 | kSimulation, | |
331 | matrix, | |
332 | "",//AODB path, default | |
333 | kRunNumber, | |
334 | kPass, | |
335 | bCalib, | |
336 | bBadMap | |
337 | ); | |
338 | ||
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()); | |
341 | ||
342 | //Alignment matrices | |
343 | cu->SwitchOffLoadOwnEMCALGeometryMatrices(); | |
344 | /* | |
345 | for (Int_t mod=0;mod<12;mod++) | |
346 | { | |
347 | //((TGeoHMatrix*) mobj->At(mod))->Print(); | |
348 | cu->SetEMCALGeometryMatrixInSM(matrix[mod],mod); | |
349 | } | |
350 | */ | |
351 | ||
352 | // Non linearity | |
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); | |
357 | } | |
358 | ||
359 | recou->SwitchOnRejectExoticCell(); | |
360 | if(kClusterArray == "") recou->SwitchOnRejectExoticCluster(); | |
361 | else recou->SwitchOffRejectExoticCluster(); | |
362 | ||
363 | } | |
364 | else { // PHOS settings | |
365 | ||
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; | |
369 | ||
370 | // Bad map | |
371 | ||
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"); | |
378 | if(!maps){ | |
379 | printf("Can not read Bad map for run %d. \n You may choose to use your map with ForceUsingBadMap()\n",run2010) ; | |
380 | } | |
381 | else{ | |
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); | |
385 | ||
386 | if(hbmPH) | |
387 | delete hbmPH ; | |
388 | hbmPH=(TH2I*)maps->At(mod); | |
389 | ||
390 | if(hbmPH) hbmPH->SetDirectory(0); | |
391 | ||
392 | cu->SetPHOSChannelStatusMap(mod-1,hbmPH); | |
393 | } | |
394 | } | |
395 | ||
396 | //Alignment matrices | |
397 | cu->SwitchOffLoadOwnPHOSGeometryMatrices(); | |
398 | /* | |
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++) | |
405 | { | |
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); | |
409 | } | |
410 | */ | |
411 | }// PHOS | |
1e3689fa | 412 | |
193828fd | 413 | if(kPrint) cu->Print(""); |
afabc52f | 414 | |
193828fd | 415 | return cu; |
416 | ||
417 | } | |
418 | ||
419 | //_____________________________________ | |
420 | AliAnaPhoton* ConfigurePhotonAnalysis() | |
421 | { | |
4df35693 | 422 | |
423 | AliAnaPhoton *anaphoton = new AliAnaPhoton(); | |
424 | anaphoton->SetDebug(-1); //10 for lots of messages | |
cd54ca47 | 425 | |
426 | // cluster selection cuts | |
427 | ||
428 | anaphoton->SwitchOffFiducialCut(); | |
429 | ||
430 | anaphoton->SetCalorimeter(kCalorimeter); | |
193828fd | 431 | |
432 | if(kCalorimeter == "PHOS"){ | |
433 | anaphoton->SetNCellCut(2);// At least 2 cells | |
f676c850 | 434 | anaphoton->SetMinPt(0.3); |
1e3689fa | 435 | anaphoton->SetMinDistanceToBadChannel(2, 4, 5); |
caa8a222 | 436 | anaphoton->SetTimeCut(-2000,2000); // open cut, usual time window of [425-825] ns if time recalibration is off |
57eb7f00 | 437 | } |
438 | else {//EMCAL | |
193828fd | 439 | anaphoton->SetNCellCut(1);// At least 2 cells |
cd54ca47 | 440 | anaphoton->SetMinPt(0.5); // avoid mip peak at E = 260 MeV |
193828fd | 441 | anaphoton->SetMaxPt(1000); |
5eef1db1 | 442 | anaphoton->SetTimeCut(-1000,1000); // open cut, usual time window of [425-825] ns if time recalibration is off |
15882d9f | 443 | // restrict to less than 100 ns when time calibration is on |
cd54ca47 | 444 | anaphoton->SetMinDistanceToBadChannel(1, 2, 3); // For filtered AODs, new releases. |
57eb7f00 | 445 | } |
193828fd | 446 | |
cd54ca47 | 447 | anaphoton->SwitchOnTrackMatchRejection() ; |
193828fd | 448 | |
cd54ca47 | 449 | //PID cuts (shower shape) |
c1624f38 | 450 | anaphoton->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian |
193828fd | 451 | AliCaloPID* caloPID = anaphoton->GetCaloPID(); |
c1624f38 | 452 | //Not used in bayesian |
453 | ||
454 | //EMCAL | |
455 | caloPID->SetEMCALLambda0CutMax(0.30); | |
456 | caloPID->SetEMCALLambda0CutMin(0.10); | |
457 | ||
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); | |
465 | } | |
466 | ||
467 | //PHOS | |
468 | caloPID->SetPHOSDispersionCut(2.5); | |
469 | caloPID->SetPHOSRCut(2.); | |
470 | if(kData=="AOD") caloPID->SetPHOSRCut(2000.); // Open cut since dX, dZ not stored | |
471 | ||
472 | if(kCalorimeter=="PHOS"){ | |
473 | caloPID->SetHistoDEtaRangeAndNBins(-200, 200, 200); // dZ | |
474 | caloPID->SetHistoDPhiRangeAndNBins(-200, 200, 200); // dX | |
475 | } | |
476 | ||
477 | //caloPID->SetTOFCut(10000000); // Not used, only to set PID bits | |
478 | ||
cd54ca47 | 479 | anaphoton->SwitchOffFillShowerShapeHistograms(); // Filled before photon shower shape selection |
193828fd | 480 | |
cd54ca47 | 481 | // Input / output delta AOD settings |
1e3689fa | 482 | |
193828fd | 483 | if(!kData.Contains("delta")) { |
484 | anaphoton->SetOutputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data())); | |
1e3689fa | 485 | anaphoton->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); |
cd54ca47 | 486 | //anaphoton->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done |
4df35693 | 487 | } |
193828fd | 488 | else anaphoton->SetInputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data())); |
489 | ||
cd54ca47 | 490 | //Set Histograms name tag, bins and ranges |
491 | ||
193828fd | 492 | anaphoton->AddToHistogramsName("AnaPhoton_"); |
cd54ca47 | 493 | SetHistoRangeAndNBins(anaphoton); // see method below |
193828fd | 494 | |
cd54ca47 | 495 | // Number of particle type MC histograms |
496 | anaphoton->FillNOriginHistograms(8); | |
497 | anaphoton->FillNPrimaryHistograms(4); | |
7e7694bb | 498 | |
193828fd | 499 | if(kPrint) anaphoton->Print(""); |
500 | ||
501 | return anaphoton; | |
15882d9f | 502 | |
193828fd | 503 | } |
504 | ||
cd54ca47 | 505 | //_______________________________________________ |
506 | AliAnaChargedParticles* ConfigureChargedAnalysis() | |
507 | { | |
508 | ||
509 | AliAnaChargedParticles *anatrack = new AliAnaChargedParticles(); | |
510 | anatrack->SetDebug(-1); //10 for lots of messages | |
511 | ||
512 | // selection cuts | |
513 | ||
514 | anatrack->SetDebug(-1);//10 for lots of messages | |
515 | anatrack->SetMinPt(5.); | |
516 | anatrack->SwitchOffFiducialCut(); | |
517 | ||
518 | // Input / output delta AOD settings | |
519 | ||
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 | |
524 | } | |
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 | |
528 | ||
529 | anatrack->AddToHistogramsName("AnaHadrons_"); | |
530 | SetHistoRangeAndNBins(anatrack); // see method below | |
531 | ||
532 | if(kPrint) anatrack->Print(""); | |
533 | ||
534 | return anatrack; | |
535 | ||
536 | } | |
537 | ||
538 | ||
193828fd | 539 | //_______________________________ |
540 | AliAnaPi0* ConfigurePi0Analysis() | |
541 | { | |
1e3689fa | 542 | |
90eb3a19 | 543 | AliAnaPi0 *anapi0 = new AliAnaPi0(); |
cd54ca47 | 544 | |
74b57e64 | 545 | anapi0->SetDebug(-1);//10 for lots of messages |
cd54ca47 | 546 | if(kPrint) anapi0->Print(""); |
547 | ||
548 | // Input delta AOD settings | |
193828fd | 549 | anapi0->SetInputAODName(Form("Photon%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data())); |
cd54ca47 | 550 | |
551 | // Calorimeter settings | |
193828fd | 552 | anapi0->SetCalorimeter(kCalorimeter); |
cd54ca47 | 553 | if(kCalorimeter=="PHOS") anapi0->SetNumberOfModules(3); //PHOS first year |
554 | else { | |
555 | if(kYears==2010) anapi0->SetNumberOfModules(4); //EMCAL first year | |
556 | else anapi0->SetNumberOfModules(10); | |
557 | } | |
193828fd | 558 | |
559 | //settings for pp collision mixing | |
560 | anapi0->SwitchOnOwnMix(); //Off when mixing done with general mixing frame | |
561 | ||
cd54ca47 | 562 | // Cuts |
563 | if(kCalorimeter=="EMCAL") anapi0->SetPairTimeCut(70); | |
564 | ||
193828fd | 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(); | |
572 | } | |
573 | else if(kCollisions=="PbPb") { | |
574 | anapi0->SetNCentrBin(10); | |
575 | anapi0->SetNZvertBin(10); | |
576 | anapi0->SetNRPBin(4); | |
577 | anapi0->SetNMaxEvMix(10); | |
578 | anapi0->SwitchOffSMCombinations(); | |
579 | } | |
580 | ||
cd54ca47 | 581 | //Set Histograms name tag, bins and ranges |
193828fd | 582 | |
cd54ca47 | 583 | anapi0->AddToHistogramsName("AnaPi0_"); |
584 | SetHistoRangeAndNBins(anapi0); // see method below | |
193828fd | 585 | |
586 | return anapi0; | |
587 | ||
588 | } | |
af7b3903 | 589 | |
193828fd | 590 | //_____________________________________________________ |
591 | AliAnaPi0EbE* ConfigurePi0EbEAnalysis(TString particle, | |
592 | Int_t analysis) | |
593 | { | |
7e7694bb | 594 | |
32301b07 | 595 | AliAnaPi0EbE *anapi0ebe = new AliAnaPi0EbE(); |
596 | anapi0ebe->SetDebug(-1);//10 for lots of messages | |
cd54ca47 | 597 | |
193828fd | 598 | anapi0ebe->SetAnalysisType(analysis); |
599 | TString opt = ""; | |
600 | if(analysis==AliAnaPi0EbE::kIMCaloTracks) opt = "Conv"; | |
601 | if(analysis==AliAnaPi0EbE::kSSCalo) opt = "SS"; | |
602 | ||
603 | anapi0ebe->SwitchOffFillWeightHistograms(); | |
604 | anapi0ebe->SetMinPt(0.5); | |
cd54ca47 | 605 | if(kCalorimeter=="EMCAL")anapi0ebe->SetPairTimeCut(20); |
193828fd | 606 | anapi0ebe->SetCalorimeter(kCalorimeter); |
607 | ||
cd54ca47 | 608 | // Input / output delta AOD settings |
609 | ||
193828fd | 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())); | |
4f155d15 | 613 | anapi0ebe->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); |
32301b07 | 614 | } |
193828fd | 615 | else anapi0ebe->SetInputAODName(Form("%s%s%s_Trig%s_Cl%s",particle.Data(),opt.Data(),kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data())); |
616 | ||
617 | if(analysis == AliAnaPi0EbE::kIMCaloTracks) anapi0ebe->SetInputAODGammaConvName("PhotonsCTS"); | |
4f155d15 | 618 | |
193828fd | 619 | if(analysis!=AliAnaPi0EbE::kSSCalo){ |
620 | ||
621 | AliNeutralMesonSelection *nms = anapi0ebe->GetNeutralMesonSelection(); | |
622 | nms->SetParticle(particle); | |
15882d9f | 623 | nms->SwitchOffAngleSelection(); |
193828fd | 624 | nms->KeepNeutralMesonSelectionHistos(kTRUE); |
625 | //nms->SetAngleMaxParam(2,0.2); | |
626 | nms->SetHistoERangeAndNBins(0, 20, 100) ; | |
627 | //nms->SetHistoIMRangeAndNBins(0, 1, 400); | |
57b97dc6 | 628 | } |
193828fd | 629 | |
cd54ca47 | 630 | //Set Histograms name tag, bins and ranges |
193828fd | 631 | |
cd54ca47 | 632 | anapi0ebe->AddToHistogramsName(Form("Ana%s%sEbE_",particle.Data(),opt.Data())); |
633 | SetHistoRangeAndNBins(anapi0ebe); // see method below | |
193828fd | 634 | |
635 | if(kPrint) anapi0ebe->Print(""); | |
636 | ||
637 | return anapi0ebe; | |
638 | ||
639 | } | |
640 | ||
641 | //___________________________________________________________________ | |
cd54ca47 | 642 | AliAnaParticleIsolation* ConfigureIsolationAnalysis(TString particle="Photon", |
643 | Int_t partInCone = AliIsolationCut::kOnlyCharged, | |
644 | Int_t thresType = AliIsolationCut::kSumPtFracIC, | |
645 | Bool_t multi = kFALSE) | |
193828fd | 646 | { |
647 | ||
90eb3a19 | 648 | AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation(); |
649 | anaisol->SetDebug(-1); | |
cd54ca47 | 650 | |
193828fd | 651 | anaisol->SetMinPt(5); |
cd54ca47 | 652 | |
653 | // Input / output delta AOD settings | |
654 | ||
193828fd | 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())); | |
657 | ||
658 | anaisol->SetCalorimeter(kCalorimeter); | |
659 | ||
cd54ca47 | 660 | //Do settings for main isolation cut class |
7787a778 | 661 | AliIsolationCut * ic = anaisol->GetIsolationCut(); |
662 | ic->SetConeSize(0.4); | |
cd54ca47 | 663 | ic->SetPtThreshold(0.5); |
2244659d | 664 | ic->SetPtFraction(0.1); |
665 | ic->SetSumPtThreshold(1.0) ; | |
cd54ca47 | 666 | ic->SetParticleTypeInCone(partInCone); |
667 | ic->SetICMethod(thresType); | |
1e3689fa | 668 | |
90eb3a19 | 669 | //Do or not do isolation with previously produced AODs. |
670 | //No effect if use of SwitchOnSeveralIsolation() | |
671 | anaisol->SwitchOffReIsolation(); | |
672 | //Multiple IC | |
cd54ca47 | 673 | if(multi) anaisol->SwitchOnSeveralIsolation() ; |
674 | else anaisol->SwitchOffSeveralIsolation() ; | |
675 | ||
676 | //Set Histograms name tag, bins and ranges | |
677 | ||
193828fd | 678 | anaisol->AddToHistogramsName(Form("AnaIsol%s_",particle.Data())); |
cd54ca47 | 679 | SetHistoRangeAndNBins(anaisol); // see method below |
680 | ||
681 | if(kPrint) ic ->Print(""); | |
193828fd | 682 | if(kPrint) anaisol->Print(""); |
683 | ||
684 | return anaisol; | |
685 | ||
686 | } | |
687 | ||
688 | //___________________________________________________________________________________ | |
689 | AliAnaParticleHadronCorrelation* ConfigureHadronCorrelationAnalysis(TString particle, | |
690 | Int_t bIsolated) | |
691 | { | |
90eb3a19 | 692 | |
a3aebfff | 693 | AliAnaParticleHadronCorrelation *anacorrhadron = new AliAnaParticleHadronCorrelation(); |
cd54ca47 | 694 | anacorrhadron->SetDebug(-1); |
695 | ||
696 | anacorrhadron->SetPtCutRange(5,200); | |
697 | ||
698 | // Input / output delta AOD settings | |
699 | ||
193828fd | 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)); | |
193828fd | 703 | |
704 | anacorrhadron->SelectIsolated(bIsolated); // do correlation with isolated photons | |
705 | ||
2244659d | 706 | anacorrhadron->SwitchOnDecayCorr(); |
707 | anacorrhadron->SetMultiBin(1); | |
2244659d | 708 | anacorrhadron->SwitchOffNeutralCorr(); |
709 | anacorrhadron->SwitchOffEventSelection(); | |
a3aebfff | 710 | anacorrhadron->SetDeltaPhiCutRange(1.5,4.5); |
cd54ca47 | 711 | |
2d3dce11 | 712 | anacorrhadron->SwitchOnSeveralUECalculation(); |
afabc52f | 713 | anacorrhadron->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3); |
cd54ca47 | 714 | |
193828fd | 715 | //if(kCalorimeter=="PHOS"){ |
afabc52f | 716 | //Correlate with particles in EMCAL |
717 | //anacorrhadron->SwitchOnCaloPID(); | |
cd54ca47 | 718 | //anacorrhadron->SwitchOnCaloPIDRecalculation(); |
de8a210f | 719 | //} |
cd54ca47 | 720 | |
721 | //Set Histograms name tag, bins and ranges | |
722 | ||
723 | anacorrhadron->AddToHistogramsName(Form("Ana%sHadronCorr_Iso%d_",particle.Data(),bIsolated)); | |
724 | SetHistoRangeAndNBins(anacorrhadron); // see method below | |
725 | ||
193828fd | 726 | if(kPrint) anacorrhadron->Print(""); |
1e3689fa | 727 | |
193828fd | 728 | return anacorrhadron; |
1e3689fa | 729 | |
193828fd | 730 | } |
69652c63 | 731 | |
193828fd | 732 | //________________________________________ |
733 | AliAnaCalorimeterQA* ConfigureQAAnalysis() | |
734 | { | |
90eb3a19 | 735 | |
193828fd | 736 | AliAnaCalorimeterQA *anaQA = new AliAnaCalorimeterQA(); |
737 | //anaQA->SetDebug(10); //10 for lots of messages | |
738 | anaQA->SetCalorimeter(kCalorimeter); | |
a3aebfff | 739 | |
5eef1db1 | 740 | anaQA->SetTimeCut(-1000,1000); // Open time cut |
741 | ||
8f880b6e | 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 | |
744 | else | |
745 | anaQA->SwitchOffCorrelation(); | |
746 | ||
193828fd | 747 | anaQA->SwitchOffFiducialCut(); |
193828fd | 748 | anaQA->SwitchOffFillAllTH3Histogram(); |
749 | anaQA->SwitchOffFillAllPositionHistogram(); | |
8f880b6e | 750 | anaQA->SwitchOffFillAllPositionHistogram2(); |
193828fd | 751 | |
8f880b6e | 752 | anaQA->SwitchOffStudyBadClusters() ; // On only for EMCAL |
cd54ca47 | 753 | anaQA->SwitchOffStudyClustersAsymmetry(); |
754 | anaQA->SwitchOffStudyWeight(); | |
193828fd | 755 | anaQA->SwitchOffFillAllTrackMatchingHistogram(); |
756 | ||
8f880b6e | 757 | if(kCalorimeter=="EMCAL") |
758 | { | |
cd54ca47 | 759 | if(kYears==2010) |
193828fd | 760 | anaQA->SetNumberOfModules(4); |
cd54ca47 | 761 | else{ |
193828fd | 762 | anaQA->SetNumberOfModules(10); |
193828fd | 763 | } |
8f880b6e | 764 | } |
765 | else | |
766 | {//PHOS | |
767 | anaQA->SetNumberOfModules(3); | |
768 | } | |
769 | ||
cd54ca47 | 770 | anaQA->AddToHistogramsName("QA_"); //Begining of histograms name |
771 | SetHistoRangeAndNBins(anaQA); // see method below | |
772 | ||
193828fd | 773 | if(kPrint) anaQA->Print(""); |
774 | ||
775 | return anaQA; | |
69652c63 | 776 | |
90eb3a19 | 777 | } |
193828fd | 778 | |
cd54ca47 | 779 | //________________________________________________________ |
780 | void SetHistoRangeAndNBins (AliAnaPartCorrBaseClass* ana) | |
781 | { | |
782 | // Set common bins for all analysis and MC histograms filling | |
783 | ||
784 | if(kSimulation) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet. | |
785 | else ana->SwitchOffDataMC() ; | |
786 | ||
787 | ana->SetHistoPtRangeAndNBins(0, 100, 250) ; // Energy and pt histograms | |
788 | ||
789 | if(kCalorimeter=="EMCAL"){ | |
790 | if(kYears==2010){ | |
791 | ana->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ; | |
792 | ana->SetHistoXRangeAndNBins(-230,90,120); // QA | |
793 | ana->SetHistoYRangeAndNBins(370,450,40); // QA | |
794 | } | |
795 | else { | |
796 | ana->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ; | |
797 | ana->SetHistoXRangeAndNBins(-600,90,200); // QA | |
798 | ana->SetHistoYRangeAndNBins(100,450,100); // QA | |
799 | } | |
800 | ||
801 | ana->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ; | |
802 | } | |
803 | else{ | |
804 | ana->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ; | |
805 | ana->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ; | |
806 | ||
807 | } | |
808 | ||
809 | ana->SetHistoShowerShapeRangeAndNBins(0, 3, 300); | |
810 | ||
811 | // Invariant mass analysis | |
812 | ana->SetHistoMassRangeAndNBins(0., 1., 200) ; | |
813 | ana->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ; | |
814 | ||
815 | // check if time calibration is on | |
816 | ana->SetHistoTimeRangeAndNBins(-1000.,1000,1000); | |
817 | ana->SetHistoDiffTimeRangeAndNBins(-200, 200, 800); | |
818 | ||
819 | // QA, electron, charged | |
820 | ana->SetHistoPOverERangeAndNBins(0,10.,100); | |
821 | ana->SetHistodEdxRangeAndNBins(0.,200.,200); | |
822 | ||
823 | // QA | |
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); | |
834 | ||
835 | } | |
193828fd | 836 |