]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/CaloTrackCorrelations/macros/AddTaskCaloTrackCorr.C
put different cluster parameters (time, n cells, n SM) in the AOD particle, recover...
[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 = "";
8bd000ef 13TString kData = ""; // MC or deltaAOD
193828fd 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;
67b98f1b 27Bool_t kTender = kFALSE;
740c3286 28Bool_t kMix = kFALSE;
ec551ef4 29Int_t kRunNumber = -1;
023e6936 30
8bd000ef 31AliAnalysisTaskCaloTrackCorrelation *AddTaskCaloTrackCorr(const TString data = "",
ac0610dc 32 const TString calorimeter = "EMCAL",
33 const Bool_t simulation = kFALSE,
34 const Bool_t eventsel = kFALSE,
35 const Bool_t exotic = kTRUE,
36 const Bool_t nonlin = kFALSE,
37 TString outputfile = "",
38 const Int_t year = 2010,
39 const TString col = "pp",
40 const TString trigger = "MB",
41 const TString clustersArray = "V1",
740c3286 42 const Bool_t mix = kTRUE,
ac0610dc 43 const Bool_t recaltm = kTRUE,
44 const Bool_t tm = kTRUE,
45 const Int_t minCen = -1,
46 const Int_t maxCen = -1,
47 const Bool_t qaan = kFALSE,
48 const Bool_t hadronan = kFALSE,
49 const Bool_t calibE = kTRUE,
50 const Bool_t badmap = kTRUE,
51 const Bool_t calibT = kTRUE,
67b98f1b 52 const Bool_t tender = kFALSE,
ac0610dc 53 const Bool_t outputAOD = kFALSE,
54 const Bool_t printSettings = kFALSE,
ec551ef4 55 const Double_t scaleFactor = -1,
56 const Int_t runNumber = -1
531f682d 57 )
193828fd 58{
372e67a3 59 // Creates a CaloTrackCorr task, configures it and adds it to the analysis manager.
90eb3a19 60
cd54ca47 61 kPrint = printSettings;
193828fd 62 kSimulation = simulation;
193828fd 63 kYears = year;
64 kCollisions = col;
531f682d 65 kExotic = exotic;
66 kNonLinearity = nonlin;
193828fd 67 kTrig = trigger;
68 kClusterArray = clustersArray;
69 kData = data;
70 kCalorimeter = calorimeter;
71 kOutputAOD = outputAOD;
531f682d 72 kTM = tm;
73 kRecalTM = recaltm;
74 kMinCen = minCen;
75 kMaxCen = maxCen;
76 kEventSelection= eventsel;
77 kQA = qaan;
78 kHadronAN = hadronan;
023e6936 79 kCalibE = calibE;
80 kCalibT = calibT;
81 kBadMap = badmap;
67b98f1b 82 kTender = tender;
740c3286 83 kMix = mix;
ec551ef4 84 kRunNumber = runNumber;
85
90eb3a19 86 // Get the pointer to the existing analysis manager via the static access method.
193828fd 87
90eb3a19 88 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
531f682d 89 if (!mgr)
90 {
193828fd 91 ::Error("AddTask", "No analysis manager to connect to.");
90eb3a19 92 return NULL;
93 }
193828fd 94
95 // Check the analysis type using the event handlers connected to the analysis manager.
96
531f682d 97 if (!mgr->GetInputEventHandler())
98 {
193828fd 99 ::Error("AddTask", "This task requires an input event handler");
100 return NULL;
101 }
e47144a5 102
103 // Make sure the B field is enabled for track selection, some cuts need it
104 ((AliInputEventHandler*)mgr->GetInputEventHandler())->SetNeedField(kTRUE);
531f682d 105
193828fd 106 kInputDataType = "AOD";
107 if(!kData.Contains("delta"))
108 kInputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
109
531f682d 110 if(kSimulation)
111 {
1e3689fa 112 kUseKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
193828fd 113 if (!kUseKinematics && data=="AOD" && kInputDataType != "ESD") kUseKinematics = kTRUE; //AOD primary should be available ...
1e3689fa 114 }
115
116 cout<<"********* ACCESS KINE? "<<kUseKinematics<<endl;
117
531f682d 118 // Name for containers
119
120 kName = Form("%s_Trig%s_Cl%s_TM%d",kCalorimeter.Data(), kTrig.Data(),kClusterArray.Data(),kTM);
121
122 if(kCollisions=="PbPb" && kMaxCen>=0) kName+=Form("Cen%d_%d",kMinCen,kMaxCen);
123
124 printf("<<<< NAME: %s >>>>>\n",kName.Data());
125
193828fd 126 // #### Configure analysis ####
cd54ca47 127
745913ae 128 AliAnaCaloTrackCorrMaker * maker = new AliAnaCaloTrackCorrMaker();
193828fd 129
1806f9c0 130 maker->SetScaleFactor(scaleFactor); // for MC, negative (not scaled) by default
131
193828fd 132 // General frame setting and configuration
133 maker->SetReader (ConfigureReader() );
134 maker->SetCaloUtils(ConfigureCaloUtils());
135
136 // Analysis tasks setting and configuration
137 Int_t n = 0;//Analysis number, order is important
193828fd 138
cd54ca47 139 // Isolation settings
66e64043 140 Int_t partInCone = AliIsolationCut::kNeutralAndCharged; // kOnlyCharged;
ac0610dc 141 Int_t thresType = AliIsolationCut::kPtThresIC;// AliIsolationCut::kSumPtFracIC ;
740c3286 142 Float_t cone = -1;
143 Float_t pth = -1;
531f682d 144
ac0610dc 145 // Photon analysis
531f682d 146
147 maker->AddAnalysis(ConfigurePhotonAnalysis(), n++); // Photon cluster selection
e9de0d57 148
149 // Invariant mass analysis Put here to tag selected photons as decay
150 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Pi0", AliAnaPi0EbE::kIMCalo), n++); // Pi0 event by event selection, invariant mass and photon tagging from decay
151 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Eta", AliAnaPi0EbE::kIMCalo), n++); // Eta event by event selection, invariant mass and photon tagging from decay
152
153 // Photon analysis
740c3286 154 maker->AddAnalysis(ConfigureIsolationAnalysis("Photon", partInCone,thresType,cone, pth), n++); // Photon isolation
531f682d 155 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Photon",kFALSE), n++); // Gamma hadron correlation
740c3286 156 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Photon",kTRUE,partInCone,thresType, cone, pth) , n++); // Isolated gamma hadron correlation
ac0610dc 157 //maker->AddAnalysis(ConfigureIsolationAnalysis("Photon", partInCone,thresType,kTRUE), n++); // Photon multi isolation, leave it the last
158
e9de0d57 159
ac0610dc 160 // Split cluster analysis
161 if(kCalorimeter == "EMCAL")
162 {
b583134f 163 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Pi0", AliAnaPi0EbE::kSSCalo), n++); // Pi0 event by event selection, cluster splitting
164 maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0SS", partInCone,thresType,cone, pth), n++); // Pi0 isolation, cluster splits
ac0610dc 165 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0SS" ,kFALSE), n++); // Pi0 hadron correlation
740c3286 166 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0SS" ,kTRUE,partInCone,thresType, cone, pth) , n++); // Isolated pi0 hadron correlation
ac0610dc 167 //maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0SS", partInCone,thresType,kTRUE), n++); // Pi0 multi isolation, split cluster
b583134f 168 maker->AddAnalysis(ConfigureInClusterIMAnalysis(kTRUE , kTRUE ), n++);
ac0610dc 169 }
170
171 // Invariant mass analysis
ac0610dc 172 maker->AddAnalysis(ConfigurePi0EbEAnalysis("Pi0SideBand", AliAnaPi0EbE::kIMCalo), n++); // Pi0 event by event selection, and photon tagging from decay
740c3286 173 maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0", partInCone,thresType,cone, pth), n++); // Pi0 isolation, invariant mass
174 maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0SideBand", partInCone,thresType,cone, pth), n++); // Pi0 isolation, side band
531f682d 175 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0" ,kFALSE), n++); // Pi0 hadron correlation
740c3286 176 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0" ,kTRUE,partInCone,thresType, cone, pth) , n++); // Isolated pi0 hadron correlation
ac0610dc 177 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0SideBand" ,kFALSE), n++); // Pi0 hadron correlation
740c3286 178 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Pi0SideBand" ,kTRUE,partInCone,thresType, cone, pth) , n++); // Isolated pi0 hadron correlation
ac0610dc 179 //maker->AddAnalysis(ConfigureIsolationAnalysis("Pi0", partInCone,thresType,kTRUE), n++); // Pi0 multi isolation, invariant mass, leave it the last
180
531f682d 181 if(kHadronAN)
8f880b6e 182 {
8f880b6e 183 maker->AddAnalysis(ConfigureChargedAnalysis(), n++); // track selection
740c3286 184 maker->AddAnalysis(ConfigureIsolationAnalysis("Hadron",AliIsolationCut::kOnlyCharged,thresType,cone, pth), n++); // track isolation
8f880b6e 185 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Hadron",kFALSE), n++); // track-track correlation
740c3286 186 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("Hadron",kTRUE,partInCone,thresType, cone, pth) , n++); // Isolated track-track correlation
ac0610dc 187 //maker->AddAnalysis(ConfigureIsolationAnalysis("Hadron",partInCone,thresType,kTRUE), n++);// Hadron multi isolation
cd54ca47 188 }
531f682d 189
bef94c35 190 // Analysis with ghost triggers, only for Min Bias like events
ac0610dc 191 if( kTrig.Contains("INT") || kTrig.Contains("Central") || kTrig.Contains("MB") )
bef94c35 192 {
193 maker->AddAnalysis(ConfigureRandomTriggerAnalysis(), n++);
740c3286 194 maker->AddAnalysis(ConfigureIsolationAnalysis(Form("RandomTrigger%s",kCalorimeter.Data()), partInCone,thresType,cone, pth), n++); // Ghost trigger isolation
bef94c35 195 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis(Form("RandomTrigger%s",kCalorimeter.Data()),kFALSE), n++); // Ghost trigger hadron correlation
740c3286 196 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis(Form("RandomTrigger%s",kCalorimeter.Data()),kTRUE,partInCone,thresType, cone, pth) , n++); // Isolated ghost hadron correlation
ac0610dc 197 //maker->AddAnalysis(ConfigureIsolationAnalysis(Form("RandomTrigger%s",kCalorimeter.Data()), partInCone,thresType,kTRUE), n++); // Ghost multi isolation
bef94c35 198
199 if(kHadronAN)
200 {
201 maker->AddAnalysis(ConfigureRandomTriggerAnalysis("CTS"), n++); // track selection
740c3286 202 maker->AddAnalysis(ConfigureIsolationAnalysis("RandomTriggerCTS",AliIsolationCut::kOnlyCharged,thresType,cone, pth), n++); // track isolation
bef94c35 203 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("RandomTriggerCTS",kFALSE), n++); // track-track correlation
740c3286 204 maker->AddAnalysis(ConfigureHadronCorrelationAnalysis("RandomTriggerCTS",kTRUE,partInCone,thresType, cone, pth) , n++); // Isolated track-track correlation
ac0610dc 205 //maker->AddAnalysis(ConfigureIsolationAnalysis("RandomTriggerCTS",AliIsolationCut::kOnlyCharged,thresType,kTRUE), n++); // Ghost multi isolation
bef94c35 206 }
207 }
208
ac0610dc 209 if(kQA) maker->AddAnalysis(ConfigureQAAnalysis(),n++);
531f682d 210
211 maker->SetAnaDebug(kDebug) ;
193828fd 212 maker->SwitchOnHistogramsMaker() ;
213 if(kData.Contains("delta")) maker->SwitchOffAODsMaker() ;
214 else maker->SwitchOnAODsMaker() ;
531f682d 215
193828fd 216 if(kPrint) maker->Print("");
217
b583134f 218 if(kSimulation) maker->SwitchOffDataControlHistograms();
219
cd54ca47 220 printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, kCalorimeter.Data());
e9de0d57 221
193828fd 222 // Create task
223
531f682d 224 AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("CaloTrackCorr%s",kName.Data()));
193828fd 225 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
531f682d 226 task->SetDebugLevel(kDebug);
227 task->SetBranches("ESD:AliESDRun.,AliESDHeader");
193828fd 228 task->SetAnalysisMaker(maker);
229 mgr->AddTask(task);
230
231 //Create containers
232
531f682d 233 if(outputfile.Length()==0) outputfile = AliAnalysisManager::GetCommonFileName();
193828fd 234
531f682d 235 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(kName, TList::Class(),
193828fd 236 AliAnalysisManager::kOutputContainer,
237 Form("%s",outputfile.Data()));
238
1806f9c0 239 AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Param_%s",kName.Data()), TList::Class(),
193828fd 240 AliAnalysisManager::kParamContainer,
1806f9c0 241 "AnalysisParameters.root");
3e0ccecf 242
193828fd 243 // Create ONLY the output containers for the data produced by the task.
244 // Get and connect other common input/output containers via the manager as below
245 //==============================================================================
246 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
247 // AOD output slot will be used in a different way in future
248 if(!kData.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
249 mgr->ConnectOutput (task, 1, cout_pc);
250 mgr->ConnectOutput (task, 2, cout_cuts);
251
ec551ef4 252 if(!kMix)
253 {
254 UInt_t mask = SetTriggerMaskFromName();
255 task->SelectCollisionCandidates(mask);
256 }
193828fd 257
258 return task;
259}
260
261//____________________________________
262AliCaloTrackReader * ConfigureReader()
263{
264
265 AliCaloTrackReader * reader = 0;
8bd000ef 266 if (kInputDataType == "ESD"&& kData=="MC" )
267 reader = new AliCaloTrackMCReader();
268 else if(kInputDataType=="AOD" || kData.Contains("AOD"))
269 reader = new AliCaloTrackAODReader();
270 else if(kInputDataType=="ESD")
271 reader = new AliCaloTrackESDReader();
272 else
273 printf("AliCaloTrackReader::ConfigureReader() - Data combination not known kData=%s, kInputData=%s\n",kData.Data(),kInputDataType.Data());
1e3689fa 274
531f682d 275 reader->SetDebug(kDebug);//10 for lots of messages
193828fd 276
ec551ef4 277 /*
6288bcb7 278 if(kSimulation)
279 {
280 // Event rejection cuts for jet-jet simulations
281 reader->SetPtHardAndJetPtComparison(kTRUE);
282 reader->SetPtHardAndJetPtFactor(4);
ec551ef4 283
6288bcb7 284 reader->SetPtHardAndClusterPtComparison(kTRUE);
285 reader->SetPtHardAndClusterPtFactor(1.5);
286 }
ec551ef4 287 */
288
cd54ca47 289 //Delta AOD?
290 //reader->SetDeltaAODFileName("");
291 if(kOutputAOD) reader->SwitchOnWriteDeltaAOD() ;
292
293 // MC settings
294 if(kUseKinematics){
295 if(kInputDataType == "ESD"){
296 reader->SwitchOnStack();
297 reader->SwitchOffAODMCParticles();
298 }
299 else if(kInputDataType == "AOD"){
300 reader->SwitchOffStack();
301 reader->SwitchOnAODMCParticles();
302 }
303 }
304
305 //------------------------
306 // Detector input filling
307 //------------------------
308
309 //Min cluster/track E
d2655d46 310 reader->SetEMCALEMin(0.3);
cd54ca47 311 reader->SetEMCALEMax(1000);
312 reader->SetPHOSEMin(0.3);
313 reader->SetPHOSEMax(1000);
050ad675 314 reader->SetCTSPtMin(0.2);
cd54ca47 315 reader->SetCTSPtMax(1000);
d2655d46 316
ec551ef4 317 // Time cuts
318 if(kSimulation)
319 {
fedea415 320 reader->SwitchOffUseTrackTimeCut();
ec551ef4 321 reader->SwitchOffUseParametrizedTimeCut();
fedea415 322 reader->SwitchOffUseEMCALTimeCut();
b583134f 323 reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
ec551ef4 324 }
325 else
326 {
327 if(kCalibT)
328 {
fedea415 329 printf("Set time cut parameters for run %d\n",kRunNumber);
330 reader->SwitchOnUseEMCALTimeCut();
ec551ef4 331 reader->SwitchOnUseParametrizedTimeCut();
fedea415 332
333 //Absolute window
b583134f 334 reader->SetEMCALTimeCut(-25,20);
fedea415 335
336 //Parametrization
ec551ef4 337 if (kRunNumber >= 151636 && kRunNumber <= 155384 )
338 {
339 printf("Set time parameters for LHC11c");
340 reader->SetEMCALParametrizedMinTimeCut(0,-5 ); reader->SetEMCALParametrizedMinTimeCut(1,-1 ); reader->SetEMCALParametrizedMinTimeCut(2, 1.87); reader->SetEMCALParametrizedMinTimeCut(3, 0.4);
341 reader->SetEMCALParametrizedMaxTimeCut(0, 3.5); reader->SetEMCALParametrizedMaxTimeCut(1, 50); reader->SetEMCALParametrizedMaxTimeCut(2, 0.15); reader->SetEMCALParametrizedMaxTimeCut(3, 1.6);
342 }
343 else if(kRunNumber >= 156447 && kRunNumber <= 159635 )
344 {
345 printf("Set time parameters for LHC11d");
346 reader->SetEMCALParametrizedMinTimeCut(0,-5); reader->SetEMCALParametrizedMinTimeCut(1,-1 ); reader->SetEMCALParametrizedMinTimeCut(2, 3.5 ); reader->SetEMCALParametrizedMinTimeCut(3, 1. );
347 reader->SetEMCALParametrizedMaxTimeCut(0, 5); reader->SetEMCALParametrizedMaxTimeCut(1, 50); reader->SetEMCALParametrizedMaxTimeCut(2, 0.45); reader->SetEMCALParametrizedMaxTimeCut(3, 1.25);
348 }
fedea415 349 else
350 {
351 reader->SwitchOffUseParametrizedTimeCut();
352 }
ec551ef4 353 }
354 else
355 {
fedea415 356 reader->SwitchOffUseParametrizedTimeCut();
357 reader->SwitchOffUseEMCALTimeCut();
b583134f 358 reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
ec551ef4 359 }
360 }
361
531f682d 362 reader->SwitchOnFiducialCut();
363 reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
364
cd54ca47 365 // Tracks
366 reader->SwitchOnCTS();
b583134f 367 reader->SwitchOffRejectNoTrackEvents();
368
369 reader->SwitchOffRecalculateVertexBC();
370 reader->SwitchOffVertexBCEventSelection();
371
372 reader->SwitchOffUseTrackTimeCut();
373 reader->SetTrackTimeCut(0,50);
374
375 reader->SwitchOffUseTrackDCACut();
376 //reader->SetTrackDCACut(0,0.0105);
377 //reader->SetTrackDCACut(1,0.035);
378 //reader->SetTrackDCACut(2,1.1);
379
531f682d 380 if(kInputDataType=="ESD")
381 {
382 gROOT->LoadMacro("$ALICE_ROOT/PWGJE/macros/CreateTrackCutsPWGJE.C");
4d1c4fdc 383 //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10041004);
384 //reader->SetTrackCuts(esdTrackCuts);
385 //reader->SwitchOnConstrainTrackToVertex();
386
387 if(kYears>2010)
388 {
389 //Hybrids 2011
390 AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
391 reader->SetTrackCuts(esdTrackCuts);
392 AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
393 reader->SetTrackComplementaryCuts(esdTrackCuts2);
394 }
395 else
396 {
397 //Hybrids 2010
398 AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001006);
399 reader->SetTrackCuts(esdTrackCuts);
400 AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10041006);
401 reader->SetTrackComplementaryCuts(esdTrackCuts2);
402 }
66e64043 403 }
531f682d 404 else if(kInputDataType=="AOD")
405 {
4d1c4fdc 406 //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid
ec551ef4 407 reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
4d1c4fdc 408 reader->SetTrackStatus(AliVTrack::kITSrefit);
fedea415 409 //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
66e64043 410 }
cd54ca47 411
412 // Calorimeter
413
193828fd 414 reader->SetEMCALClusterListName(kClusterArray);
67b98f1b 415 if(kClusterArray == "" && !kTender)
531f682d 416 {
5eef1db1 417 printf("**************** Standard EMCAL clusters branch analysis **************** \n");
cd54ca47 418 reader->SwitchOnClusterRecalculation();
5eef1db1 419 // Check in ConfigureCaloUtils that the recalibration and bad map are ON
193828fd 420 }
531f682d 421 else
422 {
193828fd 423 printf("**************** Input for analysis is Clusterizer %s **************** \n", kClusterArray.Data());
cd54ca47 424 reader->SwitchOffClusterRecalculation();
425 }
193828fd 426
b583134f 427 if(!kNonLinearity) reader->SwitchOffClusterELinearityCorrection();
428
cd54ca47 429 //if(kCalorimeter == "EMCAL") {
afabc52f 430 reader->SwitchOnEMCALCells();
69652c63 431 reader->SwitchOnEMCAL();
cd54ca47 432 //}
433 //if(kCalorimeter == "PHOS") {
afabc52f 434 reader->SwitchOnPHOSCells();
435 reader->SwitchOnPHOS();
cd54ca47 436 //}
1e3689fa 437
193828fd 438 // for case data="deltaAOD", no need to fill the EMCAL/PHOS cluster lists
740c3286 439 if(kData.Contains("delta"))
440 {
1e3689fa 441 reader->SwitchOffEMCAL();
442 reader->SwitchOffPHOS();
443 reader->SwitchOffEMCALCells();
444 reader->SwitchOffPHOSCells();
1e86c71e 445 }
1e3689fa 446
cd54ca47 447 //-----------------
448 // Event selection
449 //-----------------
450
b583134f 451 //reader->RejectFastClusterEvents() ;
452
453 // Event triggered selection settings
454 reader->SwitchOnTriggerPatchMatching();
6288bcb7 455 reader->SwitchOnBadTriggerEventsRemoval(); // only if SwitchOnTriggerPatchMatching();
456 reader->SwitchOnUnMatchedTriggerEventsRemoval(); // only if SwitchOnBadTriggerEventsRemoval();
457 //reader->SwitchOffTriggerClusterTimeRecal() ;
458
459 reader->SetTriggerPatchTimeWindow(8,9); // L0
93c2e459 460 if (kRunNumber < 146861) reader->SetEventTriggerL0Threshold(3.);
461 else if(kRunNumber < 154000) reader->SetEventTriggerL0Threshold(4.);
462 else if(kRunNumber < 165000) reader->SetEventTriggerL0Threshold(5.5);
463
b583134f 464 //redefine for other periods, triggers
465
cd54ca47 466 //if(!kUseKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
193828fd 467
029dea5a 468 // For mixing with AliAnaParticleHadronCorrelation switch it off
740c3286 469 if(kMix)
470 {
471 reader->SwitchOffEventTriggerAtSE();
ec551ef4 472 UInt_t mask = SetTriggerMaskFromName();
b583134f 473 reader->SetEventTriggerMask(mask); // Only for mixing and SwitchOffEventTriggerAtSE();
474 //reader->SetMixEventTriggerMask(AliVEvent::kMB); // Careful, not all productions work with kMB, try kINT7, kINT1, kAnyINT
475 reader->SetMixEventTriggerMask(AliVEvent::kAnyINT); // Careful, not all productions work with kMB, try kINT7, kINT1, kAnyINT
740c3286 476
477 printf("---Trigger selection done in AliCaloTrackReader!!!\n");
478 }
ec551ef4 479 else
740c3286 480 reader->SwitchOnEventTriggerAtSE();
ec551ef4 481
333b77db 482 reader->SetZvertexCut(10.); // Open cut
d2655d46 483 reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
484
531f682d 485 if(kEventSelection)
486 {
333b77db 487 reader->SwitchOnEventPileUpRejection(); // remove pileup by default
488 reader->SwitchOnV0ANDSelection() ; // and besides v0 AND
193828fd 489 }
531f682d 490 else
491 {
333b77db 492 reader->SwitchOffPileUpEventRejection();// remove pileup by default
493 reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
531f682d 494 }
cd54ca47 495
531f682d 496 if(kCollisions=="PbPb")
497 {
cd54ca47 498 // Centrality
499 reader->SetCentralityClass("V0M");
b583134f 500 reader->SetCentralityOpt(100); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
531f682d 501 reader->SetCentralityBin(kMinCen,kMaxCen); // Accept all events, if not select range
cd54ca47 502
740c3286 503 // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
504 reader->SetEventPlaneMethod("V0");
69652c63 505 }
afabc52f 506
193828fd 507 if(kPrint) reader->Print("");
508
509 return reader;
510
511}
69652c63 512
193828fd 513//_______________________________________
514AliCalorimeterUtils* ConfigureCaloUtils()
515{
516
fa991e42 517 AliCalorimeterUtils *cu = new AliCalorimeterUtils;
531f682d 518 cu->SetDebug(kDebug);
69652c63 519
193828fd 520 // Remove clusters close to borders, at least max energy cell is 1 cell away
fa991e42 521 cu->SetNumberOfCellsFromEMCALBorder(1);
1e3689fa 522 cu->SetNumberOfCellsFromPHOSBorder(2);
1e3689fa 523
531f682d 524 // Search of local maxima in cluster
525 if(kCollisions=="pp")
526 {
527 cu->SetLocalMaximaCutE(0.1);
528 cu->SetLocalMaximaCutEDiff(0.03);
b583134f 529 if(kName.Contains("150"))
530 {
531 printf("Reclusterize with 150 threshold, set PbPb settings\n");
532 cu->SetLocalMaximaCutE(0.2);
533 cu->SetLocalMaximaCutEDiff(0.03);
534 }
531f682d 535 }
536 else
537 {
538 cu->SetLocalMaximaCutE(0.2);
539 cu->SetLocalMaximaCutEDiff(0.03);
540 }
541
542 cu->SwitchOffClusterPlot();
543
544 if(kRecalTM) cu->SwitchOnRecalculateClusterTrackMatching(); // Done in clusterization
545 else cu->SwitchOffRecalculateClusterTrackMatching();
1e3689fa 546
15882d9f 547 cu->SwitchOnBadChannelsRemoval() ;
1e3689fa 548
15882d9f 549 //EMCAL settings
531f682d 550
551 if(!kSimulation)
552 cu->SwitchOnLoadOwnEMCALGeometryMatrices();
553
554 AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
555
ec551ef4 556 if(!kSimulation)
557 {
558 cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering
4d1c4fdc 559 if(kClusterArray == "" && !kTender) cu->SwitchOnRunDepCorrection();
ec551ef4 560 }
531f682d 561
562 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/ConfigureEMCALRecoUtils.C");
563 ConfigureEMCALRecoUtils(recou,
564 kSimulation,
565 kExotic,
b583134f 566 kTRUE,//kNonLinearity,
023e6936 567 kCalibE,
568 kBadMap,
b583134f 569 kCalibT);
570 //recou->SetExoticCellDiffTimeCut(50.);
571
531f682d 572
c2091d88 573 if( kNonLinearity )
574 {
575 printf("ConfigureCaloUtils() - Apply non linearity to EMCAL\n");
576 cu->SwitchOnCorrectClusterLinearity();
577 }
578
531f682d 579 printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
580 printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
581
4afd944b 582
583 if(kCalorimeter=="PHOS")
584 {
585 if (kYears < 2014) cu->SetNumberOfSuperModulesUsed(3);
586 else cu->SetNumberOfSuperModulesUsed(4);
587 }
588 else
589 {
590 if (kYears == 2010) cu->SetNumberOfSuperModulesUsed(4); //EMCAL first year
591 else if (kYears < 2014) cu->SetNumberOfSuperModulesUsed(10);
592 else cu->SetNumberOfSuperModulesUsed(20);
593 }
594
531f682d 595 // PHOS
596 cu->SwitchOffLoadOwnPHOSGeometryMatrices();
15882d9f 597
193828fd 598 if(kPrint) cu->Print("");
afabc52f 599
193828fd 600 return cu;
601
602}
603
604//_____________________________________
605AliAnaPhoton* ConfigurePhotonAnalysis()
606{
4df35693 607
531f682d 608 AliAnaPhoton *ana = new AliAnaPhoton();
609 ana->SetDebug(kDebug); //10 for lots of messages
cd54ca47 610
611 // cluster selection cuts
612
531f682d 613 ana->SwitchOffFiducialCut();
614
615 ana->SetCalorimeter(kCalorimeter);
193828fd 616
531f682d 617 if(kCalorimeter == "PHOS")
618 {
619 ana->SetNCellCut(2);// At least 3 cells
620 ana->SetMinPt(0.3);
621 ana->SetMinDistanceToBadChannel(2, 4, 5);
b583134f 622 ana->SetTimeCut(-1e10,1e10); // open cut
57eb7f00 623 }
531f682d 624 else
625 {//EMCAL
626 ana->SetNCellCut(1);// At least 2 cells
050ad675 627 ana->SetMinEnergy(0.3); // avoid mip peak at E = 260 MeV
531f682d 628 ana->SetMaxEnergy(1000);
b583134f 629 ana->SetTimeCut(-1e10,1e10); // open cut, usual time window of [425-825] ns if time recalibration is off
15882d9f 630 // restrict to less than 100 ns when time calibration is on
531f682d 631 ana->SetMinDistanceToBadChannel(2, 4, 6);
9e51e29a 632
633 // NLM cut, used in all, exclude clusters with more than 2 maxima
634 // Not needed if M02 cut is already strong or clusterizer V2
635 ana->SetNLMCut(1, 2) ;
57eb7f00 636 }
193828fd 637
531f682d 638 if(kTM)
639 {
640 ana->SwitchOnTrackMatchRejection() ;
641 ana->SwitchOffTMHistoFill() ;
642 }
643 else
644 {
645 ana->SwitchOffTrackMatchRejection() ;
646 ana->SwitchOnTMHistoFill() ;
647 }
193828fd 648
cd54ca47 649 //PID cuts (shower shape)
531f682d 650 ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
651 AliCaloPID* caloPID = ana->GetCaloPID();
c1624f38 652 //Not used in bayesian
653
654 //EMCAL
531f682d 655 caloPID->SetEMCALLambda0CutMax(0.27);
c1624f38 656 caloPID->SetEMCALLambda0CutMin(0.10);
657
658 caloPID->SetEMCALDEtaCut(0.025);
531f682d 659 caloPID->SetEMCALDPhiCut(0.030);
bef94c35 660
c1624f38 661 //PHOS
662 caloPID->SetPHOSDispersionCut(2.5);
663 caloPID->SetPHOSRCut(2.);
8bd000ef 664 if(kInputData=="AOD") caloPID->SetPHOSRCut(2000.); // Open cut since dX, dZ not stored
bef94c35 665
531f682d 666 ana->SwitchOffFillShowerShapeHistograms(); // Filled before photon shower shape selection
b583134f 667 if(!kSimulation)ana->SwitchOnFillPileUpHistograms();
668 //if(!kSimulation) ana->SwitchOnFillEMCALBCHistograms();
669
cd54ca47 670 // Input / output delta AOD settings
1e3689fa 671
531f682d 672 if(!kData.Contains("delta"))
673 {
674 ana->SetOutputAODName(Form("Photon%s",kName.Data()));
675 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
676 //ana->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done
4df35693 677 }
531f682d 678 else ana->SetInputAODName(Form("Photon%s",kName.Data()));
193828fd 679
cd54ca47 680 //Set Histograms name tag, bins and ranges
681
531f682d 682 ana->AddToHistogramsName(Form("AnaPhoton_TM%d_",kTM));
683 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
193828fd 684
cd54ca47 685 // Number of particle type MC histograms
ac0610dc 686 ana->FillNOriginHistograms(20);
687 ana->FillNPrimaryHistograms(20);
531f682d 688
6fad734c 689 ana->SwitchOnRealCaloAcceptance(); // primary particle acceptance histograms
531f682d 690 ConfigureMC(ana);
691
692 if(kPrint) ana->Print("");
7e7694bb 693
531f682d 694 return ana;
695
696}
697
6fad734c 698//________________________________________________________________
699AliAnaEMCALTriggerClusters* ConfigureEMCALTriggerClusterAnalysis()
700{
701 // For filling all histograms meaninfully, in the reader, time cut must be off
702 // and bad triggered events not rejected, and of course analyze triggered events.
703
704 AliAnaEMCALTriggerClusters *ana = new AliAnaEMCALTriggerClusters();
705 ana->SetDebug(kDebug); //10 for lots of messages
706
707 // cluster selection cuts
708
709 ana->SwitchOffFiducialCut();
710 ana->SetNCellCut(1);// At least 2 cells
711 ana->SetMinEnergy(0.3); // avoid mip peak at E = 260 MeV
712 ana->SetMaxEnergy(1000);
713 ana->SetM02(1, 2) ;
714 ana->SwitchOnTrackMatchRejection() ;
715
716 ana->AddToHistogramsName("EMCTriggerClusters_");
717 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
718
719 if(kPrint) ana->Print("");
720
721 return ana;
722
723}
724
725//___________________________________________________
726AliAnaClusterPileUp* ConfigureClusterPileUpAnalysis()
727{
728 // For filling all histograms meaninfully, in the reader, time cut must be off
729 // and bad triggered events in different BC not rejected
730
731 AliAnaClusterPileUp *ana = new AliAnaClusterPileUp();
732 ana->SetDebug(kDebug); //10 for lots of messages
733
734 // cluster selection cuts
735
736 ana->SwitchOffFiducialCut();
737 ana->SetNCellCut(1);// At least 2 cells
738 ana->SetMinEnergy(0.3); // avoid mip peak at E = 260 MeV
739 ana->SetMaxEnergy(1000);
740
741 ana->AddToHistogramsName("ClusterPileUp_");
742 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
743
744 if(kPrint) ana->Print("");
745
746 return ana;
747
748}
749
bef94c35 750//________________________________________________________________________________
751AliAnaElectron* ConfigureElectronAnalysis()
752{
753
754 AliAnaElectron *ana = new AliAnaElectron();
755 ana->SetDebug(kDebug); //10 for lots of messages
7aec8c58 756
757 ana->FillAODWithElectrons();
758 //ana->FillAODWithHadrons();
759 //ana->FillAODWithAny();
760
bef94c35 761 if(kCalorimeter == "PHOS")
762 {
763 ana->SetNCellCut(2);// At least 2 cells
764 ana->SetMinPt(0.3);
765 ana->SetMinDistanceToBadChannel(2, 4, 5);
766 }
767 else
768 {//EMCAL
769 ana->SetNCellCut(1);// At least 2 cells
770 ana->SetMinPt(0.5); // no effect minium EMCAL cut.
771 ana->SetMaxPt(100);
772 //ana->SetTimeCut(400,900);// Time window of [400-900] ns
773 ana->SetMinDistanceToBadChannel(2, 4, 6);
774 }
775
776 //Electron selection cuts with tracks
d2655d46 777 ana->SetEOverP(0.85, 1.2);
b583134f 778
bef94c35 779 // TO DO, find a more suitable way to set this
b583134f 780 if (kRunNumber < 146861) ana->SetdEdxCut(72, 90);
781 else if(kRunNumber < 154000) ana->SetdEdxCut(54, 70);
782 else ana->SetdEdxCut(74, 90);
783
784 if(kSimulation) ana->SetdEdxCut(80, 100);
bef94c35 785
786 ana->SetCalorimeter(kCalorimeter);
787
ec551ef4 788 ana->SwitchOnCaloPID();
789
790 AliCaloPID* caloPID = ana->GetCaloPID();
791
792 caloPID->SetEMCALLambda0CutMax(0.27);
793 caloPID->SetEMCALLambda0CutMin(0.10);
794
bef94c35 795 ana->SwitchOffFillShowerShapeHistograms();
796 ana->SwitchOffFillWeightHistograms() ;
797 ana->SwitchOffFiducialCut();
798
799 if(!kData.Contains("delta"))
800 {
801 ana->SetOutputAODName(Form("Electron%s",kName.Data()));
802 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
803 }
804 else ana->SetInputAODName(Form("Electron%s",kName.Data()));
805
806 //Set Histograms name tag, bins and ranges
807
808 ana->AddToHistogramsName(Form("AnaElectron_TM%d_",kTM));
809 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
810
811 ConfigureMC(ana);
812
813 if(kPrint) ana->Print("");
814
815 return ana ;
816
817}
818
531f682d 819//__________________________________________________________________________________________
bef94c35 820AliAnaRandomTrigger* ConfigureRandomTriggerAnalysis(TString detector = "")
531f682d 821{
bef94c35 822
823 AliAnaRandomTrigger *ana = new AliAnaRandomTrigger();
824 ana->SetDebug(kDebug); //10 for lots of messages
825
826 if(detector=="") detector = kCalorimeter;
515f302f 827 ana->SetTriggerDetector(detector);
bef94c35 828
829 // selection cuts
830 ana->SetMinPt(4.);
831 ana->SetMaxPt(51.);
832
833 if (detector=="EMCAL")
834 {
835 ana->SetEtaCut(-0.71,0.71);
836 ana->SetPhiCut(100*TMath::DegToRad(), 160*TMath::DegToRad());
837 }
838 else if(detector=="PHOS")
839 {
840 ana->SetEtaCut(-0.13,0.13);
841 ana->SetPhiCut(260*TMath::DegToRad(), 320*TMath::DegToRad());
842 }
843 else if(detector=="CTS")
844 {
845 ana->SetEtaCut(-0.9,0.9);
846 ana->SetPhiCut(0, TMath::TwoPi());
847 }
848
849 // AOD branch
850 if(!kData.Contains("delta"))
851 {
852 ana->SetOutputAODName(Form("RandomTrigger%s%s",detector.Data(),kName.Data()));
853 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
854 }
855 else
856 ana->SetInputAODName(Form("RandomTrigger%s%s",detector.Data(),kName.Data()));
857
858 printf("Set RandomTrigger%s%s\n",detector.Data(),kName.Data());
859
860 //Set Histograms name tag, bins and ranges
861
862 ana->AddToHistogramsName(Form("AnaRandomTrigger%s_",detector.Data()));
863
864 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
865
866 if(detector=="CTS")
867 {
868 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
869 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
870 }
871
872 if(kPrint) ana->Print("");
873
874 return ana;
875
876}
745913ae 877
bef94c35 878//__________________________________________________________________________________________
b583134f 879AliAnaInsideClusterInvariantMass* ConfigureInClusterIMAnalysis(Bool_t useSS = kTRUE, Bool_t useAsy = kFALSE)
bef94c35 880{
531f682d 881 AliAnaInsideClusterInvariantMass *ana = new AliAnaInsideClusterInvariantMass();
882 ana->SetDebug(kDebug); //10 for lots of messages
883
884 // selection cuts
193828fd 885
b583134f 886 ana->SetMinEnergy(6);
887 ana->SetMaxEnergy(200.);
888 ana->SetMinNCells(6); // check same as in calopid
889
531f682d 890 ana->SetCalorimeter(kCalorimeter);
b583134f 891 ana->SwitchOnSplitClusterDistToBad();
892
893 ana->SwitchOffFillSSWeightHistograms() ;
894 ana->SetNWeightForShowerShape(0);
895 //ana->SetWeightForShowerShape(0, 4.6);
896
897 ana->SwitchOnFillNCellHistograms();
898 ana->SwitchOffFillEbinHistograms();
899 if(!useSS && !useAsy) ana->SwitchOnFillEbinHistograms();
900
901 if(!kTM)
902 {
903 ana->SwitchOnFillTMHistograms();
904 ana->SwitchOnFillTMResidualHistograms();
905 }
906 else
907 {
908 ana->SwitchOffFillTMHistograms();
909 ana->SwitchOffFillTMResidualHistograms();
910 }
911
912 //printf("Set correction slope for SS weight \n");
913 //ana->SetWCorrectionParameter(0.07);
914 //ana->SetNECellCutForShowerShape(0);
915 //ana->SetECellCutForShowerShape(0, 0.07);
916 //ana->SetECellCutForShowerShape(1, 0.1);
917 //ana->SetECellCutForShowerShape(2, 0.2);
918
919 if(kSimulation)
920 {
921 ana->SwitchOnFillMCPrimaryHistograms() ;
922 ana->SwitchOffFillMCOverlapHistograms() ; // Off when possible
923 if(!useSS && !useAsy) ana->SwitchOnFillMCOverlapHistograms() ;
924 }
531f682d 925
531f682d 926 AliCaloPID* caloPID = ana->GetCaloPID();
927 caloPID->SetEMCALDEtaCut(0.025);
928 caloPID->SetEMCALDPhiCut(0.030);
b583134f 929 caloPID->SetClusterSplittingM02Cut(0,100000); // use parametrized cut, not fixed
930
ec551ef4 931 caloPID->SetPi0MassRange(0.11, 0.18);
d2655d46 932 caloPID->SetEtaMassRange(0.40, 0.60);
933 caloPID->SetPhotonMassRange(0.00, 0.08);
934
b583134f 935 caloPID->SetSplitWidthSigma(3.); // cut at 3 sigma of the mean pi0 peak.
936
937 caloPID->SetClusterSplittingMinNCells(6);
938
939 if(kCollisions=="PbPb" || kName.Contains("150"))
4d1c4fdc 940 {
b583134f 941 caloPID->SetClusterSplittingMinNCells(4);
942 ana->SetMinNCells(4);
943 caloPID->SetPi0MassShiftHighECell(0.005);
944 if(kCollisions=="PbPb") ana->SwitchOnFillHighMultHistograms();
945 }
946
947 ana->AddToHistogramsName("AnaInClusterIM_");
948
949 if(useAsy)
950 {
951 caloPID->SwitchOnSplitAsymmetryCut() ;
952 }
953 else
954 {
955 printf("InClusterIM: Do not apply Asy cut on merged pi0 in cluster analysis \n");
956 caloPID->SwitchOffSplitAsymmetryCut() ;
957 ana->AddToHistogramsName("AnaInClusterIM_OpenAsy_");
958 }
959
960 if(!useSS)
961 {
962 printf("InClusterIM: Do not apply SS cut on merged pi0 in cluster analysis \n");
963 caloPID->SwitchOffSplitShowerShapeCut() ;
964 ana->AddToHistogramsName("AnaInClusterIM_OpenSS_");
965 }
966 else caloPID->SwitchOnSplitShowerShapeCut() ;
967
968 if(!useAsy && !useSS)
969 {
970 printf("InClusterIM: Do not apply SS and Asy cut on merged pi0 in cluster analysis \n");
971 ana->AddToHistogramsName("AnaInClusterIM_OpenSS_OpenAsy_");
4d1c4fdc 972 }
973
b583134f 974 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
975
531f682d 976 ConfigureMC(ana);
977
978 if(kPrint) ana->Print("");
979
980 return ana;
15882d9f 981
193828fd 982}
983
cd54ca47 984//_______________________________________________
985AliAnaChargedParticles* ConfigureChargedAnalysis()
986{
987
531f682d 988 AliAnaChargedParticles *ana = new AliAnaChargedParticles();
989 ana->SetDebug(kDebug); //10 for lots of messages
cd54ca47 990
991 // selection cuts
992
050ad675 993 ana->SetMinPt(0.5);
531f682d 994 ana->SwitchOnFiducialCut();
050ad675 995 ana->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ; //more restrictive cut in reader and after in isolation
b583134f 996
997 ana->SwitchOnFillVertexBC0Histograms() ;
998 if(!kSimulation) ana->SwitchOnFillPileUpHistograms();
999
cd54ca47 1000 // Input / output delta AOD settings
1001
b583134f 1002 if(!kData.Contains("delta"))
531f682d 1003 {
1004 ana->SetOutputAODName(Form("Hadron%s",kName.Data()));
1005 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
1006 //ana->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done
cd54ca47 1007 }
b583134f 1008 else
531f682d 1009 ana->SetInputAODName(Form("Hadron%s",kName.Data()));
1010 printf("Set Hadron%s\n",kName.Data());
b583134f 1011
cd54ca47 1012 //Set Histograms name tag, bins and ranges
1013
531f682d 1014 ana->AddToHistogramsName("AnaHadrons_");
1015 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
b583134f 1016
531f682d 1017 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
1018 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
745913ae 1019
531f682d 1020 ConfigureMC(ana);
cd54ca47 1021
531f682d 1022 if(kPrint) ana->Print("");
1023
1024 return ana;
193828fd 1025
1026}
af7b3903 1027
b583134f 1028
193828fd 1029//_____________________________________________________
b583134f 1030AliAnaPi0EbE* ConfigurePi0EbEAnalysis(TString particle,
1031 Int_t analysis, Bool_t useSS = kTRUE, Bool_t useAsy = kTRUE)
193828fd 1032{
7e7694bb 1033
531f682d 1034 AliAnaPi0EbE *ana = new AliAnaPi0EbE();
1035 ana->SetDebug(kDebug);//10 for lots of messages
cd54ca47 1036
531f682d 1037 ana->SetAnalysisType(analysis);
193828fd 1038 TString opt = "";
cb062c14 1039 if(analysis == AliAnaPi0EbE::kIMCaloTracks) opt = "Conv";
1040 if(analysis == AliAnaPi0EbE::kSSCalo) opt = "SS";
193828fd 1041
cb062c14 1042 if(analysis == AliAnaPi0EbE::kIMCalo && kCalorimeter=="EMCAL" && !kSimulation) ana->SetPairTimeCut(100);
1043 if(analysis == AliAnaPi0EbE::kIMCaloTracks) ana->SetInputAODGammaConvName("PhotonsCTS");
b583134f 1044
cb062c14 1045 // Common settings for all 3 type of analysis
1046
b583134f 1047 ana->SwitchOnSelectedClusterHistoFill();
1048
531f682d 1049 ana->SetCalorimeter(kCalorimeter);
193828fd 1050
cb062c14 1051 //Set Histograms name tag, bins and ranges
1052 ana->AddToHistogramsName(Form("Ana%s%sEbE_TM%d_",particle.Data(),opt.Data(),kTM));
1053
1054 // Specific settings for different type of analysis
1055
1056 ana->SwitchOffFillWeightHistograms();
1057 if(!kSimulation) ana->SwitchOnFillPileUpHistograms();
1058
1059 if(kTM)
1060 {
1061 //printf("--->>>REMOVE MATCHED Pi0\n");
1062 ana->SwitchOnTrackMatchRejection() ;
1063 ana->SwitchOffTMHistoFill() ;
1064 }
1065 else
1066 {
1067 //printf("---->>>ACCEPT MATCHED Pi0\n");
1068 ana->SwitchOffTrackMatchRejection() ;
1069 ana->SwitchOnTMHistoFill() ;
1070 }
cd54ca47 1071
cb062c14 1072 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
1073
1074 //ana->SwitchOnFillEMCALBCHistograms();
1075
1076 if(kPrint) ana->Print("");
1077
1078 ConfigureMC(ana);
1079
b583134f 1080 if(!kInputDataType.Contains("delta"))
531f682d 1081 {
1082 ana->SetOutputAODName(Form("%s%s%s",particle.Data(), opt.Data(), kName.Data()));
1083 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
b583134f 1084
32301b07 1085 }
b583134f 1086 else
531f682d 1087 ana->SetInputAODName(Form("%s%s%s",particle.Data(),opt.Data(),kName.Data()));
193828fd 1088
531f682d 1089 if(analysis!=AliAnaPi0EbE::kSSCalo)
1090 {
cb062c14 1091 // Input / output delta AOD settings
1092
1093 ana->SetInputAODName(Form("Photon%s",kName.Data()));
1094
531f682d 1095 AliNeutralMesonSelection *nms = ana->GetNeutralMesonSelection();
193828fd 1096 nms->SetParticle(particle);
bef94c35 1097
1098 // Tighten a bit mass cut with respect to default window
1099 if(particle=="Pi0") nms->SetInvMassCutRange(0.120,0.150);
b583134f 1100 if(particle=="Eta") nms->SetInvMassCutRange(0.520,0.580);
bef94c35 1101
b583134f 1102 //if(!particle.Contains("SideBand")) nms->SwitchOnAngleSelection();
1103 //else nms->SwitchOnAngleSelection();
1104
1105 nms->SwitchOffAngleSelection();
ec551ef4 1106 if(particle.Contains("Pi0SideBand")) // For pi0, do not consider left band
1107 nms->SetSideBandCutRanges(-1,0,0.180,0.220);
b583134f 1108
193828fd 1109 nms->KeepNeutralMesonSelectionHistos(kTRUE);
1110 //nms->SetAngleMaxParam(2,0.2);
531f682d 1111 nms->SetHistoERangeAndNBins(0, 20, 80) ;
193828fd 1112 //nms->SetHistoIMRangeAndNBins(0, 1, 400);
57b97dc6 1113 }
d2655d46 1114 else
1115 { // cluster splitting settings
b583134f 1116 ana->SetMinEnergy(6);
1117 ana->SetMaxEnergy(200.);
1118
1119 ana->SetNLMMinEnergy(0, 10);
1120 ana->SetNLMMinEnergy(1, 6);
1121 ana->SetNLMMinEnergy(2, 6);
fedea415 1122
cb062c14 1123 ana->SetMinDistanceToBadChannel(2, 4, 6); // only use the first one
1124 ana->SwitchOnSplitClusterDistToBad();
1125
1126 ana->SetTimeCut(-1e10,1e10); // Open time cut
1127
fedea415 1128 // NLM cut, used in all, exclude clusters with more than 2 maxima
1129 ana->SetNLMCut(1, 2) ;
1130
d2655d46 1131 AliCaloPID* caloPID = ana->GetCaloPID();
b583134f 1132
1133 caloPID->SetSplitWidthSigma(3.); // cut at 3 sigma of the mean pi0 peak.
1134
1135 if(!useSS)
1136 {
1137 printf("Do not apply SS cut on merged pi0 analysis \n");
1138 caloPID->SwitchOffSplitShowerShapeCut() ;
1139 ana->AddToHistogramsName(Form("Ana%s%sEbE_OpenSS_TM%d_",particle.Data(),opt.Data(),kTM));
1140 ana->SetOutputAODName(Form("%s%s%s_OpenSS",particle.Data(), opt.Data(), kName.Data()));
1141 caloPID->SetClusterSplittingM02Cut(0.1,10000);
1142 }
1143 else
1144 {
1145 caloPID->SetClusterSplittingM02Cut(0.3,5); // Do the selection in the analysis class and not in the PID method to fill SS histograms
1146 caloPID->SwitchOnSplitShowerShapeCut() ;
1147 }
1148
1149 if(useAsy) caloPID->SwitchOnSplitAsymmetryCut() ;
1150 else
1151 {
1152 caloPID->SwitchOffSplitAsymmetryCut() ;
1153 if(!useSS)
1154 {
1155 ana->AddToHistogramsName(Form("Ana%s%sEbE_OpenSS_OpenAsy_TM%d_",particle.Data(),opt.Data(),kTM));
1156 ana->SetOutputAODName(Form("%s%s%s_OpenSS_OpenAsy",particle.Data(), opt.Data(), kName.Data()));
1157 }
1158 else
1159 {
1160 ana->AddToHistogramsName(Form("Ana%s%sEbE_OpenAsy_TM%d_",particle.Data(),opt.Data(),kTM));
1161 ana->SetOutputAODName(Form("%s%s%s_OpenAsy",particle.Data(), opt.Data(), kName.Data()));
1162 }
1163 }
1164
1165 //For Pi0 only if SwitchOnSimpleSplitMassCut()
d2655d46 1166 caloPID->SetPi0MassRange(0.10, 0.18);
1167 caloPID->SetEtaMassRange(0.40, 0.60);
1168 caloPID->SetPhotonMassRange(0.00, 0.08);
4d1c4fdc 1169
b583134f 1170 caloPID->SetClusterSplittingMinNCells(6);
1171
1172 //caloPID->SetSplitEnergyFractionMinimum(0, 0.95);
1173 //caloPID->SetSplitEnergyFractionMinimum(1, 0.95);
1174 //caloPID->SetSplitEnergyFractionMinimum(2, 0.8);
1175
1176 if(kCollisions=="PbPb" || kName.Contains("150"))
4d1c4fdc 1177 {
b583134f 1178 caloPID->SetClusterSplittingMinNCells(4);
1179 caloPID->SetPi0MassShiftHighECell(0.005);
4d1c4fdc 1180 }
d2655d46 1181 }
193828fd 1182
531f682d 1183 return ana;
193828fd 1184
1185}
1186
531f682d 1187//____________________________________________________________________________________________________
cd54ca47 1188AliAnaParticleIsolation* ConfigureIsolationAnalysis(TString particle="Photon",
1189 Int_t partInCone = AliIsolationCut::kOnlyCharged,
1190 Int_t thresType = AliIsolationCut::kSumPtFracIC,
740c3286 1191 Float_t cone = 0.3,
1192 Float_t pth = 0.3,
cd54ca47 1193 Bool_t multi = kFALSE)
193828fd 1194{
1195
531f682d 1196 AliAnaParticleIsolation *ana = new AliAnaParticleIsolation();
1197 //ana->SetDebug(kDebug);
1198 ana->SetDebug(kDebug);
cd54ca47 1199
531f682d 1200 ana->SwitchOnFiducialCut();
1201 //Avoid borders of EMCal
1202 if(kCalorimeter=="EMCAL")
1203 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
1204
1205 // Same Eta as EMCal, cut in phi if EMCAL was triggering
bef94c35 1206 if(particle=="Hadron" || particle.Contains("CTS"))
531f682d 1207 {
740c3286 1208 // if(kTrig.Contains("EMC"))
1209 // ana->GetFiducialCut()->SetSimpleCTSFiducialCut (0.6, 260, 360) ;
1210 // else
531f682d 1211 ana->GetFiducialCut()->SetSimpleCTSFiducialCut (0.6, 0, 360) ;
1212 }
1213
ec551ef4 1214 ana->SetMinPt(5);
cd54ca47 1215
1216 // Input / output delta AOD settings
1217
531f682d 1218 ana->SetInputAODName(Form("%s%s",particle.Data(),kName.Data()));
740c3286 1219 ana->SetAODObjArrayName(Form("IC%s_%s",particle.Data(),kName.Data()));
531f682d 1220
1221 ana->SetCalorimeter(kCalorimeter);
1222
1223 if(!kTM) ana->SwitchOnTMHistoFill();
1224 else ana->SwitchOffTMHistoFill();
193828fd 1225
531f682d 1226 ana->SwitchOffSSHistoFill();
b583134f 1227 if(!kSimulation) ana->SwitchOnFillPileUpHistograms();
ec551ef4 1228
cd54ca47 1229 //Do settings for main isolation cut class
531f682d 1230 AliIsolationCut * ic = ana->GetIsolationCut();
1231 ic->SetDebug(kDebug);
1232
740c3286 1233 if(cone >0 && pth > 0)
050ad675 1234 {
740c3286 1235 ic->SetPtThreshold(pth);
1236 ic->SetConeSize(cone);
050ad675 1237 }
740c3286 1238 else
050ad675 1239 {
740c3286 1240 if(kCollisions=="pp")
1241 {
1242 ic->SetPtThreshold(0.5);
1243 ic->SetConeSize(0.4);
1244 }
1245 if(kCollisions=="PbPb")
1246 {
ec551ef4 1247 ic->SetPtThreshold(3.);
740c3286 1248 //ic->SetPtThreshold(1.);
1249 ic->SetConeSize(0.3);
1250 }
050ad675 1251 }
531f682d 1252
2244659d 1253 ic->SetPtFraction(0.1);
1254 ic->SetSumPtThreshold(1.0) ;
cd54ca47 1255 ic->SetParticleTypeInCone(partInCone);
1256 ic->SetICMethod(thresType);
1e3689fa 1257
90eb3a19 1258 //Do or not do isolation with previously produced AODs.
1259 //No effect if use of SwitchOnSeveralIsolation()
531f682d 1260 ana->SwitchOffReIsolation();
1261
90eb3a19 1262 //Multiple IC
531f682d 1263 if(multi)
1264 {
1265 ic->SetConeSize(1.); // Take all for first iteration
1266 ic->SetPtThreshold(100);// Take all for first iteration
1267 ana->SwitchOnSeveralIsolation() ;
531f682d 1268 ana->SetAODObjArrayName(Form("MultiIC%sTM%d",particle.Data(),kTM));
ac0610dc 1269
1270 ana->SetNCones(4);
1271 ana->SetNPtThresFrac(4);
1272 ana->SetConeSizes(0,0.3); ana->SetConeSizes(1,0.4);
1273 ana->SetConeSizes(2,0.5); ana->SetConeSizes(3,0.6);
1274 ana->SetPtThresholds(0, 0.5); ana->SetPtThresholds(1, 1); ana->SetPtThresholds(2, 2);
1275 ana->SetPtFractions (0, 0.05) ; ana->SetPtFractions (1, 0.1); ana->SetPtFractions (2, 0.2) ; ana->SetPtFractions (3, 0.3) ;
1276 ana->SetSumPtThresholds(0, 1) ; ana->SetSumPtThresholds(1, 3) ; ana->SetSumPtThresholds(2, 5); ana->SetSumPtThresholds(3, 7) ;
1277
531f682d 1278 ana->SwitchOffTMHistoFill();
1279 ana->SwitchOffSSHistoFill();
1280 }
1281 else
1282 ana->SwitchOffSeveralIsolation() ;
1283
1284 AliCaloPID* caloPID = ana->GetCaloPID();
1285 caloPID->SetEMCALDEtaCut(0.025);
1286 caloPID->SetEMCALDPhiCut(0.030);
cd54ca47 1287
1288 //Set Histograms name tag, bins and ranges
1289
ac0610dc 1290 if(!multi)ana->AddToHistogramsName(Form("AnaIsol%s_TM%d_",particle.Data(),kTM));
1291 else ana->AddToHistogramsName(Form("AnaMultiIsol%s_TM%d_",particle.Data(),kTM));
1292
531f682d 1293 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
cd54ca47 1294
bef94c35 1295 if(particle=="Hadron" || particle.Contains("CTS"))
531f682d 1296 {
1297 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
1298 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
1299 }
193828fd 1300
6fad734c 1301 ana->SwitchOnRealCaloAcceptance(); // primary particle acceptance histograms
531f682d 1302 ConfigureMC(ana);
745913ae 1303
531f682d 1304 if(kPrint) ic ->Print("");
1305 if(kPrint) ana->Print("");
1306
1307 return ana;
193828fd 1308
1309}
1310
1311//___________________________________________________________________________________
1312AliAnaParticleHadronCorrelation* ConfigureHadronCorrelationAnalysis(TString particle,
fedea415 1313 Bool_t bIsolated,
740c3286 1314 Int_t partInCone = AliIsolationCut::kOnlyCharged,
1315 Int_t thresType = AliIsolationCut::kSumPtFracIC,
1316 Float_t cone = 0.3,
1317 Float_t pth = 0.3)
193828fd 1318{
90eb3a19 1319
531f682d 1320 AliAnaParticleHadronCorrelation *ana = new AliAnaParticleHadronCorrelation();
1321 ana->SetDebug(kDebug);
1322
6c9e3fb5 1323 ana->SwitchOnAbsoluteLeading(); // Select trigger leading particle of all the selected tracks
1324 ana->SwitchOffNearSideLeading(); // Select trigger leading particle of all the particles at +-90 degrees, default
1325
1326 //ana->SwitchOnLeadHadronSelection();
1327 //ana->SetLeadHadronPhiCut(TMath::DegToRad()*100., TMath::DegToRad()*260.);
1328 //ana->SetLeadHadronPtCut(0.5, 100);
1329
1f8591af 1330 ana->SetTriggerPtRange(5,100);
1331 ana->SetAssociatedPtRange(0.2,100);
6f84cc7b 1332 //ana->SetDeltaPhiCutRange( TMath::Pi()/2,3*TMath::Pi()/2 ); //[90 deg, 270 deg]
1333 ana->SetDeltaPhiCutRange (TMath::DegToRad()*120.,TMath::DegToRad()*240.);
1334 ana->SetUeDeltaPhiCutRange(TMath::DegToRad()*60. ,TMath::DegToRad()*120.);
6c9e3fb5 1335 ana->SwitchOnFillEtaGapHistograms();
1336
740c3286 1337 ana->SetNAssocPtBins(9);
740c3286 1338 ana->SetAssocPtBinLimit(0, 0.2) ;
1339 ana->SetAssocPtBinLimit(1, 0.5) ;
1340 ana->SetAssocPtBinLimit(2, 1) ;
1341 ana->SetAssocPtBinLimit(3, 2) ;
1342 ana->SetAssocPtBinLimit(4, 3) ;
1343 ana->SetAssocPtBinLimit(5, 4) ;
1344 ana->SetAssocPtBinLimit(6, 6) ;
1345 ana->SetAssocPtBinLimit(7, 10) ;
1346 ana->SetAssocPtBinLimit(8, 30) ;
1347 ana->SetAssocPtBinLimit(9, 200) ;
6c9e3fb5 1348 //ana->SwitchOnFillPtImbalancePerPtABinHistograms();
1349
907b38cd 1350 ana->SelectIsolated(bIsolated); // do correlation with isolated photons
1351
740c3286 1352 if(bIsolated)
1353 {
1354 //Do settings for main isolation cut class
1355 AliIsolationCut * ic = ana->GetIsolationCut();
1356 ic->SetDebug(kDebug);
1357
1358 if(cone >0 && pth > 0)
1359 {
1360 ic->SetPtThreshold(pth);
1361 ic->SetConeSize(cone);
1362 }
1363 else
1364 {
1365 if(kCollisions=="pp")
1366 {
1367 ic->SetPtThreshold(0.5);
1368 ic->SetConeSize(0.4);
1369 }
1370 if(kCollisions=="PbPb")
1371 {
ec551ef4 1372 ic->SetPtThreshold(3.);
740c3286 1373 //ic->SetPtThreshold(1.);
1374 ic->SetConeSize(0.3);
1375 }
1376 }
1377
1378 ic->SetPtFraction(0.1);
1379 ic->SetSumPtThreshold(1.0) ;
1380 ic->SetParticleTypeInCone(partInCone);
1381 ic->SetICMethod(thresType);
1382
1383 }
1384
029dea5a 1385 // Mixing with own pool
fedea415 1386 if(kMix)
1387 {
1388 ana->SwitchOnOwnMix();
1389 ana->SwitchOnFillNeutralInMixedEvent();
1390 }
1391 else
1392 ana->SwitchOffOwnMix();
740c3286 1393
ec551ef4 1394 ana->SetNZvertBin(20);
6c9e3fb5 1395 ana->SwitchOffCorrelationVzBin() ;
6f84cc7b 1396 ana->SwitchOffFillHighMultiplicityHistograms();
1397
029dea5a 1398 if(kCollisions=="pp")
1399 {
ec551ef4 1400 ana->SetNMaxEvMix(100);
029dea5a 1401 ana->SwitchOnTrackMultBins();
6f84cc7b 1402 ana->SetNTrackMultBin(10); // same as SetNCentrBin(10);
740c3286 1403 ana->SetNRPBin(1);
029dea5a 1404 }
1405 else
1406 {
6f84cc7b 1407 ana->SetNMaxEvMix(10);
740c3286 1408 ana->SwitchOffTrackMultBins(); // centrality bins
1409 ana->SetNCentrBin(3);
1410 ana->SetNRPBin(3);
ec551ef4 1411 if(kName.Contains("60_90"))
1412 {
1413 printf("*** Set mixing for peripheral\n");
1414 ana->SetNMaxEvMix(50);
1415 ana->SetNCentrBin(2);
1416 }
050ad675 1417 }
1418
1419 ana->SwitchOnFiducialCut();
1420
531f682d 1421 //Avoid borders of EMCal, same as for isolation
1422 if(kCalorimeter=="EMCAL")
1423 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
1424
1425 // Same Eta as EMCal, cut in phi if EMCAL was triggering
bef94c35 1426 if(particle=="Hadron" || particle.Contains("CTS"))
531f682d 1427 {
740c3286 1428 //if(kTrig.Contains("EMC"))
1429 // ana->GetFiducialCut()->SetSimpleCTSFiducialCut (0.6, 260, 360) ;
1430 //else
531f682d 1431 ana->GetFiducialCut()->SetSimpleCTSFiducialCut (0.6, 0, 360) ;
1432 }
cd54ca47 1433
1434 // Input / output delta AOD settings
1435
531f682d 1436 ana->SetInputAODName(Form("%s%s",particle.Data(),kName.Data()));
740c3286 1437 ana->SetAODObjArrayName(Form("%sHadronCorrIso%d_%s",particle.Data(),bIsolated,kName.Data()));
193828fd 1438
907b38cd 1439 // Fill extra plots on tagged decay photons
1440 // If trigger is pi0/eta found with invariant mass, get the decays
1441 // If trigger is photon, check if it was tagged as decay previously
050ad675 1442 if(particle!="Hadron" )
907b38cd 1443 {
fedea415 1444 if(particle.Contains("Pi0") || particle.Contains("Eta"))
050ad675 1445 {
ec551ef4 1446 ana->SwitchOffPi0TriggerDecayCorr();
050ad675 1447 ana->SwitchOffDecayTriggerDecayCorr();
1448 }
1449 else
1450 {
1451 ana->SwitchOffPi0TriggerDecayCorr();
1452 ana->SwitchOnDecayTriggerDecayCorr(); // Make sure pi0 decay tagging runs before this task
1453 }
907b38cd 1454 }
1455 else
1456 {
1457 ana->SwitchOffPi0TriggerDecayCorr();
050ad675 1458 ana->SwitchOffDecayTriggerDecayCorr();
907b38cd 1459 }
193828fd 1460
740c3286 1461 if(particle=="Photon")
1462 {
1463 printf("**** SET M02 limits *** \n");
ec551ef4 1464 ana->SetM02Cut(0.1,0.27);
740c3286 1465 }
1466
907b38cd 1467 // if triggering on PHOS and EMCAL is on
1468 //if(kCalorimeter=="PHOS") ana->SwitchOnNeutralCorr();
1469 ana->SwitchOffNeutralCorr(); // Do only correlation with TPC
1470
1471 ana->SwitchOffHMPIDCorrelation();
cd54ca47 1472
907b38cd 1473 ana->SwitchOffFillBradHistograms();
023e6936 1474
907b38cd 1475 // Underlying event
531f682d 1476 ana->SwitchOnSeveralUECalculation();
1477 ana->SetUeDeltaPhiCutRange(TMath::Pi()/3, 2*TMath::Pi()/3);
cd54ca47 1478
1479 //Set Histograms name tag, bins and ranges
1480
531f682d 1481 ana->AddToHistogramsName(Form("Ana%sHadronCorr_Iso%d_TM%d_",particle.Data(),bIsolated,kTM));
1482 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
1483
bef94c35 1484 if(particle=="Hadron" || particle.Contains("CTS"))
531f682d 1485 {
1486 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
1487 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
1488 }
745913ae 1489
531f682d 1490 ConfigureMC(ana);
cd54ca47 1491
531f682d 1492 if(kPrint) ana->Print("");
1e3689fa 1493
531f682d 1494 return ana;
1e3689fa 1495
193828fd 1496}
69652c63 1497
193828fd 1498//________________________________________
1499AliAnaCalorimeterQA* ConfigureQAAnalysis()
1500{
90eb3a19 1501
531f682d 1502 AliAnaCalorimeterQA *ana = new AliAnaCalorimeterQA();
1503 ana->SetDebug(kDebug); //10 for lots of messages
1504 ana->SetCalorimeter(kCalorimeter);
a3aebfff 1505
b583134f 1506 ana->SetTimeCut(-1e10,1e10); // Open time cut
5eef1db1 1507
66e64043 1508 // Study inter detector correlation (PHOS, EMCAL, Tracks, V0)
d2655d46 1509 if(kCalorimeter=="PHOS" && kTrig=="PHOS")
531f682d 1510 ana->SwitchOnCorrelation(); // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON
d2655d46 1511 if(kCalorimeter=="EMCAL" && kClusterArray=="")
531f682d 1512 ana->SwitchOnCorrelation(); // make sure you switch in the reader PHOS and EMCAL cells and clusters if option is ON
d2655d46 1513 else
531f682d 1514 ana->SwitchOffCorrelation();
66e64043 1515
1516 // Study exotic clusters PHOS and EMCAL
d2655d46 1517 if(kClusterArray=="") ana->SwitchOnStudyBadClusters() ;
1518 else ana->SwitchOffStudyBadClusters() ;
1519
8f880b6e 1520
531f682d 1521 ana->SwitchOffFiducialCut();
1522 ana->SwitchOffFillAllTH3Histogram();
1523 ana->SwitchOffFillAllPositionHistogram();
1524 ana->SwitchOffFillAllPositionHistogram2();
1525 if(!kExotic)ana->SwitchOnStudyBadClusters();
1526 else ana->SwitchOffStudyBadClusters();
1527 ana->SwitchOffStudyClustersAsymmetry();
1528 ana->SwitchOffStudyWeight();
1529 ana->SwitchOnFillAllTrackMatchingHistogram();
fedea415 1530 ana->SwitchOnFillAllCellTimeHisto() ;
8f880b6e 1531
531f682d 1532 ana->AddToHistogramsName("QA_"); //Begining of histograms name
1533 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
745913ae 1534
531f682d 1535 ConfigureMC(ana);
cd54ca47 1536
531f682d 1537 if(kPrint) ana->Print("");
193828fd 1538
531f682d 1539 return ana;
69652c63 1540
90eb3a19 1541}
193828fd 1542
a4438a9c 1543//________________________________________________________________
1544AliAnaGeneratorKine* ConfigureGenKineAnalysis()
1545{
1546 // Analysis for parton, jets correlation with photon and pi0
1547
1548 AliAnaGeneratorKine *ana = new AliAnaGeneratorKine();
1549 ana->SetDebug(kDebug); //10 for lots of messages
1550
2b341b44 1551 // Trigger detector, acceptance and pT cut
1552 ana->SetTriggerDetector("EMCAL");
a4438a9c 1553 ana->SetMinPt(10); // Trigger photon, pi0 minimum pT
2b341b44 1554 ana->GetFiducialCutForTrigger()->SetSimpleEMCALFiducialCut(0.6, 85, 175);
a4438a9c 1555
2b341b44 1556 // Particles associated to trigger or isolation cone acceptance and pT cut
a4438a9c 1557 ana->SetCalorimeter("EMCAL");
2b341b44 1558 ana->SetMinChargedPt(0.2);
1559 ana->SetMinNeutralPt(0.3);
a4438a9c 1560 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.65, 81, 179);
1561 ana->GetFiducialCut()->SetSimpleCTSFiducialCut(0.9, 0, 360);
1562
2b341b44 1563 // Isolation paramters
a4438a9c 1564 AliIsolationCut * ic = ana->GetIsolationCut();
1565 ic->SetDebug(kDebug);
1566 ic->SetPtThreshold(0.5);
1567 ic->SetConeSize(0.5);
1568 ic->SetSumPtThreshold(1.0) ;
1569 ic->SetICMethod(AliIsolationCut::kPtThresIC); // kSumPtIC
1570
1571 ana->AddToHistogramsName("AnaGenKine_");
1572 SetHistoRangeAndNBins(ana->GetHistogramRanges()); // see method below
1573
1574 if(kPrint) ana->Print("");
1575
1576 return ana;
1577
1578}
1579
cd54ca47 1580//________________________________________________________
531f682d 1581void ConfigureMC(AliAnaCaloTrackCorrBaseClass* ana)
1582{
1583 if(kSimulation) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
1584 else ana->SwitchOffDataMC() ;
1585
1586 //Set here generator name, default pythia
1587 //ana->GetMCAnalysisUtils()->SetMCGenerator("");
1588}
1589
1590//________________________________________________________
1591void SetHistoRangeAndNBins (AliHistogramRanges* histoRanges)
cd54ca47 1592{
1593 // Set common bins for all analysis and MC histograms filling
745913ae 1594
531f682d 1595 histoRanges->SetHistoPtRangeAndNBins(0, 100, 200) ; // Energy and pt histograms
cd54ca47 1596
531f682d 1597 if(kCalorimeter=="EMCAL")
1598 {
1599 if(kYears==2010)
1600 {
1601 histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 122*TMath::DegToRad(), 78) ;
1602 histoRanges->SetHistoXRangeAndNBins(-230,90,120); // QA
1603 histoRanges->SetHistoYRangeAndNBins(370,450,40); // QA
cd54ca47 1604 }
531f682d 1605 else if(kYears==2011)
1606 {
1607 histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
1608 histoRanges->SetHistoXRangeAndNBins(-600,90,200); // QA
1609 histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
cd54ca47 1610 }
531f682d 1611 else
1612 {
1613 histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 190*TMath::DegToRad(), 122) ;
1614 histoRanges->SetHistoXRangeAndNBins(-100,90,200); // QA
1615 histoRanges->SetHistoYRangeAndNBins(50,450,100); // QA
1616 }
1617
1618 histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
cd54ca47 1619 }
531f682d 1620 else
1621 {
1622 histoRanges->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ;
1623 histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
745913ae 1624 }
1625
bef94c35 1626 histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
cd54ca47 1627
531f682d 1628 // Invariant mass histoRangeslysis
1629 histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
1630 histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
cd54ca47 1631
1632 // check if time calibration is on
531f682d 1633 histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
1634 histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
cd54ca47 1635
09273901 1636 // track-cluster residuals
531f682d 1637 histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
1638 histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
6962f0e8 1639 histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
531f682d 1640
cd54ca47 1641 // QA, electron, charged
2964508d 1642 histoRanges->SetHistoPOverERangeAndNBins(0,2.,200);
1643 histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200);
cd54ca47 1644
1645 // QA
531f682d 1646 histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
531f682d 1647 histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
531f682d 1648 histoRanges->SetHistoZRangeAndNBins(-400,400,200);
1649 histoRanges->SetHistoRRangeAndNBins(400,450,25);
1650 histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
1651 histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
2964508d 1652
1653 // QA, correlation
1654 if(kCollisions=="PbPb")
1655 {
1656 histoRanges->SetHistoNClusterCellRangeAndNBins(0,100,100);
1657 histoRanges->SetHistoNClustersRangeAndNBins(0,500,50);
1658 histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,2000,200);
1659 }
1660 else
1661 {
1662 histoRanges->SetHistoNClusterCellRangeAndNBins(0,50,50);
1663 histoRanges->SetHistoNClustersRangeAndNBins(0,50,50);
1664 histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,200,200);
1665 }
1666
1667 // xE, zT
1668 histoRanges->SetHistoRatioRangeAndNBins(0.,2.,200);
1669 histoRanges->SetHistoHBPRangeAndNBins (0.,10.,200);
cd54ca47 1670
98287a43 1671 // Isolation
1672 histoRanges->SetHistoPtInConeRangeAndNBins(0, 50 , 250);
1673 histoRanges->SetHistoPtSumRangeAndNBins (0, 100, 250);
1674
cd54ca47 1675}
193828fd 1676
fedea415 1677//_____________________________
1678UInt_t SetTriggerMaskFromName()
740c3286 1679{
1680 if(kTrig=="EMC7")
1681 {
1682 printf("CaloTrackCorr trigger EMC7\n");
1683 return AliVEvent::kEMC7;
1684 }
1685 else if (kTrig=="INT7")
1686 {
1687 printf("CaloTrackCorr trigger INT7\n");
1688 return AliVEvent::kINT7;
1689 }
1690 else if(kTrig=="EMC1")
1691 {
1692 printf("CaloTrackCorr trigger EMC1\n");
1693 return AliVEvent::kEMC1;
1694 }
1695 else if(kTrig=="MB")
1696 {
1697 printf("CaloTrackCorr trigger MB\n");
1698 return AliVEvent::kMB;
1699 }
1700 else if(kTrig=="PHOS")
1701 {
1702 printf("CaloTrackCorr trigger PHOS\n");
1703 return AliVEvent::kPHI7;
1704 }
1705 else if(kTrig=="PHOSPb")
1706 {
1707 printf("CaloTrackCorr trigger PHOSPb\n");
1708 return AliVEvent::kPHOSPb;
1709 }
1710 else if(kTrig=="AnyINT")
1711 {
1712 printf("CaloTrackCorr trigger AnyINT\n");
1713 return AliVEvent::kAnyINT;
1714 }
1715 else if(kTrig=="INT")
1716 {
1717 printf("CaloTrackCorr trigger AnyINT\n");
1718 return AliVEvent::kAny;
1719 }
1720 else if(kTrig=="EMCEGA")
1721 {
1722 printf("CaloTrackCorr trigger EMC Gamma\n");
1723 return AliVEvent::kEMCEGA;
1724 }
1725 else if(kTrig=="EMCEJE")
1726 {
1727 printf("CaloTrackCorr trigger EMC Jet\n");
1728 return AliVEvent::kEMCEJE;
1729 }
1730 else if(kTrig=="Central")
1731 {
1732 printf("CaloTrackCorr trigger Central\n");
b583134f 1733 return (AliVEvent::kCentral | AliVEvent::kMB);
4d1c4fdc 1734 }
1735 else if(kTrig=="CentralEGA")
1736 {
1737 printf("CaloTrackCorr trigger Central+EMCEGA\n");
1738 return (AliVEvent::kCentral | AliVEvent::kEMCEGA);
1739 }
740c3286 1740 else if(kTrig=="SemiCentral")
1741 {
1742 printf("CaloTrackCorr trigger SemiCentral\n");
b583134f 1743 return (AliVEvent::kSemiCentral | AliVEvent::kMB);
740c3286 1744 }
1745 else if(kTrig=="SemiOrCentral")
1746 {
1747 printf("CaloTrackCorr trigger SemiCentral Or Central\n");
b583134f 1748 return (AliVEvent::kSemiCentral | AliVEvent::kCentral | AliVEvent::kMB);
1749 }
740c3286 1750}
1751