]>
Commit | Line | Data |
---|---|---|
bef94c35 | 1 | |
2 | Bool_t kPrint = kFALSE; | |
3 | Bool_t kSimulation = kFALSE; | |
4 | Bool_t kUseKinematics = kFALSE; | |
5 | Bool_t kOutputAOD = kFALSE; | |
6 | Bool_t kEventSelection= kFALSE; | |
7 | Bool_t kExotic = kTRUE; | |
8 | Bool_t kNonLinearity = kFALSE; | |
9 | Int_t kYears = 2011; | |
10 | TString kCollisions = "pp"; | |
11 | TString kTrig = "EMC7" ; | |
12 | TString kClusterArray = ""; | |
13 | TString kData = "ESD"; | |
14 | TString kInputDataType = "ESD"; | |
15 | TString kCalorimeter = "EMCAL"; | |
16 | Bool_t kTM = kTRUE; | |
17 | Bool_t kRecalTM = kTRUE; | |
18 | Int_t kMinCen = -1; | |
19 | Int_t kMaxCen = -1; | |
20 | TString kName = ""; | |
21 | Int_t kDebug = -1; | |
22 | Bool_t kQA = kFALSE; | |
bef94c35 | 23 | Bool_t kCalibE = kTRUE; |
24 | Bool_t kCalibT = kTRUE; | |
25 | Bool_t kBadMap = kTRUE; | |
26 | ||
27 | AliAnalysisTaskCaloTrackCorrelation *AddTaskShowerShapeStudies(const TString data = "AOD", | |
28 | const TString calorimeter = "EMCAL", | |
29 | const Bool_t simulation = kFALSE, | |
30 | const Bool_t eventsel = kFALSE, | |
31 | const Bool_t exotic = kTRUE, | |
32 | const Bool_t nonlin = kFALSE, | |
33 | TString outputfile = "", | |
d2655d46 | 34 | const Int_t year = 2011, |
bef94c35 | 35 | const TString col = "pp", |
36 | const TString trigger = "MB", | |
37 | const TString clustersArray = "V1", | |
38 | const Bool_t recaltm = kTRUE, | |
39 | const Bool_t tm = kTRUE, | |
40 | const Int_t minCen = -1, | |
41 | const Int_t maxCen = -1, | |
42 | const Bool_t qaan = kFALSE, | |
bef94c35 | 43 | const Bool_t calibE = kTRUE, |
44 | const Bool_t badmap = kTRUE, | |
45 | const Bool_t calibT = kTRUE, | |
46 | const Bool_t outputAOD = kFALSE, | |
47 | const Bool_t printSettings = kFALSE | |
48 | ) | |
49 | { | |
50 | // Creates a CaloTrackCorr task, configures it and adds it to the analysis manager. | |
51 | ||
52 | kPrint = printSettings; | |
53 | kSimulation = simulation; | |
54 | kYears = year; | |
55 | kCollisions = col; | |
56 | kExotic = exotic; | |
57 | kNonLinearity = nonlin; | |
58 | kTrig = trigger; | |
59 | kClusterArray = clustersArray; | |
60 | kData = data; | |
61 | kCalorimeter = calorimeter; | |
62 | kOutputAOD = outputAOD; | |
63 | kTM = tm; | |
64 | kRecalTM = recaltm; | |
65 | kMinCen = minCen; | |
66 | kMaxCen = maxCen; | |
67 | kEventSelection= eventsel; | |
68 | kQA = qaan; | |
bef94c35 | 69 | kCalibE = calibE; |
70 | kCalibT = calibT; | |
71 | kBadMap = badmap; | |
72 | ||
73 | // Get the pointer to the existing analysis manager via the static access method. | |
74 | ||
75 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
76 | if (!mgr) | |
77 | { | |
78 | ::Error("AddTask", "No analysis manager to connect to."); | |
79 | return NULL; | |
80 | } | |
81 | ||
82 | // Check the analysis type using the event handlers connected to the analysis manager. | |
83 | ||
84 | if (!mgr->GetInputEventHandler()) | |
85 | { | |
86 | ::Error("AddTask", "This task requires an input event handler"); | |
87 | return NULL; | |
88 | } | |
89 | ||
90 | kInputDataType = "AOD"; | |
91 | if(!kData.Contains("delta")) | |
92 | kInputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
93 | ||
94 | if(kSimulation) | |
95 | { | |
96 | kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE; | |
97 | if (!kUseKinematics && data=="AOD" && kInputDataType != "ESD") kUseKinematics = kTRUE; //AOD primary should be available ... | |
98 | } | |
99 | ||
100 | cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl; | |
101 | ||
102 | // Name for containers | |
103 | ||
104 | kName = Form("%s_Trig%s_Cl%s_TM%d",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data(),kTM); | |
105 | ||
106 | if(kCollisions=="PbPb" && kMaxCen>=0) kName+=Form("Cen%d_%d",kMinCen,kMaxCen); | |
107 | ||
108 | printf("<<<< NAME: %s >>>>>\n",kName.Data()); | |
109 | ||
110 | // #### Configure analysis #### | |
111 | ||
112 | AliAnaCaloTrackCorrMaker * maker = new AliAnaCaloTrackCorrMaker(); | |
113 | ||
114 | // General frame setting and configuration | |
115 | maker->SetReader (ConfigureReader() ); | |
116 | maker->SetCaloUtils(ConfigureCaloUtils()); | |
117 | ||
118 | // Analysis tasks setting and configuration | |
d2655d46 | 119 | Int_t n = 0;//Analysis number, order is important |
bef94c35 | 120 | |
d2655d46 | 121 | maker->AddAnalysis(ConfigurePhotonAnalysis(), n++); // Photon cluster selection |
bef94c35 | 122 | maker->AddAnalysis(ConfigureElectronAnalysis(),n++); // Electron cluster selection |
123 | maker->AddAnalysis(ConfigurePi0EbEAnalysis("Pi0", AliAnaPi0EbE::kIMCalo), n++); // Pi0 event by event selection, and photon tagging from decay | |
124 | maker->AddAnalysis(ConfigurePi0EbEAnalysis("Eta", AliAnaPi0EbE::kIMCalo), n++); // Eta event by event selection, and photon tagging from decay | |
bef94c35 | 125 | |
d2655d46 | 126 | if(kCalorimeter=="EMCAL") |
127 | { | |
128 | maker->AddAnalysis(ConfigurePi0EbEAnalysis("Pi0", AliAnaPi0EbE::kSSCalo), n++); // Pi0 event by event selection, and photon tagging from decay | |
129 | maker->AddAnalysis(ConfigureInClusterIMAnalysis(0.5,100), n++); | |
130 | } | |
bef94c35 | 131 | |
d2655d46 | 132 | if(kQA) maker->AddAnalysis(ConfigureQAAnalysis(),n++); |
bef94c35 | 133 | |
134 | maker->SetAnaDebug(kDebug) ; | |
135 | maker->SwitchOnHistogramsMaker() ; | |
136 | if(kData.Contains("delta")) maker->SwitchOffAODsMaker() ; | |
137 | else maker->SwitchOnAODsMaker() ; | |
138 | ||
139 | if(kPrint) maker->Print(""); | |
140 | ||
141 | printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, kCalorimeter.Data()); | |
142 | // CAREFUL | |
143 | //kName = Form("%s_Trig%s_Cl%s_TM%d",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data(),kFALSE); | |
144 | kName = Form("%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data()); | |
145 | if(kCollisions=="PbPb" && kMaxCen>=0) kName+=Form("Cen%d_%d",kMinCen,kMaxCen); | |
146 | ||
147 | // Create task | |
148 | ||
149 | AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("CaloTrackCorr%s",kName.Data())); | |
150 | task->SetConfigFileName(""); //Don't configure the analysis via configuration file. | |
151 | task->SetDebugLevel(kDebug); | |
152 | task->SetBranches("ESD:AliESDRun.,AliESDHeader"); | |
153 | task->SetAnalysisMaker(maker); | |
154 | mgr->AddTask(task); | |
155 | ||
156 | //Create containers | |
157 | ||
158 | if(outputfile.Length()==0) outputfile = AliAnalysisManager::GetCommonFileName(); | |
159 | ||
160 | AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(kName, TList::Class(), | |
161 | AliAnalysisManager::kOutputContainer, | |
162 | Form("%s",outputfile.Data())); | |
163 | ||
164 | AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Cuts_%s",kName.Data()), TList::Class(), | |
165 | AliAnalysisManager::kParamContainer, | |
166 | Form("%s",outputfile.Data())); | |
167 | ||
168 | // Create ONLY the output containers for the data produced by the task. | |
169 | // Get and connect other common input/output containers via the manager as below | |
170 | //============================================================================== | |
171 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer()); | |
172 | // AOD output slot will be used in a different way in future | |
173 | if(!kData.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer()); | |
174 | mgr->ConnectOutput (task, 1, cout_pc); | |
175 | mgr->ConnectOutput (task, 2, cout_cuts); | |
176 | ||
177 | ||
d2655d46 | 178 | if(kTrig=="EMC7") |
179 | { | |
bef94c35 | 180 | printf("CaloTrackCorr trigger EMC7\n"); |
181 | task->SelectCollisionCandidates(AliVEvent::kEMC7); | |
182 | } | |
d2655d46 | 183 | else if (kTrig=="INT7") |
184 | { | |
bef94c35 | 185 | printf("CaloTrackCorr trigger INT7\n"); |
186 | task->SelectCollisionCandidates(AliVEvent::kINT7); | |
187 | } | |
d2655d46 | 188 | else if(kTrig=="EMC1") |
189 | { | |
bef94c35 | 190 | printf("CaloTrackCorr trigger EMC1\n"); |
191 | task->SelectCollisionCandidates(AliVEvent::kEMC1); | |
192 | } | |
d2655d46 | 193 | else if(kTrig=="MB") |
194 | { | |
bef94c35 | 195 | printf("CaloTrackCorr trigger MB\n"); |
196 | task->SelectCollisionCandidates(AliVEvent::kMB); | |
197 | } | |
d2655d46 | 198 | else if(kTrig=="PHOS") |
199 | { | |
bef94c35 | 200 | printf("CaloTrackCorr trigger PHOS\n"); |
201 | task->SelectCollisionCandidates(AliVEvent::kPHI7); | |
202 | } | |
d2655d46 | 203 | else if(kTrig=="PHOSPb") |
204 | { | |
bef94c35 | 205 | printf("CaloTrackCorr trigger PHOSPb\n"); |
206 | task->SelectCollisionCandidates(AliVEvent::kPHOSPb); | |
207 | } | |
208 | else if(kTrig=="AnyINT") | |
209 | { | |
210 | printf("CaloTrackCorr trigger AnyINT\n"); | |
211 | task->SelectCollisionCandidates(AliVEvent::kAnyINT); | |
212 | } | |
213 | else if(kTrig=="INT") | |
214 | { | |
215 | printf("CaloTrackCorr trigger AnyINT\n"); | |
216 | task->SelectCollisionCandidates(AliVEvent::kAny); | |
217 | } | |
218 | else if(kTrig=="EMCEGA") | |
219 | { | |
220 | printf("CaloTrackCorr trigger EMC Gamma\n"); | |
221 | task->SelectCollisionCandidates(AliVEvent::kEMCEGA); | |
222 | } | |
223 | else if(kTrig=="EMCEJE") | |
224 | { | |
225 | printf("CaloTrackCorr trigger EMC Jet\n"); | |
226 | task->SelectCollisionCandidates(AliVEvent::kEMCEJE); | |
227 | } | |
228 | else if(kTrig=="Central") | |
229 | { | |
230 | printf("CaloTrackCorr trigger Central\n"); | |
231 | task->SelectCollisionCandidates(AliVEvent::kCentral); | |
232 | } | |
233 | else if(kTrig=="SemiCentral") | |
234 | { | |
235 | printf("CaloTrackCorr trigger SemiCentral\n"); | |
236 | task->SelectCollisionCandidates(AliVEvent::kSemiCentral); | |
237 | } | |
238 | ||
239 | return task; | |
240 | } | |
241 | ||
242 | //____________________________________ | |
243 | AliCaloTrackReader * ConfigureReader() | |
244 | { | |
245 | ||
246 | AliCaloTrackReader * reader = 0; | |
247 | if (kData.Contains("AOD")) reader = new AliCaloTrackAODReader(); | |
248 | else if(kData=="ESD") reader = new AliCaloTrackESDReader(); | |
249 | else if(kData=="MC" && | |
250 | kInputDataType == "ESD") reader = new AliCaloTrackMCReader(); | |
251 | ||
252 | reader->SetDebug(kDebug);//10 for lots of messages | |
253 | ||
254 | //Delta AOD? | |
255 | //reader->SetDeltaAODFileName(""); | |
256 | if(kOutputAOD) reader->SwitchOnWriteDeltaAOD() ; | |
257 | ||
258 | // MC settings | |
259 | if(kUseKinematics){ | |
260 | if(kInputDataType == "ESD"){ | |
261 | reader->SwitchOnStack(); | |
262 | reader->SwitchOffAODMCParticles(); | |
263 | } | |
264 | else if(kInputDataType == "AOD"){ | |
265 | reader->SwitchOffStack(); | |
266 | reader->SwitchOnAODMCParticles(); | |
267 | } | |
268 | } | |
269 | ||
270 | //------------------------ | |
271 | // Detector input filling | |
272 | //------------------------ | |
273 | ||
274 | //Min cluster/track E | |
d2655d46 | 275 | reader->SetEMCALEMin(0.3); |
bef94c35 | 276 | reader->SetEMCALEMax(1000); |
277 | reader->SetPHOSEMin(0.3); | |
278 | reader->SetPHOSEMax(1000); | |
279 | reader->SetCTSPtMin(0.1); | |
280 | reader->SetCTSPtMax(1000); | |
281 | ||
d2655d46 | 282 | if(!kSimulation && kCalibT) reader->SetEMCALTimeCut(-30,30); |
283 | else reader->SetEMCALTimeCut(-1000,1000); // Open time cut | |
284 | ||
bef94c35 | 285 | reader->SwitchOnFiducialCut(); |
286 | reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ; | |
287 | ||
d2655d46 | 288 | // Tracks (do not filter tracks for SS studies) |
289 | reader->SwitchOffCTS(); | |
290 | ||
bef94c35 | 291 | if(kInputDataType=="ESD") |
292 | { | |
293 | gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C"); | |
294 | AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004); | |
295 | reader->SetTrackCuts(esdTrackCuts); | |
296 | } | |
297 | else if(kInputDataType=="AOD") | |
298 | { | |
299 | reader->SetTrackFilterMask(128); // Filter bit, not mask | |
300 | } | |
301 | ||
302 | // Calorimeter | |
303 | ||
304 | reader->SetEMCALClusterListName(kClusterArray); | |
305 | if(kClusterArray == "") | |
306 | { | |
307 | printf("**************** Standard EMCAL clusters branch analysis **************** \n"); | |
308 | reader->SwitchOnClusterRecalculation(); | |
309 | // Check in ConfigureCaloUtils that the recalibration and bad map are ON | |
310 | } | |
311 | else | |
312 | { | |
313 | printf("**************** Input for analysis is Clusterizer %s **************** \n", kClusterArray.Data()); | |
314 | reader->SwitchOffClusterRecalculation(); | |
315 | } | |
316 | ||
d2655d46 | 317 | if(kCalorimeter == "EMCAL") |
318 | { | |
bef94c35 | 319 | reader->SwitchOnEMCALCells(); |
320 | reader->SwitchOnEMCAL(); | |
d2655d46 | 321 | } |
322 | if(kCalorimeter == "PHOS") | |
323 | { | |
bef94c35 | 324 | reader->SwitchOnPHOSCells(); |
325 | reader->SwitchOnPHOS(); | |
d2655d46 | 326 | } |
bef94c35 | 327 | |
328 | // for case data="deltaAOD", no need to fill the EMCAL/PHOS cluster lists | |
d2655d46 | 329 | if(kData.Contains("delta")) |
330 | { | |
bef94c35 | 331 | reader->SwitchOffEMCAL(); |
332 | reader->SwitchOffPHOS(); | |
333 | reader->SwitchOffEMCALCells(); | |
334 | reader->SwitchOffPHOSCells(); | |
335 | } | |
336 | ||
337 | //----------------- | |
338 | // Event selection | |
339 | //----------------- | |
340 | ||
341 | //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma | |
342 | ||
d2655d46 | 343 | reader->SetZvertexCut(10.); |
bef94c35 | 344 | |
345 | if(kEventSelection) | |
346 | { | |
347 | reader->SwitchOnEventSelection(); // remove pileup by default | |
348 | reader->SwitchOnV0ANDSelection() ; // and besides v0 AND | |
349 | reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex | |
350 | } | |
351 | else | |
352 | { | |
353 | reader->SwitchOffEventSelection(); // remove pileup by default | |
354 | reader->SwitchOffV0ANDSelection() ; // and besides v0 AND | |
355 | reader->SwitchOffPrimaryVertexSelection(); // and besides primary vertex | |
356 | } | |
357 | ||
358 | if(kCollisions=="PbPb") | |
359 | { | |
360 | // Centrality | |
361 | reader->SetCentralityClass("V0M"); | |
362 | reader->SetCentralityOpt(10); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..) | |
363 | reader->SetCentralityBin(kMinCen,kMaxCen); // Accept all events, if not select range | |
364 | ||
365 | // Event plane (only used in AliAnaPi0 for the moment) | |
366 | reader->SetEventPlaneMethod("Q"); | |
367 | } | |
368 | ||
369 | reader->SetImportGeometryFromFile(kTRUE);//,"$ALICE_ROOT/PWGGA/EMCALTasks/macros/geometry.root"); | |
370 | ||
371 | if(kPrint) reader->Print(""); | |
372 | ||
373 | return reader; | |
374 | ||
375 | } | |
376 | ||
377 | //_______________________________________ | |
378 | AliCalorimeterUtils* ConfigureCaloUtils() | |
379 | { | |
380 | ||
381 | AliCalorimeterUtils *cu = new AliCalorimeterUtils; | |
382 | cu->SetDebug(kDebug); | |
383 | ||
384 | // Remove clusters close to borders, at least max energy cell is 1 cell away | |
385 | cu->SetNumberOfCellsFromEMCALBorder(1); | |
386 | cu->SetNumberOfCellsFromPHOSBorder(2); | |
387 | ||
388 | // Search of local maxima in cluster | |
389 | if(kCollisions=="pp") | |
390 | { | |
391 | cu->SetLocalMaximaCutE(0.1); | |
392 | cu->SetLocalMaximaCutEDiff(0.03); | |
393 | } | |
394 | else | |
395 | { | |
396 | cu->SetLocalMaximaCutE(0.2); | |
397 | cu->SetLocalMaximaCutEDiff(0.03); | |
398 | } | |
399 | ||
400 | cu->SwitchOffClusterPlot(); | |
401 | ||
402 | if(kRecalTM) cu->SwitchOnRecalculateClusterTrackMatching(); // Done in clusterization | |
403 | else cu->SwitchOffRecalculateClusterTrackMatching(); | |
404 | ||
405 | cu->SwitchOnBadChannelsRemoval() ; | |
406 | ||
407 | //EMCAL settings | |
408 | ||
409 | if(!kSimulation) | |
410 | cu->SwitchOnLoadOwnEMCALGeometryMatrices(); | |
411 | ||
412 | AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils(); | |
413 | ||
414 | ||
415 | cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering | |
416 | ||
417 | ||
418 | gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/ConfigureEMCALRecoUtils.C"); | |
419 | ConfigureEMCALRecoUtils(recou, | |
420 | kSimulation, | |
421 | kExotic, | |
422 | kNonLinearity, | |
423 | kCalibE, | |
424 | kBadMap, | |
425 | kCalibT); | |
426 | ||
427 | if( kNonLinearity ) | |
428 | { | |
429 | printf("ConfigureCaloUtils() - Apply non linearity to EMCAL\n"); | |
430 | cu->SwitchOnCorrectClusterLinearity(); | |
431 | } | |
432 | ||
433 | printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn()); | |
434 | printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn()); | |
435 | ||
436 | ||
437 | // PHOS | |
438 | cu->SwitchOffLoadOwnPHOSGeometryMatrices(); | |
439 | ||
440 | if(kPrint) cu->Print(""); | |
441 | ||
442 | return cu; | |
443 | ||
444 | } | |
445 | ||
446 | //_____________________________________ | |
447 | AliAnaPhoton* ConfigurePhotonAnalysis() | |
448 | { | |
449 | ||
450 | AliAnaPhoton *ana = new AliAnaPhoton(); | |
451 | ana->SetDebug(kDebug); //10 for lots of messages | |
452 | ||
453 | // cluster selection cuts | |
454 | ||
455 | ana->SwitchOffFiducialCut(); | |
456 | ||
457 | ana->SetCalorimeter(kCalorimeter); | |
458 | ||
459 | if(kCalorimeter == "PHOS") | |
460 | { | |
461 | ana->SetNCellCut(2);// At least 3 cells | |
462 | ana->SetMinPt(0.3); | |
463 | ana->SetMinDistanceToBadChannel(2, 4, 5); | |
464 | ana->SetTimeCut(-2000,2000); // open cut | |
465 | } | |
466 | else | |
467 | {//EMCAL | |
468 | ana->SetNCellCut(1);// At least 2 cells | |
469 | ana->SetMinEnergy(0.5); // avoid mip peak at E = 260 MeV | |
470 | ana->SetMaxEnergy(1000); | |
d2655d46 | 471 | ana->SetTimeCut(-1000,1000); // Open time cut |
bef94c35 | 472 | ana->SetMinDistanceToBadChannel(2, 4, 6); |
473 | } | |
474 | ||
475 | if(kTM) | |
476 | { | |
477 | ana->SwitchOnTrackMatchRejection() ; | |
478 | ana->SwitchOffTMHistoFill() ; | |
479 | } | |
480 | else | |
481 | { | |
482 | ana->SwitchOffTrackMatchRejection() ; | |
483 | ana->SwitchOnTMHistoFill() ; | |
484 | } | |
485 | ||
486 | //PID cuts (shower shape) | |
487 | ana->SwitchOffCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian | |
488 | AliCaloPID* caloPID = ana->GetCaloPID(); | |
bef94c35 | 489 | |
490 | //EMCAL | |
491 | caloPID->SetEMCALLambda0CutMax(0.27); | |
492 | caloPID->SetEMCALLambda0CutMin(0.10); | |
493 | ||
494 | caloPID->SetEMCALDEtaCut(0.025); | |
495 | caloPID->SetEMCALDPhiCut(0.030); | |
496 | ||
497 | //PHOS | |
498 | caloPID->SetPHOSDispersionCut(2.5); | |
499 | caloPID->SetPHOSRCut(2.); | |
500 | if(kData=="AOD") caloPID->SetPHOSRCut(2000.); // Open cut since dX, dZ not stored | |
501 | ||
502 | ana->SwitchOnFillShowerShapeHistograms(); // Filled before photon shower shape selection | |
503 | ||
504 | // Input / output delta AOD settings | |
505 | ||
506 | if(!kData.Contains("delta")) | |
507 | { | |
508 | ana->SetOutputAODName(Form("Photon%s",kName.Data())); | |
509 | ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); | |
510 | //ana->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done | |
511 | } | |
512 | else ana->SetInputAODName(Form("Photon%s",kName.Data())); | |
513 | ||
514 | //Set Histograms name tag, bins and ranges | |
515 | ||
516 | ana->AddToHistogramsName(Form("AnaPhoton_TM%d_",kTM)); | |
517 | SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below | |
518 | ||
519 | // Number of particle type MC histograms | |
520 | ana->FillNOriginHistograms(8); | |
521 | ana->FillNPrimaryHistograms(4); | |
522 | ||
523 | ConfigureMC(ana); | |
524 | ||
525 | if(kPrint) ana->Print(""); | |
526 | ||
527 | return ana; | |
528 | ||
529 | } | |
530 | ||
531 | //________________________________________________________________________________ | |
532 | AliAnaElectron* ConfigureElectronAnalysis() | |
533 | { | |
534 | ||
535 | AliAnaElectron *ana = new AliAnaElectron(); | |
536 | ana->SetDebug(kDebug); //10 for lots of messages | |
537 | ||
538 | ana->SwitchOnFillShowerShapeHistograms(); | |
539 | ana->SwitchOffFillWeightHistograms() ; | |
540 | ||
541 | if(kCalorimeter == "PHOS") | |
542 | { | |
543 | ana->SetNCellCut(2);// At least 2 cells | |
544 | ana->SetMinPt(0.3); | |
545 | ana->SetMinDistanceToBadChannel(2, 4, 5); | |
546 | } | |
547 | else | |
548 | {//EMCAL | |
549 | ana->SetNCellCut(1);// At least 2 cells | |
d2655d46 | 550 | ana->SetMinPt(0.5); // no effect minimum EMCAL cut. |
bef94c35 | 551 | ana->SetMaxPt(100); |
bef94c35 | 552 | ana->SetMinDistanceToBadChannel(2, 4, 6); |
d2655d46 | 553 | ana->SetTimeCut(-1000,1000); // Open time cut |
bef94c35 | 554 | } |
555 | ||
556 | //Electron selection cuts with tracks | |
d2655d46 | 557 | |
558 | ana->SetEOverP(0.85, 1.2); | |
bef94c35 | 559 | // TO DO, find a more suitable way to set this |
560 | if(kSimulation) | |
561 | { // LHC11a | |
562 | ana->SetdEdxCut(76, 85); | |
563 | } | |
564 | else // LHC11c | |
565 | { | |
566 | ana->SetdEdxCut(56, 64); | |
567 | } | |
d2655d46 | 568 | |
bef94c35 | 569 | ana->SetCalorimeter(kCalorimeter); |
570 | ||
571 | ana->SwitchOffCaloPID(); | |
572 | ||
573 | ana->SwitchOffFiducialCut(); | |
574 | ||
575 | if(!kData.Contains("delta")) | |
576 | { | |
577 | ana->SetOutputAODName(Form("Electron%s",kName.Data())); | |
578 | ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); | |
579 | } | |
580 | else ana->SetInputAODName(Form("Electron%s",kName.Data())); | |
581 | ||
582 | //Set Histograms name tag, bins and ranges | |
583 | ||
584 | ana->AddToHistogramsName(Form("AnaElectron_TM%d_",kTM)); | |
585 | SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below | |
586 | ||
587 | ConfigureMC(ana); | |
588 | ||
589 | if(kPrint) ana->Print(""); | |
590 | ||
591 | return ana ; | |
592 | ||
593 | } | |
594 | ||
595 | //__________________________________________________________________________________________ | |
596 | AliAnaInsideClusterInvariantMass* ConfigureInClusterIMAnalysis(Float_t l0min, Float_t l0max) | |
597 | { | |
598 | ||
599 | AliAnaInsideClusterInvariantMass *ana = new AliAnaInsideClusterInvariantMass(); | |
600 | ana->SetDebug(kDebug); //10 for lots of messages | |
601 | ||
602 | // selection cuts | |
603 | ||
604 | ana->SetMinEnergy(5); | |
605 | ana->SetMaxEnergy(200.); | |
606 | ana->SetMinNCells(3); | |
607 | ana->SetM02Cut(l0min,l0max); | |
608 | ana->SetCalorimeter(kCalorimeter); | |
609 | ||
610 | //ana->AddToHistogramsName(Form("AnaInClusterIM_%1.2f_%1.2f_",l0min,l0max)); | |
611 | ana->AddToHistogramsName("AnaInClusterIM_"); | |
612 | ||
613 | SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below | |
614 | ||
615 | AliCaloPID* caloPID = ana->GetCaloPID(); | |
616 | caloPID->SetEMCALDEtaCut(0.025); | |
617 | caloPID->SetEMCALDPhiCut(0.030); | |
618 | caloPID->SetClusterSplittingM02Cut(0,100); // Do the selection in the analysis class and not in the PID method to fill SS histograms | |
d2655d46 | 619 | |
620 | caloPID->SetPi0MassRange(0.10, 0.18); | |
621 | caloPID->SetEtaMassRange(0.40, 0.60); | |
622 | caloPID->SetPhotonMassRange(0.00, 0.08); | |
bef94c35 | 623 | |
624 | ConfigureMC(ana); | |
625 | ||
626 | if(kPrint) ana->Print(""); | |
627 | ||
628 | return ana; | |
629 | ||
630 | } | |
631 | ||
632 | //_____________________________________________________ | |
633 | AliAnaPi0EbE* ConfigurePi0EbEAnalysis(TString particle, | |
634 | Int_t analysis) | |
635 | { | |
636 | ||
637 | AliAnaPi0EbE *ana = new AliAnaPi0EbE(); | |
638 | ana->SetDebug(kDebug);//10 for lots of messages | |
639 | ||
640 | ana->SetAnalysisType(analysis); | |
641 | TString opt = ""; | |
642 | if(analysis==AliAnaPi0EbE::kIMCaloTracks) opt = "Conv"; | |
643 | if(analysis==AliAnaPi0EbE::kSSCalo) opt = "SS"; | |
644 | ||
645 | ana->SetMinPt(0.5); | |
646 | ||
647 | if(kCalorimeter=="EMCAL")ana->SetPairTimeCut(15); // More strict than in pi0 inv mass analysis | |
648 | ||
649 | ana->SetCalorimeter(kCalorimeter); | |
650 | ||
651 | // Input / output delta AOD settings | |
652 | ||
653 | ana->SetInputAODName(Form("Photon%s",kName.Data())); | |
654 | if(!kInputDataType.Contains("delta")) | |
655 | { | |
656 | ana->SetOutputAODName(Form("%s%s%s",particle.Data(), opt.Data(), kName.Data())); | |
657 | ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); | |
658 | } | |
659 | else | |
660 | ana->SetInputAODName(Form("%s%s%s",particle.Data(),opt.Data(),kName.Data())); | |
661 | ||
662 | if(analysis == AliAnaPi0EbE::kIMCaloTracks) ana->SetInputAODGammaConvName("PhotonsCTS"); | |
663 | ||
664 | if(analysis!=AliAnaPi0EbE::kSSCalo) | |
665 | { | |
666 | AliNeutralMesonSelection *nms = ana->GetNeutralMesonSelection(); | |
667 | nms->SetParticle(particle); | |
bef94c35 | 668 | // Tighten a bit mass cut with respect to default window |
669 | if(particle=="Pi0") nms->SetInvMassCutRange(0.120,0.150); | |
670 | if(particle=="Eta") nms->SetInvMassCutRange(0.520,0.580); | |
671 | ||
672 | nms->SwitchOnAngleSelection(); | |
673 | nms->KeepNeutralMesonSelectionHistos(kTRUE); | |
674 | //nms->SetAngleMaxParam(2,0.2); | |
675 | nms->SetHistoERangeAndNBins(0, 20, 80) ; | |
676 | //nms->SetHistoIMRangeAndNBins(0, 1, 400); | |
677 | } | |
d2655d46 | 678 | else |
679 | { // cluster splitting settings | |
680 | ana->SetTimeCut(-1000,1000); // Open time cut | |
681 | AliCaloPID* caloPID = ana->GetCaloPID(); | |
682 | caloPID->SetPi0MassRange(0.10, 0.18); | |
683 | caloPID->SetEtaMassRange(0.40, 0.60); | |
684 | caloPID->SetPhotonMassRange(0.00, 0.08); | |
685 | caloPID->SetClusterSplittingM02Cut(0.5,100); // Do the selection in the analysis class and not in the PID method to fill SS histograms | |
686 | } | |
bef94c35 | 687 | |
688 | ana->SwitchOnSelectedClusterHistoFill(); // Shower shape et al. | |
689 | ana->SwitchOffFillWeightHistograms(); | |
690 | ||
691 | if(!kTM) ana->SwitchOnTMHistoFill(); | |
692 | else ana->SwitchOffTMHistoFill(); | |
693 | ||
694 | //Set Histograms name tag, bins and ranges | |
695 | ||
696 | ana->AddToHistogramsName(Form("Ana%s%sEbE_TM%d_",particle.Data(),opt.Data(),kTM)); | |
697 | SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below | |
698 | ||
699 | ConfigureMC(ana); | |
700 | ||
701 | if(kPrint) ana->Print(""); | |
702 | ||
703 | return ana; | |
704 | ||
705 | } | |
706 | ||
bef94c35 | 707 | //________________________________________ |
708 | AliAnaCalorimeterQA* ConfigureQAAnalysis() | |
709 | { | |
710 | ||
711 | AliAnaCalorimeterQA *ana = new AliAnaCalorimeterQA(); | |
712 | ana->SetDebug(kDebug); //10 for lots of messages | |
713 | ana->SetCalorimeter(kCalorimeter); | |
714 | ||
715 | ana->SetTimeCut(-1000,1000); // Open time cut | |
716 | ||
717 | // Study inter detector correlation (PHOS, EMCAL, Tracks, V0) | |
d2655d46 | 718 | ana->SwitchOffCorrelation(); // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON |
bef94c35 | 719 | |
d2655d46 | 720 | // correlation between calorimeters, tracks, v0 ... |
721 | // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON | |
722 | if(kCalorimeter=="EMCAL" && kClusterArray=="") ana->SwitchOnCorrelation(); | |
723 | else ana->SwitchOffCorrelation(); | |
bef94c35 | 724 | |
d2655d46 | 725 | // Study exotic clusters PHOS and EMCAL |
726 | if(kClusterArray=="") ana->SwitchOnStudyBadClusters() ; | |
727 | else ana->SwitchOffStudyBadClusters() ; | |
728 | ||
bef94c35 | 729 | ana->SwitchOffFiducialCut(); |
730 | ana->SwitchOffFillAllTH3Histogram(); | |
731 | ana->SwitchOffFillAllPositionHistogram(); | |
732 | ana->SwitchOffFillAllPositionHistogram2(); | |
733 | if(!kExotic)ana->SwitchOnStudyBadClusters(); | |
734 | else ana->SwitchOffStudyBadClusters(); | |
735 | ana->SwitchOffStudyClustersAsymmetry(); | |
736 | ana->SwitchOffStudyWeight(); | |
737 | ana->SwitchOnFillAllTrackMatchingHistogram(); | |
738 | ||
739 | if(kCalorimeter=="EMCAL") | |
740 | { | |
741 | if (kYears==2010) ana->SetNumberOfModules(4); | |
742 | else if(kYears==2011) ana->SetNumberOfModules(10); | |
743 | else ana->SetNumberOfModules(12); | |
744 | } | |
745 | else | |
746 | {//PHOS | |
747 | ana->SetNumberOfModules(3); | |
748 | } | |
749 | ||
750 | ana->AddToHistogramsName("QA_"); //Begining of histograms name | |
751 | SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below | |
752 | ||
753 | ConfigureMC(ana); | |
754 | ||
755 | if(kPrint) ana->Print(""); | |
756 | ||
757 | return ana; | |
758 | ||
759 | } | |
760 | ||
761 | //________________________________________________________ | |
762 | void ConfigureMC(AliAnaCaloTrackCorrBaseClass* ana) | |
763 | { | |
764 | if(kSimulation) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet. | |
765 | else ana->SwitchOffDataMC() ; | |
766 | ||
767 | //Set here generator name, default pythia | |
768 | //ana->GetMCAnalysisUtils()->SetMCGenerator(""); | |
769 | } | |
770 | ||
771 | //________________________________________________________ | |
772 | void SetHistoRangeAndNBins (AliHistogramRanges* histoRanges) | |
773 | { | |
774 | // Set common bins for all analysis and MC histograms filling | |
775 | ||
776 | histoRanges->SetHistoPtRangeAndNBins(0, 100, 200) ; // Energy and pt histograms | |
777 | ||
778 | if(kCalorimeter=="EMCAL") | |
779 | { | |
780 | if(kYears==2010) | |
781 | { | |
782 | histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ; | |
783 | histoRanges->SetHistoXRangeAndNBins(-230,90,120); // QA | |
784 | histoRanges->SetHistoYRangeAndNBins(370,450,40); // QA | |
785 | } | |
786 | else if(kYears==2011) | |
787 | { | |
788 | histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ; | |
789 | histoRanges->SetHistoXRangeAndNBins(-600,90,200); // QA | |
790 | histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA | |
791 | } | |
792 | else | |
793 | { | |
794 | histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 190*TMath::DegToRad(), 122) ; | |
795 | histoRanges->SetHistoXRangeAndNBins(-100,90,200); // QA | |
796 | histoRanges->SetHistoYRangeAndNBins(50,450,100); // QA | |
797 | } | |
798 | ||
799 | histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ; | |
800 | } | |
801 | else | |
802 | { | |
803 | histoRanges->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ; | |
804 | histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ; | |
805 | } | |
806 | ||
807 | histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500); | |
808 | ||
809 | // Invariant mass histoRangeslysis | |
810 | histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ; | |
811 | histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ; | |
812 | ||
813 | // check if time calibration is on | |
814 | histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000); | |
815 | histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800); | |
816 | ||
817 | // track-cluster residuals | |
818 | histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300); | |
819 | histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300); | |
820 | ||
821 | // QA, electron, charged | |
822 | histoRanges->SetHistoPOverERangeAndNBins(0,10.,100); | |
823 | histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200); | |
824 | ||
825 | // QA | |
826 | histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId | |
827 | histoRanges->SetHistodRRangeAndNBins(0.,TMath::Pi(),150); | |
828 | histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100); | |
829 | histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500); | |
830 | histoRanges->SetHistoNClusterCellRangeAndNBins(0,500,500); | |
831 | histoRanges->SetHistoZRangeAndNBins(-400,400,200); | |
832 | histoRanges->SetHistoRRangeAndNBins(400,450,25); | |
833 | histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500); | |
834 | histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500); | |
835 | histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500); | |
836 | ||
837 | } | |
838 | ||
839 |