]>
Commit | Line | Data |
---|---|---|
fdceab34 | 1 | //DEFINITION OF A FEW CONSTANTS |
67ebd013 | 2 | const Float_t phimin = 0.; |
3 | const Float_t phimax = 2.*TMath::Pi(); | |
4 | const Float_t etamin = -0.9; | |
5 | const Float_t etamax = 0.9; | |
67ebd013 | 6 | |
67ebd013 | 7 | const Int_t mintrackrefsTPC = 1; |
8 | const Int_t mintrackrefsITS = 1; | |
fdceab34 | 9 | |
7b90d977 | 10 | void AddTaskPWG4HighPtSpectraAll(char *prodType = "LHC10h",Bool_t isPbPb=kTRUE, Int_t iAODanalysis = 0) |
fdceab34 | 11 | { |
7b90d977 | 12 | int cent = 10; |
13 | ||
14 | AliPWG4HighPtSpectra *taskSpectra00cent10 = AddTaskPWG4HighPtSpectra(prodType,isPbPb,cent,0,0); | |
15 | AliPWG4HighPtSpectra *taskSpectra01cent10 = AddTaskPWG4HighPtSpectra(prodType,isPbPb,cent,0,1); | |
16 | AliPWG4HighPtSpectra *taskSpectra10cent10 = AddTaskPWG4HighPtSpectra(prodType,isPbPb,cent,1,0); | |
17 | AliPWG4HighPtSpectra *taskSpectra20cent10 = AddTaskPWG4HighPtSpectra(prodType,isPbPb,cent,2,0); | |
18 | ||
19 | if(isPbPb) { | |
20 | for(cent=0; cent<4; cent++) { | |
21 | AliPWG4HighPtSpectra *taskSpectra00 = AddTaskPWG4HighPtSpectra(prodType,isPbPb,cent,0,0); | |
22 | AliPWG4HighPtSpectra *taskSpectra01 = AddTaskPWG4HighPtSpectra(prodType,isPbPb,cent,0,1); | |
23 | AliPWG4HighPtSpectra *taskSpectra10 = AddTaskPWG4HighPtSpectra(prodType,isPbPb,cent,1,0); | |
24 | AliPWG4HighPtSpectra *taskSpectra20 = AddTaskPWG4HighPtSpectra(prodType,isPbPb,cent,2,0); | |
25 | } | |
26 | } | |
27 | ||
28 | } | |
29 | ||
30 | ||
31 | AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra(char *prodType = "LHC10e14", Bool_t isPbPb=kTRUE,Int_t centClass = 0, Int_t trackType = 0, Int_t cuts = 0) | |
32 | { | |
33 | ||
34 | /* | |
35 | trackType: 0 = global | |
36 | 1 = TPC stand alone | |
37 | 2 = TPC stand alone constrained to SPD vertex | |
38 | cuts: 0 (global) = standard ITSTPC2010 | |
39 | 1 (global) = ITSrefit, no SPD requirements | |
40 | 2 (global) = SPD || SDD | |
41 | 0 (TPC) = standard TPC + NClusters>70 | |
42 | 1 (TPC) = standard TPC + NClusters>0 --> to study new TPC QA recommendations | |
43 | */ | |
44 | ||
67ebd013 | 45 | // Creates HighPtSpectra analysis task and adds it to the analysis manager. |
fdceab34 | 46 | |
47 | // A. Get the pointer to the existing analysis manager via the static access method. | |
48 | //============================================================================== | |
49 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
50 | if (!mgr) { | |
51 | Error("AddTaskPWG4HighPtSpectra", "No analysis manager to connect to."); | |
52 | return NULL; | |
53 | } | |
54 | ||
55 | // B. Check the analysis type using the event handlers connected to the analysis | |
56 | // manager. The availability of MC handler can also be checked here. | |
57 | //============================================================================== | |
58 | if (!mgr->GetInputEventHandler()) { | |
67ebd013 | 59 | ::Error("AddTaskPWG4HighPtSpectra", "This task requires an input event handler"); |
fdceab34 | 60 | return NULL; |
61 | } | |
62 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
63 | const char *analysisType = "ESD";//"TPC" | |
64 | ||
65 | // C. Create the task, add it to manager. | |
66 | //=========================================================================== | |
67ebd013 | 67 | //CONTAINER DEFINITION |
fdceab34 | 68 | Info("AliPWG4HighPtSpectra","SETUP CONTAINER"); |
69 | //the sensitive variables, their indices | |
67ebd013 | 70 | UInt_t ipt = 0; |
71 | UInt_t iphi = 1; | |
72 | UInt_t ieta = 2; | |
67ebd013 | 73 | |
fdceab34 | 74 | //Setting up the container grid... |
7b90d977 | 75 | UInt_t nstep = 7; //Steps/Modes for containers |
76 | Int_t kStepReconstructed = 0; | |
77 | Int_t kStepSecondaries = 1; | |
78 | Int_t kStepReconstructedMC = 2; | |
79 | Int_t kStepMCAcceptance = 3; | |
b1cd0099 | 80 | |
81 | //redefine pt ranges in case of Jet-Jet production | |
82 | Float_t ptBinEdges[2][2]; | |
83 | Float_t ptmin = 2.0 ; | |
84 | Float_t ptmax = 50.0 ; | |
85 | Float_t binWidth3 = 5.; | |
a31b8a87 | 86 | if(!strcmp(prodType, "LHC10e14")) { |
b1cd0099 | 87 | ptmin = 0.0 ; |
88 | ptmax = 500.0 ; | |
89 | ||
90 | ptBinEdges[0][0] = 100.; | |
91 | ptBinEdges[0][1] = 5.; | |
92 | ptBinEdges[1][0] = 300.; | |
93 | ptBinEdges[1][1] = 10.; | |
94 | binWidth3 = 20.; | |
95 | } else { | |
96 | ptmin = 2.0 ; | |
97 | ptmax = 50.0 ; | |
98 | ||
99 | ptBinEdges[0][0] = 10.; | |
a31b8a87 | 100 | ptBinEdges[0][1] = 0.5; |
34fc6450 | 101 | ptBinEdges[1][0] = 60.; |
102 | ptBinEdges[1][1] = 2.; | |
b1cd0099 | 103 | binWidth3 = 5.; |
104 | } | |
105 | ||
ec555a3c | 106 | const Int_t nvar = 3; //number of variables on the grid: pt:phi:eta |
b1cd0099 | 107 | const Int_t nbin11 = (int)((ptBinEdges[0][0]-ptmin)/ptBinEdges[0][1]); |
108 | const Int_t nbin12 = (int)((ptBinEdges[1][0]-ptBinEdges[0][0])/ptBinEdges[1][1])+nbin11; | |
109 | const Int_t nbin13 = (int)((ptmax-ptBinEdges[1][0])/binWidth3)+nbin12; | |
43032097 | 110 | const Int_t nbin1 = nbin13; //bins in pt |
a31b8a87 | 111 | const Int_t nbin2 = 18; //bins in phi |
112 | const Int_t nbin3 = 2; //bins in eta | |
fdceab34 | 113 | |
fdceab34 | 114 | //arrays for the number of bins in each dimension |
115 | Int_t iBin[nvar]; | |
116 | iBin[0]=nbin1; | |
67ebd013 | 117 | iBin[1]=nbin2; |
118 | iBin[2]=nbin3; | |
ec555a3c | 119 | |
fdceab34 | 120 | //arrays for lower bounds : |
121 | Double_t *binLim1=new Double_t[nbin1+1]; | |
67ebd013 | 122 | Double_t *binLim2=new Double_t[nbin2+1]; |
123 | Double_t *binLim3=new Double_t[nbin3+1]; | |
ec555a3c | 124 | |
67ebd013 | 125 | //values for bin lower bounds |
126 | for(Int_t i=0; i<=nbin1; i++) { | |
b1cd0099 | 127 | if(i<=nbin11) binLim1[i]=(Double_t)ptmin + (ptBinEdges[0][0]-ptmin)/nbin11*(Double_t)i ; |
128 | if(i<=nbin12 && i>nbin11) binLim1[i]=(Double_t)ptBinEdges[0][0] + (ptBinEdges[1][0]-ptBinEdges[0][0])/(nbin12-nbin11)*((Double_t)i-(Double_t)nbin11) ; | |
129 | if(i<=nbin13 && i>nbin12) binLim1[i]=(Double_t)ptBinEdges[1][0] + (ptmax-ptBinEdges[1][0])/(nbin13-nbin12)*((Double_t)i-(Double_t)nbin12) ; | |
67ebd013 | 130 | } |
67ebd013 | 131 | for(Int_t i=0; i<=nbin2; i++) binLim2[i]=(Double_t)phimin + (phimax-phimin)/nbin2*(Double_t)i ; |
132 | for(Int_t i=0; i<=nbin3; i++) binLim3[i]=(Double_t)etamin + (etamax-etamin)/nbin3*(Double_t)i ; | |
67ebd013 | 133 | |
134 | ||
135 | AliCFContainer* containerPos = new AliCFContainer("containerPos","container for positive tracks",nstep,nvar,iBin); | |
136 | //setting the bin limits | |
137 | containerPos -> SetBinLimits(ipt,binLim1); | |
138 | containerPos -> SetBinLimits(iphi,binLim2); | |
139 | containerPos -> SetBinLimits(ieta,binLim3); | |
fdceab34 | 140 | |
67ebd013 | 141 | AliCFContainer* containerNeg = new AliCFContainer("containerNeg","container for negative tracks",nstep,nvar,iBin); |
fdceab34 | 142 | //setting the bin limits |
67ebd013 | 143 | containerNeg -> SetBinLimits(ipt,binLim1); |
144 | containerNeg -> SetBinLimits(iphi,binLim2); | |
145 | containerNeg -> SetBinLimits(ieta,binLim3); | |
67ebd013 | 146 | |
fdceab34 | 147 | //CREATE THE CUTS ----------------------------------------------- |
148 | //Use AliESDtrackCuts | |
7b90d977 | 149 | AliESDtrackCuts *trackCuts = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts"); |
150 | //Standard Cuts | |
151 | //Set track cuts for global tracks | |
152 | if(trackType==0 && cuts==0) { | |
153 | trackCuts = trackCuts->GetStandardITSTPCTrackCuts2010(kTRUE);//Primary Track Selection | |
154 | trackCuts->SetRequireITSRefit(kTRUE); | |
34fc6450 | 155 | } |
7b90d977 | 156 | if(trackType==0 && cuts==1) { |
34fc6450 | 157 | //Cuts global tracks with ITSrefit requirement |
158 | // TPC | |
159 | trackCuts->SetMinNClustersTPC(70); | |
160 | trackCuts->SetMaxChi2PerClusterTPC(4); | |
161 | trackCuts->SetAcceptKinkDaughters(kFALSE); | |
162 | trackCuts->SetRequireTPCRefit(kTRUE); | |
163 | // ITS | |
164 | trackCuts->SetRequireITSRefit(kTRUE); | |
165 | ||
166 | trackCuts->SetMaxDCAToVertexXYPtDep("0.0182+0.0350/pt^1.01"); | |
167 | trackCuts->SetMaxDCAToVertexZ(2); | |
168 | trackCuts->SetDCAToVertex2D(kFALSE); | |
169 | trackCuts->SetRequireSigmaToVertex(kFALSE); | |
170 | } | |
7b90d977 | 171 | if(trackType==1 && cuts==0) { |
172 | //Set track cuts for TPConly tracks | |
173 | trackCuts = trackCuts->GetStandardTPCOnlyTrackCuts(); | |
174 | trackCuts->SetMinNClustersTPC(70); | |
175 | } | |
176 | if(trackType==2 && cuts==0) { | |
177 | // Set track cuts for TPConly constrained tracks | |
178 | trackCuts = trackCuts->GetStandardTPCOnlyTrackCuts(); | |
179 | trackCuts->SetMinNClustersTPC(70); | |
180 | } | |
10295ac3 | 181 | trackCuts->SetEtaRange(-0.9,0.9); |
182 | trackCuts->SetPtRange(0.15, 1e10); | |
43032097 | 183 | |
ec555a3c | 184 | // Gen-Level kinematic cuts |
fdceab34 | 185 | AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts"); |
67ebd013 | 186 | mcKineCuts->SetPtRange(0.15,1e10); |
fdceab34 | 187 | mcKineCuts->SetRapidityRange(-0.9,0.9);//-0.5,0.5); |
188 | mcKineCuts->SetRequireIsCharged(kTRUE); | |
189 | ||
190 | //Acceptance Cuts | |
191 | AliCFAcceptanceCuts *mcAccCuts = new AliCFAcceptanceCuts("mcAccCuts","MC acceptance cuts"); | |
192 | // mcAccCuts->SetMinNHitITS(mintrackrefsITS); | |
193 | mcAccCuts->SetMinNHitTPC(mintrackrefsTPC); | |
194 | ||
195 | TObjArray* recList = new TObjArray(0); | |
fdceab34 | 196 | TObjArray* secList = new TObjArray(0) ; |
9b58297c | 197 | TObjArray* recMCList = new TObjArray(0); |
fdceab34 | 198 | |
199 | printf("CREATE MC KINE CUTS\n"); | |
200 | TObjArray* mcList = new TObjArray(0) ; | |
201 | mcList->AddLast(mcKineCuts); | |
202 | mcList->AddLast(mcAccCuts); | |
203 | ||
204 | //CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK | |
205 | printf("CREATE INTERFACE AND CUTS\n"); | |
67ebd013 | 206 | AliCFManager* manPos = new AliCFManager("manPos","Manager for Positive tracks") ; |
207 | manPos->SetParticleContainer(containerPos); | |
9b58297c | 208 | manPos->SetParticleCutsList(kStepReconstructed,recList); |
9b58297c | 209 | manPos->SetParticleCutsList(kStepSecondaries,secList); |
210 | manPos->SetParticleCutsList(kStepReconstructedMC,recMCList); | |
211 | manPos->SetParticleCutsList(kStepMCAcceptance,mcList); | |
67ebd013 | 212 | |
213 | AliCFManager* manNeg = new AliCFManager("manNeg","Manager for Negative tracks") ; | |
214 | manNeg->SetParticleContainer(containerNeg); | |
9b58297c | 215 | manNeg->SetParticleCutsList(kStepReconstructed,recList); |
9b58297c | 216 | manNeg->SetParticleCutsList(kStepSecondaries,secList); |
217 | manNeg->SetParticleCutsList(kStepReconstructedMC,recMCList); | |
218 | manNeg->SetParticleCutsList(kStepMCAcceptance,mcList); | |
67ebd013 | 219 | |
220 | ||
221 | printf("Create task AliPWG4HighPtSpectra\n"); | |
aa3ba8d2 | 222 | AliPWG4HighPtSpectra *taskPWG4HighPtSpectra = new AliPWG4HighPtSpectra(Form("AliPWG4HighPtSpectraCent%dTrackType%dCuts%d",centClass,trackType,cuts)); |
34fc6450 | 223 | taskPWG4HighPtSpectra->SetTrackType(trackType); |
fdceab34 | 224 | taskPWG4HighPtSpectra->SetCuts(trackCuts); |
43032097 | 225 | taskPWG4HighPtSpectra->SetCFManagerPos(manPos); //here is set the CF manager + |
226 | taskPWG4HighPtSpectra->SetCFManagerNeg(manNeg); //here is set the CF manager - | |
67ebd013 | 227 | |
7b90d977 | 228 | if(isPbPb) { |
229 | taskPWG4HighPtSpectra->SetIsPbPb(kTRUE); | |
230 | taskPWG4HighPtSpectra->SetCentralityClass(centClass); | |
231 | } | |
232 | taskPWG4HighPtSpectra->SetSigmaConstrainedMax(5.); | |
233 | ||
e50809ff | 234 | |
fdceab34 | 235 | // E. Create ONLY the output containers for the data produced by the task. |
236 | // Get and connect other common input/output containers via the manager as below | |
237 | //============================================================================== | |
238 | ||
43032097 | 239 | //------ output containers ------ |
fdceab34 | 240 | TString outputfile = AliAnalysisManager::GetCommonFileName(); |
7b90d977 | 241 | outputfile += Form(":PWG4_HighPtSpectraCent%dTrackType%dCuts%d",centClass,trackType,cuts); |
10295ac3 | 242 | |
7b90d977 | 243 | AliAnalysisDataContainer *coutput0 = mgr->CreateContainer(Form("chist0HighPtSpectraCent%dTrackType%dCuts%d",centClass,trackType,cuts), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile); |
244 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(Form("ccontainer0HighPtSpectraCent%dTrackType%dCuts%d",centClass,trackType,cuts), AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
245 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(Form("ccontainer1HighPtSpectraCent%dTrackType%dCuts%d",centClass,trackType,cuts), AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
246 | AliAnalysisDataContainer *cout_cuts0 = mgr->CreateContainer(Form("qa_SpectraTrackCutsCent%dTrackType%dCuts%d",centClass,trackType,cuts), AliESDtrackCuts::Class(), AliAnalysisManager::kParamContainer,outputfile); | |
43032097 | 247 | |
fdceab34 | 248 | mgr->AddTask(taskPWG4HighPtSpectra); |
249 | ||
250 | mgr->ConnectInput(taskPWG4HighPtSpectra,0,mgr->GetCommonInputContainer()); | |
251 | mgr->ConnectOutput(taskPWG4HighPtSpectra,0,coutput0); | |
252 | mgr->ConnectOutput(taskPWG4HighPtSpectra,1,coutput1); | |
67ebd013 | 253 | mgr->ConnectOutput(taskPWG4HighPtSpectra,2,coutput2); |
e5abcde9 | 254 | mgr->ConnectOutput(taskPWG4HighPtSpectra,3,cout_cuts0); |
fdceab34 | 255 | |
256 | // Return task pointer at the end | |
257 | return taskPWG4HighPtSpectra; | |
258 | } |