]>
Commit | Line | Data |
---|---|---|
a3aebfff | 1 | AliAnalysisTaskParticleCorrelation *AddTaskPartCorr(TString data, TString calorimeter) |
90eb3a19 | 2 | { |
3 | // Creates a PartCorr task, configures it and adds it to the analysis manager. | |
4 | ||
5 | // Get the pointer to the existing analysis manager via the static access method. | |
6 | //============================================================================== | |
7 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
8 | if (!mgr) { | |
9 | ::Error("AddTaskPartCorr", "No analysis manager to connect to."); | |
10 | return NULL; | |
11 | } | |
12 | ||
13 | // Check the analysis type using the event handlers connected to the analysis manager. | |
14 | //============================================================================== | |
15 | if (!mgr->GetInputEventHandler()) { | |
16 | ::Error("AddTaskPartCorr", "This task requires an input event handler"); | |
17 | return NULL; | |
18 | } | |
19 | //TString dataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
20 | ||
21 | // Configure analysis | |
22 | //=========================================================================== | |
23 | ||
24 | //Reader | |
25 | AliCaloTrackReader * reader = 0x0; | |
26 | if(data=="AOD") reader = new AliCaloTrackAODReader(); | |
27 | else if(data=="ESD") reader = new AliCaloTrackESDReader(); | |
28 | else if(data=="MC") reader = new AliCaloTrackMCReader(); | |
29 | reader->SetDebug(-1);//10 for lots of messages | |
30 | ||
90eb3a19 | 31 | //Min particle pT |
32 | reader->SetEMCALPtMin(0.5); | |
33 | reader->SetPHOSPtMin(0.5); | |
a3aebfff | 34 | reader->SetCTSPtMin(0.2); |
90eb3a19 | 35 | reader->Print(""); |
36 | ||
a3aebfff | 37 | // ##### Analysis algorithm settings #### |
38 | ||
39 | // -------------------- | |
40 | // --- Pi0 Analysis --- | |
41 | // -------------------- | |
90eb3a19 | 42 | |
43 | AliCaloPID * pid = new AliCaloPID(); | |
44 | pid->SetDispersionCut(1.5); | |
45 | pid->SetTOFCut(5.e-9); | |
46 | pid->SetDebug(-1); | |
47 | pid->Print(""); | |
48 | ||
a3aebfff | 49 | AliAnaPhoton *anaphoton1 = new AliAnaPhoton(); |
50 | anaphoton1->SetDebug(-1); //10 for lots of messages | |
90eb3a19 | 51 | //anaphoton->SetMinPt(0.5); |
a3aebfff | 52 | anaphoton1->SetMinDistanceToBadChannel(2, 4, 5); |
53 | anaphoton1->SetCaloPID(pid); | |
54 | anaphoton1->SetCalorimeter(calorimeter); | |
55 | anaphoton1->SwitchOffDataMC() ;//Access MC stack and fill more histograms | |
56 | anaphoton1->SwitchOffCaloPID(); | |
57 | anaphoton1->SwitchOffCaloPIDRecalculation(); //recommended for EMCAL | |
58 | anaphoton1->SwitchOffFidutialCut(); | |
59 | anaphoton1->SetOutputAODName("PhotonsForPi0IM"+calorimeter); | |
60 | anaphoton1->Print(""); | |
61 | ||
90eb3a19 | 62 | AliAnaPi0 *anapi0 = new AliAnaPi0(); |
63 | anapi0->SetDebug(-1);//10 for lots of messages | |
a3aebfff | 64 | anapi0->SetInputAODName("PhotonsForPi0IM"+calorimeter); |
90eb3a19 | 65 | anapi0->SetCaloPID(pid); |
66 | anapi0->SetCalorimeter(calorimeter); | |
67 | anapi0->SwitchOnFidutialCut(); | |
68 | anapi0->SwitchOffDataMC() ;//Access MC stack and fill more histograms | |
69 | anapi0->Print(""); | |
70 | ||
90eb3a19 | 71 | |
a3aebfff | 72 | // ------------------------------------------------- |
73 | // --- Photon Isolation and Correlation Analysis --- | |
74 | // ------------------------------------------------- | |
75 | ||
76 | AliAnaPhoton *anaphoton2 = new AliAnaPhoton(); | |
77 | anaphoton2->SetDebug(-1); //10 for lots of messages | |
78 | anaphoton2->SetMinPt(5); | |
79 | anaphoton2->SetCaloPID(pid); | |
80 | anaphoton2->SetCalorimeter(calorimeter); | |
81 | anaphoton2->SwitchOffDataMC() ;//Access MC stack and fill more histograms | |
82 | anaphoton2->SwitchOnCaloPID(); | |
83 | if(calorimeter == "EMCAL") anaphoton2->SwitchOnCaloPIDRecalculation(); | |
84 | anaphoton2->SwitchOffFidutialCut(); | |
85 | anaphoton2->SetOutputAODName("DirectPhotons"+calorimeter); | |
86 | anaphoton2->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); | |
87 | anaphoton2->AddToHistogramsName("AnaPhotonCorr_"); | |
88 | anaphoton2->Print(""); | |
90eb3a19 | 89 | // ### Isolation analysis ### |
90 | ||
91 | AliIsolationCut * ic = new AliIsolationCut(); | |
92 | ic->SetConeSize(0.5); | |
93 | ic->SetPtThreshold(1.); | |
94 | ic->SetICMethod(AliIsolationCut::kPtThresIC); | |
95 | ic->Print(""); | |
96 | ||
97 | AliAnaParticleIsolation *anaisol = new AliAnaParticleIsolation(); | |
98 | anaisol->SetDebug(-1); | |
99 | //anaisol->SetMinPt(5); | |
a3aebfff | 100 | anaisol->SetInputAODName("DirectPhotons"+calorimeter); |
90eb3a19 | 101 | anaisol->SetCalorimeter(calorimeter); |
102 | anaisol->SwitchOffDataMC() ;//Access MC stack and fill more histograms | |
103 | //Select clusters with no pair, if both clusters with pi0 mass | |
104 | anaisol->SwitchOffInvariantMass(); | |
105 | //anaisol->SetNeutralMesonSelection(nms); | |
106 | //Do isolation cut | |
107 | anaisol->SetIsolationCut(ic); | |
108 | //Do or not do isolation with previously produced AODs. | |
109 | //No effect if use of SwitchOnSeveralIsolation() | |
110 | anaisol->SwitchOffReIsolation(); | |
111 | //Multiple IC | |
112 | anaisol->SwitchOffSeveralIsolation() ; | |
113 | anaisol->Print(""); | |
114 | ||
a3aebfff | 115 | // ### Correlation with Jet Finder AOD output |
116 | AliAnaParticleJetFinderCorrelation *anacorrjet = new AliAnaParticleJetFinderCorrelation(); | |
117 | anacorrjet->SetInputAODName("DirectPhotons"+calorimeter); | |
118 | anacorrjet->SwitchOffFidutialCut(); | |
119 | anacorrjet->SetDebug(-1); | |
120 | anacorrjet->SetConeSize(1); | |
121 | anacorrjet->SelectIsolated(kTRUE); // do correlation with isolated photons | |
122 | anacorrjet->SetPtThresholdInCone(0.2); | |
123 | anacorrjet->SetDeltaPhiCutRange(0.5,5.5);//Mostly Open Cuts | |
124 | anacorrjet->SetRatioCutRange(0.01,3); //Mostly Open Cuts | |
125 | anacorrjet->UseJetRefTracks(kFALSE); //Not working now | |
126 | anacorrjet->Print(""); | |
90eb3a19 | 127 | |
128 | // ### Correlation with hadrons | |
a3aebfff | 129 | AliAnaParticleHadronCorrelation *anacorrhadron = new AliAnaParticleHadronCorrelation(); |
130 | anacorrhadron->SetInputAODName("DirectPhotons"+calorimeter); | |
9415d854 | 131 | anacorrhadron->SetOutputAODName("CorrelatedPi0s"+calorimeter); |
132 | anacorrhadron->SetOutputAODClassName("AliAODPWG4ParticleCorrelation"); | |
a3aebfff | 133 | anacorrhadron->SetDebug(-1); |
134 | anacorrhadron->SwitchOffFidutialCut(); | |
135 | anacorrhadron->SetPtCutRange(1,100); | |
136 | anacorrhadron->SetDeltaPhiCutRange(1.5,4.5); | |
137 | anacorrhadron->SelectIsolated(kTRUE); // do correlation with isolated photons | |
138 | if(calorimeter=="PHOS"){ | |
90eb3a19 | 139 | //Correlate with particles in EMCAL |
a3aebfff | 140 | anacorrhadron->SwitchOnCaloPID(); |
141 | anacorrhadron->SwitchOnCaloPIDRecalculation(); //recommended for EMCAL | |
90eb3a19 | 142 | } |
a3aebfff | 143 | anacorrhadron->Print(""); |
90eb3a19 | 144 | |
145 | // #### Configure Maker #### | |
a3aebfff | 146 | AliAnaPartCorrMaker * maker = new AliAnaPartCorrMaker(); |
90eb3a19 | 147 | maker->SetReader(reader);//pointer to reader |
a3aebfff | 148 | maker->AddAnalysis(anaphoton1,0); |
149 | maker->AddAnalysis(anapi0,1); | |
150 | maker->AddAnalysis(anaphoton2,2); | |
151 | maker->AddAnalysis(anaisol,3); | |
152 | maker->AddAnalysis(anacorrjet,4); | |
153 | maker->AddAnalysis(anacorrhadron,5); | |
90eb3a19 | 154 | maker->SetAnaDebug(-1) ; |
155 | maker->SwitchOnHistogramsMaker() ; | |
156 | maker->SwitchOnAODsMaker() ; | |
157 | maker->Print(""); | |
a3aebfff | 158 | |
90eb3a19 | 159 | printf("======================== \n"); |
a3aebfff | 160 | printf(" End Configuration of PartCorr analysis with detector %s \n",calorimeter.Data()); |
90eb3a19 | 161 | printf("======================== \n"); |
162 | ||
a3aebfff | 163 | // Create task |
164 | //=========================================================================== | |
fbc534a2 | 165 | AliAnalysisTaskParticleCorrelation * task = new AliAnalysisTaskParticleCorrelation ("PartCorr"+calorimeter); |
a3aebfff | 166 | task->SetConfigFileName(""); //Don't configure the analysis via configuration file. |
167 | //task->SetDebugLevel(-1); | |
168 | task->SetAnalysisMaker(maker); | |
169 | mgr->AddTask(task); | |
170 | ||
fbc534a2 | 171 | char name[128]; |
172 | sprintf(name,"PartCorr_%s",calorimeter.Data()); | |
173 | cout<<"Name of task "<<name<<endl; | |
174 | AliAnalysisDataContainer *cout_pc = mgr->CreateContainer(Form(name),TList::Class(), | |
a3aebfff | 175 | AliAnalysisManager::kOutputContainer, Form("PartCorr_%s.root",calorimeter.Data())); |
176 | ||
177 | // Create ONLY the output containers for the data produced by the task. | |
178 | // Get and connect other common input/output containers via the manager as below | |
179 | //============================================================================== | |
180 | mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer()); | |
181 | // AOD output slot will be used in a different way in future | |
182 | mgr->ConnectOutput (task, 0, mgr->GetCommonOutputContainer()); | |
183 | mgr->ConnectOutput (task, 1, cout_pc); | |
184 | ||
185 | return task; | |
90eb3a19 | 186 | } |
a3aebfff | 187 | |
188 |