]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/CaloTrackCorrelations/macros/AddTaskIsoPhoton.C
wagon for photon isolation spectra analysis with CaloTrackCorr frame
[u/mrichter/AliRoot.git] / PWGGA / CaloTrackCorrelations / macros / AddTaskIsoPhoton.C
CommitLineData
f692c37f 1// Configuration macro for analysis of isolated photon spectra
2// Author : Gustavo Conesa; Marie Germain.
3
4TString kAnaIsoPhotonName = "";
5AliAnalysisTaskCaloTrackCorrelation *AddTaskIsoPhoton(const Float_t cone = 0.4,
6 const Float_t pth = 5.,
7 const Bool_t timecut = kFALSE,
8 const TString calorimeter = "EMCAL",
9 const Bool_t simu = kFALSE,
10 const Bool_t exotic = kTRUE,
11 const Bool_t nonlin = kFALSE,
12 const TString trigger = "EMC7",
13 const Bool_t tm = kTRUE,
14 const Int_t minCen = -1,
15 const Int_t maxCen = -1,
16 const Bool_t qaan = kFALSE,
17 const Int_t debug = -1,
18 const Bool_t print = kFALSE
19 )
20{
21 // Creates a CaloTrackCorr task, configures it and adds it to the analysis manager.
22
23 printf("AddTaskIsoPhoton() - Settings: cone %2.2f, pth %2.2f, timeCut On %d, calorimeter %s, simu %d, exotic %d, non lin %d, trigger %s, TM %d, qa %d, debug %d, centrality %d-%d\n",
24 cone, pth, timecut , calorimeter.Data(),simu, exotic, nonlin, trigger.Data(), tm, qaan, debug, minCen, maxCen );
25
26 // Get the pointer to the existing analysis manager via the static access method.
27
28 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
29 if (!mgr)
30 {
31 ::Error("AddTask", "No analysis manager to connect to.");
32 return NULL;
33 }
34
35 // Check the analysis type using the event handlers connected to the analysis manager.
36
37 if (!mgr->GetInputEventHandler())
38 {
39 ::Error("AddTask", "This task requires an input event handler");
40 return NULL;
41 }
42
43 Bool_t useKinematics = kFALSE;
44 useKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
45
46 // Name for containers
47
48 kAnaIsoPhotonName = Form("%s_Trig%s_TM%d_R%1.1f_Pt%1.1f",calorimeter.Data(), trigger.Data(),tm,cone,pth);
49
50 if(maxCen>=0) kAnaIsoPhotonName+=Form("Cen%d_%d",minCen,maxCen);
51
52 printf("<<<< NAME: %s >>>>>\n",kAnaIsoPhotonName.Data());
53
54 // #### Configure analysis ####
55
56 AliAnaCaloTrackCorrMaker * maker = new AliAnaCaloTrackCorrMaker();
57
58 //maker->SetScaleFactor(scaleFactor); // for MC, negative (not scaled) by default
59
60 // General frame setting and configuration
61 maker->SetReader (ConfigureReader (mgr->GetInputEventHandler()->GetDataType(),useKinematics,simu,
62 calorimeter,nonlin, timecut,minCen, maxCen, debug,print));
63 maker->SetCaloUtils(ConfigureCaloUtils(nonlin,exotic,simu,timecut,debug,print));
64
65 // Analysis tasks setting and configuration
66 Int_t n = 0;//Analysis number, order is important
67
68 // Isolation settings
69 Int_t partInCone = AliIsolationCut::kNeutralAndCharged; // kOnlyCharged;
70 // Int_t thresType = AliIsolationCut::kPtThresIC;// AliIsolationCut::kSumPtFracIC ;
71 Int_t thresType = AliIsolationCut::kSumPtIC ;
72
73 // Photon analysis
74
75 maker->AddAnalysis(ConfigurePhotonAnalysis(calorimeter,tm,simu,debug,print), n++); // Photon cluster selection
76
77 // Photon analysis
78 maker->AddAnalysis(ConfigureIsolationAnalysis(calorimeter,"Photon", partInCone,thresType,cone, pth,tm,kFALSE,simu,debug,print), n++); // Photon isolation
79
80 if(qaan) maker->AddAnalysis(ConfigureQAAnalysis(calorimeter,simu,debug,print),n++);
81
82 maker->SetAnaDebug(debug) ;
83 maker->SwitchOnHistogramsMaker() ;
84 maker->SwitchOnAODsMaker() ;
85
86 if(print) maker->Print("");
87
88 maker->SwitchOffDataControlHistograms();
89
90 printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, calorimeter.Data());
91
92 // Create task
93
94 AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("CaloTrackCorr%s",kAnaIsoPhotonName.Data()));
95 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
96 task->SetDebugLevel(debug);
97 task->SetBranches("ESD:AliESDRun.,AliESDHeader");
98 task->SetAnalysisMaker(maker);
99 mgr->AddTask(task);
100
101 //Create containers
102
103 TString outputfile = AliAnalysisManager::GetCommonFileName();
104
105 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(kAnaIsoPhotonName, TList::Class(),
106 AliAnalysisManager::kOutputContainer,
107 Form("%s",outputfile.Data()));
108
109 AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Param_%s",kAnaIsoPhotonName.Data()), TList::Class(),
110 AliAnalysisManager::kParamContainer,
111 "AnalysisParameters.root");
112
113 // Create ONLY the output containers for the data produced by the task.
114 // Get and connect other common input/output containers via the manager as below
115 //==============================================================================
116 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
117 // AOD output slot will be used in a different way in future
118 mgr->ConnectOutput (task, 1, cout_pc);
119 mgr->ConnectOutput (task, 2, cout_cuts);
120
121 // Set the trigger selection
122 UInt_t mask = SetTriggerMaskFromName(trigger);
123 task->SelectCollisionCandidates(mask);
124
125 return task;
126}
127
128//____________________________________
129AliCaloTrackReader * ConfigureReader(TString inputDataType = "AOD", Bool_t useKinematics = kFALSE, Bool_t simu = kFALSE,
130 TString calorimeter = "EMCAL", Bool_t nonlin = kTRUE, Bool_t timecut = kFALSE,
131 Float_t minCen = -1, Float_t maxCen = -1,
132 Int_t debug = -1, Bool_t print = kFALSE)
133{
134 // Init reader settings: event selection, basic cluster track cuts, etc
135
136 if(simu)
137 {
138 if (!useKinematics && inputDataType=="AOD") useKinematics = kTRUE; //AOD primary should be available ...
139 }
140
141 cout<<"********* ACCESS KINE? "<<useKinematics<< endl;
142
143 AliCaloTrackReader * reader = 0;
144 if (inputDataType=="AOD") reader = new AliCaloTrackAODReader();
145 else if(inputDataType=="ESD") reader = new AliCaloTrackESDReader();
146 else printf("AliCaloTrackReader::ConfigureReader() - Data not known inputData=%s\n",inputDataType.Data());
147
148 reader->SetDebug(debug);//10 for lots of messages
149
150 reader->SwitchOffTriggerPatchMatching();
151 reader->SwitchOffBadTriggerEventsRemoval();
152
153 reader->SwitchOffWriteDeltaAOD() ;
154
155 // MC settings
156 if(useKinematics)
157 {
158 if(inputDataType == "ESD")
159 {
160 reader->SwitchOnStack();
161 reader->SwitchOffAODMCParticles();
162 }
163 else if(inputDataType == "AOD")
164 {
165 reader->SwitchOffStack();
166 reader->SwitchOnAODMCParticles();
167 }
168 }
169
170 //------------------------
171 // Detector input filling
172 //------------------------
173
174 //Min cluster/track E
175 reader->SetEMCALEMin(0.3);
176 reader->SetEMCALEMax(1000);
177 reader->SetPHOSEMin(0.3);
178 reader->SetPHOSEMax(1000);
179 reader->SetCTSPtMin(0.2);
180 reader->SetCTSPtMax(1000);
181
182 // Time cuts
183 if(simu)
184 {
185 reader->SwitchOffUseTrackTimeCut();
186 reader->SwitchOffUseParametrizedTimeCut();
187 reader->SwitchOffUseEMCALTimeCut();
188 reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
189 }
190 else
191 {
192 reader->SwitchOffUseParametrizedTimeCut();
193
194 if(timecut)
195 {
196 printf("Set time cut \n");
197 reader->SwitchOnUseEMCALTimeCut();
198 //Absolute window
199 reader->SetEMCALTimeCut(-30.,30.); // default is -25ns-20ns
200 }
201 else
202 {
203 printf("Off time cuts time cut \n");
204 reader->SwitchOffUseEMCALTimeCut();
205 //Absolute window
206 reader->SetEMCALTimeCut(-1.e6,1.e6);
207 }
208 }
209
210 reader->SwitchOffFiducialCut();
211 reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
212
213 // Tracks
214 reader->SwitchOnCTS();
215
216 reader->SwitchOffRecalculateVertexBC();
217 reader->SwitchOffVertexBCEventSelection();
218
219 reader->SwitchOffUseTrackTimeCut();
220 reader->SetTrackTimeCut(0,50);
221
222 reader->SwitchOffUseTrackDCACut();
223 //reader->SetTrackDCACut(0,0.0105);
224 //reader->SetTrackDCACut(1,0.035);
225 //reader->SetTrackDCACut(2,1.1);
226
227 if(inputDataType=="ESD")
228 {
229 gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");
230 //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
231 //reader->SetTrackCuts(esdTrackCuts);
232 //reader->SwitchOnConstrainTrackToVertex();
233
234// if(kYears>2010)
235 {
236 //Hybrids 2011
237 AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
238 reader->SetTrackCuts(esdTrackCuts);
239 AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
240 reader->SetTrackComplementaryCuts(esdTrackCuts2);
241 }
242// else
243// {
244// //Hybrids 2010
245// AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001006);
246// reader->SetTrackCuts(esdTrackCuts);
247// AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10041006);
248// reader->SetTrackComplementaryCuts(esdTrackCuts2);
249// }
250 }
251 else if(inputDataType=="AOD")
252 {
253 //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid
254 reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
255 reader->SetTrackStatus(AliVTrack::kITSrefit);
256 //reader->SwitchOnTrackHitSPDSelection(); // Check that the track has at least a hit on the SPD, not much sense to use for hybrid or TPC only tracks
257 }
258
259 // Calorimeter
260
261 reader->SwitchOffClusterRecalculation();
262
263
264 // CAREFUL
265 if(!nonlin) reader->SwitchOffClusterELinearityCorrection();
266 else reader->SwitchOnClusterELinearityCorrection();
267
268 if(calorimeter == "EMCAL") {
269 reader->SwitchOnEMCALCells();
270 reader->SwitchOnEMCAL();
271 }
272 if(calorimeter == "PHOS") { // Should be on if QA is activated with correlation on
273 reader->SwitchOffPHOSCells();
274 reader->SwitchOffPHOS();
275 }
276
277 //-----------------
278 // Event selection
279 //-----------------
280
281 //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
282
283 // reader->RejectFastClusterEvents() ;
284
285 reader->SwitchOnEventTriggerAtSE();
286
287 reader->SetZvertexCut(10.); // Open cut
288 reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
289 reader->SwitchOnRejectNoTrackEvents();
290
291 reader->SwitchOffPileUpEventRejection(); // remove pileup
292 reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
293
294 if(maxCen > 0 )
295 {
296 // Centrality
297 reader->SetCentralityClass("V0M");
298 reader->SetCentralityOpt(100); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
299 reader->SetCentralityBin(minCen,maxCen); // Accept all events, if not select range
300
301 // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
302 reader->SetEventPlaneMethod("V0");
303 }
304
305 if(print) reader->Print("");
306
307 return reader;
308
309}
310
311//_______________________________________
312AliCalorimeterUtils* ConfigureCaloUtils(Bool_t nonlin = kTRUE, Bool_t exotic = kTRUE ,Bool_t simu = kFALSE, Bool_t timecut = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
313{
314
315 AliCalorimeterUtils *cu = new AliCalorimeterUtils;
316 cu->SetDebug(debug);
317
318 // Remove clusters close to borders, at least max energy cell is 1 cell away
319 cu->SetNumberOfCellsFromEMCALBorder(1);
320 cu->SetNumberOfCellsFromPHOSBorder(2);
321
322 cu->SwitchOffRecalculateClusterTrackMatching();
323
324 cu->SwitchOffBadChannelsRemoval() ;
325
326 //EMCAL settings
327
328 if(simu)
329 cu->SwitchOnLoadOwnEMCALGeometryMatrices();
330
331 AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
332
333 cu->SwitchOffRecalibration();
334 cu->SwitchOffRunDepCorrection();
335
336 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/ConfigureEMCALRecoUtils.C");
337 ConfigureEMCALRecoUtils(recou,
338 simu,
339 exotic,
340 nonlin,
341 kFALSE, // e calib
342 kFALSE, // bad map
343 kFALSE); // time calib
344 if(timecut) recou->SetExoticCellDiffTimeCut(50.);
345
346
347 if( nonlin)
348 {
349 printf("ConfigureCaloUtils() - Apply non linearity to EMCAL\n");
350 cu->SwitchOnCorrectClusterLinearity();
351 }
352
353 printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
354 printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
355
356
357 // PHOS
358 cu->SwitchOffLoadOwnPHOSGeometryMatrices();
359
360 if(print) cu->Print("");
361
362 return cu;
363
364}
365
366//_____________________________________
367AliAnaPhoton* ConfigurePhotonAnalysis(TString calorimeter = "EMCAL", Bool_t tm = kFALSE, Bool_t simu = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
368{
369
370 AliAnaPhoton *ana = new AliAnaPhoton();
371 ana->SetDebug(debug); //10 for lots of messages
372
373 // cluster selection cuts
374
375 ana->SwitchOffFiducialCut();
376
377 ana->SetCalorimeter(calorimeter);
378
379 if(calorimeter == "PHOS")
380 {
381 ana->SetNCellCut(2);// At least 3 cells
382 ana->SetMinPt(0.3);
383 ana->SetMinDistanceToBadChannel(2, 4, 5);
384 ana->SetTimeCut(-1e10,1e10); // open cut
385 }
386 else
387 {//EMCAL
388 ana->SetNCellCut(1);// At least 2 cells
389 ana->SetMinEnergy(0.3); // avoid mip peak at E = 260 MeV
390 ana->SetMaxEnergy(1000);
391 // ana->SetTimeCut(-1e10,1e10); // open cut, usual time window of [425-825] ns if time recalibration is off
392 // restrict to less than 100 ns when time calibration is on
393 ana->SetMinDistanceToBadChannel(2, 4, 6);
394
395 // NLM cut, used in all, exclude clusters with more than 2 maxima
396 // Not needed if M02 cut is already strong or clusterizer V2
397 ana->SetNLMCut(1, 2) ;
398 }
399
400 if(tm)
401 {
402 ana->SwitchOnTrackMatchRejection() ;
403 ana->SwitchOffTMHistoFill() ;
404 }
405 else
406 {
407 ana->SwitchOffTrackMatchRejection() ;
408 ana->SwitchOnTMHistoFill() ;
409 }
410
411 //PID cuts (shower shape)
412 ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
413 AliCaloPID* caloPID = ana->GetCaloPID();
414 //Not used in bayesian
415
416 //EMCAL
417 caloPID->SetEMCALLambda0CutMax(10.);
418 caloPID->SetEMCALLambda0CutMin(0.10);
419
420 caloPID->SetEMCALDEtaCut(0.025);
421 caloPID->SetEMCALDPhiCut(0.030);
422
423 ana->SwitchOnFillShowerShapeHistograms(); // Filled before photon shower shape selection
424 if(!simu) ana->SwitchOnFillPileUpHistograms();
425
426 // Input / output delta AOD settings
427
428 ana->SetOutputAODName(Form("Photon%s",kAnaIsoPhotonName.Data()));
429 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
430
431 //Set Histograms name tag, bins and ranges
432
433 ana->AddToHistogramsName(Form("AnaPhoton_TM%d_",tm));
434 SetHistoRangeAndNBins(ana->GetHistogramRanges(), calorimeter); // see method below
435
436 // Number of particle type MC histograms
437 ana->FillNOriginHistograms(20);
438 ana->FillNPrimaryHistograms(20);
439
440 ConfigureMC(ana,simu);
441
442 if(print) ana->Print("");
443
444 return ana;
445
446}
447
448//____________________________________________________________________________________________________
449AliAnaParticleIsolation* ConfigureIsolationAnalysis(TString calorimeter = "EMCAL", TString particle="Photon",
450 Int_t partInCone = AliIsolationCut::kOnlyCharged,
451 Int_t thresType = AliIsolationCut::kSumPtFracIC,
452 Float_t cone = 0.3,
453 Float_t pth = 0.3,
454 Bool_t tm = kFALSE,
455 Bool_t multi = kFALSE, Bool_t simu = kFALSE,
456 Int_t debug = -1, Bool_t print = kFALSE)
457{
458
459 AliAnaParticleIsolation *ana = new AliAnaParticleIsolation();
460 ana->SetDebug(debug);
461
462 ana->SwitchOnFiducialCut();
463 //Avoid borders of EMCal
464 if(calorimeter=="EMCAL")
8258c022 465<<<<<<< HEAD
55a36bc5 466<<<<<<< HEAD
9d7489cf 467<<<<<<< HEAD
55a36bc5 468=======
469>>>>>>> f177d5e... reduce isolated photon fiducial area
d5f6b943 470 {
471 //ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
472 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.27, 103, 157) ;
473 }
55a36bc5 474<<<<<<< HEAD
8258c022 475=======
476 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
477>>>>>>> 02f44ef... wagon for photon isolation spectra analysis with CaloTrackCorr frame
55a36bc5 478=======
479>>>>>>> f177d5e... reduce isolated photon fiducial area
9d7489cf 480=======
481 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
482>>>>>>> 02f44ef... wagon for photon isolation spectra analysis with CaloTrackCorr frame
f692c37f 483
484 ana->SetMinPt(5);
485
486 // Input / output delta AOD settings
487
488 ana->SetInputAODName(Form("%s%s",particle.Data(),kAnaIsoPhotonName.Data()));
489 ana->SetAODObjArrayName(Form("IC%s_%s",particle.Data(),kAnaIsoPhotonName.Data()));
490
491 ana->SetCalorimeter(calorimeter);
492
493 if(!tm) ana->SwitchOnTMHistoFill();
494 else ana->SwitchOffTMHistoFill();
495 // ana->SwitchOnTMHistoFill();
496
497 // ana->SwitchOffSSHistoFill();
498 // if(!kSimulation) ana->SwitchOnFillPileUpHistograms();
499 ana->SwitchOnSSHistoFill();
500 if(!simu) ana->SwitchOnFillPileUpHistograms();
501
502 //Do settings for main isolation cut class
503 AliIsolationCut * ic = ana->GetIsolationCut();
504 ic->SetDebug(debug);
505
506 printf("\t *** Set: R = %2.2f, Threshold %2.2f, Method %d, Neutral/Charged option %d ***\n",cone,pth,thresType,partInCone);
507
508 ic->SetPtThreshold(pth);
509 ic->SetConeSize(cone);
510
511 ic->SetPtFraction(0.1);
512 // ic->SetSumPtThreshold(1.0) ;
513 ic->SetPtThreshold(pth);
514 ic->SetSumPtThreshold(pth);
515 ic->SetParticleTypeInCone(partInCone);
516 ic->SetICMethod(thresType);
517
518 //Do or not do isolation with previously produced AODs.
519 //No effect if use of SwitchOnSeveralIsolation()
520 ana->SwitchOffReIsolation();
521
522 //Multiple IC
523 if(multi)
524 {
525 ic->SetConeSize(1.); // Take all for first iteration
526 ic->SetPtThreshold(100);// Take all for first iteration
527 ana->SwitchOnSeveralIsolation() ;
528 ana->SetAODObjArrayName(Form("MultiIC%sTM%d",particle.Data(),tm));
529
530 ana->SetNCones(4);
531 ana->SetNPtThresFrac(4);
532 ana->SetConeSizes(0,0.3); ana->SetConeSizes(1,0.4);
533 ana->SetConeSizes(2,0.5); ana->SetConeSizes(3,0.6);
534 ana->SetPtThresholds(0, 0.5); ana->SetPtThresholds(1, 1); ana->SetPtThresholds(2, 2);
535 ana->SetPtFractions (0, 0.05) ; ana->SetPtFractions (1, 0.1); ana->SetPtFractions (2, 0.2) ; ana->SetPtFractions (3, 0.3) ;
536 ana->SetSumPtThresholds(0, 1) ; ana->SetSumPtThresholds(1, 3) ; ana->SetSumPtThresholds(2, 5); ana->SetSumPtThresholds(3, 7) ;
537
538 ana->SwitchOffTMHistoFill();
539 ana->SwitchOffSSHistoFill();
540 }
541 else
542 ana->SwitchOffSeveralIsolation() ;
543
544 AliCaloPID* caloPID = ana->GetCaloPID();
545 caloPID->SetEMCALDEtaCut(0.02);
546 caloPID->SetEMCALDPhiCut(0.030);
547
548 //Set Histograms name tag, bins and ranges
549
550 if(!multi)ana->AddToHistogramsName(Form("AnaIsol%s_TM%d_",particle.Data(),tm));
551 else ana->AddToHistogramsName(Form("AnaMultiIsol%s_TM%d_",particle.Data(),tm));
552
553 SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
554
555 ana->SetHistoPtInConeRangeAndNBins(0, 50 , 250);
556 ana->SetHistoPtSumRangeAndNBins (0, 100, 250);
557
558 if(particle=="Hadron" || particle.Contains("CTS"))
559 {
560 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
561 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
562 }
563
564 ConfigureMC(ana,simu);
565
566 if(print) ic ->Print("");
567 if(print) ana->Print("");
568
569 return ana;
570
571}
572
573
574//________________________________________
575AliAnaCalorimeterQA* ConfigureQAAnalysis(TString calorimeter = "EMCAL", Bool_t simu = kFALSE, Int_t debug = -1, Bool_t print = kFALSE)
576{
577
578 AliAnaCalorimeterQA *ana = new AliAnaCalorimeterQA();
579 ana->SetDebug(debug); //10 for lots of messages
580 ana->SetCalorimeter(calorimeter);
581
582 ana->SetTimeCut(-1e10,1e10); // Open time cut
583 ana->SwitchOffCorrelation();
584
585 // Study exotic clusters PHOS and EMCAL
586 ana->SwitchOffStudyBadClusters() ;
587
588
589 ana->SwitchOffFiducialCut();
590 ana->SwitchOffFillAllTH3Histogram();
591 ana->SwitchOffFillAllPositionHistogram();
592 ana->SwitchOffFillAllPositionHistogram2();
593 ana->SwitchOffStudyBadClusters();
594 ana->SwitchOffStudyClustersAsymmetry();
595 ana->SwitchOffStudyWeight();
596 ana->SwitchOnFillAllTrackMatchingHistogram();
597 ana->SwitchOnFillAllCellTimeHisto() ;
598
599 if(calorimeter=="EMCAL")
600 {
601 ana->SetNumberOfModules(10);
602 }
603 else
604 {//PHOS
605 ana->SetNumberOfModules(3);
606 }
607
608 ana->AddToHistogramsName("QA_"); //Begining of histograms name
609 SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
610
611 ConfigureMC(ana,simu);
612
613 if(print) ana->Print("");
614
615 return ana;
616
617}
618
619//________________________________________________________
620void ConfigureMC(AliAnaCaloTrackCorrBaseClass* ana, Bool_t simu = kFALSE)
621{
622 if(simu) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
623 else ana->SwitchOffDataMC() ;
624
625 //Set here generator name, default pythia
626 //ana->GetMCAnalysisUtils()->SetMCGenerator("");
627}
628
629//________________________________________________________
630void SetHistoRangeAndNBins (AliHistogramRanges* histoRanges, TString calorimeter = "EMCAL")
631{
632 // Set common bins for all analysis and MC histograms filling
633
634 histoRanges->SetHistoPtRangeAndNBins(0, 100, 200) ; // Energy and pt histograms
635
636 if(calorimeter=="EMCAL")
637 {
638
639 histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
640 histoRanges->SetHistoXRangeAndNBins(-600,90,200); // QA
641 histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
642
643 histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
644 }
645 else
646 {
647 histoRanges->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ;
648 histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
649 }
650
651 histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
652
653 // Invariant mass histoRangeslysis
654 histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
655 histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
656
657 // check if time calibration is on
658 histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
659 histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
660
661 // track-cluster residuals
662 histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
663 histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
664 histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
665
666 // QA, electron, charged
667 histoRanges->SetHistoPOverERangeAndNBins(0, 2.5 ,500);
668 histoRanges->SetHistodEdxRangeAndNBins (0.,250.0,500);
669
670 // QA
671 histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
672 histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
673 histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
674 histoRanges->SetHistoNClusterCellRangeAndNBins(0,50,50);
675 histoRanges->SetHistoZRangeAndNBins(-400,400,200);
676 histoRanges->SetHistoRRangeAndNBins(400,450,25);
677 histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
678 histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
679 histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
680
681}
682
683//_____________________________
684UInt_t SetTriggerMaskFromName(TString trigger)
685{
686 if(trigger=="EMC7")
687 {
688 printf("CaloTrackCorr trigger EMC7\n");
689 return AliVEvent::kEMC7;
690 }
691 else if (trigger=="INT7")
692 {
693 printf("CaloTrackCorr trigger INT7\n");
694 return AliVEvent::kINT7;
695 }
696 else if(trigger=="EMC1")
697 {
698 printf("CaloTrackCorr trigger EMC1\n");
699 return AliVEvent::kEMC1;
700 }
701 else if(trigger=="MB")
702 {
703 printf("CaloTrackCorr trigger MB\n");
704 return AliVEvent::kMB;
705 }
706 else if(trigger=="PHOS")
707 {
708 printf("CaloTrackCorr trigger PHOS\n");
709 return AliVEvent::kPHI7;
710 }
711 else if(trigger=="PHOSPb")
712 {
713 printf("CaloTrackCorr trigger PHOSPb\n");
714 return AliVEvent::kPHOSPb;
715 }
716 else if(trigger=="AnyINT")
717 {
718 printf("CaloTrackCorr trigger AnyINT\n");
719 return AliVEvent::kAnyINT;
720 }
721 else if(trigger=="INT")
722 {
723 printf("CaloTrackCorr trigger AnyINT\n");
724 return AliVEvent::kAny;
725 }
726 else if(trigger=="EMCEGA")
727 {
728 printf("CaloTrackCorr trigger EMC Gamma\n");
729 return AliVEvent::kEMCEGA;
730 }
731 else if(trigger=="EMCEJE")
732 {
733 printf("CaloTrackCorr trigger EMC Jet\n");
734 return AliVEvent::kEMCEJE;
735 }
736 else if(trigger=="Central")
737 {
738 printf("CaloTrackCorr trigger Central\n");
739 return (AliVEvent::kCentral | AliVEvent::kMB);
740 }
741 else if(trigger=="CentralEGA")
742 {
743 printf("CaloTrackCorr trigger Central+EMCEGA\n");
744 return (AliVEvent::kCentral | AliVEvent::kEMCEGA);
745 }
746 else if(trigger=="SemiCentral")
747 {
748 printf("CaloTrackCorr trigger SemiCentral\n");
749 return (AliVEvent::kSemiCentral | AliVEvent::kMB);
750 }
751 else if(trigger=="SemiOrCentral")
752 {
753 printf("CaloTrackCorr trigger SemiCentral Or Central\n");
754 return (AliVEvent::kSemiCentral | AliVEvent::kCentral | AliVEvent::kMB);
755 }
756}
757