From 9a365626da0a13f7742f304dbc77d98f510c6b2a Mon Sep 17 00:00:00 2001 From: cnattras Date: Fri, 2 Aug 2013 14:20:02 +0000 Subject: [PATCH] Adding/updating PID info, adding histograms for neutron correction --- PWGLF/totEt/AliAnalysisEt.cxx | 15 ++ PWGLF/totEt/AliAnalysisEt.h | 4 + PWGLF/totEt/AliAnalysisEtMonteCarlo.cxx | 252 +++++++++++++++++- PWGLF/totEt/AliAnalysisEtMonteCarlo.h | 29 ++ PWGLF/totEt/AliAnalysisEtReconstructed.cxx | 176 ++++++++++-- PWGLF/totEt/AliAnalysisEtReconstructed.h | 15 ++ PWGLF/totEt/AliAnalysisHadEt.cxx | 8 + PWGLF/totEt/AliAnalysisHadEt.h | 2 + PWGLF/totEt/AliAnalysisHadEtMonteCarlo.cxx | 71 +++-- PWGLF/totEt/AliAnalysisHadEtReconstructed.cxx | 44 ++- PWGLF/totEt/AliAnalysisTaskHadEt.cxx | 29 ++ PWGLF/totEt/AliAnalysisTaskHadEt.h | 2 + PWGLF/totEt/AliAnalysisTaskTotEt.cxx | 15 ++ PWGLF/totEt/AliAnalysisTaskTotEt.h | 2 + PWGLF/totEt/macros/runCaloEt.C | 101 ++++++- PWGLF/totEt/macros/runHadEt.C | 16 +- 16 files changed, 707 insertions(+), 74 deletions(-) diff --git a/PWGLF/totEt/AliAnalysisEt.cxx b/PWGLF/totEt/AliAnalysisEt.cxx index f7f1be8c557..4705e1415d7 100644 --- a/PWGLF/totEt/AliAnalysisEt.cxx +++ b/PWGLF/totEt/AliAnalysisEt.cxx @@ -27,6 +27,10 @@ #include "AliAnalysisEtRecEffCorrection.h" #include "TFile.h" #include "TVector3.h" +#include "AliPIDResponse.h" +#include "AliTPCPIDResponse.h" +#include "AliInputEventHandler.h" +#include "AliAnalysisManager.h" using namespace std; ClassImp(AliAnalysisEt); @@ -156,6 +160,7 @@ AliAnalysisEt::AliAnalysisEt() : AliAnalysisEtCommon() ,fMakeSparse(kFALSE) ,fCutFlow(0) ,fSelector(0) + ,fPIDResponse(0) {} @@ -184,6 +189,7 @@ AliAnalysisEt::~AliAnalysisEt() //delete fCentrality;//this code does not actually own AliCentrality so we don't have to worry about deleting it... we just borrow it... delete fCutFlow; delete fSelector; + delete fPIDResponse; } void AliAnalysisEt::FillOutputList(TList *list) @@ -206,6 +212,14 @@ void AliAnalysisEt::FillOutputList(TList *list) list->Add(fCutFlow); + AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); + AliInputEventHandler *inputHandler=dynamic_cast(man->GetInputEventHandler()); + if (!inputHandler) AliFatal("Input handler needed"); + + //pid response object + fPIDResponse=inputHandler->GetPIDResponse(); + if (!fPIDResponse) AliError("PIDResponse object was not created"); + } void AliAnalysisEt::Init() @@ -217,6 +231,7 @@ void AliAnalysisEt::Init() exit(-1); } ResetEventValues(); + } void AliAnalysisEt::CreateHistograms() diff --git a/PWGLF/totEt/AliAnalysisEt.h b/PWGLF/totEt/AliAnalysisEt.h index 99d60074969..4e8d844461e 100644 --- a/PWGLF/totEt/AliAnalysisEt.h +++ b/PWGLF/totEt/AliAnalysisEt.h @@ -35,6 +35,7 @@ class AliESDtrackCuts; class AliAnalysisEtCuts; class AliESDCaloCluster; //class THnSparseD; +class AliPIDResponse; class AliAnalysisEt : public AliAnalysisEtCommon { @@ -308,6 +309,9 @@ protected: AliAnalysisEtSelector *fSelector; // Selector class + AliPIDResponse *fPIDResponse; + + private: diff --git a/PWGLF/totEt/AliAnalysisEtMonteCarlo.cxx b/PWGLF/totEt/AliAnalysisEtMonteCarlo.cxx index 609a9d55edd..5fc2f49911a 100644 --- a/PWGLF/totEt/AliAnalysisEtMonteCarlo.cxx +++ b/PWGLF/totEt/AliAnalysisEtMonteCarlo.cxx @@ -247,6 +247,7 @@ AliAnalysisEtMonteCarlo::AliAnalysisEtMonteCarlo():AliAnalysisEt() ,fHistGammasFound(0) ,fHistGammasGenerated(0) ,fHistGammasFoundCent(0) + ,fHistGammasFoundOutOfAccCent(0) ,fHistGammasGeneratedCent(0) ,fHistChargedTracksCut(0) ,fHistChargedTracksAccepted(0) @@ -283,6 +284,34 @@ AliAnalysisEtMonteCarlo::AliAnalysisEtMonteCarlo():AliAnalysisEt() ,fHistHadronDepositsRecoCent(0) ,fHistHadronsAllCent(0) ,fHistMultChVsSignalVsMult(0) + ,fHistNeutralRemovedSecondaryEtVsCent(0) + ,fHistChargedRemovedSecondaryEtVsCent(0) + ,fHistNeutralNotRemovedSecondaryEtVsCent(0) + ,fHistChargedNotRemovedSecondaryEtVsCent(0) + ,fHistNeutralRemovedSecondaryNumVsNCluster(0) + ,fHistChargedRemovedSecondaryNumVsNCluster(0) + ,fHistNeutralNotRemovedSecondaryNumVsNCluster(0) + ,fHistChargedNotRemovedSecondaryNumVsNCluster(0) + ,fHistNeutralRemovedSecondaryNumVsCent(0) + ,fHistChargedRemovedSecondaryNumVsCent(0) + ,fHistNeutralNotRemovedSecondaryNumVsCent(0) + ,fHistChargedNotRemovedSecondaryNumVsCent(0) + ,fHistNeutronsEtVsCent(0) + ,fHistNeutronsNumVsCent(0) + ,fHistNotNeutronsNumVsCent(0) + ,fHistPiKPDepositedVsNch(0) + ,fHistPiKPNotTrackMatchedDepositedVsNch(0) + ,fHistNeutronsDepositedVsNch(0) + ,fHistAntiNeutronsDepositedVsNch(0) + ,fHistProtonsDepositedVsNch(0) + ,fHistAntiProtonsDepositedVsNch(0) + ,fHistProtonsNotTrackMatchedDepositedVsNch(0) + ,fHistAntiProtonsNotTrackMatchedDepositedVsNch(0) + ,fHistSecondariesVsNch(0) + ,fHistSecondariesVsNcl(0) + ,fHistSecondariesEffCorrVsNch(0) + ,fHistSecondariesEffCorrVsNcl(0) + ,fHistCentVsNchVsNcl(0) { } @@ -385,6 +414,7 @@ AliAnalysisEtMonteCarlo::~AliAnalysisEtMonteCarlo() delete fHistPiZeroMultAcc; // enter comment here delete fHistGammasFound; // enter comment here delete fHistGammasGenerated; // enter comment here + delete fHistGammasFoundOutOfAccCent; // enter comment here delete fHistGammasFoundCent; // enter comment here delete fHistGammasGeneratedCent; // enter comment here delete fHistChargedTracksCut; @@ -421,6 +451,34 @@ AliAnalysisEtMonteCarlo::~AliAnalysisEtMonteCarlo() delete fHistHadronDepositsRecoCent; delete fHistHadronsAllCent; delete fHistMultChVsSignalVsMult; + delete fHistNeutralRemovedSecondaryEtVsCent; + delete fHistChargedRemovedSecondaryEtVsCent; + delete fHistNeutralNotRemovedSecondaryEtVsCent; + delete fHistChargedNotRemovedSecondaryEtVsCent; + delete fHistNeutralRemovedSecondaryNumVsNCluster; + delete fHistChargedRemovedSecondaryNumVsNCluster; + delete fHistNeutralNotRemovedSecondaryNumVsNCluster; + delete fHistChargedNotRemovedSecondaryNumVsNCluster; + delete fHistNeutralRemovedSecondaryNumVsCent; + delete fHistChargedRemovedSecondaryNumVsCent; + delete fHistNeutralNotRemovedSecondaryNumVsCent; + delete fHistChargedNotRemovedSecondaryNumVsCent; + delete fHistNeutronsEtVsCent; + delete fHistNeutronsNumVsCent; + delete fHistNotNeutronsNumVsCent; + delete fHistPiKPDepositedVsNch; + delete fHistPiKPNotTrackMatchedDepositedVsNch; + delete fHistNeutronsDepositedVsNch; + delete fHistAntiNeutronsDepositedVsNch; + delete fHistProtonsDepositedVsNch; + delete fHistAntiProtonsDepositedVsNch; + delete fHistProtonsNotTrackMatchedDepositedVsNch; + delete fHistAntiProtonsNotTrackMatchedDepositedVsNch; + delete fHistSecondariesVsNch; + delete fHistSecondariesVsNcl; + delete fHistSecondariesEffCorrVsNch; + delete fHistSecondariesEffCorrVsNcl; + delete fHistCentVsNchVsNcl; } Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev) @@ -685,6 +743,26 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) fNClusters = 0; Int_t fClusterMultChargedTracks = 0; Int_t fClusterMultGammas = 0; + Int_t nChargedSecondariesRemoved = 0; + Int_t nChargedSecondariesNotRemoved = 0; + Int_t nNeutralSecondariesRemoved = 0; + Int_t nNeutralSecondariesNotRemoved = 0; + Int_t nNeutrons = 0; + Int_t nNotNeutrons = 0; + //All efficiency corrected except etSecondaries --> + Float_t etPiKPDeposited = 0.0;// + Float_t etPiKPDepositedNotTrackMatched = 0.0;// + Float_t etProtonDepositedNotTrackMatched = 0.0;// + Float_t etAntiProtonDepositedNotTrackMatched = 0.0;// + //Float_t etPIDProtonDepositedNotTrackMatched = 0.0;//Still has to be filled! + //Float_t etPIDAntiProtonDepositedNotTrackMatched = 0.0;//Still has to be filled + Float_t etProtonDeposited = 0.0;// + Float_t etAntiProtonDeposited = 0.0;// + Float_t etNeutronDeposited = 0.0; + Float_t etAntiNeutronDeposited = 0.0; + Float_t etSecondaries = 0.0; + Float_t etSecondariesEffCorr = 0.0; + Float_t multiplicity = fEsdtrackCutsTPC->GetReferenceMultiplicity(realEvent,kTRUE); // loop the clusters for (int iCluster = 0; iCluster < nCluster; iCluster++ ) { @@ -842,14 +920,20 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) if(fSecondary){//all particles from secondary interactions written = kTRUE; if(nottrackmatched){//secondaries not removed + fSecondaryNotRemoved++; + etSecondaries += fReconstructedEt; + etSecondariesEffCorr += clEt; if (fDepositedCharge != 0){//charged track not removed fChargedNotRemoved++; fEnergyChargedNotRemoved += clEt; fHistRemovedOrNot->Fill(2.0, fCentClass); fHistDxDzNonRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz()); + fHistChargedNotRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass); + nChargedSecondariesNotRemoved++; } else{ - fSecondaryNotRemoved++; + fHistNeutralNotRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass); + nNeutralSecondariesNotRemoved++; } } else{//secondaries removed @@ -858,6 +942,8 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) fEnergyChargedRemoved += clEt; fHistRemovedOrNot->Fill(0.0, fCentClass); fHistDxDzRemovedCharged->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz()); + fHistChargedRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass); + nChargedSecondariesRemoved++; fHistChargedTracksCut->Fill(fDepositedEt); if(fCalcTrackMatchVsMult){ fHistChargedTracksCutMult->Fill(fDepositedEt,fClusterMult); @@ -884,15 +970,32 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) fEnergyNeutralRemoved += clEt; fHistRemovedOrNot->Fill(1.0, fCentClass); fHistDxDzRemovedNeutral->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz()); + fHistNeutralRemovedSecondaryEtVsCent->Fill(fReconstructedEt,fCentClass); + + nNeutralSecondariesRemoved++; } } } - else{ + else{//not a secondary if (fDepositedCharge != 0 && fDepositedCode!=fgEMinusCode && fDepositedCode!=fgEPlusCode){//if the particle hitting the calorimeter is pi/k/p/mu written = kTRUE; fClusterMultChargedTracks++; + etPiKPDeposited += clEt; + if(fDepositedCode==fgProtonCode){ + etProtonDeposited += clEt; + } + if(fDepositedCode==fgAntiProtonCode){ + etAntiProtonDeposited += clEt; + } if(nottrackmatched){//not removed but should be + etPiKPDepositedNotTrackMatched += clEt; + if(fDepositedCode==fgProtonCode){ + etProtonDepositedNotTrackMatched += clEt; + } + if(fDepositedCode==fgAntiProtonCode){ + etAntiProtonDepositedNotTrackMatched += clEt; + } fHistHadronDepositsAll->Fill(part->Pt()); fHistHadronDepositsAllCent->Fill(part->Pt(), fCentClass); if(fReconstructedEt>0.5) fHistHadronDepositsAllCent500MeV->Fill(part->Pt(), fCentClass); @@ -994,14 +1097,54 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) //all other cases - neutron, anti-neutron, not aware of other cases if(!written){ fNeutralNotRemoved++; - fEnergyNeutralNotRemoved += clEt; + fEnergyNeutralNotRemoved += clEt;//this is the efficiency corrected energy fHistRemovedOrNot->Fill(3.0, fCentClass); - fHistDxDzNonRemovedNeutral->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz()); + if (fDepositedCode == fgNeutronCode || fDepositedCode == fgAntiNeutronCode){ + fHistDxDzNonRemovedNeutral->Fill(caloCluster->GetTrackDx(), caloCluster->GetTrackDz()); + fHistNeutronsEtVsCent->Fill(clEt,fCentClass); + nNeutrons++; + if(fDepositedCode == fgNeutronCode){ + etNeutronDeposited += clEt; + } + if(fDepositedCode == fgAntiNeutronCode){ + etAntiNeutronDeposited += clEt; + } + //cout<<"I am a"; + //if(fDepositedCode == fgAntiNeutronCode) cout<<"n anti-"; + //else{cout<<" ";} + //cout<<"neutron!! pt "<Pt()<<" eta "<Eta()<<" phi "<Phi()<<" Et "<Pt()<<" eta "<Eta()<<" phi "<Phi()<<" Et "<Fill(); } // end of loop over clusters - + fHistPiKPNotTrackMatchedDepositedVsNch->Fill(etPiKPDepositedNotTrackMatched,multiplicity); + fHistPiKPDepositedVsNch->Fill(etPiKPDeposited,multiplicity); + fHistNeutronsDepositedVsNch->Fill(etNeutronDeposited,multiplicity); + fHistAntiNeutronsDepositedVsNch->Fill(etAntiNeutronDeposited,multiplicity); + fHistProtonsDepositedVsNch->Fill(etProtonDeposited,multiplicity); + fHistAntiProtonsDepositedVsNch->Fill(etAntiProtonDeposited,multiplicity); + fHistProtonsNotTrackMatchedDepositedVsNch->Fill(etProtonDepositedNotTrackMatched,multiplicity); + fHistAntiProtonsNotTrackMatchedDepositedVsNch->Fill(etAntiProtonDepositedNotTrackMatched,multiplicity); + fHistSecondariesVsNch->Fill(etSecondaries,multiplicity); + fHistSecondariesVsNcl->Fill(etSecondaries,fNClusters); + fHistSecondariesEffCorrVsNch->Fill(etSecondariesEffCorr,multiplicity); + fHistSecondariesEffCorrVsNcl->Fill(etSecondariesEffCorr,fNClusters); + fHistCentVsNchVsNcl->Fill(fCentClass,multiplicity, fNClusters); + + fHistNeutronsNumVsCent->Fill(nNeutrons,fCentClass); + fHistNotNeutronsNumVsCent->Fill(nNotNeutrons,fCentClass); std::sort(foundGammas.begin(), foundGammas.end()); for (Int_t iPart = 0; iPart < stack->GetNtrack(); iPart++) @@ -1024,14 +1167,23 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) continue; } - if(pdg->PdgCode()==fgGammaCode && fSelector->CutGeometricalAcceptance(*part))// TMath::Abs(part->Eta()) < 0.12) + if(pdg->PdgCode()==fgGammaCode)// TMath::Abs(part->Eta()) < 0.12) { - fHistGammasGenerated->Fill(part->Energy()); - fHistGammasGeneratedCent->Fill(part->Energy(),fCentClass); + if(fSelector->CutGeometricalAcceptance(*part)){ + fHistGammasGenerated->Fill(part->Energy()); + fHistGammasGeneratedCent->Fill(part->Energy(),fCentClass); + } if(std::binary_search(foundGammas.begin(),foundGammas.end(),iPart)) { - fHistGammasFound->Fill(part->Energy()); - fHistGammasFoundCent->Fill(part->Energy(),fCentClass); + if(!fSelector->CutGeometricalAcceptance(*part)){ + //cout<<"Gamma NOT in acceptance"<Fill(part->Energy(),fCentClass); + } + else{ + fHistGammasFound->Fill(part->Energy()); + fHistGammasFoundCent->Fill(part->Energy(),fCentClass); + //cout<<"Gamma IN acceptance"<PdgCode()==fgPiPlusCode || pdg->PdgCode()==fgPiMinusCode || pdg->PdgCode()==fgProtonCode || pdg->PdgCode()==fgAntiProtonCode){//section here for all hadrons generated @@ -1141,7 +1293,16 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) } } } - fHistMultChVsSignalVsMult->Fill(fClusterMultChargedTracks,fClusterMultGammas,fClusterMult); + fHistMultChVsSignalVsMult->Fill(fClusterMultChargedTracks,fClusterMultGammas,fNClusters); + fHistNeutralRemovedSecondaryNumVsNCluster->Fill(nNeutralSecondariesRemoved,fNClusters); + fHistChargedRemovedSecondaryNumVsNCluster->Fill(nChargedSecondariesRemoved,fNClusters); + fHistNeutralNotRemovedSecondaryNumVsNCluster->Fill(nNeutralSecondariesNotRemoved,fNClusters); + fHistChargedNotRemovedSecondaryNumVsNCluster->Fill(nChargedSecondariesNotRemoved,fNClusters); + fHistNeutralRemovedSecondaryNumVsCent->Fill(nNeutralSecondariesRemoved,fCentClass); + fHistChargedRemovedSecondaryNumVsCent->Fill(nChargedSecondariesRemoved,fCentClass); + fHistNeutralNotRemovedSecondaryNumVsCent->Fill(nNeutralSecondariesNotRemoved,fCentClass); + fHistChargedNotRemovedSecondaryNumVsCent->Fill(nChargedSecondariesNotRemoved,fCentClass); + //cout<<"Secondaries not removed: "<Add(fHistGammasFound); list->Add(fHistGammasGenerated); + list->Add(fHistGammasFoundOutOfAccCent); list->Add(fHistGammasFoundCent); list->Add(fHistGammasGeneratedCent); list->Add(fHistChargedTracksCut); @@ -1667,6 +1868,35 @@ void AliAnalysisEtMonteCarlo::FillOutputList(TList *list) list->Add(fHistHadronDepositsRecoCent); list->Add(fHistHadronsAllCent); list->Add(fHistMultChVsSignalVsMult); + list->Add(fHistNeutralRemovedSecondaryEtVsCent); + list->Add(fHistChargedRemovedSecondaryEtVsCent); + list->Add(fHistNeutralNotRemovedSecondaryEtVsCent); + list->Add(fHistChargedNotRemovedSecondaryEtVsCent); + list->Add(fHistNeutralRemovedSecondaryNumVsNCluster); + list->Add(fHistChargedRemovedSecondaryNumVsNCluster); + list->Add(fHistNeutralNotRemovedSecondaryNumVsNCluster); + list->Add(fHistChargedNotRemovedSecondaryNumVsNCluster); + list->Add(fHistNeutralRemovedSecondaryNumVsCent); + list->Add(fHistChargedRemovedSecondaryNumVsCent); + list->Add(fHistNeutralNotRemovedSecondaryNumVsCent); + list->Add(fHistChargedNotRemovedSecondaryNumVsCent); + list->Add(fHistNeutronsEtVsCent); + list->Add(fHistNeutronsNumVsCent); + list->Add(fHistNotNeutronsNumVsCent); + list->Add(fHistPiKPDepositedVsNch); + list->Add(fHistPiKPNotTrackMatchedDepositedVsNch); + list->Add(fHistNeutronsDepositedVsNch); + list->Add(fHistAntiNeutronsDepositedVsNch); + list->Add(fHistProtonsDepositedVsNch); + list->Add(fHistAntiProtonsDepositedVsNch); + list->Add(fHistProtonsNotTrackMatchedDepositedVsNch); + list->Add(fHistAntiProtonsNotTrackMatchedDepositedVsNch); + list->Add(fHistSecondariesVsNch); + list->Add(fHistSecondariesVsNcl); + list->Add(fHistSecondariesEffCorrVsNch); + list->Add(fHistSecondariesEffCorrVsNcl); + list->Add(fHistCentVsNchVsNcl); + } diff --git a/PWGLF/totEt/AliAnalysisEtMonteCarlo.h b/PWGLF/totEt/AliAnalysisEtMonteCarlo.h index f842ad7a728..4aed9bbd124 100644 --- a/PWGLF/totEt/AliAnalysisEtMonteCarlo.h +++ b/PWGLF/totEt/AliAnalysisEtMonteCarlo.h @@ -314,6 +314,7 @@ protected: TH1F *fHistGammasFound; TH1F *fHistGammasGenerated; TH2F *fHistGammasFoundCent; + TH2F *fHistGammasFoundOutOfAccCent; TH2F *fHistGammasGeneratedCent; TH1F *fHistChargedTracksCut; TH1F *fHistChargedTracksAccepted; @@ -349,6 +350,34 @@ protected: TH2F *fHistHadronDepositsRecoCent; TH2F *fHistHadronsAllCent; TH3F *fHistMultChVsSignalVsMult; + TH2F *fHistNeutralRemovedSecondaryEtVsCent; + TH2F *fHistChargedRemovedSecondaryEtVsCent; + TH2F *fHistNeutralNotRemovedSecondaryEtVsCent; + TH2F *fHistChargedNotRemovedSecondaryEtVsCent; + TH2F *fHistNeutralRemovedSecondaryNumVsNCluster; + TH2F *fHistChargedRemovedSecondaryNumVsNCluster; + TH2F *fHistNeutralNotRemovedSecondaryNumVsNCluster; + TH2F *fHistChargedNotRemovedSecondaryNumVsNCluster; + TH2F *fHistNeutralRemovedSecondaryNumVsCent; + TH2F *fHistChargedRemovedSecondaryNumVsCent; + TH2F *fHistNeutralNotRemovedSecondaryNumVsCent; + TH2F *fHistChargedNotRemovedSecondaryNumVsCent; + TH2F *fHistNeutronsEtVsCent; + TH2F *fHistNeutronsNumVsCent; + TH2F *fHistNotNeutronsNumVsCent; + TH2F *fHistPiKPDepositedVsNch; + TH2F *fHistPiKPNotTrackMatchedDepositedVsNch; + TH2F *fHistNeutronsDepositedVsNch; + TH2F *fHistAntiNeutronsDepositedVsNch; + TH2F *fHistProtonsDepositedVsNch; + TH2F *fHistAntiProtonsDepositedVsNch; + TH2F *fHistProtonsNotTrackMatchedDepositedVsNch; + TH2F *fHistAntiProtonsNotTrackMatchedDepositedVsNch; + TH2F *fHistSecondariesVsNch; + TH2F *fHistSecondariesVsNcl; + TH2F *fHistSecondariesEffCorrVsNch; + TH2F *fHistSecondariesEffCorrVsNcl; + TH3F *fHistCentVsNchVsNcl; private: diff --git a/PWGLF/totEt/AliAnalysisEtReconstructed.cxx b/PWGLF/totEt/AliAnalysisEtReconstructed.cxx index b50bb0bdfaa..ac675db17df 100644 --- a/PWGLF/totEt/AliAnalysisEtReconstructed.cxx +++ b/PWGLF/totEt/AliAnalysisEtReconstructed.cxx @@ -35,6 +35,7 @@ #include "AliPHOSGeoUtils.h" #include "AliPHOSGeometry.h" #include "AliAnalysisEtRecEffCorrection.h" +#include "AliESDpid.h" using namespace std; @@ -60,6 +61,9 @@ AliAnalysisEtReconstructed::AliAnalysisEtReconstructed() : ,fClusterPositionAcceptedEnergy(0) ,fClusterPositionAllEnergy(0) ,fClusterEnergy(0) + ,fClusterEnergyCent(0) + ,fClusterEnergyCentMatched(0) + ,fClusterEnergyCentNotMatched(0) ,fClusterEt(0) ,fHistChargedEnergyRemoved(0) ,fHistNeutralEnergyRemoved(0) @@ -86,6 +90,16 @@ AliAnalysisEtReconstructed::AliAnalysisEtReconstructed() : ,fHistTotRawEtEffCorr500MeV(0) ,fHistTotAllRawEt(0) ,fHistTotAllRawEtEffCorr(0) + ,fHistNClustersPhosVsEmcal(0) + ,fHistClusterSizeVsCent(0) + ,fHistMatchedClusterSizeVsCent(0) + ,fHistTotAllRawEtVsTotalPt(0) + ,fHistTotAllRawEtVsTotalPtVsCent(0) + ,fHistTotMatchedRawEtVsTotalPtVsCent(0) + ,fHistPIDProtonsTrackMatchedDepositedVsNch(0) + ,fHistPIDAntiProtonsTrackMatchedDepositedVsNch(0) + ,fHistPiKPTrackMatchedDepositedVsNch(0) + ,fHistCentVsNchVsNclReco(0) { } @@ -105,6 +119,9 @@ AliAnalysisEtReconstructed::~AliAnalysisEtReconstructed() delete fClusterPositionAcceptedEnergy; delete fClusterPositionAllEnergy; delete fClusterEnergy; + delete fClusterEnergyCent; + delete fClusterEnergyCentMatched; + delete fClusterEnergyCentNotMatched; delete fClusterEt; delete fHistChargedEnergyRemoved; delete fHistNeutralEnergyRemoved; @@ -131,6 +148,16 @@ AliAnalysisEtReconstructed::~AliAnalysisEtReconstructed() delete fHistTotAllRawEt; delete fHistTotAllRawEtEffCorr; delete fHistTotRawEtEffCorr500MeV; + delete fHistNClustersPhosVsEmcal; + delete fHistClusterSizeVsCent; + delete fHistMatchedClusterSizeVsCent; + delete fHistTotAllRawEtVsTotalPt; + delete fHistTotAllRawEtVsTotalPtVsCent; + delete fHistTotMatchedRawEtVsTotalPtVsCent; + delete fHistPIDProtonsTrackMatchedDepositedVsNch; + delete fHistPIDAntiProtonsTrackMatchedDepositedVsNch; + delete fHistPiKPTrackMatchedDepositedVsNch; + delete fHistCentVsNchVsNclReco; } Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev) @@ -163,6 +190,35 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev) fCentClass = fCentrality->GetCentralityClass5("V0M"); } + + //for PID + AliESDpid *pID = new AliESDpid(); + pID->MakePID(event); + Float_t etPIDProtons = 0.0; + Float_t etPIDAntiProtons = 0.0; + Float_t etPiKPMatched = 0.0; + Float_t multiplicity = fEsdtrackCutsTPC->GetReferenceMultiplicity(event,kTRUE); + + + Float_t totalMatchedPt = 0.0; + Float_t totalPt = 0.0; + TObjArray* list = fEsdtrackCutsTPC->GetAcceptedTracks(event); + Int_t nGoodTracks = list->GetEntries(); + for (Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++){ + AliESDtrack *track = dynamic_cast (list->At(iTrack)); + if (!track) + { + Printf("ERROR: Could not get track %d", iTrack); + continue; + } + else{ + totalPt +=track->Pt(); + pID->MakeITSPID(track); + + + } + } + //TRefArray *caloClusters = fSelector->GetClusters();//just gets the correct set of clusters - does not apply any cuts //Float_t fClusterMult = caloClusters->GetEntries(); @@ -185,7 +241,8 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev) Float_t fTotAllRawEt = 0.0; Float_t fTotRawEt = 0.0; Float_t fTotAllRawEtEffCorr = 0.0; - + Int_t nPhosClusters = 0; + Int_t nEmcalClusters = 0; for (Int_t iCluster = 0; iCluster < event->GetNumberOfCaloClusters(); iCluster++) { @@ -197,6 +254,8 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev) } int x = 0; fCutFlow->Fill(x++); + if(cluster->IsEMCAL()) nEmcalClusters++; + else nPhosClusters++; if(!fSelector->IsDetectorCluster(*cluster)) continue; fCutFlow->Fill(x++); if(!fSelector->PassMinEnergyCut(*cluster)) continue; @@ -216,6 +275,8 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev) fTotAllRawEt += TMath::Sin(cp.Theta())*cluster->E(); fTotAllRawEtEffCorr += CorrectForReconstructionEfficiency(*cluster,cent); + fClusterEnergyCent->Fill(cluster->E(),cent); + Bool_t matched = kTRUE;//default to no track matched Int_t trackMatchedIndex = cluster->GetTrackMatchedIndex();//find the index of the matched track matched = !(fSelector->PassTrackMatchingCut(*cluster));//PassTrackMatchingCut is false if there is a matched track @@ -239,20 +300,38 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev) AliError("Error: track does not exist"); } else { + totalMatchedPt +=track->Pt(); + fClusterEnergyCentMatched->Fill(cluster->E(),cent); + fHistMatchedClusterSizeVsCent->Fill(cluster->GetNCells(),cent); + float eff = fTmCorrections->TrackMatchingEfficiency(track->Pt(),cent); if(TMath::Abs(eff)<1e-5) eff = 1.0; - //cout<<"pt "<Pt()<<" eff "<Pt()<<" eff "<E(); //One efficiency is the gamma efficiency and the other is the track matching efficiency. - nChargedHadronsEtTotal+= 1/eff *effCorrEt; + nChargedHadronsEtTotal+= 1/eff *TMath::Sin(cp.Theta())*cluster->E(); + + Float_t nSigmaPion = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kPion); + Float_t nSigmaProton = fPIDResponse->NumberOfSigmasTPC(track, AliPID::kProton); + bool isProton = (nSigmaPion>3.0 && nSigmaProton<3.0 && track->Pt()<0.9); + //cout<<"NSigmaProton "<Charge()>0){ + etPIDProtons += effCorrEt; + } + else{ + etPIDAntiProtons += effCorrEt; + } + } if(TMath::Sin(cp.Theta())*cluster->E()>0.5){ nChargedHadronsMeasured500MeV++; nChargedHadronsTotal500MeV += 1/eff; - nChargedHadronsEtMeasured500MeV+= 1/eff*effCorrEt; - nChargedHadronsEtTotal500MeV+= 1/eff *effCorrEt; + nChargedHadronsEtMeasured500MeV+= TMath::Sin(cp.Theta())*cluster->E(); + nChargedHadronsEtTotal500MeV+= 1/eff *TMath::Sin(cp.Theta())*cluster->E(); } fHistMatchedTracksEvspTvsCent->Fill(track->P(),TMath::Sin(cp.Theta())*cluster->E(),cent); fHistMatchedTracksEvspTvsCentEffCorr->Fill(track->P(),effCorrEt,cent); @@ -344,6 +423,8 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev) fClusterPositionAccepted->Fill(p2.Phi(), p2.PseudoRapidity()); fClusterPositionAcceptedEnergy->Fill(p2.Phi(), p2.PseudoRapidity(),cluster->E()); fClusterEnergy->Fill(cluster->E()); + fClusterEnergyCentNotMatched->Fill(cluster->E(),cent); + fHistClusterSizeVsCent->Fill(cluster->GetNCells(),cent); fClusterEt->Fill(TMath::Sin(p2.Theta())*cluster->E()); uncorrEt += TMath::Sin(p2.Theta())*cluster->E(); float myuncorrEt = TMath::Sin(p2.Theta())*cluster->E(); @@ -369,6 +450,7 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev) fMultiplicity++; } + fHistNClustersPhosVsEmcal->Fill(nPhosClusters,nEmcalClusters,cent); fChargedEnergyRemoved = GetChargedContribution(fNeutralMultiplicity); fNeutralEnergyRemoved = GetNeutralContribution(fNeutralMultiplicity); fHistChargedEnergyRemoved->Fill(fChargedEnergyRemoved, fNeutralMultiplicity); @@ -384,6 +466,9 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev) fHistTotRawEtEffCorr->Fill(fTotNeutralEt,cent); fHistTotRawEt->Fill(fTotRawEt,cent); fHistTotAllRawEt->Fill(fTotAllRawEt,cent); + fHistTotAllRawEtVsTotalPt->Fill(fTotAllRawEt,totalPt); + fHistTotAllRawEtVsTotalPtVsCent->Fill(fTotAllRawEt,totalPt,cent); + fHistTotMatchedRawEtVsTotalPtVsCent->Fill(fTotAllRawEt,totalMatchedPt,cent); fHistTotAllRawEtEffCorr->Fill(fTotAllRawEtEffCorr,cent); //cout<<"uncorr "<Fill(nChargedHadronsTotal-nChargedHadronsMeasured,cent); fHistFoundHadronsEtvsCent->Fill(nChargedHadronsEtMeasured,cent); fHistNotFoundHadronsEtvsCent->Fill(nChargedHadronsEtTotal-nChargedHadronsEtMeasured,cent); + //cout<<"found "<Fill(nChargedHadronsMeasured500MeV,cent); fHistNotFoundHadronsvsCent500MeV->Fill(nChargedHadronsTotal500MeV-nChargedHadronsMeasured500MeV,cent); fHistFoundHadronsEtvsCent500MeV->Fill(nChargedHadronsEtMeasured500MeV,cent); @@ -414,6 +500,11 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev) // cout<0) cout<<" ("<Fill(etPIDProtons,multiplicity); + fHistPIDAntiProtonsTrackMatchedDepositedVsNch->Fill(etPIDAntiProtons,multiplicity); + fHistCentVsNchVsNclReco->Fill(cent,multiplicity,fMultiplicity); + fHistPiKPTrackMatchedDepositedVsNch->Fill(etPiKPMatched,multiplicity); + delete pID; return 0; } @@ -488,6 +579,9 @@ void AliAnalysisEtReconstructed::FillOutputList(TList* list) list->Add(fClusterPositionAcceptedEnergy); list->Add(fClusterPositionAllEnergy); list->Add(fClusterEnergy); + list->Add(fClusterEnergyCent); + list->Add(fClusterEnergyCentMatched); + list->Add(fClusterEnergyCentNotMatched); list->Add(fClusterEt); list->Add(fHistChargedEnergyRemoved); @@ -515,6 +609,16 @@ void AliAnalysisEtReconstructed::FillOutputList(TList* list) list->Add(fHistTotAllRawEtEffCorr); list->Add(fHistTotRawEt); list->Add(fHistTotAllRawEt); + list->Add(fHistNClustersPhosVsEmcal); + list->Add(fHistClusterSizeVsCent); + list->Add(fHistMatchedClusterSizeVsCent); + list->Add(fHistTotAllRawEtVsTotalPt); + list->Add(fHistTotAllRawEtVsTotalPtVsCent); + list->Add(fHistTotMatchedRawEtVsTotalPtVsCent); + list->Add(fHistPIDProtonsTrackMatchedDepositedVsNch); + list->Add(fHistPIDAntiProtonsTrackMatchedDepositedVsNch); + list->Add(fHistPiKPTrackMatchedDepositedVsNch); + list->Add(fHistCentVsNchVsNclReco); } void AliAnalysisEtReconstructed::CreateHistograms() @@ -585,8 +689,26 @@ void AliAnalysisEtReconstructed::CreateHistograms() histname = "fClusterEnergy" + fHistogramNameSuffix; fClusterEnergy = new TH1F(histname.Data(), histname.Data(), 100, 0, 5); - fClusterEnergy->SetXTitle("Number of clusters"); - fClusterEnergy->SetYTitle("Energy of cluster"); + fClusterEnergy->SetYTitle("Number of clusters"); + fClusterEnergy->SetXTitle("Energy of cluster"); + + histname = "fClusterEnergyCent" + fHistogramNameSuffix; + fClusterEnergyCent = new TH2F(histname.Data(), histname.Data(), 100, 0, 5,20,-0.5,19.5); + fClusterEnergyCent->SetXTitle("Energy of cluster"); + fClusterEnergyCent->SetYTitle("Centrality Bin"); + fClusterEnergyCent->SetZTitle("Number of clusters"); + + histname = "fClusterEnergyCentMatched" + fHistogramNameSuffix; + fClusterEnergyCentMatched = new TH2F(histname.Data(), histname.Data(), 100, 0, 5,20,-0.5,19.5); + fClusterEnergyCentMatched->SetXTitle("Energy of cluster"); + fClusterEnergyCentMatched->SetYTitle("Centrality Bin"); + fClusterEnergyCentMatched->SetZTitle("Number of Clusters"); + + histname = "fClusterEnergyCentNotMatched" + fHistogramNameSuffix; + fClusterEnergyCentNotMatched = new TH2F(histname.Data(), histname.Data(), 100, 0, 5,20,-0.5,19.5); + fClusterEnergyCentNotMatched->SetXTitle("Energy of cluster"); + fClusterEnergyCentNotMatched->SetYTitle("Centrality Bin"); + fClusterEnergyCentNotMatched->SetZTitle("Number of clusters"); histname = "fClusterEt" + fHistogramNameSuffix; fClusterEt = new TH1F(histname.Data(), histname.Data(), 100, 0, 5); @@ -606,20 +728,29 @@ void AliAnalysisEtReconstructed::CreateHistograms() fHistMatchedTracksEvspTvsCentEffCorr = new TH3F("fHistMatchedTracksEvspTvsCentEffCorr", "fHistMatchedTracksEvspTvsCentEffCorr",100, 0, 3,100,0,3,20,-0.5,19.5); fHistMatchedTracksEvspTvsCentEffTMCorr = new TH3F("fHistMatchedTracksEvspTvsCentEffTMCorr", "fHistMatchedTracksEvspTvsCentEffTMCorr",100, 0, 3,100,0,3,20,-0.5,19.5); fHistMatchedTracksEvspTvsCentEffTMCorr500MeV = new TH3F("fHistMatchedTracksEvspTvsCentEffTMCorr500MeV", "fHistMatchedTracksEvspTvsCentEffTMCorr500MeV",100, 0, 3,100,0,3,20,-0.5,19.5); - fHistFoundHadronsvsCent = new TH2F("fHistFoundHadronsvsCent","fHistFoundHadronsvsCent",100,0,100,20,-0.5,19.5); - fHistNotFoundHadronsvsCent = new TH2F("fHistNotFoundHadronsvsCent","fHistNotFoundHadronsvsCent",100,0,200,20,-0.5,19.5); - fHistFoundHadronsEtvsCent = new TH2F("fHistFoundHadronsEtvsCent","fHistFoundHadronsEtvsCent",100,0,200,20,-0.5,19.5); - fHistNotFoundHadronsEtvsCent = new TH2F("fHistNotFoundHadronsEtvsCent","fHistNotFoundHadronsEtvsCent",100,0,300,20,-0.5,19.5); - fHistFoundHadronsvsCent500MeV = new TH2F("fHistFoundHadronsvsCent500MeV","fHistFoundHadronsvsCent500MeV",100,0,100,20,-0.5,19.5); - fHistNotFoundHadronsvsCent500MeV = new TH2F("fHistNotFoundHadronsvsCent500MeV","fHistNotFoundHadronsvsCent500MeV",100,0,200,20,-0.5,19.5); - fHistFoundHadronsEtvsCent500MeV = new TH2F("fHistFoundHadronsEtvsCent500MeV","fHistFoundHadronsEtvsCent500MeV",100,0,200,20,-0.5,19.5); - fHistNotFoundHadronsEtvsCent500MeV = new TH2F("fHistNotFoundHadronsEtvsCent500MeV","fHistNotFoundHadronsEtvsCent500MeV",100,0,300,20,-0.5,19.5); + + float max = 200; + if(fHistogramNameSuffix.Contains("P")){max = 100;} + fHistFoundHadronsvsCent = new TH2F("fHistFoundHadronsvsCent","fHistFoundHadronsvsCent",100,0,max,20,-0.5,19.5); + fHistNotFoundHadronsvsCent = new TH2F("fHistNotFoundHadronsvsCent","fHistNotFoundHadronsvsCent",100,0,max,20,-0.5,19.5); + fHistFoundHadronsEtvsCent = new TH2F("fHistFoundHadronsEtvsCent","fHistFoundHadronsEtvsCent",100,0,max,20,-0.5,19.5); + fHistNotFoundHadronsEtvsCent = new TH2F("fHistNotFoundHadronsEtvsCent","fHistNotFoundHadronsEtvsCent",100,0,max,20,-0.5,19.5); + fHistFoundHadronsvsCent500MeV = new TH2F("fHistFoundHadronsvsCent500MeV","fHistFoundHadronsvsCent500MeV",100,0,max,20,-0.5,19.5); + fHistNotFoundHadronsvsCent500MeV = new TH2F("fHistNotFoundHadronsvsCent500MeV","fHistNotFoundHadronsvsCent500MeV",100,0,max,20,-0.5,19.5); + fHistFoundHadronsEtvsCent500MeV = new TH2F("fHistFoundHadronsEtvsCent500MeV","fHistFoundHadronsEtvsCent500MeV",100,0,max,20,-0.5,19.5); + fHistNotFoundHadronsEtvsCent500MeV = new TH2F("fHistNotFoundHadronsEtvsCent500MeV","fHistNotFoundHadronsEtvsCent500MeV",100,0,max,20,-0.5,19.5); fHistTotRawEtEffCorr = new TH2F("fHistTotRawEtEffCorr","fHistTotRawEtEffCorr",250,0,250,20,-0.5,19.5); fHistTotRawEt = new TH2F("fHistTotRawEt","fHistTotRawEt",250,0,250,20,-0.5,19.5); fHistTotRawEtEffCorr500MeV = new TH2F("fHistTotRawEtEffCorr500MeV","fHistTotRawEtEffCorr500MeV",250,0,250,20,-0.5,19.5); fHistTotAllRawEt = new TH2F("fHistTotAllRawEt","fHistTotAllRawEt",250,0,250,20,-0.5,19.5); fHistTotAllRawEtEffCorr = new TH2F("fHistTotAllRawEtEffCorr","fHistTotAllRawEtEffCorr",250,0,250,20,-0.5,19.5); + fHistNClustersPhosVsEmcal = new TH3F("fHistNClustersPhosVsEmcal","fHistNClustersPhosVsEmcal",50,0,50,250,0,250,20,-0.5,19); + fHistClusterSizeVsCent = new TH2F("fHistClusterSizeVsCent","fHistClusterSizeVsCent",10,0.5,10.5,20,-0.5,19.5); + fHistMatchedClusterSizeVsCent = new TH2F("fHistMatchedClusterSizeVsCent","fHistMatchedClusterSizeVsCent",10,0.5,10.5,20,-0.5,19.5); + fHistTotAllRawEtVsTotalPt = new TH2F("fHistTotAllRawEtVsTotalPt","fHistTotAllRawEtVsTotalPt",125,0,250,200,0,2000); + fHistTotAllRawEtVsTotalPtVsCent = new TH3F("fHistTotAllRawEtVsTotalPtVsCent","fHistTotAllRawEtVsTotalPtVsCent",125,0,250,200,0,2000,20,-0.5,19.5); + fHistTotMatchedRawEtVsTotalPtVsCent = new TH3F("fHistTotMatchedRawEtVsTotalPtVsCent","fHistTotMatchedRawEtVsTotalPtVsCent",250,0,250,100,0,200,20,-0.5,19.5); maxEt = 500; histname = "fHistNominalRawEt" + fHistogramNameSuffix; @@ -633,6 +764,19 @@ void AliAnalysisEtReconstructed::CreateHistograms() histname = "fHistNominalEffLowEt" + fHistogramNameSuffix; fHistNominalEffLowEt = new TH2D(histname.Data(), histname.Data(),nbinsEt,minEt,maxEt,20,-0.5,19.5); + Float_t maxEtRange = 25; + Float_t maxEtRangeHigh = 125; + Float_t minEtRange = 0; + Int_t nbinsMult = 100; + Float_t maxMult = 3000; + Float_t minMult = 0; + Int_t nbinsCl = 150; + Float_t maxCl = 300; + Float_t minCl = 0; + fHistPIDProtonsTrackMatchedDepositedVsNch = new TH2F("fHistPIDProtonsTrackMatchedDepositedVsNch","PID'd protons deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsMult,minMult,maxMult); + fHistPIDAntiProtonsTrackMatchedDepositedVsNch = new TH2F("fHistPIDAntiProtonsTrackMatchedDepositedVsNch","PID'd #bar{p} E_{T} deposited in calorimeter vs multiplicity",nbinsEt,minEtRange,maxEtRange,nbinsMult,minMult,maxMult); + fHistPiKPTrackMatchedDepositedVsNch = new TH2F("fHistPiKPTrackMatchedDepositedVsNch","PiKP track matched",nbinsEt,minEtRange,maxEtRangeHigh,nbinsMult,minMult,maxMult); + fHistCentVsNchVsNclReco = new TH3F("fHistCentVsNchVsNclReco","Cent bin vs Nch Vs NCl",20,-0.5,19.5,nbinsMult,minMult,maxMult,nbinsCl,minCl,maxCl); } Double_t AliAnalysisEtReconstructed::ApplyModifiedCorrections(const AliESDCaloCluster& cluster,Int_t nonLinCorr, Int_t effCorr, Int_t cent) { diff --git a/PWGLF/totEt/AliAnalysisEtReconstructed.h b/PWGLF/totEt/AliAnalysisEtReconstructed.h index 8eb54b1c62c..56bbb5af155 100644 --- a/PWGLF/totEt/AliAnalysisEtReconstructed.h +++ b/PWGLF/totEt/AliAnalysisEtReconstructed.h @@ -69,6 +69,9 @@ protected: TH2D *fClusterPositionAcceptedEnergy; // Position of clusters TH2D *fClusterPositionAllEnergy; // Position of clusters TH1F *fClusterEnergy; // Distribution of cluster energies + TH2F *fClusterEnergyCent; // Distribution of cluster energies vs centrality bin + TH2F *fClusterEnergyCentMatched; // Distribution of cluster energies vs centrality bin + TH2F *fClusterEnergyCentNotMatched; // Distribution of cluster energies vs centrality bin TH1F *fClusterEt; // Distribution of cluster energies TH2D *fHistChargedEnergyRemoved; // Charged energy removed @@ -100,6 +103,18 @@ protected: TH2F *fHistTotAllRawEtEffCorr; // all clusters reco eff applied Double_t ApplyModifiedCorrections(const AliESDCaloCluster& cluster,Int_t nonLinCorr, Int_t effCorr, Int_t cent);//nonLinCorr 0 = nominal 1 = high -1 = low, effCorr 0 = nominal 1 = high -1 = low + TH3F *fHistNClustersPhosVsEmcal; // all clusters no reco eff + TH2F *fHistClusterSizeVsCent; // all clusters no reco eff + TH2F *fHistMatchedClusterSizeVsCent; // all clusters no reco eff + TH2F *fHistTotAllRawEtVsTotalPt; // all clusters no reco eff + //fHistTotAllRawEtVsTotalPtCent + TH3F *fHistTotAllRawEtVsTotalPtVsCent; // all clusters no reco eff + TH3F *fHistTotMatchedRawEtVsTotalPtVsCent; // all clusters no reco eff + TH2F *fHistPIDProtonsTrackMatchedDepositedVsNch; + TH2F *fHistPIDAntiProtonsTrackMatchedDepositedVsNch; + TH2F *fHistPiKPTrackMatchedDepositedVsNch; + TH3F *fHistCentVsNchVsNclReco; + private: AliAnalysisEtReconstructed(const AliAnalysisEtReconstructed& g); diff --git a/PWGLF/totEt/AliAnalysisHadEt.cxx b/PWGLF/totEt/AliAnalysisHadEt.cxx index e0cc8ef2ea0..b0d5a26f9c6 100644 --- a/PWGLF/totEt/AliAnalysisHadEt.cxx +++ b/PWGLF/totEt/AliAnalysisHadEt.cxx @@ -24,6 +24,11 @@ #include "TParticle.h" #include "Rtypes.h" #include "AliPDG.h" +#include "AliPIDResponse.h" +#include "AliTPCPIDResponse.h" +#include "AliInputEventHandler.h" +#include "AliAnalysisManager.h" +#include "AliLog.h" using namespace std; @@ -56,6 +61,7 @@ Int_t AliAnalysisHadEt::fgNumOfResBins = 80; AliAnalysisHadEt::AliAnalysisHadEt() : AliAnalysisEtCommon() + ,fPIDResponse(0) ,fSumEt(0) ,fSumEtAcc(0) ,fTotEt(0) @@ -78,6 +84,7 @@ AliAnalysisHadEt::~AliAnalysisHadEt() delete fEsdtrackCutsITSTPC; delete fEsdtrackCutsITS; delete fEsdtrackCutsTPC; + delete fPIDResponse; } Int_t AliAnalysisHadEt::AnalyseEvent(AliVEvent *event) @@ -91,6 +98,7 @@ Int_t AliAnalysisHadEt::AnalyseEvent(AliVEvent *event) void AliAnalysisHadEt::Init() {// clear variables, set up cuts and PDG info AliAnalysisEtCommon::Init(); + } void AliAnalysisHadEt::ResetEventValues() diff --git a/PWGLF/totEt/AliAnalysisHadEt.h b/PWGLF/totEt/AliAnalysisHadEt.h index 59162d40dba..c8a7f4845f2 100644 --- a/PWGLF/totEt/AliAnalysisHadEt.h +++ b/PWGLF/totEt/AliAnalysisHadEt.h @@ -20,6 +20,7 @@ class Rtypes; class TParticle; class TDatabasePDG; class AliAnalysisEtCuts; +class AliPIDResponse; class AliAnalysisHadEt : public AliAnalysisEtCommon { @@ -71,6 +72,7 @@ public: void SetHistoList(const TList *mylist){fhistoList = (TList *) mylist;} + AliPIDResponse *fPIDResponse; protected: diff --git a/PWGLF/totEt/AliAnalysisHadEtMonteCarlo.cxx b/PWGLF/totEt/AliAnalysisHadEtMonteCarlo.cxx index 8f606ae7a66..0a7686cb997 100644 --- a/PWGLF/totEt/AliAnalysisHadEtMonteCarlo.cxx +++ b/PWGLF/totEt/AliAnalysisHadEtMonteCarlo.cxx @@ -29,6 +29,10 @@ #include "AliCentrality.h" #include "AliLog.h" #include "AliPWG0Helper.h" +#include "AliPIDResponse.h" +#include "AliTPCPIDResponse.h" +#include "AliInputEventHandler.h" +#include "AliAnalysisManager.h" //class AliPWG0Helper; //#include "$ALICE_ROOT/PWG0/AliPWG0Helper.h" @@ -166,19 +170,27 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) } 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); @@ -232,21 +244,21 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) //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(); } @@ -315,7 +327,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) 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(); @@ -474,7 +486,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) 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); @@ -507,7 +519,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) 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); @@ -541,7 +553,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) 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); @@ -575,7 +587,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) 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); @@ -609,7 +621,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) 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){ @@ -653,7 +665,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) 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()); @@ -672,7 +684,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) FillHisto2D(Form("EtReconstructed%sMisidentifiedElectrons",cutName->Data()),track->Pt(),track->Eta(),myEtPi); } } - filled = true; + //filled = true; } if(pdgCode == fgEMinusCode){ if( !fRunLightweight){ @@ -683,7 +695,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2) 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);} @@ -1750,6 +1762,15 @@ void AliAnalysisHadEtMonteCarlo::Init() } void AliAnalysisHadEtMonteCarlo::CreateHistograms(){ //for simulated Et only (no reconstruction) + + AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); + AliInputEventHandler *inputHandler=dynamic_cast(man->GetInputEventHandler()); + if (!inputHandler) AliFatal("Input handler needed"); + + //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^{-}"); diff --git a/PWGLF/totEt/AliAnalysisHadEtReconstructed.cxx b/PWGLF/totEt/AliAnalysisHadEtReconstructed.cxx index 37f9dc2eca9..2c2499987aa 100644 --- a/PWGLF/totEt/AliAnalysisHadEtReconstructed.cxx +++ b/PWGLF/totEt/AliAnalysisHadEtReconstructed.cxx @@ -28,6 +28,10 @@ #include "AliAnalysisHadEt.h" #include "AliCentrality.h" #include "AliLog.h" +#include "AliPIDResponse.h" +#include "AliTPCPIDResponse.h" +#include "AliInputEventHandler.h" +#include "AliAnalysisManager.h" #include "AliPWG0Helper.h" using namespace std; @@ -159,20 +163,31 @@ Int_t AliAnalysisHadEtReconstructed::AnalyseEvent(AliVEvent* ev, Int_t eventtype else{ if(TMath::Abs(track->Eta())>fCorrections->GetEtaCut()) continue; Float_t nSigmaPion,nSigmaProton,nSigmaKaon,nSigmaElectron; - pID->MakeTPCPID(track); - pID->MakeITSPID(track); +// pID->MakeTPCPID(track); +// pID->MakeITSPID(track); + //if(!fPIDResponse) cout<<"Uh-oh! No PID Response!"<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)); } + //cout<<"Nsigma pion "<2.0 && nSigmaKaon>2.0); // bool isElectron = (nSigmaElectron<2.0 && nSigmaPion>4.0 && nSigmaProton>3.0 && nSigmaKaon>3.0); // bool isKaon = (nSigmaPion>3.0 && nSigmaProton>2.0 && nSigmaKaon<2.0); @@ -589,6 +604,15 @@ void AliAnalysisHadEtReconstructed::ResetEventValues(){//resetting event by even } void AliAnalysisHadEtReconstructed::CreateHistograms(){//Creating histograms and adding them to the output TList + AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); + AliInputEventHandler *inputHandler=dynamic_cast(man->GetInputEventHandler()); + if (!inputHandler) AliFatal("Input handler needed"); + + //pid response object + fPIDResponse=inputHandler->GetPIDResponse(); + if (!fPIDResponse) AliError("PIDResponse object was not created"); + + if(kDoTriggerChecksOnly){return;}//In this case we are just after trigger efficiencies and don't care about the ET reconstructed. //TString *strTPC = new TString("TPC"); TString *strITS = new TString("ITS"); diff --git a/PWGLF/totEt/AliAnalysisTaskHadEt.cxx b/PWGLF/totEt/AliAnalysisTaskHadEt.cxx index e3fc58f9917..3420b0a1b61 100644 --- a/PWGLF/totEt/AliAnalysisTaskHadEt.cxx +++ b/PWGLF/totEt/AliAnalysisTaskHadEt.cxx @@ -25,6 +25,10 @@ #include "AliAnalysisHadEtMonteCarlo.h" #include "AliPWG0Helper.h" #include "AliTriggerAnalysis.h" +#include "AliAnalysisManager.h" +#include "AliPIDResponse.h" +#include "AliTPCPIDResponse.h" +#include "AliInputEventHandler.h" #include #include "AliLog.h" @@ -38,6 +42,7 @@ ClassImp(AliAnalysisTaskHadEt) //________________________________________________________________________ AliAnalysisTaskHadEt::AliAnalysisTaskHadEt(const char *name, Bool_t isMc, TString recoConfigFile, TString mcConfigFile) : AliAnalysisTaskTransverseEnergy(name, isMc) + ,fPIDResponse(0) ,fRecAnalysis(0) ,fMCAnalysis(0) ,fIsSim(isMc) @@ -45,6 +50,17 @@ ClassImp(AliAnalysisTaskHadEt) ,kIsOfflineMB(0) { // Constructor + //input hander + AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); + AliInputEventHandler *inputHandler=dynamic_cast(man->GetInputEventHandler()); + if (!inputHandler) AliFatal("Input handler needed"); + + //pid response object + fPIDResponse=inputHandler->GetPIDResponse(); + if (!fPIDResponse) AliError("PIDResponse object was not created"); + else{cout<<"PIDResponse was created!"<(man->GetInputEventHandler()); + if (!inputHandler) AliFatal("Input handler needed"); + + //pid response object + fPIDResponse=inputHandler->GetPIDResponse(); + if (!fPIDResponse) AliError("PIDResponse object was not created"); + else{cout<<"PIDResponse was created!"<SetOwner(); @@ -158,6 +185,8 @@ void AliAnalysisTaskHadEt::UserCreateOutputObjects() Printf("Error: no track cuts!"); } + + PostData(1, fOutputList); } diff --git a/PWGLF/totEt/AliAnalysisTaskHadEt.h b/PWGLF/totEt/AliAnalysisTaskHadEt.h index 7ec47d2a2aa..a7cb9b2c363 100644 --- a/PWGLF/totEt/AliAnalysisTaskHadEt.h +++ b/PWGLF/totEt/AliAnalysisTaskHadEt.h @@ -14,6 +14,7 @@ class AliAnalysisHadEtMonteCarlo; class AliESDtrackCuts; class TH2F; class TList; +class AliPIDResponse; #include "AliAnalysisTaskTransverseEnergy.h" class AliPWG0Helper; @@ -28,6 +29,7 @@ public: virtual void UserExec(Option_t *option); virtual void Terminate(Option_t *); void IsSim(){fIsSim = kTRUE;} + AliPIDResponse *fPIDResponse; private: diff --git a/PWGLF/totEt/AliAnalysisTaskTotEt.cxx b/PWGLF/totEt/AliAnalysisTaskTotEt.cxx index 892e198290f..5b69b58fa65 100644 --- a/PWGLF/totEt/AliAnalysisTaskTotEt.cxx +++ b/PWGLF/totEt/AliAnalysisTaskTotEt.cxx @@ -28,6 +28,10 @@ #include "AliAnalysisEtMonteCarloEmcal.h" #include "AliAnalysisEmEtMonteCarlo.h" #include "AliAnalysisEmEtReconstructed.h" +#include "AliAnalysisManager.h" +#include "AliPIDResponse.h" +#include "AliTPCPIDResponse.h" +#include "AliInputEventHandler.h" #include #include @@ -39,6 +43,7 @@ ClassImp(AliAnalysisTaskTotEt) //________________________________________________________________________ AliAnalysisTaskTotEt::AliAnalysisTaskTotEt(const char *name, Bool_t isMc) : AliAnalysisTaskTransverseEnergy(name, isMc) + ,fPIDResponse(0) ,fRecAnalysis(0) ,fMCAnalysis(0) // ,fSparseHistRecVsMc(0) @@ -109,6 +114,7 @@ AliAnalysisTaskTotEt::~AliAnalysisTaskTotEt() {//Destructor // fOutputList->Clear(); delete fRecAnalysis; delete fMCAnalysis; + delete fPIDResponse; //delete fSparseHistRecVsMc; //delete fSparseRecVsMc; } @@ -116,6 +122,15 @@ AliAnalysisTaskTotEt::~AliAnalysisTaskTotEt() {//Destructor //________________________________________________________________________ void AliAnalysisTaskTotEt::UserCreateOutputObjects() { + //input hander + AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager(); + AliInputEventHandler *inputHandler=dynamic_cast(man->GetInputEventHandler()); + if (!inputHandler) AliFatal("Input handler needed"); + + //pid response object + fPIDResponse=inputHandler->GetPIDResponse(); + if (!fPIDResponse) AliError("PIDResponse object was not created"); + // Create histograms // Called once if (fMCAnalysis) diff --git a/PWGLF/totEt/AliAnalysisTaskTotEt.h b/PWGLF/totEt/AliAnalysisTaskTotEt.h index 64aab3970cf..dad452e6f74 100644 --- a/PWGLF/totEt/AliAnalysisTaskTotEt.h +++ b/PWGLF/totEt/AliAnalysisTaskTotEt.h @@ -13,6 +13,7 @@ class AliAnalysisEtMonteCarlo; class AliESDtrackCuts; class TH2F; class TList; +class AliPIDResponse; #include "AliAnalysisTaskTransverseEnergy.h" @@ -26,6 +27,7 @@ public: virtual void UserCreateOutputObjects(); virtual void UserExec(Option_t *option); virtual void Terminate(Option_t *); + AliPIDResponse *fPIDResponse; private: diff --git a/PWGLF/totEt/macros/runCaloEt.C b/PWGLF/totEt/macros/runCaloEt.C index 1773dbf958e..e5e31a67a9d 100644 --- a/PWGLF/totEt/macros/runCaloEt.C +++ b/PWGLF/totEt/macros/runCaloEt.C @@ -6,8 +6,8 @@ //As written this requires an xml script tag.xml in the ~/et directory on the grid to submit jobs void runCaloEt(bool submit = false, // true or false const char *dataType="simPbPb", // "sim" or "real" etc. - const char *pluginRunMode="full", // "test" or "full" or "terminate" - const char *det = "EMCal",int production = 1, Bool_t withtender = kTRUE) // "PHOS" or "EMCAL" or EMCalDetail + const char *pluginRunMode="test", // "test" or "full" or "terminate" + const char *det = "EMCal",int production = 1, Bool_t withtender = kTRUE, Int_t runnum = 0, Bool_t withNonlinearity = kTRUE, Bool_t withReclusterizing = kFALSE, Int_t trackmatchcuts==0) // "PHOS" or "EMCAL" or EMCalDetail { TStopwatch timer; timer.Start(); @@ -108,16 +108,25 @@ void runCaloEt(bool submit = false, // true or false } TString outputName = "Et.ESD." + dataStrName + "." + detStr + ".root"; TString outputDir = "totEt" + dataStr + detStr+suffix; - + if(!withNonlinearity){ + outputDir +="NoNonlinearity"; + } + if(withReclusterizing){ + outputDir +="WithReclusterizing"; + } + if(trackmatchcuts!=0){ + outputDir +=Form("TrackMatchCut%i",trackmatchcuts); + } cout << " taskName " << taskName << " outputName " << outputName << " outputDir (alien) " << outputDir << endl; mgr->SetCommonFileName(outputName.Data()); AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("out1", TList::Class(), AliAnalysisManager::kOutputContainer, outputName); + if(!isPb){ cout<<"I am not PbPb!!"<LoadMacro("CreateAlienHandlerCaloEtSim.C"); - AliAnalysisGrid *alienHandler = CreateAlienHandlerCaloEtSim(outputDir, outputName, pluginRunMode, production,detStr.Contains("PHOS"),!isPb,dataStr.Contains("real")); + AliAnalysisGrid *alienHandler = CreateAlienHandlerCaloEtSim(outputDir, outputName, pluginRunMode, production,detStr.Contains("PHOS"),!isPb,dataStr.Contains("real"),runnum); if (!alienHandler) return; mgr->SetGridHandler(alienHandler); } @@ -133,13 +142,77 @@ void runCaloEt(bool submit = false, // true or false TString fileLocation = "/data/LHC10h8/137161/999/AliESDs.root";//"/home/dsilverm/data/E_T/" + dataStr + "/dir/AliESDs.root"; cout << "fileLocation " << fileLocation.Data() << endl; // chain->Add(fileLocation.Data()); // link to local test file - chain->Add("/data/LHC10h8/137161/999/AliESDs.root");//Hijing Pb+Pb - chain->Add("/data/LHC10h8/137161/111/AliESDs.root");//Hijing Pb+Pb - chain->Add("/data/LHC10h8/137161/222/AliESDs.root");//Hijing Pb+Pb +// chain->Add("/data/LHC10h8/137161/999/AliESDs.root");//Hijing Pb+Pb +// chain->Add("/data/LHC10h8/137161/111/AliESDs.root");//Hijing Pb+Pb +// chain->Add("/data/LHC10h8/137161/222/AliESDs.root");//Hijing Pb+Pb +chain->Add("/data/LHC11a10a_bis/139465/001/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/002/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/003/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/004/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/006/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/007/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/008/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/009/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/010/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/011/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/012/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/013/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/014/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/015/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/016/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/017/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/018/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/019/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/020/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/021/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/022/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/023/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/024/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/025/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/026/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/027/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/028/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/029/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/030/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/031/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/032/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/033/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/034/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/035/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/036/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/037/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/038/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/039/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/040/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/041/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/042/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/043/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/044/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/045/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/046/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/047/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/048/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/049/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/050/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/051/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/052/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/053/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/054/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/055/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/056/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/057/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/058/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/059/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/060/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/061/AliESDs.root"); +chain->Add("/data/LHC11a10a_bis/139465/062/AliESDs.root"); + } else { // pp cout<<"adding pp simulation file"<Add("/data/LHC10d15/1821/AliESDs.root"); + chain->Add("/data/LHC11b1b/999/AliESDs.root"); + //chain->Add("/data/LHC11b1a/999/AliESDs.root"); + //chain->Add("/data/LHC10d15/1821/AliESDs.root"); //chain->Add("/data/LHC10dpass2/10000126403050.70/AliESDs.root");//data //chain->Add("/home/dsilverm/data/E_T/sim/LHC10d1/117222/100/AliESDs.root"); // link to local test file } @@ -179,7 +252,7 @@ void runCaloEt(bool submit = false, // true or false //Gets calibration factors from grid if jobs are to be submitted to the grid // AliEMCALRecParam* pars = GetOCDBRecParam( 137161, "PbPb", submit); - AliTender *tender = AddTaskEMCALTender( "EMCAL_COMPLETEV1", 0); + AliTender *tender = AddTaskEMCALTender( "EMCAL_COMPLETEV1", 0,withNonlinearity,withReclusterizing,trackmatchcuts); //this also likely needs modification // tender->SelectCollisionCandidates( AliVEvent::kMB | AliVEvent::kEMCEGA | AliVEvent::kEMC1 | AliVEvent::kEMC7 ); // if(submit){tender->SetDefaultCDBStorage("raw://");} //uncomment if you work on grid @@ -221,7 +294,14 @@ void runCaloEt(bool submit = false, // true or false } } - + gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); + //AliAnalysisTask *AddTaskPIDResponse(Bool_t isMC=kFALSE, Bool_t autoMCesd=kTRUE, +// Bool_t tuneOnData=kFALSE, Int_t recoPass=2, +// Bool_t cachePID=kFALSE, TString detResponse="", +// Bool_t useTPCEtaCorrection = kFALSE); + AliAnalysisTaskPIDResponse *taskPID=AddTaskPIDResponse(isMc,kTRUE,kTRUE,2); + gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C"); + AddTaskPIDqa(); AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); @@ -231,6 +311,7 @@ void runCaloEt(bool submit = false, // true or false AliAnalysisTaskTotEt *task1 = new AliAnalysisTaskTotEt(taskName); task1->SetMcData(isMc);//necessary to tell the task to basically accept all MC events. + task1->SelectCollisionCandidates(AliVEvent::kMB ) ; mgr->AddTask(task1); diff --git a/PWGLF/totEt/macros/runHadEt.C b/PWGLF/totEt/macros/runHadEt.C index eb47d11da8a..16594469c33 100644 --- a/PWGLF/totEt/macros/runHadEt.C +++ b/PWGLF/totEt/macros/runHadEt.C @@ -147,11 +147,23 @@ void runHadEt(bool submit = false, bool data = false, Int_t dataset = 20100, Boo else{gSystem->CopyFile("rootFiles/corrections/corrections.LHC10e20.pp.ForSimulations.root","corrections.root",kTRUE);} } } + + + gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); + cout<<"I am adding PID response task"<LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C"); + AddTaskPIDqa(); + AliAnalysisTaskHadEt *task2 = new AliAnalysisTaskHadEt("TaskHadEt",!data);//,recoFile,mcFile); if(!data) task2->SetMcData(); //Add thing here to select collision type!! - //if(dataset!=20100){task2->SelectCollisionCandidates(AliVEvent::kMB ) ;} - //if(dataset!=20100){task2->SelectCollisionCandidates(AliVEvent::kMB ) ;} + if(dataset!=20100){task2->SelectCollisionCandidates(AliVEvent::kMB ) ;} + if(dataset!=20100){task2->SelectCollisionCandidates(AliVEvent::kMB ) ;} mgr->AddTask(task2); AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("out2", TList::Class(), AliAnalysisManager::kOutputContainer,"Et.ESD.new.sim.root"); -- 2.43.0