coverity fix
[u/mrichter/AliRoot.git] / PWG4 / totEt / AliAnalysisHadEtMonteCarlo.cxx
CommitLineData
cf6522d1 1//_________________________________________________________________________
2// Utility Class for transverse energy studies, charged hadrons
3// Base class for MC analysis
4// - MC output
5// implementation file
6//
7//Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili
641e1e0c 8//University of Tennessee at Knoxville
cf6522d1 9//_________________________________________________________________________
641e1e0c 10#include "AliAnalysisHadEtMonteCarlo.h"
11#include "AliAnalysisEtCuts.h"
12
13#include "AliStack.h"
14#include "AliMCEvent.h"
15#include "AliESDEvent.h"
16#include "AliESDtrackCuts.h"
17#include "AliESDpid.h"
4b40b2b1 18#include "AliPID.h"
19#include "AliESDtrack.h"
20#include "AliVParticle.h"
21#include "AliAnalysisTask.h"
22#include "AliAnalysisManager.h"
23#include "AliAnalysisHadEtReconstructed.h"
49b25059 24#include "AliAnalysisHadEtCorrections.h"
4b40b2b1 25#include "AliAnalysisEtCuts.h"
641e1e0c 26#include <iostream>
4b40b2b1 27#include "TRandom.h"
7d2d1773 28#include "AliAnalysisEtCommon.h"
52503ae7 29#include "AliCentrality.h"
0f6416f3 30#include "AliLog.h"
16abb579 31
641e1e0c 32using namespace std;
33
16abb579 34ClassImp(AliAnalysisHadEtMonteCarlo);
35
4b40b2b1 36
0e866ddc 37Int_t AliAnalysisHadEtMonteCarlo::fgNumSmearWidths = 4;
38Float_t AliAnalysisHadEtMonteCarlo::fgSmearWidths[4] = {0.005,0.006,0.007,0.008};
4b40b2b1 39
d6214a64 40AliAnalysisHadEtMonteCarlo::AliAnalysisHadEtMonteCarlo():AliAnalysisHadEt()
0e866ddc 41 ,fSimPiKPEt(0)
4b40b2b1 42 ,fSimHadEt(0)
43 ,fSimTotEt(0)
49b25059 44 ,fSimPiKPEtShouldBeReco(0)
45 ,fSimPiKPEtShouldBeRecoPi(0)
46 ,fSimPiKPEtShouldBeRecoK(0)
47 ,fSimPiKPEtShouldBeRecoP(0)
7d2d1773 48 ,fInvestigateSmearing(0)
49 ,fInvestigateFull(0)
50 ,fInvestigateEMCal(0)
51 ,fInvestigatePHOS(0)
52 ,fInvestigatePiKP(0)
53 ,fRequireITSHits(0)
f43fc416 54 ,fBaryonEnhancement(0)
61e3f555 55 ,fUseRecoPt(0)
0e866ddc 56 ,fPtSmearer(0)
49b25059 57 ,fHadEtReco(0)
d6214a64 58{
4b40b2b1 59}
60AliAnalysisHadEtMonteCarlo::~AliAnalysisHadEtMonteCarlo(){//destructor
0e866ddc 61 if(fPtSmearer) delete fPtSmearer;
d6214a64 62}
4b40b2b1 63
64void AliAnalysisHadEtMonteCarlo::ResetEventValues(){//resetting event variables
d6214a64 65 AliAnalysisHadEt::ResetEventValues();
66 fSimHadEt=0.0;
67 fSimTotEt=0.0;
0e866ddc 68 fSimPiKPEt=0.0;
d6214a64 69}
cf6522d1 70Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
71{ // analyse MC and real event info
641e1e0c 72 FillHisto1D("NEvents",0.5,1);
6a0df78a 73 if(!ev || !ev2){
0f6416f3 74 AliFatal("ERROR: Event does not exist");
6a0df78a 75 return 0;
76 }
641e1e0c 77 AliMCEvent *mcEvent = dynamic_cast<AliMCEvent*>(ev);
78 AliESDEvent *realEvent = dynamic_cast<AliESDEvent*>(ev2);
ec956c46 79 if(!mcEvent || !realEvent){
80 AliFatal("ERROR: mcEvent or realEvent does not exist");
81 return 0;
82 }
641e1e0c 83 AliStack *stack = mcEvent->Stack();
bf205f52 84 fCentBin= -1;
61e3f555 85 fGoodEvent = kTRUE;//for p+p collisions if we made it this far we have a good event
52503ae7 86 if(fDataSet==20100){//If this is Pb+Pb
87 AliCentrality *centrality = realEvent->GetCentrality();
61e3f555 88 if(fNCentBins<21) fCentBin= centrality->GetCentralityClass10(fCentralityMethod);
bf205f52 89 else{ fCentBin= centrality->GetCentralityClass5(fCentralityMethod);}
61e3f555 90 if(fCentBin ==-1) fGoodEvent = kFALSE;//but for Pb+Pb events we don't want to count events where we did not find a centrality
52503ae7 91 }
92 AnalyseEvent(ev);
641e1e0c 93
94 //for PID
ea331c5d 95 AliESDpid *pID = new AliESDpid();//This is identified as a memory leak in valgrind but I delete this object so I think it may be a problem with AliESDpid.
641e1e0c 96
641e1e0c 97 //=============================================
98
99 //Roughly following $ALICE_ROOT/PWG0/dNdEta/AlidNdEtaCorrectionTask
100
101 //=============================================TPC&&ITS=============================================
49b25059 102 //for investigating momentum smearing
103 Float_t pTtotalReco = 0.0;
104 Float_t pTtotalSim = 0.0;
105 Float_t eTtotalSimAll = 0.0;
106 Float_t eTtotalReco = 0.0;
107 Float_t eTtotalRecoEffCorr = 0.0;
108 Float_t eTtotalRecoEffBkgdCorr = 0.0;
109 Float_t eTtotalRecoBkgdCorr = 0.0;
110 Float_t eTtotalRecoUncorr = 0.0;
111 Float_t eTtotalRecoTotalUncorr = 0.0;
112 Float_t eTtotalRecoEffCorrPi = 0.0;
113 Float_t eTtotalRecoEffCorrK = 0.0;
114 Float_t eTtotalRecoEffCorrP = 0.0;
115 Float_t eTtotalRecoBkgd = 0.0;
116 Float_t eTtotalRecoPIDSmeared = 0.0;
117 Float_t eTtotalAsReconstructed = 0.0;
118 Float_t eTBkgdAsReconstructed = 0.0;
119 Float_t eTtotalAsReconstructedPi = 0.0;
120 Float_t eTtotalAsReconstructedP = 0.0;
121 Float_t eTtotalAsReconstructedK = 0.0;
122 Float_t eTtotalSim = 0.0;
123 Int_t nReco = 0;
cf6522d1 124 TString *strTPC = new TString("TPC");
125 TString *strITS = new TString("ITS");
126 TString *strTPCITS = new TString("TPCITS");
7d2d1773 127 Int_t lastcutset = 1;
128 if(fRequireITSHits) lastcutset = 2;
129 for(Int_t cutset=0;cutset<=lastcutset;cutset++){
ea331c5d 130 TString *cutName = NULL;
131 TObjArray* list = NULL;
641e1e0c 132 switch(cutset){
133 case 0:
cf6522d1 134 cutName = strTPC;
135 list = fEsdtrackCutsTPC->GetAcceptedTracks(realEvent);
641e1e0c 136 break;
137 case 1:
cf6522d1 138 cutName = strITS;
139 list = fEsdtrackCutsITS->GetAcceptedTracks(realEvent);
641e1e0c 140 break;
141 case 2:
cf6522d1 142 cutName = strTPCITS;
143 list = fEsdtrackCutsITSTPC->GetAcceptedTracks(realEvent);
641e1e0c 144 break;
145 default:
146 cerr<<"Error: cannot fill histograms!"<<endl;
147 return -1;
148 }
149 Int_t nGoodTracks = list->GetEntries();
150 for (Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++)
151 {
152 AliESDtrack *track = dynamic_cast<AliESDtrack*> (list->At(iTrack));
153 if (!track)
154 {
155 Printf("ERROR: Could not get track %d", iTrack);
156 continue;
157 }
158 else{
641e1e0c 159 Float_t nSigmaPion,nSigmaProton,nSigmaKaon,nSigmaElectron;
7d2d1773 160 pID->MakeTPCPID(track);
161 pID->MakeITSPID(track);
641e1e0c 162 if(cutset!=1){
cf6522d1 163 nSigmaPion = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kPion));
164 nSigmaProton = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kProton));
165 nSigmaKaon = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kKaon));
166 nSigmaElectron = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kElectron));
641e1e0c 167 }
168 else{
cf6522d1 169 nSigmaPion = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kPion));
170 nSigmaProton = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kProton));
171 nSigmaKaon = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kKaon));
172 nSigmaElectron = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kElectron));
641e1e0c 173 }
6a0df78a 174// bool isPion = (nSigmaPion<3.0 && nSigmaProton>2.0 && nSigmaKaon>2.0);
175// bool isElectron = (nSigmaElectron<2.0 && nSigmaPion>4.0 && nSigmaProton>3.0 && nSigmaKaon>3.0);
176// bool isKaon = (nSigmaPion>3.0 && nSigmaProton>2.0 && nSigmaKaon<2.0);
177// bool isProton = (nSigmaPion>3.0 && nSigmaProton<2.0 && nSigmaKaon>2.0);
cf6522d1 178 bool isPion = (nSigmaPion<3.0 && nSigmaProton>2.0 && nSigmaKaon>2.0);
179 bool isElectron = (nSigmaElectron<2.0 && nSigmaPion>4.0 && nSigmaProton>3.0 && nSigmaKaon>3.0);
701b4621 180 bool isKaon = (nSigmaPion>3.0 && nSigmaProton>3.0 && nSigmaKaon<3.0 && track->Pt()<0.45);
181 bool isProton = (nSigmaPion>3.0 && nSigmaProton<3.0 && nSigmaKaon>3.0 && track->Pt()<0.9);
641e1e0c 182
49b25059 183 bool unidentified = (!isProton && !isKaon && !isElectron && !isPion);
184 if(cutset==1){//ITS dE/dx identification requires tighter cuts on the tracks and we don't gain much from that so we won't do it
185 unidentified = true;
186 isPion=false;
187 isElectron=false;
188 isKaon=false;
189 isProton=false;
190 }
641e1e0c 191 Float_t dEdx = track->GetTPCsignal();
192 if(cutset==1) dEdx = track->GetITSsignal();
193
cf6522d1 194 FillHisto2D(Form("dEdxAll%s",cutName->Data()),track->P(),dEdx,1.0);
641e1e0c 195
196 UInt_t label = (UInt_t)TMath::Abs(track->GetLabel());
197 TParticle *simPart = stack->Particle(label);
198 if(!simPart) {
199 Printf("no MC particle\n");
200 continue;
201 }
202 else{//analysis
49b25059 203 if(fInvestigateSmearing && cutset==2){
204 //calculates what we would measure for the pi/k/p et with background
205 eTtotalRecoTotalUncorr += Et(simPart);
206 if(isPion){
207 eTtotalRecoEffBkgdCorr += Et(simPart) *fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionPion(track->Pt(),fCentBin) * fHadEtReco->GetCorrections()->GetBackgroundCorrectionTPC(track->Pt());
208 eTtotalRecoBkgdCorr += Et(simPart) * fHadEtReco->GetCorrections()->GetBackgroundCorrectionTPC(track->Pt());
209 eTtotalRecoTotalUncorr += Et(simPart);
210 }
211 if(isProton){
212 eTtotalRecoEffBkgdCorr += Et(simPart) *fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionProton(track->Pt(),fCentBin) * fHadEtReco->GetCorrections()->GetBackgroundCorrectionTPC(track->Pt());
213 eTtotalRecoBkgdCorr += Et(simPart) * fHadEtReco->GetCorrections()->GetBackgroundCorrectionTPC(track->Pt());
214 }
215 if(isKaon){
216 eTtotalRecoEffBkgdCorr += Et(simPart) *fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionKaon(track->Pt(),fCentBin) * fHadEtReco->GetCorrections()->GetBackgroundCorrectionTPC(track->Pt());
217 eTtotalRecoBkgdCorr += Et(simPart) * fHadEtReco->GetCorrections()->GetBackgroundCorrectionTPC(track->Pt());
218 }
219 if(unidentified){
220 eTtotalRecoEffBkgdCorr += Et(simPart) *fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionHadron(track->Pt(),fCentBin) * fHadEtReco->GetCorrections()->GetBackgroundCorrectionTPC(track->Pt());
221 eTtotalRecoBkgdCorr += Et(simPart) * fHadEtReco->GetCorrections()->GetBackgroundCorrectionTPC(track->Pt());
222 }
223 //for calculating et as it's done in the reconstructed data
224 Float_t corrBkgd=0.0;
225 Float_t corrNotID=0.0;
226 Float_t corrNoID=0.0;// = fHadEtReco->GetCorrections()->GetNotIDCorrectionNoPID(track->Pt());
227 Float_t corrEff = 0.0;
228 Float_t corrEffNoID = 0.0;
229 Float_t et = 0.0;
230 if(cutset==2){//TPC
231 corrBkgd = fHadEtReco->GetCorrections()->GetBackgroundCorrectionTPC(track->Pt());
232 corrEffNoID = fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionHadron(track->Pt(),fCentBin);
233 corrNotID = fHadEtReco->GetCorrections()->GetNotIDConstCorrectionTPC();
234 corrNoID = fHadEtReco->GetCorrections()->GetNotIDConstCorrectionTPCNoID();
235 }
236 if(cutset==1){//ITS
237 corrBkgd = fHadEtReco->GetCorrections()->GetBackgroundCorrectionITS(track->Pt());
238 corrEffNoID = fHadEtReco->GetCorrections()->GetITSEfficiencyCorrectionHadron(track->Pt(),fCentBin);
239 corrNotID = fHadEtReco->GetCorrections()->GetNotIDConstCorrectionITS();
240 corrNoID = fHadEtReco->GetCorrections()->GetNotIDConstCorrectionITSNoID();
241 }
242
243 bool isprimary = stack->IsPhysicalPrimary(label);
244 if (TMath::Abs(track->Eta()) < fHadEtReco->GetCorrections()->GetEtaCut()){
245 if(isPion){
246 et = Et(track->P(),track->Theta(),fgPiPlusCode,track->Charge());
247 corrEff = fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionPion(track->Pt(),fCentBin);
248 if(isprimary){
249 eTtotalAsReconstructed += et*corrBkgd*corrEff*corrNotID;
250 }
251 else{
252 eTBkgdAsReconstructed += et*corrBkgd*corrEff*corrNotID;
253 }
254 }
255 if(isKaon){
256 et = Et(track->P(),track->Theta(),fgKPlusCode,track->Charge());
257 corrEff = fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionKaon(track->Pt(),fCentBin);
258 if(isprimary){
259 eTtotalAsReconstructed += et*corrBkgd*corrEff*corrNotID;
260 }
261 else{
262 eTBkgdAsReconstructed += et*corrBkgd*corrEff*corrNotID;
263 }
264 }
265 if(isProton){
266 et = Et(track->P(),track->Theta(),fgProtonCode,track->Charge());
267 corrEff = fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionProton(track->Pt(),fCentBin);
268 if(isprimary){
269 eTtotalAsReconstructed += et*corrBkgd*corrEff*corrNotID;
270 }
271 else{
272 eTBkgdAsReconstructed += et*corrBkgd*corrEff*corrNotID;
273 }
274 }
275 if(unidentified){
276 et = Et(track->P(),track->Theta(),fgPiPlusCode,track->Charge());
277 corrEff = fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionHadron(track->Pt(),fCentBin);
278 if(isprimary){
279 eTtotalAsReconstructed += et*corrBkgd*corrEff*corrNotID;
280 }
281 else{
282 eTBkgdAsReconstructed += et*corrBkgd*corrEff*corrNotID;
283 }
284 }
285 if(!isPion && !isProton && !isKaon && !unidentified){
286 eTBkgdAsReconstructed += et*corrBkgd*corrEff*corrNotID;
287 }
288 Int_t pdgCode = simPart->GetPDG(0)->PdgCode();
289 if(pdgCode==fgPiPlusCode ||pdgCode==fgPiMinusCode){eTtotalAsReconstructedPi+=et*corrBkgd*corrEff*corrNotID;}
290 if(pdgCode==fgKPlusCode ||pdgCode==fgKMinusCode){eTtotalAsReconstructedK+=et*corrBkgd*corrEff*corrNotID;}
291 if(pdgCode==fgProtonCode ||pdgCode==fgAntiProtonCode){eTtotalAsReconstructedP+=et*corrBkgd*corrEff*corrNotID;}
292 }
293 }
294
295 if(cutset==2) eTtotalSimAll += Et(simPart);
641e1e0c 296 if(stack->IsPhysicalPrimary(label)){
49b25059 297 if (TMath::Abs(simPart->Eta()) < fHadEtReco->GetCorrections()->GetEtaCut()){
641e1e0c 298 Int_t pdgCode = simPart->GetPDG(0)->PdgCode();
299 Int_t mypid = 0;
7d2d1773 300 if(pdgCode==AliAnalysisHadEt::fgPiPlusCode) mypid = 1;
4b40b2b1 301 if(pdgCode==fgProtonCode) mypid = 2;
302 if(pdgCode==fgKPlusCode) mypid = 3;
303 if(pdgCode==fgEPlusCode) mypid = 4;
304 if(pdgCode==fgPiMinusCode) mypid = 1;
305 if(pdgCode==fgAntiProtonCode) mypid = 2;
306 if(pdgCode==fgKMinusCode) mypid = 3;
307 if(pdgCode==fgEMinusCode) mypid = 4;
641e1e0c 308 bool filled = false;
49b25059 309 //for smearing investigations
310 if(fInvestigateSmearing && cutset==2){
311 pTtotalReco += simPart->Pt();
312 pTtotalSim += track->Pt();
313 eTtotalReco += Et(track->P(),track->Theta(),pdgCode,track->Charge());
314 eTtotalSim += Et(simPart);
315 nReco++;
316 }
641e1e0c 317 //============Charged hadrons===================================
49b25059 318 float myefficiencyCorrEt = 0.0;
641e1e0c 319 //identified...
cf6522d1 320 if(isPion){
4b40b2b1 321 if(pdgCode!=fgPiPlusCode && pdgCode!=fgPiMinusCode){
cf6522d1 322 FillHisto2D(Form("MisidentifiedPIDs%s",cutName->Data()),1,mypid,1);
641e1e0c 323 }
324 float myEt = Et(simPart);
49b25059 325 if(fInvestigateSmearing && cutset==2){
326 eTtotalRecoPIDSmeared +=myEt;
327 eTtotalRecoEffCorr += myEt *fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionPion(track->Pt(),fCentBin);
328 myefficiencyCorrEt = myEt * fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionPion(track->Pt(),fCentBin) ;
329 }
cf6522d1 330 if(track->Charge()>0){ FillHisto2D(Form("EtReconstructed%sIdentifiedPiPlus",cutName->Data()),track->Pt(),track->Eta(),myEt);}
331 else{ FillHisto2D(Form("EtReconstructed%sIdentifiedPiMinus",cutName->Data()),track->Pt(),track->Eta(),myEt);}
332 FillHisto2D(Form("dEdxPion%s",cutName->Data()),track->P(),dEdx,1.0);
641e1e0c 333 }
cf6522d1 334 if(isProton){
4b40b2b1 335 if(pdgCode!=fgProtonCode && pdgCode!=fgAntiProtonCode){
cf6522d1 336 FillHisto2D(Form("MisidentifiedPIDs%s",cutName->Data()),2,mypid,1);
641e1e0c 337 }
338 float myEt = Et(simPart);
49b25059 339 if(fInvestigateSmearing && cutset==2){
340 eTtotalRecoPIDSmeared +=myEt;
341 eTtotalRecoEffCorr += myEt *fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionProton(track->Pt(),fCentBin);
342 myefficiencyCorrEt = myEt * fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionProton(track->Pt(),fCentBin);
343 }
cf6522d1 344 if(track->Charge()>0){ FillHisto2D(Form("EtReconstructed%sIdentifiedProton",cutName->Data()),track->Pt(),track->Eta(),myEt);}
345 else{ FillHisto2D(Form("EtReconstructed%sIdentifiedAntiProton",cutName->Data()),track->Pt(),track->Eta(),myEt);}
f43fc416 346 if(fBaryonEnhancement){
347 myEt = myEt*ProtonBaryonEnhancement(track->Pt());
348 if(track->Charge()>0){ FillHisto2D(Form("EtReconstructed%sIdentifiedProtonEnhanced",cutName->Data()),track->Pt(),track->Eta(),myEt);}
349 else{ FillHisto2D(Form("EtReconstructed%sIdentifiedAntiProtonEnhanced",cutName->Data()),track->Pt(),track->Eta(),myEt);}
350 }
cf6522d1 351 FillHisto2D(Form("dEdxProton%s",cutName->Data()),track->P(),dEdx,1.0);
641e1e0c 352 }
cf6522d1 353 if(isKaon){
4b40b2b1 354 if(pdgCode!=fgKMinusCode && pdgCode!=fgKPlusCode){
cf6522d1 355 FillHisto2D(Form("MisidentifiedPIDs%s",cutName->Data()),3,mypid,1);
641e1e0c 356 }
357 float myEt = Et(simPart);
49b25059 358 if(fInvestigateSmearing && cutset==2){
359 eTtotalRecoPIDSmeared +=myEt;
360 eTtotalRecoEffCorr += myEt *fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionKaon(track->Pt(),fCentBin);
361 myefficiencyCorrEt = myEt * fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionKaon(track->Pt(),fCentBin);
362 }
cf6522d1 363 if(track->Charge()>0){ FillHisto2D(Form("EtReconstructed%sIdentifiedKPlus",cutName->Data()),track->Pt(),track->Eta(),myEt);}
364 else{ FillHisto2D(Form("EtReconstructed%sIdentifiedKMinus",cutName->Data()),track->Pt(),track->Eta(),myEt);}
365 FillHisto2D(Form("dEdxKaon%s",cutName->Data()),track->P(),dEdx,1.0);
641e1e0c 366 }
cf6522d1 367 if(isElectron){
4b40b2b1 368 if(pdgCode!=fgEMinusCode && pdgCode!=fgEPlusCode){
cf6522d1 369 FillHisto2D(Form("MisidentifiedPIDs%s",cutName->Data()),4,mypid,1);
641e1e0c 370 }
371 float myEt = Et(simPart);
cf6522d1 372 if(track->Charge()>0){ FillHisto2D(Form("EtReconstructed%sIdentifiedEPlus",cutName->Data()),track->Pt(),track->Eta(),myEt);}
373 else{ FillHisto2D(Form("EtReconstructed%sIdentifiedEMinus",cutName->Data()),track->Pt(),track->Eta(),myEt);}
374 FillHisto2D(Form("dEdxElectron%s",cutName->Data()),track->P(),dEdx,1.0);
641e1e0c 375 }
cf6522d1 376 if(unidentified){
4b40b2b1 377 if(pdgCode!=fgEMinusCode && pdgCode!=fgEPlusCode){
378 float myEtPi = Et(simPart,fgPionMass);
86d9d0dc 379 float myEtP = Et(simPart,fgProtonMass);
380 float myEtK = Et(simPart,fgKaonMass);
641e1e0c 381 float myEt = Et(simPart);
49b25059 382 if(fInvestigateSmearing && cutset==2){
383 eTtotalRecoPIDSmeared +=myEtPi;
384 eTtotalRecoEffCorr += myEt *fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionHadron(track->Pt(),fCentBin);
385 myefficiencyCorrEt = myEt * fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionHadron(track->Pt(),fCentBin);
386 }
cf6522d1 387 FillHisto2D(Form("EtReconstructed%sUnidentifiedAssumingPion",cutName->Data()),track->Pt(),track->Eta(),myEtPi);
86d9d0dc 388 FillHisto2D(Form("EtReconstructed%sUnidentifiedAssumingProton",cutName->Data()),track->Pt(),track->Eta(),myEtP);
389 FillHisto2D(Form("EtReconstructed%sUnidentifiedAssumingKaon",cutName->Data()),track->Pt(),track->Eta(),myEtK);
cf6522d1 390 FillHisto2D(Form("EtReconstructed%sUnidentified",cutName->Data()),track->Pt(),track->Eta(),myEt);
391 FillHisto2D(Form("EtNReconstructed%sUnidentified",cutName->Data()),track->Pt(),track->Eta(),1.0);
f43fc416 392 if(pdgCode == fgPiPlusCode||pdgCode == fgPiMinusCode){
393 FillHisto2D(Form("EtReconstructed%sUnidentifiedPionAssumingPion",cutName->Data()),track->Pt(),track->Eta(),myEtPi);
86d9d0dc 394 FillHisto2D(Form("EtReconstructed%sUnidentifiedPionAssumingProton",cutName->Data()),track->Pt(),track->Eta(),myEtP);
395 FillHisto2D(Form("EtReconstructed%sUnidentifiedPionAssumingKaon",cutName->Data()),track->Pt(),track->Eta(),myEtK);
904048b2 396 FillHisto2D(Form("EtReconstructed%sUnidentifiedPion",cutName->Data()),track->Pt(),track->Eta(),myEt);
f43fc416 397 FillHisto2D(Form("EtNReconstructed%sUnidentifiedPion",cutName->Data()),track->Pt(),track->Eta(),1.0);
398 }
399 if(pdgCode == fgKPlusCode||pdgCode == fgKMinusCode){
400 FillHisto2D(Form("EtReconstructed%sUnidentifiedKaonAssumingPion",cutName->Data()),track->Pt(),track->Eta(),myEtPi);
86d9d0dc 401 FillHisto2D(Form("EtReconstructed%sUnidentifiedKaonAssumingProton",cutName->Data()),track->Pt(),track->Eta(),myEtP);
402 FillHisto2D(Form("EtReconstructed%sUnidentifiedKaonAssumingKaon",cutName->Data()),track->Pt(),track->Eta(),myEtK);
904048b2 403 FillHisto2D(Form("EtReconstructed%sUnidentifiedKaon",cutName->Data()),track->Pt(),track->Eta(),myEt);
f43fc416 404 FillHisto2D(Form("EtNReconstructed%sUnidentifiedKaon",cutName->Data()),track->Pt(),track->Eta(),1.0);
405 }
406 if(pdgCode == fgProtonCode||pdgCode == fgAntiProtonCode){
407 FillHisto2D(Form("EtReconstructed%sUnidentifiedProtonAssumingPion",cutName->Data()),track->Pt(),track->Eta(),myEtPi);
86d9d0dc 408 FillHisto2D(Form("EtReconstructed%sUnidentifiedProtonAssumingProton",cutName->Data()),track->Pt(),track->Eta(),myEtP);
409 FillHisto2D(Form("EtReconstructed%sUnidentifiedProtonAssumingKaon",cutName->Data()),track->Pt(),track->Eta(),myEtK);
904048b2 410 FillHisto2D(Form("EtReconstructed%sUnidentifiedProton",cutName->Data()),track->Pt(),track->Eta(),myEt);
f43fc416 411 FillHisto2D(Form("EtNReconstructed%sUnidentifiedProton",cutName->Data()),track->Pt(),track->Eta(),1.0);
412 if(fBaryonEnhancement){
413 myEt = myEt*ProtonBaryonEnhancement(track->Pt());
414 FillHisto2D(Form("EtReconstructed%sUnidentifiedProtonAssumingPionEnhanced",cutName->Data()),track->Pt(),track->Eta(),myEtPi);
904048b2 415 FillHisto2D(Form("EtReconstructed%sUnidentifiedProtonEnhanced",cutName->Data()),track->Pt(),track->Eta(),myEt);
f43fc416 416 FillHisto2D(Form("EtNReconstructed%sUnidentifiedProtonEnhanced",cutName->Data()),track->Pt(),track->Eta(),1.0);
417 }
418 }
641e1e0c 419 }
cf6522d1 420 FillHisto2D(Form("dEdxUnidentified%s",cutName->Data()),track->P(),dEdx,1.0);
cf6522d1 421 FillHisto1D(Form("UnidentifiedPIDs%s",cutName->Data()),mypid,1);
641e1e0c 422 }
423 //...simulated
61e3f555 424 float myEtSim = Et(simPart);
425 float myEtReco = 0.0;
7d2d1773 426 if(pdgCode == fgPiPlusCode){
641e1e0c 427 float myEt = Et(simPart);
86d9d0dc 428 float myEtP = Et(simPart,fgProtonMass);
429 float myEtK = Et(simPart,fgKaonMass);
61e3f555 430 myEtReco = Et(track->P(),track->Theta(),fgPiPlusCode,track->Charge());
431 float pT = simPart->Pt();
432 float eta = simPart->Eta();
49b25059 433 if(fInvestigateSmearing && cutset==2){
434 eTtotalRecoEffCorrPi+=myefficiencyCorrEt;
435 eTtotalRecoUncorr +=myEt;
436 }
61e3f555 437 if(fUseRecoPt){//Then we switch the pT and the Et
438 myEt = myEtReco;
439 pT = track->Pt();
440 eta = track->Eta();
441 }
442 FillHisto2D(Form("EtReconstructed%sPiPlus",cutName->Data()),pT,eta,myEt);
443 FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
444 FillHisto2D(Form("EtNReconstructed%sPiPlus",cutName->Data()),pT,eta,myEt);
445 FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
bf205f52 446 if(fCentBin>=0){//if a centrality bin was defined
61e3f555 447 FillHisto2D(Form("EtNReconstructed%sPiPlusCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
448 FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
52503ae7 449 }
61e3f555 450 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEt);
451 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEtP);
452 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingKaon",cutName->Data()),pT,eta,myEtK);
453 FillHisto2D(Form("EtReconstructed%sPiPlusAssumingKaon",cutName->Data()),pT,eta,myEtK);
454 FillHisto2D(Form("EtReconstructed%sPiPlusAssumingProton",cutName->Data()),pT,eta,myEtP);
641e1e0c 455 filled = true;
456 }
4b40b2b1 457 if(pdgCode == fgPiMinusCode){
641e1e0c 458 float myEt = Et(simPart);
86d9d0dc 459 float myEtP = Et(simPart,fgProtonMass);
460 float myEtK = Et(simPart,fgKaonMass);
61e3f555 461 myEtReco = Et(track->P(),track->Theta(),fgPiMinusCode,track->Charge());
462 float pT = simPart->Pt();
463 float eta = simPart->Eta();
49b25059 464 if(fInvestigateSmearing && cutset==2){
465 eTtotalRecoEffCorrPi+=myefficiencyCorrEt;
466 eTtotalRecoUncorr +=myEt;
467 }
61e3f555 468 if(fUseRecoPt){//Then we switch the pT and the Et
469 myEt = myEtReco;
470 pT = track->Pt();
471 eta = track->Eta();
472 }
473 FillHisto2D(Form("EtReconstructed%sPiMinus",cutName->Data()),pT,eta,myEt);
474 FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
475 FillHisto2D(Form("EtNReconstructed%sPiMinus",cutName->Data()),pT,eta,myEt);
476 FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
bf205f52 477 if(fCentBin>=0){//if a centrality bin was defined
61e3f555 478 FillHisto2D(Form("EtNReconstructed%sPiMinusCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
479 FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
52503ae7 480 }
61e3f555 481 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEt);
482 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEtP);
483 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingKaon",cutName->Data()),pT,eta,myEtK);
484 FillHisto2D(Form("EtReconstructed%sPiMinusAssumingKaon",cutName->Data()),pT,eta,myEtK);
485 FillHisto2D(Form("EtReconstructed%sPiMinusAssumingProton",cutName->Data()),pT,eta,myEtP);
641e1e0c 486 filled = true;
487 }
4b40b2b1 488 if(pdgCode == fgKPlusCode){
641e1e0c 489 float myEt = Et(simPart);
4b40b2b1 490 float myEtPi = Et(simPart,fgPionMass);
86d9d0dc 491 float myEtP = Et(simPart,fgProtonMass);
61e3f555 492 myEtReco = Et(track->P(),track->Theta(),fgKPlusCode,track->Charge());
493 float pT = simPart->Pt();
494 float eta = simPart->Eta();
495 if(fUseRecoPt){//Then we switch the pT and the Et
496 myEt = myEtReco;
497 pT = track->Pt();
498 eta = track->Eta();
499 }
49b25059 500 if(fInvestigateSmearing && cutset==2){
501 eTtotalRecoEffCorrK+=myefficiencyCorrEt;
502 eTtotalRecoUncorr +=myEt;
503 }
61e3f555 504 FillHisto2D(Form("EtReconstructed%sKPlus",cutName->Data()),pT,eta,myEt);
505 FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
506 FillHisto2D(Form("EtNReconstructed%sKPlus",cutName->Data()),pT,eta,myEt);
507 FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
bf205f52 508 if(fCentBin>=0){//if a centrality bin was defined
61e3f555 509 FillHisto2D(Form("EtNReconstructed%sKPlusCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
510 FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
52503ae7 511 }
61e3f555 512 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEtPi);
513 FillHisto2D(Form("EtReconstructed%sKPlusAssumingPion",cutName->Data()),pT,eta,myEtPi);
514 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingKaon",cutName->Data()),pT,eta,myEt);
515 FillHisto2D(Form("EtReconstructed%sKPlusAssumingKaon",cutName->Data()),pT,eta,myEt);
516 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEtP);
517 FillHisto2D(Form("EtReconstructed%sKPlusAssumingProton",cutName->Data()),pT,eta,myEtP);
641e1e0c 518 filled = true;
519 }
4b40b2b1 520 if(pdgCode == fgKMinusCode){
641e1e0c 521 float myEt = Et(simPart);
4b40b2b1 522 float myEtPi = Et(simPart,fgPionMass);
86d9d0dc 523 float myEtP = Et(simPart,fgProtonMass);
61e3f555 524 myEtReco = Et(track->P(),track->Theta(),fgKMinusCode,track->Charge());
525 float pT = simPart->Pt();
526 float eta = simPart->Eta();
527 if(fUseRecoPt){//Then we switch the pT and the Et
528 myEt = myEtReco;
529 pT = track->Pt();
530 eta = track->Eta();
531 }
49b25059 532 if(fInvestigateSmearing && cutset==2){
533 eTtotalRecoEffCorrK+=myefficiencyCorrEt;
534 eTtotalRecoUncorr +=myEt;
535 }
61e3f555 536 FillHisto2D(Form("EtReconstructed%sKMinus",cutName->Data()),pT,eta,myEt);
537 FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
538 FillHisto2D(Form("EtNReconstructed%sKMinus",cutName->Data()),pT,eta,myEt);
539 FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
bf205f52 540 if(fCentBin>=0){//if a centrality bin was defined
61e3f555 541 FillHisto2D(Form("EtNReconstructed%sKMinusCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
542 FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
52503ae7 543 }
61e3f555 544 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEtPi);
545 FillHisto2D(Form("EtReconstructed%sKMinusAssumingPion",cutName->Data()),pT,eta,myEtPi);
546 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingKaon",cutName->Data()),pT,eta,myEt);
547 FillHisto2D(Form("EtReconstructed%sKMinusAssumingKaon",cutName->Data()),pT,eta,myEt);
548 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEtP);
549 FillHisto2D(Form("EtReconstructed%sKMinusAssumingProton",cutName->Data()),pT,eta,myEtP);
641e1e0c 550 filled = true;
551 }
4b40b2b1 552 if(pdgCode == fgProtonCode){
641e1e0c 553 float myEt = Et(simPart);
4b40b2b1 554 float myEtPi = Et(simPart,fgPionMass);
86d9d0dc 555 float myEtK = Et(simPart,fgKaonMass);
61e3f555 556 myEtReco = Et(track->P(),track->Theta(),fgProtonCode,track->Charge());
557 float pT = simPart->Pt();
558 float eta = simPart->Eta();
559 if(fUseRecoPt){//Then we switch the pT and the Et
560 myEt = myEtReco;
561 pT = track->Pt();
562 eta = track->Eta();
563 }
49b25059 564 if(fInvestigateSmearing && cutset==2){
565 eTtotalRecoEffCorrP+=myefficiencyCorrEt;
566 eTtotalRecoUncorr +=myEt;
567 }
61e3f555 568 FillHisto2D(Form("EtReconstructed%sProton",cutName->Data()),pT,eta,myEt);
569 FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
570 FillHisto2D(Form("EtNReconstructed%sProton",cutName->Data()),pT,eta,myEt);
571 FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
bf205f52 572 if(fCentBin>=0){//if a centrality bin was defined
61e3f555 573 FillHisto2D(Form("EtNReconstructed%sProtonCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
574 FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
52503ae7 575 }
61e3f555 576 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEtPi);
577 FillHisto2D(Form("EtReconstructed%sProtonAssumingPion",cutName->Data()),pT,eta,myEtPi);
578 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingKaon",cutName->Data()),pT,eta,myEtK);
579 FillHisto2D(Form("EtReconstructed%sProtonAssumingKaon",cutName->Data()),pT,eta,myEtK);
580 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEt);
581 FillHisto2D(Form("EtReconstructed%sProtonAssumingProton",cutName->Data()),pT,eta,myEt);
641e1e0c 582 filled = true;
f43fc416 583
61e3f555 584 if(fBaryonEnhancement){
585 float enhancement = ProtonBaryonEnhancement(track->Pt());
586 FillHisto2D(Form("EtReconstructed%sProtonEnhanced",cutName->Data()),pT,eta,myEt*enhancement);
587 FillHisto2D(Form("EtNReconstructed%sProtonEnhanced",cutName->Data()),pT,eta,myEt*enhancement);
588 FillHisto2D(Form("EtReconstructed%sProtonAssumingPionEnhanced",cutName->Data()),pT,eta,myEtPi*enhancement);
589 }
f43fc416 590
641e1e0c 591 }
4b40b2b1 592 if(pdgCode == fgAntiProtonCode){
641e1e0c 593 float myEt = Et(simPart);
4b40b2b1 594 float myEtPi = Et(simPart,fgPionMass);
86d9d0dc 595 float myEtK = Et(simPart,fgKaonMass);
61e3f555 596 myEtReco = Et(track->P(),track->Theta(),fgAntiProtonCode,track->Charge());
597 float pT = simPart->Pt();
598 float eta = simPart->Eta();
599 if(fUseRecoPt){//Then we switch the pT and the Et
600 myEt = myEtReco;
601 pT = track->Pt();
602 eta = track->Eta();
603 }
49b25059 604 if(fInvestigateSmearing && cutset==2){
605 eTtotalRecoEffCorrP+=myefficiencyCorrEt;
606 eTtotalRecoUncorr +=myEt;
607 }
61e3f555 608 FillHisto2D(Form("EtReconstructed%sAntiProton",cutName->Data()),pT,eta,myEt);
609 FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
610 FillHisto2D(Form("EtNReconstructed%sAntiProton",cutName->Data()),pT,eta,myEt);
611 FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
bf205f52 612 if(fCentBin>=0){//if a centrality bin was defined
61e3f555 613 FillHisto2D(Form("EtNReconstructed%sAntiProtonCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
614 FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
52503ae7 615 }
61e3f555 616 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEtPi);
617 FillHisto2D(Form("EtReconstructed%sAntiProtonAssumingPion",cutName->Data()),pT,eta,myEtPi);
618 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingKaon",cutName->Data()),pT,eta,myEtK);
619 FillHisto2D(Form("EtReconstructed%sAntiProtonAssumingKaon",cutName->Data()),pT,eta,myEtK);
620 FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEt);
621 FillHisto2D(Form("EtReconstructed%sAntiProtonAssumingProton",cutName->Data()),pT,eta,myEt);
641e1e0c 622 filled = true;
f43fc416 623 if(fBaryonEnhancement){
624 float enhancement = ProtonBaryonEnhancement(track->Pt());
61e3f555 625 FillHisto2D(Form("EtReconstructed%sAntiProtonEnhanced",cutName->Data()),pT,eta,myEt*enhancement);
626 FillHisto2D(Form("EtNReconstructed%sAntiProtonEnhanced",cutName->Data()),pT,eta,myEt*enhancement);
627 FillHisto2D(Form("EtReconstructed%sAntiProtonAssumingPionEnhanced",cutName->Data()),pT,eta,myEtPi*enhancement);
f43fc416 628 }
641e1e0c 629 }
4b40b2b1 630 if(pdgCode == fgEPlusCode){
641e1e0c 631 float myEt = Et(simPart);
cf6522d1 632 FillHisto2D(Form("EtReconstructed%sEPlus",cutName->Data()),simPart->Pt(),simPart->Eta(),myEt);
633 if(!isElectron || unidentified){
4b40b2b1 634 float myEtPi = Et(simPart,fgPionMass);
cf6522d1 635 FillHisto2D(Form("EtReconstructed%sMisidentifiedElectrons",cutName->Data()),track->Pt(),track->Eta(),myEtPi);
641e1e0c 636 }
637 filled = true;
638 }
4b40b2b1 639 if(pdgCode == fgEMinusCode){
cf6522d1 640 if(!isElectron || unidentified){
4b40b2b1 641 float myEtPi = Et(simPart,fgPionMass);
cf6522d1 642 FillHisto2D(Form("EtReconstructed%sMisidentifiedElectrons",cutName->Data()),track->Pt(),track->Eta(),myEtPi);
641e1e0c 643 }
644 float myEt = Et(simPart);
49b25059 645 FillHisto2D(Form("EtReconstructed%sEMinus",cutName->Data()),simPart->Pt(),simPart->Eta(),myEt);
646 filled = true;
641e1e0c 647 }
61e3f555 648 if(myEtReco>0.0){FillHisto2D(Form("ETresolution%s",cutName->Data()),myEtReco,(myEtSim-myEtReco)/myEtReco,1.0);}
649 if(track->Pt()>0.0){FillHisto2D(Form("pTresolution%s",cutName->Data()),track->Pt(),(simPart->Pt() - track->Pt())/track->Pt(),1.0);}
650 if(track->P()>0.0){FillHisto2D(Form("presolution%s",cutName->Data()),track->P(),(simPart->P() - track->P())/track->P(),1.0);}
651 FillHisto1D(Form("pTsim%s",cutName->Data()),simPart->Pt(),1.0);
652 FillHisto1D(Form("pTrec%s",cutName->Data()),track->Pt(),1.0);
653 if(fCentBin!=-1){
654 FillHisto1D(Form("pTsim%sCB%i",cutName->Data(),fCentBin),simPart->Pt(),1.0);
655 FillHisto1D(Form("pTrec%sCB%i",cutName->Data(),fCentBin),track->Pt(),1.0);
656 }
657
641e1e0c 658 }
641e1e0c 659 }
660 else{//not a primary - we're after V0 daughters!
49b25059 661 bool written = false;
662 //now, what is the et we would measure for this? Since this is the relevant et.
663 float myrecoEt = 0;
664 if(isPion || unidentified) myrecoEt = Et(track->P(),track->Theta(),fgPiPlusCode,track->Charge());
665 if(isProton) myrecoEt = Et(track->P(),track->Theta(),fgProtonCode,track->Charge());
666 if(isKaon) myrecoEt = Et(track->P(),track->Theta(),fgKPlusCode,track->Charge());
667 if (TMath::Abs(simPart->Eta()) < fHadEtReco->GetCorrections()->GetEtaCut()){
0e866ddc 668 TParticle *mom = stack->Particle(simPart->GetFirstMother());
669 if(mom){
670 TParticlePDG *pc = mom->GetPDG(0);
671 if(pc){
672 Int_t pdgCode = mom->GetPDG(0)->PdgCode();
673 if(pdgCode == fgLambdaCode){
49b25059 674 written = true;
0e866ddc 675 float myEt = Et(simPart);
61e3f555 676 float pT = simPart->Pt();
677 float eta = simPart->Eta();
49b25059 678 eTtotalRecoBkgd+=myEt;
61e3f555 679 if(fUseRecoPt){//Then we switch the pT and the Et
680 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
681 pT = track->Pt();
682 eta = track->Eta();
683 }
49b25059 684 FillHisto2D(Form("EtReconstructed%sLambdaDaughters",cutName->Data()),pT,eta,myrecoEt);
0f97be4c 685 Float_t weight = LambdaWeight(mom->Pt());
f43fc416 686 if(fBaryonEnhancement){
687 float enhancement = ProtonBaryonEnhancement(track->Pt());
688 weight = weight*enhancement;
689 }
49b25059 690 FillHisto2D(Form("EtReconstructed%sLambdaDaughtersReweighted",cutName->Data()),pT,eta,myrecoEt*weight);
0e866ddc 691 }
692 if(pdgCode == fgAntiLambdaCode){
49b25059 693 written = true;
0e866ddc 694 float myEt = Et(simPart);
61e3f555 695 float pT = simPart->Pt();
696 float eta = simPart->Eta();
49b25059 697 eTtotalRecoBkgd+=myEt;
61e3f555 698 if(fUseRecoPt){//Then we switch the pT and the Et
699 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
700 pT = track->Pt();
701 eta = track->Eta();
702 }
49b25059 703 FillHisto2D(Form("EtReconstructed%sAntiLambdaDaughters",cutName->Data()),pT,eta,myrecoEt);
0f97be4c 704 Float_t weight = AntiLambdaWeight(mom->Pt());
f43fc416 705 if(fBaryonEnhancement){
706 float enhancement = ProtonBaryonEnhancement(track->Pt());
707 weight = weight*enhancement;
708 }
49b25059 709 FillHisto2D(Form("EtReconstructed%sAntiLambdaDaughtersReweighted",cutName->Data()),pT,eta,myrecoEt*weight);
0e866ddc 710 }
49b25059 711 if(pdgCode == fgK0SCode || pdgCode == fgK0LCode || pdgCode == fgKPlusCode || pdgCode == fgKMinusCode){//actually get all kaon daughters
712 written = true;
0e866ddc 713 float myEt = Et(simPart);
61e3f555 714 float pT = simPart->Pt();
715 float eta = simPart->Eta();
49b25059 716 eTtotalRecoBkgd+=myEt;
61e3f555 717 if(fUseRecoPt){//Then we switch the pT and the Et
718 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
719 pT = track->Pt();
720 eta = track->Eta();
721 }
722 FillHisto2D(Form("EtReconstructed%sK0SDaughters",cutName->Data()),pT,eta,myEt);
0f97be4c 723 Float_t weight = K0Weight(mom->Pt());
49b25059 724 FillHisto2D(Form("EtReconstructed%sK0SDaughtersReweighted",cutName->Data()),pT,eta,myrecoEt*weight);
0e866ddc 725 }
726 if(pdgCode == fgXiCode){
49b25059 727 written = true;
0e866ddc 728 float myEt = Et(simPart);
61e3f555 729 float pT = simPart->Pt();
730 float eta = simPart->Eta();
49b25059 731 eTtotalRecoBkgd+=myEt;
61e3f555 732 if(fUseRecoPt){//Then we switch the pT and the Et
733 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
734 pT = track->Pt();
735 eta = track->Eta();
736 }
49b25059 737 FillHisto2D(Form("EtReconstructed%sXiDaughters",cutName->Data()),pT,eta,myrecoEt);
0e866ddc 738 }
739 if(pdgCode == fgAntiXiCode){
49b25059 740 written = true;
0e866ddc 741 float myEt = Et(simPart);
61e3f555 742 float pT = simPart->Pt();
743 float eta = simPart->Eta();
49b25059 744 eTtotalRecoBkgd+=myEt;
61e3f555 745 if(fUseRecoPt){//Then we switch the pT and the Et
746 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
747 pT = track->Pt();
748 eta = track->Eta();
749 }
49b25059 750 FillHisto2D(Form("EtReconstructed%sAntiXiDaughters",cutName->Data()),pT,eta,myrecoEt);
0e866ddc 751 }
752 if(pdgCode == fgOmegaCode){
49b25059 753 written = true;
0e866ddc 754 float myEt = Et(simPart);
61e3f555 755 float pT = simPart->Pt();
756 float eta = simPart->Eta();
49b25059 757 eTtotalRecoBkgd+=myEt;
61e3f555 758 if(fUseRecoPt){//Then we switch the pT and the Et
759 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
760 pT = track->Pt();
761 eta = track->Eta();
762 }
49b25059 763 FillHisto2D(Form("EtReconstructed%sOmegaDaughters",cutName->Data()),pT,eta,myrecoEt);
0e866ddc 764 }
765 if(pdgCode == fgXiCode){
49b25059 766 written = true;
0e866ddc 767 float myEt = Et(simPart);
61e3f555 768 float pT = simPart->Pt();
769 float eta = simPart->Eta();
49b25059 770 eTtotalRecoBkgd+=myEt;
61e3f555 771 if(fUseRecoPt){//Then we switch the pT and the Et
772 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
773 pT = track->Pt();
774 eta = track->Eta();
775 }
49b25059 776 FillHisto2D(Form("EtReconstructed%sAntiOmegaDaughters",cutName->Data()),pT,eta,myrecoEt);
0e866ddc 777 }
641e1e0c 778
0e866ddc 779 if(mom->GetFirstMother()>0){
780 TParticle *grandma = stack->Particle(mom->GetFirstMother());
781 if(grandma){
782 Int_t pdgCodeMom = mom->GetPDG(0)->PdgCode();
783 if(pdgCodeMom==fgPiPlusCode || pdgCodeMom==fgPiMinusCode || pdgCodeMom==fgProtonCode ||pdgCodeMom==fgAntiProtonCode || pdgCodeMom==fgKPlusCode || pdgCode==fgKMinusCode){
0e866ddc 784 Int_t pdgCodeGrandma = grandma->GetPDG(0)->PdgCode();
641e1e0c 785
0e866ddc 786 if(pdgCodeGrandma == fgXiCode){
49b25059 787 written = true;
0e866ddc 788 float myEt = Et(simPart);
61e3f555 789 float pT = simPart->Pt();
790 float eta = simPart->Eta();
49b25059 791 eTtotalRecoBkgd+=myEt;
61e3f555 792 if(fUseRecoPt){//Then we switch the pT and the Et
793 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
794 pT = track->Pt();
795 eta = track->Eta();
796 }
49b25059 797 FillHisto2D(Form("EtReconstructed%sXiDaughters",cutName->Data()),pT,eta,myrecoEt);
0e866ddc 798 }
799 if(pdgCodeGrandma == fgAntiXiCode){
49b25059 800 written = true;
0e866ddc 801 float myEt = Et(simPart);
61e3f555 802 float pT = simPart->Pt();
803 float eta = simPart->Eta();
49b25059 804 eTtotalRecoBkgd+=myEt;
61e3f555 805 if(fUseRecoPt){//Then we switch the pT and the Et
806 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
807 pT = track->Pt();
808 eta = track->Eta();
809 }
49b25059 810 FillHisto2D(Form("EtReconstructed%sAntiXiDaughters",cutName->Data()),pT,eta,myrecoEt);
0e866ddc 811 }
812 if(pdgCodeGrandma == fgOmegaCode){
49b25059 813 written = true;
0e866ddc 814 float myEt = Et(simPart);
61e3f555 815 float pT = simPart->Pt();
816 float eta = simPart->Eta();
49b25059 817 eTtotalRecoBkgd+=myEt;
61e3f555 818 if(fUseRecoPt){//Then we switch the pT and the Et
819 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
820 pT = track->Pt();
821 eta = track->Eta();
822 }
49b25059 823 FillHisto2D(Form("EtReconstructed%sOmegaDaughters",cutName->Data()),pT,eta,myrecoEt);
0e866ddc 824 }
825 if(pdgCodeGrandma == fgXiCode){
49b25059 826 written = true;
0e866ddc 827 float myEt = Et(simPart);
61e3f555 828 float pT = simPart->Pt();
829 float eta = simPart->Eta();
49b25059 830 eTtotalRecoBkgd+=myEt;
61e3f555 831 if(fUseRecoPt){//Then we switch the pT and the Et
832 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
833 pT = track->Pt();
834 eta = track->Eta();
835 }
49b25059 836 FillHisto2D(Form("EtReconstructed%sAntiOmegaDaughters",cutName->Data()),pT,eta,myrecoEt);
0e866ddc 837 }
641e1e0c 838
0e866ddc 839 }
641e1e0c 840 }
841 }
49b25059 842 if(!written){
843 int mycode = simPart->GetPDG(0)->PdgCode();
844 if( (pdgCode == fgGammaCode || pdgCode == fgPi0Code) && (mycode==fgEPlusCode||mycode==fgEMinusCode)){
845 written = true;
846 float myEt = Et(simPart);
847 float pT = simPart->Pt();
848 float eta = simPart->Eta();
849 eTtotalRecoBkgd+=myEt;
850 if(fUseRecoPt){//Then we switch the pT and the Et
851 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
852 pT = track->Pt();
853 eta = track->Eta();
854 }
855 FillHisto2D(Form("EtReconstructed%sConversionElectrons",cutName->Data()),pT,eta,myrecoEt);
856 }
857 if(mycode==fgMuPlusCode || mycode==fgMuMinusCode){
858 written = true;
859 float myEt = Et(simPart);
860 float pT = simPart->Pt();
861 float eta = simPart->Eta();
862 eTtotalRecoBkgd+=myEt;
863 if(fUseRecoPt){//Then we switch the pT and the Et
864 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
865 pT = track->Pt();
866 eta = track->Eta();
867 }
868 FillHisto2D(Form("EtReconstructed%sSecondaryMuons",cutName->Data()),pT,eta,myrecoEt);
869 }
870 if(mycode==fgPiPlusCode || mycode==fgPiMinusCode){
871 written = true;
872 float myEt = Et(simPart);
873 float pT = simPart->Pt();
874 float eta = simPart->Eta();
875 eTtotalRecoBkgd+=myEt;
876 if(fUseRecoPt){//Then we switch the pT and the Et
877 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
878 pT = track->Pt();
879 eta = track->Eta();
880 }
881 FillHisto2D(Form("EtReconstructed%sSecondaryPions",cutName->Data()),pT,eta,myrecoEt);
882 }
883 if(mycode==fgAntiProtonCode || mycode==fgProtonCode){
884 written = true;
885 float myEt = Et(simPart);
886 float pT = simPart->Pt();
887 float eta = simPart->Eta();
888 eTtotalRecoBkgd+=myEt;
889 if(fUseRecoPt){//Then we switch the pT and the Et
890 myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
891 pT = track->Pt();
892 eta = track->Eta();
893 }
894 FillHisto2D(Form("EtReconstructed%sSecondaryProtons",cutName->Data()),pT,eta,myrecoEt);
895 }
896 //if(!written) cout<<"I was not counted in the background and I am a "<<simPart->GetName()<<" and my mother is a "<<mom->GetName()<<endl;
897 }
641e1e0c 898 }
49b25059 899 else{cout<<"No particle code!! 657"<<endl;}
641e1e0c 900 }
49b25059 901 else{cout<<"No mother particle!! 658"<<endl;}
641e1e0c 902 }
903 }
904 }
905
906 }
907 }
908 delete list;
909 }
49b25059 910 if(fInvestigateSmearing){
911 if(fSimPiKPEtShouldBeReco>0.0) FillHisto2D("SimPiKPEtMinusSimEffCorrRecoOnly",fSimPiKPEtShouldBeReco,(fSimPiKPEtShouldBeReco-eTtotalRecoEffCorr)/fSimPiKPEtShouldBeReco,1.0);
912 if(fSimPiKPEtShouldBeReco>0.0) FillHisto2D("SimPiKPEtMinusSimEffBkgdCorrRecoOnly",fSimPiKPEtShouldBeReco,(fSimPiKPEtShouldBeReco-eTtotalRecoEffBkgdCorr)/fSimPiKPEtShouldBeReco,1.0);
913 if(fSimPiKPEtShouldBeRecoPi>0.0) FillHisto2D("SimPiKPEtMinusSimEffCorrRecoPiOnly",fSimPiKPEtShouldBeRecoPi,(fSimPiKPEtShouldBeRecoPi-eTtotalRecoEffCorrPi)/fSimPiKPEtShouldBeRecoPi,1.0);
914 if(fSimPiKPEtShouldBeRecoP>0.0) FillHisto2D("SimPiKPEtMinusSimEffCorrRecoPOnly",fSimPiKPEtShouldBeRecoP,(fSimPiKPEtShouldBeRecoP-eTtotalRecoEffCorrP)/fSimPiKPEtShouldBeRecoP,1.0);
915 if(fSimPiKPEtShouldBeRecoK>0.0) FillHisto2D("SimPiKPEtMinusSimEffCorrRecoKOnly",fSimPiKPEtShouldBeRecoK,(fSimPiKPEtShouldBeRecoK-eTtotalRecoEffCorrK)/fSimPiKPEtShouldBeRecoK,1.0);
916 if(eTtotalSim>0.0) FillHisto2D("SimPiKPEtMinusSimAllCorrSmearedRecoOnly",eTtotalSim,(eTtotalSim-eTtotalSimAll+eTtotalRecoBkgd)/eTtotalSim,1.0);
917 if(eTtotalRecoTotalUncorr>0.0) FillHisto2D("SimPiKPEtMeasMinusEtRealPiKP",eTtotalRecoTotalUncorr,(eTtotalRecoTotalUncorr-eTtotalRecoUncorr)/eTtotalRecoTotalUncorr,1.0);
918 if(eTtotalSim>0.0) FillHisto2D("SimPiKPEtMinusSimAllSmearedRecoOnly",eTtotalSim,(eTtotalSim-eTtotalSimAll)/eTtotalSim,1.0);
919 if(eTtotalSim>0.0) FillHisto2D("SimPiKPEtMinusSimPIDSmearedRecoOnly",eTtotalSim,(eTtotalSim-eTtotalRecoPIDSmeared*1.01)/eTtotalSim,1.0);
920 if(eTtotalSim>0.0) FillHisto2D("SimPiKPEtMinusSimSmearedRecoOnly",eTtotalSim,(eTtotalSim-eTtotalReco)/eTtotalSim,1.0);
921 if(pTtotalSim>0.0) FillHisto2D("SimPiKPPtMinusSimSmearedRecoOnly",pTtotalSim,(pTtotalSim-pTtotalReco)/pTtotalSim,1.0);
922 if(eTtotalSim>0.0) FillHisto2D("SimPiKPEtMinusSimSmearedMultRecoOnly",nReco,(eTtotalSim-eTtotalReco)/eTtotalSim,1.0);
923 if(pTtotalSim>0.0) FillHisto2D("SimPiKPPtMinusSimSmearedMultRecoOnly",nReco,(pTtotalSim-pTtotalReco)/pTtotalSim,1.0);
924 }
464aa50c 925 delete pID;
926 delete strTPC;
927 delete strITS;
928 delete strTPCITS;
641e1e0c 929 return 1;
930}
931Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
cf6522d1 932{ // analyse MC event
641e1e0c 933 ResetEventValues();
6a0df78a 934 if(!ev){
0f6416f3 935 AliFatal("ERROR: Event does not exist");
6a0df78a 936 return 0;
937 }
641e1e0c 938
939 // Get us an mc event
940 AliMCEvent *mcEvent = dynamic_cast<AliMCEvent*>(ev);
ec956c46 941 if(!mcEvent){
942 AliFatal("ERROR: MC Event does not exist");
943 return 0;
944 }
641e1e0c 945 // Let's play with the stack!
946 AliStack *stack = mcEvent->Stack();
947
948 Int_t nPrim = stack->GetNtrack();
949
0e866ddc 950 Float_t fSimPiKPEtPtSmeared = 0;
951 Float_t fSimPiKPEtEfficiencySmeared = 0;
952 Float_t fSimPiKPEtPtCutSmearedTPC = 0;
953 Float_t fSimPiKPEtPtCutSmearedITS = 0;
954 Float_t fSimPiKPEtPIDSmeared = 0;
955 Float_t fSimPiKPEtPIDSmearedNoID = 0;
49b25059 956 fSimPiKPEtShouldBeReco = 0;
957 fSimPiKPEtShouldBeRecoPi = 0;
958 fSimPiKPEtShouldBeRecoK = 0;
959 fSimPiKPEtShouldBeRecoP = 0;
641e1e0c 960 //=================Tracks which may or may not have been reconstructed=================
961
962 for (Int_t iPart = 0; iPart < nPrim; iPart++)
963 {
964
ea331c5d 965 TParticle *part = stack->Particle(iPart);//This line is identified as a loss of memory by valgrind, however, the pointer still belongs to the stack, so it's the stack's problem
641e1e0c 966
967 if (!part)
968 {
969 Printf("ERROR: Could not get particle %d", iPart);
970 continue;
971 }
641e1e0c 972 // Check if it is a primary particle
f427cbed 973 if (stack->IsPhysicalPrimary(iPart)){//primaries
641e1e0c 974
49b25059 975 if (TMath::Abs(part->Eta()) < fHadEtReco->GetCorrections()->GetEtaCut()) {
641e1e0c 976
977 Int_t pdgCode = part->GetPDG(0)->PdgCode();
641e1e0c 978 bool filled = false;
0e866ddc 979 //Investigating smearing...
980 //Numbers are realistic correction factors from previous studies
7d2d1773 981 if(fInvestigateSmearing){
982 if(pdgCode==fgPiPlusCode ||pdgCode==fgPiMinusCode ||pdgCode==fgKPlusCode ||pdgCode==fgKMinusCode ||pdgCode==fgProtonCode ||pdgCode==fgAntiProtonCode){
983 //To investigate Smearing...
984 Float_t myet = Et(part);
985 fSimPiKPEt += myet;
986 Float_t theta = part->Theta();
987 Short_t charge = 1;
988 Float_t momentum = part->P();
989 //pt smearing
990 Float_t pSmeared = momentum * fPtSmearer->Gaus(1,0.005);//Gaussian centered around 1
991 fSimPiKPEtPtSmeared += Et(pSmeared,theta,pdgCode,charge);
992 //Efficiency smearing
61e3f555 993 //to mock up the difference between TPC only tracks in p+p (~90% efficiency at high pT) and TPC+ITS tracks in Pb+Pb (about 70% efficiency at high pT) a factor of 7/9 was added in front
994 float efficiency = 7.0/9.0*2.26545*TMath::Exp(-TMath::Power(9.99977e-01/part->Pt(),7.85488e-02));//simple rough efficiency from fitting curve
7d2d1773 995 if(fPtSmearer->Binomial(1,efficiency) ==1){
996 fSimPiKPEtEfficiencySmeared += (1.0/efficiency)*myet;
997 }
998 //pT cut smeared
61e3f555 999 if(part->Pt()>0.10){fSimPiKPEtPtCutSmearedITS +=1.00988*myet;}
1000 if(part->Pt()>0.15){fSimPiKPEtPtCutSmearedTPC +=1.02994*myet;}
7d2d1773 1001 //PID smearing
61e3f555 1002 fSimPiKPEtPIDSmearedNoID += 1.03018015790601458*Et(momentum,theta,fgPiPlusCode,charge);
7d2d1773 1003 if(part->P()<1.0){//then the particle would have been ID'd
61e3f555 1004 fSimPiKPEtPIDSmeared += 1.00918051514628582*myet;
7d2d1773 1005 }
1006 else{//Then it would have been assumed to be a pion
61e3f555 1007 fSimPiKPEtPIDSmeared += 1.00918051514628582*Et(momentum,theta,fgPiPlusCode,charge);
7d2d1773 1008 }
0e866ddc 1009 }
1010 }
1011
641e1e0c 1012 //============Charged hadrons===================================
4b40b2b1 1013 if(pdgCode == fgPiPlusCode){
641e1e0c 1014 float myEt = Et(part);
86d9d0dc 1015 float myEtP = Et(part,fgProtonMass);
1016 float myEtK = Et(part,fgKaonMass);
49b25059 1017 if(part->Pt()>0.15) fSimPiKPEtShouldBeReco += myEt;
1018 if(part->Pt()>0.15) fSimPiKPEtShouldBeRecoPi += myEt;
0e866ddc 1019
d6214a64 1020 fSimHadEt += myEt;
1021 fSimTotEt += myEt;
0e866ddc 1022
641e1e0c 1023 FillHisto2D("EtSimulatedPiPlus",part->Pt(),part->Eta(),myEt);
1024 FillHisto2D("EtNSimulatedPiPlus",part->Pt(),part->Eta(),1.0);
1025 FillHisto2D("EtSimulatedChargedHadron",part->Pt(),part->Eta(),myEt);
1026 FillHisto2D("EtNSimulatedChargedHadron",part->Pt(),part->Eta(),1.0);
bf205f52 1027 if(fCentBin>=0){//if a centrality bin was defined
1028 FillHisto2D(Form("EtNSimulatedPiPlusCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
1029 FillHisto2D(Form("EtNSimulatedChargedHadronCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
52503ae7 1030 }
641e1e0c 1031 FillHisto2D("EtSimulatedChargedHadronAssumingPion",part->Pt(),part->Eta(),myEt);
86d9d0dc 1032 FillHisto2D("EtSimulatedChargedHadronAssumingProton",part->Pt(),part->Eta(),myEtP);
1033 FillHisto2D("EtSimulatedPiPlusAssumingProton",part->Pt(),part->Eta(),myEtP);
1034 FillHisto2D("EtSimulatedChargedHadronAssumingKaon",part->Pt(),part->Eta(),myEtK);
1035 FillHisto2D("EtSimulatedPiPlusAssumingKaon",part->Pt(),part->Eta(),myEtK);
641e1e0c 1036 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
0e866ddc 1037 Short_t charge = 1;
1038 Float_t myEtLow = Et(0.0,part->Theta(),pdgCode,charge);
1039 Float_t myEtITS = Et(0.10/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1040 Float_t myEtTPC = Et(0.15/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1041 FillHisto2D("EtSimulatedChargedHadronAssumingNoPt",part->Pt(),part->Eta(),myEtLow);
1042 FillHisto2D("EtSimulatedChargedHadronAssumingPtTPCCut",part->Pt(),part->Eta(),myEtTPC);
1043 FillHisto2D("EtSimulatedChargedHadronAssumingPtITSCut",part->Pt(),part->Eta(),myEtITS);
641e1e0c 1044 filled = true;
1045 }
4b40b2b1 1046 if(pdgCode == fgPiMinusCode){
641e1e0c 1047 float myEt = Et(part);
86d9d0dc 1048 float myEtP = Et(part,fgProtonMass);
1049 float myEtK = Et(part,fgKaonMass);
49b25059 1050 if(part->Pt()>0.15) fSimPiKPEtShouldBeReco += myEt;
1051 if(part->Pt()>0.15) fSimPiKPEtShouldBeRecoPi += myEt;
d6214a64 1052 fSimHadEt += myEt;
1053 fSimTotEt += myEt;
641e1e0c 1054 FillHisto2D("EtSimulatedPiMinus",part->Pt(),part->Eta(),myEt);
1055 FillHisto2D("EtNSimulatedPiMinus",part->Pt(),part->Eta(),1.0);
1056 FillHisto2D("EtSimulatedChargedHadron",part->Pt(),part->Eta(),myEt);
1057 FillHisto2D("EtNSimulatedChargedHadron",part->Pt(),part->Eta(),1.0);
bf205f52 1058 if(fCentBin>=0){//if a centrality bin was defined
1059 FillHisto2D(Form("EtNSimulatedPiMinusCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
1060 FillHisto2D(Form("EtNSimulatedChargedHadronCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
52503ae7 1061 }
641e1e0c 1062 FillHisto2D("EtSimulatedChargedHadronAssumingPion",part->Pt(),part->Eta(),myEt);
86d9d0dc 1063 FillHisto2D("EtSimulatedChargedHadronAssumingProton",part->Pt(),part->Eta(),myEtP);
1064 FillHisto2D("EtSimulatedPiMinusAssumingProton",part->Pt(),part->Eta(),myEtP);
1065 FillHisto2D("EtSimulatedChargedHadronAssumingKaon",part->Pt(),part->Eta(),myEtK);
1066 FillHisto2D("EtSimulatedPiMinusAssumingKaon",part->Pt(),part->Eta(),myEtK);
641e1e0c 1067 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
0e866ddc 1068 Short_t charge = -1;
1069 Float_t myEtLow = Et(0.0,part->Theta(),pdgCode,charge);
1070 Float_t myEtITS = Et(0.10/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1071 Float_t myEtTPC = Et(0.15/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1072 FillHisto2D("EtSimulatedChargedHadronAssumingNoPt",part->Pt(),part->Eta(),myEtLow);
1073 FillHisto2D("EtSimulatedChargedHadronAssumingPtTPCCut",part->Pt(),part->Eta(),myEtTPC);
1074 FillHisto2D("EtSimulatedChargedHadronAssumingPtITSCut",part->Pt(),part->Eta(),myEtITS);
641e1e0c 1075 filled = true;
1076 }
4b40b2b1 1077 if(pdgCode == fgKPlusCode){
641e1e0c 1078 float myEt = Et(part);
4b40b2b1 1079 float myEtPi = Et(part,fgPionMass);
86d9d0dc 1080 float myEtP = Et(part,fgProtonMass);
49b25059 1081 if(part->Pt()>0.15) fSimPiKPEtShouldBeReco += myEt;
1082 if(part->Pt()>0.15) fSimPiKPEtShouldBeRecoK += myEt;
d6214a64 1083 fSimHadEt += myEt;
1084 fSimTotEt += myEt;
641e1e0c 1085 FillHisto2D("EtSimulatedKPlus",part->Pt(),part->Eta(),myEt);
1086 FillHisto2D("EtNSimulatedKPlus",part->Pt(),part->Eta(),1.0);
1087 FillHisto2D("EtSimulatedChargedHadron",part->Pt(),part->Eta(),myEt);
1088 FillHisto2D("EtNSimulatedChargedHadron",part->Pt(),part->Eta(),1.0);
bf205f52 1089 if(fCentBin>=0){//if a centrality bin was defined
1090 FillHisto2D(Form("EtNSimulatedKPlusCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
1091 FillHisto2D(Form("EtNSimulatedChargedHadronCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
52503ae7 1092 }
641e1e0c 1093 FillHisto2D("EtSimulatedChargedHadronAssumingPion",part->Pt(),part->Eta(),myEtPi);
1094 FillHisto2D("EtSimulatedKPlusAssumingPion",part->Pt(),part->Eta(),myEtPi);
86d9d0dc 1095 FillHisto2D("EtSimulatedChargedHadronAssumingProton",part->Pt(),part->Eta(),myEtP);
1096 FillHisto2D("EtSimulatedKPlusAssumingProton",part->Pt(),part->Eta(),myEtP);
641e1e0c 1097 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
0e866ddc 1098 Short_t charge = 1;
1099 Float_t myEtLow = Et(0.0,part->Theta(),pdgCode,charge);
1100 Float_t myEtITS = Et(0.10/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1101 Float_t myEtTPC = Et(0.15/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1102 FillHisto2D("EtSimulatedChargedHadronAssumingNoPt",part->Pt(),part->Eta(),myEtLow);
1103 FillHisto2D("EtSimulatedChargedHadronAssumingPtTPCCut",part->Pt(),part->Eta(),myEtTPC);
1104 FillHisto2D("EtSimulatedChargedHadronAssumingPtITSCut",part->Pt(),part->Eta(),myEtITS);
641e1e0c 1105 filled = true;
1106 }
4b40b2b1 1107 if(pdgCode == fgKMinusCode){
641e1e0c 1108 float myEt = Et(part);
4b40b2b1 1109 float myEtPi = Et(part,fgPionMass);
86d9d0dc 1110 float myEtP = Et(part,fgProtonMass);
49b25059 1111 if(part->Pt()>0.15) fSimPiKPEtShouldBeReco += myEt;
1112 if(part->Pt()>0.15) fSimPiKPEtShouldBeRecoK += myEt;
d6214a64 1113 fSimHadEt += myEt;
1114 fSimTotEt += myEt;
641e1e0c 1115 FillHisto2D("EtSimulatedKMinus",part->Pt(),part->Eta(),myEt);
1116 FillHisto2D("EtNSimulatedKMinus",part->Pt(),part->Eta(),1.0);
1117 FillHisto2D("EtSimulatedChargedHadron",part->Pt(),part->Eta(),myEt);
1118 FillHisto2D("EtNSimulatedChargedHadron",part->Pt(),part->Eta(),1.0);
bf205f52 1119 if(fCentBin>=0){//if a centrality bin was defined
1120 FillHisto2D(Form("EtNSimulatedKMinusCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
1121 FillHisto2D(Form("EtNSimulatedChargedHadronCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
52503ae7 1122 }
641e1e0c 1123 FillHisto2D("EtSimulatedChargedHadronAssumingPion",part->Pt(),part->Eta(),myEtPi);
1124 FillHisto2D("EtSimulatedKMinusAssumingPion",part->Pt(),part->Eta(),myEtPi);
86d9d0dc 1125 FillHisto2D("EtSimulatedChargedHadronAssumingProton",part->Pt(),part->Eta(),myEtP);
1126 FillHisto2D("EtSimulatedKMinusAssumingProton",part->Pt(),part->Eta(),myEtP);
641e1e0c 1127 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
0e866ddc 1128 Short_t charge = -1;
1129 Float_t myEtLow = Et(0.0,part->Theta(),pdgCode,charge);
1130 Float_t myEtITS = Et(0.10/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1131 Float_t myEtTPC = Et(0.15/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1132 FillHisto2D("EtSimulatedChargedHadronAssumingNoPt",part->Pt(),part->Eta(),myEtLow);
1133 FillHisto2D("EtSimulatedChargedHadronAssumingPtTPCCut",part->Pt(),part->Eta(),myEtTPC);
1134 FillHisto2D("EtSimulatedChargedHadronAssumingPtITSCut",part->Pt(),part->Eta(),myEtITS);
641e1e0c 1135 filled = true;
1136 }
4b40b2b1 1137 if(pdgCode == fgProtonCode){
641e1e0c 1138 float myEt = Et(part);
4b40b2b1 1139 float myEtPi = Et(part,fgPionMass);
86d9d0dc 1140 float myEtK = Et(part,fgKaonMass);
49b25059 1141 if(part->Pt()>0.15) fSimPiKPEtShouldBeReco += myEt;
1142 if(part->Pt()>0.15) fSimPiKPEtShouldBeRecoP += myEt;
d6214a64 1143 fSimHadEt += myEt;
1144 fSimTotEt += myEt;
641e1e0c 1145 FillHisto2D("EtSimulatedProton",part->Pt(),part->Eta(),myEt);
1146 FillHisto2D("EtNSimulatedProton",part->Pt(),part->Eta(),1.0);
1147 FillHisto2D("EtSimulatedChargedHadron",part->Pt(),part->Eta(),myEt);
1148 FillHisto2D("EtNSimulatedChargedHadron",part->Pt(),part->Eta(),1.0);
bf205f52 1149 if(fCentBin>=0){//if a centrality bin was defined
1150 FillHisto2D(Form("EtNSimulatedProtonCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
1151 FillHisto2D(Form("EtNSimulatedChargedHadronCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
52503ae7 1152 }
641e1e0c 1153 FillHisto2D("EtSimulatedChargedHadronAssumingPion",part->Pt(),part->Eta(),myEtPi);
1154 FillHisto2D("EtSimulatedProtonAssumingPion",part->Pt(),part->Eta(),myEtPi);
86d9d0dc 1155 FillHisto2D("EtSimulatedChargedHadronAssumingKaon",part->Pt(),part->Eta(),myEtK);
1156 FillHisto2D("EtSimulatedProtonAssumingKaon",part->Pt(),part->Eta(),myEtK);
641e1e0c 1157 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
0e866ddc 1158 Short_t charge = 1;
1159 Float_t myEtLow = Et(0.0,part->Theta(),pdgCode,charge);
1160 Float_t myEtITS = Et(0.10/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1161 Float_t myEtTPC = Et(0.15/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1162 FillHisto2D("EtSimulatedChargedHadronAssumingNoPt",part->Pt(),part->Eta(),myEtLow);
1163 FillHisto2D("EtSimulatedChargedHadronAssumingPtTPCCut",part->Pt(),part->Eta(),myEtTPC);
1164 FillHisto2D("EtSimulatedChargedHadronAssumingPtITSCut",part->Pt(),part->Eta(),myEtITS);
641e1e0c 1165 filled = true;
f43fc416 1166 if(fBaryonEnhancement){
1167 float enhancement = ProtonBaryonEnhancement(part->Pt());
1168 FillHisto2D("EtSimulatedProtonEnhanced",part->Pt(),part->Eta(),myEt*enhancement);
1169 FillHisto2D("EtNSimulatedProtonEnhanced",part->Pt(),part->Eta(),1.0*enhancement);
1170 FillHisto2D("EtSimulatedProtonAssumingPionEnhanced",part->Pt(),part->Eta(),myEtPi*enhancement);
1171 }
641e1e0c 1172 }
4b40b2b1 1173 if(pdgCode == fgAntiProtonCode){
641e1e0c 1174 float myEt = Et(part);
4b40b2b1 1175 float myEtPi = Et(part,fgPionMass);
86d9d0dc 1176 float myEtK = Et(part,fgKaonMass);
49b25059 1177 if(part->Pt()>0.15) fSimPiKPEtShouldBeReco += myEt;
1178 if(part->Pt()>0.15) fSimPiKPEtShouldBeRecoP += myEt;
d6214a64 1179 fSimHadEt += myEt;
1180 fSimTotEt += myEt;
641e1e0c 1181 FillHisto2D("EtSimulatedAntiProton",part->Pt(),part->Eta(),myEt);
1182 FillHisto2D("EtNSimulatedAntiProton",part->Pt(),part->Eta(),1.0);
1183 FillHisto2D("EtSimulatedChargedHadron",part->Pt(),part->Eta(),myEt);
1184 FillHisto2D("EtNSimulatedChargedHadron",part->Pt(),part->Eta(),1.0);
bf205f52 1185 if(fCentBin>=0){//if a centrality bin was defined
1186 FillHisto2D(Form("EtNSimulatedAntiProtonCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
1187 FillHisto2D(Form("EtNSimulatedChargedHadronCB%i",fCentBin),part->Pt(),part->Eta(),1.0);
52503ae7 1188 }
641e1e0c 1189 FillHisto2D("EtSimulatedChargedHadronAssumingPion",part->Pt(),part->Eta(),myEtPi);
1190 FillHisto2D("EtSimulatedAntiProtonAssumingPion",part->Pt(),part->Eta(),myEtPi);
86d9d0dc 1191 FillHisto2D("EtSimulatedChargedHadronAssumingKaon",part->Pt(),part->Eta(),myEtK);
1192 FillHisto2D("EtSimulatedAntiProtonAssumingKaon",part->Pt(),part->Eta(),myEtK);
641e1e0c 1193 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
0e866ddc 1194 Short_t charge = -1;
1195 Float_t myEtLow = Et(0.0,part->Theta(),pdgCode,charge);
1196 Float_t myEtITS = Et(0.10/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1197 Float_t myEtTPC = Et(0.15/TMath::Sin(part->Theta()),part->Theta(),pdgCode,charge);
1198 FillHisto2D("EtSimulatedChargedHadronAssumingNoPt",part->Pt(),part->Eta(),myEtLow);
1199 FillHisto2D("EtSimulatedChargedHadronAssumingPtTPCCut",part->Pt(),part->Eta(),myEtTPC);
1200 FillHisto2D("EtSimulatedChargedHadronAssumingPtITSCut",part->Pt(),part->Eta(),myEtITS);
641e1e0c 1201 filled = true;
f43fc416 1202 if(fBaryonEnhancement){
1203 float enhancement = ProtonBaryonEnhancement(part->Pt());
1204 FillHisto2D("EtSimulatedAntiProtonEnhanced",part->Pt(),part->Eta(),myEt*enhancement);
1205 FillHisto2D("EtNSimulatedAntiProtonEnhanced",part->Pt(),part->Eta(),1.0*enhancement);
1206 FillHisto2D("EtSimulatedAntiProtonAssumingPionEnhanced",part->Pt(),part->Eta(),myEtPi*enhancement);
1207 }
641e1e0c 1208 }
1209 //============Other hadrons===================================
1210
4b40b2b1 1211 if(pdgCode == fgNeutronCode){
641e1e0c 1212 float myEt = Et(part);
d6214a64 1213 fSimHadEt += myEt;
1214 fSimTotEt += myEt;
641e1e0c 1215 FillHisto2D("EtSimulatedNeutron",part->Pt(),part->Eta(),myEt);
1216 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
1217 filled = true;
1218 }
4b40b2b1 1219 if(pdgCode == fgAntiNeutronCode){
641e1e0c 1220 float myEt = Et(part);
d6214a64 1221 fSimHadEt += myEt;
1222 fSimTotEt += myEt;
641e1e0c 1223 FillHisto2D("EtSimulatedAntiNeutron",part->Pt(),part->Eta(),myEt);
1224 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
1225 filled = true;
1226 }
4b40b2b1 1227 if(pdgCode == fgLambdaCode){
641e1e0c 1228 float myEt = Et(part);
d6214a64 1229 fSimHadEt += myEt;
1230 fSimTotEt += myEt;
641e1e0c 1231 FillHisto2D("EtSimulatedLambda",part->Pt(),part->Eta(),myEt);
1232 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
964c8159 1233 Float_t weight = LambdaWeight(part->Pt());
f43fc416 1234 if(fBaryonEnhancement){
1235 float enhancement = ProtonBaryonEnhancement(part->Pt());
1236 weight = weight*enhancement;
1237 }
964c8159 1238 FillHisto2D("EtSimulatedLambdaReweighted",part->Pt(),part->Eta(),myEt*weight);
641e1e0c 1239 Int_t ndaughters = part->GetNDaughters();
1240 for(Int_t idaughter = 0;idaughter<ndaughters;idaughter++){
1241 Int_t daughterindex = part->GetDaughter(idaughter);
1242 if(daughterindex<0 || daughterindex>1e5) continue;
1243 TParticle *daughter = stack->ParticleFromTreeK(daughterindex);
1244 if(daughter){
1245 if(daughter->GetPDG(0)){
1246 Int_t daughtercode = daughter->GetPDG(0)->PdgCode();
4b40b2b1 1247 if(daughtercode==fgPiMinusCode || daughtercode==fgProtonCode){
641e1e0c 1248 myEt = Et(daughter);
1249 FillHisto2D("EtSimulatedLambdaDaughters",daughter->Pt(),daughter->Eta(),myEt);
964c8159 1250 FillHisto2D("EtSimulatedLambdaDaughtersReweighted",daughter->Pt(),daughter->Eta(),myEt*weight);
641e1e0c 1251 }
1252 }
1253 else{
641e1e0c 1254 }
1255 }
1256 }
1257 filled = true;
1258 }
4b40b2b1 1259 if(pdgCode == fgAntiLambdaCode){
641e1e0c 1260 float myEt = Et(part);
d6214a64 1261 fSimHadEt += myEt;
1262 fSimTotEt += myEt;
641e1e0c 1263 FillHisto2D("EtSimulatedAntiLambda",part->Pt(),part->Eta(),myEt);
1264 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
964c8159 1265 Float_t weight = AntiLambdaWeight(part->Pt());
f43fc416 1266 if(fBaryonEnhancement){
1267 float enhancement = ProtonBaryonEnhancement(part->Pt());
1268 weight = weight*enhancement;
1269 }
964c8159 1270 FillHisto2D("EtSimulatedAntiLambdaReweighted",part->Pt(),part->Eta(),myEt*weight);
641e1e0c 1271 Int_t ndaughters = part->GetNDaughters();
1272 for(Int_t idaughter = 0;idaughter<ndaughters;idaughter++){
1273 Int_t daughterindex = part->GetDaughter(idaughter);
1274 if(daughterindex<0 || daughterindex>1e5) continue;
1275 TParticle *daughter = stack->ParticleFromTreeK(daughterindex);
1276 if(daughter){
1277 if(daughter->GetPDG(0)){
1278 Int_t daughtercode = daughter->GetPDG(0)->PdgCode();
4b40b2b1 1279 if(daughtercode==fgPiPlusCode || daughtercode==fgAntiProtonCode){
641e1e0c 1280 myEt = Et(daughter);
1281 FillHisto2D("EtSimulatedAntiLambdaDaughters",daughter->Pt(),daughter->Eta(),myEt);
964c8159 1282 FillHisto2D("EtSimulatedAntiLambdaDaughtersReweighted",daughter->Pt(),daughter->Eta(),myEt*weight);
641e1e0c 1283 }
1284 }
641e1e0c 1285 }
1286 }
1287 filled = true;
1288 }
4b40b2b1 1289 if(pdgCode == fgK0SCode){
641e1e0c 1290 float myEt = Et(part);
d6214a64 1291 fSimHadEt += myEt;
1292 fSimTotEt += myEt;
641e1e0c 1293 FillHisto2D("EtSimulatedK0S",part->Pt(),part->Eta(),myEt);
1294 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
964c8159 1295 Float_t weight = K0Weight(part->Pt());
1296 FillHisto2D("EtSimulatedK0SReweighted",part->Pt(),part->Eta(),myEt*weight);
641e1e0c 1297 Int_t ndaughters = part->GetNDaughters();
1298 for(Int_t idaughter = 0;idaughter<ndaughters;idaughter++){
1299 Int_t daughterindex = part->GetDaughter(idaughter);
1300 if(daughterindex<0 || daughterindex>1e5) continue;
1301 TParticle *daughter = stack->ParticleFromTreeK(daughterindex);
1302 if(daughter){
1303 if(daughter->GetPDG(0)){
1304
1305 Int_t daughtercode = daughter->GetPDG(0)->PdgCode();
4b40b2b1 1306 if(daughtercode==fgPiMinusCode || daughtercode==fgPiPlusCode){
641e1e0c 1307 myEt = Et(daughter);
1308 FillHisto2D("EtSimulatedK0SDaughters",daughter->Pt(),daughter->Eta(),myEt);
964c8159 1309 FillHisto2D("EtSimulatedK0SDaughtersReweighted",daughter->Pt(),daughter->Eta(),myEt*weight);
641e1e0c 1310 }
1311 }
641e1e0c 1312 }
1313 }
1314 filled = true;
1315 }
4b40b2b1 1316 if(pdgCode == fgK0LCode){
641e1e0c 1317 float myEt = Et(part);
d6214a64 1318 fSimHadEt += myEt;
1319 fSimTotEt += myEt;
641e1e0c 1320 FillHisto2D("EtSimulatedK0L",part->Pt(),part->Eta(),myEt);
1321 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
964c8159 1322 Float_t weight = K0Weight(part->Pt());
1323 FillHisto2D("EtSimulatedK0LReweighted",part->Pt(),part->Eta(),myEt*weight);
641e1e0c 1324 filled = true;
1325 }
4b40b2b1 1326 if(pdgCode == fgOmegaCode){
641e1e0c 1327 float myEt = Et(part);
d6214a64 1328 fSimHadEt += myEt;
1329 fSimTotEt += myEt;
641e1e0c 1330 FillHisto2D("EtSimulatedOmega",part->Pt(),part->Eta(),myEt);
1331 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
1332 Int_t ndaughters = part->GetNDaughters();
1333 for(Int_t idaughter = 0;idaughter<ndaughters;idaughter++){
1334 Int_t daughterindex = part->GetDaughter(idaughter);
1335 if(daughterindex<0 || daughterindex>1e5) continue;
1336 TParticle *daughter = stack->Particle(daughterindex);
1337 if(daughter){
1338 if(daughter->GetPDG(0)){
1339
1340 Int_t daughtercode = daughter->GetPDG(0)->PdgCode();
4b40b2b1 1341 if(daughtercode==fgPiPlusCode || daughtercode==fgProtonCode || daughtercode==fgKMinusCode){
641e1e0c 1342 myEt = Et(daughter);
1343 FillHisto2D("EtSimulatedOmegaDaughters",daughter->Pt(),daughter->Eta(),myEt);
641e1e0c 1344 }
1345 }
641e1e0c 1346 }
1347 }
1348 filled = true;
1349 }
4b40b2b1 1350 if(pdgCode == fgAntiOmegaCode){
641e1e0c 1351 float myEt = Et(part);
d6214a64 1352 fSimHadEt += myEt;
1353 fSimTotEt += myEt;
641e1e0c 1354 FillHisto2D("EtSimulatedOmega",part->Pt(),part->Eta(),myEt);
1355 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
1356 Int_t ndaughters = part->GetNDaughters();
1357 for(Int_t idaughter = 0;idaughter<ndaughters;idaughter++){
1358 Int_t daughterindex = part->GetDaughter(idaughter);
1359 if(daughterindex<0 || daughterindex>1e5) continue;
1360 TParticle *daughter = stack->ParticleFromTreeK(daughterindex);
1361 if(daughter){
1362 if(daughter->GetPDG(0)){
1363 Int_t daughtercode = daughter->GetPDG(0)->PdgCode();
4b40b2b1 1364 if(daughtercode==fgPiMinusCode || daughtercode==fgAntiProtonCode || daughtercode==fgKPlusCode){
641e1e0c 1365 myEt = Et(daughter);
1366 FillHisto2D("EtSimulatedAntiOmegaDaughters",daughter->Pt(),daughter->Eta(),myEt);
641e1e0c 1367 }
1368 }
641e1e0c 1369 }
1370 }
1371 filled = true;
1372 }
1373 //There are two codes for Sigmas
4b40b2b1 1374 if(pdgCode == fgSigmaCode || pdgCode == -3222){
641e1e0c 1375 float myEt = Et(part);
d6214a64 1376 fSimHadEt += myEt;
1377 fSimTotEt += myEt;
641e1e0c 1378 FillHisto2D("EtSimulatedSigma",part->Pt(),part->Eta(),myEt);
1379 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
1380 filled = true;
1381 }
4b40b2b1 1382 if(pdgCode == fgAntiSigmaCode || pdgCode == 3222){
641e1e0c 1383 float myEt = Et(part);
d6214a64 1384 fSimHadEt += myEt;
1385 fSimTotEt += myEt;
641e1e0c 1386 FillHisto2D("EtSimulatedAntiSigma",part->Pt(),part->Eta(),myEt);
1387 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
1388 filled = true;
1389 }
4b40b2b1 1390 if(pdgCode == fgXiCode){
641e1e0c 1391 float myEt = Et(part);
d6214a64 1392 fSimHadEt += myEt;
1393 fSimTotEt += myEt;
641e1e0c 1394 FillHisto2D("EtSimulatedXi",part->Pt(),part->Eta(),myEt);
1395 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
1396 Int_t ndaughters = part->GetNDaughters();
1397 for(Int_t idaughter = 0;idaughter<ndaughters;idaughter++){
1398 Int_t daughterindex = part->GetDaughter(idaughter);
1399 if(daughterindex<0 || daughterindex>1e5 || daughterindex>1e5) continue;
641e1e0c 1400 TParticle *daughter = stack->ParticleFromTreeK(daughterindex);
1401 if(daughter){
1402 if(daughter->GetPDG(0)){
1403
1404 Int_t daughtercode = daughter->GetPDG(0)->PdgCode();
4b40b2b1 1405 if(daughtercode==fgPiPlusCode || daughtercode==fgProtonCode || daughtercode==fgPiMinusCode){
641e1e0c 1406 myEt = Et(daughter);
1407 FillHisto2D("EtSimulatedXiDaughters",daughter->Pt(),daughter->Eta(),myEt);
641e1e0c 1408 }
1409 }
641e1e0c 1410 }
1411 }
1412 filled = true;
1413 }
4b40b2b1 1414 if(pdgCode == fgAntiXiCode){
641e1e0c 1415 float myEt = Et(part);
d6214a64 1416 fSimHadEt += myEt;
1417 fSimTotEt += myEt;
641e1e0c 1418 FillHisto2D("EtSimulatedAntiXi",part->Pt(),part->Eta(),myEt);
1419 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
1420 Int_t ndaughters = part->GetNDaughters();
1421 for(Int_t idaughter = 0;idaughter<ndaughters;idaughter++){
1422 Int_t daughterindex = part->GetDaughter(idaughter);
1423 if(daughterindex<0 || daughterindex>1e5) continue;
1424 TParticle *daughter = stack->ParticleFromTreeK(daughterindex);
1425 if(daughter){
1426 if(daughter->GetPDG(0)){
1427 Int_t daughtercode = daughter->GetPDG(0)->PdgCode();
4b40b2b1 1428 if(daughtercode==fgPiPlusCode || daughtercode==fgAntiProtonCode || daughtercode==fgPiMinusCode){
641e1e0c 1429 myEt = Et(daughter);
1430 FillHisto2D("EtSimulatedAntiXiDaughters",daughter->Pt(),daughter->Eta(),myEt);
641e1e0c 1431 }
1432 }
641e1e0c 1433 }
1434 }
1435 filled = true;
1436 }
4b40b2b1 1437 if(pdgCode == fgXi0Code){
641e1e0c 1438 float myEt = Et(part);
d6214a64 1439 fSimHadEt += myEt;
1440 fSimTotEt += myEt;
641e1e0c 1441 FillHisto2D("EtSimulatedXi0",part->Pt(),part->Eta(),myEt);
1442 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
1443 filled = true;
1444 }
4b40b2b1 1445 if(pdgCode == fgAntiXi0Code){
641e1e0c 1446 float myEt = Et(part);
d6214a64 1447 fSimHadEt += myEt;
1448 fSimTotEt += myEt;
641e1e0c 1449 FillHisto2D("EtSimulatedAntiXi0",part->Pt(),part->Eta(),myEt);
1450 FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
1451 filled = true;
1452 }
1453 //============electrons===================================
1454
4b40b2b1 1455 if(pdgCode == fgEPlusCode){
641e1e0c 1456 float myEt = Et(part);
d6214a64 1457 fSimTotEt += myEt;
641e1e0c 1458 FillHisto2D("EtSimulatedEPlus",part->Pt(),part->Eta(),myEt);
1459 filled = true;
1460 }
4b40b2b1 1461 if(pdgCode == fgEMinusCode){
641e1e0c 1462 float myEt = Et(part);
d6214a64 1463 fSimTotEt += myEt;
641e1e0c 1464 FillHisto2D("EtSimulatedEMinus",part->Pt(),part->Eta(),myEt);
1465 filled = true;
1466 }
f427cbed 1467 //============neutrals===================================
4b40b2b1 1468 if(pdgCode == fgGammaCode){
61e3f555 1469 TParticle *mom = NULL;
1470 Int_t pdgCodeMom = -99999999;
1471 float momEta = -30;
1472 float mompT = -5;
1473 if(part->GetFirstMother()){
1474 mom = stack->Particle(part->GetFirstMother());
1475 pdgCodeMom = mom->GetPDG(0)->PdgCode();
1476 momEta = mom->Eta();
1477 mompT = mom->Pt();
1478 }
4e0c0fe1 1479 //We want to separate the gammas by pi0, eta, omega0 but we don't want to double count energy so we get the et from the gamma daughter
4b40b2b1 1480 if(pdgCodeMom == fgEtaCode){
4e0c0fe1 1481 float myEt = Et(part);
1482 fSimTotEt += myEt;
61e3f555 1483 FillHisto2D("EtSimulatedEta",mompT,momEta,myEt);
b64de20c 1484 filled = true;
1485 }
4b40b2b1 1486 if(pdgCodeMom == fgPi0Code){
4e0c0fe1 1487 float myEt = Et(part);
1488 fSimTotEt += myEt;
61e3f555 1489 FillHisto2D("EtSimulatedPi0",mompT,momEta,myEt);
b64de20c 1490 filled = true;
1491 }
4b40b2b1 1492 if(pdgCodeMom == fgOmega0Code){
4e0c0fe1 1493 float myEt = Et(part);
1494 fSimTotEt += myEt;
61e3f555 1495 FillHisto2D("EtSimulatedOmega0",mompT,momEta,myEt);
b64de20c 1496 filled = true;
1497 }
1498 if(!filled){
1499 float myEt = Et(part);
4e0c0fe1 1500 fSimTotEt += myEt;
b64de20c 1501 FillHisto2D("EtSimulatedGamma",part->Pt(),part->Eta(),myEt);
1502 filled = true;
1503 }
f427cbed 1504 }
4b40b2b1 1505 if(pdgCode == fgEtaCode){
f427cbed 1506 float myEt = Et(part);
d6214a64 1507 fSimTotEt += myEt;
f427cbed 1508 FillHisto2D("EtSimulatedEta",part->Pt(),part->Eta(),myEt);
1509 filled = true;
1510 }
4b40b2b1 1511 if(pdgCode == fgPi0Code){
f427cbed 1512 float myEt = Et(part);
d6214a64 1513 fSimTotEt += myEt;
f427cbed 1514 FillHisto2D("EtSimulatedPi0",part->Pt(),part->Eta(),myEt);
1515 filled = true;
1516 }
4b40b2b1 1517 if(pdgCode == fgOmega0Code){
b64de20c 1518 float myEt = Et(part);
d6214a64 1519 fSimTotEt += myEt;
b64de20c 1520 FillHisto2D("EtSimulatedOmega0",part->Pt(),part->Eta(),myEt);
1521 filled = true;
1522 }
641e1e0c 1523 }
1524 }
1525 }
1526
0e866ddc 1527 if(fSimTotEt>0.0)FillHisto1D("SimTotEt",fSimTotEt,1.0);
1528 if(fSimHadEt>0.0)FillHisto1D("SimHadEt",fSimHadEt,1.0);
1529 if(fSimPiKPEt>0.0)FillHisto1D("SimPiKPEt",fSimPiKPEt,1.0);
02710991 1530 if(fCentBin != -1){//if we have Pb+Pb and a centrality bin was found
1531 if(fSimTotEt>0.0) FillHisto1D(Form("SimTotEtCB%i",fCentBin),fSimTotEt,1.0);
1532 if(fSimHadEt>0.0) FillHisto1D(Form("SimHadEtCB%i",fCentBin),fSimHadEt,1.0);
1533 if(fSimPiKPEt>0.0)FillHisto1D(Form("SimPiKPEtCB%i",fCentBin),fSimPiKPEt,1.0);
1534 }
0e866ddc 1535
7d2d1773 1536 if(fInvestigateSmearing){
1537 //Smearing histograms
1538 if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPtSmeared",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPtSmeared)/fSimPiKPEt,1.0);
1539 FillHisto1D("SimPiKPEtPtSmeared",fSimPiKPEtPtSmeared,1.0);
1540 if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimEfficiencySmeared",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtEfficiencySmeared)/fSimPiKPEt,1.0);
1541 FillHisto1D("SimPiKPEtEfficiencySmeared",fSimPiKPEtEfficiencySmeared,1.0);
1542 if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPtCutSmearedTPC",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPtCutSmearedTPC)/fSimPiKPEt,1.0);
1543 FillHisto1D("SimPiKPEtPtCutSmearedTPC",fSimPiKPEtPtCutSmearedTPC,1.0);
1544 if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPtCutSmearedITS",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPtCutSmearedITS)/fSimPiKPEt,1.0);
1545 FillHisto1D("SimPiKPEtPtCutSmearedITS",fSimPiKPEtPtCutSmearedTPC,1.0);
1546 if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPIDSmeared",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPIDSmeared)/fSimPiKPEt,1.0);
1547 FillHisto1D("SimPiKPEtPIDSmeared",fSimPiKPEtPIDSmeared,1.0);
1548 if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPIDSmearedNoID",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPIDSmearedNoID)/fSimPiKPEt,1.0);
1549 FillHisto1D("SimPiKPEtPIDSmearedNoID",fSimPiKPEtPIDSmearedNoID,1.0);
1550 }
641e1e0c 1551 return 1;
1552
1553}
1554
1555void AliAnalysisHadEtMonteCarlo::Init()
cf6522d1 1556{ // Init
641e1e0c 1557 AliAnalysisHadEt::Init();
0e866ddc 1558 if(!fPtSmearer) fPtSmearer = new TRandom();
641e1e0c 1559}
1560void AliAnalysisHadEtMonteCarlo::CreateHistograms(){
1561 //for simulated Et only (no reconstruction)
1562 CreateEtaPtHisto2D(TString("EtSimulatedPiPlus"),TString("Simulated E_{T} from #pi^{+}"));
1563 CreateEtaPtHisto2D("EtSimulatedPiMinus","Simulated E_{T} from #pi^{-}");
1564 CreateEtaPtHisto2D("EtSimulatedKPlus","Simulated E_{T} from K^{+}");
1565 CreateEtaPtHisto2D("EtSimulatedKMinus","Simulated E_{T} from K^{-}");
1566 CreateEtaPtHisto2D("EtSimulatedProton","Simulated E_{T} from p");
f43fc416 1567 CreateEtaPtHisto2D("EtSimulatedAntiProton","Simulated E_{T} from #bar{p}");//Both baryon enhancement and strangeness rescaling
1568 if(fBaryonEnhancement){
1569 CreateEtaPtHisto2D("EtSimulatedProtonEnhanced","Simulated E_{T} from p");
1570 CreateEtaPtHisto2D("EtSimulatedAntiProtonEnhanced","Simulated E_{T} from #bar{p}");
1571 }
641e1e0c 1572 CreateEtaPtHisto2D("EtSimulatedChargedHadron","Simulated E_{T} from charged hadrons");
52503ae7 1573 CreateEtaPtHisto2D("EtNSimulatedPiPlus","Number of Simulated #pi^{+}");
641e1e0c 1574 CreateEtaPtHisto2D("EtNSimulatedPiMinus","Number of simulated #pi^{-}");
1575 CreateEtaPtHisto2D("EtNSimulatedKPlus","Number of simulated K^{+}");
1576 CreateEtaPtHisto2D("EtNSimulatedKMinus","Number of simulated K^{-}");
1577 CreateEtaPtHisto2D("EtNSimulatedProton","Number of simulated p");
1578 CreateEtaPtHisto2D("EtNSimulatedAntiProton","Number of simulated #bar{p}");
f43fc416 1579 if(fBaryonEnhancement){
1580 CreateEtaPtHisto2D("EtNSimulatedProtonEnhanced","Number of simulated p");
1581 CreateEtaPtHisto2D("EtNSimulatedAntiProtonEnhanced","Number of simulated #bar{p}");
1582 }
641e1e0c 1583 CreateEtaPtHisto2D("EtNSimulatedChargedHadron","Number of simulated charged hadrons");
52503ae7 1584 if(fDataSet==20100){//If this is Pb+Pb
1585 Int_t width = 5;
61e3f555 1586 if(fNCentBins<21) width = 10;
bf205f52 1587 for(Int_t i=0;i<fNCentBins;i++){
52503ae7 1588 CreateEtaPtHisto2D(Form("EtNSimulatedPiPlusCB%i",i),Form("Number of Simulated #pi^{+} for %i-%i central",i*width,(i+1)*width));
1589 CreateEtaPtHisto2D(Form("EtNSimulatedPiMinusCB%i",i),Form("Number of simulated #pi^{-} for %i-%i central",i*width,(i+1)*width));
1590 CreateEtaPtHisto2D(Form("EtNSimulatedKPlusCB%i",i),Form("Number of simulated K^{+} for %i-%i central",i*width,(i+1)*width));
1591 CreateEtaPtHisto2D(Form("EtNSimulatedKMinusCB%i",i),Form("Number of simulated K^{-} for %i-%i central",i*width,(i+1)*width));
1592 CreateEtaPtHisto2D(Form("EtNSimulatedProtonCB%i",i),Form("Number of simulated p for %i-%i central",i*width,(i+1)*width));
1593 CreateEtaPtHisto2D(Form("EtNSimulatedAntiProtonCB%i",i),Form("Number of simulated #bar{p} for %i-%i central",i*width,(i+1)*width));
1594 CreateEtaPtHisto2D(Form("EtNSimulatedChargedHadronCB%i",i),Form("Number of simulated charged hadrons for %i-%i central",i*width,(i+1)*width));
1595 }
1596 }
0e866ddc 1597 CreateEtaPtHisto2D("EtSimulatedChargedHadronAssumingNoPt","Simulated E_{T} from charged hadrons assuming p_{T}=0");
1598 CreateEtaPtHisto2D("EtSimulatedChargedHadronAssumingPtTPCCut","Simulated E_{T} from charged hadrons assuming p_{T}=0.15");
1599 CreateEtaPtHisto2D("EtSimulatedChargedHadronAssumingPtITSCut","Simulated E_{T} from charged hadrons assuming p_{T}=0.10");
641e1e0c 1600
1601 CreateEtaPtHisto2D("EtSimulatedChargedHadronAssumingPion","Simulated E_{T} from charged hadrons assuming they are all pions");
86d9d0dc 1602 CreateEtaPtHisto2D("EtSimulatedChargedHadronAssumingProton","Simulated E_{T} from charged hadrons assuming they are all pions");
1603 CreateEtaPtHisto2D("EtSimulatedChargedHadronAssumingKaon","Simulated E_{T} from charged hadrons assuming they are all pions");
641e1e0c 1604 CreateEtaPtHisto2D("EtSimulatedKPlusAssumingPion","Simulated E_{T} from K^{+} assuming #pi mass");
1605 CreateEtaPtHisto2D("EtSimulatedKMinusAssumingPion","Simulated E_{T} from K^{-} assuming #pi mass");
1606 CreateEtaPtHisto2D("EtSimulatedProtonAssumingPion","Simulated E_{T} from p assuming #pi mass");
1607 CreateEtaPtHisto2D("EtSimulatedAntiProtonAssumingPion","Simulated E_{T} from #bar{p} assuming #pi mass");
86d9d0dc 1608 CreateEtaPtHisto2D("EtSimulatedKPlusAssumingProton","Simulated E_{T} from K^{+} assuming #pi mass");
1609 CreateEtaPtHisto2D("EtSimulatedKMinusAssumingProton","Simulated E_{T} from K^{-} assuming #pi mass");
1610 CreateEtaPtHisto2D("EtSimulatedPiPlusAssumingProton","Simulated E_{T} from p assuming #pi mass");
1611 CreateEtaPtHisto2D("EtSimulatedPiMinusAssumingProton","Simulated E_{T} from #bar{p} assuming #pi mass");
1612 CreateEtaPtHisto2D("EtSimulatedPiPlusAssumingKaon","Simulated E_{T} from K^{+} assuming #pi mass");
1613 CreateEtaPtHisto2D("EtSimulatedPiMinusAssumingKaon","Simulated E_{T} from K^{-} assuming #pi mass");
1614 CreateEtaPtHisto2D("EtSimulatedProtonAssumingKaon","Simulated E_{T} from p assuming #pi mass");
1615 CreateEtaPtHisto2D("EtSimulatedAntiProtonAssumingKaon","Simulated E_{T} from #bar{p} assuming #pi mass");
f43fc416 1616 if(fBaryonEnhancement){
1617 CreateEtaPtHisto2D("EtSimulatedProtonAssumingPionEnhanced","Simulated E_{T} from p assuming #pi mass");
1618 CreateEtaPtHisto2D("EtSimulatedAntiProtonAssumingPionEnhanced","Simulated E_{T} from #bar{p} assuming #pi mass");
1619 }
641e1e0c 1620
1621 CreateEtaPtHisto2D("EtSimulatedLambda","Simulated E_{T} from #Lambda");
1622 CreateEtaPtHisto2D("EtSimulatedAntiLambda","Simulated E_{T} from #bar{#Lambda}");
1623 CreateEtaPtHisto2D("EtSimulatedK0S","Simulated E_{T} from K^{0}_{S}");
1624 CreateEtaPtHisto2D("EtSimulatedK0L","Simulated E_{T} from K^{0}_{L}");
f43fc416 1625 CreateEtaPtHisto2D("EtSimulatedLambdaReweighted","Simulated E_{T} from #Lambda");//These will also be used for baryon enhancement
964c8159 1626 CreateEtaPtHisto2D("EtSimulatedAntiLambdaReweighted","Simulated E_{T} from #bar{#Lambda}");
1627 CreateEtaPtHisto2D("EtSimulatedK0SReweighted","Simulated E_{T} from K^{0}_{S}");
1628 CreateEtaPtHisto2D("EtSimulatedK0LReweighted","Simulated E_{T} from K^{0}_{L}");
641e1e0c 1629 CreateEtaPtHisto2D("EtSimulatedNeutron","Simulated E_{T} from neutrons");
1630 CreateEtaPtHisto2D("EtSimulatedAntiNeutron","Simulated E_{T} from #bar{n}");
1631 CreateEtaPtHisto2D("EtSimulatedEPlus","Simulated E_{T} from e^{+}");
1632 CreateEtaPtHisto2D("EtSimulatedEMinus","Simulated E_{T} from e^{-}");
1633 CreateEtaPtHisto2D("EtSimulatedOmega","Simulated E_{T} from #Omega^{-}");
1634 CreateEtaPtHisto2D("EtSimulatedAntiOmega","Simulated E_{T} from #Omega^{+}");
1635 CreateEtaPtHisto2D("EtSimulatedXi","Simulated E_{T} from #Xi^{-}");
1636 CreateEtaPtHisto2D("EtSimulatedAntiXi","Simulated E_{T} from #Xi^{+}");
1637 CreateEtaPtHisto2D("EtSimulatedSigma","Simulated E_{T} from #Xi^{-}");
1638 CreateEtaPtHisto2D("EtSimulatedAntiSigma","Simulated E_{T} from #Xi^{+}");
1639 CreateEtaPtHisto2D("EtSimulatedXi0","Simulated E_{T} from #Xi^{0}");
1640 CreateEtaPtHisto2D("EtSimulatedAntiXi0","Simulated E_{T} from #Xi^{0}");
1641 CreateEtaPtHisto2D("EtSimulatedAllHadron","Simulated E_{T} from all hadrons");
1642
1643
1644 CreateEtaPtHisto2D("EtSimulatedLambdaDaughters","Simulated E_{T} from #Lambda Daughters");
1645 CreateEtaPtHisto2D("EtSimulatedAntiLambdaDaughters","Simulated E_{T} from #bar{#Lambda} Daughters");
1646 CreateEtaPtHisto2D("EtSimulatedK0SDaughters","Simulated E_{T} from K^{0}_{S} Daughters");
964c8159 1647 CreateEtaPtHisto2D("EtSimulatedLambdaDaughtersReweighted","Simulated E_{T} from #Lambda Daughters");
1648 CreateEtaPtHisto2D("EtSimulatedAntiLambdaDaughtersReweighted","Simulated E_{T} from #bar{#Lambda} Daughters");
1649 CreateEtaPtHisto2D("EtSimulatedK0SDaughtersReweighted","Simulated E_{T} from K^{0}_{S} Daughters");
641e1e0c 1650 CreateEtaPtHisto2D("EtSimulatedOmegaDaughters","Simulated E_{T} from #Omega^{-} Daughters");
1651 CreateEtaPtHisto2D("EtSimulatedAntiOmegaDaughters","Simulated E_{T} from #Omega^{+} Daughters");
1652 CreateEtaPtHisto2D("EtSimulatedXiDaughters","Simulated E_{T} from #Xi^{-} Daughters");
1653 CreateEtaPtHisto2D("EtSimulatedAntiXiDaughters","Simulated E_{T} from #Xi^{+} Daughters");
1654
f427cbed 1655
1656 CreateEtaPtHisto2D("EtSimulatedGamma","Simulated E_{T} from #gamma");
1657 CreateEtaPtHisto2D("EtSimulatedEta","Simulated E_{T} from #eta");
1658 CreateEtaPtHisto2D("EtSimulatedPi0","Simulated E_{T} from #pi^{0}");
b64de20c 1659 CreateEtaPtHisto2D("EtSimulatedOmega0","Simulated E_{T} from #omega");
f427cbed 1660
cf6522d1 1661 TString *strTPC = new TString("TPC");
1662 TString *strITS = new TString("ITS");
1663 TString *strTPCITS = new TString("TPCITS");
7d2d1773 1664 Int_t lastcutset = 1;
1665 if(fRequireITSHits) lastcutset = 2;
1666 for(Int_t i=0;i<=lastcutset;i++){
ea331c5d 1667 TString *cutName = NULL;
641e1e0c 1668 Float_t maxPtdEdx = 10;
1669 Float_t mindEdx = 35;
1670 Float_t maxdEdx = 150.0;
1671 switch(i){
1672 case 0:
cf6522d1 1673 cutName = strTPC;
641e1e0c 1674 break;
1675 case 1:
cf6522d1 1676 cutName = strITS;
641e1e0c 1677 maxPtdEdx = 5;
1678 maxdEdx = 500.0;
1679 break;
1680 case 2:
cf6522d1 1681 cutName = strTPCITS;
641e1e0c 1682 break;
1683 default:
1684 cerr<<"Error: cannot make histograms!"<<endl;
1685 return;
1686 }
1687
cf6522d1 1688 CreateEtaPtHisto2D(Form("EtReconstructed%sIdentifiedPiPlus",cutName->Data()),"Reconstructed E_{T} from identified #pi^{+}");
1689 CreateEtaPtHisto2D(Form("EtReconstructed%sIdentifiedPiMinus",cutName->Data()),"Reconstructed E_{T} from identified #pi^{-}");
1690 CreateEtaPtHisto2D(Form("EtReconstructed%sIdentifiedKPlus",cutName->Data()),"Reconstructed E_{T} from identified K^{+}");
1691 CreateEtaPtHisto2D(Form("EtReconstructed%sIdentifiedEMinus",cutName->Data()),"Reconstructed E_{T} from identified e^{-}");
1692 CreateEtaPtHisto2D(Form("EtReconstructed%sIdentifiedEPlus",cutName->Data()),"Reconstructed E_{T} from identified e^{+}");
1693 CreateEtaPtHisto2D(Form("EtReconstructed%sIdentifiedKMinus",cutName->Data()),"Reconstructed E_{T} from identified K^{-}");
1694 CreateEtaPtHisto2D(Form("EtReconstructed%sIdentifiedProton",cutName->Data()),"Reconstructed E_{T} from identified p");
1695 CreateEtaPtHisto2D(Form("EtReconstructed%sIdentifiedAntiProton",cutName->Data()),"Reconstructed E_{T} from identified #bar{p}");
f43fc416 1696 if(fBaryonEnhancement){
1697 CreateEtaPtHisto2D(Form("EtReconstructed%sIdentifiedProtonEnhanced",cutName->Data()),"Reconstructed E_{T} from identified p");
1698 CreateEtaPtHisto2D(Form("EtReconstructed%sIdentifiedAntiProtonEnhanced",cutName->Data()),"Reconstructed E_{T} from identified #bar{p}");
1699 }
cf6522d1 1700 CreateEtaPtHisto2D(Form("EtNReconstructed%sUnidentified",cutName->Data()),"Number of Reconstructed unidentified particles");
1701 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedAssumingPion",cutName->Data()),"Reconstructed E_{T} from unidentified particles assuming pion mass");
86d9d0dc 1702 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedAssumingProton",cutName->Data()),"Reconstructed E_{T} from unidentified particles assuming pion mass");
1703 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedAssumingKaon",cutName->Data()),"Reconstructed E_{T} from unidentified particles assuming pion mass");
f43fc416 1704
1705 CreateEtaPtHisto2D(Form("EtNReconstructed%sUnidentifiedKaon",cutName->Data()),"Number of Reconstructed unidentified kaons particles");
1706 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedKaonAssumingPion",cutName->Data()),"Reconstructed E_{T} from unidentified kaons particles assuming pion mass");
86d9d0dc 1707 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedKaonAssumingProton",cutName->Data()),"Reconstructed E_{T} from unidentified kaons particles assuming pion mass");
1708 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedKaonAssumingKaon",cutName->Data()),"Reconstructed E_{T} from unidentified kaons particles assuming pion mass");
904048b2 1709 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedKaon",cutName->Data()),"Reconstructed E_{T} from unidentified kaons particles assuming kaon mass");
f43fc416 1710 CreateEtaPtHisto2D(Form("EtNReconstructed%sUnidentifiedProton",cutName->Data()),"Number of Reconstructed unidentified proton particles");
1711 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedProtonAssumingPion",cutName->Data()),"Reconstructed E_{T} from unidentified proton particles assuming pion mass");
86d9d0dc 1712 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedProtonAssumingKaon",cutName->Data()),"Reconstructed E_{T} from unidentified proton particles assuming pion mass");
1713 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedPionAssumingKaon",cutName->Data()),"Reconstructed E_{T} from unidentified kaons particles assuming pion mass");
1714 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedProtonAssumingKaon",cutName->Data()),"Reconstructed E_{T} from unidentified proton particles assuming pion mass");
1715 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedPionAssumingProton",cutName->Data()),"Reconstructed E_{T} from unidentified kaons particles assuming pion mass");
1716 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedProtonAssumingProton",cutName->Data()),"Reconstructed E_{T} from unidentified proton particles assuming pion mass");
904048b2 1717 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedProton",cutName->Data()),"Reconstructed E_{T} from unidentified proton particles assuming proton mass");
f43fc416 1718 if(fBaryonEnhancement){
1719 CreateEtaPtHisto2D(Form("EtNReconstructed%sUnidentifiedProtonEnhanced",cutName->Data()),"Number of Reconstructed unidentified proton particles");
1720 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedProtonAssumingPionEnhanced",cutName->Data()),"Reconstructed E_{T} from unidentified proton particles assuming pion mass");
904048b2 1721 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedProtonEnhanced",cutName->Data()),"Reconstructed E_{T} from unidentified proton particles assuming proton mass");
f43fc416 1722 }
1723 CreateEtaPtHisto2D(Form("EtNReconstructed%sUnidentifiedPion",cutName->Data()),"Number of Reconstructed unidentified pions particles");
1724 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedPionAssumingPion",cutName->Data()),"Reconstructed E_{T} from unidentified pions particles assuming pion mass");
86d9d0dc 1725 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedPionAssumingKaon",cutName->Data()),"Reconstructed E_{T} from unidentified pions particles assuming pion mass");
1726 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedPionAssumingProton",cutName->Data()),"Reconstructed E_{T} from unidentified pions particles assuming pion mass");
904048b2 1727 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentifiedPion",cutName->Data()),"Reconstructed E_{T} from unidentified pions particles assuming pion mass");
f43fc416 1728
cf6522d1 1729 CreateEtaPtHisto2D(Form("EtReconstructed%sUnidentified",cutName->Data()),"Reconstructed E_{T} from unidentified particles using real mass");
1730 CreateEtaPtHisto2D(Form("EtReconstructed%sMisidentifiedElectrons",cutName->Data()),"Reconstructed E_{T} from misidentified electrons");
1731
1732
1733 CreateEtaPtHisto2D(Form("EtReconstructed%sPiPlus",cutName->Data()),"Reconstructed E_{T} from #pi^{+}");
1734 CreateEtaPtHisto2D(Form("EtReconstructed%sPiMinus",cutName->Data()),"Reconstructed E_{T} from #pi^{-}");
1735 CreateEtaPtHisto2D(Form("EtReconstructed%sKPlus",cutName->Data()),"Reconstructed E_{T} from K^{+}");
1736 CreateEtaPtHisto2D(Form("EtReconstructed%sKMinus",cutName->Data()),"Reconstructed E_{T} from K^{-}");
1737 CreateEtaPtHisto2D(Form("EtReconstructed%sProton",cutName->Data()),"Reconstructed E_{T} from p");
1738 CreateEtaPtHisto2D(Form("EtReconstructed%sAntiProton",cutName->Data()),"Reconstructed E_{T} from #bar{p}");
f43fc416 1739 if(fBaryonEnhancement){
1740 CreateEtaPtHisto2D(Form("EtReconstructed%sProtonEnhanced",cutName->Data()),"Reconstructed E_{T} from p");
1741 CreateEtaPtHisto2D(Form("EtReconstructed%sAntiProtonEnhanced",cutName->Data()),"Reconstructed E_{T} from #bar{p}");
1742 }
cf6522d1 1743 CreateEtaPtHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),"Reconstructed E_{T} from charged hadrons");
1744 CreateEtaPtHisto2D(Form("EtNReconstructed%sPiPlus",cutName->Data()),"Reconstructed E_{T} from #pi^{+}");
1745 CreateEtaPtHisto2D(Form("EtNReconstructed%sPiMinus",cutName->Data()),"Reconstructed E_{T} from #pi^{-}");
1746 CreateEtaPtHisto2D(Form("EtNReconstructed%sKPlus",cutName->Data()),"Reconstructed E_{T} from K^{+}");
1747 CreateEtaPtHisto2D(Form("EtNReconstructed%sKMinus",cutName->Data()),"Reconstructed E_{T} from K^{-}");
1748 CreateEtaPtHisto2D(Form("EtNReconstructed%sProton",cutName->Data()),"Reconstructed E_{T} from p");
1749 CreateEtaPtHisto2D(Form("EtNReconstructed%sAntiProton",cutName->Data()),"Reconstructed E_{T} from #bar{p}");
f43fc416 1750 if(fBaryonEnhancement){
1751 CreateEtaPtHisto2D(Form("EtNReconstructed%sProtonEnhanced",cutName->Data()),"Reconstructed E_{T} from p");
1752 CreateEtaPtHisto2D(Form("EtNReconstructed%sAntiProtonEnhanced",cutName->Data()),"Reconstructed E_{T} from #bar{p}");
1753 }
cf6522d1 1754 CreateEtaPtHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),"Reconstructed E_{T} from charged hadrons");
52503ae7 1755 if(fDataSet==20100){//If this is Pb+Pb
1756 Int_t width = 5;
61e3f555 1757 if(fNCentBins<21) width = 10;
bf205f52 1758 for(Int_t j=0;j<fNCentBins;j++){
52503ae7 1759 CreateEtaPtHisto2D(Form("EtNReconstructed%sPiPlusCB%i",cutName->Data(),j),Form("Reconstructed E_{T} from #pi^{+} for %i-%i central",j*width,(j+1)*width));
1760 CreateEtaPtHisto2D(Form("EtNReconstructed%sPiMinusCB%i",cutName->Data(),j),Form("Reconstructed E_{T} from #pi^{-} for %i-%i central",j*width,(j+1)*width));
1761 CreateEtaPtHisto2D(Form("EtNReconstructed%sKPlusCB%i",cutName->Data(),j),Form("Reconstructed E_{T} from K^{+} for %i-%i central",j*width,(j+1)*width));
1762 CreateEtaPtHisto2D(Form("EtNReconstructed%sKMinusCB%i",cutName->Data(),j),Form("Reconstructed E_{T} from K^{-} for %i-%i central",j*width,(j+1)*width));
1763 CreateEtaPtHisto2D(Form("EtNReconstructed%sProtonCB%i",cutName->Data(),j),Form("Reconstructed E_{T} from p for %i-%i central",j*width,(j+1)*width));
1764 CreateEtaPtHisto2D(Form("EtNReconstructed%sAntiProtonCB%i",cutName->Data(),j),Form("Reconstructed E_{T} from #bar{p} for %i-%i central",j*width,(j+1)*width));
1765 CreateEtaPtHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),j),Form("Reconstructed E_{T} from charged hadrons for %i-%i central",j*width,(j+1)*width));
1766 }
1767 }
cf6522d1 1768
1769 CreateEtaPtHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),"Reconstructed E_{T} from charged hadrons assuming they are all pions");
86d9d0dc 1770 CreateEtaPtHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),"Reconstructed E_{T} from charged hadrons assuming they are all pions");
1771 CreateEtaPtHisto2D(Form("EtReconstructed%sChargedHadronAssumingKaon",cutName->Data()),"Reconstructed E_{T} from charged hadrons assuming they are all pions");
cf6522d1 1772 CreateEtaPtHisto2D(Form("EtReconstructed%sKPlusAssumingPion",cutName->Data()),"Reconstructed E_{T} from K^{+} assuming #pi mass");
1773 CreateEtaPtHisto2D(Form("EtReconstructed%sKMinusAssumingPion",cutName->Data()),"Reconstructed E_{T} from K^{-} assuming #pi mass");
1774 CreateEtaPtHisto2D(Form("EtReconstructed%sProtonAssumingPion",cutName->Data()),"Reconstructed E_{T} from p assuming #pi mass");
1775 CreateEtaPtHisto2D(Form("EtReconstructed%sAntiProtonAssumingPion",cutName->Data()),"Reconstructed E_{T} from #bar{p} assuming #pi mass");
86d9d0dc 1776 CreateEtaPtHisto2D(Form("EtReconstructed%sPiPlusAssumingKaon",cutName->Data()),"Reconstructed E_{T} from K^{+} assuming #pi mass");
1777 CreateEtaPtHisto2D(Form("EtReconstructed%sPiMinusAssumingKaon",cutName->Data()),"Reconstructed E_{T} from K^{-} assuming #pi mass");
1778 CreateEtaPtHisto2D(Form("EtReconstructed%sKPlusAssumingKaon",cutName->Data()),"Reconstructed E_{T} from K^{+} assuming #pi mass");
1779 CreateEtaPtHisto2D(Form("EtReconstructed%sKMinusAssumingKaon",cutName->Data()),"Reconstructed E_{T} from K^{-} assuming #pi mass");
1780 CreateEtaPtHisto2D(Form("EtReconstructed%sProtonAssumingKaon",cutName->Data()),"Reconstructed E_{T} from p assuming #pi mass");
1781 CreateEtaPtHisto2D(Form("EtReconstructed%sAntiProtonAssumingKaon",cutName->Data()),"Reconstructed E_{T} from #bar{p} assuming #pi mass");
1782
1783 CreateEtaPtHisto2D(Form("EtReconstructed%sKPlusAssumingProton",cutName->Data()),"Reconstructed E_{T} from K^{+} assuming #pi mass");
1784 CreateEtaPtHisto2D(Form("EtReconstructed%sKMinusAssumingProton",cutName->Data()),"Reconstructed E_{T} from K^{-} assuming #pi mass");
1785 CreateEtaPtHisto2D(Form("EtReconstructed%sPiMinusAssumingProton",cutName->Data()),"Reconstructed E_{T} from p assuming #pi mass");
1786 CreateEtaPtHisto2D(Form("EtReconstructed%sPiPlusAssumingProton",cutName->Data()),"Reconstructed E_{T} from #bar{p} assuming #pi mass");
1787 CreateEtaPtHisto2D(Form("EtReconstructed%sProtonAssumingProton",cutName->Data()),"Reconstructed E_{T} from p assuming #pi mass");
1788 CreateEtaPtHisto2D(Form("EtReconstructed%sAntiProtonAssumingProton",cutName->Data()),"Reconstructed E_{T} from #bar{p} assuming #pi mass");
1789
f43fc416 1790 if(fBaryonEnhancement){
1791 CreateEtaPtHisto2D(Form("EtReconstructed%sProtonAssumingPionEnhanced",cutName->Data()),"Reconstructed E_{T} from p assuming #pi mass");
1792 CreateEtaPtHisto2D(Form("EtReconstructed%sAntiProtonAssumingPionEnhanced",cutName->Data()),"Reconstructed E_{T} from #bar{p} assuming #pi mass");
1793 }
cf6522d1 1794
1795 CreateEtaPtHisto2D(Form("EtReconstructed%sEPlus",cutName->Data()),"Reconstructed E_{T} from e^{+}");
1796 CreateEtaPtHisto2D(Form("EtReconstructed%sEMinus",cutName->Data()),"Reconstructed E_{T} from e^{-}");
1797
1798
1799
1800 CreateEtaPtHisto2D(Form("EtReconstructed%sLambdaDaughters",cutName->Data()),"Reconstructed E_{T} from #Lambda Daughters");
1801 CreateEtaPtHisto2D(Form("EtReconstructed%sAntiLambdaDaughters",cutName->Data()),"Reconstructed E_{T} from #bar{#Lambda} Daughters");
1802 CreateEtaPtHisto2D(Form("EtReconstructed%sK0SDaughters",cutName->Data()),"Reconstructed E_{T} from K^{0}_{S} Daughters");
0f97be4c 1803 CreateEtaPtHisto2D(Form("EtReconstructed%sLambdaDaughtersReweighted",cutName->Data()),"Reconstructed E_{T} from #Lambda Daughters");
1804 CreateEtaPtHisto2D(Form("EtReconstructed%sAntiLambdaDaughtersReweighted",cutName->Data()),"Reconstructed E_{T} from #bar{#Lambda} Daughters");
1805 CreateEtaPtHisto2D(Form("EtReconstructed%sK0SDaughtersReweighted",cutName->Data()),"Reconstructed E_{T} from K^{0}_{S} Daughters");
cf6522d1 1806 CreateEtaPtHisto2D(Form("EtReconstructed%sOmegaDaughters",cutName->Data()),"Reconstructed E_{T} from #Omega^{-} Daughters");
1807 CreateEtaPtHisto2D(Form("EtReconstructed%sAntiOmegaDaughters",cutName->Data()),"Reconstructed E_{T} from #Omega^{+} Daughters");
1808 CreateEtaPtHisto2D(Form("EtReconstructed%sXiDaughters",cutName->Data()),"Reconstructed E_{T} from #Xi^{-} Daughters");
1809 CreateEtaPtHisto2D(Form("EtReconstructed%sAntiXiDaughters",cutName->Data()),"Reconstructed E_{T} from #Xi^{+} Daughters");
49b25059 1810 CreateEtaPtHisto2D(Form("EtReconstructed%sConversionElectrons",cutName->Data()),"Reconstructed E_{T} from conversion electrons");
1811 CreateEtaPtHisto2D(Form("EtReconstructed%sSecondaryMuons",cutName->Data()),"Reconstructed E_{T} from secondary muons");//from pions
1812 CreateEtaPtHisto2D(Form("EtReconstructed%sSecondaryPions",cutName->Data()),"Reconstructed E_{T} from secondary pions");//from rescattering and sigma+-
1813 CreateEtaPtHisto2D(Form("EtReconstructed%sSecondaryProtons",cutName->Data()),"Reconstructed E_{T} from secondary protons");//from rescattering and sigma+-
cf6522d1 1814
1815 CreateIntHisto1D(Form("UnidentifiedPIDs%s",cutName->Data()),"PIDs of unidentified particles", "PID", "Number of particles",9, -4,4);
1816 CreateHisto2D(Form("MisidentifiedPIDs%s",cutName->Data()),"PIDs of misidentified particles", "PID real","PID identified",5, -.5,4.5,5, -.5,4.5);
1817 CreateHisto2D(Form("dEdxAll%s",cutName->Data()),"dE/dx for all particles","momentum (GeV/c)","dE/dx",400,0.0,maxPtdEdx,200,mindEdx,maxdEdx);
1818 CreateHisto2D(Form("dEdxPion%s",cutName->Data()),"dE/dx for #pi^{#pm}","momentum (GeV/c)","dE/dx",400,0.0,maxPtdEdx,200,mindEdx,maxdEdx);
1819 CreateHisto2D(Form("dEdxKaon%s",cutName->Data()),"dE/dx for K^{#pm}","momentum (GeV/c)","dE/dx",400,0.0,maxPtdEdx,200,mindEdx,maxdEdx);
1820 CreateHisto2D(Form("dEdxProton%s",cutName->Data()),"dE/dx for p(#bar{p})","momentum (GeV/c)","dE/dx",400,0.0,maxPtdEdx,200,mindEdx,maxdEdx);
1821 CreateHisto2D(Form("dEdxElectron%s",cutName->Data()),"dE/dx for e^{#pm}","momentum (GeV/c)","dE/dx",400,0.0,maxPtdEdx,200,mindEdx,maxdEdx);
1822 CreateHisto2D(Form("dEdxUnidentified%s",cutName->Data()),"dE/dx for unidentified particles","momentum (GeV/c)","dE/dx",400,0.0,maxPtdEdx,200,mindEdx,maxdEdx);
641e1e0c 1823 }
464aa50c 1824 delete strTPC;
1825 delete strITS;
1826 delete strTPCITS;
4e0c0fe1 1827
1828 Float_t minEt = 0.0;
1829 Float_t maxEt = 100.0;
37827f90 1830 if(fDataSet==20100) maxEt=4000.0;
4b40b2b1 1831 Int_t nbinsEt = 100;
4e0c0fe1 1832 char histoname[200];
1833 char histotitle[200];
1834 char xtitle[50];
1835 char ytitle[50];
464aa50c 1836 TString *sTPC = new TString("TPC");
1837 TString *sITS = new TString("ITS");
1838 TString *sTPCpt = new TString("0.15");
1839 TString *sITSpt = new TString("0.10");
1840 TString *sPID = new TString("");
1841 TString *sNoPID = new TString("NoPID");
1842 TString *sNoPIDString = new TString(", No PID");
1843 TString *sHadEt = new TString("HadEt");
1844 TString *sTotEt = new TString("TotEt");
1845 TString *sTotEtString = new TString("total E_{T}");
1846 TString *sHadEtString = new TString("hadronic E_{T}");
1847 TString *sFull = new TString("Full");
1848 TString *sEMCAL = new TString("EMCAL");
1849 TString *sPHOS = new TString("PHOS");
4b40b2b1 1850 float etDiff = 1.5;
7d2d1773 1851
1852 for(int tpc = 0;tpc<lastcutset;tpc++){
ea331c5d 1853 TString *detector = NULL;
1854 TString *ptstring = NULL;
4b40b2b1 1855 if(tpc==1) {detector = sTPC; ptstring = sTPCpt;}
1856 else{detector = sITS; ptstring = sITSpt;}
4e0c0fe1 1857 for(int hadet = 0;hadet<2;hadet++){
ea331c5d 1858 TString *et = NULL;
1859 TString *etstring = NULL;
4b40b2b1 1860 if(hadet==1) {et = sHadEt; etstring = sHadEtString;}
1861 else{et = sTotEt; etstring = sTotEtString;}
7d2d1773 1862 for(int type = 0;type<3;type++){
1863 if(type==0 && !fInvestigateFull) continue;
1864 if(type==1 && !fInvestigateEMCal) continue;
1865 if(type==2 && !fInvestigatePHOS) continue;
ea331c5d 1866 TString *acceptance = NULL;
4b40b2b1 1867 switch(type){
1868 case 0:
1869 acceptance = sFull;
7d2d1773 1870 etDiff = 1.5;
4b40b2b1 1871 break;
1872 case 1:
1873 acceptance = sEMCAL;
7d2d1773 1874 etDiff = 5;
4b40b2b1 1875 break;
1876 case 2:
1877 acceptance = sPHOS;
7d2d1773 1878 etDiff = 5;
4b40b2b1 1879 break;
1880 default:
1881 acceptance = sFull;
1882 }
4e0c0fe1 1883 for(int pid = 0;pid<2;pid++){
ea331c5d 1884 TString *partid = NULL;
1885 TString *partidstring = NULL;
464aa50c 1886 if(pid==1){partid = sPID; partidstring = sPID;}
1887 else{partid = sNoPID; partidstring = sNoPIDString;}
6a0df78a 1888 snprintf(histoname,200,"Sim%sMinusReco%s%sAcceptance%s%s",et->Data(),et->Data(),acceptance->Data(),detector->Data(),partid->Data());
1889 snprintf(histotitle,200,"(Simulated %s - reconstructed %s)/(Simulated %s) with %s acceptance for p_{T}>%s GeV/c%s",etstring->Data(),etstring->Data(),etstring->Data(),acceptance->Data(),ptstring->Data(),partidstring->Data());
1890 snprintf(ytitle,50,"(Simulated %s - reconstructed %s)/(Simulated %s)",etstring->Data(),etstring->Data(),etstring->Data());
1891 snprintf(xtitle,50,"Simulated %s",etstring->Data());
4b40b2b1 1892 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
7d2d1773 1893 if(hadet==0 && type==0 && fInvestigatePiKP){//we only want to do this once... not the most elegant way of coding but hey...
6a0df78a 1894 snprintf(histoname,200,"SimPiKPMinusRecoPiKP%sAcceptance%s%s",acceptance->Data(),detector->Data(),partid->Data());
1895 snprintf(histotitle,200,"(Sim PiKP - reco PiKP)/(Sim PiKP) with %s acceptance for p_{T}>%s GeV/c%s",acceptance->Data(),ptstring->Data(),partidstring->Data());
1896 snprintf(ytitle,50,"(Sim PiKP - reco PiKP)/(Sim PiKP)");
1897 snprintf(xtitle,50,"Simulated E_{T}^{#pi,K,p}");
0e866ddc 1898 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
0e866ddc 1899 }
4e0c0fe1 1900 }
1901 }
1902 }
1903 }
7d2d1773 1904 CreateHisto1D("SimPiKPEt","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt,minEt,maxEt);
0e866ddc 1905 CreateHisto1D("SimTotEt","Simulated Total E_{T}","Simulated Total E_{T}","Number of events",nbinsEt*4,minEt,maxEt);
1906 CreateHisto1D("SimHadEt","Simulated Hadronic E_{T}","Simulated Hadronic E_{T}","Number of events",nbinsEt*4,minEt,maxEt);
02710991 1907 if(fDataSet==20100){
1908 Int_t width = 5;
61e3f555 1909 if(fNCentBins<21) width = 10;
02710991 1910 for(Int_t j=0;j<fNCentBins;j++){
1911 CreateHisto1D(Form("SimTotEtCB%i",j),Form("Simulated Total E_{T} for %i-%i central",j*width,(j+1)*width),"Simulated Total E_{T}","Number of events",nbinsEt*4,minEt,maxEt);
1912 CreateHisto1D(Form("SimHadEtCB%i",j),Form("Simulated Hadronic E_{T} for %i-%i central",j*width,(j+1)*width),"Simulated Hadronic E_{T}","Number of events",nbinsEt*4,minEt,maxEt);
61e3f555 1913 CreateHisto1D(Form("SimPiKPEtCB%i",j),Form("Simulated #pi,K,p E_{T} for %i-%i central",j*width,(j+1)*width),"Simulated #pi,K,p E_{T}","Number of events",nbinsEt,minEt,maxEt);
02710991 1914 }
1915 }
0e866ddc 1916
1917 etDiff = 0.15;
1918
7d2d1773 1919 if(fInvestigateSmearing){
49b25059 1920 //======================================================================
1921
1922 snprintf(histoname,200,"SimPiKPEtMeasMinusEtRealPiKP");
1923 snprintf(histotitle,200,"Simulated (all reconstructed - primaries)/all reconstructed for reconstructed tracks only");
1924 snprintf(ytitle,50,"(primary-all)/primary");
1925 snprintf(xtitle,50,"true p, K, p E_{T} for primary tracks");
1926 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff*5,etDiff*5);
1927
1928 snprintf(histoname,200,"SimPiKPEtMinusSimAllCorrSmearedRecoOnly");
1929 snprintf(histotitle,200,"Simulated (primary-all)/primary for reconstructed tracks only");
1930 snprintf(ytitle,50,"(primary-all)/primary");
1931 snprintf(xtitle,50,"true p, K, p E_{T} for primary tracks");
1932 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff*5,etDiff*5);
1933
1934 snprintf(histoname,200,"SimPiKPEtMinusSimEffCorrRecoOnly");
1935 snprintf(histotitle,200,"(sim-reco)/sim primary #pi,k,p for p_{T}>0.15");
1936 snprintf(ytitle,50,"(sim-reco)/sim");
1937 snprintf(xtitle,50,"true p, K, p E_{T} for primary tracks");
1938 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff*5,etDiff*5);
1939
1940 snprintf(histoname,200,"SimPiKPEtMinusSimEffBkgdCorrRecoOnly");
1941 snprintf(histotitle,200,"(sim-reco)/sim primary #pi,k,p for p_{T}>0.15 with background subtraction");
1942 snprintf(ytitle,50,"(sim-reco)/sim");
1943 snprintf(xtitle,50,"true p, K, p E_{T} for primary tracks");
1944 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff*5,etDiff*5);
1945
1946 snprintf(histoname,200,"SimPiKPEtMinusSimEffCorrRecoPiOnly");
1947 snprintf(histotitle,200,"(sim-reco)/sim primary #pi for p_{T}>0.15");
1948 snprintf(ytitle,50,"(sim-reco)/sim");
1949 snprintf(xtitle,50,"true #pi E_{T} for primary tracks");
1950 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt/2,nbinsEt,-etDiff*5,etDiff*5);
1951
1952 snprintf(histoname,200,"SimPiKPEtMinusSimEffCorrRecoKOnly");
1953 snprintf(histotitle,200,"(sim-reco)/sim primary K for p_{T}>0.15");
1954 snprintf(ytitle,50,"(sim-reco)/sim");
1955 snprintf(xtitle,50,"true K E_{T} for primary tracks");
1956 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt/6,nbinsEt,-etDiff*5,etDiff*5);
1957
1958 snprintf(histoname,200,"SimPiKPEtMinusSimEffCorrRecoPOnly");
1959 snprintf(histotitle,200,"(sim-reco)/sim primary p for p_{T}>0.15");
1960 snprintf(ytitle,50,"(sim-reco)/sim");
1961 snprintf(xtitle,50,"true p E_{T} for primary tracks");
1962 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt/6,nbinsEt,-etDiff*5,etDiff*5);
1963
1964 snprintf(histoname,200,"SimPiKPEtMinusSimAllSmearedRecoOnly");
1965 snprintf(histotitle,200,"Simulated (primary-all)/primary for reconstructed tracks only");
1966 snprintf(ytitle,50,"(primary-all)/primary");
1967 snprintf(xtitle,50,"true p, K, p E_{T} for primary tracks");
1968 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff*5,0.0);
1969
1970 snprintf(histoname,200,"SimPiKPEtMinusSimPIDSmearedRecoOnly");
1971 snprintf(histotitle,200,"Simulated (true-smeared)/true for reconstructed tracks only with PID smearing");
1972 snprintf(ytitle,50,"(true-smeared)/true");
1973 snprintf(xtitle,50,"true p, K, p E_{T}");
1974 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
1975
1976 snprintf(histoname,200,"SimPiKPEtMinusSimSmearedRecoOnly");
1977 snprintf(histotitle,200,"Simulated (true-smeared)/true for reconstructed tracks only");
1978 snprintf(ytitle,50,"(true-smeared)/true");
1979 snprintf(xtitle,50,"true p, K, p E_{T}");
1980 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff/15,etDiff/15);
1981
1982 snprintf(histoname,200,"SimPiKPPtMinusSimSmearedRecoOnly");
1983 snprintf(histotitle,200,"Simulated (true-smeared)/true for reconstructed tracks only");
1984 snprintf(ytitle,50,"(true-smeared)/true");
1985 snprintf(xtitle,50,"true p, K, p p_{T}");
1986 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff/15,etDiff/15);
1987
1988 snprintf(histoname,200,"SimPiKPEtMinusSimSmearedMultRecoOnly");
1989 snprintf(histotitle,200,"Simulated (true-smeared)/true for reconstructed tracks only");
1990 snprintf(ytitle,50,"(true-smeared)/true");
1991 snprintf(xtitle,50,"number of reconstructed particles");
1992 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff/15,etDiff/15);
1993
1994 snprintf(histoname,200,"SimPiKPPtMinusSimSmearedMultRecoOnly");
1995 snprintf(histotitle,200,"Simulated (true-smeared)/true for reconstructed tracks only");
1996 snprintf(ytitle,50,"(true-smeared)/true");
1997 snprintf(xtitle,50,"number of reconstructed particles");
1998 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff/15,etDiff/15);
7d2d1773 1999
2000 //======================================================================
2001
6a0df78a 2002 snprintf(histoname,200,"SimPiKPEtMinusSimPtSmeared");
2003 snprintf(histotitle,200,"Simulated (true-smeared)/true for 0.5 percent momentum smearing");
2004 snprintf(ytitle,50,"(true-smeared)/true");
2005 snprintf(xtitle,50,"true p, K, p E_{T}");
61e3f555 2006 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
6a0df78a 2007 snprintf(histoname,200,"SimPiKPEtPtSmeared");
2008 snprintf(histotitle,200,"Simulated E_{T} for 0.5 percent momentum smearing");
2009 snprintf(ytitle,50,"Number of events");
2010 snprintf(xtitle,50,"p, K, p E_{T}");
7d2d1773 2011 CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
2012
2013 //======================================================================
2014
6a0df78a 2015 snprintf(histoname,200,"SimPiKPEtMinusSimEfficiencySmeared");
2016 snprintf(histotitle,200,"Simulated (true-smeared)/true for efficiency smearing");
2017 snprintf(ytitle,50,"(true-smeared)/true");
2018 snprintf(xtitle,50,"true p, K, p E_{T}");
7d2d1773 2019 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff*5,etDiff*5);
6a0df78a 2020 snprintf(histoname,200,"SimPiKPEtEfficiencySmeared");
2021 snprintf(histotitle,200,"Simulated E_{T} for efficiency smearing");
2022 snprintf(ytitle,50,"Number of events");
2023 snprintf(xtitle,50,"p, K, p E_{T}");
7d2d1773 2024 CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
2025
2026 //======================================================================
2027
6a0df78a 2028 snprintf(histoname,200,"SimPiKPEtMinusSimPtCutSmearedTPC");
2029 snprintf(histotitle,200,"Simulated (true-smeared)/true for p_{T}>0.15 GeV/c smearing");
2030 snprintf(ytitle,50,"(true-smeared)/true");
2031 snprintf(xtitle,50,"true p, K, p E_{T}");
7d2d1773 2032 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
6a0df78a 2033 snprintf(histoname,200,"SimPiKPEtPtCutSmearedTPC");
2034 snprintf(histotitle,200,"Simulated E_{T} for p_{T}>0.15 GeV/c smearing");
2035 snprintf(ytitle,50,"Number of events");
2036 snprintf(xtitle,50,"p, K, p E_{T}");
7d2d1773 2037 CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
2038
2039
2040 //======================================================================
2041
6a0df78a 2042 snprintf(histoname,200,"SimPiKPEtMinusSimPtCutSmearedITS");
2043 snprintf(histotitle,200,"Simulated (true-smeared)/true for p_{T}>0.10 GeV/c smearing");
2044 snprintf(ytitle,50,"(true-smeared)/true");
2045 snprintf(xtitle,50,"true p, K, p E_{T}");
7d2d1773 2046 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
6a0df78a 2047 snprintf(histoname,200,"SimPiKPEtPtCutSmearedITS");
2048 snprintf(histotitle,200,"Simulated E_{T} for p_{T}>0.10 GeV/c smearing");
2049 snprintf(ytitle,50,"Number of events");
2050 snprintf(xtitle,50,"p, K, p E_{T}");
7d2d1773 2051 CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
2052
2053 //======================================================================
2054
6a0df78a 2055 snprintf(histoname,200,"SimPiKPEtMinusSimPIDSmeared");
2056 snprintf(histotitle,200,"Simulated (true-smeared)/true for PID smearing");
2057 snprintf(ytitle,50,"(true-smeared)/true");
2058 snprintf(xtitle,50,"true p, K, p E_{T}");
7d2d1773 2059 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
6a0df78a 2060 snprintf(histoname,200,"SimPiKPEtPIDSmeared");
2061 snprintf(histotitle,200,"Simulated E_{T} for PID smearing");
2062 snprintf(ytitle,50,"Number of events");
2063 snprintf(xtitle,50,"p, K, p E_{T}");
7d2d1773 2064 CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
2065
2066 //======================================================================
2067
6a0df78a 2068 snprintf(histoname,200,"SimPiKPEtMinusSimPIDSmearedNoID");
2069 snprintf(histotitle,200,"Simulated (true-smeared)/true for PID smearing No ID");
2070 snprintf(ytitle,50,"(true-smeared)/true");
2071 snprintf(xtitle,50,"true p, K, p E_{T}");
7d2d1773 2072 CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
6a0df78a 2073 snprintf(histoname,200,"SimPiKPEtPIDSmearedNoID");
2074 snprintf(histotitle,200,"Simulated E_{T} for PID smearing No ID");
2075 snprintf(ytitle,50,"Number of events");
2076 snprintf(xtitle,50,"p, K, p E_{T}");
7d2d1773 2077 CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
2078 }
464aa50c 2079 delete sTPC;
2080 delete sITS;
2081 delete sTPCpt;
2082 delete sITSpt;
2083 delete sPID;
2084 delete sNoPID;
2085 delete sNoPIDString;
2086 delete sHadEt;
2087 delete sTotEt;
2088 delete sTotEtString;
2089 delete sHadEtString;
2090 delete sFull;
2091 delete sEMCAL;
2092 delete sPHOS;
641e1e0c 2093 CreateIntHisto1D("NEvents","Number of events","number of events","Number of events",1,0,1);
61e3f555 2094 CreateResolutionPtHisto2D("presolutionTPC","p resolution","p^{rec}","(p^{sim}-p^{rec})/p^{rec}");
2095 CreateResolutionPtHisto2D("pTresolutionTPC","p_{T} resolution","p_{T}^{rec}","(p_{T}^{sim}-p_{T}^{rec})/p_{T}^{rec}");
2096 CreateResolutionPtHisto2D("ETresolutionTPC","E_{T} resolution","E_{T}^{rec}","(E_{T}^{sim}-E_{T}^{rec})/E_{T}^{rec}");
2097 CreateResolutionPtHisto2D("pTresolutionTPCITS","p_{T} resolution","p_{T}^{rec}","(p_{T}^{sim}-p_{T}^{rec})/p_{T}^{rec}");
2098 CreateResolutionPtHisto2D("ETresolutionTPCITS","E_{T} resolution","E_{T}^{rec}","(E_{T}^{sim}-E_{T}^{rec})/E_{T}^{rec}");
2099 CreateResolutionPtHisto2D("presolutionTPCITS","p resolution","p^{rec}","(p^{sim}-p^{rec})/p^{rec}");
2100 CreateResolutionPtHisto2D("pTresolutionITS","p_{T} resolution","p_{T}^{rec}","(p_{T}^{sim}-p_{T}^{rec})/p_{T}^{rec}");
2101 CreateResolutionPtHisto2D("ETresolutionITS","E_{T} resolution","E_{T}^{rec}","(E_{T}^{sim}-E_{T}^{rec})/E_{T}^{rec}");
2102 CreateResolutionPtHisto2D("presolutionITS","p resolution","p^{rec}","(p^{sim}-p^{rec})/p^{rec}");
2103 CreatePtHisto1D("pTsimITS","p_{T}^{sim}","p_{T}^{sim}","Number of particles");
2104 CreatePtHisto1D("pTsimTPC","p_{T}^{sim}","p_{T}^{sim}","Number of particles");
2105 CreatePtHisto1D("pTsimTPCITS","p_{T}^{sim}","p_{T}^{sim}","Number of particles");
2106 CreatePtHisto1D("pTrecITS","p_{T}^{rec}","p_{T}^{rec}","Number of particles");
2107 CreatePtHisto1D("pTrecTPC","p_{T}^{rec}","p_{T}^{rec}","Number of particles");
2108 CreatePtHisto1D("pTrecTPCITS","p_{T}^{rec}","p_{T}^{rec}","Number of particles");
2109 if(fDataSet==20100){
2110 Int_t width = 5;
2111 if(fNCentBins<21) width = 10;
2112 for(Int_t j=0;j<fNCentBins;j++){
2113 CreatePtHisto1D(Form("pTsimITSCB%i",j),Form("p_{T}^{sim} for %i-%i central",j*width,(j+1)*width),"p_{T}^{sim}","Number of particles");
2114 CreatePtHisto1D(Form("pTsimTPCITSCB%i",j),Form("p_{T}^{sim} for %i-%i central",j*width,(j+1)*width),"p_{T}^{sim}","Number of particles");
2115 CreatePtHisto1D(Form("pTsimTPCCB%i",j),Form("p_{T}^{sim} for %i-%i central",j*width,(j+1)*width),"p_{T}^{sim}","Number of particles");
2116 CreatePtHisto1D(Form("pTrecITSCB%i",j),Form("p_{T}^{rec} for %i-%i central",j*width,(j+1)*width),"p_{T}^{rec}","Number of particles");
2117 CreatePtHisto1D(Form("pTrecTPCITSCB%i",j),Form("p_{T}^{rec} for %i-%i central",j*width,(j+1)*width),"p_{T}^{rec}","Number of particles");
2118 CreatePtHisto1D(Form("pTrecTPCCB%i",j),Form("p_{T}^{rec} for %i-%i central",j*width,(j+1)*width),"p_{T}^{rec}","Number of particles");
2119 }
2120 }
641e1e0c 2121
641e1e0c 2122}
2123