]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/CaloTrackCorrelations/macros/AddTaskCaloTrackCorr.C
add possibility to analyze triggered events and create a pool with MB tracks, fill...
[u/mrichter/AliRoot.git] / PWGGA / CaloTrackCorrelations / macros / AddTaskCaloTrackCorr.C
CommitLineData
cd54ca47 1
2Bool_t kPrint = kFALSE;
193828fd 3Bool_t kSimulation = kFALSE;
4Bool_t kUseKinematics = kFALSE;
5Bool_t kOutputAOD = kFALSE;
531f682d 6Bool_t kEventSelection= kFALSE;
7Bool_t kExotic = kTRUE;
8Bool_t kNonLinearity = kFALSE;
193828fd 9Int_t kYears = 2011;
cd54ca47 10TString kCollisions = "pp";
11TString kTrig = "EMC7" ;
193828fd 12TString kClusterArray = "";
13TString kData = "ESD";
14TString kInputDataType = "ESD";
15TString kCalorimeter = "EMCAL";
531f682d 16Bool_t kTM = kTRUE;
17Bool_t kRecalTM = kTRUE;
18Int_t kMinCen = -1;
19Int_t kMaxCen = -1;
20TString kName = "";
21Int_t kDebug = -1;
22Bool_t kQA = kFALSE;
23Bool_t kHadronAN = kFALSE;
023e6936 24Bool_t kCalibE = kTRUE;
25Bool_t kCalibT = kTRUE;
26Bool_t kBadMap = kTRUE;
27
531f682d 28AliAnalysisTaskCaloTrackCorrelation *AddTaskCaloTrackCorr(const TString data = "AOD",
29 const TString calorimeter = "EMCAL",
30 const Bool_t simulation = kFALSE,
31 const Bool_t eventsel = kFALSE,
32 const Bool_t exotic = kTRUE,
33 const Bool_t nonlin = kFALSE,
34 TString outputfile = "",
35 const Int_t year = 2010,
36 const TString col = "pp",
37 const TString trigger = "MB",
38 const TString clustersArray = "V1",
39 const Bool_t recaltm = kTRUE,
40 const Bool_t tm = kTRUE,
41 const Int_t minCen = -1,
42 const Int_t maxCen = -1,
43 const Bool_t qaan = kFALSE,
44 const Bool_t hadronan = kFALSE,
023e6936 45 const Bool_t calibE = kTRUE,
46 const Bool_t badmap = kTRUE,
47 const Bool_t calibT = kTRUE,
531f682d 48 const Bool_t outputAOD = kFALSE,
49 const Bool_t printSettings = kFALSE
50 )
193828fd 51{
372e67a3 52 // Creates a CaloTrackCorr task, configures it and adds it to the analysis manager.
90eb3a19 53
cd54ca47 54 kPrint = printSettings;
193828fd 55 kSimulation = simulation;
193828fd 56 kYears = year;
57 kCollisions = col;
531f682d 58 kExotic = exotic;
59 kNonLinearity = nonlin;
193828fd 60 kTrig = trigger;
61 kClusterArray = clustersArray;
62 kData = data;
63 kCalorimeter = calorimeter;
64 kOutputAOD = outputAOD;
531f682d 65 kTM = tm;
66 kRecalTM = recaltm;
67 kMinCen = minCen;
68 kMaxCen = maxCen;
69 kEventSelection= eventsel;
70 kQA = qaan;
71 kHadronAN = hadronan;
023e6936 72 kCalibE = calibE;
73 kCalibT = calibT;
74 kBadMap = badmap;
193828fd 75
90eb3a19 76 // Get the pointer to the existing analysis manager via the static access method.
193828fd 77
90eb3a19 78 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
531f682d 79 if (!mgr)
80 {
193828fd 81 ::Error("AddTask", "No analysis manager to connect to.");
90eb3a19 82 return NULL;
83 }
193828fd 84
85 // Check the analysis type using the event handlers connected to the analysis manager.
86
531f682d 87 if (!mgr->GetInputEventHandler())
88 {
193828fd 89 ::Error("AddTask", "This task requires an input event handler");
90 return NULL;
91 }
531f682d 92
193828fd 93 kInputDataType = "AOD";
94 if(!kData.Contains("delta"))
95 kInputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
96
531f682d 97 if(kSimulation)
98 {
1e3689fa 99 kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
193828fd 100 if (!kUseKinematics && data=="AOD" && kInputDataType != "ESD") kUseKinematics = kTRUE; //AOD primary should be available ...
1e3689fa 101 }
102
103 cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl;
104
531f682d 105 // Name for containers
106
107 kName = Form("%s_Trig%s_Cl%s_TM%d",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data(),kTM);
108
109 if(kCollisions=="PbPb" && kMaxCen>=0) kName+=Form("Cen%d_%d",kMinCen,kMaxCen);
110
111 printf("<<<< NAME: %s >>>>>\n",kName.Data());
112
193828fd 113 // #### Configure analysis ####
cd54ca47 114
745913ae 115 AliAnaCaloTrackCorrMaker * maker = new AliAnaCaloTrackCorrMaker();
193828fd 116
117 // General frame setting and configuration
118 maker->SetReader (ConfigureReader() );
119 maker->SetCaloUtils(ConfigureCaloUtils());
120
121 // Analysis tasks setting and configuration
122 Int_t n = 0;//Analysis number, order is important
193828fd 123
cd54ca47 124 // Isolation settings
66e64043 125 Int_t partInCone = AliIsolationCut::kNeutralAndCharged; // kOnlyCharged;
531f682d 126 Int_t thresType = AliIsolationCut::kPtThresIC;// PbPb
127 if(kCollisions=="pp") thresType = AliIsolationCut::kSumPtFracIC ;
128
129
130 maker->AddAnalysis(ConfigurePhotonAnalysis(), n++); // Photon cluster selection
131 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Pi0", AliAnaPi0EbE::kIMCalo), n++); // Pi0 event by event selection, and photon tagging from decay
3e0ccecf 132 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Eta", AliAnaPi0EbE::kIMCalo), n++); // Eta event by event selection, and photon tagging from decay
531f682d 133
134 maker->AddAnalysis(ConfigureIsolationAnalysis("Photon", partInCone,thresType), n++); // Photon isolation
135 maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0", partInCone,thresType), n++); // Pi0 isolation
136
137 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Photon",kFALSE), n++); // Gamma hadron correlation
138 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Photon",kTRUE) , n++); // Isolated gamma hadron correlation
139 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0" ,kFALSE), n++); // Pi0 hadron correlation
140 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0" ,kTRUE) , n++); // Isolated pi0 hadron correlation
193828fd 141
531f682d 142 if(kQA) maker->AddAnalysis(ConfigureQAAnalysis(),n++);
143 if(kCalorimeter=="EMCAL")maker->AddAnalysis(ConfigureInClusterIMAnalysis(0.5,3), n++);
144
145 if(kHadronAN)
8f880b6e 146 {
8f880b6e 147 maker->AddAnalysis(ConfigureChargedAnalysis(), n++); // track selection
531f682d 148 maker->AddAnalysis(ConfigureIsolationAnalysis("Hadron",AliIsolationCut::kOnlyCharged,thresType), n++); // track isolation
8f880b6e 149 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Hadron",kFALSE), n++); // track-track correlation
150 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Hadron",kTRUE) , n++); // Isolated track-track correlation
cd54ca47 151 }
531f682d 152
bef94c35 153 // Analysis with ghost triggers, only for Min Bias like events
154 if(kTrig.Contains("INT") || kTrig.Contains("Central") || kTrig.Contains("MB") )
155 {
156 maker->AddAnalysis(ConfigureRandomTriggerAnalysis(), n++);
157 maker->AddAnalysis(ConfigureIsolationAnalysis(Form("RandomTrigger%s",kCalorimeter.Data()), partInCone,thresType), n++); // Ghost trigger isolation
158 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis(Form("RandomTrigger%s",kCalorimeter.Data()),kFALSE), n++); // Ghost trigger hadron correlation
159 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis(Form("RandomTrigger%s",kCalorimeter.Data()),kTRUE) , n++); // Isolated ghost hadron correlation
160
161 if(kHadronAN)
162 {
163 maker->AddAnalysis(ConfigureRandomTriggerAnalysis("CTS"), n++); // track selection
164 maker->AddAnalysis(ConfigureIsolationAnalysis("RandomTriggerCTS",AliIsolationCut::kOnlyCharged,thresType), n++); // track isolation
165 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("RandomTriggerCTS",kFALSE), n++); // track-track correlation
166 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("RandomTriggerCTS",kTRUE) , n++); // Isolated track-track correlation
167 }
168 }
169
531f682d 170 //maker->AddAnalysis(ConfigureIsolationAnalysis("Photon", partInCone,thresType,kTRUE), n++); // Photon multi isolation
171 //maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0", partInCone,thresType,kTRUE), n++); // Pi0 multi isolation
172 //if(kHadronAN)
173 // maker->AddAnalysis(ConfigureIsolationAnalysis("Hadron",partInCone,thresType,kTRUE), n++);
174
175 maker->SetAnaDebug(kDebug) ;
193828fd 176 maker->SwitchOnHistogramsMaker() ;
177 if(kData.Contains("delta")) maker->SwitchOffAODsMaker() ;
178 else maker->SwitchOnAODsMaker() ;
531f682d 179
193828fd 180 if(kPrint) maker->Print("");
181
cd54ca47 182 printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, kCalorimeter.Data());
531f682d 183 // CAREFUL
184 //kName = Form("%s_Trig%s_Cl%s_TM%d",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data(),kFALSE);
185 kName = Form("%s_Trig%s_Cl%s",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data());
186 if(kCollisions=="PbPb" && kMaxCen>=0) kName+=Form("Cen%d_%d",kMinCen,kMaxCen);
187
193828fd 188 // Create task
189
531f682d 190 AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("CaloTrackCorr%s",kName.Data()));
193828fd 191 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
531f682d 192 task->SetDebugLevel(kDebug);
193 task->SetBranches("ESD:AliESDRun.,AliESDHeader");
193828fd 194 task->SetAnalysisMaker(maker);
195 mgr->AddTask(task);
196
197 //Create containers
198
531f682d 199 if(outputfile.Length()==0) outputfile = AliAnalysisManager::GetCommonFileName();
193828fd 200
531f682d 201 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(kName, TList::Class(),
193828fd 202 AliAnalysisManager::kOutputContainer,
203 Form("%s",outputfile.Data()));
204
531f682d 205 AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Cuts_%s",kName.Data()), TList::Class(),
193828fd 206 AliAnalysisManager::kParamContainer,
207 Form("%s",outputfile.Data()));
3e0ccecf 208
193828fd 209 // Create ONLY the output containers for the data produced by the task.
210 // Get and connect other common input/output containers via the manager as below
211 //==============================================================================
212 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
213 // AOD output slot will be used in a different way in future
214 if(!kData.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
215 mgr->ConnectOutput (task, 1, cout_pc);
216 mgr->ConnectOutput (task, 2, cout_cuts);
217
218
d2655d46 219 if(kTrig=="EMC7")
220 {
531f682d 221 printf("CaloTrackCorr trigger EMC7\n");
193828fd 222 task->SelectCollisionCandidates(AliVEvent::kEMC7);
223 }
d2655d46 224 else if (kTrig=="INT7")
225 {
531f682d 226 printf("CaloTrackCorr trigger INT7\n");
193828fd 227 task->SelectCollisionCandidates(AliVEvent::kINT7);
228 }
d2655d46 229 else if(kTrig=="EMC1")
230 {
531f682d 231 printf("CaloTrackCorr trigger EMC1\n");
193828fd 232 task->SelectCollisionCandidates(AliVEvent::kEMC1);
233 }
d2655d46 234 else if(kTrig=="MB")
235 {
531f682d 236 printf("CaloTrackCorr trigger MB\n");
193828fd 237 task->SelectCollisionCandidates(AliVEvent::kMB);
238 }
d2655d46 239 else if(kTrig=="PHOS")
240 {
531f682d 241 printf("CaloTrackCorr trigger PHOS\n");
cd54ca47 242 task->SelectCollisionCandidates(AliVEvent::kPHI7);
531f682d 243 }
d2655d46 244 else if(kTrig=="PHOSPb")
245 {
531f682d 246 printf("CaloTrackCorr trigger PHOSPb\n");
247 task->SelectCollisionCandidates(AliVEvent::kPHOSPb);
248 }
249 else if(kTrig=="AnyINT")
250 {
251 printf("CaloTrackCorr trigger AnyINT\n");
252 task->SelectCollisionCandidates(AliVEvent::kAnyINT);
253 }
254 else if(kTrig=="INT")
255 {
256 printf("CaloTrackCorr trigger AnyINT\n");
257 task->SelectCollisionCandidates(AliVEvent::kAny);
258 }
259 else if(kTrig=="EMCEGA")
260 {
261 printf("CaloTrackCorr trigger EMC Gamma\n");
262 task->SelectCollisionCandidates(AliVEvent::kEMCEGA);
263 }
264 else if(kTrig=="EMCEJE")
265 {
266 printf("CaloTrackCorr trigger EMC Jet\n");
267 task->SelectCollisionCandidates(AliVEvent::kEMCEJE);
268 }
269 else if(kTrig=="Central")
270 {
271 printf("CaloTrackCorr trigger Central\n");
272 task->SelectCollisionCandidates(AliVEvent::kCentral);
273 }
274 else if(kTrig=="SemiCentral")
275 {
276 printf("CaloTrackCorr trigger SemiCentral\n");
277 task->SelectCollisionCandidates(AliVEvent::kSemiCentral);
cd54ca47 278 }
193828fd 279
280 return task;
281}
282
283//____________________________________
284AliCaloTrackReader * ConfigureReader()
285{
286
287 AliCaloTrackReader * reader = 0;
288 if (kData.Contains("AOD")) reader = new AliCaloTrackAODReader();
289 else if(kData=="ESD") reader = new AliCaloTrackESDReader();
290 else if(kData=="MC" &&
291 kInputDataType == "ESD") reader = new AliCaloTrackMCReader();
1e3689fa 292
531f682d 293 reader->SetDebug(kDebug);//10 for lots of messages
193828fd 294
cd54ca47 295 //Delta AOD?
296 //reader->SetDeltaAODFileName("");
297 if(kOutputAOD) reader->SwitchOnWriteDeltaAOD() ;
298
299 // MC settings
300 if(kUseKinematics){
301 if(kInputDataType == "ESD"){
302 reader->SwitchOnStack();
303 reader->SwitchOffAODMCParticles();
304 }
305 else if(kInputDataType == "AOD"){
306 reader->SwitchOffStack();
307 reader->SwitchOnAODMCParticles();
308 }
309 }
310
311 //------------------------
312 // Detector input filling
313 //------------------------
314
315 //Min cluster/track E
d2655d46 316 reader->SetEMCALEMin(0.3);
cd54ca47 317 reader->SetEMCALEMax(1000);
318 reader->SetPHOSEMin(0.3);
319 reader->SetPHOSEMax(1000);
320 reader->SetCTSPtMin(0.1);
321 reader->SetCTSPtMax(1000);
d2655d46 322
323 if(!kSimulation && kCalibT) reader->SetEMCALTimeCut(-30,30);
324 else reader->SetEMCALTimeCut(-1000,1000); // Open time cut
325
531f682d 326 reader->SwitchOnFiducialCut();
327 reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
328
cd54ca47 329 // Tracks
330 reader->SwitchOnCTS();
531f682d 331 if(kInputDataType=="ESD")
332 {
333 gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");
334 AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
66e64043 335 reader->SetTrackCuts(esdTrackCuts);
336 }
531f682d 337 else if(kInputDataType=="AOD")
338 {
66e64043 339 reader->SetTrackFilterMask(128); // Filter bit, not mask
340 }
cd54ca47 341
342 // Calorimeter
343
193828fd 344 reader->SetEMCALClusterListName(kClusterArray);
531f682d 345 if(kClusterArray == "")
346 {
5eef1db1 347 printf("**************** Standard EMCAL clusters branch analysis **************** \n");
cd54ca47 348 reader->SwitchOnClusterRecalculation();
5eef1db1 349 // Check in ConfigureCaloUtils that the recalibration and bad map are ON
193828fd 350 }
531f682d 351 else
352 {
193828fd 353 printf("**************** Input for analysis is Clusterizer %s **************** \n", kClusterArray.Data());
cd54ca47 354 reader->SwitchOffClusterRecalculation();
355 }
193828fd 356
cd54ca47 357 //if(kCalorimeter == "EMCAL") {
afabc52f 358 reader->SwitchOnEMCALCells();
69652c63 359 reader->SwitchOnEMCAL();
cd54ca47 360 //}
361 //if(kCalorimeter == "PHOS") {
afabc52f 362 reader->SwitchOnPHOSCells();
363 reader->SwitchOnPHOS();
cd54ca47 364 //}
1e3689fa 365
193828fd 366 // for case data="deltaAOD", no need to fill the EMCAL/PHOS cluster lists
367 if(kData.Contains("delta")){
1e3689fa 368 reader->SwitchOffEMCAL();
369 reader->SwitchOffPHOS();
370 reader->SwitchOffEMCALCells();
371 reader->SwitchOffPHOSCells();
1e86c71e 372 }
1e3689fa 373
cd54ca47 374 //-----------------
375 // Event selection
376 //-----------------
377
cd54ca47 378 //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
193828fd 379
029dea5a 380 // For mixing with AliAnaParticleHadronCorrelation switch it off
381 reader->SwitchOnEventTriggerAtSE();
382 reader->SetEventTriggerMaks(AliVEvent::kEMC7); // Only for mixing and SwitchOffEventTriggerAtSE();
383
531f682d 384 reader->SetZvertexCut(10.); // Open cut
d2655d46 385 reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
386
531f682d 387 if(kEventSelection)
388 {
389 reader->SwitchOnEventSelection(); // remove pileup by default
390 reader->SwitchOnV0ANDSelection() ; // and besides v0 AND
193828fd 391 }
531f682d 392 else
393 {
193828fd 394 reader->SwitchOffEventSelection(); // remove pileup by default
395 reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
531f682d 396 }
cd54ca47 397
531f682d 398 if(kCollisions=="PbPb")
399 {
cd54ca47 400 // Centrality
401 reader->SetCentralityClass("V0M");
745913ae 402 reader->SetCentralityOpt(10); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
531f682d 403 reader->SetCentralityBin(kMinCen,kMaxCen); // Accept all events, if not select range
cd54ca47 404
405 // Event plane (only used in AliAnaPi0 for the moment)
406 reader->SetEventPlaneMethod("Q");
69652c63 407 }
afabc52f 408
8f880b6e 409 reader->SetImportGeometryFromFile(kTRUE);
410
193828fd 411 if(kPrint) reader->Print("");
412
413 return reader;
414
415}
69652c63 416
193828fd 417//_______________________________________
418AliCalorimeterUtils* ConfigureCaloUtils()
419{
420
fa991e42 421 AliCalorimeterUtils *cu = new AliCalorimeterUtils;
531f682d 422 cu->SetDebug(kDebug);
69652c63 423
193828fd 424 // Remove clusters close to borders, at least max energy cell is 1 cell away
fa991e42 425 cu->SetNumberOfCellsFromEMCALBorder(1);
1e3689fa 426 cu->SetNumberOfCellsFromPHOSBorder(2);
1e3689fa 427
531f682d 428 // Search of local maxima in cluster
429 if(kCollisions=="pp")
430 {
431 cu->SetLocalMaximaCutE(0.1);
432 cu->SetLocalMaximaCutEDiff(0.03);
433 }
434 else
435 {
436 cu->SetLocalMaximaCutE(0.2);
437 cu->SetLocalMaximaCutEDiff(0.03);
438 }
439
440 cu->SwitchOffClusterPlot();
441
442 if(kRecalTM) cu->SwitchOnRecalculateClusterTrackMatching(); // Done in clusterization
443 else cu->SwitchOffRecalculateClusterTrackMatching();
1e3689fa 444
15882d9f 445 cu->SwitchOnBadChannelsRemoval() ;
1e3689fa 446
15882d9f 447 //EMCAL settings
531f682d 448
449 if(!kSimulation)
450 cu->SwitchOnLoadOwnEMCALGeometryMatrices();
451
452 AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
453
023e6936 454
531f682d 455 cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering
456
457
458 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/ConfigureEMCALRecoUtils.C");
459 ConfigureEMCALRecoUtils(recou,
460 kSimulation,
461 kExotic,
462 kNonLinearity,
023e6936 463 kCalibE,
464 kBadMap,
465 kCalibT);
531f682d 466
c2091d88 467 if( kNonLinearity )
468 {
469 printf("ConfigureCaloUtils() - Apply non linearity to EMCAL\n");
470 cu->SwitchOnCorrectClusterLinearity();
471 }
472
531f682d 473 printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
474 printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
475
15882d9f 476
531f682d 477 // PHOS
478 cu->SwitchOffLoadOwnPHOSGeometryMatrices();
15882d9f 479
193828fd 480 if(kPrint) cu->Print("");
afabc52f 481
193828fd 482 return cu;
483
484}
485
486//_____________________________________
487AliAnaPhoton* ConfigurePhotonAnalysis()
488{
4df35693 489
531f682d 490 AliAnaPhoton *ana = new AliAnaPhoton();
491 ana->SetDebug(kDebug); //10 for lots of messages
cd54ca47 492
493 // cluster selection cuts
494
531f682d 495 ana->SwitchOffFiducialCut();
496
497 ana->SetCalorimeter(kCalorimeter);
193828fd 498
531f682d 499 if(kCalorimeter == "PHOS")
500 {
501 ana->SetNCellCut(2);// At least 3 cells
502 ana->SetMinPt(0.3);
503 ana->SetMinDistanceToBadChannel(2, 4, 5);
504 ana->SetTimeCut(-2000,2000); // open cut
57eb7f00 505 }
531f682d 506 else
507 {//EMCAL
508 ana->SetNCellCut(1);// At least 2 cells
509 ana->SetMinEnergy(0.5); // avoid mip peak at E = 260 MeV
510 ana->SetMaxEnergy(1000);
511 ana->SetTimeCut(-1000,1000); // open cut, usual time window of [425-825] ns if time recalibration is off
15882d9f 512 // restrict to less than 100 ns when time calibration is on
531f682d 513 ana->SetMinDistanceToBadChannel(2, 4, 6);
57eb7f00 514 }
193828fd 515
531f682d 516 if(kTM)
517 {
518 ana->SwitchOnTrackMatchRejection() ;
519 ana->SwitchOffTMHistoFill() ;
520 }
521 else
522 {
523 ana->SwitchOffTrackMatchRejection() ;
524 ana->SwitchOnTMHistoFill() ;
525 }
193828fd 526
cd54ca47 527 //PID cuts (shower shape)
531f682d 528 ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
529 AliCaloPID* caloPID = ana->GetCaloPID();
c1624f38 530 //Not used in bayesian
531
532 //EMCAL
531f682d 533 caloPID->SetEMCALLambda0CutMax(0.27);
c1624f38 534 caloPID->SetEMCALLambda0CutMin(0.10);
535
536 caloPID->SetEMCALDEtaCut(0.025);
531f682d 537 caloPID->SetEMCALDPhiCut(0.030);
bef94c35 538
c1624f38 539 //PHOS
540 caloPID->SetPHOSDispersionCut(2.5);
541 caloPID->SetPHOSRCut(2.);
542 if(kData=="AOD") caloPID->SetPHOSRCut(2000.); // Open cut since dX, dZ not stored
bef94c35 543
531f682d 544 ana->SwitchOffFillShowerShapeHistograms(); // Filled before photon shower shape selection
193828fd 545
cd54ca47 546 // Input / output delta AOD settings
1e3689fa 547
531f682d 548 if(!kData.Contains("delta"))
549 {
550 ana->SetOutputAODName(Form("Photon%s",kName.Data()));
551 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
552 //ana->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done
4df35693 553 }
531f682d 554 else ana->SetInputAODName(Form("Photon%s",kName.Data()));
193828fd 555
cd54ca47 556 //Set Histograms name tag, bins and ranges
557
531f682d 558 ana->AddToHistogramsName(Form("AnaPhoton_TM%d_",kTM));
559 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
193828fd 560
cd54ca47 561 // Number of particle type MC histograms
531f682d 562 ana->FillNOriginHistograms(8);
563 ana->FillNPrimaryHistograms(4);
564
565 ConfigureMC(ana);
566
567 if(kPrint) ana->Print("");
7e7694bb 568
531f682d 569 return ana;
570
571}
572
bef94c35 573//________________________________________________________________________________
574AliAnaElectron* ConfigureElectronAnalysis()
575{
576
577 AliAnaElectron *ana = new AliAnaElectron();
578 ana->SetDebug(kDebug); //10 for lots of messages
579
580 if(kCalorimeter == "PHOS")
581 {
582 ana->SetNCellCut(2);// At least 2 cells
583 ana->SetMinPt(0.3);
584 ana->SetMinDistanceToBadChannel(2, 4, 5);
585 }
586 else
587 {//EMCAL
588 ana->SetNCellCut(1);// At least 2 cells
589 ana->SetMinPt(0.5); // no effect minium EMCAL cut.
590 ana->SetMaxPt(100);
591 //ana->SetTimeCut(400,900);// Time window of [400-900] ns
592 ana->SetMinDistanceToBadChannel(2, 4, 6);
593 }
594
595 //Electron selection cuts with tracks
d2655d46 596 ana->SetEOverP(0.85, 1.2);
bef94c35 597 // TO DO, find a more suitable way to set this
598 if(kSimulation)
599 { // LHC11a
600 ana->SetdEdxCut(76, 85);
601 }
602 else // LHC11c
603 {
604 ana->SetdEdxCut(56, 64);
605 }
606
607 ana->SetCalorimeter(kCalorimeter);
608
609 ana->SwitchOffCaloPID();
610 ana->SwitchOffFillShowerShapeHistograms();
611 ana->SwitchOffFillWeightHistograms() ;
612 ana->SwitchOffFiducialCut();
613
614 if(!kData.Contains("delta"))
615 {
616 ana->SetOutputAODName(Form("Electron%s",kName.Data()));
617 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
618 }
619 else ana->SetInputAODName(Form("Electron%s",kName.Data()));
620
621 //Set Histograms name tag, bins and ranges
622
623 ana->AddToHistogramsName(Form("AnaElectron_TM%d_",kTM));
624 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
625
626 ConfigureMC(ana);
627
628 if(kPrint) ana->Print("");
629
630 return ana ;
631
632}
633
531f682d 634//__________________________________________________________________________________________
bef94c35 635AliAnaRandomTrigger* ConfigureRandomTriggerAnalysis(TString detector = "")
531f682d 636{
bef94c35 637
638 AliAnaRandomTrigger *ana = new AliAnaRandomTrigger();
639 ana->SetDebug(kDebug); //10 for lots of messages
640
641 if(detector=="") detector = kCalorimeter;
642 ana->SetDetector(detector);
643
644 // selection cuts
645 ana->SetMinPt(4.);
646 ana->SetMaxPt(51.);
647
648 if (detector=="EMCAL")
649 {
650 ana->SetEtaCut(-0.71,0.71);
651 ana->SetPhiCut(100*TMath::DegToRad(), 160*TMath::DegToRad());
652 }
653 else if(detector=="PHOS")
654 {
655 ana->SetEtaCut(-0.13,0.13);
656 ana->SetPhiCut(260*TMath::DegToRad(), 320*TMath::DegToRad());
657 }
658 else if(detector=="CTS")
659 {
660 ana->SetEtaCut(-0.9,0.9);
661 ana->SetPhiCut(0, TMath::TwoPi());
662 }
663
664 // AOD branch
665 if(!kData.Contains("delta"))
666 {
667 ana->SetOutputAODName(Form("RandomTrigger%s%s",detector.Data(),kName.Data()));
668 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
669 }
670 else
671 ana->SetInputAODName(Form("RandomTrigger%s%s",detector.Data(),kName.Data()));
672
673 printf("Set RandomTrigger%s%s\n",detector.Data(),kName.Data());
674
675 //Set Histograms name tag, bins and ranges
676
677 ana->AddToHistogramsName(Form("AnaRandomTrigger%s_",detector.Data()));
678
679 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
680
681 if(detector=="CTS")
682 {
683 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
684 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
685 }
686
687 if(kPrint) ana->Print("");
688
689 return ana;
690
691}
745913ae 692
bef94c35 693//__________________________________________________________________________________________
694AliAnaInsideClusterInvariantMass* ConfigureInClusterIMAnalysis(Float_t l0min, Float_t l0max)
695{
531f682d 696 AliAnaInsideClusterInvariantMass *ana = new AliAnaInsideClusterInvariantMass();
697 ana->SetDebug(kDebug); //10 for lots of messages
698
699 // selection cuts
193828fd 700
531f682d 701 ana->SetMinEnergy(5);
702 ana->SetMaxEnergy(200.);
703 ana->SetMinNCells(3);
704 ana->SetM02Cut(l0min,l0max);
705 ana->SetCalorimeter(kCalorimeter);
706
707 //ana->AddToHistogramsName(Form("AnaInClusterIM_%1.2f_%1.2f_",l0min,l0max));
708 ana->AddToHistogramsName("AnaInClusterIM_");
709
710 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
bef94c35 711
531f682d 712 AliCaloPID* caloPID = ana->GetCaloPID();
713 caloPID->SetEMCALDEtaCut(0.025);
714 caloPID->SetEMCALDPhiCut(0.030);
715 caloPID->SetClusterSplittingM02Cut(0,100); // Do the selection in the analysis class and not in the PID method to fill SS histograms
716
d2655d46 717 caloPID->SetPi0MassRange(0.10, 0.18);
718 caloPID->SetEtaMassRange(0.40, 0.60);
719 caloPID->SetPhotonMassRange(0.00, 0.08);
720
531f682d 721 ConfigureMC(ana);
722
723 if(kPrint) ana->Print("");
724
725 return ana;
15882d9f 726
193828fd 727}
728
cd54ca47 729//_______________________________________________
730AliAnaChargedParticles* ConfigureChargedAnalysis()
731{
732
531f682d 733 AliAnaChargedParticles *ana = new AliAnaChargedParticles();
734 ana->SetDebug(kDebug); //10 for lots of messages
cd54ca47 735
736 // selection cuts
737
3e0ccecf 738 ana->SetMinPt(4.);
531f682d 739 ana->SwitchOnFiducialCut();
740 ana->GetFiducialCut()->SetSimpleCTSFiducialCut(0.9, 0, 360) ; //more restrictive cut in reader and after in isolation
741
cd54ca47 742 // Input / output delta AOD settings
743
531f682d 744 if(!kData.Contains("delta"))
745 {
746 ana->SetOutputAODName(Form("Hadron%s",kName.Data()));
747 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
748 //ana->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done
cd54ca47 749 }
531f682d 750 else
751 ana->SetInputAODName(Form("Hadron%s",kName.Data()));
752 printf("Set Hadron%s\n",kName.Data());
cd54ca47 753 //Set Histograms name tag, bins and ranges
754
531f682d 755 ana->AddToHistogramsName("AnaHadrons_");
756 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
cd54ca47 757
531f682d 758 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
759 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
745913ae 760
531f682d 761 ConfigureMC(ana);
cd54ca47 762
531f682d 763 if(kPrint) ana->Print("");
764
765 return ana;
cd54ca47 766
767}
768
769
193828fd 770//_______________________________
771AliAnaPi0* ConfigurePi0Analysis()
772{
1e3689fa 773
531f682d 774 AliAnaPi0 *ana = new AliAnaPi0();
cd54ca47 775
531f682d 776 ana->SetDebug(kDebug);//10 for lots of messages
cd54ca47 777
778 // Input delta AOD settings
c2091d88 779 ana->SetInputAODName(Form("Photon%s",kName.Data()));
cd54ca47 780
781 // Calorimeter settings
531f682d 782 ana->SetCalorimeter(kCalorimeter);
783 if(kCalorimeter=="PHOS") ana->SetNumberOfModules(3); //PHOS first year
784 else
785 {
786 if (kYears == 2010) ana->SetNumberOfModules( 4); // EMCAL first year
787 else if(kYears == 2011) ana->SetNumberOfModules(10); // Second year
788 else ana->SetNumberOfModules(12);
cd54ca47 789 }
193828fd 790
791 //settings for pp collision mixing
531f682d 792 ana->SwitchOnOwnMix(); //Off when mixing done with general mixing frame
193828fd 793
cd54ca47 794 // Cuts
531f682d 795 if(kCalorimeter=="EMCAL") ana->SetPairTimeCut(70);
cd54ca47 796
531f682d 797 if (kCollisions=="pp" )
798 {
799 ana->SetNCentrBin(1);
800 ana->SetNZvertBin(10);
801 ana->SetNRPBin(1);
802 ana->SetNMaxEvMix(100);
bef94c35 803 ana->SwitchOnSMCombinations();
193828fd 804 }
531f682d 805 else if(kCollisions=="PbPb")
806 {
807 ana->SetNCentrBin(10);
808 ana->SetNZvertBin(10);
809 ana->SetNRPBin(4);
810 ana->SetNMaxEvMix(10);
811 ana->SwitchOffSMCombinations();
193828fd 812 }
bef94c35 813
814 ana->SwitchOffMultipleCutAnalysis();
815
cd54ca47 816 //Set Histograms name tag, bins and ranges
193828fd 817
531f682d 818 ana->AddToHistogramsName(Form("AnaPi0_TM%d_",kTM));
819 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
745913ae 820
531f682d 821 ConfigureMC(ana);
822
823 if(kPrint) ana->Print("");
824
825 return ana;
193828fd 826
827}
af7b3903 828
193828fd 829//_____________________________________________________
830AliAnaPi0EbE* ConfigurePi0EbEAnalysis(TString particle,
831 Int_t analysis)
832{
7e7694bb 833
531f682d 834 AliAnaPi0EbE *ana = new AliAnaPi0EbE();
835 ana->SetDebug(kDebug);//10 for lots of messages
cd54ca47 836
531f682d 837 ana->SetAnalysisType(analysis);
193828fd 838 TString opt = "";
839 if(analysis==AliAnaPi0EbE::kIMCaloTracks) opt = "Conv";
840 if(analysis==AliAnaPi0EbE::kSSCalo) opt = "SS";
841
531f682d 842 ana->SetMinPt(0.5);
843
844 if(kCalorimeter=="EMCAL")ana->SetPairTimeCut(15); // More strict than in pi0 inv mass analysis
845
846 ana->SetCalorimeter(kCalorimeter);
193828fd 847
cd54ca47 848 // Input / output delta AOD settings
849
531f682d 850 ana->SetInputAODName(Form("Photon%s",kName.Data()));
851 if(!kInputDataType.Contains("delta"))
852 {
853 ana->SetOutputAODName(Form("%s%s%s",particle.Data(), opt.Data(), kName.Data()));
854 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
32301b07 855 }
531f682d 856 else
857 ana->SetInputAODName(Form("%s%s%s",particle.Data(),opt.Data(),kName.Data()));
193828fd 858
531f682d 859 if(analysis == AliAnaPi0EbE::kIMCaloTracks) ana->SetInputAODGammaConvName("PhotonsCTS");
4f155d15 860
531f682d 861 if(analysis!=AliAnaPi0EbE::kSSCalo)
862 {
863 AliNeutralMesonSelection *nms = ana->GetNeutralMesonSelection();
193828fd 864 nms->SetParticle(particle);
bef94c35 865
866 // Tighten a bit mass cut with respect to default window
867 if(particle=="Pi0") nms->SetInvMassCutRange(0.120,0.150);
868 if(particle=="Eta") nms->SetInvMassCutRange(0.520,0.580);
869
531f682d 870 nms->SwitchOnAngleSelection();
193828fd 871 nms->KeepNeutralMesonSelectionHistos(kTRUE);
872 //nms->SetAngleMaxParam(2,0.2);
531f682d 873 nms->SetHistoERangeAndNBins(0, 20, 80) ;
193828fd 874 //nms->SetHistoIMRangeAndNBins(0, 1, 400);
57b97dc6 875 }
d2655d46 876 else
877 { // cluster splitting settings
878 ana->SetTimeCut(-1000,1000); // Open time cut
879 AliCaloPID* caloPID = ana->GetCaloPID();
880 caloPID->SetPi0MassRange(0.10, 0.18);
881 caloPID->SetEtaMassRange(0.40, 0.60);
882 caloPID->SetPhotonMassRange(0.00, 0.08);
883 caloPID->SetClusterSplittingM02Cut(0.5,100); // Do the selection in the analysis class and not in the PID method to fill SS histograms
884 }
193828fd 885
531f682d 886 ana->SwitchOffSelectedClusterHistoFill();
887 ana->SwitchOffFillWeightHistograms();
888
889 if(!kTM) ana->SwitchOnTMHistoFill();
890 else ana->SwitchOffTMHistoFill();
891
cd54ca47 892 //Set Histograms name tag, bins and ranges
193828fd 893
531f682d 894 ana->AddToHistogramsName(Form("Ana%s%sEbE_TM%d_",particle.Data(),opt.Data(),kTM));
895 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
745913ae 896
531f682d 897 ConfigureMC(ana);
193828fd 898
531f682d 899 if(kPrint) ana->Print("");
193828fd 900
531f682d 901 return ana;
193828fd 902
903}
904
531f682d 905//____________________________________________________________________________________________________
cd54ca47 906AliAnaParticleIsolation* ConfigureIsolationAnalysis(TString particle="Photon",
907 Int_t partInCone = AliIsolationCut::kOnlyCharged,
908 Int_t thresType = AliIsolationCut::kSumPtFracIC,
909 Bool_t multi = kFALSE)
193828fd 910{
911
531f682d 912 AliAnaParticleIsolation *ana = new AliAnaParticleIsolation();
913 //ana->SetDebug(kDebug);
914 ana->SetDebug(kDebug);
cd54ca47 915
531f682d 916 ana->SwitchOnFiducialCut();
917 //Avoid borders of EMCal
918 if(kCalorimeter=="EMCAL")
919 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
920
921 // Same Eta as EMCal, cut in phi if EMCAL was triggering
bef94c35 922 if(particle=="Hadron" || particle.Contains("CTS"))
531f682d 923 {
924 if(kTrig.Contains("EMC"))
925 ana->GetFiducialCut()->SetSimpleCTSFiducialCut (0.6, 190, 360+70) ;
926 else
927 ana->GetFiducialCut()->SetSimpleCTSFiducialCut (0.6, 0, 360) ;
928 }
929
3e0ccecf 930 ana->SetMinPt(4);
cd54ca47 931
932 // Input / output delta AOD settings
933
531f682d 934 ana->SetInputAODName(Form("%s%s",particle.Data(),kName.Data()));
935 ana->SetAODObjArrayName(Form("IC%sTM%d",particle.Data(),kTM));
936
937 ana->SetCalorimeter(kCalorimeter);
938
939 if(!kTM) ana->SwitchOnTMHistoFill();
940 else ana->SwitchOffTMHistoFill();
193828fd 941
531f682d 942 ana->SwitchOffSSHistoFill();
193828fd 943
cd54ca47 944 //Do settings for main isolation cut class
531f682d 945 AliIsolationCut * ic = ana->GetIsolationCut();
946 ic->SetDebug(kDebug);
947
948 ic->SetConeSize(0.3);
949
950 if(kCollisions=="pp") ic->SetPtThreshold(0.5);
951 if(kCollisions=="PbPb")ic->SetPtThreshold(2);
952 //ic->SetPtThreshold(1.);
953
2244659d 954 ic->SetPtFraction(0.1);
955 ic->SetSumPtThreshold(1.0) ;
cd54ca47 956 ic->SetParticleTypeInCone(partInCone);
957 ic->SetICMethod(thresType);
1e3689fa 958
90eb3a19 959 //Do or not do isolation with previously produced AODs.
960 //No effect if use of SwitchOnSeveralIsolation()
531f682d 961 ana->SwitchOffReIsolation();
962
90eb3a19 963 //Multiple IC
531f682d 964 if(multi)
965 {
966 ic->SetConeSize(1.); // Take all for first iteration
967 ic->SetPtThreshold(100);// Take all for first iteration
968 ana->SwitchOnSeveralIsolation() ;
969 ana->AddToHistogramsName(Form("AnaMultiIsol%s_TM%d_",particle.Data(),kTM));
970 ana->SetAODObjArrayName(Form("MultiIC%sTM%d",particle.Data(),kTM));
971 ana->SetNCones(2);
972 ana->SetNPtThresFrac(4);
973 ana->SetConeSizes(0,0.3); ana->SetConeSizes(1,0.4);
974 ana->SetPtThresholds(0, 0.5); ana->SetPtThresholds(1, 1); ana->SetPtThresholds(2, 2); ana->SetPtThresholds(3, 3);
975 ana->SetPtFractions (0, 0.05) ; ana->SetPtFractions (1, 0.1);ana->SetPtFractions (2, 0.2) ; ana->SetPtFractions (3, 0.3) ;
976 ana->SwitchOffTMHistoFill();
977 ana->SwitchOffSSHistoFill();
978 }
979 else
980 ana->SwitchOffSeveralIsolation() ;
981
982 AliCaloPID* caloPID = ana->GetCaloPID();
983 caloPID->SetEMCALDEtaCut(0.025);
984 caloPID->SetEMCALDPhiCut(0.030);
cd54ca47 985
986 //Set Histograms name tag, bins and ranges
987
531f682d 988 ana->AddToHistogramsName(Form("AnaIsol%s_TM%d_",particle.Data(),kTM));
989 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
cd54ca47 990
531f682d 991 ana->SetHistoPtInConeRangeAndNBins(0, 50 , 250);
992 ana->SetHistoPtSumRangeAndNBins (0, 100, 250);
993
bef94c35 994 if(particle=="Hadron" || particle.Contains("CTS"))
531f682d 995 {
996 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
997 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
998 }
193828fd 999
531f682d 1000 ConfigureMC(ana);
745913ae 1001
531f682d 1002 if(kPrint) ic ->Print("");
1003 if(kPrint) ana->Print("");
1004
1005 return ana;
193828fd 1006
1007}
1008
1009//___________________________________________________________________________________
1010AliAnaParticleHadronCorrelation* ConfigureHadronCorrelationAnalysis(TString particle,
1011 Int_t bIsolated)
1012{
90eb3a19 1013
531f682d 1014 AliAnaParticleHadronCorrelation *ana = new AliAnaParticleHadronCorrelation();
1015 ana->SetDebug(kDebug);
1016
3e0ccecf 1017 ana->SetMinimumTriggerPt(4);
531f682d 1018 ana->SetAssociatedPtRange(0.2,200);
907b38cd 1019 ana->SetDeltaPhiCutRange( TMath::Pi()/2,3*TMath::Pi()/2 ); //[90 deg, 270 deg]
1020
1021 ana->SelectIsolated(bIsolated); // do correlation with isolated photons
1022
1023 ana->SwitchOnAbsoluteLeading(); // Select trigger leading particle of all the selected tracks
1024 ana->SwitchOffNearSideLeading(); // Select trigger leading particle of all the particles at +-90 degrees, default
cd54ca47 1025
029dea5a 1026 // Mixing with own pool
1027 ana->SwitchOffOwnMix();
1028 ana->SetNCentrBin(9);
1029 ana->SetNZvertBin(10);
1030 if(kCollisions=="pp")
1031 {
1032 ana->SetNMaxEvMix(10);
1033 ana->SwitchOnTrackMultBins();
1034 }
1035 else
1036 {
1037 ana->SetNMaxEvMix(2);
1038 ana->SwitchOffTrackMultBins();
1039 }
1040
531f682d 1041 //Avoid borders of EMCal, same as for isolation
1042 if(kCalorimeter=="EMCAL")
1043 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
1044
1045 // Same Eta as EMCal, cut in phi if EMCAL was triggering
bef94c35 1046 if(particle=="Hadron" || particle.Contains("CTS"))
531f682d 1047 {
1048 if(kTrig.Contains("EMC"))
1049 ana->GetFiducialCut()->SetSimpleCTSFiducialCut (0.6, 190, 360+70) ;
1050 else
1051 ana->GetFiducialCut()->SetSimpleCTSFiducialCut (0.6, 0, 360) ;
1052 }
cd54ca47 1053
1054 // Input / output delta AOD settings
1055
531f682d 1056 ana->SetInputAODName(Form("%s%s",particle.Data(),kName.Data()));
1057 ana->SetAODObjArrayName(Form("%sHadronCorrIso%dTM%d",particle.Data(),bIsolated,kTM));
193828fd 1058
907b38cd 1059 // Fill extra plots on tagged decay photons
1060 // If trigger is pi0/eta found with invariant mass, get the decays
1061 // If trigger is photon, check if it was tagged as decay previously
1062 if(particle=="Pi0" || particle =="Eta")
1063 {
1064 if(!particle.Contains("SS")) ana->SwitchOnPi0TriggerDecayCorr();
1065 else ana->SwitchOffPi0TriggerDecayCorr();
1066 ana->SwitchOffDecayTriggerDecayCorr();
1067 }
1068 else
1069 {
1070 ana->SwitchOffPi0TriggerDecayCorr();
1071 ana->SwitchOnDecayTriggerDecayCorr(); // Make sure pi0 decay tagging runs before this task
1072 }
193828fd 1073
907b38cd 1074 // if triggering on PHOS and EMCAL is on
1075 //if(kCalorimeter=="PHOS") ana->SwitchOnNeutralCorr();
1076 ana->SwitchOffNeutralCorr(); // Do only correlation with TPC
1077
1078 ana->SwitchOffHMPIDCorrelation();
cd54ca47 1079
907b38cd 1080 ana->SwitchOffFillBradHistograms();
023e6936 1081
907b38cd 1082 // Underlying event
1083 ana->SwitchOnEventSelection();
531f682d 1084 ana->SwitchOnSeveralUECalculation();
1085 ana->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3);
907b38cd 1086 ana->SetMultiBin(1);
cd54ca47 1087
1088 //Set Histograms name tag, bins and ranges
1089
531f682d 1090 ana->AddToHistogramsName(Form("Ana%sHadronCorr_Iso%d_TM%d_",particle.Data(),bIsolated,kTM));
1091 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
1092
bef94c35 1093 if(particle=="Hadron" || particle.Contains("CTS"))
531f682d 1094 {
1095 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
1096 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
1097 }
745913ae 1098
531f682d 1099 ConfigureMC(ana);
cd54ca47 1100
531f682d 1101 if(kPrint) ana->Print("");
1e3689fa 1102
531f682d 1103 return ana;
1e3689fa 1104
193828fd 1105}
69652c63 1106
193828fd 1107//________________________________________
1108AliAnaCalorimeterQA* ConfigureQAAnalysis()
1109{
90eb3a19 1110
531f682d 1111 AliAnaCalorimeterQA *ana = new AliAnaCalorimeterQA();
1112 ana->SetDebug(kDebug); //10 for lots of messages
1113 ana->SetCalorimeter(kCalorimeter);
a3aebfff 1114
531f682d 1115 ana->SetTimeCut(-1000,1000); // Open time cut
5eef1db1 1116
66e64043 1117 // Study inter detector correlation (PHOS, EMCAL, Tracks, V0)
d2655d46 1118 if(kCalorimeter=="PHOS" && kTrig=="PHOS")
531f682d 1119 ana->SwitchOnCorrelation(); // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON
d2655d46 1120 if(kCalorimeter=="EMCAL" && kClusterArray=="")
531f682d 1121 ana->SwitchOnCorrelation(); // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON
d2655d46 1122 else
531f682d 1123 ana->SwitchOffCorrelation();
66e64043 1124
1125 // Study exotic clusters PHOS and EMCAL
d2655d46 1126 if(kClusterArray=="") ana->SwitchOnStudyBadClusters() ;
1127 else ana->SwitchOffStudyBadClusters() ;
1128
8f880b6e 1129
531f682d 1130 ana->SwitchOffFiducialCut();
1131 ana->SwitchOffFillAllTH3Histogram();
1132 ana->SwitchOffFillAllPositionHistogram();
1133 ana->SwitchOffFillAllPositionHistogram2();
1134 if(!kExotic)ana->SwitchOnStudyBadClusters();
1135 else ana->SwitchOffStudyBadClusters();
1136 ana->SwitchOffStudyClustersAsymmetry();
1137 ana->SwitchOffStudyWeight();
1138 ana->SwitchOnFillAllTrackMatchingHistogram();
193828fd 1139
8f880b6e 1140 if(kCalorimeter=="EMCAL")
1141 {
531f682d 1142 if (kYears==2010) ana->SetNumberOfModules(4);
1143 else if(kYears==2011) ana->SetNumberOfModules(10);
1144 else ana->SetNumberOfModules(12);
8f880b6e 1145 }
1146 else
1147 {//PHOS
531f682d 1148 ana->SetNumberOfModules(3);
8f880b6e 1149 }
1150
531f682d 1151 ana->AddToHistogramsName("QA_"); //Begining of histograms name
1152 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
745913ae 1153
531f682d 1154 ConfigureMC(ana);
cd54ca47 1155
531f682d 1156 if(kPrint) ana->Print("");
193828fd 1157
531f682d 1158 return ana;
69652c63 1159
90eb3a19 1160}
193828fd 1161
cd54ca47 1162//________________________________________________________
531f682d 1163void ConfigureMC(AliAnaCaloTrackCorrBaseClass* ana)
1164{
1165 if(kSimulation) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
1166 else ana->SwitchOffDataMC() ;
1167
1168 //Set here generator name, default pythia
1169 //ana->GetMCAnalysisUtils()->SetMCGenerator("");
1170}
1171
1172//________________________________________________________
1173void SetHistoRangeAndNBins (AliHistogramRanges* histoRanges)
cd54ca47 1174{
1175 // Set common bins for all analysis and MC histograms filling
745913ae 1176
531f682d 1177 histoRanges->SetHistoPtRangeAndNBins(0, 100, 200) ; // Energy and pt histograms
cd54ca47 1178
531f682d 1179 if(kCalorimeter=="EMCAL")
1180 {
1181 if(kYears==2010)
1182 {
1183 histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
1184 histoRanges->SetHistoXRangeAndNBins(-230,90,120); // QA
1185 histoRanges->SetHistoYRangeAndNBins(370,450,40); // QA
cd54ca47 1186 }
531f682d 1187 else if(kYears==2011)
1188 {
1189 histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
1190 histoRanges->SetHistoXRangeAndNBins(-600,90,200); // QA
1191 histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
cd54ca47 1192 }
531f682d 1193 else
1194 {
1195 histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 190*TMath::DegToRad(), 122) ;
1196 histoRanges->SetHistoXRangeAndNBins(-100,90,200); // QA
1197 histoRanges->SetHistoYRangeAndNBins(50,450,100); // QA
1198 }
1199
1200 histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
cd54ca47 1201 }
531f682d 1202 else
1203 {
1204 histoRanges->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ;
1205 histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
745913ae 1206 }
1207
bef94c35 1208 histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
cd54ca47 1209
531f682d 1210 // Invariant mass histoRangeslysis
1211 histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
1212 histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
cd54ca47 1213
1214 // check if time calibration is on
531f682d 1215 histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
1216 histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
cd54ca47 1217
09273901 1218 // track-cluster residuals
531f682d 1219 histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
1220 histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
1221
cd54ca47 1222 // QA, electron, charged
531f682d 1223 histoRanges->SetHistoPOverERangeAndNBins(0,10.,100);
1224 histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200);
cd54ca47 1225
1226 // QA
531f682d 1227 histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
1228 histoRanges->SetHistodRRangeAndNBins(0.,TMath::Pi(),150);
1229 histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
1230 histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
1231 histoRanges->SetHistoNClusterCellRangeAndNBins(0,500,500);
1232 histoRanges->SetHistoZRangeAndNBins(-400,400,200);
1233 histoRanges->SetHistoRRangeAndNBins(400,450,25);
1234 histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
1235 histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
1236 histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
cd54ca47 1237
1238}
193828fd 1239
531f682d 1240