#include "AliCentrality.h"
#include "AliLog.h"
#include "AliPWG0Helper.h"
+#include "AliPIDResponse.h"
+#include "AliTPCPIDResponse.h"
+#include "AliInputEventHandler.h"
+#include "AliAnalysisManager.h"
+#include "AliGenEventHeader.h"
+#include "AliGenCocktailEventHeader.h"
+#include "AliGenHijingEventHeader.h"
//class AliPWG0Helper;
//#include "$ALICE_ROOT/PWG0/AliPWG0Helper.h"
Float_t AliAnalysisHadEtMonteCarlo::fgSmearWidths[4] = {0.005,0.006,0.007,0.008};
AliAnalysisHadEtMonteCarlo::AliAnalysisHadEtMonteCarlo():AliAnalysisHadEt()
+ ,checkLabelForHIJING(kFALSE)
+ ,fNMCProducedMin(0)
+ ,fNMCProducedMax(0)
,fSimPiKPEt(0)
+ ,fSimRawEtTPC(0)
+ ,fSimRawEtITS(0)
,fSimHadEt(0)
,fSimTotEt(0)
,fSimPiKPEtShouldBeReco(0)
,fRequireITSHits(0)
,fBaryonEnhancement(0)
,fUseRecoPt(0)
+ ,kIsOfflineV0AND(0)
+ ,kIsOfflineMB(0)
+ ,kDoTriggerChecks(0)
+ ,kDoTriggerChecksOnly(0)
,fPtSmearer(0)
,fHadEtReco(0)
{
fSimHadEt=0.0;
fSimTotEt=0.0;
fSimPiKPEt=0.0;
+ fSimRawEtTPC=0.0;
+ fSimRawEtITS=0.0;
}
Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
{ // analyse MC and real event info
return 0;
}
AliStack *stack = mcEvent->Stack();
+
+ if(checkLabelForHIJING) SetGeneratorMinMaxParticles(mcEvent);
fCentBin= -1;
fGoodEvent = kTRUE;//for p+p collisions if we made it this far we have a good event
- if(fDataSet==20100){//If this is Pb+Pb
- AliCentrality *centrality = realEvent->GetCentrality();
- if(fNCentBins<21) fCentBin= centrality->GetCentralityClass10(fCentralityMethod);
- else{ fCentBin= centrality->GetCentralityClass5(fCentralityMethod);}
+ if(fDataSet==20100 ||fDataSet==2011 ){//If this is Pb+Pb
+// AliCentrality *centrality2 = realEvent->GetCentrality();
+// if(fNCentBins<21) fCentBin= centrality2->GetCentralityClass10(fCentralityMethod);
+// else{ fCentBin= centrality2->GetCentralityClass5(fCentralityMethod);}
+// cout<<"centrality "<<fCentBin<<endl;
+ AliCentrality *centrality = realEvent->GetCentrality();
+ fCentBin = GetCentralityBin(fNCentBins, centrality);
if(fCentBin ==-1) fGoodEvent = kFALSE;//but for Pb+Pb events we don't want to count events where we did not find a centrality
}
AnalyseEvent(ev);
-
+ if(kDoTriggerChecksOnly) return 1;//If we are only doing trigger checks, don't bother with all of the reconstructed stuff
//for PID
- 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.
+ if(kDoTriggerChecks && (!kIsOfflineV0AND ||!kIsOfflineMB ) ){return 1;}//In this case we are just after trigger efficiencies and don't care about the ET reconstructed.
+ //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.
//=============================================
for (Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++)
{
AliESDtrack *track = dynamic_cast<AliESDtrack*> (list->At(iTrack));
+ UInt_t label = (UInt_t)TMath::Abs(track->GetLabel());
+ //if(checkLabelForHIJING && !IsHIJINGLabel(label,mcEvent,stack) ){cout<<"I am rejecting this particle because it is not HIJING"<<endl;}
+ if(checkLabelForHIJING && !IsHIJINGLabel(label,mcEvent,stack) ) continue;
if (!track)
{
Printf("ERROR: Could not get track %d", iTrack);
}
else{
Float_t nSigmaPion,nSigmaProton,nSigmaKaon,nSigmaElectron;
- pID->MakeTPCPID(track);
- pID->MakeITSPID(track);
+// pID->MakeTPCPID(track);
+// pID->MakeITSPID(track);
if(cutset!=1){
- nSigmaPion = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kPion));
- nSigmaProton = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kProton));
- nSigmaKaon = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kKaon));
- nSigmaElectron = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kElectron));
+ nSigmaPion = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(track, AliPID::kPion));
+ nSigmaProton = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(track, AliPID::kProton));
+ nSigmaKaon =TMath::Abs( fPIDResponse->NumberOfSigmasTPC(track, AliPID::kKaon));
+ nSigmaElectron =TMath::Abs( fPIDResponse->NumberOfSigmasTPC(track, AliPID::kElectron));
+// nSigmaPion = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kPion));
+// nSigmaProton = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kProton));
+// nSigmaKaon = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kKaon));
+// nSigmaElectron = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kElectron));
}
else{
- nSigmaPion = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kPion));
- nSigmaProton = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kProton));
- nSigmaKaon = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kKaon));
- nSigmaElectron = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kElectron));
+ nSigmaPion = TMath::Abs(fPIDResponse->NumberOfSigmasITS(track, AliPID::kPion));
+ nSigmaProton = TMath::Abs(fPIDResponse->NumberOfSigmasITS(track, AliPID::kProton));
+ nSigmaKaon = TMath::Abs(fPIDResponse->NumberOfSigmasITS(track, AliPID::kKaon));
+ nSigmaElectron = TMath::Abs(fPIDResponse->NumberOfSigmasITS(track, AliPID::kElectron));
+// nSigmaPion = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kPion));
+// nSigmaProton = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kProton));
+// nSigmaKaon = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kKaon));
+// nSigmaElectron = TMath::Abs(pID->NumberOfSigmasITS(track,AliPID::kElectron));
}
// bool isPion = (nSigmaPion<3.0 && nSigmaProton>2.0 && nSigmaKaon>2.0);
// bool isElectron = (nSigmaElectron<2.0 && nSigmaPion>4.0 && nSigmaProton>3.0 && nSigmaKaon>3.0);
FillHisto2D(Form("dEdxAll%s",cutName->Data()),track->P(),dEdx,1.0);
- UInt_t label = (UInt_t)TMath::Abs(track->GetLabel());
- TParticle *simPart = stack->Particle(label);
+ TParticle *simPart = stack->Particle(label);
if(!simPart) {
Printf("no MC particle\n");
continue;
//for calculating et as it's done in the reconstructed data
Float_t corrBkgd=0.0;
Float_t corrNotID=0.0;
- Float_t corrNoID=0.0;// = fHadEtReco->GetCorrections()->GetNotIDCorrectionNoPID(track->Pt());
+ //Float_t corrNoID=0.0;// = fHadEtReco->GetCorrections()->GetNotIDCorrectionNoPID(track->Pt());
Float_t corrEff = 0.0;
- Float_t corrEffNoID = 0.0;
+ //Float_t corrEffNoID = 0.0;
Float_t et = 0.0;
if(cutset==2){//TPC
corrBkgd = fHadEtReco->GetCorrections()->GetBackgroundCorrectionTPC(track->Pt());
- corrEffNoID = fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionHadron(track->Pt(),fCentBin);
+ //corrEffNoID = fHadEtReco->GetCorrections()->GetTPCEfficiencyCorrectionHadron(track->Pt(),fCentBin);
corrNotID = fHadEtReco->GetCorrections()->GetNotIDConstCorrectionTPC();
- corrNoID = fHadEtReco->GetCorrections()->GetNotIDConstCorrectionTPCNoID();
+ //corrNoID = fHadEtReco->GetCorrections()->GetNotIDConstCorrectionTPCNoID();
}
if(cutset==1){//ITS
corrBkgd = fHadEtReco->GetCorrections()->GetBackgroundCorrectionITS(track->Pt());
- corrEffNoID = fHadEtReco->GetCorrections()->GetITSEfficiencyCorrectionHadron(track->Pt(),fCentBin);
+ //corrEffNoID = fHadEtReco->GetCorrections()->GetITSEfficiencyCorrectionHadron(track->Pt(),fCentBin);
corrNotID = fHadEtReco->GetCorrections()->GetNotIDConstCorrectionITS();
- corrNoID = fHadEtReco->GetCorrections()->GetNotIDConstCorrectionITSNoID();
+ //corrNoID = fHadEtReco->GetCorrections()->GetNotIDConstCorrectionITSNoID();
}
+
bool isprimary = stack->IsPhysicalPrimary(label);
if (TMath::Abs(track->Eta()) < fHadEtReco->GetCorrections()->GetEtaCut()){
if(isPion){
if(!isPion && !isProton && !isKaon && !unidentified){
eTBkgdAsReconstructed += et*corrBkgd*corrEff*corrNotID;
}
- Int_t pdgCode = simPart->GetPDG(0)->PdgCode();
- if(pdgCode==fgPiPlusCode ||pdgCode==fgPiMinusCode){eTtotalAsReconstructedPi+=et*corrBkgd*corrEff*corrNotID;}
- if(pdgCode==fgKPlusCode ||pdgCode==fgKMinusCode){eTtotalAsReconstructedK+=et*corrBkgd*corrEff*corrNotID;}
- if(pdgCode==fgProtonCode ||pdgCode==fgAntiProtonCode){eTtotalAsReconstructedP+=et*corrBkgd*corrEff*corrNotID;}
+ TParticlePDG *pdg = simPart->GetPDG(0);
+ if(pdg){
+ Int_t pdgCode = simPart->GetPDG(0)->PdgCode();
+ if(pdgCode==fgPiPlusCode ||pdgCode==fgPiMinusCode){eTtotalAsReconstructedPi+=et*corrBkgd*corrEff*corrNotID;}
+ if(pdgCode==fgKPlusCode ||pdgCode==fgKMinusCode){eTtotalAsReconstructedK+=et*corrBkgd*corrEff*corrNotID;}
+ if(pdgCode==fgProtonCode ||pdgCode==fgAntiProtonCode){eTtotalAsReconstructedP+=et*corrBkgd*corrEff*corrNotID;}
+ }
}
}
if(cutset==2) eTtotalSimAll += Et(simPart);
if(stack->IsPhysicalPrimary(label)){
if (TMath::Abs(simPart->Eta()) < fHadEtReco->GetCorrections()->GetEtaCut()){
+ TParticlePDG *pdg = simPart->GetPDG(0);
+ if(!pdg) continue;
Int_t pdgCode = simPart->GetPDG(0)->PdgCode();
Int_t mypid = 0;
if(pdgCode==AliAnalysisHadEt::fgPiPlusCode) mypid = 1;
if(pdgCode==fgAntiProtonCode) mypid = 2;
if(pdgCode==fgKMinusCode) mypid = 3;
if(pdgCode==fgEMinusCode) mypid = 4;
- bool filled = false;
+ //bool filled = false;
//for smearing investigations
if(fInvestigateSmearing && cutset==2){
pTtotalReco += simPart->Pt();
if( !fRunLightweight){
FillHisto2D(Form("EtReconstructed%sPiPlus",cutName->Data()),pT,eta,myEt);
FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sPiPlus",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sPiPlus",cutName->Data()),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,1.0);
if(fCentBin>=0){//if a centrality bin was defined
- FillHisto2D(Form("EtNReconstructed%sPiPlusCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sPiPlusCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
}
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEt);
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEtP);
FillHisto2D(Form("EtReconstructed%sPiPlusAssumingKaon",cutName->Data()),pT,eta,myEtK);
FillHisto2D(Form("EtReconstructed%sPiPlusAssumingProton",cutName->Data()),pT,eta,myEtP);
}
- filled = true;
+ //filled = true;
}
if(pdgCode == fgPiMinusCode){
float myEt = Et(simPart);
if( !fRunLightweight){
FillHisto2D(Form("EtReconstructed%sPiMinus",cutName->Data()),pT,eta,myEt);
FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sPiMinus",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sPiMinus",cutName->Data()),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,1.0);
if(fCentBin>=0){//if a centrality bin was defined
- FillHisto2D(Form("EtNReconstructed%sPiMinusCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sPiMinusCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
}
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEt);
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEtP);
FillHisto2D(Form("EtReconstructed%sPiMinusAssumingKaon",cutName->Data()),pT,eta,myEtK);
FillHisto2D(Form("EtReconstructed%sPiMinusAssumingProton",cutName->Data()),pT,eta,myEtP);
}
- filled = true;
+ //filled = true;
}
if(pdgCode == fgKPlusCode){
float myEt = Et(simPart);
if( !fRunLightweight){
FillHisto2D(Form("EtReconstructed%sKPlus",cutName->Data()),pT,eta,myEt);
FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sKPlus",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sKPlus",cutName->Data()),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,1.0);
if(fCentBin>=0){//if a centrality bin was defined
- FillHisto2D(Form("EtNReconstructed%sKPlusCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sKPlusCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
}
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEtPi);
FillHisto2D(Form("EtReconstructed%sKPlusAssumingPion",cutName->Data()),pT,eta,myEtPi);
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEtP);
FillHisto2D(Form("EtReconstructed%sKPlusAssumingProton",cutName->Data()),pT,eta,myEtP);
}
- filled = true;
+ //filled = true;
}
if(pdgCode == fgKMinusCode){
float myEt = Et(simPart);
if( !fRunLightweight){
FillHisto2D(Form("EtReconstructed%sKMinus",cutName->Data()),pT,eta,myEt);
FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sKMinus",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sKMinus",cutName->Data()),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,1.0);
if(fCentBin>=0){//if a centrality bin was defined
- FillHisto2D(Form("EtNReconstructed%sKMinusCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sKMinusCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
}
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEtPi);
FillHisto2D(Form("EtReconstructed%sKMinusAssumingPion",cutName->Data()),pT,eta,myEtPi);
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEtP);
FillHisto2D(Form("EtReconstructed%sKMinusAssumingProton",cutName->Data()),pT,eta,myEtP);
}
- filled = true;
+ //filled = true;
}
if(pdgCode == fgProtonCode){
float myEt = Et(simPart);
if( !fRunLightweight){
FillHisto2D(Form("EtReconstructed%sProton",cutName->Data()),pT,eta,myEt);
FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sProton",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sProton",cutName->Data()),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,1.0);
if(fCentBin>=0){//if a centrality bin was defined
- FillHisto2D(Form("EtNReconstructed%sProtonCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sProtonCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
}
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEtPi);
FillHisto2D(Form("EtReconstructed%sProtonAssumingPion",cutName->Data()),pT,eta,myEtPi);
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEt);
FillHisto2D(Form("EtReconstructed%sProtonAssumingProton",cutName->Data()),pT,eta,myEt);
}
- filled = true;
+ //filled = true;
if( !fRunLightweight){
if(fBaryonEnhancement){
if( !fRunLightweight){
FillHisto2D(Form("EtReconstructed%sAntiProton",cutName->Data()),pT,eta,myEt);
FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sAntiProton",cutName->Data()),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sAntiProton",cutName->Data()),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),pT,eta,1.0);
if(fCentBin>=0){//if a centrality bin was defined
- FillHisto2D(Form("EtNReconstructed%sAntiProtonCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
- FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,myEt);
+ FillHisto2D(Form("EtNReconstructed%sAntiProtonCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
+ FillHisto2D(Form("EtNReconstructed%sChargedHadronCB%i",cutName->Data(),fCentBin),pT,eta,1.0);
}
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingPion",cutName->Data()),pT,eta,myEtPi);
FillHisto2D(Form("EtReconstructed%sAntiProtonAssumingPion",cutName->Data()),pT,eta,myEtPi);
FillHisto2D(Form("EtReconstructed%sChargedHadronAssumingProton",cutName->Data()),pT,eta,myEt);
FillHisto2D(Form("EtReconstructed%sAntiProtonAssumingProton",cutName->Data()),pT,eta,myEt);
}
- filled = true;
+ //filled = true;
if( !fRunLightweight){
if(fBaryonEnhancement){
float enhancement = ProtonBaryonEnhancement(track->Pt());
FillHisto2D(Form("EtReconstructed%sMisidentifiedElectrons",cutName->Data()),track->Pt(),track->Eta(),myEtPi);
}
}
- filled = true;
+ //filled = true;
}
if(pdgCode == fgEMinusCode){
if( !fRunLightweight){
float myEt = Et(simPart);
FillHisto2D(Form("EtReconstructed%sEMinus",cutName->Data()),simPart->Pt(),simPart->Eta(),myEt);
}
- filled = true;
+ //filled = true;
}
if( !fRunLightweight){
if(myEtReco>0.0){FillHisto2D(Form("ETresolution%s",cutName->Data()),myEtReco,(myEtSim-myEtReco)/myEtReco,1.0);}
if(isProton) myrecoEt = Et(track->P(),track->Theta(),fgProtonCode,track->Charge());
if(isKaon) myrecoEt = Et(track->P(),track->Theta(),fgKPlusCode,track->Charge());
if (TMath::Abs(simPart->Eta()) < fHadEtReco->GetCorrections()->GetEtaCut()){
- TParticle *mom = stack->Particle(simPart->GetFirstMother());
+ TParticle *mom = NULL;
+ if(simPart->GetFirstMother()>=0) mom= stack->Particle(simPart->GetFirstMother());
if(mom){
TParticlePDG *pc = mom->GetPDG(0);
if(pc){
float myEt = Et(simPart);
float pT = simPart->Pt();
float eta = simPart->Eta();
+ TParticlePDG *simpdg = simPart->GetPDG(0);
+ if(!simpdg) continue;
eTtotalRecoBkgd+=myEt;
if(fUseRecoPt){//Then we switch the pT and the Et
myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
float pT = simPart->Pt();
float eta = simPart->Eta();
eTtotalRecoBkgd+=myEt;
+ TParticlePDG *simpdg = simPart->GetPDG(0);
+ if(!simpdg) continue;
if(fUseRecoPt){//Then we switch the pT and the Et
myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
pT = track->Pt();
float pT = simPart->Pt();
float eta = simPart->Eta();
eTtotalRecoBkgd+=myEt;
+ TParticlePDG *simpdg = simPart->GetPDG(0);
+ if(!simpdg) continue;
if(fUseRecoPt){//Then we switch the pT and the Et
myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
pT = track->Pt();
float pT = simPart->Pt();
float eta = simPart->Eta();
eTtotalRecoBkgd+=myEt;
+ TParticlePDG *simpdg = simPart->GetPDG(0);
+ if(!simpdg) continue;
if(fUseRecoPt){//Then we switch the pT and the Et
myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
pT = track->Pt();
float pT = simPart->Pt();
float eta = simPart->Eta();
eTtotalRecoBkgd+=myEt;
+ TParticlePDG *simpdg = simPart->GetPDG(0);
+ if(!simpdg) continue;
if(fUseRecoPt){//Then we switch the pT and the Et
myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
pT = track->Pt();
float pT = simPart->Pt();
float eta = simPart->Eta();
eTtotalRecoBkgd+=myEt;
+ TParticlePDG *simpdg = simPart->GetPDG(0);
+ if(!simpdg) continue;
if(fUseRecoPt){//Then we switch the pT and the Et
myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
pT = track->Pt();
float pT = simPart->Pt();
float eta = simPart->Eta();
eTtotalRecoBkgd+=myEt;
+ TParticlePDG *simpdg = simPart->GetPDG(0);
+ if(!simpdg) continue;
if(fUseRecoPt){//Then we switch the pT and the Et
myEt = Et(track->P(),track->Theta(),simPart->GetPDG(0)->PdgCode(),track->Charge());
pT = track->Pt();
}
if(mom->GetFirstMother()>0){
- TParticle *grandma = stack->Particle(mom->GetFirstMother());
+ TParticle *grandma = NULL;
+ if(mom->GetFirstMother()>=0) stack->Particle(mom->GetFirstMother());
if(grandma){
+ TParticlePDG *mompdg = mom->GetPDG(0);
+ if(!mompdg) continue;
Int_t pdgCodeMom = mom->GetPDG(0)->PdgCode();
if(pdgCodeMom==fgPiPlusCode || pdgCodeMom==fgPiMinusCode || pdgCodeMom==fgProtonCode ||pdgCodeMom==fgAntiProtonCode || pdgCodeMom==fgKPlusCode || pdgCode==fgKMinusCode){
+ TParticlePDG *grandmapdg = grandma->GetPDG(0);
+ if(!grandmapdg) continue;
Int_t pdgCodeGrandma = grandma->GetPDG(0)->PdgCode();
if(pdgCodeGrandma == fgXiCode){
}
if(!written){
int mycode = simPart->GetPDG(0)->PdgCode();
+ if(!mycode) continue;
if( (pdgCode == fgGammaCode || pdgCode == fgPi0Code) && (mycode==fgEPlusCode||mycode==fgEMinusCode)){
written = true;
float myEt = Et(simPart);
if(eTtotalSim>0.0) FillHisto2D("SimPiKPEtMinusSimSmearedMultRecoOnly",nReco,(eTtotalSim-eTtotalReco)/eTtotalSim,1.0);
if(pTtotalSim>0.0) FillHisto2D("SimPiKPPtMinusSimSmearedMultRecoOnly",nReco,(pTtotalSim-pTtotalReco)/pTtotalSim,1.0);
}
- delete pID;
+ // delete pID;
delete strTPC;
delete strITS;
delete strTPCITS;
// Let's play with the stack!
AliStack *stack = mcEvent->Stack();
+
Int_t nPrim = stack->GetNtrack();
Float_t fSimPiKPEtPtSmeared = 0;
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
+ if(checkLabelForHIJING && !IsHIJINGLabel(iPart,mcEvent,stack) ) continue;
+
if (!part)
{
Printf("ERROR: Could not get particle %d", iPart);
if (stack->IsPhysicalPrimary(iPart)){//primaries
if (TMath::Abs(part->Eta()) < fHadEtReco->GetCorrections()->GetEtaCut()) {
-
+ TParticlePDG *pdg = part->GetPDG(0);
+ if(!pdg) continue;
Int_t pdgCode = part->GetPDG(0)->PdgCode();
bool filled = false;
//Investigating smearing...
//To investigate Smearing...
Float_t myet = Et(part);
fSimPiKPEt += myet;
+ if(part->Pt()>0.150) fSimRawEtTPC += myet;
+ if(part->Pt()>0.100) fSimRawEtITS += myet;
Float_t theta = part->Theta();
Short_t charge = 1;
Float_t momentum = part->P();
Int_t pdgCodeMom = -99999999;
float momEta = -30;
float mompT = -5;
- if(part->GetFirstMother()){
+ if(part->GetFirstMother()>=0){
mom = stack->Particle(part->GetFirstMother());
- pdgCodeMom = mom->GetPDG(0)->PdgCode();
- momEta = mom->Eta();
- mompT = mom->Pt();
+ if(mom->GetPDG(0)){
+ pdgCodeMom = mom->GetPDG(0)->PdgCode();
+ momEta = mom->Eta();
+ mompT = mom->Pt();
+ }
}
//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
if(pdgCodeMom == fgEtaCode){
FillHisto1D("SimTotEt",fSimTotEt,1.0);
FillHisto1D("SimHadEt",fSimHadEt,1.0);
FillHisto1D("SimPiKPEt",fSimPiKPEt,1.0);
- if(AliPWG0Helper::GetEventProcessType(mcEvent->Header()) == AliPWG0Helper::kND){
+ FillHisto1D("SimRawEtTPC",fSimRawEtTPC,1.0);
+ FillHisto1D("SimRawEtITS",fSimRawEtITS,1.0);
+ if((fDataSet!=20100 || fDataSet==2011) && AliPWG0Helper::GetEventProcessType(mcEvent->Header()) == AliPWG0Helper::kND){
FillHisto1D("SimHadEtND",fSimHadEt,1.0);
- FillHisto1D("SimTotEtND",fSimHadEt,1.0);
+ FillHisto1D("SimTotEtND",fSimTotEt,1.0);
FillHisto1D("NEventsND",0.5,1);
FillHisto1D("SimPiKPEtND",fSimPiKPEt,1.0);
+ FillHisto1D("SimRawEtNDTPC",fSimRawEtTPC,1.0);
+ FillHisto1D("SimRawEtNDITS",fSimRawEtITS,1.0);
+ if(kIsOfflineV0AND){
+ FillHisto1D("SimHadEtNDV0AND",fSimHadEt,1.0);
+ FillHisto1D("SimTotEtNDV0AND",fSimTotEt,1.0);
+ FillHisto1D("NEventsNDV0AND",0.5,1);
+ FillHisto1D("SimPiKPEtNDV0AND",fSimPiKPEt,1.0);
+ FillHisto1D("SimRawEtNDV0ANDTPC",fSimRawEtTPC,1.0);
+ FillHisto1D("SimRawEtNDV0ANDITS",fSimRawEtITS,1.0);
+ }
+ if(kIsOfflineMB){
+ FillHisto1D("SimHadEtNDMB",fSimHadEt,1.0);
+ FillHisto1D("SimTotEtNDMB",fSimTotEt,1.0);
+ FillHisto1D("NEventsNDMB",0.5,1);
+ FillHisto1D("SimPiKPEtNDMB",fSimPiKPEt,1.0);
+ FillHisto1D("SimRawEtNDMBTPC",fSimRawEtTPC,1.0);
+ FillHisto1D("SimRawEtNDMBITS",fSimRawEtITS,1.0);
+ }
}
- if(AliPWG0Helper::GetEventProcessType(mcEvent->Header()) == AliPWG0Helper::kSD){
+ if((fDataSet!=20100||fDataSet==2011) && AliPWG0Helper::GetEventProcessType(mcEvent->Header()) == AliPWG0Helper::kSD){
FillHisto1D("SimHadEtSD",fSimHadEt,1.0);
- FillHisto1D("SimTotEtSD",fSimHadEt,1.0);
+ FillHisto1D("SimTotEtSD",fSimTotEt,1.0);
FillHisto1D("NEventsSD",0.5,1);
FillHisto1D("SimPiKPEtSD",fSimPiKPEt,1.0);
+ FillHisto1D("SimRawEtSDTPC",fSimRawEtTPC,1.0);
+ FillHisto1D("SimRawEtSDITS",fSimRawEtITS,1.0);
+ if(kIsOfflineV0AND){
+ FillHisto1D("SimHadEtSDV0AND",fSimHadEt,1.0);
+ FillHisto1D("SimTotEtSDV0AND",fSimTotEt,1.0);
+ FillHisto1D("NEventsSDV0AND",0.5,1);
+ FillHisto1D("SimPiKPEtSDV0AND",fSimPiKPEt,1.0);
+ FillHisto1D("SimRawEtSDV0ANDTPC",fSimRawEtTPC,1.0);
+ FillHisto1D("SimRawEtSDV0ANDITS",fSimRawEtITS,1.0);
+ }
+ if(kIsOfflineMB){
+ FillHisto1D("SimHadEtSDMB",fSimHadEt,1.0);
+ FillHisto1D("SimTotEtSDMB",fSimTotEt,1.0);
+ FillHisto1D("NEventsSDMB",0.5,1);
+ FillHisto1D("SimPiKPEtSDMB",fSimPiKPEt,1.0);
+ FillHisto1D("SimRawEtSDMBTPC",fSimRawEtTPC,1.0);
+ FillHisto1D("SimRawEtSDMBITS",fSimRawEtITS,1.0);
+ }
}
- if(AliPWG0Helper::GetEventProcessType(mcEvent->Header()) == AliPWG0Helper::kDD){
+ if((fDataSet!=20100 || fDataSet==2011) && AliPWG0Helper::GetEventProcessType(mcEvent->Header()) == AliPWG0Helper::kDD){
FillHisto1D("SimHadEtDD",fSimHadEt,1.0);
- FillHisto1D("SimTotEtDD",fSimHadEt,1.0);
+ FillHisto1D("SimTotEtDD",fSimTotEt,1.0);
FillHisto1D("NEventsDD",0.5,1);
- FillHisto1D("SimPiKPEtSD",fSimPiKPEt,1.0);
+ FillHisto1D("SimPiKPEtDD",fSimPiKPEt,1.0);
+ FillHisto1D("SimRawEtDDTPC",fSimRawEtTPC,1.0);
+ if(kIsOfflineV0AND){
+ FillHisto1D("SimHadEtDDV0AND",fSimHadEt,1.0);
+ FillHisto1D("SimTotEtDDV0AND",fSimTotEt,1.0);
+ FillHisto1D("NEventsDDV0AND",0.5,1);
+ FillHisto1D("SimPiKPEtDDV0AND",fSimPiKPEt,1.0);
+ FillHisto1D("SimRawEtDDV0ANDTPC",fSimRawEtTPC,1.0);
+ FillHisto1D("SimRawEtDDV0ANDITS",fSimRawEtITS,1.0);
+ }
+ if(kIsOfflineMB){
+ FillHisto1D("SimHadEtDDMB",fSimHadEt,1.0);
+ FillHisto1D("SimTotEtDDMB",fSimTotEt,1.0);
+ FillHisto1D("NEventsDDMB",0.5,1);
+ FillHisto1D("SimPiKPEtDDMB",fSimPiKPEt,1.0);
+ FillHisto1D("SimRawEtDDMBTPC",fSimRawEtTPC,1.0);
+ FillHisto1D("SimRawEtDDMBITS",fSimRawEtITS,1.0);
+ }
}
if(fCentBin != -1){//if we have Pb+Pb and a centrality bin was found
if(fSimTotEt>0.0) FillHisto1D(Form("SimTotEtCB%i",fCentBin),fSimTotEt,1.0);
}
void AliAnalysisHadEtMonteCarlo::CreateHistograms(){
//for simulated Et only (no reconstruction)
+
+ AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
+ if (!man) {
+ AliFatal("Analysis manager needed");
+ return;
+ }
+ AliInputEventHandler *inputHandler=dynamic_cast<AliInputEventHandler*>(man->GetInputEventHandler());
+ if (!inputHandler) {
+ AliFatal("Input handler needed");
+ return;
+ }
+
+ //pid response object
+ fPIDResponse=inputHandler->GetPIDResponse();
+ if (!fPIDResponse) AliError("PIDResponse object was not created");
+
if( !fRunLightweight){
CreateEtaPtHisto2D(TString("EtSimulatedPiPlus"),TString("Simulated E_{T} from #pi^{+}"));
CreateEtaPtHisto2D("EtSimulatedPiMinus","Simulated E_{T} from #pi^{-}");
CreateEtaPtHisto2D("EtNSimulatedAntiProtonEnhanced","Number of simulated #bar{p}");
}
CreateEtaPtHisto2D("EtNSimulatedChargedHadron","Number of simulated charged hadrons");
- if(fDataSet==20100){//If this is Pb+Pb
+ if(fDataSet==20100 || fDataSet==2011){//If this is Pb+Pb
Int_t width = 5;
if(fNCentBins<21) width = 10;
for(Int_t i=0;i<fNCentBins;i++){
CreateEtaPtHisto2D(Form("EtNReconstructed%sAntiProtonEnhanced",cutName->Data()),"Reconstructed E_{T} from #bar{p}");
}
CreateEtaPtHisto2D(Form("EtNReconstructed%sChargedHadron",cutName->Data()),"Reconstructed E_{T} from charged hadrons");
- if(fDataSet==20100){//If this is Pb+Pb
+ if(fDataSet==20100||fDataSet==2011){//If this is Pb+Pb
Int_t width = 5;
if(fNCentBins<21) width = 10;
for(Int_t j=0;j<fNCentBins;j++){
Float_t minEt = 0.0;
Float_t maxEt = 100.0;
- if(fDataSet==20100) maxEt=4000.0;
+ Float_t minEtPiKP = 0.0;
+ Float_t maxEtPiKP = 100.0;
+ if(fDataSet==20100 || fDataSet==2011){
+ maxEt=4000.0;
+ maxEtPiKP = 2500;
+ }
+ if(fDataSet==2013){
+ maxEt=100.0;
+ maxEtPiKP = 100.0;
+ }
Int_t nbinsEt = 100;
char histoname[200];
char histotitle[200];
TString *sHadEt = new TString("HadEt");
TString *sTotEt = new TString("TotEt");
TString *sPiKPEt = new TString("PiKPEt");
+ TString *sRawEt = new TString("RawEt");
TString *sTotEtString = new TString("total E_{T}");
TString *sHadEtString = new TString("hadronic E_{T}");
TString *sPiKPEtString = new TString("E_{T}^{#pi,K,p}");
+ TString *sRawEtString = new TString("E_{T}^{raw}");
TString *sFull = new TString("Full");
TString *sEMCAL = new TString("EMCAL");
TString *sPHOS = new TString("PHOS");
float etDiff = 1.5;
float etDiffLow = etDiff;
- if(fDataSet!=20100){//If this is p+p
+ if(fDataSet!=20100 && fDataSet!=2011){//If this is p+p
etDiffLow = 2.5;
}
snprintf(histotitle,200,"Simulated %s vs reconstructed %s with %s acceptance for p_{T}>%s GeV/c%s",sPiKPEtString->Data(),sPiKPEtString->Data(),acceptance->Data(),ptstring->Data(),partidstring->Data());
snprintf(ytitle,50,"Reconstructed %s",sPiKPEtString->Data());
snprintf(xtitle,50,"Simulated %s",sPiKPEtString->Data());
- CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt*4,minEt,maxEt,nbinsEt*4,minEt,maxEt);
+ CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt*4,minEtPiKP,maxEtPiKP,nbinsEt*4,minEtPiKP,maxEtPiKP);
+
+ //And for the raw ET
+ snprintf(histoname,200,"Sim%sVsReco%s%sAcceptance%s%s",sRawEt->Data(),sRawEt->Data(),acceptance->Data(),detector->Data(),partid->Data());
+ snprintf(histotitle,200,"Simulated %s vs reconstructed %s with %s acceptance for p_{T}>%s GeV/c%s",sRawEtString->Data(),sRawEtString->Data(),acceptance->Data(),ptstring->Data(),partidstring->Data());
+ snprintf(ytitle,50,"Reconstructed %s",sRawEtString->Data());
+ snprintf(xtitle,50,"Simulated %s",sRawEtString->Data());
+ CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt*4,minEtPiKP,maxEtPiKP,nbinsEt*4,minEtPiKP,maxEtPiKP);
}
}
}
}
}
- CreateHisto1D("SimPiKPEt","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEt*4,maxEt*4);
- CreateHisto1D("SimPiKPEtND","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEt*4,maxEt*4);
- CreateHisto1D("SimPiKPEtDD","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEt*4,maxEt*4);
- CreateHisto1D("SimPiKPEtSD","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEt*4,maxEt*4);
+ CreateHisto1D("SimPiKPEt","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimPiKPEtND","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimPiKPEtDD","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimPiKPEtSD","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimPiKPEtNDV0AND","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimPiKPEtDDV0AND","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimPiKPEtSDV0AND","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimPiKPEtNDMB","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimPiKPEtDDMB","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimPiKPEtSDMB","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtTPC","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtNDTPC","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtDDTPC","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtSDTPC","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtNDV0ANDTPC","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtDDV0ANDTPC","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtSDV0ANDTPC","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtNDMBTPC","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtDDMBTPC","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtSDMBTPC","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtITS","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtNDITS","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtDDITS","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtSDITS","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtNDV0ANDITS","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtDDV0ANDITS","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtSDV0ANDITS","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtNDMBITS","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtDDMBITS","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
+ CreateHisto1D("SimRawEtSDMBITS","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt*4,minEtPiKP,maxEtPiKP);
CreateHisto1D("SimTotEt","Simulated Total E_{T}","Simulated Total E_{T}","Number of events",nbinsEt*4,minEt,maxEt);
CreateHisto1D("SimHadEt","Simulated Hadronic E_{T}","Simulated Hadronic E_{T}","Number of events",nbinsEt*4,minEt,maxEt);
CreateHisto1D("SimTotEtND","Simulated Total E_{T}","Simulated Total E_{T} for non-diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
CreateHisto1D("SimHadEtND","Simulated Hadronic E_{T}","Simulated Hadronic E_{T} for non-diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimTotEtNDV0AND","Simulated Total E_{T}","Simulated Total E_{T} for non-diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimHadEtNDV0AND","Simulated Hadronic E_{T}","Simulated Hadronic E_{T} for non-diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimTotEtNDMB","Simulated Total E_{T}","Simulated Total E_{T} for non-diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimHadEtNDMB","Simulated Hadronic E_{T}","Simulated Hadronic E_{T} for non-diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
CreateHisto1D("SimTotEtSD","Simulated Total E_{T}","Simulated Total E_{T} for singly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
CreateHisto1D("SimHadEtSD","Simulated Hadronic E_{T}","Simulated Hadronic E_{T} for singly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimTotEtSDV0AND","Simulated Total E_{T}","Simulated Total E_{T} for singly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimHadEtSDV0AND","Simulated Hadronic E_{T}","Simulated Hadronic E_{T} for singly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimTotEtSDMB","Simulated Total E_{T}","Simulated Total E_{T} for singly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimHadEtSDMB","Simulated Hadronic E_{T}","Simulated Hadronic E_{T} for singly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
CreateHisto1D("SimTotEtDD","Simulated Total E_{T}","Simulated Total E_{T} for doubly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
CreateHisto1D("SimHadEtDD","Simulated Hadronic E_{T}","Simulated Hadronic E_{T} for doubly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
- if(fDataSet==20100){
+ CreateHisto1D("SimTotEtDDV0AND","Simulated Total E_{T}","Simulated Total E_{T} for doubly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimHadEtDDV0AND","Simulated Hadronic E_{T}","Simulated Hadronic E_{T} for doubly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimTotEtDDMB","Simulated Total E_{T}","Simulated Total E_{T} for doubly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ CreateHisto1D("SimHadEtDDMB","Simulated Hadronic E_{T}","Simulated Hadronic E_{T} for doubly diffractive events","Number of events",nbinsEt*4,minEt,maxEt);
+ if(fDataSet==20100||fDataSet==2011){
Int_t width = 5;
if(fNCentBins<21) width = 10;
for(Int_t j=0;j<fNCentBins;j++){
CreateIntHisto1D("NEventsSD","Number of events","number of singly diffractive events","Number of events",1,0,1);
CreateIntHisto1D("NEventsDD","Number of events","number of doubly diffractive events","Number of events",1,0,1);
CreateIntHisto1D("NEventsND","Number of events","number of non-diffractive events","Number of events",1,0,1);
+ CreateIntHisto1D("NEventsSDV0AND","Number of events","number of singly diffractive events","Number of events",1,0,1);
+ CreateIntHisto1D("NEventsDDV0AND","Number of events","number of doubly diffractive events","Number of events",1,0,1);
+ CreateIntHisto1D("NEventsNDV0AND","Number of events","number of non-diffractive events","Number of events",1,0,1);
+ CreateIntHisto1D("NEventsSDMB","Number of events","number of singly diffractive events","Number of events",1,0,1);
+ CreateIntHisto1D("NEventsDDMB","Number of events","number of doubly diffractive events","Number of events",1,0,1);
+ CreateIntHisto1D("NEventsNDMB","Number of events","number of non-diffractive events","Number of events",1,0,1);
if( !fRunLightweight){
CreateResolutionPtHisto2D("presolutionTPC","p resolution","p^{rec}","(p^{sim}-p^{rec})/p^{rec}");
CreateResolutionPtHisto2D("pTresolutionTPC","p_{T} resolution","p_{T}^{rec}","(p_{T}^{sim}-p_{T}^{rec})/p_{T}^{rec}");
CreatePtHisto1D("pTrecITS","p_{T}^{rec}","p_{T}^{rec}","Number of particles");
CreatePtHisto1D("pTrecTPC","p_{T}^{rec}","p_{T}^{rec}","Number of particles");
CreatePtHisto1D("pTrecTPCITS","p_{T}^{rec}","p_{T}^{rec}","Number of particles");
- if(fDataSet==20100){
+ if(fDataSet==20100||fDataSet==2011){
Int_t width = 5;
if(fNCentBins<21) width = 10;
for(Int_t j=0;j<fNCentBins;j++){
}
+void AliAnalysisHadEtMonteCarlo::SetGeneratorMinMaxParticles(AliMCEvent *eventMC){
+ // In case of access only to hijing particles in cocktail
+ // get the min and max labels
+ // TODO: Check when generator is not the first one ...
+
+ fNMCProducedMin = 0;
+ fNMCProducedMax = 0;
+
+ AliGenEventHeader * eventHeader = eventMC->GenEventHeader();
+
+ AliGenCocktailEventHeader *cocktail = dynamic_cast<AliGenCocktailEventHeader *>(eventHeader);
+
+ if(!cocktail) return ;
+
+ TList *genHeaders = cocktail->GetHeaders();
+
+ Int_t nGenerators = genHeaders->GetEntries();
+ //printf("N generators %d \n", nGenerators);
+
+ for(Int_t igen = 0; igen < nGenerators; igen++)
+ {
+ AliGenEventHeader * eventHeader2 = (AliGenEventHeader*)genHeaders->At(igen) ;
+ TString name = eventHeader2->GetName();
+
+ //printf("Generator %d: Class Name %s, Name %s, title %s \n",igen, eventHeader2->ClassName(), name.Data(), eventHeader2->GetTitle());
+
+ fNMCProducedMin = fNMCProducedMax;
+ fNMCProducedMax+= eventHeader2->NProduced();
+
+ if(name.Contains("Hijing",TString::kIgnoreCase)){
+ //cout<<"Found HIJING event and set range "<<fNMCProducedMin<<"-"<<fNMCProducedMax<<endl;
+ return ;
+ }
+ }
+
+}
+AliGenEventHeader* AliAnalysisHadEtMonteCarlo::GetGenEventHeader(AliMCEvent *eventMC) const
+{
+ // Return pointer to Generated event header
+ // If requested and cocktail, search for the hijing generator
+ AliGenEventHeader * eventHeader = eventMC->GenEventHeader();
+ AliGenCocktailEventHeader *cocktail = dynamic_cast<AliGenCocktailEventHeader *>(eventHeader);
+
+ if(!cocktail) return 0x0 ;
+
+ TList *genHeaders = cocktail->GetHeaders();
+
+ Int_t nGenerators = genHeaders->GetEntries();
+ //printf("N generators %d \n", nGenerators);
+
+ for(Int_t igen = 0; igen < nGenerators; igen++)
+ {
+ AliGenEventHeader * eventHeader2 = (AliGenEventHeader*)genHeaders->At(igen) ;
+ TString name = eventHeader2->GetName();
+
+ //printf("Generator %d: Class Name %s, Name %s, title %s \n",igen, eventHeader2->ClassName(), name.Data(), eventHeader2->GetTitle());
+
+ if(name.Contains("Hijing",TString::kIgnoreCase)) return eventHeader2 ;
+ }
+
+ return 0x0;
+
+}
+Bool_t AliAnalysisHadEtMonteCarlo::IsHIJINGLabel(Int_t label,AliMCEvent *eventMC,AliStack *stack)
+{
+
+ // Find if cluster/track was generated by HIJING
+
+ AliGenHijingEventHeader* hijingHeader = dynamic_cast<AliGenHijingEventHeader *> (GetGenEventHeader(eventMC));
+
+ //printf("header %p, label %d\n",hijingHeader,label);
+
+ if(!hijingHeader || label < 0 ) return kFALSE;
+
+
+ //printf("pass a), N produced %d\n",nproduced);
+
+ if(label >= fNMCProducedMin && label < fNMCProducedMax)
+ {
+ //printf(" accept!, label is smaller than produced, N %d\n",nproduced);
+
+ return kTRUE;
+ }
+
+ if(!stack) return kFALSE;
+
+ Int_t nprimaries = stack->GetNtrack();
+
+ if(label > nprimaries) return kFALSE;
+
+ TParticle * mom = stack->Particle(label);
+
+ Int_t iMom = label;
+ Int_t iParent = mom->GetFirstMother();
+ while(iParent!=-1){
+ if(iParent >= fNMCProducedMin && iParent < fNMCProducedMax){
+ return kTRUE;
+ }
+
+ iMom = iParent;
+ mom = stack->Particle(iMom);
+ iParent = mom->GetFirstMother();
+ }
+
+ return kFALSE ;
+
+}
+
+
+
+