1 // Configuration macro for analysis of photon-jet analysis
3 // based on AddTaskIsoPhoton by Gustavo Conesa & Marie Germain.
6 TString kGammaJetCorrelationName = "";
8 AliAnalysisTaskCaloTrackCorrelation *AddTaskGammaJetCorrelation(const Float_t isoCone = 0.4,
9 const Float_t isoPth = 0.5,
10 const Double_t maxLambda0Cut = 0.5,
11 const Int_t maxNLMcut = 2,
12 const Bool_t timecut = kFALSE,
13 const TString calorimeter = "EMCAL",
14 const Bool_t simulation = kFALSE,
15 const Bool_t eventsel = kFALSE,
16 const Bool_t exotic = kTRUE,
17 const Bool_t nonlin = kFALSE,
18 const TString collision = "pp",
19 const TString trigger = "MB",
20 const TString firedTrigger = "EG1",
21 const TString clustersArray = "V1",
22 const Bool_t mix = kTRUE,
23 const Bool_t tm = kTRUE,
24 const Int_t minCen = -1,
25 const Int_t maxCen = -1,
26 const TString jetBranchName = "clustersAOD_ANTIKT04_B0_Filter00272_Cut00150_Skip00",
27 const TString jetBkgBranchName = "jeteventbackground_clustersAOD_KT04_B0_Filter00768_Cut00150_Skip00",
28 const Float_t jetMinPt = 0,
29 const Float_t minDeltaPhi = 1.5,
30 const Float_t maxDeltaPhi = 4.5,
31 const Float_t minPtRatio = 0,
32 const Float_t maxPtRatio = 5,
33 const Int_t debug = -1,
34 const Bool_t printSettings = kFALSE,
35 const Double_t scaleFactor = -1
38 // Creates a CaloTrackCorr task, configures it and adds it to the analysis manager.
40 // Get the pointer to the existing analysis manager via the static access method.
42 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
45 ::Error("AddTask", "No analysis manager to connect to.");
49 // Check the analysis type using the event handlers connected to the analysis manager.
51 if (!mgr->GetInputEventHandler())
53 ::Error("AddTask", "This task requires an input event handler");
57 // Make sure the B field is enabled for track selection, some cuts need it
58 ((AliInputEventHandler*)mgr->GetInputEventHandler())->SetNeedField(kTRUE);
60 // inputDataType = "AOD";
61 // if(!kData.Contains("delta"))
62 // inputDataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
65 TString deltaAODJetName = "AliAOD.Jets.root"; //Jet input AOD name
66 if(deltaAODJetName.Length()!=0)
68 // External file with Jets
69 // aodHandler->AddFriend(deltaAODJetName.Data());
70 mgr->RegisterExtraFile(deltaAODJetName.Data());
71 cout<<"Jet file registered "<<endl;
72 cout<<"Extra files: "<<mgr->GetExtraFiles()<<endl;
77 Bool_t useKinematics = kFALSE;
78 useKinematics = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE;
80 // Name for containers
82 //kGammaJetCorrelationName = Form("%s_Trig%s_Cl%s_TM%d_R%1.1f_Pt%1.1f",calorimeter.Data(), trigger.Data(),clustersArray.Data(),tm,cone,pth);
83 // kGammaJetCorrelationName = Form("%s_Trig%s_Cl%s_TM%d",calorimeter.Data(), trigger.Data(),clustersArray.Data(),tm);
84 kGammaJetCorrelationName = Form("%s_Trig%s_Fired%s_Cl%s_TM%d_l02%1.2f",calorimeter.Data(), trigger.Data(),firedTrigger.Data(),clustersArray.Data(),tm,maxLambda0Cut);//<<<---changed here
87 if(collision=="PbPb" && maxCen>=0) kGammaJetCorrelationName+=Form("Cen%d_%d",minCen,maxCen);
89 printf("<<<< NAME: %s >>>>>\n",kGammaJetCorrelationName.Data());
91 // #### Configure analysis ####
93 AliAnaCaloTrackCorrMaker * maker = new AliAnaCaloTrackCorrMaker();
94 printf("SCALE FACTOR %e\n",scaleFactor);
95 maker->SetScaleFactor(scaleFactor); // for MC, negative (not scaled) by default
97 // General frame setting and configuration
98 maker->SetReader (ConfigureReader(mgr->GetInputEventHandler()->GetDataType(),calorimeter,useKinematics,simulation,eventsel,nonlin,timecut,collision,trigger,firedTrigger,clustersArray,jetBranchName,jetBkgBranchName,mix,minCen,maxCen,debug,printSettings) );
99 maker->SetCaloUtils(ConfigureCaloUtils(clustersArray,collision,nonlin,exotic,simulation,timecut,debug,printSettings));
101 // Analysis tasks setting and configuration
102 Int_t n = 0;//Analysis number, order is important
104 // Isolation settings
105 Int_t partInCone = AliIsolationCut::kNeutralAndCharged; // kOnlyCharged;
106 Int_t thresType = AliIsolationCut::kPtThresIC;// AliIsolationCut::kSumPtFracIC ;
107 //Float_t isoCone = -1;
108 //Float_t isoPth = -1;
110 maker->AddAnalysis(ConfigurePhotonAnalysis(calorimeter,tm,simulation,maxLambda0Cut,maxNLMcut,debug,printSettings), n++); // Photon cluster selection
111 maker->AddAnalysis(ConfigureIsolationAnalysis(calorimeter,collision,"Photon", partInCone,thresType, isoCone, isoPth,tm,kFALSE,simulation,debug,printSettings), n++); // Photon isolation
112 maker->AddAnalysis(ConfigurePhotonJetAnalysis(calorimeter,isoCone,jetMinPt,minDeltaPhi,maxDeltaPhi,minPtRatio,maxPtRatio,simulation,debug,printSettings), n++);// photon-jet correlation analysis
114 maker->SetAnaDebug(debug) ;
115 maker->SwitchOnHistogramsMaker() ;
116 //if(kData.Contains("delta")) maker->SwitchOffAODsMaker() ;
117 //else maker->SwitchOnAODsMaker() ;
119 if(printSettings) maker->Print("");
121 printf("<< End Configuration of %d analysis for calorimeter %s >>\n",n, calorimeter.Data());
124 AliAnalysisTaskCaloTrackCorrelation * task = new AliAnalysisTaskCaloTrackCorrelation (Form("CaloTrackCorr%s",kGammaJetCorrelationName.Data()));
125 task->SetConfigFileName(""); //Don't configure the analysis via configuration file.
126 task->SetDebugLevel(debug);
127 task->SetBranches("ESD:AliESDRun.,AliESDHeader");
128 task->SetAnalysisMaker(maker);
133 //if(outputfile.Length()==0) outputfile = AliAnalysisManager::GetCommonFileName();
134 TString outputfile = AliAnalysisManager::GetCommonFileName();
136 AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(kGammaJetCorrelationName, TList::Class(),
137 AliAnalysisManager::kOutputContainer,
138 Form("%s",outputfile.Data()));
140 AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("Param_%s",kGammaJetCorrelationName.Data()), TList::Class(),
141 AliAnalysisManager::kParamContainer,
142 "AnalysisParameters.root");
144 // Create ONLY the output containers for the data produced by the task.
145 // Get and connect other common input/output containers via the manager as below
146 //==============================================================================
147 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
148 // AOD output slot will be used in a different way in future
149 //if(!kData.Contains("delta") && outputAOD) mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer());
150 mgr->ConnectOutput (task, 1, cout_pc);
151 mgr->ConnectOutput (task, 2, cout_cuts);
155 UInt_t mask = SetTriggerMaskFromName(trigger);
156 task->SelectCollisionCandidates(mask);
162 //____________________________________
163 AliCaloTrackReader * ConfigureReader(TString inputDataType = "AOD",TString calorimeter = "EMCAL",Bool_t useKinematics = kFALSE,
164 Bool_t simulation = kFALSE,Bool_t eventsel = kFALSE,Bool_t nonlin = kTRUE, Bool_t timecut = kFALSE,
165 TString collision = "pp",TString trigger="MB",TString firedTrigger="EG1",
166 TString clustersArray = "V1", TString jetBranchName = "jets", TString jetBkgBranchName = "jets",
168 Float_t minCen = -1, Float_t maxCen = -1,
169 Int_t debug = -1,Bool_t printSettings = kFALSE)
172 Bool_t useTender=kTRUE;
176 if (!useKinematics && inputDataType=="AOD") useKinematics = kTRUE; //AOD primary should be available ...
179 cout<<"********* ACCESS KINE? "<<useKinematics<< endl;
183 AliCaloTrackReader * reader = 0;
184 if (inputDataType == "AOD") reader = new AliCaloTrackAODReader();
185 else if(inputDataType == "ESD") reader = new AliCaloTrackESDReader();
186 else printf("AliCaloTrackReader::ConfigureReader() - Data not known InputData=%s\n",inputDataType.Data());
188 reader->SetDebug(debug);//10 for lots of messages
191 reader->SwitchOffTriggerPatchMatching();
192 reader->SwitchOffBadTriggerEventsRemoval();
197 // Event rejection cuts for jet-jet simulations, do not use in other
198 reader->SetPtHardAndJetPtComparison(kTRUE);
199 reader->SetPtHardAndJetPtFactor(4);
201 reader->SetPtHardAndClusterPtComparison(kTRUE);
202 reader->SetPtHardAndClusterPtFactor(1.5);
206 //reader->SetDeltaAODFileName("");
207 //if(kOutputAOD) reader->SwitchOnWriteDeltaAOD() ;
211 if(inputDataType == "ESD"){
212 reader->SwitchOnStack();
213 reader->SwitchOffAODMCParticles();
215 else if(inputDataType == "AOD"){
216 reader->SwitchOffStack();
217 reader->SwitchOnAODMCParticles();
221 //------------------------
222 // Detector input filling
223 //------------------------
225 //Min cluster/track E
226 reader->SetEMCALEMin(0.3);
227 //reader->SetEMCALEMin(0.);// <<<----changed here
228 reader->SetEMCALEMax(1000);
229 reader->SetPHOSEMin(0.3);
230 reader->SetPHOSEMax(1000);
231 // reader->SetCTSPtMin(0.2);
232 reader->SetCTSPtMin(0.15);// <<<----changed here
233 reader->SetCTSPtMax(1000);
235 //-----------------------------------------------------------------
237 //-----------------------------------------------------------------
238 reader->SwitchOnNonStandardJets();
239 //reader->SetInputNonStandardJetBranchName("clustersAOD_ANTIKT04_B0_Filter00768_Cut00150_Skip00");
240 //reader->SetInputNonStandardJetBranchName("clustersAOD_ANTIKT04_B1_Filter00768_Cut00150_Skip00");//in PbPb
241 //reader->SetInputNonStandardJetBranchName("clustersAOD_ANTIKT04_B0_Filter00272_Cut00150_Skip00");//in pp 2.76 LHC11a,7 LHC11c
242 //reader->SetInputNonStandardJetBranchName("clustersAOD_ANTIKT04_B0_Filter00768_Cut00150_Skip02");//in pp 7 LHC13e4 MC
243 //reader->SetInputNonStandardJetBranchName("clustersAOD_ANTIKT04_B0_Filter00272_Cut00150_Skip00");//in pp 7 LHC12a15f MC
244 reader->SetInputNonStandardJetBranchName(jetBranchName.Data());
245 if(jetBkgBranchName.Length()!=0) {
246 reader->SwitchOnBackgroundJets();
247 reader->SetInputBackgroundJetBranchName(jetBkgBranchName.Data());
249 reader->SwitchOffBackgroundJets();
251 //reader->SetInputBackgroundJetBranchName("jeteventbackground_clustersAOD_KT04_B0_Filter00768_Cut00150_Skip00");//in pp 7 LHC13e4 MC
257 reader->SwitchOffUseTrackTimeCut();
258 reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
259 reader->SwitchOffUseEMCALTimeCut() ;
260 reader->SwitchOffUseParametrizedTimeCut();
264 reader->SwitchOffUseParametrizedTimeCut();
267 printf("Set time cut \n");
268 reader->SwitchOnUseEMCALTimeCut();
270 reader->SetEMCALTimeCut(-30.,30.); // default is -25ns-20ns
274 printf("Off time cuts time cut \n");
275 reader->SwitchOffUseEMCALTimeCut();
277 reader->SetEMCALTimeCut(-1.e6,1.e6);
282 //printf("Set time cut parameters for run %d\n",kRunNumber);
283 //reader->SetEMCALTimeCut(-20,20);
284 //reader->SwitchOnUseParametrizedTimeCut();
285 //if (kRunNumber >= 151636 && kRunNumber <= 155384 )
287 // printf("Set time parameters for LHC11c\n");
288 // reader->SetEMCALParametrizedMinTimeCut(0,-5 ); reader->SetEMCALParametrizedMinTimeCut(1,-1 ); reader->SetEMCALParametrizedMinTimeCut(2, 1.87); reader->SetEMCALParametrizedMinTimeCut(3, 0.4);
289 // reader->SetEMCALParametrizedMaxTimeCut(0, 3.5); reader->SetEMCALParametrizedMaxTimeCut(1, 50); reader->SetEMCALParametrizedMaxTimeCut(2, 0.15); reader->SetEMCALParametrizedMaxTimeCut(3, 1.6);
291 //else if(kRunNumber >= 156447 && kRunNumber <= 159635 )
293 // printf("Set time parameters for LHC11d\n");
294 // reader->SetEMCALParametrizedMinTimeCut(0,-5); reader->SetEMCALParametrizedMinTimeCut(1,-1 ); reader->SetEMCALParametrizedMinTimeCut(2, 3.5 ); reader->SetEMCALParametrizedMinTimeCut(3, 1. );
295 // reader->SetEMCALParametrizedMaxTimeCut(0, 5); reader->SetEMCALParametrizedMaxTimeCut(1, 50); reader->SetEMCALParametrizedMaxTimeCut(2, 0.45); reader->SetEMCALParametrizedMaxTimeCut(3, 1.25);
299 // printf("*** Fixed time cut 20 ns *** \n");
300 // reader->SetEMCALTimeCut(-20,20);
306 // reader->SwitchOffUseEMCALTimeCut();
307 // reader->SetEMCALTimeCut(-1e10,1e10); // Open time cut
308 // reader->SwitchOffUseParametrizedTimeCut();
313 reader->SwitchOnFiducialCut();
314 //reader->SwitchOffFiducialCut();// <<<----changed here
315 //reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.8, 0, 360) ;
316 reader->GetFiducialCut()->SetSimpleCTSFiducialCut(0.9, 0, 360) ;// <<<--- changed here
320 // reader->SwitchOffCTS();//here changed 0n->off
321 reader->SwitchOnCTS();//here changed 0n->off
323 reader->SwitchOffRecalculateVertexBC();
324 reader->SwitchOffVertexBCEventSelection();
326 reader->SwitchOffUseTrackTimeCut();
327 reader->SetTrackTimeCut(0,50);
329 if(inputDataType=="ESD")
332 AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001008);
333 reader->SetTrackCuts(esdTrackCuts);
334 AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10011008);
335 reader->SetTrackComplementaryCuts(esdTrackCuts2);
338 //AliESDtrackCuts * esdTrackCuts = CreateTrackCutsPWGJE(10001006);
339 //reader->SetTrackCuts(esdTrackCuts);
340 //AliESDtrackCuts * esdTrackCuts2 = CreateTrackCutsPWGJE(10041006);
341 //reader->SetTrackComplementaryCuts(esdTrackCuts2);
343 else if(inputDataType=="AOD")
345 reader->SwitchOnAODHybridTrackSelection(); // Check that the AODs have Hybrids!!!!
346 reader->SetTrackStatus(AliVTrack::kITSrefit);
347 //reader->SetTrackFilterMask(128); // Filter bit, not mask, use if off hybrid
352 reader->SetEMCALClusterListName(clustersArray);
353 if(clustersArray == "" && !useTender)
355 printf("**************** Standard EMCAL clusters branch analysis **************** \n");
356 reader->SwitchOnClusterRecalculation();
357 // Check in ConfigureCaloUtils that the recalibration and bad map are ON
361 printf("**************** Input for analysis is Clusterizer %s **************** \n", clustersArray.Data());
362 reader->SwitchOffClusterRecalculation();
365 if(!nonlin) reader->SwitchOffClusterELinearityCorrection();
366 else reader->SwitchOnClusterELinearityCorrection();
368 if(calorimeter == "EMCAL") {
369 reader->SwitchOnEMCALCells();
370 reader->SwitchOnEMCAL();
372 if(calorimeter == "PHOS") {
373 reader->SwitchOnPHOSCells();
374 reader->SwitchOnPHOS();
377 // for case data="deltaAOD", no need to fill the EMCAL/PHOS cluster lists
378 //if(kData.Contains("delta"))
380 // reader->SwitchOffEMCAL();
381 // reader->SwitchOffPHOS();
382 // reader->SwitchOffEMCALCells();
383 // reader->SwitchOffPHOSCells();
390 //if(!useKinematics) reader->SetFiredTriggerClassName("CEMC7EGA-B-NOPF-CENTNOTRD"); // L1 Gamma
392 if(collision =="pPb" && trigger=="EMCEGA") {
393 reader->SetFiredTriggerClassName(firedTrigger);
397 // For mixing with AliAnaParticleHadronCorrelation switch it off
400 reader->SwitchOffEventTriggerAtSE();
401 UInt_t mask = SetTriggerMaskFromName(trigger);
402 reader->SetEventTriggerMaks(mask); // Only for mixing and SwitchOffEventTriggerAtSE();
403 //reader->SetMixEventTriggerMaks(AliVEvent::kMB); // Careful, not all productions work with kMB, try kINT7, kINT1, kAnyINT
404 reader->SetMixEventTriggerMaks(AliVEvent::kAnyINT); // Careful, not all productions work with kMB, try kINT7, kINT1, kAnyINT
406 printf("---Trigger selection done in AliCaloTrackReader!!!\n");
409 reader->SwitchOnEventTriggerAtSE();
411 reader->SetZvertexCut(10.); // Open cut
412 reader->SwitchOnPrimaryVertexSelection(); // and besides primary vertex
413 reader->SwitchOnRejectNoTrackEvents();//<<<--- changed here, new added
417 reader->SwitchOnPileUpEventRejection(); // remove pileup by default
418 reader->SwitchOnV0ANDSelection() ; // and besides v0 AND
422 reader->SwitchOffPileUpEventRejection(); // remove pileup by default
423 reader->SwitchOffV0ANDSelection() ; // and besides v0 AND
426 if(collision=="PbPb")
429 reader->SetCentralityClass("V0M");
430 reader->SetCentralityOpt(10); // 10 (c= 0-10, 10-20 ...), 20 (c= 0-5, 5-10 ...) or 100 (c= 1, 2, 3 ..)
431 reader->SetCentralityBin(minCen,maxCen); // Accept all events, if not select range
433 // Event plane (only used in Maker and mixing for AliAnaPi0/AliAnaHadronCorrelation for the moment)
434 reader->SetEventPlaneMethod("V0");
437 if(printSettings) reader->Print("");
443 //_______________________________________
444 AliCalorimeterUtils* ConfigureCaloUtils( TString clustersArray = "V1",TString collision = "pp",Bool_t nonlin = kTRUE,Bool_t exotic = kTRUE ,Bool_t simulation = kFALSE,Bool_t timecut = kFALSE,Int_t debug = -1,Bool_t printSettings = kFALSE)
447 Bool_t useTender=kTRUE;
449 AliCalorimeterUtils *cu = new AliCalorimeterUtils;
452 // Remove clusters close to borders, at least max energy cell is 1 cell away
453 //cu->SetNumberOfCellsFromEMCALBorder(0);// <<<----changed here
454 cu->SetNumberOfCellsFromEMCALBorder(1);
455 cu->SetNumberOfCellsFromPHOSBorder(2);
457 // Search of local maxima in cluster
458 if(collision=="pp" || collision=="pPb")
460 cu->SetLocalMaximaCutE(0.1);
461 cu->SetLocalMaximaCutEDiff(0.03);
465 cu->SetLocalMaximaCutE(0.2);
466 cu->SetLocalMaximaCutEDiff(0.03);
469 cu->SwitchOffClusterPlot();
471 //if(kRecalTM) cu->SwitchOnRecalculateClusterTrackMatching(); // Done in clusterization
473 cu->SwitchOffRecalculateClusterTrackMatching();
476 cu->SwitchOffBadChannelsRemoval() ;
478 cu->SwitchOnBadChannelsRemoval() ;
482 cu->SwitchOnLoadOwnEMCALGeometryMatrices();
485 AliEMCALRecoUtils * recou = cu->GetEMCALRecoUtils();
489 cu->SwitchOnRecalibration(); // Check the reader if it is taken into account during filtering
490 //if(clustersArray == "" && !kTender) cu->SwitchOnRunDepCorrection();
491 if(clustersArray == "") cu->SwitchOnRunDepCorrection();
494 cu->SwitchOnEMCALOADB();//FIX ME!!!
496 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/ConfigureEMCALRecoUtils.C");
497 ConfigureEMCALRecoUtils(recou,
503 kFALSE); // time calib
507 recou->SetExoticCellDiffTimeCut(1e10);
508 if(timecut) recou->SetExoticCellDiffTimeCut(50.);
514 // printf("ConfigureCaloUtils() - Apply non linearity to EMCAL\n");
515 // //CAREFUL only for the latest simulation
516 // recou->SetNonLinearityFunction(AliEMCALRecoUtils::kBeamTestCorrected);
517 // recou->SetNonLinearityParam(0,9.81039e-01);
518 // recou->SetNonLinearityParam(1,1.13508e-01);
519 // recou->SetNonLinearityParam(2,1.00173e+00);
520 // recou->SetNonLinearityParam(3,9.67998e-02);
521 // recou->SetNonLinearityParam(4,2.19381e+02);
522 // recou->SetNonLinearityParam(5,6.31604e+01);
523 // recou->SetNonLinearityParam(6,1);
524 printf("*** SET cluster non linearity correction ***\n");
525 cu->SwitchOnCorrectClusterLinearity();
529 printf("ConfigureCaloUtils() - EMCAL Recalibration ON? %d %d\n",recou->IsRecalibrationOn(), cu->IsRecalibrationOn());
530 printf("ConfigureCaloUtils() - EMCAL BadMap ON? %d %d\n",recou->IsBadChannelsRemovalSwitchedOn(), cu->IsBadChannelsRemovalSwitchedOn());
533 cu->SetNumberOfSuperModulesUsed(10);
535 cu->SwitchOffLoadOwnPHOSGeometryMatrices();
537 if(printSettings) cu->Print("");
543 //_____________________________________
544 AliAnaPhoton* ConfigurePhotonAnalysis(TString calorimeter = "EMCAL",Bool_t tm = kFALSE,Bool_t simulation = kFALSE,Double_t maxLambda0Cut=0.5,Int_t maxNLMcut=2,Int_t debug = -1,Bool_t printSettings = kFALSE)
547 AliAnaPhoton *ana = new AliAnaPhoton();
548 ana->SetDebug(debug); //10 for lots of messages
550 // cluster selection cuts
552 ana->SwitchOffFiducialCut();
554 ana->SetCalorimeter(calorimeter);
556 if(calorimeter == "PHOS")
558 ana->SetNCellCut(2);// At least 3 cells
560 ana->SetMinDistanceToBadChannel(2, 4, 5);
561 ana->SetTimeCut(-1e10,1e10); // open cut
565 ana->SetNCellCut(1);// At least 2 cells
566 ana->SetMinEnergy(0.3); // avoid mip peak at E = 260 MeV
567 ana->SetMaxEnergy(1000);
568 //ana->SetTimeCut(-1e10,1e10); // open cut, usual time window of [425-825] ns if time recalibration is off //<<<---modified here
569 // restrict to less than 100 ns when time calibration is on
570 ana->SetMinDistanceToBadChannel(2, 4, 6);
571 // Not useful if M02 cut is already strong
572 ana->SetNLMCut(1, maxNLMcut) ;//[1,2]
573 //ana->SetNLMCut(1, 10) ;//<<<----changed here
574 //ana->SetNLMCut(1, 1) ;//<<<----changed here
579 ana->SwitchOnTrackMatchRejection() ;
580 ana->SwitchOffTMHistoFill() ;
584 ana->SwitchOffTrackMatchRejection() ;
585 ana->SwitchOnTMHistoFill() ;
589 //PID cuts (shower shape)
590 ana->SwitchOnCaloPID(); // do PID selection, unless specified in GetCaloPID, selection not based on bayesian
591 AliCaloPID* caloPID = ana->GetCaloPID();
592 //Not used in bayesian
595 caloPID->SetEMCALLambda0CutMax(maxLambda0Cut);//0.27 was before//0.50//<<<----changed here
596 caloPID->SetEMCALLambda0CutMin(0.10);
598 caloPID->SetEMCALDEtaCut(0.025);
599 caloPID->SetEMCALDPhiCut(0.030);
602 caloPID->SetPHOSDispersionCut(2.5);
603 caloPID->SetPHOSRCut(2.);
604 //if(kInputData=="AOD") caloPID->SetPHOSRCut(2000.); // Open cut since dX, dZ not stored
606 ana->SwitchOnFillShowerShapeHistograms(); // Filled before photon shower shape selection <<<--- changed here
607 //ana->SwitchOffFillShowerShapeHistograms(); // Filled before photon shower shape selection
608 ana->SwitchOffFillPileUpHistograms();
610 // Input / output delta AOD settings
612 //if(!kData.Contains("delta"))
614 ana->SetOutputAODName(Form("Photon%s",kGammaJetCorrelationName.Data()));
615 ana->SetOutputAODClassName("AliAODPWG4ParticleCorrelation");
616 // //ana->SetOutputAODClassName("AliAODPWG4Particle"); // use if no correlation done
619 ana->SetInputAODName(Form("Photon%s",kGammaJetCorrelationName.Data()));
621 //Set Histograms name tag, bins and ranges
623 ana->AddToHistogramsName(Form("AnaPhoton_TM%d_",tm));
624 SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
626 // Number of particle type MC histograms
627 ana->FillNOriginHistograms(20);
628 ana->FillNPrimaryHistograms(20);
630 ConfigureMC(ana,simulation);
632 if(printSettings) ana->Print("");
638 //____________________________________________________________________________________________________
639 AliAnaParticleIsolation* ConfigureIsolationAnalysis(TString calorimeter = "EMCAL",
640 TString collision = "pp",
641 TString particle="Photon",
642 Int_t partInCone = AliIsolationCut::kOnlyCharged,
643 Int_t thresType = AliIsolationCut::kSumPtFracIC,
647 Bool_t multi = kFALSE,Bool_t simulation = kFALSE,
649 Bool_t printSettings = kFALSE)
652 AliAnaParticleIsolation *ana = new AliAnaParticleIsolation();
653 ana->SetDebug(debug);
655 ana->SwitchOnFiducialCut();
656 //Avoid borders of EMCal
657 if(calorimeter=="EMCAL")
658 ana->GetFiducialCut()->SetSimpleEMCALFiducialCut(0.6, 86, 174) ;
660 // Same Eta as EMCal, cut in phi if EMCAL was triggering
661 if(particle=="Hadron" || particle.Contains("CTS"))
663 //if(trigger.Contains("EMC"))
664 // ana->GetFiducialCut()->SetSimpleCTSFiducialCut (0.6, 260, 360) ;
666 ana->GetFiducialCut()->SetSimpleCTSFiducialCut (0.6, 0, 360) ;
669 ana->SetMinPt(10);//<<---changed here
671 // Input / output delta AOD settings
673 ana->SetInputAODName(Form("%s%s",particle.Data(),kGammaJetCorrelationName.Data()));
674 ana->SetAODObjArrayName(Form("IC%s_%s",particle.Data(),kGammaJetCorrelationName.Data()));
676 ana->SetCalorimeter(calorimeter);
678 if(!tm) ana->SwitchOnTMHistoFill();
679 else ana->SwitchOffTMHistoFill();
681 //if(particle=="Photon")ana->SwitchOnSSHistoFill();
682 //else ana->SwitchOffSSHistoFill();
684 ana->SwitchOffSSHistoFill();
685 ana->SwitchOffFillPileUpHistograms();
687 //Do settings for main isolation cut class
688 AliIsolationCut * ic = ana->GetIsolationCut();
691 if(cone >0 && pth > 0)
693 ic->SetPtThreshold(pth);
694 ic->SetConeSize(cone);
700 ic->SetPtThreshold(1.);//<<---changed here was 0.5,1
701 ic->SetConeSize(0.3);//<<---changed here was 0.4
705 ic->SetPtThreshold(1.0);
706 ic->SetConeSize(0.3);
709 if(collision=="PbPb")
711 ic->SetPtThreshold(3.);
712 //ic->SetPtThreshold(1.);
713 ic->SetConeSize(0.3);
717 ic->SetPtFraction(0.1);
718 ic->SetSumPtThreshold(1.0) ;
719 ic->SetParticleTypeInCone(partInCone);
720 ic->SetICMethod(thresType);
722 //Do or not do isolation with previously produced AODs.
723 //No effect if use of SwitchOnSeveralIsolation()
724 ana->SwitchOffReIsolation();
729 ic->SetConeSize(1.); // Take all for first iteration
730 ic->SetPtThreshold(100);// Take all for first iteration
731 ana->SwitchOnSeveralIsolation() ;
732 ana->SetAODObjArrayName(Form("MultiIC%sTM%d",particle.Data(),tm));
735 ana->SetNPtThresFrac(4);
736 ana->SetConeSizes(0,0.3); ana->SetConeSizes(1,0.4);
737 ana->SetConeSizes(2,0.5); ana->SetConeSizes(3,0.6);
738 ana->SetPtThresholds(0, 0.5); ana->SetPtThresholds(1, 1); ana->SetPtThresholds(2, 2);
739 ana->SetPtFractions (0, 0.05) ; ana->SetPtFractions (1, 0.1); ana->SetPtFractions (2, 0.2) ; ana->SetPtFractions (3, 0.3) ;
740 ana->SetSumPtThresholds(0, 1) ; ana->SetSumPtThresholds(1, 3) ; ana->SetSumPtThresholds(2, 5); ana->SetSumPtThresholds(3, 7) ;
742 ana->SwitchOffTMHistoFill();
743 ana->SwitchOffSSHistoFill();
746 ana->SwitchOffSeveralIsolation() ;
748 AliCaloPID* caloPID = ana->GetCaloPID();
749 caloPID->SetEMCALDEtaCut(0.025);
750 caloPID->SetEMCALDPhiCut(0.030);
752 //Set Histograms name tag, bins and ranges
754 if(!multi)ana->AddToHistogramsName(Form("AnaIsol%s_TM%d_",particle.Data(),tm));
755 else ana->AddToHistogramsName(Form("AnaMultiIsol%s_TM%d_",particle.Data(),tm));
757 SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below
759 if(particle=="Hadron" || particle.Contains("CTS"))
761 ana->GetHistogramRanges()->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 200) ;
762 ana->GetHistogramRanges()->SetHistoEtaRangeAndNBins(-1.5, 1.5, 300) ;
765 ConfigureMC(ana,simulation);
767 if(printSettings) ic ->Print("");
768 if(printSettings) ana->Print("");
774 //________________________________________________________
775 void ConfigureMC(AliAnaCaloTrackCorrBaseClass* ana,Bool_t simulation = kFALSE)
777 if(simulation) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms, AOD MC not implemented yet.
778 else ana->SwitchOffDataMC() ;
780 //Set here generator name, default pythia
781 //ana->GetMCAnalysisUtils()->SetMCGenerator("");
784 //________________________________________________________
785 void SetHistoRangeAndNBins (AliHistogramRanges* histoRanges,TString calorimeter = "EMCAL")
787 // Set common bins for all analysis and MC histograms filling
789 histoRanges->SetHistoPtRangeAndNBins(-0.25, 99.75, 200) ; // Energy and pt histograms
791 if(calorimeter=="EMCAL")
793 histoRanges->SetHistoPhiRangeAndNBins(78*TMath::DegToRad(), 182*TMath::DegToRad(), 108) ;
794 histoRanges->SetHistoXRangeAndNBins(-600,90,200); // QA
795 histoRanges->SetHistoYRangeAndNBins(100,450,100); // QA
797 histoRanges->SetHistoEtaRangeAndNBins(-0.72, 0.72, 144) ;
801 histoRanges->SetHistoPhiRangeAndNBins(260*TMath::DegToRad(), 320*TMath::DegToRad(), 60) ;
802 histoRanges->SetHistoEtaRangeAndNBins(-0.13, 0.13, 130) ;
805 histoRanges->SetHistoShowerShapeRangeAndNBins(-0.1, 4.9, 500);
807 // Invariant mass histoRangeslysis
808 histoRanges->SetHistoMassRangeAndNBins(0., 1., 200) ;
809 histoRanges->SetHistoAsymmetryRangeAndNBins(0., 1. , 100) ;
811 // check if time calibration is on
812 //histoRanges->SetHistoTimeRangeAndNBins(-1000.,1000,1000);
813 histoRanges->SetHistoTimeRangeAndNBins(-400.,400,400);
814 histoRanges->SetHistoDiffTimeRangeAndNBins(-200, 200, 800);
816 // track-cluster residuals
817 histoRanges->SetHistoTrackResidualEtaRangeAndNBins(-0.15,0.15,300);
818 histoRanges->SetHistoTrackResidualPhiRangeAndNBins(-0.15,0.15,300);
819 histoRanges->SetHistodRRangeAndNBins(0.,0.15,150);//QA
821 // QA, electron, charged
822 histoRanges->SetHistoPOverERangeAndNBins(0,10.,100);
823 histoRanges->SetHistodEdxRangeAndNBins(0.,200.,200);
826 histoRanges->SetHistoFinePtRangeAndNBins(0, 10, 200) ; // bining for fhAmpId
827 histoRanges->SetHistoRatioRangeAndNBins(0.,2.,100);
828 histoRanges->SetHistoVertexDistRangeAndNBins(0.,500.,500);
829 histoRanges->SetHistoNClusterCellRangeAndNBins(0,500,500);
830 histoRanges->SetHistoZRangeAndNBins(-400,400,200);
831 histoRanges->SetHistoRRangeAndNBins(400,450,25);
832 histoRanges->SetHistoV0SignalRangeAndNBins(0,5000,500);
833 histoRanges->SetHistoV0MultiplicityRangeAndNBins(0,5000,500);
834 histoRanges->SetHistoTrackMultiplicityRangeAndNBins(0,5000,500);
837 histoRanges->SetHistoPtInConeRangeAndNBins(0, 50 , 250);
838 histoRanges->SetHistoPtSumRangeAndNBins (0, 100, 250);
843 UInt_t SetTriggerMaskFromName(TString trigger)
847 printf("CaloTrackCorr trigger EMC7\n");
848 return AliVEvent::kEMC7;
850 else if (trigger=="INT7")
852 printf("CaloTrackCorr trigger INT7\n");
853 return AliVEvent::kINT7;
855 else if(trigger=="EMC1")
857 printf("CaloTrackCorr trigger EMC1\n");
858 return AliVEvent::kEMC1;
860 else if(trigger=="MB")
862 printf("CaloTrackCorr trigger MB\n");
863 return AliVEvent::kMB;
865 else if(trigger=="PHOS")
867 printf("CaloTrackCorr trigger PHOS\n");
868 return AliVEvent::kPHI7;
870 else if(trigger=="PHOSPb")
872 printf("CaloTrackCorr trigger PHOSPb\n");
873 return AliVEvent::kPHOSPb;
875 else if(trigger=="AnyINT")
877 printf("CaloTrackCorr trigger AnyINT\n");
878 return AliVEvent::kAnyINT;
880 else if(trigger=="INT")
882 printf("CaloTrackCorr trigger AnyINT\n");
883 return AliVEvent::kAny;
885 else if(trigger=="EMCEGA")
887 printf("CaloTrackCorr trigger EMC Gamma\n");
888 return AliVEvent::kEMCEGA;
890 else if(trigger=="EMCEJE")
892 printf("CaloTrackCorr trigger EMC Jet\n");
893 return AliVEvent::kEMCEJE;
895 else if(trigger=="Central")
897 printf("CaloTrackCorr trigger Central\n");
898 return AliVEvent::kCentral;
900 else if(trigger=="CentralEGA")
902 printf("CaloTrackCorr trigger Central+EMCEGA\n");
903 return (AliVEvent::kCentral | AliVEvent::kEMCEGA);
905 else if(trigger=="SemiCentral")
907 printf("CaloTrackCorr trigger SemiCentral\n");
908 return AliVEvent::kSemiCentral;
910 else if(trigger=="SemiOrCentral")
912 printf("CaloTrackCorr trigger SemiCentral Or Central\n");
913 return (AliVEvent::kSemiCentral | AliVEvent::kCentral);
915 else if(trigger=="SemiOrCentralOrAnyINT")
917 printf("CaloTrackCorr trigger SemiCentral Or Central Or AnyINT\n");
918 return (AliVEvent::kSemiCentral | AliVEvent::kCentral | AliVEvent::kAnyINT);
923 AliAnaParticleJetFinderCorrelation* ConfigurePhotonJetAnalysis(TString calorimeter = "EMCAL",Float_t gammaConeSize = 0.3, Float_t jetMinPt = 0,
924 Float_t minDeltaPhi = 1.5,Float_t maxDeltaPhi = 4.5,
925 Float_t minPtRatio = 0,Float_t maxPtRatio = 5,
926 Bool_t simulation = kFALSE,Int_t debug = -1,Bool_t printSettings = kFALSE){
928 AliAnaParticleJetFinderCorrelation *ana = new AliAnaParticleJetFinderCorrelation();
929 ana->SetDebug(debug);
930 TString particle="Photon";
931 ana->SetInputAODName(Form("%s%s",particle.Data(),kGammaJetCorrelationName.Data()));
933 ana->SwitchOffFiducialCut();
935 ana->SetConeSize(0.4); //was 1 - cone to calculate FF
936 ana->SelectIsolated(kTRUE); // do correlation with isolated photons <<---changed here
937 ana->SetMakeCorrelationInHistoMaker(kFALSE);
938 ana->SetPtThresholdInCone(0.150);//<<---- change here
939 //ana->SetDeltaPhiCutRange(TMath::Pi()/2.,TMath::Pi()*3./2.);//Mostly Open Cuts
940 ana->SetDeltaPhiCutRange(minDeltaPhi,maxDeltaPhi); // Delta phi cut for correlation
941 ana->SetJetConeSize(0.4);//jet cone size / check the reco jet name
942 ana->SetJetMinPt(jetMinPt);//min jet pt
943 ana->SetJetAreaFraction(0.8);//min area fraction was 0.6
944 ana->SetMinPt(0.3);//min cluster pt repeated from reader
945 ana->SetGammaConeSize(gammaConeSize);//isolation cone repeated from isolation ana
946 //ana->SetRatioCutRange(0.01,5.); //Mostly Open Cuts //0.01-5//<<---- change here
947 ana->SetRatioCutRange(minPtRatio,maxPtRatio); // Delta pt cut for correlation
949 ana->UseJetRefTracks(kTRUE); //Working now
950 //Set Histograms bins and ranges
951 SetHistoRangeAndNBins(ana->GetHistogramRanges(),calorimeter); // see method below 0,100,200
952 //ana->SetHistoPtRangeAndNBins(0, 50, 200) ;
953 // ana->SetHistoPhiRangeAndNBins(0, TMath::TwoPi(), 100) ;
954 // ana->SetHistoEtaRangeAndNBins(-0.7, 0.7, 100) ;
956 // ana->SwitchOnNonStandardJetFromReader();
957 ana->SwitchOnBackgroundJetFromReader();
958 //background subtraction for photons
959 //ana->SwitchOnBackgroundSubtractionGamma();
960 ana->SwitchOffBackgroundSubtractionGamma();
962 ana->SwitchOnSaveGJTree();
963 ana->SwitchOnMostOpposite();
964 //ana->SwitchOnMostEnergetic();
967 //if(useKinematics) ana->SwitchOnDataMC() ;//Access MC stack and fill more histograms