]>
Commit | Line | Data |
---|---|---|
c683985a | 1 | //DEFINITION OF A FEW CONSTANTS |
2 | //---------------------------------------------------- | |
3 | ||
4 | /* $Id$ */ | |
5 | ||
6 | AliAnalysisTaskDStarCorrelations *AddTaskDStarCorrelations(AliAnalysisTaskDStarCorrelations::CollSyst syst, | |
c3cc0c2f | 7 | Bool_t theMCon, Bool_t mixing, Bool_t UseReco=kTRUE,Bool_t UseHadChannelinMC,Bool_t fullmode = kFALSE,Bool_t UseEffic=kFALSE,Bool_t UseDEffic = kFALSE, Bool_t useDStarSidebands = kFALSE, |
c683985a | 8 | AliAnalysisTaskDStarCorrelations::DEffVariable var, |
9 | Int_t trackselect =1, Int_t usedispl =0, Int_t nbins, Float_t DStarSigma, Float_t D0Sigma, Float_t D0SBSigmaLow, Float_t D0SBSigmaHigh, Float_t eta, | |
10 | TString DStarCutsFile, TString TrackCutsFile, | |
5d3b1a33 | 11 | TString suffix = "") |
c683985a | 12 | { |
13 | ||
14 | ||
15 | ||
16 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
17 | if (!mgr) { | |
18 | ::Error(" AliAnalysisTaskDStarCorrelations", "No analysis manager to connect to."); | |
19 | return NULL; | |
20 | } | |
21 | ||
22 | cout << "==========================================================" << endl; | |
23 | cout << "Set Inputs : " << endl; | |
24 | cout << " " << endl; | |
25 | if(syst == AliAnalysisTaskDStarCorrelations::pp) cout << "Running on pp @ 7 TeV" << endl; | |
26 | if(syst == AliAnalysisTaskDStarCorrelations::pA) cout << "Running on pPb @ 5.02 TeV" << endl; | |
27 | if(syst == AliAnalysisTaskDStarCorrelations::AA) cout << "Running on PbPb @ 2.76 TeV" << endl; | |
28 | ||
29 | if(theMCon) cout << "Analysis on MonteCarlo" << endl; | |
30 | else cout << "Analysis on Data" << endl; | |
31 | ||
32 | if(mixing) cout << "Analysis on Mixed Events" << endl; | |
33 | else cout << "Analysis on Single Events" << endl; | |
34 | ||
35 | if(UseReco) cout << "Using Reconstructed objects" << endl; | |
36 | else cout << "Using Pure MC information " << endl; | |
37 | ||
38 | if(fullmode) cout << "Running in full mode" << endl; | |
39 | else cout << "Running in fast mode " << endl; | |
40 | ||
41 | if(UseEffic) cout << "Using single track efficiency map" << endl; | |
42 | else cout << "Not Using single track efficiency map " << endl; | |
43 | ||
44 | if(UseDEffic) cout << "Using Dmeson efficiency map" << endl; | |
45 | else cout << "Not Using Dmeson efficiency map " << endl; | |
46 | ||
47 | ||
48 | if(var == AliAnalysisTaskDStarCorrelations::kNone) cout << "Applying D Efficiency map vs pT " << endl; | |
49 | if(var == AliAnalysisTaskDStarCorrelations::kMult) cout << "Applying D Efficiency map vs pT vs Multiplicity" << endl; | |
50 | if(var == AliAnalysisTaskDStarCorrelations::kCentr) cout << "Applying D Efficiency map vs pT vs Centrality" << endl; | |
51 | if(var == AliAnalysisTaskDStarCorrelations::kRapidity) cout << "Applying D Efficiency map vs pT vs Rapidity" << endl; | |
52 | if(var == AliAnalysisTaskDStarCorrelations::kEta) cout << "Applying D Efficiency map vs pT vs Eta" << endl; | |
53 | ||
54 | if(trackselect == 1) cout << "Correlating with hadrons" << endl; | |
55 | if(trackselect == 2) cout << "Correlating with kaons" << endl; | |
56 | if(trackselect == 3) cout << "Correlating with kzeros" << endl; | |
57 | ||
58 | if(usedispl == 0) cout << "Not using displacement cut" << endl; | |
59 | if(usedispl == 1) cout << "Using absolute displacement cut" << endl; | |
60 | if(usedispl == 2) cout << "Using relative displacement cut" << endl; | |
61 | ||
62 | ||
63 | cout << "Number of bins in deltaphi = " << nbins << endl; | |
64 | ||
65 | cout << "N of Sigmas in D* selection =" << DStarSigma << endl; | |
66 | cout << "N of Sigmas in D0 selection = " << D0Sigma << endl; | |
67 | cout << "D0 Sidebands taken from = " << D0SBSigmaLow << " - " << D0SBSigmaHigh << " sigmas " << endl; endl; | |
68 | ||
69 | ||
70 | ||
71 | cout << "DStar cut object: " << DStarCutsFile << endl; | |
72 | cout << "Tracks cut object: " << TrackCutsFile << endl; | |
73 | ||
74 | ||
75 | cout << "==========================================================" << endl; | |
76 | //gSystem->Sleep(2000); | |
77 | ||
78 | // TString DCutObjPath = "CutObjects/DStar/"; | |
79 | ||
80 | ||
81 | // ******************************** OPENING THE D* CUTS ************************************ | |
82 | cout << "Getting D meson cut object from file \n" << DStarCutsFile.Data() << "\n " << endl; | |
83 | TFile* filecuts=TFile::Open(DStarCutsFile.Data()); | |
84 | if(!filecuts->IsOpen()){ | |
85 | cout<<"DStar cut object file not found: exit"<<endl; | |
86 | return; | |
87 | } | |
88 | ||
89 | AliRDHFCutsDStartoKpipi* RDHFDStartoKpipi=new AliRDHFCutsDStartoKpipi(); | |
90 | RDHFDStartoKpipi = (AliRDHFCutsDStartoKpipi*)filecuts->Get("DStartoKpipiCuts"); | |
91 | RDHFDStartoKpipi->SetName("DStartoKpipiCuts"); | |
92 | ||
93 | // mm let's see if everything is ok | |
94 | if(!RDHFDStartoKpipi){ | |
95 | cout<<"Specific AliRDHFCuts not found"<<endl; | |
96 | return; | |
97 | } | |
98 | ||
99 | ||
100 | // RDHFDStartoKpipi->SetTriggerClass(""); | |
101 | // RDHFDStartoKpipi->SetTriggerMask(AliVEvent::kCentral); | |
102 | ||
103 | ||
104 | ||
105 | // ******************************** OPENING THE ASSOCIATED TRACK CUTS ************************************ | |
106 | cout << "Getting associated track cut object from file \n" << TrackCutsFile.Data() << "\n " << endl; | |
107 | TFile* filecuts2=TFile::Open(TrackCutsFile.Data()); | |
108 | if(!filecuts2->IsOpen()){ | |
109 | cout<<"Track cut object file not found: exit"<<endl; | |
110 | return; | |
111 | } | |
112 | AliHFAssociatedTrackCuts* corrCuts=new AliHFAssociatedTrackCuts(); | |
113 | corrCuts = (AliHFAssociatedTrackCuts*)filecuts2->Get("AssociatedCuts"); | |
114 | corrCuts->SetName("AssociatedCuts"); | |
115 | corrCuts->PrintAll(); | |
116 | if(!corrCuts){ | |
117 | cout<<"Specific associated track cuts not found"<<endl; | |
118 | return; | |
119 | } | |
120 | ||
121 | ||
122 | // ******************************** SELECTING THE MC PROCESS ************************************ | |
123 | ||
124 | TString selectMCproc = ""; | |
125 | ||
126 | Int_t NMCevents = corrCuts->GetNofMCEventType(); | |
127 | for(Int_t k=0; k<NMCevents; k++){ | |
128 | Int_t * MCEventType = corrCuts->GetMCEventType(); | |
129 | selectMCproc += Form("%d",MCEventType[k]); | |
130 | } | |
131 | ||
132 | cout << "Select process string = " << selectMCproc << endl; | |
133 | ||
134 | ||
135 | ||
136 | // ******************************** CREATING THE TASK ************************************ | |
137 | ||
138 | printf("CREATE TASK \n"); | |
139 | // create the task | |
140 | AliAnalysisTaskDStarCorrelations *task = new AliAnalysisTaskDStarCorrelations("AliAnalysisTaskDStarCorrelations",RDHFDStartoKpipi,corrCuts,syst,fullmode); | |
141 | ||
142 | // Setters | |
143 | ||
144 | if(!theMCon) { | |
145 | printf("Analysis on Data - reconstruction only!"); | |
146 | UseReco = kTRUE; | |
147 | printf("Analysis on Data - hadronic channel only!"); | |
148 | UseHadChannelinMC = kFALSE; | |
149 | } | |
150 | ||
151 | ||
152 | ||
153 | ||
c683985a | 154 | task->SetNofPhiBins(nbins); |
155 | task->SetMonteCarlo(theMCon); | |
156 | task->SetUseMixing(mixing); | |
157 | task->SetCorrelator(trackselect) ; | |
158 | task->SetUseDisplacement(usedispl); | |
159 | //task->SetCollSys(syst); | |
160 | task->SetLevelOfDebug(2); | |
161 | task->SetUseReconstruction(UseReco); // set kTRUE for Using Reconstruction, kFALSe for MC Truth | |
162 | task->SetDMesonSigmas(DStarSigma,D0Sigma,D0SBSigmaLow,D0SBSigmaHigh); | |
163 | //task->SetDMesonSigmas(sigmas); | |
164 | //task->SetDMesonSigmas(sigmas); | |
165 | task->SetUseEfficiencyCorrection(UseEffic); | |
166 | task->SetUseDmesonEfficiencyCorrection(UseDEffic); | |
167 | ||
168 | task->SetEfficiencyVariable(var); | |
169 | task->SetMaxDStarEta(eta); | |
170 | task->SetUseHadronicChannelAtKineLevel(UseHadChannelinMC); | |
c3cc0c2f | 171 | if(useDStarSidebands)task->SetBkgEstimationMethod(AliAnalysisTaskDStarCorrelations::kDStarSB); |
172 | if(!useDStarSidebands)task->SetBkgEstimationMethod(AliAnalysisTaskDStarCorrelations::kDZeroSB); | |
c683985a | 173 | |
174 | if(trackselect == 1) Info(" AliAnalysisTaskDStarCorrelations","Correlating D* with charged hadrons \n"); | |
175 | else if(trackselect == 2) Info(" AliAnalysisTaskDStarCorrelations","Correlating D* with charged kaons \n"); | |
176 | else if(trackselect == 3) Info(" AliAnalysisTaskDStarCorrelations","Correlating D* with reconstructed K0s \n"); | |
177 | else Fatal(" AliAnalysisTaskDStarCorrelations","Nothing to correlate with!"); | |
178 | if(mixing) Info (" AliAnalysisTaskDStarCorrelations","Event Mixing Analysis\n"); | |
179 | if(!mixing) Info (" AliAnalysisTaskDStarCorrelations","Single Event Analysis \n"); | |
180 | ||
181 | // Create and connect containers for input/output | |
182 | //TString dcavalue = " "; | |
5d3b1a33 | 183 | |
184 | TString contname1 = "OutputEvent"; | |
185 | TString contname2 = "OutputDmeson"; | |
186 | TString contname3 = "OutputTracks"; | |
187 | TString contname4 = "OutputEventMixing"; | |
188 | TString contname5 = "OutputCorrelations"; | |
189 | TString contname6 = "OutputMC"; | |
190 | TString counter = "NormCounter"; | |
191 | TString cutname1 = "Dcuts" ; | |
c683985a | 192 | TString cutname2 = "hadroncuts" ; |
5d3b1a33 | 193 | |
194 | //if(suffix != ""){ | |
195 | contname1 += suffix; | |
196 | contname2 += suffix; | |
197 | contname3 += suffix; | |
198 | contname4 += suffix; | |
199 | contname5 += suffix; | |
200 | contname6 += suffix; | |
201 | counter += suffix; | |
202 | cutname1 += suffix; | |
203 | cutname2 += suffix; | |
204 | ||
205 | ||
206 | // } | |
207 | ||
208 | // else{ | |
209 | ||
210 | //if(!theMCon) TString contname = "Data"; | |
211 | //if(theMCon) TString contname = "MonteCarlo"; | |
212 | //TString contname2 = "MC"; | |
213 | //if(trackselect ==1) TString particle = "Hadron"; | |
214 | //if(trackselect ==2) TString particle = "Kaon"; | |
215 | //if(trackselect ==3) TString particle = "KZero"; | |
216 | ||
217 | ||
c683985a | 218 | TString outputfile = AliAnalysisManager::GetCommonFileName(); |
5d3b1a33 | 219 | //TString outputfileMC = AliAnalysisManager::GetCommonFileName(); |
220 | //TString counter = "NormCounter"; | |
c683985a | 221 | outputfile += ":PWGHF_HFCJ_"; |
5d3b1a33 | 222 | //outputfileMC += ":PWGHF_HFCJ_"; |
c683985a | 223 | |
224 | if(!mixing) { | |
225 | outputfile += "SE"; | |
5d3b1a33 | 226 | //outputfileMC += "SE"; |
227 | /*contname1 += "SE"; | |
c683985a | 228 | contname2 += "SE"; |
5d3b1a33 | 229 | contname3 += "SE"; |
230 | contname4 += "SE"; | |
231 | contname5 += "SE"; | |
232 | counter+= "SE"; | |
233 | cutname1 += "SE"; | |
234 | cutname2 += "SE";*/ | |
235 | ||
c683985a | 236 | } |
237 | if(mixing){ | |
238 | outputfile += "ME"; | |
5d3b1a33 | 239 | //outputfileMC += "ME"; |
240 | ||
c683985a | 241 | } |
242 | ||
243 | ||
244 | ||
5d3b1a33 | 245 | /*outputfile += "Dphi_DStar"; |
246 | //outputfileMC += "Dphi_DStar"; | |
c683985a | 247 | outputfile += particle; |
5d3b1a33 | 248 | //outputfileMC += particle; |
249 | */ | |
c683985a | 250 | if(UseEffic){ |
251 | outputfile += "_EffY_"; | |
5d3b1a33 | 252 | //outputfileMC += "_EffY_"; |
253 | ||
c683985a | 254 | } |
255 | ||
256 | if(!UseEffic){ | |
257 | outputfile += "_EffN_"; | |
5d3b1a33 | 258 | //outputfileMC += "_EffN_"; |
259 | ||
c683985a | 260 | } |
261 | ||
262 | if(UseDEffic){ | |
263 | TString string = "DEffY_"; | |
264 | ||
265 | if(var == AliAnalysisTaskDStarCorrelations::kNone) string += "vsPt_"; | |
266 | if(var == AliAnalysisTaskDStarCorrelations::kMult) string += "vsPtMult_"; | |
267 | if(var == AliAnalysisTaskDStarCorrelations::kCentr) string += "vsPCentrt_"; | |
268 | if(var == AliAnalysisTaskDStarCorrelations::kRapidity) string += "vsPtY_"; | |
269 | if(var == AliAnalysisTaskDStarCorrelations::kEta) string += "vsPtEta_"; | |
270 | ||
271 | outputfile += string; | |
5d3b1a33 | 272 | //outputfileMC += string; |
273 | ||
c683985a | 274 | } |
275 | ||
276 | if(!UseDEffic){ | |
277 | outputfile += "DEffN_"; | |
5d3b1a33 | 278 | //outputfileMC += "DEffN_"; |
279 | ||
c683985a | 280 | } |
281 | ||
282 | ||
283 | outputfile += Form("%d_bins_",nbins); | |
5d3b1a33 | 284 | //outputfileMC += Form("%d_bins_",nbins); |
285 | ||
c683985a | 286 | |
287 | ||
5d3b1a33 | 288 | outputfile += suffix; |
289 | //outputfileMC += Form("task_%d",tasknumber); | |
290 | ||
c683985a | 291 | |
292 | /* outputfile += TrackCutObjNamePrefix; | |
5d3b1a33 | 293 | //outputfileMC += TrackCutObjNamePrefix; |
c683985a | 294 | cutname += TrackCutObjNamePrefix; |
295 | cutname2 += TrackCutObjNamePrefix; | |
296 | contname += TrackCutObjNamePrefix; | |
297 | contname2 += TrackCutObjNamePrefix; | |
298 | counter+= TrackCutObjNamePrefix; | |
299 | */ | |
300 | outputfile += selectMCproc; | |
5d3b1a33 | 301 | //outputfileMC += selectMCproc; |
302 | ||
c683985a | 303 | |
304 | TString reco = ""; | |
305 | ||
306 | if(UseReco) reco = "_reco"; | |
307 | if(!UseReco) { | |
308 | if(UseHadChannelinMC) reco = "_MCTruthHadChan"; | |
309 | if(!UseHadChannelinMC) reco = "_MCTruthAllChan"; | |
310 | } | |
311 | outputfile += reco; | |
5d3b1a33 | 312 | //outputfileMC += reco; |
313 | ||
c683985a | 314 | |
315 | TString nsigma = Form("_%.0f_%.0f%.0f%.0f_sigmas",DStarSigma,D0Sigma,D0SBSigmaLow,D0SBSigmaHigh); | |
316 | ||
317 | //cout << "nsigma string = "<< nsigma << endl; | |
318 | ||
319 | outputfile += nsigma; | |
5d3b1a33 | 320 | //outputfileMC += nsigma; |
321 | ||
c683985a | 322 | |
5d3b1a33 | 323 | /* |
c683985a | 324 | cout << contname << endl; |
325 | cout << contname2 << endl; | |
326 | cout << cutname << endl; | |
327 | cout << cutname2 << endl; | |
328 | cout << counter << endl; | |
5d3b1a33 | 329 | cout << outputfile << endl;*/ |
c683985a | 330 | //return; |
5d3b1a33 | 331 | //}// end else |
c683985a | 332 | mgr->AddTask(task); |
333 | // ------ input data ------ | |
334 | AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer(); | |
335 | ||
336 | // ----- output data ----- | |
337 | ||
338 | // output TH1I for event counting | |
339 | ||
340 | //TLists | |
5d3b1a33 | 341 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname1, TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); |
342 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(contname2, TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
343 | AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(contname3, TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
344 | AliAnalysisDataContainer *coutput4 = mgr->CreateContainer(contname4, TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
345 | AliAnalysisDataContainer *coutput5 = mgr->CreateContainer(contname5, TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
346 | AliAnalysisDataContainer *coutput6 = mgr->CreateContainer(contname6, TList::Class(),AliAnalysisManager::kOutputContainer,outputfile.Data()); | |
347 | // Normalization Counter | |
348 | AliAnalysisDataContainer *coutput7 = mgr->CreateContainer(counter,AliNormalizationCounter::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); | |
c683985a | 349 | // Cut Objects |
5d3b1a33 | 350 | AliAnalysisDataContainer *coutput8 = mgr->CreateContainer(cutname1,AliRDHFCutsDStartoKpipi::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //cuts D |
351 | AliAnalysisDataContainer *coutput9 = mgr->CreateContainer(cutname2,AliHFAssociatedTrackCuts::Class(),AliAnalysisManager::kOutputContainer, outputfile.Data()); //cuts tracks | |
352 | ||
c683985a | 353 | |
354 | ||
355 | mgr->ConnectInput(task,0,mgr->GetCommonInputContainer()); | |
356 | mgr->ConnectOutput(task,1,coutput1); | |
357 | mgr->ConnectOutput(task,2,coutput2); | |
358 | mgr->ConnectOutput(task,3,coutput3); | |
359 | mgr->ConnectOutput(task,4,coutput4); | |
360 | mgr->ConnectOutput(task,5,coutput5); | |
5d3b1a33 | 361 | mgr->ConnectOutput(task,6,coutput6); |
362 | mgr->ConnectOutput(task,7,coutput7); | |
363 | mgr->ConnectOutput(task,8,coutput8); | |
364 | mgr->ConnectOutput(task,9,coutput9); | |
c683985a | 365 | |
366 | return task ; | |
367 | ||
368 | } | |
369 |