]>
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; | |
6 | const Float_t dcarmin = -0.2; | |
7 | const Float_t dcarmax = 0.2; | |
8 | const Float_t chi2TPCmin = 0.0; | |
d1084bbd | 9 | const Float_t chi2TPCmax = 4.; |
67ebd013 | 10 | |
67ebd013 | 11 | const Int_t mintrackrefsTPC = 1; |
12 | const Int_t mintrackrefsITS = 1; | |
13 | const Int_t charge = 1; | |
fdceab34 | 14 | |
b1cd0099 | 15 | AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra(char *prodType = "LHC10e14") |
fdceab34 | 16 | { |
67ebd013 | 17 | // Creates HighPtSpectra analysis task and adds it to the analysis manager. |
fdceab34 | 18 | |
19 | // A. Get the pointer to the existing analysis manager via the static access method. | |
20 | //============================================================================== | |
21 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
22 | if (!mgr) { | |
23 | Error("AddTaskPWG4HighPtSpectra", "No analysis manager to connect to."); | |
24 | return NULL; | |
25 | } | |
26 | ||
27 | // B. Check the analysis type using the event handlers connected to the analysis | |
28 | // manager. The availability of MC handler can also be checked here. | |
29 | //============================================================================== | |
30 | if (!mgr->GetInputEventHandler()) { | |
67ebd013 | 31 | ::Error("AddTaskPWG4HighPtSpectra", "This task requires an input event handler"); |
fdceab34 | 32 | return NULL; |
33 | } | |
34 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
35 | const char *analysisType = "ESD";//"TPC" | |
36 | ||
37 | // C. Create the task, add it to manager. | |
38 | //=========================================================================== | |
67ebd013 | 39 | //CONTAINER DEFINITION |
fdceab34 | 40 | Info("AliPWG4HighPtSpectra","SETUP CONTAINER"); |
41 | //the sensitive variables, their indices | |
67ebd013 | 42 | UInt_t ipt = 0; |
43 | UInt_t iphi = 1; | |
44 | UInt_t ieta = 2; | |
45 | UInt_t idcar = 3; | |
46 | UInt_t ichi2TPC = 4; | |
47 | ||
fdceab34 | 48 | //Setting up the container grid... |
9b58297c | 49 | UInt_t nstep = 5; //Steps/Modes for containers |
fdceab34 | 50 | Int_t kStepReconstructed = 0; |
51 | Int_t kStepReconstructedTPCOnly = 1; | |
52 | Int_t kStepSecondaries = 2; | |
9b58297c | 53 | Int_t kStepReconstructedMC = 3; |
54 | Int_t kStepMCAcceptance = 4; | |
b1cd0099 | 55 | |
56 | //redefine pt ranges in case of Jet-Jet production | |
57 | Float_t ptBinEdges[2][2]; | |
58 | Float_t ptmin = 2.0 ; | |
59 | Float_t ptmax = 50.0 ; | |
60 | Float_t binWidth3 = 5.; | |
61 | if(!strcmp(prodType, "LHC10e14") || !strcmp(prodType, "PbPb")) { | |
62 | ptmin = 0.0 ; | |
63 | ptmax = 500.0 ; | |
64 | ||
65 | ptBinEdges[0][0] = 100.; | |
66 | ptBinEdges[0][1] = 5.; | |
67 | ptBinEdges[1][0] = 300.; | |
68 | ptBinEdges[1][1] = 10.; | |
69 | binWidth3 = 20.; | |
70 | } else { | |
71 | ptmin = 2.0 ; | |
72 | ptmax = 50.0 ; | |
73 | ||
74 | ptBinEdges[0][0] = 10.; | |
75 | ptBinEdges[0][1] = 1.; | |
76 | ptBinEdges[1][0] = 20.; | |
77 | ptBinEdges[1][1] = 2.; | |
78 | binWidth3 = 5.; | |
79 | } | |
80 | ||
43032097 | 81 | const Int_t nvar = 5; //number of variables on the grid: pt:phi:eta:DCAR:Chi2/NClusTPC |
b1cd0099 | 82 | const Int_t nbin11 = (int)((ptBinEdges[0][0]-ptmin)/ptBinEdges[0][1]); |
83 | const Int_t nbin12 = (int)((ptBinEdges[1][0]-ptBinEdges[0][0])/ptBinEdges[1][1])+nbin11; | |
84 | const Int_t nbin13 = (int)((ptmax-ptBinEdges[1][0])/binWidth3)+nbin12; | |
43032097 | 85 | const Int_t nbin1 = nbin13; //bins in pt |
67ebd013 | 86 | const Int_t nbin2 = 18;//36; //bins in phi |
43032097 | 87 | const Int_t nbin3 = 8; //bins in eta |
9f54dd56 | 88 | const Int_t nbin4 = 40; //bins in DCAR |
d1084bbd | 89 | const Int_t nbin5 = 20; //bins in Chi2/#NclusTPC |
fdceab34 | 90 | |
fdceab34 | 91 | //arrays for the number of bins in each dimension |
92 | Int_t iBin[nvar]; | |
93 | iBin[0]=nbin1; | |
67ebd013 | 94 | iBin[1]=nbin2; |
95 | iBin[2]=nbin3; | |
96 | iBin[3]=nbin4; | |
97 | iBin[4]=nbin5; | |
98 | ||
fdceab34 | 99 | //arrays for lower bounds : |
100 | Double_t *binLim1=new Double_t[nbin1+1]; | |
67ebd013 | 101 | Double_t *binLim2=new Double_t[nbin2+1]; |
102 | Double_t *binLim3=new Double_t[nbin3+1]; | |
103 | Double_t *binLim4=new Double_t[nbin4+1]; | |
104 | Double_t *binLim5=new Double_t[nbin5+1]; | |
105 | ||
106 | //values for bin lower bounds | |
107 | for(Int_t i=0; i<=nbin1; i++) { | |
b1cd0099 | 108 | if(i<=nbin11) binLim1[i]=(Double_t)ptmin + (ptBinEdges[0][0]-ptmin)/nbin11*(Double_t)i ; |
109 | 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) ; | |
110 | 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 | 111 | } |
67ebd013 | 112 | for(Int_t i=0; i<=nbin2; i++) binLim2[i]=(Double_t)phimin + (phimax-phimin)/nbin2*(Double_t)i ; |
113 | for(Int_t i=0; i<=nbin3; i++) binLim3[i]=(Double_t)etamin + (etamax-etamin)/nbin3*(Double_t)i ; | |
114 | for(Int_t i=0; i<=nbin4; i++) binLim4[i]=(Double_t)dcarmin + (dcarmax-dcarmin)/nbin4*(Double_t)i ; | |
115 | for(Int_t i=0; i<=nbin5; i++) binLim5[i]=(Double_t)chi2TPCmin + (chi2TPCmax-chi2TPCmin)/nbin5*(Double_t)i ; | |
116 | ||
117 | ||
118 | AliCFContainer* containerPos = new AliCFContainer("containerPos","container for positive tracks",nstep,nvar,iBin); | |
119 | //setting the bin limits | |
120 | containerPos -> SetBinLimits(ipt,binLim1); | |
121 | containerPos -> SetBinLimits(iphi,binLim2); | |
122 | containerPos -> SetBinLimits(ieta,binLim3); | |
123 | containerPos -> SetBinLimits(idcar,binLim4); | |
124 | containerPos -> SetBinLimits(ichi2TPC,binLim5); | |
fdceab34 | 125 | |
67ebd013 | 126 | AliCFContainer* containerNeg = new AliCFContainer("containerNeg","container for negative tracks",nstep,nvar,iBin); |
fdceab34 | 127 | //setting the bin limits |
67ebd013 | 128 | containerNeg -> SetBinLimits(ipt,binLim1); |
129 | containerNeg -> SetBinLimits(iphi,binLim2); | |
130 | containerNeg -> SetBinLimits(ieta,binLim3); | |
131 | containerNeg -> SetBinLimits(idcar,binLim4); | |
132 | containerNeg -> SetBinLimits(ichi2TPC,binLim5); | |
133 | ||
fdceab34 | 134 | //CREATE THE CUTS ----------------------------------------------- |
135 | //Use AliESDtrackCuts | |
136 | AliESDtrackCuts *trackCuts = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts"); | |
10295ac3 | 137 | trackCuts->SetEtaRange(-0.9,0.9); |
138 | trackCuts->SetPtRange(0.15, 1e10); | |
43032097 | 139 | trackCuts = trackCuts->GetStandardITSTPCTrackCuts2009(kTRUE);//Primary Track Quality Selection for Global tracks |
140 | ||
141 | AliESDtrackCuts *trackCutsTPConly = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts TPC only tracks"); | |
142 | trackCutsTPConly->SetEtaRange(-0.9,0.9); | |
143 | trackCutsTPConly->SetPtRange(0.15, 1e10); | |
144 | trackCutsTPConly = trackCutsTPConly->GetStandardTPCOnlyTrackCuts();//TPC only Track Quality Cuts | |
145 | ||
67ebd013 | 146 | |
147 | // Gen-Level kinematic cuts | |
fdceab34 | 148 | AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts"); |
67ebd013 | 149 | mcKineCuts->SetPtRange(0.15,1e10); |
fdceab34 | 150 | mcKineCuts->SetRapidityRange(-0.9,0.9);//-0.5,0.5); |
151 | mcKineCuts->SetRequireIsCharged(kTRUE); | |
152 | ||
153 | //Acceptance Cuts | |
154 | AliCFAcceptanceCuts *mcAccCuts = new AliCFAcceptanceCuts("mcAccCuts","MC acceptance cuts"); | |
155 | // mcAccCuts->SetMinNHitITS(mintrackrefsITS); | |
156 | mcAccCuts->SetMinNHitTPC(mintrackrefsTPC); | |
157 | ||
158 | TObjArray* recList = new TObjArray(0); | |
fdceab34 | 159 | TObjArray* recTPConlyList = new TObjArray(0); |
160 | TObjArray* secList = new TObjArray(0) ; | |
9b58297c | 161 | TObjArray* recMCList = new TObjArray(0); |
fdceab34 | 162 | |
163 | printf("CREATE MC KINE CUTS\n"); | |
164 | TObjArray* mcList = new TObjArray(0) ; | |
165 | mcList->AddLast(mcKineCuts); | |
166 | mcList->AddLast(mcAccCuts); | |
167 | ||
168 | //CREATE THE INTERFACE TO CORRECTION FRAMEWORK USED IN THE TASK | |
169 | printf("CREATE INTERFACE AND CUTS\n"); | |
67ebd013 | 170 | AliCFManager* manPos = new AliCFManager("manPos","Manager for Positive tracks") ; |
171 | manPos->SetParticleContainer(containerPos); | |
9b58297c | 172 | manPos->SetParticleCutsList(kStepReconstructed,recList); |
173 | manPos->SetParticleCutsList(kStepReconstructedTPCOnly,recTPConlyList); | |
174 | manPos->SetParticleCutsList(kStepSecondaries,secList); | |
175 | manPos->SetParticleCutsList(kStepReconstructedMC,recMCList); | |
176 | manPos->SetParticleCutsList(kStepMCAcceptance,mcList); | |
177 | ||
67ebd013 | 178 | |
179 | AliCFManager* manNeg = new AliCFManager("manNeg","Manager for Negative tracks") ; | |
180 | manNeg->SetParticleContainer(containerNeg); | |
9b58297c | 181 | manNeg->SetParticleCutsList(kStepReconstructed,recList); |
182 | manNeg->SetParticleCutsList(kStepReconstructedTPCOnly,recTPConlyList); | |
183 | manNeg->SetParticleCutsList(kStepSecondaries,secList); | |
184 | manNeg->SetParticleCutsList(kStepReconstructedMC,recMCList); | |
185 | manNeg->SetParticleCutsList(kStepMCAcceptance,mcList); | |
186 | ||
67ebd013 | 187 | |
188 | ||
189 | printf("Create task AliPWG4HighPtSpectra\n"); | |
fdceab34 | 190 | AliPWG4HighPtSpectra *taskPWG4HighPtSpectra = new AliPWG4HighPtSpectra("taskPWG4HighPtSpectra"); |
191 | taskPWG4HighPtSpectra->SetCuts(trackCuts); | |
43032097 | 192 | taskPWG4HighPtSpectra->SetCutsTPConly(trackCutsTPConly); |
193 | taskPWG4HighPtSpectra->SetCFManagerPos(manPos); //here is set the CF manager + | |
194 | taskPWG4HighPtSpectra->SetCFManagerNeg(manNeg); //here is set the CF manager - | |
67ebd013 | 195 | |
e50809ff | 196 | |
fdceab34 | 197 | // E. Create ONLY the output containers for the data produced by the task. |
198 | // Get and connect other common input/output containers via the manager as below | |
199 | //============================================================================== | |
200 | ||
43032097 | 201 | //------ output containers ------ |
fdceab34 | 202 | TString outputfile = AliAnalysisManager::GetCommonFileName(); |
203 | outputfile += ":PWG4_HighPtSpectra"; | |
10295ac3 | 204 | |
67ebd013 | 205 | AliAnalysisDataContainer *coutput0 = mgr->CreateContainer("chist0HighPtSpectra", TList::Class(),AliAnalysisManager::kOutputContainer,outputfile); |
206 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("ccontainer0HighPtSpectra", AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
207 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("ccontainer1HighPtSpectra", AliCFContainer::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
e5abcde9 | 208 | AliAnalysisDataContainer *cout_cuts0 = mgr->CreateContainer("qa_trackCuts", AliESDtrackCuts::Class(), AliAnalysisManager::kParamContainer,outputfile); |
43032097 | 209 | AliAnalysisDataContainer *cout_cuts1 = mgr->CreateContainer("qa_trackCutsTPConly", AliESDtrackCuts::Class(), AliAnalysisManager::kParamContainer,outputfile); |
210 | ||
fdceab34 | 211 | mgr->AddTask(taskPWG4HighPtSpectra); |
212 | ||
213 | mgr->ConnectInput(taskPWG4HighPtSpectra,0,mgr->GetCommonInputContainer()); | |
214 | mgr->ConnectOutput(taskPWG4HighPtSpectra,0,coutput0); | |
215 | mgr->ConnectOutput(taskPWG4HighPtSpectra,1,coutput1); | |
67ebd013 | 216 | mgr->ConnectOutput(taskPWG4HighPtSpectra,2,coutput2); |
e5abcde9 | 217 | mgr->ConnectOutput(taskPWG4HighPtSpectra,3,cout_cuts0); |
43032097 | 218 | mgr->ConnectOutput(taskPWG4HighPtSpectra,4,cout_cuts1); |
fdceab34 | 219 | |
220 | // Return task pointer at the end | |
221 | return taskPWG4HighPtSpectra; | |
222 | } |