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