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