Adding common base class for AliAnalysisEt and AliAnalysisHadEt so we are not repeati...
authorcnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Nov 2010 17:58:18 +0000 (17:58 +0000)
committercnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Nov 2010 17:58:18 +0000 (17:58 +0000)
20 files changed:
PWG4/PWG4totEtLinkDef.h
PWG4/totEt/AliAnalysisEt.cxx
PWG4/totEt/AliAnalysisEt.h
PWG4/totEt/AliAnalysisEtCommon.cxx [new file with mode: 0644]
PWG4/totEt/AliAnalysisEtCommon.h [new file with mode: 0644]
PWG4/totEt/AliAnalysisEtMonteCarlo.cxx
PWG4/totEt/AliAnalysisEtReconstructed.cxx
PWG4/totEt/AliAnalysisHadEt.cxx
PWG4/totEt/AliAnalysisHadEt.h
PWG4/totEt/AliAnalysisHadEtMonteCarlo.cxx
PWG4/totEt/AliAnalysisHadEtMonteCarlo.h
PWG4/totEt/AliAnalysisHadEtReconstructed.cxx
PWG4/totEt/AliAnalysisTaskHadEt.cxx
PWG4/totEt/AliAnalysisTaskHadEt.h
PWG4/totEt/macros/ConfigHadEtMonteCarlo.C [new file with mode: 0644]
PWG4/totEt/macros/ConfigHadEtReconstructed.C [new file with mode: 0644]
PWG4/totEt/macros/CreateAlienHandlerCaloEtSim.C
PWG4/totEt/macros/CreateAlienHandlerHadEtSim.C
PWG4/totEt/macros/runCaloEt.C
PWG4/totEt/macros/runHadEt.C

index 8ece5af..7927d29 100644 (file)
@@ -5,6 +5,7 @@
 #pragma link off all functions;
 
 #pragma link C++ class AliAnalysisEtCuts+;
+#pragma link C++ class AliAnalysisEtCommon+;
 #pragma link C++ class AliAnalysisEt+;
 #pragma link C++ class AliAnalysisEtMonteCarlo+;
 #pragma link C++ class AliAnalysisEtMonteCarloEmcal+;
index e9b387b..ea0de20 100644 (file)
 #include "AliAnalysisEtCuts.h"
 #include "AliESDtrackCuts.h"
 #include "AliVEvent.h"
-#include "TDatabasePDG.h"
 #include "Rtypes.h"
 
 using namespace std;
 ClassImp(AliAnalysisEt);
 
 
-AliAnalysisEt::AliAnalysisEt() :
-        fHistogramNameSuffix("")
-        ,fCuts(0)
-        ,fPdgDB(0)
-        ,fPiPlusCode(0)
-        ,fPiMinusCode(0)
-        ,fKPlusCode(0)
-        ,fKMinusCode(0)
-        ,fProtonCode(0)
-        ,fAntiProtonCode(0)
-        ,fLambdaCode(0)
-        ,fAntiLambdaCode(0)
-        ,fK0SCode(0)
-        ,fOmegaCode(0)
-        ,fAntiOmegaCode(0)
-        ,fXi0Code(0)
-        ,fAntiXi0Code(0)
-        ,fXiCode(0)
-        ,fAntiXiCode(0)
-        ,fSigmaCode(0)
-        ,fAntiSigmaCode(0)
-        ,fK0LCode(0)
-        ,fNeutronCode(0)
-        ,fAntiNeutronCode(0)
-        ,fEPlusCode(0)
-        ,fEMinusCode(0)
-        ,fMuPlusCode(0)
-        ,fMuMinusCode(0)
-        ,fGammaCode(0)
-        ,fPionMass(0)
-        ,fTotEt(0)
-        ,fTotEtAcc(0)
-        ,fTotNeutralEt(0)
-        ,fTotNeutralEtAcc(0)
-        ,fTotChargedEt(0)
-        ,fTotChargedEtAcc(0)
-        ,fMultiplicity(0)
-        ,fChargedMultiplicity(0)
-        ,fNeutralMultiplicity(0)
-        ,fBaryonEt(0)
-        ,fAntiBaryonEt(0)
-        ,fMesonEt(0)
-        ,fProtonEt(0)
-        ,fPionEt(0)
-        ,fChargedKaonEt(0)
-        ,fMuonEt(0)
-        ,fElectronEt(0)
-        ,fNeutronEt(0)
-        ,fAntiNeutronEt(0)
-        ,fGammaEt(0)
-        ,fProtonEtAcc(0)
-        ,fPionEtAcc(0)
-        ,fChargedKaonEtAcc(0)
-        ,fMuonEtAcc(0)
-        ,fElectronEtAcc(0)
-        ,fEnergyDeposited(0)
-        ,fEnergyTPC(0)
-        ,fCharge(0)
-        ,fParticlePid(0)
-        ,fPidProb(0)
-        ,fTrackPassedCut(kFALSE)
-        ,fEtaCut(0)
-       ,fEtaCutAcc(0)
-       ,fPhiCutAccMin(0)
-       ,fPhiCutAccMax(0)
-       ,fDetectorRadius(0)
-       ,fClusterEnergyCut(0) 
-       ,fSingleCellEnergyCut(0)
-        ,fHistEt(0)
-        ,fHistChargedEt(0)
-        ,fHistNeutralEt(0)
-        ,fHistEtAcc(0)
-        ,fHistChargedEtAcc(0)
-        ,fHistNeutralEtAcc(0)
-        ,fHistMult(0)
-        ,fHistChargedMult(0)
-        ,fHistNeutralMult(0)
-        ,fHistPhivsPtPos(0)
-        ,fHistPhivsPtNeg(0)
-        ,fHistBaryonEt(0)
-        ,fHistAntiBaryonEt(0)
-        ,fHistMesonEt(0)
-        ,fHistProtonEt(0)
-        ,fHistPionEt(0)
-        ,fHistChargedKaonEt(0)
-        ,fHistMuonEt(0)
-        ,fHistElectronEt(0)
-        ,fHistNeutronEt(0)
-        ,fHistAntiNeutronEt(0)
-        ,fHistGammaEt(0)
-        ,fHistProtonEtAcc(0)
-        ,fHistPionEtAcc(0)
-        ,fHistChargedKaonEtAcc(0)
-        ,fHistMuonEtAcc(0)
-        ,fHistElectronEtAcc(0)
-        ,fHistTMDeltaR(0)
-        ,fTree(0)
-        ,fTreeDeposit(0)
-        ,fEsdtrackCutsTPC(0)
+AliAnalysisEt::AliAnalysisEt() : AliAnalysisEtCommon()
+                              ,fHistogramNameSuffix("")
+                              ,fTotEt(0)
+                              ,fTotEtAcc(0)
+                              ,fTotNeutralEt(0)
+                              ,fTotNeutralEtAcc(0)
+                              ,fTotChargedEt(0)
+                              ,fTotChargedEtAcc(0)
+                              ,fMultiplicity(0)
+                              ,fChargedMultiplicity(0)
+                              ,fNeutralMultiplicity(0)
+                              ,fBaryonEt(0)
+                              ,fAntiBaryonEt(0)
+                              ,fMesonEt(0)
+                              ,fProtonEt(0)
+                              ,fPionEt(0)
+                              ,fChargedKaonEt(0)
+                              ,fMuonEt(0)
+                              ,fElectronEt(0)
+                              ,fNeutronEt(0)
+                              ,fAntiNeutronEt(0)
+                              ,fGammaEt(0)
+                              ,fProtonEtAcc(0)
+                              ,fPionEtAcc(0)
+                              ,fChargedKaonEtAcc(0)
+                              ,fMuonEtAcc(0)
+                              ,fElectronEtAcc(0)
+                              ,fEnergyDeposited(0)
+                              ,fEnergyTPC(0)
+                              ,fCharge(0)
+                              ,fParticlePid(0)
+                              ,fPidProb(0)
+                              ,fTrackPassedCut(kFALSE)
+                              ,fEtaCut(0)
+                              ,fEtaCutAcc(0)
+                              ,fPhiCutAccMin(0)
+                              ,fPhiCutAccMax(0)
+                              ,fDetectorRadius(0)
+                              ,fClusterEnergyCut(0) 
+                              ,fSingleCellEnergyCut(0)
+                              ,fHistEt(0)
+                              ,fHistChargedEt(0)
+                              ,fHistNeutralEt(0)
+                              ,fHistEtAcc(0)
+                              ,fHistChargedEtAcc(0)
+                              ,fHistNeutralEtAcc(0)
+                              ,fHistMult(0)
+                              ,fHistChargedMult(0)
+                              ,fHistNeutralMult(0)
+                              ,fHistPhivsPtPos(0)
+                              ,fHistPhivsPtNeg(0)
+                              ,fHistBaryonEt(0)
+                              ,fHistAntiBaryonEt(0)
+                              ,fHistMesonEt(0)
+                              ,fHistProtonEt(0)
+                              ,fHistPionEt(0)
+                              ,fHistChargedKaonEt(0)
+                              ,fHistMuonEt(0)
+                              ,fHistElectronEt(0)
+                              ,fHistNeutronEt(0)
+                              ,fHistAntiNeutronEt(0)
+                              ,fHistGammaEt(0)
+                              ,fHistProtonEtAcc(0)
+                              ,fHistPionEtAcc(0)
+                              ,fHistChargedKaonEtAcc(0)
+                              ,fHistMuonEtAcc(0)
+                              ,fHistElectronEtAcc(0)
+                              ,fHistTMDeltaR(0)
+                              ,fTree(0)
+                              ,fTreeDeposit(0)
 {
 }
 
 AliAnalysisEt::~AliAnalysisEt()
 {//Destructor
-  delete fCuts;
-  delete fPdgDB;
   if(fTreeDeposit){
     fTreeDeposit->Clear();
     delete fTreeDeposit; // optional TTree
@@ -138,8 +106,34 @@ AliAnalysisEt::~AliAnalysisEt()
     fTree->Clear();
     delete fTree; // optional TTree
   }
-  delete fEsdtrackCutsTPC;
-
+  delete fHistEt; //Et spectrum
+  delete fHistChargedEt; //Charged Et spectrum 
+  delete fHistNeutralEt; //Neutral Et spectrum
+  delete fHistEtAcc; //Et in acceptance
+  delete fHistChargedEtAcc; //Charged Et in acceptance
+  delete fHistNeutralEtAcc; //Et in acceptance
+  delete fHistMult; //Multiplicity
+  delete fHistChargedMult; //Charged multiplicity
+  delete fHistNeutralMult; //Neutral multiplicity
+  delete fHistPhivsPtPos; //phi vs pT plot for positive tracks
+  delete fHistPhivsPtNeg; //phi vs pT plot for negative tracks
+  delete fHistBaryonEt; /** Et of identified baryons */    
+  delete fHistAntiBaryonEt; /** Et of identified anti-baryons */
+  delete fHistMesonEt; /** Et of identified mesons */
+  delete fHistProtonEt; /** Et of identified protons */
+  delete fHistPionEt; /** Et of identified protons */
+  delete fHistChargedKaonEt; /** Et of identified charged kaons */
+  delete fHistMuonEt; /** Et of identified muons */
+  delete fHistElectronEt; /** Et of identified electrons */
+  delete fHistNeutronEt; /** Et of neutrons (MC only for now) */
+  delete fHistAntiNeutronEt; /** Et of anti-neutrons (MC only for now) */
+  delete fHistGammaEt; /** Et of gammas (MC only for now) */
+  delete fHistProtonEtAcc; /** Et of identified protons in calorimeter acceptance */    
+  delete fHistPionEtAcc; /** Et of identified protons in calorimeter acceptance */    
+  delete fHistChargedKaonEtAcc; /** Et of identified charged kaons in calorimeter acceptance */    
+  delete fHistMuonEtAcc; /** Et of identified muons in calorimeter acceptance */
+  delete fHistElectronEtAcc; /** Et of identified electrons in calorimeter acceptance */
+  delete fHistTMDeltaR; /* Track matching plots; Rec only for now */
 }
 
 void AliAnalysisEt::FillOutputList(TList *list)
@@ -192,6 +186,7 @@ void AliAnalysisEt::FillOutputList(TList *list)
 
 void AliAnalysisEt::Init()
 {// clear variables, set up cuts and PDG info
+  AliAnalysisEtCommon::Init();
   ResetEventValues();
 }
 
@@ -420,13 +415,14 @@ void AliAnalysisEt::FillHistograms()
 
 Int_t AliAnalysisEt::AnalyseEvent(AliVEvent *event)
 { //this line is basically here to eliminate a compiler warning that event is not used.  Making it a virtual function did not work with the plugin.
-  cout << "This event has " << event->GetNumberOfTracks() << " tracks" << endl;
+  AliAnalysisEtCommon::AnalyseEvent(event);
   ResetEventValues();
   return 0;
 }
 
 void AliAnalysisEt::ResetEventValues()
 { // clear
+  AliAnalysisEtCommon::ResetEventValues();
   fTotEt = 0;
   fTotEtAcc = 0;
   fTotNeutralEt = 0;
@@ -452,57 +448,6 @@ void AliAnalysisEt::ResetEventValues()
   fChargedKaonEtAcc = 0;
   fMuonEtAcc = 0;
   fElectronEtAcc = 0;
-  
-  if (!fCuts || !fPdgDB || fPiPlusCode==0) { // some Init's needed
-    cout << __FILE__ << ":" << __LINE__ << " : Init " << endl;
-    if (!fCuts) {
-      cout << " setting up Cuts " << endl;
-      fCuts = new AliAnalysisEtCuts();
-    }
-    if(!fPdgDB) {
-      cout << " setting up PdgDB " << endl;
-      fPdgDB = new TDatabasePDG();
-    }
-    if (fPiPlusCode==0) {
-      SetParticleCodes();
-    }
-  }
   return;
 }
 
-
-void AliAnalysisEt::SetParticleCodes()
-{ // set PDG info    
-  fPionMass = fPdgDB->GetParticle("pi+")->Mass();
-  fPiPlusCode = fPdgDB->GetParticle("pi+")->PdgCode();
-  fPiMinusCode = fPdgDB->GetParticle("pi-")->PdgCode();
-  fKPlusCode = fPdgDB->GetParticle("K+")->PdgCode();
-  fKMinusCode = fPdgDB->GetParticle("K-")->PdgCode();
-  fProtonCode = fPdgDB->GetParticle("proton")->PdgCode();
-  fAntiProtonCode = fPdgDB->GetParticle("antiproton")->PdgCode();
-  fLambdaCode = fPdgDB->GetParticle("Lambda0")->PdgCode();
-  fAntiLambdaCode = fPdgDB->GetParticle("Lambda0_bar")->PdgCode();
-  fK0SCode = fPdgDB->GetParticle("K_S0")->PdgCode();
-  fOmegaCode = fPdgDB->GetParticle("Omega-")->PdgCode();
-  fAntiOmegaCode = fPdgDB->GetParticle("Omega+")->PdgCode();
-  fXi0Code = fPdgDB->GetParticle("Xi0")->PdgCode();
-  fAntiXi0Code = fPdgDB->GetParticle("Xi0_bar")->PdgCode();
-  fXiCode = fPdgDB->GetParticle("Xi-")->PdgCode();
-  fAntiXiCode = fPdgDB->GetParticle("Xi-_bar")->PdgCode();
-  fSigmaCode = fPdgDB->GetParticle("Sigma-")->PdgCode();
-  fAntiSigmaCode = fPdgDB->GetParticle("Sigma+")->PdgCode();
-  fK0LCode = fPdgDB->GetParticle("K_L0")->PdgCode();
-  fNeutronCode = fPdgDB->GetParticle("neutron")->PdgCode();
-  fAntiNeutronCode = fPdgDB->GetParticle("antineutron")->PdgCode();
-  fEPlusCode = fPdgDB->GetParticle("e+")->PdgCode();
-  fEMinusCode = fPdgDB->GetParticle("e-")->PdgCode();
-  fMuPlusCode = fPdgDB->GetParticle("mu+")->PdgCode();
-  fMuMinusCode = fPdgDB->GetParticle("mu-")->PdgCode();
-  fGammaCode = fPdgDB->GetParticle("gamma")->PdgCode();
-  
-  cout << "Resetting Codes: Pion " << fPiPlusCode
-       << "," << fPiMinusCode 
-       << " Kaon " << fKPlusCode 
-       << "," << fKMinusCode << endl;
-}
-
index b8dd94e..d550154 100644 (file)
@@ -9,6 +9,7 @@
 //_________________________________________________________________________
 
 #include "TString.h"
+#include "AliAnalysisEtCommon.h"
 
 class TTree;
 class TH2F;
@@ -17,10 +18,9 @@ class AliVEvent;
 class TList;
 class AliESDtrackCuts;
 class Rtypes;
-class TDatabasePDG;
 class AliAnalysisEtCuts;
 
-class AliAnalysisEt
+class AliAnalysisEt : public AliAnalysisEtCommon
 {
 public:
    
@@ -51,13 +51,7 @@ public:
     /** Reset event specific values (Et etc.) */
     virtual void ResetEventValues();
 
-    /** Set Particle codes/mass */
-    virtual void SetParticleCodes();
     
-    /** Cuts info */
-    AliAnalysisEtCuts * GetCuts() const { return fCuts; } 
-    virtual void SetCuts(const AliAnalysisEtCuts *cuts) 
-    { fCuts = (AliAnalysisEtCuts *) cuts; } 
 
     /** Total Et in the event (without acceptance cuts) */
     Double_t GetTotEt() const { return fTotEt; }
@@ -83,37 +77,8 @@ protected:
        
     TString fHistogramNameSuffix; /** The suffix for the histogram names */
 
-    AliAnalysisEtCuts *fCuts; // keeper of basic cuts
-
-    /** PDG Database */
-    TDatabasePDG *fPdgDB;//data base used for looking up pdg codes
-    //these codes are stored as variables because otherwise there were issues using this with the plugin
-    Int_t fPiPlusCode;//pdg pi plus code
-    Int_t fPiMinusCode;//pdg pi minus code
-    Int_t fKPlusCode;// pdg k plus code
-    Int_t fKMinusCode;//pdg k minus code
-    Int_t fProtonCode;//pdg proton code
-    Int_t fAntiProtonCode;//pdg antiproton code
-    Int_t fLambdaCode;// pdg lambda code
-    Int_t fAntiLambdaCode;//pdg antilambda code
-    Int_t fK0SCode;//pdg k0 short code
-    Int_t fOmegaCode;//pdg omega code
-    Int_t fAntiOmegaCode;//pdg anti-omega code
-    Int_t fXi0Code;//pdg xi-0 code
-    Int_t fAntiXi0Code;//pdg anti-xi0 code
-    Int_t fXiCode;//pdg xi code
-    Int_t fAntiXiCode;//pdg anti-xi code
-    Int_t fSigmaCode;//pdg sigma code
-    Int_t fAntiSigmaCode;//pdg anti-sigma code
-    Int_t fK0LCode;//pdg k0 long code
-    Int_t fNeutronCode;//pdg neutron code
-    Int_t fAntiNeutronCode;//pdg anti-neutron code
-    Int_t fEPlusCode;//pdg positron code
-    Int_t fEMinusCode;//pdg electron code
-    Int_t fMuPlusCode; // pdg muon + code
-    Int_t fMuMinusCode; // pdg muon - code
-    Int_t fGammaCode; // pdg gamma code
-    Float_t fPionMass;//pdg pion mass
+    //AliAnalysisEtCuts *fCuts; // keeper of basic cuts
+
 
     Double_t fTotEt;/** Total Et in the event (without acceptance cuts) */    
     Double_t fTotEtAcc;/** Total Et in the event within the acceptance cuts */
@@ -233,7 +198,6 @@ protected:
     TTree *fTree; // optional TTree
     TTree *fTreeDeposit; // optional TTree for energy deposit measurements
 
-    AliESDtrackCuts* fEsdtrackCutsTPC;//esd track cuts for TPC tracks (which may also contain ITS hits)
 
 private:
     //Declare private to avoid compilation warning
diff --git a/PWG4/totEt/AliAnalysisEtCommon.cxx b/PWG4/totEt/AliAnalysisEtCommon.cxx
new file mode 100644 (file)
index 0000000..7e30c80
--- /dev/null
@@ -0,0 +1,157 @@
+//Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili
+//University of Tennessee at Knoxville
+//
+// This class is designed for the analysis of the hadronic component of 
+// transverse energy.  It is used by AliAnalysisTaskHadEt.
+// This gets information about the hadronic component of the transverse energy 
+// from tracks reconstructed in an event
+// it has daughters, AliAnalysisEtCommonMonteCarlo and 
+// AliAnalysisEtCommonReconstructed which loop over either Monte Carlo data or 
+// real data to get Et
+
+#include "AliAnalysisEtCommon.h"
+#include "TMath.h"
+#include "TList.h"
+#include "TH1F.h"
+#include "TH2F.h"
+#include <iostream>
+#include "AliAnalysisEtCuts.h"
+#include "AliMCEvent.h"
+#include "AliVEvent.h"
+#include "AliStack.h"
+#include "AliESDtrackCuts.h"
+#include "TDatabasePDG.h"
+#include "TParticle.h"
+#include "Rtypes.h"
+#include "AliPDG.h"
+
+using namespace std;
+
+ClassImp(AliAnalysisEtCommon);
+//These are from the PDG database but by making them static the code is a bit more efficient and has no problems running with the plugin
+//Cuts are defined in $ROOTSYS/etc/pdg_table.txt
+
+Float_t AliAnalysisEtCommon::fgPionMass = 0.13957;
+Float_t AliAnalysisEtCommon::fgKaonMass = 0.493677;
+Float_t AliAnalysisEtCommon::fgProtonMass = 0.938272;
+Float_t AliAnalysisEtCommon::fgElectronMass = 0.000510999;
+Int_t AliAnalysisEtCommon::fgPiPlusCode = 211;
+Int_t AliAnalysisEtCommon::fgPiMinusCode = -211;
+Int_t AliAnalysisEtCommon::fgKPlusCode = 321;
+Int_t AliAnalysisEtCommon::fgKMinusCode = -321;
+Int_t AliAnalysisEtCommon::fgProtonCode = 2212;
+Int_t AliAnalysisEtCommon::fgAntiProtonCode = -2212;
+Int_t AliAnalysisEtCommon::fgLambdaCode = 3122;
+Int_t AliAnalysisEtCommon::fgAntiLambdaCode = -3122;
+Int_t AliAnalysisEtCommon::fgK0SCode = 310;
+Int_t AliAnalysisEtCommon::fgOmegaCode = 3334;
+Int_t AliAnalysisEtCommon::fgAntiOmegaCode = -3334;
+Int_t AliAnalysisEtCommon::fgXi0Code = 3322;
+Int_t AliAnalysisEtCommon::fgAntiXi0Code = -3322;
+Int_t AliAnalysisEtCommon::fgXiCode = 3312;
+Int_t AliAnalysisEtCommon::fgAntiXiCode = -3312;
+Int_t AliAnalysisEtCommon::fgSigmaCode = 3112;
+Int_t AliAnalysisEtCommon::fgAntiSigmaCode = -3112;
+Int_t AliAnalysisEtCommon::fgK0LCode = 130;
+Int_t AliAnalysisEtCommon::fgNeutronCode = 2112;
+Int_t AliAnalysisEtCommon::fgAntiNeutronCode = -2112;
+Int_t AliAnalysisEtCommon::fgEPlusCode = -11;
+Int_t AliAnalysisEtCommon::fgEMinusCode = 11;
+Int_t AliAnalysisEtCommon::fgMuPlusCode = -13;
+Int_t AliAnalysisEtCommon::fgMuMinusCode = 13;
+Int_t AliAnalysisEtCommon::fgGammaCode = 22;
+Int_t AliAnalysisEtCommon::fgPi0Code = 111;
+Int_t AliAnalysisEtCommon::fgEtaCode = 221;
+Int_t AliAnalysisEtCommon::fgOmega0Code = 223;
+
+
+
+Float_t AliAnalysisEtCommon::fgPtTPCCutOff = 0.15;
+Float_t AliAnalysisEtCommon::fgPtITSCutOff = 0.10;
+
+AliAnalysisEtCommon::AliAnalysisEtCommon() :
+  fHistogramNameSuffix("")
+  ,fCuts(0)
+  ,fEsdtrackCutsITSTPC(0)
+  ,fEsdtrackCutsTPC(0)
+  ,fEsdtrackCutsITS(0)
+{//default constructor
+
+}
+
+AliAnalysisEtCommon::~AliAnalysisEtCommon()
+{//destructor
+  delete fCuts;
+  delete fEsdtrackCutsITSTPC;
+  delete fEsdtrackCutsITS;
+  delete fEsdtrackCutsTPC;
+}
+
+Int_t AliAnalysisEtCommon::AnalyseEvent(AliVEvent *event)
+{ //this line is basically here to eliminate a compiler warning that event is not used.  Making it a virtual function did not work with the plugin.
+  cout << "This event has " << event->GetNumberOfTracks() << " tracks" << endl;
+  ResetEventValues();
+  return 0;
+}
+
+
+void AliAnalysisEtCommon::Init()
+{// clear variables, set up cuts and PDG info
+
+}
+
+void AliAnalysisEtCommon::ResetEventValues()
+{//Resets event values of et to zero
+  
+  if (!fCuts) { // some Init's needed
+    cout << __FILE__ << ":" << __LINE__ << " : Init " << endl;
+    if (!fCuts) {
+      cout << " setting up Cuts " << endl;
+      fCuts = new AliAnalysisEtCuts();
+    }
+  }
+}
+
+
+Float_t AliAnalysisEtCommon::Et(TParticle *part, float mass){//function to calculate et in the same way as it would be calculated in a calorimeter
+  if(mass+1000<0.01){//if no mass given return default.  The default argument is -1000
+    if(TMath::Abs(part->GetPDG(0)->PdgCode())==2212 || TMath::Abs(part->GetPDG(0)->PdgCode())==2112){
+      if(part->GetPDG(0)->PdgCode()==-2212 || part->GetPDG(0)->PdgCode()==-2112){//antiproton or antineutron
+       //for antinucleons we specifically want to return the kinetic energy plus twice the rest mass
+       return (part->Energy()+part->GetMass())*TMath::Sin(part->Theta());
+      }
+      if(part->GetPDG(0)->PdgCode()==2212 || part->GetPDG(0)->PdgCode()==2112){//proton or neutron
+       //for nucleons we specifically want to return the kinetic energy only
+       return (part->Energy()-part->GetMass())*TMath::Sin(part->Theta());
+      }
+    }
+    else{//otherwise go to the default
+      return part->Energy()*TMath::Sin(part->Theta());
+    }
+  }
+  else{//otherwise use the mass that was given
+    return (TMath::Sqrt(TMath::Power(part->P(),2.0)+TMath::Power(mass,2.0)))*TMath::Sin(part->Theta());
+  }
+  return 0.0;
+}
+Float_t AliAnalysisEtCommon::Et(Float_t p, Float_t theta, Int_t pid, Short_t charge) const {//function to calculate et in the same way as it would be calculated in a calorimeter
+  if(pid==fgPiPlusCode || pid==fgPiMinusCode){//Nothing special for pions
+    return TMath::Sqrt(p*p + fgPionMass*fgPionMass) * TMath::Sin(theta);
+  }
+  if(pid==fgKPlusCode || pid==fgKMinusCode){//Nothing special for kaons
+    return TMath::Sqrt(p*p + fgKaonMass*fgKaonMass) * TMath::Sin(theta);
+  }
+  if(pid==fgEPlusCode || pid==fgEMinusCode){//Nothing special for electrons
+    return TMath::Sqrt(p*p + fgElectronMass*fgElectronMass) * TMath::Sin(theta);
+  }
+  if(pid==fgProtonCode || pid==fgAntiProtonCode){//But for protons we must be careful...
+    if(charge<0.0){//antiprotns: kinetic energy plus twice the rest mass
+      return (TMath::Sqrt(p*p + fgProtonMass*fgProtonMass) + fgProtonMass) * TMath::Sin(theta);
+    }
+    if(charge>0.0){//antiprotns: kinetic energy only
+      return (TMath::Sqrt(p*p + fgProtonMass*fgProtonMass) - fgProtonMass) * TMath::Sin(theta);
+    }
+  }
+  cerr<<"Uh-oh!  Et not set properly!"<<endl;
+  return 0.0;
+}
diff --git a/PWG4/totEt/AliAnalysisEtCommon.h b/PWG4/totEt/AliAnalysisEtCommon.h
new file mode 100644 (file)
index 0000000..307220e
--- /dev/null
@@ -0,0 +1,115 @@
+//_________________________________________________________________________
+//Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili
+//University of Tennessee at Knoxville
+//
+// This class is designed for the analysis of the hadronic component of 
+// transverse energy.  It is used by AliAnalysisTaskHadEt.
+//_________________________________________________________________________
+#ifndef ALIANALYSISETCOMMON_H
+#define ALIANALYSISETCOMMON_H
+
+#include "TString.h"
+
+class TH2F;
+class TH1F;
+class AliVEvent;
+class TList;
+class AliESDtrackCuts;
+class Rtypes;
+class TParticle;
+class TDatabasePDG;
+class AliAnalysisEtCuts;
+
+class AliAnalysisEtCommon
+{
+public:
+   
+  AliAnalysisEtCommon();
+    virtual ~AliAnalysisEtCommon();
+
+    /** Analyse the event! */
+    virtual Int_t AnalyseEvent(AliVEvent *event);
+
+
+    /** Initialise the analysis, must be overloaded. */
+    virtual void Init();
+
+
+    /** Reset event specific values (Et etc.) */
+    virtual void ResetEventValues();
+
+    /** Cuts info */
+    AliAnalysisEtCuts * GetCuts() const { return fCuts; } 
+    virtual void SetCuts(const AliAnalysisEtCuts *cuts) 
+    { fCuts = (AliAnalysisEtCuts *) cuts; } 
+
+
+    void SetTPCITSTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsITSTPC = (AliESDtrackCuts *) cuts;}
+    void SetTPCOnlyTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsTPC = (AliESDtrackCuts *) cuts;}
+    void SetITSTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsITS = (AliESDtrackCuts *) cuts;}
+
+
+protected:   
+    
+    TString fHistogramNameSuffix; /** The suffix for the histogram names */
+
+    AliAnalysisEtCuts *fCuts; // keeper of basic cuts
+
+    /** PDG Database */
+    //TDatabasePDG *fPdgDB;//data base used for looking up pdg codes
+    //these codes are stored as variables because otherwise there were issues using this with the plugin
+
+    static Int_t fgPiPlusCode;//pdg pi plus code
+    static Int_t fgPiMinusCode;//pdg pi minus code
+    static Int_t fgKPlusCode;// pdg k plus code
+    static Int_t fgKMinusCode;//pdg k minus code
+    static Int_t fgProtonCode;//pdg proton code
+    static Int_t fgAntiProtonCode;//pdg antiproton code
+    static Int_t fgLambdaCode;// pdg lambda code
+    static Int_t fgAntiLambdaCode;//pdg antilambda code
+    static Int_t fgK0SCode;//pdg k0 short code
+    static Int_t fgOmegaCode;//pdg omega code
+    static Int_t fgAntiOmegaCode;//pdg anti-omega code
+    static Int_t fgXi0Code;//pdg xi-0 code
+    static Int_t fgAntiXi0Code;//pdg anti-xi0 code
+    static Int_t fgXiCode;//pdg xi code
+    static Int_t fgAntiXiCode;//pdg anti-xi code
+    static Int_t fgSigmaCode;//pdg sigma code
+    static Int_t fgAntiSigmaCode;//pdg anti-sigma code
+    static Int_t fgK0LCode;//pdg k0 long code
+    static Int_t fgNeutronCode;//pdg neutron code
+    static Int_t fgAntiNeutronCode;//pdg anti-neutron code
+    static Int_t fgEPlusCode;//pdg positron code
+    static Int_t fgEMinusCode;//pdg electron code
+    static Int_t fgMuPlusCode;//pdg positron code
+    static Int_t fgMuMinusCode;//pdg electron code
+    static Int_t fgGammaCode;//pdg gamma code
+    static Int_t fgPi0Code;//pdg neutral pion code
+    static Int_t fgEtaCode;//pdg eta code
+    static Int_t fgOmega0Code;//pdg eta code
+    static Float_t fgPionMass;//pdg pion mass
+    static Float_t fgKaonMass;//pdg kaon mass
+    static Float_t fgProtonMass;//pdg proton mass
+    static Float_t fgElectronMass;//pdg electron mass
+
+
+    Float_t Et(TParticle *part, float mass = -1000);
+    Float_t Et(Float_t p, Float_t theta, Int_t pid, Short_t charge) const;
+    AliESDtrackCuts* fEsdtrackCutsITSTPC;//esd track cuts for ITS+TPC tracks
+    AliESDtrackCuts* fEsdtrackCutsTPC;//esd track cuts for TPC tracks (which may also contain ITS hits)
+    AliESDtrackCuts* fEsdtrackCutsITS;//esd track cuts for ITS stand alone tracks
+
+    static Float_t fgPtTPCCutOff;//cut off for tracks in TPC
+    static Float_t fgPtITSCutOff;//cut off for tracks in ITS
+    
+
+
+ private:
+    //Declare it private to avoid compilation warning
+    AliAnalysisEtCommon & operator = (const AliAnalysisEtCommon & g) ;//cpy assignment
+    AliAnalysisEtCommon(const AliAnalysisEtCommon & g) ; // cpy ctor
+
+    ClassDef(AliAnalysisEtCommon, 1);
+};
+
+#endif // ALIANALYSISETCOMMON_H
index 69bd6f6..613ae1d 100644 (file)
@@ -14,7 +14,6 @@
 #include "AliMCEvent.h"
 #include "TH2F.h"
 #include "TParticle.h"
-#include "TDatabasePDG.h"
 #include "AliGenHijingEventHeader.h"
 #include "AliGenPythiaEventHeader.h"
 
@@ -44,7 +43,7 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
     // Get us an mc event
     AliMCEvent *event = dynamic_cast<AliMCEvent*>(ev);
 
-    Double_t protonMass = fPdgDB->GetParticle("proton")->Mass(); // should maybe use average of proton and neutron, but they are pretty close
+    Double_t protonMass =fgProtonMass;
 
     // Hijing header
     AliGenEventHeader* genHeader = event->GenEventHeader();
@@ -108,12 +107,12 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
         {
 
             if (
-                TMath::Abs(pdg->PdgCode()) == fProtonCode ||
-                TMath::Abs(pdg->PdgCode()) == fNeutronCode ||
-                TMath::Abs(pdg->PdgCode()) == fLambdaCode ||
-                TMath::Abs(pdg->PdgCode()) == fXiCode ||
-                TMath::Abs(pdg->PdgCode()) == fXi0Code ||
-                TMath::Abs(pdg->PdgCode()) == fOmegaCode
+                TMath::Abs(pdg->PdgCode()) == fgProtonCode ||
+                TMath::Abs(pdg->PdgCode()) == fgNeutronCode ||
+                TMath::Abs(pdg->PdgCode()) == fgLambdaCode ||
+                TMath::Abs(pdg->PdgCode()) == fgXiCode ||
+                TMath::Abs(pdg->PdgCode()) == fgXi0Code ||
+                TMath::Abs(pdg->PdgCode()) == fgOmegaCode
               )
             {
              if (pdg->PdgCode() > 0) { particleMassPart = - protonMass;}
@@ -121,37 +120,37 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
            }
            Double_t et = part->Energy() * TMath::Sin(part->Theta()) + particleMassPart;
                      
-           if (pdg->PdgCode() == fProtonCode || pdg->PdgCode() == fAntiProtonCode)
+           if (pdg->PdgCode() == fgProtonCode || pdg->PdgCode() == fgAntiProtonCode)
              {
                fProtonEt += et;
              }
-           if (pdg->PdgCode() == fPiPlusCode || pdg->PdgCode() == fPiMinusCode)
+           if (pdg->PdgCode() == fgPiPlusCode || pdg->PdgCode() == fgPiMinusCode)
              {
                fPionEt += et;
              }
-           if (pdg->PdgCode() == fKPlusCode || pdg->PdgCode() == fKMinusCode)
+           if (pdg->PdgCode() == fgKPlusCode || pdg->PdgCode() == fgKMinusCode)
              {
                fChargedKaonEt += et;
              }
-           if (pdg->PdgCode() == fMuPlusCode || pdg->PdgCode() == fMuMinusCode)
+           if (pdg->PdgCode() == fgMuPlusCode || pdg->PdgCode() == fgMuMinusCode)
              {
                fMuonEt += et;
              }
-           if (pdg->PdgCode() == fEPlusCode || pdg->PdgCode() == fEMinusCode)
+           if (pdg->PdgCode() == fgEPlusCode || pdg->PdgCode() == fgEMinusCode)
              {
                fElectronEt += et;
              }
 
            // some neutrals also
-           if(pdg->PdgCode() == fNeutronCode)
+           if(pdg->PdgCode() == fgNeutronCode)
            {
              fNeutronEt += et;
            }
-            if(pdg->PdgCode() == fAntiNeutronCode)
+            if(pdg->PdgCode() == fgAntiNeutronCode)
            {
              fAntiNeutronEt += et;
            }
-           if(pdg->PdgCode() == fGammaCode)
+           if(pdg->PdgCode() == fgGammaCode)
            {
              fGammaEt += et;
            }
@@ -177,23 +176,23 @@ Int_t AliAnalysisEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
                  fTotEtAcc += et;
 
 
-                   if (pdg->PdgCode() == fProtonCode || pdg->PdgCode() == fAntiProtonCode)
+                   if (pdg->PdgCode() == fgProtonCode || pdg->PdgCode() == fgAntiProtonCode)
                      {
                        fProtonEtAcc += et;
                      }
-                   if (pdg->PdgCode() == fPiPlusCode || pdg->PdgCode() == fPiMinusCode)
+                   if (pdg->PdgCode() == fgPiPlusCode || pdg->PdgCode() == fgPiMinusCode)
                      {
                        fPionEtAcc += et;
                      }
-                   if (pdg->PdgCode() == fKPlusCode || pdg->PdgCode() == fKMinusCode)
+                   if (pdg->PdgCode() == fgKPlusCode || pdg->PdgCode() == fgKMinusCode)
                      {
                        fChargedKaonEtAcc += et;
                      }
-                   if (pdg->PdgCode() == fMuPlusCode || pdg->PdgCode() == fMuMinusCode)
+                   if (pdg->PdgCode() == fgMuPlusCode || pdg->PdgCode() == fgMuMinusCode)
                      {
                        fMuonEtAcc += et;
                      }
-                   if (pdg->PdgCode() == fEPlusCode || pdg->PdgCode() == fEMinusCode)
+                   if (pdg->PdgCode() == fgEPlusCode || pdg->PdgCode() == fgEMinusCode)
                      {
                        fElectronEtAcc += et;
                      }
index 1bb65e5..7d0a18d 100644 (file)
@@ -53,7 +53,7 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev)
     ResetEventValues();
     AliESDEvent *event = dynamic_cast<AliESDEvent*>(ev);
 
-    Double_t protonMass = fPdgDB->GetParticle("proton")->Mass();
+    Double_t protonMass = fgProtonMass;
 
     //for PID
     AliESDpid pID;
index 62f5dcc..06dca73 100644 (file)
 using namespace std;
 
 ClassImp(AliAnalysisHadEt);
-//These are from the PDG database but by making them static the code is a bit more efficient and has no problems running with the plugin
-Float_t AliAnalysisHadEt::fgPionMass = 0.13957;
-Float_t AliAnalysisHadEt::fgKaonMass = 0.493677;
-Float_t AliAnalysisHadEt::fgProtonMass = 0.938272;
-Float_t AliAnalysisHadEt::fgElectronMass = 0.000510999;
-Int_t AliAnalysisHadEt::fgPiPlusCode = 211;
-Int_t AliAnalysisHadEt::fgPiMinusCode = -211;
-Int_t AliAnalysisHadEt::fgKPlusCode = 321;
-Int_t AliAnalysisHadEt::fgKMinusCode = -321;
-Int_t AliAnalysisHadEt::fgProtonCode = 2212;
-Int_t AliAnalysisHadEt::fgAntiProtonCode = -2212;
-Int_t AliAnalysisHadEt::fgLambdaCode = 3122;
-Int_t AliAnalysisHadEt::fgAntiLambdaCode = -3122;
-Int_t AliAnalysisHadEt::fgK0SCode = 310;
-Int_t AliAnalysisHadEt::fgOmegaCode = 3334;
-Int_t AliAnalysisHadEt::fgAntiOmegaCode = -3334;
-Int_t AliAnalysisHadEt::fgXi0Code = 3322;
-Int_t AliAnalysisHadEt::fgAntiXi0Code = -3322;
-Int_t AliAnalysisHadEt::fgXiCode = 3312;
-Int_t AliAnalysisHadEt::fgAntiXiCode = -3312;
-Int_t AliAnalysisHadEt::fgSigmaCode = 3112;
-Int_t AliAnalysisHadEt::fgAntiSigmaCode = -3112;
-Int_t AliAnalysisHadEt::fgK0LCode = 130;
-Int_t AliAnalysisHadEt::fgNeutronCode = 2112;
-Int_t AliAnalysisHadEt::fgAntiNeutronCode = -2112;
-Int_t AliAnalysisHadEt::fgEPlusCode = -11;
-Int_t AliAnalysisHadEt::fgEMinusCode = 11;
-Int_t AliAnalysisHadEt::fgGammaCode = 22;
-Int_t AliAnalysisHadEt::fgPi0Code = 111;
-Int_t AliAnalysisHadEt::fgEtaCode = 221;
-Int_t AliAnalysisHadEt::fgOmega0Code = 223;
 
 
-// Int_t AliAnalysisHadEt::fgnumOfEtaBins = 46;
-// Float_t AliAnalysisHadEt::fgEtaAxis[47]={-0.78, -0.74, -0.7, -0.66, -0.62, -0.58, -0.54, -0.5, -0.46, -0.42, -0.38, -0.34, -0.3, -0.26, -0.22, -0.18, -0.14, -0.12, -0.1, -0.08, -0.06, -0.04, -0.02, -0.0, 0.02, 0.04, 0.06, 0.08, 0.1, 0.12, 0.14, 0.18, 0.22, 0.26, 0.3, 0.34, 0.38, 0.42, 0.46, 0.5, 0.54, 0.58, 0.62, 0.66, 0.7, 0.74, 0.78};
-//reduction in the number of bins
 Int_t AliAnalysisHadEt::fgnumOfEtaBins = 16;
 Float_t AliAnalysisHadEt::fgEtaAxis[17]={-0.78, -0.7, -0.58, -0.46, -0.34, -0.22, -0.12, -0.06, -0.0, 0.06, 0.12, 0.22, 0.34, 0.46, 0.58, 0.7, 0.78};
 Int_t AliAnalysisHadEt::fgNumOfPtBins = 111;
@@ -77,34 +43,27 @@ Float_t AliAnalysisHadEt::fgPtAxis[117]=
    5.0, 5.5, 6.0, 6.5, 7.0, 7.50, 8.00, 8.5, 9.0, 9.5, 10.0,12.0,14.0,16.0,18.0,
   20.0,25.0,30.0,35.0,40.0, 45.0, 50.0}; 
 
-Float_t AliAnalysisHadEt::fgPtTPCCutOff = 0.15;
-Float_t AliAnalysisHadEt::fgPtITSCutOff = 0.10;
 
-AliAnalysisHadEt::AliAnalysisHadEt() :
-        fHistogramNameSuffix("")
-       ,fCuts(0)
-       ,fSumEt(0)
-       ,fSumEtAcc(0)
-       ,fTotEt(0)
-       ,fTotEtAcc(0)
-       ,fTotNeutralEt(0)
-       ,fTotNeutralEtAcc(0)
-       ,fTotChargedEt(0)
-       ,fTotChargedEtAcc(0)
-       ,fMultiplicity(0)
-       ,fChargedMultiplicity(0)
-       ,fNeutralMultiplicity(0)
-        ,fEsdtrackCutsITSTPC(0)
-        ,fEsdtrackCutsTPC(0)
-       ,fEsdtrackCutsITS(0)
-        ,fhistoList(0)
+AliAnalysisHadEt::AliAnalysisHadEt() : AliAnalysisEtCommon()
+                                    ,fHistogramNameSuffix("")
+                                    ,fSumEt(0)
+                                    ,fSumEtAcc(0)
+                                    ,fTotEt(0)
+                                    ,fTotEtAcc(0)
+                                    ,fTotNeutralEt(0)
+                                    ,fTotNeutralEtAcc(0)
+                                    ,fTotChargedEt(0)
+                                    ,fTotChargedEtAcc(0)
+                                    ,fMultiplicity(0)
+                                    ,fChargedMultiplicity(0)
+                                    ,fNeutralMultiplicity(0)
+                                    ,fhistoList(0)
 {//default constructor
 
 }
 
 AliAnalysisHadEt::~AliAnalysisHadEt()
 {//destructor
-  delete fCuts;
   delete fEsdtrackCutsITSTPC;
   delete fEsdtrackCutsITS;
   delete fEsdtrackCutsTPC;
@@ -112,30 +71,20 @@ AliAnalysisHadEt::~AliAnalysisHadEt()
 
 Int_t AliAnalysisHadEt::AnalyseEvent(AliVEvent *event)
 { //this line is basically here to eliminate a compiler warning that event is not used.  Making it a virtual function did not work with the plugin.
-  cout << "This event has " << event->GetNumberOfTracks() << " tracks" << endl;
+  AliAnalysisEtCommon::AnalyseEvent(event);
   ResetEventValues();
   return 0;
 }
 
-void AliAnalysisHadEt::FillOutputList()
-{//fill the output histogram list with histograms in all AliAnalysisHadEt's
-}
 
 void AliAnalysisHadEt::Init()
 {// clear variables, set up cuts and PDG info
-
-}
-
-void AliAnalysisHadEt::CreateHistograms()
-{//creates histograms included in all AliAnalysisHadEt's
-}
-
-void AliAnalysisHadEt::FillHistograms()
-{//Fills histograms filled for all AliAnalysisHadEt's
+  AliAnalysisEtCommon::Init();
 }
 
 void AliAnalysisHadEt::ResetEventValues()
 {//Resets event values of et to zero
+  AliAnalysisEtCommon::ResetEventValues();
   fTotEt = 0;
   fTotEtAcc = 0;
   fTotNeutralEt = 0;
@@ -146,19 +95,7 @@ void AliAnalysisHadEt::ResetEventValues()
   fChargedMultiplicity = 0;
   fNeutralMultiplicity = 0;
   
-  if (!fCuts) { // some Init's needed
-    cout << __FILE__ << ":" << __LINE__ << " : Init " << endl;
-    if (!fCuts) {
-      cout << " setting up Cuts " << endl;
-      fCuts = new AliAnalysisEtCuts();
-    }
-  }
-}
-
-void AliAnalysisHadEt::SetParticleCodes()
-{  //the codes are defined in $ROOTSYS/etc/pdg_table.txt
 }
-
 void AliAnalysisHadEt::CreateEtaPtHisto2D(TString name, TString title)
 {     //creates a 2-d histogram in eta and phi and adds it to the list of histograms to be saved
   TString *histoname   = new TString();
@@ -300,23 +237,24 @@ Float_t AliAnalysisHadEt::Et(TParticle *part, float mass){//function to calculat
   return 0.0;
 }
 Float_t AliAnalysisHadEt::Et(Float_t p, Float_t theta, Int_t pid, Short_t charge) const {//function to calculate et in the same way as it would be calculated in a calorimeter
-  if(pid==fgPiPlusCode || pid==fgPiMinusCode){//Nothing special for pions
+  if(pid==AliAnalysisEtCommon::fgPiPlusCode || pid==AliAnalysisEtCommon::fgPiMinusCode){//Nothing special for pions
     return TMath::Sqrt(p*p + fgPionMass*fgPionMass) * TMath::Sin(theta);
   }
-  if(pid==fgKPlusCode || pid==fgKMinusCode){//Nothing special for kaons
-    return TMath::Sqrt(p*p + fgKaonMass*fgKaonMass) * TMath::Sin(theta);
+  if(pid==AliAnalysisEtCommon::fgKPlusCode || pid==AliAnalysisEtCommon::fgKMinusCode){//Nothing special for kaons
+    return TMath::Sqrt(p*p + AliAnalysisEtCommon::fgKaonMass*AliAnalysisEtCommon::fgKaonMass) * TMath::Sin(theta);
   }
-  if(pid==fgEPlusCode || pid==fgEMinusCode){//Nothing special for electrons
-    return TMath::Sqrt(p*p + fgElectronMass*fgElectronMass) * TMath::Sin(theta);
+  if(pid==AliAnalysisEtCommon::fgEPlusCode || pid==AliAnalysisEtCommon::fgEMinusCode){//Nothing special for electrons
+    return TMath::Sqrt(p*p + AliAnalysisEtCommon::fgElectronMass*AliAnalysisEtCommon::fgElectronMass) * TMath::Sin(theta);
   }
-  if(pid==fgProtonCode || pid==fgAntiProtonCode){//But for protons we must be careful...
+  if(pid==AliAnalysisEtCommon::fgProtonCode || pid==AliAnalysisEtCommon::fgAntiProtonCode){//But for protons we must be careful...
     if(charge<0.0){//antiprotns: kinetic energy plus twice the rest mass
-      return (TMath::Sqrt(p*p + fgProtonMass*fgProtonMass) + fgProtonMass) * TMath::Sin(theta);
+      return (TMath::Sqrt(p*p + AliAnalysisEtCommon::fgProtonMass*AliAnalysisEtCommon::fgProtonMass) + AliAnalysisEtCommon::fgProtonMass) * TMath::Sin(theta);
     }
     if(charge>0.0){//antiprotns: kinetic energy only
-      return (TMath::Sqrt(p*p + fgProtonMass*fgProtonMass) - fgProtonMass) * TMath::Sin(theta);
+      return (TMath::Sqrt(p*p + AliAnalysisEtCommon::fgProtonMass*AliAnalysisEtCommon::fgProtonMass) - AliAnalysisEtCommon::fgProtonMass) * TMath::Sin(theta);
     }
   }
   cerr<<"Uh-oh!  Et not set properly!"<<endl;
   return 0.0;
 }
+
index ba28726..5c75f60 100644 (file)
@@ -9,6 +9,7 @@
 #define ALIANALYSISHADET_H
 
 #include "TString.h"
+#include "AliAnalysisEtCommon.h"
 
 class TH2F;
 class TH1F;
@@ -20,7 +21,7 @@ class TParticle;
 class TDatabasePDG;
 class AliAnalysisEtCuts;
 
-class AliAnalysisHadEt
+class AliAnalysisHadEt : public AliAnalysisEtCommon
 {
 public:
    
@@ -30,26 +31,13 @@ public:
     /** Analyse the event! */
     virtual Int_t AnalyseEvent(AliVEvent *event);
 
-    /** Fill the objects you want to output, classes which add new histograms should overload this. */
-    virtual void FillOutputList();
 
     /** Initialise the analysis, must be overloaded. */
     virtual void Init();
 
-    /** 
-    * Creates the histograms, must be overloaded if you want to add your own. 
-    * Uses the fHistogramNameSuffix to create proper histogram names
-    */
-    virtual void CreateHistograms();
-    
-    /** Fills the histograms, must be overloaded if you want to add your own */
-    virtual void FillHistograms();
-
     /** Reset event specific values (Et etc.) */
     virtual void ResetEventValues();
 
-    /** Set Particle codes/mass */
-    virtual void SetParticleCodes();
 
     /** Cuts info */
     AliAnalysisEtCuts * GetCuts() const { return fCuts; } 
@@ -83,50 +71,11 @@ public:
 
     void SetHistoList(const TList *mylist){fhistoList = (TList *) mylist;}
 
-    void SetTPCITSTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsITSTPC = (AliESDtrackCuts *) cuts;}
-    void SetTPCOnlyTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsTPC = (AliESDtrackCuts *) cuts;}
-    void SetITSTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsITS = (AliESDtrackCuts *) cuts;}
 
 protected:   
     
     TString fHistogramNameSuffix; /** The suffix for the histogram names */
 
-    AliAnalysisEtCuts *fCuts; // keeper of basic cuts
-
-    /** PDG Database */
-    //TDatabasePDG *fPdgDB;//data base used for looking up pdg codes
-    //these codes are stored as variables because otherwise there were issues using this with the plugin
-    static Int_t fgPiPlusCode;//pdg pi plus code
-    static Int_t fgPiMinusCode;//pdg pi minus code
-    static Int_t fgKPlusCode;// pdg k plus code
-    static Int_t fgKMinusCode;//pdg k minus code
-    static Int_t fgProtonCode;//pdg proton code
-    static Int_t fgAntiProtonCode;//pdg antiproton code
-    static Int_t fgLambdaCode;// pdg lambda code
-    static Int_t fgAntiLambdaCode;//pdg antilambda code
-    static Int_t fgK0SCode;//pdg k0 short code
-    static Int_t fgOmegaCode;//pdg omega code
-    static Int_t fgAntiOmegaCode;//pdg anti-omega code
-    static Int_t fgXi0Code;//pdg xi-0 code
-    static Int_t fgAntiXi0Code;//pdg anti-xi0 code
-    static Int_t fgXiCode;//pdg xi code
-    static Int_t fgAntiXiCode;//pdg anti-xi code
-    static Int_t fgSigmaCode;//pdg sigma code
-    static Int_t fgAntiSigmaCode;//pdg anti-sigma code
-    static Int_t fgK0LCode;//pdg k0 long code
-    static Int_t fgNeutronCode;//pdg neutron code
-    static Int_t fgAntiNeutronCode;//pdg anti-neutron code
-    static Int_t fgEPlusCode;//pdg positron code
-    static Int_t fgEMinusCode;//pdg electron code
-    static Int_t fgGammaCode;//pdg gamma code
-    static Int_t fgPi0Code;//pdg neutral pion code
-    static Int_t fgEtaCode;//pdg eta code
-    static Int_t fgOmega0Code;//pdg eta code
-    static Float_t fgPionMass;//pdg pion mass
-    static Float_t fgKaonMass;//pdg kaon mass
-    static Float_t fgProtonMass;//pdg proton mass
-    static Float_t fgElectronMass;//pdg electron mass
-
     
     Double_t fSumEt;/** Sum of the total Et for all events */
     Double_t fSumEtAcc;/** Sum of the total Et within our acceptance for all events */
@@ -153,9 +102,6 @@ protected:
 
     Float_t Et(TParticle *part, float mass = -1000);
     Float_t Et(Float_t p, Float_t theta, Int_t pid, Short_t charge) const;
-    AliESDtrackCuts* fEsdtrackCutsITSTPC;//esd track cuts for ITS+TPC tracks
-    AliESDtrackCuts* fEsdtrackCutsTPC;//esd track cuts for TPC tracks (which may also contain ITS hits)
-    AliESDtrackCuts* fEsdtrackCutsITS;//esd track cuts for ITS stand alone tracks
 
     TList *fhistoList;//list of histograms saved out to file
     //static Float_t fgEtaAxis[47];//bins for eta axis of histograms
@@ -163,8 +109,6 @@ protected:
     static Int_t fgnumOfEtaBins;//number of eta bins
     static Float_t fgPtAxis[117];//bins for pt axis of histograms
     static Int_t fgNumOfPtBins;//number of pt bins
-    static Float_t fgPtTPCCutOff;//cut off for tracks in TPC
-    static Float_t fgPtITSCutOff;//cut off for tracks in ITS
     
 
 
index 5ba7d51..6c67c12 100644 (file)
@@ -24,6 +24,7 @@
 #include "AliAnalysisEtCuts.h"
 #include <iostream>
 #include "TRandom.h"
+#include "AliAnalysisEtCommon.h"
 
 using namespace std;
 
@@ -37,14 +38,16 @@ AliAnalysisHadEtMonteCarlo::AliAnalysisHadEtMonteCarlo():AliAnalysisHadEt()
                                                        ,fSimPiKPEt(0)
                                                        ,fSimHadEt(0)
                                                        ,fSimTotEt(0) 
+                                                       ,fInvestigateSmearing(0)
+                                                       ,fInvestigateFull(0)
+                                                       ,fInvestigateEMCal(0)
+                                                       ,fInvestigatePHOS(0)
+                                                       ,fInvestigatePiKP(0)
+                                                       ,fRequireITSHits(0)
                                                        ,fPtSmearer(0)
 {
-//   for(int i=0;i<fgNumSmearWidths;i++){
-//     //fSimPiKPEtSmeared[i] = 0.0;
-//   }
 }
 AliAnalysisHadEtMonteCarlo::~AliAnalysisHadEtMonteCarlo(){//destructor
-  //if(fSimPiKPEtSmeared) delete [] fSimPiKPEtSmeared;
   if(fPtSmearer) delete fPtSmearer;
 }
 
@@ -65,25 +68,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
 
   //for PID
   AliESDpid *pID = new AliESDpid();
-  //pID->MakePID(realEvent);
 
-  //This code taken from https://twiki.cern.ch/twiki/bin/view/ALICE/SelectionOfPrimaryTracksForPp2009DataAnalysis
-  //Gets good tracks
-  //=============================================
-  // Primary vertex
-  const AliESDVertex *vertex = realEvent->GetPrimaryVertexTracks();
-  if(vertex->GetNContributors()<1) {
-    // SPD vertex
-    vertex = realEvent->GetPrimaryVertexSPD();
-    if(vertex->GetNContributors()<1) {
-      // NO GOOD VERTEX, SKIP EVENT 
-    }
-  }
-  // apply a cut |zVertex| < CUT, if needed
-
-  
-
-  //fEsdtrackCutsITSTPC->SetEtaRange(-0.8,0.8); // normally, |eta|<0.8
   //=============================================
 
   //Roughly following $ALICE_ROOT/PWG0/dNdEta/AlidNdEtaCorrectionTask
@@ -92,7 +77,9 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
   TString *strTPC = new TString("TPC");
   TString *strITS = new TString("ITS");
   TString *strTPCITS = new TString("TPCITS");
-  for(Int_t cutset=0;cutset<2;cutset++){
+  Int_t lastcutset = 1;
+  if(fRequireITSHits) lastcutset = 2;
+  for(Int_t cutset=0;cutset<=lastcutset;cutset++){
     TString *cutName;
     TObjArray* list;
     switch(cutset){
@@ -123,8 +110,8 @@ 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));
@@ -142,13 +129,11 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
          bool isKaon = (nSigmaPion>3.0 && nSigmaProton>2.0 && nSigmaKaon<2.0);
          bool isProton = (nSigmaPion>3.0 && nSigmaProton<2.0 && nSigmaKaon>2.0);
 
-         //bool IsElectron = false;
          bool unidentified = (!isProton && !isKaon && !isElectron);
          Float_t dEdx = track->GetTPCsignal();
          if(cutset==1) dEdx = track->GetITSsignal();
 
          FillHisto2D(Form("dEdxAll%s",cutName->Data()),track->P(),dEdx,1.0);
-         //if(cutset==1) cout<<"filling "<<track->P()<<" "<<dEdx<<endl;
 
          UInt_t label = (UInt_t)TMath::Abs(track->GetLabel());
          TParticle  *simPart  = stack->Particle(label);
@@ -159,11 +144,9 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
          else{//analysis
            if(stack->IsPhysicalPrimary(label)){
              if (TMath::Abs(simPart->Eta()) < fCuts->GetCommonEtaCut()){
-             //if (TMath::Abs(simPart->Eta()) < 0.7)       {
-
                Int_t pdgCode =  simPart->GetPDG(0)->PdgCode();
                Int_t mypid = 0;
-               if(pdgCode==fgPiPlusCode) mypid = 1;
+               if(pdgCode==AliAnalysisHadEt::fgPiPlusCode) mypid = 1;
                if(pdgCode==fgProtonCode) mypid = 2;
                if(pdgCode==fgKPlusCode) mypid = 3;
                if(pdgCode==fgEPlusCode) mypid = 4;
@@ -171,8 +154,6 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
                if(pdgCode==fgAntiProtonCode) mypid = 2;
                if(pdgCode==fgKMinusCode) mypid = 3;
                if(pdgCode==fgEMinusCode) mypid = 4;
-               //cout<<pdgCode->PdgCode()<<" ";
-               //fPdgDB->GetSimParticle("pi+")->PdgCode();
                bool filled = false;      
                //============Charged hadrons===================================
                //identified...
@@ -189,7 +170,6 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
                if(isProton){
                  if(pdgCode!=fgProtonCode && pdgCode!=fgAntiProtonCode){
                    FillHisto2D(Form("MisidentifiedPIDs%s",cutName->Data()),2,mypid,1);
-                   // if(mypid==0)cerr<<"I was misidentified!  I'm not a proton! I am a "<<simPart->GetName()<<endl;
                  }
                  float myEt = Et(simPart);
                  if(track->Charge()>0){ FillHisto2D(Form("EtReconstructed%sIdentifiedProton",cutName->Data()),track->Pt(),track->Eta(),myEt);}
@@ -199,7 +179,6 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
                if(isKaon){
                  if(pdgCode!=fgKMinusCode && pdgCode!=fgKPlusCode){
                    FillHisto2D(Form("MisidentifiedPIDs%s",cutName->Data()),3,mypid,1);
-                   //if(mypid==0)cerr<<"I was misidentified!  I'm not a kaon! I am a "<<simPart->GetName()<<" p "<<track->P()<<" nSigmaProton "<<nSigmaProton<<" nSigmaPion "<<nSigmaPion<<" nSigmaKaon "<<nSigmaKaon<<endl;
                  }
                  float myEt = Et(simPart);
                  if(track->Charge()>0){ FillHisto2D(Form("EtReconstructed%sIdentifiedKPlus",cutName->Data()),track->Pt(),track->Eta(),myEt);}
@@ -209,7 +188,6 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
                if(isElectron){
                  if(pdgCode!=fgEMinusCode && pdgCode!=fgEPlusCode){
                    FillHisto2D(Form("MisidentifiedPIDs%s",cutName->Data()),4,mypid,1);
-                   //cerr<<"I was misidentified!  I'm not an electron! I am a "<<simPart->GetName()<<endl;
                  }
                  float myEt = Et(simPart);
                  if(track->Charge()>0){ FillHisto2D(Form("EtReconstructed%sIdentifiedEPlus",cutName->Data()),track->Pt(),track->Eta(),myEt);}
@@ -225,14 +203,10 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
                    FillHisto2D(Form("EtNReconstructed%sUnidentified",cutName->Data()),track->Pt(),track->Eta(),1.0);
                  }
                  FillHisto2D(Form("dEdxUnidentified%s",cutName->Data()),track->P(),dEdx,1.0);
-                 //cout<<"I was not identified.  I am a "<<simPart->GetName()<<" PID "<<pdgCode<<endl;
-                 //track what was not identified successfully
                  FillHisto1D(Form("UnidentifiedPIDs%s",cutName->Data()),mypid,1);
                }
                //...simulated
-               if(pdgCode == fgPiPlusCode){
-                 //cout<<"I'm a real primary "<<simPart->GetName()<<"! "<<"my label is "<<simPart->GetFirstMother()<<" track no "<<iTrack<<"/"<<realEvent->GetNumberOfTracks()<<endl;//<<" "<<label<<" "<<pdgCode<<endl;
-               
+               if(pdgCode == fgPiPlusCode){            
                  float myEt = Et(simPart);
                  FillHisto2D(Form("EtReconstructed%sPiPlus",cutName->Data()),simPart->Pt(),simPart->Eta(),myEt);
                  FillHisto2D(Form("EtReconstructed%sChargedHadron",cutName->Data()),simPart->Pt(),simPart->Eta(),myEt);
@@ -312,17 +286,10 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
                    FillHisto2D(Form("EtReconstructed%sEMinus",cutName->Data()),simPart->Pt(),simPart->Eta(),myEt);
                    filled = true;
                }
-               //if(!filled){
-                 //TParticlePDG *pc = simPart->GetPDG(0);
-                 //if( strcmp(pc->ParticleClass(),"Baryon")==0 || strcmp(pc->ParticleClass(),"Meson")==0 ){
-                 //cout<<"Did not find a place for "<<simPart->GetName()<<" "<<pdgCode<<" which is a "<<pc->ParticleClass()<<endl;
-                 //}
-                 //}
              }
              
            }
            else{//not a primary - we're after V0 daughters!
-             //cout<<"I'm a secondary "<<simPart->GetName()<<"!";//<<endl;
              if (TMath::Abs(simPart->Eta()) < fCuts->GetCommonEtaCut()){
                TParticle *mom = stack->Particle(simPart->GetFirstMother());
                if(mom){
@@ -363,7 +330,6 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev,AliVEvent* ev2)
                      if(grandma){
                        Int_t pdgCodeMom =  mom->GetPDG(0)->PdgCode();
                        if(pdgCodeMom==fgPiPlusCode || pdgCodeMom==fgPiMinusCode || pdgCodeMom==fgProtonCode ||pdgCodeMom==fgAntiProtonCode || pdgCodeMom==fgKPlusCode || pdgCode==fgKMinusCode){
-                         //cout<<" my grandmother is "<<grandma->GetName()<<" "<<endl;
                          Int_t pdgCodeGrandma =  grandma->GetPDG(0)->PdgCode();
                      
                          if(pdgCodeGrandma == fgXiCode){
@@ -442,42 +408,41 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
          if (TMath::Abs(part->Eta()) < fCuts->GetCommonEtaCut())           {
 
            Int_t pdgCode =  part->GetPDG(0)->PdgCode();
-           //cout<<pdgCode->PdgCode()<<" ";
-           //fPdgDB->GetParticle("pi+")->PdgCode();
            bool filled = false;
            //Investigating smearing...
            //Numbers are realistic correction factors from previous studies
-           if(pdgCode==fgPiPlusCode ||pdgCode==fgPiMinusCode ||pdgCode==fgKPlusCode ||pdgCode==fgKMinusCode ||pdgCode==fgProtonCode ||pdgCode==fgAntiProtonCode){
-             //To investigate Smearing...
-             Float_t myet = Et(part);
-             fSimPiKPEt += myet;
-             Float_t theta = part->Theta();
-             Short_t charge = 1;
-             Float_t momentum = part->P();
-             //pt smearing
-             Float_t pSmeared = momentum *  fPtSmearer->Gaus(1,0.005);//Gaussian centered around 1
-             fSimPiKPEtPtSmeared += Et(pSmeared,theta,pdgCode,charge);
-             //Efficiency smearing
-             float efficiency = 2.26545*TMath::Exp(-TMath::Power(9.99977e-01/part->Pt(),7.85488e-02));//simple rough efficiency from fitting curve
-             if(fPtSmearer->Binomial(1,efficiency) ==1){
-               fSimPiKPEtEfficiencySmeared += (1.0/efficiency)*myet;
-             }
-             //pT cut smeared
-             if(part->Pt()>0.10){fSimPiKPEtPtCutSmearedITS +=1.00645645*myet;}
-             if(part->Pt()>0.15){fSimPiKPEtPtCutSmearedTPC +=1.02000723*myet;}
-             //PID smearing
-             fSimPiKPEtPIDSmearedNoID += 1.02679314*Et(momentum,theta,fgPiPlusCode,charge);
-             if(part->P()<1.0){//then the particle would have been ID'd
-               fSimPiKPEtPIDSmeared += 1.0085942*myet;
-             }
-             else{//Then it would have been assumed to be a pion
-               fSimPiKPEtPIDSmeared += 1.0085942*Et(momentum,theta,fgPiPlusCode,charge);
+           if(fInvestigateSmearing){
+             if(pdgCode==fgPiPlusCode ||pdgCode==fgPiMinusCode ||pdgCode==fgKPlusCode ||pdgCode==fgKMinusCode ||pdgCode==fgProtonCode ||pdgCode==fgAntiProtonCode){
+               //To investigate Smearing...
+               Float_t myet = Et(part);
+               fSimPiKPEt += myet;
+               Float_t theta = part->Theta();
+               Short_t charge = 1;
+               Float_t momentum = part->P();
+               //pt smearing
+               Float_t pSmeared = momentum *  fPtSmearer->Gaus(1,0.005);//Gaussian centered around 1
+               fSimPiKPEtPtSmeared += Et(pSmeared,theta,pdgCode,charge);
+               //Efficiency smearing
+               float efficiency = 2.26545*TMath::Exp(-TMath::Power(9.99977e-01/part->Pt(),7.85488e-02));//simple rough efficiency from fitting curve
+               if(fPtSmearer->Binomial(1,efficiency) ==1){
+                 fSimPiKPEtEfficiencySmeared += (1.0/efficiency)*myet;
+               }
+               //pT cut smeared
+               if(part->Pt()>0.10){fSimPiKPEtPtCutSmearedITS +=1.00645645*myet;}
+               if(part->Pt()>0.15){fSimPiKPEtPtCutSmearedTPC +=1.02000723*myet;}
+               //PID smearing
+               fSimPiKPEtPIDSmearedNoID += 1.02679314*Et(momentum,theta,fgPiPlusCode,charge);
+               if(part->P()<1.0){//then the particle would have been ID'd
+                 fSimPiKPEtPIDSmeared += 1.0085942*myet;
+               }
+               else{//Then it would have been assumed to be a pion
+                 fSimPiKPEtPIDSmeared += 1.0085942*Et(momentum,theta,fgPiPlusCode,charge);
+               }
              }
            }
 
            //============Charged hadrons===================================
            if(pdgCode == fgPiPlusCode){
-             //cout<<"I'm a simulated primary "<<part->GetName()<<"! "<<"my label is "<<part->GetFirstMother()<<" pt "<<part->Pt()<<endl;
              float myEt = Et(part);
 
              fSimHadEt += myEt;
@@ -930,22 +895,21 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
     if(fSimHadEt>0.0)FillHisto1D("SimHadEt",fSimHadEt,1.0);
     if(fSimPiKPEt>0.0)FillHisto1D("SimPiKPEt",fSimPiKPEt,1.0);
 
-    //Smearing histograms
-    if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPtSmeared",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPtSmeared)/fSimPiKPEt,1.0);
-    FillHisto1D("SimPiKPEtPtSmeared",fSimPiKPEtPtSmeared,1.0);
-    if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimEfficiencySmeared",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtEfficiencySmeared)/fSimPiKPEt,1.0);
-    FillHisto1D("SimPiKPEtEfficiencySmeared",fSimPiKPEtEfficiencySmeared,1.0);
-    if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPtCutSmearedTPC",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPtCutSmearedTPC)/fSimPiKPEt,1.0);
-    FillHisto1D("SimPiKPEtPtCutSmearedTPC",fSimPiKPEtPtCutSmearedTPC,1.0);
-    if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPtCutSmearedITS",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPtCutSmearedITS)/fSimPiKPEt,1.0);
-    FillHisto1D("SimPiKPEtPtCutSmearedITS",fSimPiKPEtPtCutSmearedTPC,1.0);
-    if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPIDSmeared",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPIDSmeared)/fSimPiKPEt,1.0);
-    //if(fSimPiKPEt>0.0)cout<<"Filling SimPiKPEtMinusSimPIDSmeared with "<<fSimPiKPEt<<","<<(fSimPiKPEt-fSimPiKPEtPIDSmeared)/fSimPiKPEt<<endl;
-    FillHisto1D("SimPiKPEtPIDSmeared",fSimPiKPEtPIDSmeared,1.0);
-    if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPIDSmearedNoID",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPIDSmearedNoID)/fSimPiKPEt,1.0);
-    //if(fSimPiKPEt>0.0)cout<<"Filling SimPiKPEtMinusSimPIDSmearedNoID with "<<fSimPiKPEt<<","<<(fSimPiKPEt-fSimPiKPEtPIDSmearedNoID)/fSimPiKPEt<<endl;
-    FillHisto1D("SimPiKPEtPIDSmearedNoID",fSimPiKPEtPIDSmearedNoID,1.0);
-
+    if(fInvestigateSmearing){
+      //Smearing histograms
+      if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPtSmeared",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPtSmeared)/fSimPiKPEt,1.0);
+      FillHisto1D("SimPiKPEtPtSmeared",fSimPiKPEtPtSmeared,1.0);
+      if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimEfficiencySmeared",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtEfficiencySmeared)/fSimPiKPEt,1.0);
+      FillHisto1D("SimPiKPEtEfficiencySmeared",fSimPiKPEtEfficiencySmeared,1.0);
+      if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPtCutSmearedTPC",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPtCutSmearedTPC)/fSimPiKPEt,1.0);
+      FillHisto1D("SimPiKPEtPtCutSmearedTPC",fSimPiKPEtPtCutSmearedTPC,1.0);
+      if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPtCutSmearedITS",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPtCutSmearedITS)/fSimPiKPEt,1.0);
+      FillHisto1D("SimPiKPEtPtCutSmearedITS",fSimPiKPEtPtCutSmearedTPC,1.0);
+      if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPIDSmeared",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPIDSmeared)/fSimPiKPEt,1.0);
+      FillHisto1D("SimPiKPEtPIDSmeared",fSimPiKPEtPIDSmeared,1.0);
+      if(fSimPiKPEt>0.0) FillHisto2D("SimPiKPEtMinusSimPIDSmearedNoID",fSimPiKPEt,(fSimPiKPEt-fSimPiKPEtPIDSmearedNoID)/fSimPiKPEt,1.0);
+      FillHisto1D("SimPiKPEtPIDSmearedNoID",fSimPiKPEtPIDSmearedNoID,1.0);
+    }
     return 1;
     
 }
@@ -1018,7 +982,9 @@ void AliAnalysisHadEtMonteCarlo::CreateHistograms(){
   TString *strTPC = new TString("TPC");
   TString *strITS = new TString("ITS");
   TString *strTPCITS = new TString("TPCITS");
-  for(Int_t i=0;i<2;i++){
+  Int_t lastcutset = 1;
+  if(fRequireITSHits) lastcutset = 2;
+  for(Int_t i=0;i<=lastcutset;i++){
     TString *cutName;
     Float_t maxPtdEdx = 10;
     Float_t mindEdx = 35;
@@ -1123,8 +1089,8 @@ void AliAnalysisHadEtMonteCarlo::CreateHistograms(){
   TString *sEMCAL = new TString("EMCAL");
   TString *sPHOS = new TString("PHOS");
   float etDiff = 1.5;
-  
-  for(int tpc = 0;tpc<2;tpc++){
+
+  for(int tpc = 0;tpc<lastcutset;tpc++){
     TString *detector;
     TString *ptstring;
     if(tpc==1) {detector = sTPC; ptstring = sTPCpt;}
@@ -1134,142 +1100,135 @@ void AliAnalysisHadEtMonteCarlo::CreateHistograms(){
       TString *etstring;
       if(hadet==1) {et = sHadEt; etstring = sHadEtString;}
       else{et = sTotEt; etstring = sTotEtString;}
-      for(int type = 0;type<1;type++){
+      for(int type = 0;type<3;type++){
+       if(type==0 && !fInvestigateFull) continue;
+       if(type==1 && !fInvestigateEMCal) continue;
+       if(type==2 && !fInvestigatePHOS) continue;
        TString *acceptance;
        switch(type){
        case 0:
          acceptance = sFull;
+         etDiff = 1.5;
          break;
        case 1:
          acceptance = sEMCAL;
+         etDiff = 5;
          break;
        case 2:
          acceptance = sPHOS;
+         etDiff = 5;
          break;
        default:
          acceptance = sFull;
        }
-       sprintf(histoname,"Sim%sMinusRawEt%sAcceptance%s",et->Data(),acceptance->Data(),detector->Data());
-       sprintf(histotitle,"(Simulated %s - raw reconstructed)/(Simulated %s) with %s acceptance for p_{T}>%s GeV/c",etstring->Data(),etstring->Data(),acceptance->Data(),ptstring->Data());
-       sprintf(ytitle,"(Simulated %s - raw reconstructed)/(Simulated %s)",etstring->Data(),etstring->Data());
-       sprintf(xtitle,"Simulated %s",etstring->Data());
-       CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
-
        for(int pid = 0;pid<2;pid++){
          TString *partid;
          TString *partidstring;
          if(pid==1){partid = sPID; partidstring = sPID;}
          else{partid = sNoPID; partidstring = sNoPIDString;}
-
-         sprintf(histoname,"Sim%sVsReco%s%sAcceptance%s%s",et->Data(),et->Data(),acceptance->Data(),detector->Data(),partid->Data());
-         sprintf(histotitle,"Simulated %s vs reconstructed %s with %s acceptance for p_{T}>%s GeV/c%s",etstring->Data(),etstring->Data(),acceptance->Data(),ptstring->Data(),partidstring->Data());
-         sprintf(xtitle,"Simulated %s",etstring->Data());
-         sprintf(ytitle,"Reconstructed %s (%s acc., p_{T}>%s GeV/c,%s)",etstring->Data(),acceptance->Data(),ptstring->Data(),partidstring->Data());
-         CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,minEt,maxEt);
-
          sprintf(histoname,"Sim%sMinusReco%s%sAcceptance%s%s",et->Data(),et->Data(),acceptance->Data(),detector->Data(),partid->Data());
          sprintf(histotitle,"(Simulated %s - reconstructed %s)/(Simulated %s) with %s acceptance for p_{T}>%s GeV/c%s",etstring->Data(),etstring->Data(),etstring->Data(),acceptance->Data(),ptstring->Data(),partidstring->Data());
          sprintf(ytitle,"(Simulated %s - reconstructed %s)/(Simulated %s)",etstring->Data(),etstring->Data(),etstring->Data());
          sprintf(xtitle,"Simulated %s",etstring->Data());
          CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
-
-         if(hadet==0){//we only want to do this once...  not the most elegant way of coding but hey...
+         if(hadet==0 && type==0 && fInvestigatePiKP){//we only want to do this once...  not the most elegant way of coding but hey...
            sprintf(histoname,"SimPiKPMinusRecoPiKP%sAcceptance%s%s",acceptance->Data(),detector->Data(),partid->Data());
            sprintf(histotitle,"(Sim PiKP - reco PiKP)/(Sim PiKP) with %s acceptance for p_{T}>%s GeV/c%s",acceptance->Data(),ptstring->Data(),partidstring->Data());
            sprintf(ytitle,"(Sim PiKP - reco PiKP)/(Sim PiKP)");
            sprintf(xtitle,"Simulated E_{T}^{#pi,K,p}");
            CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
-           //cout<<"Creating "<<histoname<<endl;
          }
        }
       }
     }
   }
-   CreateHisto1D("SimPiKPEt","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt,minEt,maxEt);
+  CreateHisto1D("SimPiKPEt","Simulated #pi,K,p E_{T}","Simulated #pi,K,p E_{T}","Number of events",nbinsEt,minEt,maxEt);
   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);
 
   etDiff = 0.15;
 
-  //======================================================================
-
-  sprintf(histoname,"SimPiKPEtMinusSimPtSmeared");
-  sprintf(histotitle,"Simulated (true-smeared)/true for 0.5 percent momentum smearing");
-  sprintf(ytitle,"(true-smeared)/true");
-  sprintf(xtitle,"true p, K, p E_{T}");
-  CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff/10.0,etDiff/10.0);
-  sprintf(histoname,"SimPiKPEtPtSmeared");
-  sprintf(histotitle,"Simulated E_{T} for 0.5 percent momentum smearing");
-  sprintf(ytitle,"Number of events");
-  sprintf(xtitle,"p, K, p E_{T}");
-  CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
-
-  //======================================================================
-
-  sprintf(histoname,"SimPiKPEtMinusSimEfficiencySmeared");
-  sprintf(histotitle,"Simulated (true-smeared)/true for efficiency smearing");
-  sprintf(ytitle,"(true-smeared)/true");
-  sprintf(xtitle,"true p, K, p E_{T}");
-  CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff*5,etDiff*5);
-  sprintf(histoname,"SimPiKPEtEfficiencySmeared");
-  sprintf(histotitle,"Simulated E_{T} for efficiency smearing");
-  sprintf(ytitle,"Number of events");
-  sprintf(xtitle,"p, K, p E_{T}");
-  CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
-
-  //======================================================================
-
-  sprintf(histoname,"SimPiKPEtMinusSimPtCutSmearedTPC");
-  sprintf(histotitle,"Simulated (true-smeared)/true for p_{T}>0.15 GeV/c smearing");
-  sprintf(ytitle,"(true-smeared)/true");
-  sprintf(xtitle,"true p, K, p E_{T}");
-  CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
-  sprintf(histoname,"SimPiKPEtPtCutSmearedTPC");
-  sprintf(histotitle,"Simulated E_{T} for p_{T}>0.15 GeV/c smearing");
-  sprintf(ytitle,"Number of events");
-  sprintf(xtitle,"p, K, p E_{T}");
-  CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
-
-
-  //======================================================================
-
-  sprintf(histoname,"SimPiKPEtMinusSimPtCutSmearedITS");
-  sprintf(histotitle,"Simulated (true-smeared)/true for p_{T}>0.10 GeV/c smearing");
-  sprintf(ytitle,"(true-smeared)/true");
-  sprintf(xtitle,"true p, K, p E_{T}");
-  CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
-  sprintf(histoname,"SimPiKPEtPtCutSmearedITS");
-  sprintf(histotitle,"Simulated E_{T} for p_{T}>0.10 GeV/c smearing");
-  sprintf(ytitle,"Number of events");
-  sprintf(xtitle,"p, K, p E_{T}");
-  CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
-
-  //======================================================================
-
-  sprintf(histoname,"SimPiKPEtMinusSimPIDSmeared");
-  sprintf(histotitle,"Simulated (true-smeared)/true for PID smearing");
-  sprintf(ytitle,"(true-smeared)/true");
-  sprintf(xtitle,"true p, K, p E_{T}");
-  CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
-  sprintf(histoname,"SimPiKPEtPIDSmeared");
-  sprintf(histotitle,"Simulated E_{T} for PID smearing");
-  sprintf(ytitle,"Number of events");
-  sprintf(xtitle,"p, K, p E_{T}");
-  CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
-
-  //======================================================================
-
-  sprintf(histoname,"SimPiKPEtMinusSimPIDSmearedNoID");
-  sprintf(histotitle,"Simulated (true-smeared)/true for PID smearing No ID");
-  sprintf(ytitle,"(true-smeared)/true");
-  sprintf(xtitle,"true p, K, p E_{T}");
-  CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
-  sprintf(histoname,"SimPiKPEtPIDSmearedNoID");
-  sprintf(histotitle,"Simulated E_{T} for PID smearing No ID");
-  sprintf(ytitle,"Number of events");
-  sprintf(xtitle,"p, K, p E_{T}");
-  CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
-
+  if(fInvestigateSmearing){
+
+    //======================================================================
+
+    sprintf(histoname,"SimPiKPEtMinusSimPtSmeared");
+    sprintf(histotitle,"Simulated (true-smeared)/true for 0.5 percent momentum smearing");
+    sprintf(ytitle,"(true-smeared)/true");
+    sprintf(xtitle,"true p, K, p E_{T}");
+    CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff/10.0,etDiff/10.0);
+    sprintf(histoname,"SimPiKPEtPtSmeared");
+    sprintf(histotitle,"Simulated E_{T} for 0.5 percent momentum smearing");
+    sprintf(ytitle,"Number of events");
+    sprintf(xtitle,"p, K, p E_{T}");
+    CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
+
+    //======================================================================
+
+    sprintf(histoname,"SimPiKPEtMinusSimEfficiencySmeared");
+    sprintf(histotitle,"Simulated (true-smeared)/true for efficiency smearing");
+    sprintf(ytitle,"(true-smeared)/true");
+    sprintf(xtitle,"true p, K, p E_{T}");
+    CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff*5,etDiff*5);
+    sprintf(histoname,"SimPiKPEtEfficiencySmeared");
+    sprintf(histotitle,"Simulated E_{T} for efficiency smearing");
+    sprintf(ytitle,"Number of events");
+    sprintf(xtitle,"p, K, p E_{T}");
+    CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
+
+    //======================================================================
+
+    sprintf(histoname,"SimPiKPEtMinusSimPtCutSmearedTPC");
+    sprintf(histotitle,"Simulated (true-smeared)/true for p_{T}>0.15 GeV/c smearing");
+    sprintf(ytitle,"(true-smeared)/true");
+    sprintf(xtitle,"true p, K, p E_{T}");
+    CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
+    sprintf(histoname,"SimPiKPEtPtCutSmearedTPC");
+    sprintf(histotitle,"Simulated E_{T} for p_{T}>0.15 GeV/c smearing");
+    sprintf(ytitle,"Number of events");
+    sprintf(xtitle,"p, K, p E_{T}");
+    CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
+
+
+    //======================================================================
+
+    sprintf(histoname,"SimPiKPEtMinusSimPtCutSmearedITS");
+    sprintf(histotitle,"Simulated (true-smeared)/true for p_{T}>0.10 GeV/c smearing");
+    sprintf(ytitle,"(true-smeared)/true");
+    sprintf(xtitle,"true p, K, p E_{T}");
+    CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
+    sprintf(histoname,"SimPiKPEtPtCutSmearedITS");
+    sprintf(histotitle,"Simulated E_{T} for p_{T}>0.10 GeV/c smearing");
+    sprintf(ytitle,"Number of events");
+    sprintf(xtitle,"p, K, p E_{T}");
+    CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
+
+    //======================================================================
+
+    sprintf(histoname,"SimPiKPEtMinusSimPIDSmeared");
+    sprintf(histotitle,"Simulated (true-smeared)/true for PID smearing");
+    sprintf(ytitle,"(true-smeared)/true");
+    sprintf(xtitle,"true p, K, p E_{T}");
+    CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
+    sprintf(histoname,"SimPiKPEtPIDSmeared");
+    sprintf(histotitle,"Simulated E_{T} for PID smearing");
+    sprintf(ytitle,"Number of events");
+    sprintf(xtitle,"p, K, p E_{T}");
+    CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
+
+    //======================================================================
+
+    sprintf(histoname,"SimPiKPEtMinusSimPIDSmearedNoID");
+    sprintf(histotitle,"Simulated (true-smeared)/true for PID smearing No ID");
+    sprintf(ytitle,"(true-smeared)/true");
+    sprintf(xtitle,"true p, K, p E_{T}");
+    CreateHisto2D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt,nbinsEt,-etDiff,etDiff);
+    sprintf(histoname,"SimPiKPEtPIDSmearedNoID");
+    sprintf(histotitle,"Simulated E_{T} for PID smearing No ID");
+    sprintf(ytitle,"Number of events");
+    sprintf(xtitle,"p, K, p E_{T}");
+    CreateHisto1D(histoname,histotitle,xtitle,ytitle,nbinsEt,minEt,maxEt);
+  }
   delete sTPC;
   delete sITS;
   delete sTPCpt;
index ed773c2..c5c3dfc 100644 (file)
@@ -31,75 +31,86 @@ public:
     Float_t GetSimulatedHadronicEt() const {return fSimHadEt;}
     Float_t GetSimulatedTotalEt() const {return fSimTotEt;}
 
-    void FillSimTotEtVsRecoTotEtFullAcceptanceTPC(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtFullAcceptanceTPC",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtFullAcceptanceITS(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtFullAcceptanceITS",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtEMCALAcceptanceTPC(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtEMCALAcceptanceTPC",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtEMCALAcceptanceITS(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtEMCALAcceptanceITS",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtPHOSAcceptanceTPC(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtPHOSAcceptanceTPC",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtPHOSAcceptanceITS(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtPHOSAcceptanceITS",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtFullAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtFullAcceptanceTPCNoPID",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtFullAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtFullAcceptanceITSNoPID",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtEMCALAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtEMCALAcceptanceTPCNoPID",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtEMCALAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtEMCALAcceptanceITSNoPID",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtPHOSAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtPHOSAcceptanceTPCNoPID",fSimTotEt,et,1.0);}
-    void FillSimTotEtVsRecoTotEtPHOSAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtVsRecoTotEtPHOSAcceptanceITSNoPID",fSimTotEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtFullAcceptanceTPC(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtFullAcceptanceTPC",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtFullAcceptanceITS(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtFullAcceptanceITS",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtEMCALAcceptanceTPC(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtEMCALAcceptanceTPC",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtEMCALAcceptanceITS(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtEMCALAcceptanceITS",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtPHOSAcceptanceTPC(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtPHOSAcceptanceTPC",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtPHOSAcceptanceITS(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtPHOSAcceptanceITS",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtFullAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtFullAcceptanceTPCNoPID",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtFullAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtFullAcceptanceITSNoPID",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtEMCALAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtEMCALAcceptanceTPCNoPID",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtEMCALAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtEMCALAcceptanceITSNoPID",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtPHOSAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtPHOSAcceptanceTPCNoPID",fSimHadEt,et,1.0);}
-    void FillSimHadEtVsRecoHadEtPHOSAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtVsRecoHadEtPHOSAcceptanceITSNoPID",fSimHadEt,et,1.0);}
-
-    void FillSimTotEtMinusRecoTotEtFullAcceptanceTPC(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtFullAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtFullAcceptanceITS(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtFullAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtEMCALAcceptanceTPC(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtEMCALAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtEMCALAcceptanceITS(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtEMCALAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtPHOSAcceptanceTPC(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtPHOSAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtPHOSAcceptanceITS(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtPHOSAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtFullAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtFullAcceptanceTPCNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtFullAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtFullAcceptanceITSNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtEMCALAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtEMCALAcceptanceTPCNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtEMCALAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtEMCALAcceptanceITSNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtPHOSAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtPHOSAcceptanceTPCNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRecoTotEtPHOSAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRecoTotEtPHOSAcceptanceITSNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtFullAcceptanceTPC(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtFullAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtFullAcceptanceITS(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtFullAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtEMCALAcceptanceTPC(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtEMCALAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtEMCALAcceptanceITS(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtEMCALAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtPHOSAcceptanceTPC(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtPHOSAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtPHOSAcceptanceITS(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtPHOSAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtFullAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtFullAcceptanceTPCNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtFullAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtFullAcceptanceITSNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtEMCALAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtEMCALAcceptanceTPCNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtEMCALAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtEMCALAcceptanceITSNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtPHOSAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtPHOSAcceptanceTPCNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRecoHadEtPHOSAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRecoHadEtPHOSAcceptanceITSNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-
-
-    void FillSimTotEtMinusRawEtFullAcceptanceTPC(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRawEtFullAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRawEtFullAcceptanceITS(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRawEtFullAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRawEtEMCALAcceptanceTPC(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRawEtEMCALAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRawEtEMCALAcceptanceITS(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRawEtEMCALAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRawEtPHOSAcceptanceTPC(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRawEtPHOSAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimTotEtMinusRawEtPHOSAcceptanceITS(Float_t et){if(fSimTotEt>0.0)FillHisto2D("SimTotEtMinusRawEtPHOSAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
-    void FillSimHadEtMinusRawEtFullAcceptanceTPC(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRawEtFullAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRawEtFullAcceptanceITS(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRawEtFullAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRawEtEMCALAcceptanceTPC(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRawEtEMCALAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRawEtEMCALAcceptanceITS(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRawEtEMCALAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRawEtPHOSAcceptanceTPC(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRawEtPHOSAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
-    void FillSimHadEtMinusRawEtPHOSAcceptanceITS(Float_t et){if(fSimHadEt>0.0)FillHisto2D("SimHadEtMinusRawEtPHOSAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimTotEtVsRecoTotEtFullAcceptanceTPC(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtFullAcceptanceTPC",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtFullAcceptanceITS(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtFullAcceptanceITS",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtEMCALAcceptanceTPC(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtEMCALAcceptanceTPC",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtEMCALAcceptanceITS(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtEMCALAcceptanceITS",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtPHOSAcceptanceTPC(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtPHOSAcceptanceTPC",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtPHOSAcceptanceITS(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtPHOSAcceptanceITS",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtFullAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtFullAcceptanceTPCNoPID",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtFullAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtFullAcceptanceITSNoPID",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtEMCALAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtEMCALAcceptanceTPCNoPID",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtEMCALAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtEMCALAcceptanceITSNoPID",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtPHOSAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtPHOSAcceptanceTPCNoPID",fSimTotEt,et,1.0);}
+    void FillSimTotEtVsRecoTotEtPHOSAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtVsRecoTotEtPHOSAcceptanceITSNoPID",fSimTotEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtFullAcceptanceTPC(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtFullAcceptanceTPC",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtFullAcceptanceITS(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtFullAcceptanceITS",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtEMCALAcceptanceTPC(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtEMCALAcceptanceTPC",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtEMCALAcceptanceITS(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtEMCALAcceptanceITS",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtPHOSAcceptanceTPC(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtPHOSAcceptanceTPC",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtPHOSAcceptanceITS(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtPHOSAcceptanceITS",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtFullAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtFullAcceptanceTPCNoPID",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtFullAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtFullAcceptanceITSNoPID",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtEMCALAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtEMCALAcceptanceTPCNoPID",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtEMCALAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtEMCALAcceptanceITSNoPID",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtPHOSAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtPHOSAcceptanceTPCNoPID",fSimHadEt,et,1.0);}
+    void FillSimHadEtVsRecoHadEtPHOSAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtVsRecoHadEtPHOSAcceptanceITSNoPID",fSimHadEt,et,1.0);}
+
+    void FillSimTotEtMinusRecoTotEtFullAcceptanceTPC(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtFullAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtFullAcceptanceITS(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtFullAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtEMCALAcceptanceTPC(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtEMCALAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtEMCALAcceptanceITS(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtEMCALAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtPHOSAcceptanceTPC(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtPHOSAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtPHOSAcceptanceITS(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtPHOSAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtFullAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtFullAcceptanceTPCNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtFullAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtFullAcceptanceITSNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtEMCALAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtEMCALAcceptanceTPCNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtEMCALAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtEMCALAcceptanceITSNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtPHOSAcceptanceTPCNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtPHOSAcceptanceTPCNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRecoTotEtPHOSAcceptanceITSNoPID(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRecoTotEtPHOSAcceptanceITSNoPID",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtFullAcceptanceTPC(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtFullAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtFullAcceptanceITS(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtFullAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtEMCALAcceptanceTPC(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtEMCALAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtEMCALAcceptanceITS(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtEMCALAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtPHOSAcceptanceTPC(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtPHOSAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtPHOSAcceptanceITS(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtPHOSAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtFullAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtFullAcceptanceTPCNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtFullAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtFullAcceptanceITSNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtEMCALAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtEMCALAcceptanceTPCNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtEMCALAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtEMCALAcceptanceITSNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtPHOSAcceptanceTPCNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtPHOSAcceptanceTPCNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRecoHadEtPHOSAcceptanceITSNoPID(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRecoHadEtPHOSAcceptanceITSNoPID",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+
+
+    void FillSimTotEtMinusRawEtFullAcceptanceTPC(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRawEtFullAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRawEtFullAcceptanceITS(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRawEtFullAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRawEtEMCALAcceptanceTPC(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRawEtEMCALAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRawEtEMCALAcceptanceITS(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRawEtEMCALAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRawEtPHOSAcceptanceTPC(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRawEtPHOSAcceptanceTPC",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimTotEtMinusRawEtPHOSAcceptanceITS(Float_t et){if(fSimTotEt>0.0&&et>0.0)FillHisto2D("SimTotEtMinusRawEtPHOSAcceptanceITS",et,(fSimTotEt-et)/fSimTotEt,1.0);}
+    void FillSimHadEtMinusRawEtFullAcceptanceTPC(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRawEtFullAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRawEtFullAcceptanceITS(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRawEtFullAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRawEtEMCALAcceptanceTPC(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRawEtEMCALAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRawEtEMCALAcceptanceITS(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRawEtEMCALAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRawEtPHOSAcceptanceTPC(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRawEtPHOSAcceptanceTPC",et,(fSimHadEt-et)/fSimHadEt,1.0);}
+    void FillSimHadEtMinusRawEtPHOSAcceptanceITS(Float_t et){if(fSimHadEt>0.0&&et>0.0)FillHisto2D("SimHadEtMinusRawEtPHOSAcceptanceITS",et,(fSimHadEt-et)/fSimHadEt,1.0);}
 
     void FillSimPiKPMinusRecoPiKPFullAcceptanceTPC(Float_t et){if(fSimPiKPEt>0.0)FillHisto2D("SimPiKPMinusRecoPiKPFullAcceptanceTPC",et,(fSimPiKPEt-et)/fSimPiKPEt,1.0);}
     void FillSimPiKPMinusRecoPiKPFullAcceptanceITS(Float_t et){if(fSimPiKPEt>0.0)FillHisto2D("SimPiKPMinusRecoPiKPFullAcceptanceITS",et,(fSimPiKPEt-et)/fSimPiKPEt,1.0);}
     void FillSimPiKPMinusRecoPiKPFullAcceptanceTPCNoPID(Float_t et){if(fSimPiKPEt>0.0)FillHisto2D("SimPiKPMinusRecoPiKPFullAcceptanceTPCNoPID",et,(fSimPiKPEt-et)/fSimPiKPEt,1.0);}
     void FillSimPiKPMinusRecoPiKPFullAcceptanceITSNoPID(Float_t et){if(fSimPiKPEt>0.0)FillHisto2D("SimPiKPMinusRecoPiKPFullAcceptanceITSNoPID",et,(fSimPiKPEt-et)/fSimPiKPEt,1.0);}
 
+    void InvestigateSmearing(Bool_t val){fInvestigateSmearing=val;}
+    void InvestigateFull(Bool_t val){fInvestigateFull=val;}
+    void InvestigateEMCAL(Bool_t val){fInvestigateEMCal=val;}
+    void InvestigatePHOS(Bool_t val){fInvestigatePHOS=val;}
+    void InvestigatePiKP(Bool_t val){fInvestigatePiKP=val;}
+    void RequireITSHits(Bool_t val){fRequireITSHits=val;}
+    Bool_t Full(){return fInvestigateFull;}
+    Bool_t EMCAL(){return fInvestigateEMCal;}
+    Bool_t PHOS(){return fInvestigatePHOS;}
+    Bool_t PiKP(){return fInvestigatePiKP;}
+
  private:
     //Declare it private to avoid compilation warning
     AliAnalysisHadEtMonteCarlo & operator = (const AliAnalysisHadEtMonteCarlo & g) ;//cpy assignment
@@ -109,6 +120,12 @@ public:
     Float_t fSimHadEt;//simulated Et event by event
     Float_t fSimTotEt;//total et event by event
 
+    Bool_t fInvestigateSmearing;//Turns on and off functions and histos for investigating momentum, efficiency, pid smearing
+    Bool_t fInvestigateFull;//Turns on and off functions and histos for investigating event-by-event et for the full acceptance
+    Bool_t fInvestigateEMCal;//Turns on and off functions and histos for investigating event-by-event et for the full acceptance
+    Bool_t fInvestigatePHOS;//Turns on and off functions and histos for investigating event-by-event et for the full acceptance
+    Bool_t fInvestigatePiKP;//Turns on and off functions and histos for looking pi/k/p Et event-by-event
+    Bool_t fRequireITSHits;
 
     void ResetEventValues();
 
index 12dad2b..0352439 100644 (file)
@@ -24,6 +24,8 @@
 #include "AliAnalysisHadEtCorrections.h"
 #include "TFile.h"
 #include "TString.h"
+#include "AliAnalysisEtCommon.h"
+#include "AliAnalysisHadEt.h"
 
 using namespace std;
 
@@ -71,7 +73,7 @@ AliAnalysisHadEtReconstructed::AliAnalysisHadEtReconstructed() :
     ,fRawEtPHOSAcceptanceTPCNoPID(0)
     ,fRawEtPHOSAcceptanceITSNoPID(0)
 {
-
+  //cout<<"test "<<fgChristineTestjunk<<endl;
 }
 
 AliAnalysisHadEtReconstructed::~AliAnalysisHadEtReconstructed() 
@@ -87,7 +89,6 @@ Int_t AliAnalysisHadEtReconstructed::AnalyseEvent(AliVEvent* ev)
     //for PID
     AliESDpid *pID = new AliESDpid();
     pID->MakePID(realEvent);
-
     TString *strTPC = new TString("TPC");
     TString *strITS = new TString("ITS");
     TString *strTPCITS = new TString("TPCITS");
@@ -151,6 +152,7 @@ Int_t AliAnalysisHadEtReconstructed::AnalyseEvent(AliVEvent* ev)
            Float_t dEdx = track->GetTPCsignal();
            if(cutset==1) dEdx = track->GetITSsignal();
            FillHisto2D(Form("dEdxDataAll%s",cutName->Data()),track->P(),dEdx,1.0);
+           //cout<<"Filling "<< Form("dEdxDataAll%s",cutName->Data()) <<endl;
 
            bool inPHOS = IsInPHOS(track);
            bool inEMCAL = IsInEMCAL(track);
@@ -294,43 +296,43 @@ Int_t AliAnalysisHadEtReconstructed::AnalyseEvent(AliVEvent* ev)
 //       <<fCorrTotEtFullAcceptanceTPC<<", "<<fCorrTotEtFullAcceptanceITS<<", "<<fCorrHadEtFullAcceptanceTPC<<", "<<fCorrHadEtFullAcceptanceITS<<","
 //       <<fCorrTotEtEMCALAcceptanceTPC<<", "<<fCorrTotEtEMCALAcceptanceITS<<", "<<fCorrHadEtEMCALAcceptanceTPC<<", "<<fCorrHadEtEMCALAcceptanceITS<<","
 //       <<fCorrTotEtPHOSAcceptanceTPC<<", "<<fCorrTotEtPHOSAcceptanceITS<<", "<<fCorrHadEtPHOSAcceptanceTPC<<", "<<fCorrHadEtPHOSAcceptanceITS<<endl;
-    FillHisto1D("RecoHadEtFullAcceptanceTPC",GetCorrectedHadEtFullAcceptanceTPC(),1.0);
-    FillHisto1D("RecoTotEtFullAcceptanceTPC",GetCorrectedTotEtFullAcceptanceTPC(),1.0);
-    FillHisto1D("RecoHadEtEMCALAcceptanceTPC",GetCorrectedHadEtEMCALAcceptanceTPC(),1.0);
-    FillHisto1D("RecoTotEtEMCALAcceptanceTPC",GetCorrectedTotEtEMCALAcceptanceTPC(),1.0);
-    FillHisto1D("RecoHadEtPHOSAcceptanceTPC",GetCorrectedHadEtPHOSAcceptanceTPC(),1.0);
-    FillHisto1D("RecoTotEtPHOSAcceptanceTPC",GetCorrectedTotEtPHOSAcceptanceTPC(),1.0);
-    FillHisto1D("RecoHadEtFullAcceptanceTPCNoPID",GetCorrectedHadEtFullAcceptanceTPCNoPID(),1.0);
-    FillHisto1D("RecoTotEtFullAcceptanceTPCNoPID",GetCorrectedTotEtFullAcceptanceTPCNoPID(),1.0);
-    FillHisto1D("RecoHadEtEMCALAcceptanceTPCNoPID",GetCorrectedHadEtEMCALAcceptanceTPCNoPID(),1.0);
-    FillHisto1D("RecoTotEtEMCALAcceptanceTPCNoPID",GetCorrectedTotEtEMCALAcceptanceTPCNoPID(),1.0);
-    FillHisto1D("RecoHadEtPHOSAcceptanceTPCNoPID",GetCorrectedHadEtPHOSAcceptanceTPCNoPID(),1.0);
-    FillHisto1D("RecoTotEtPHOSAcceptanceTPCNoPID",GetCorrectedTotEtPHOSAcceptanceTPCNoPID(),1.0);
-    FillHisto1D("RecoHadEtFullAcceptanceITS",GetCorrectedHadEtFullAcceptanceITS(),1.0);
-    FillHisto1D("RecoTotEtFullAcceptanceITS",GetCorrectedTotEtFullAcceptanceITS(),1.0);
-    FillHisto1D("RecoHadEtEMCALAcceptanceITS",GetCorrectedHadEtEMCALAcceptanceITS(),1.0);
-    FillHisto1D("RecoTotEtEMCALAcceptanceITS",GetCorrectedTotEtEMCALAcceptanceITS(),1.0);
-    FillHisto1D("RecoHadEtPHOSAcceptanceITS",GetCorrectedHadEtPHOSAcceptanceITS(),1.0);
-    FillHisto1D("RecoTotEtPHOSAcceptanceITS",GetCorrectedTotEtPHOSAcceptanceITS(),1.0);
-    FillHisto1D("RecoHadEtFullAcceptanceITSNoPID",GetCorrectedHadEtFullAcceptanceITSNoPID(),1.0);
-    FillHisto1D("RecoTotEtFullAcceptanceITSNoPID",GetCorrectedTotEtFullAcceptanceITSNoPID(),1.0);
-    FillHisto1D("RecoHadEtEMCALAcceptanceITSNoPID",GetCorrectedHadEtEMCALAcceptanceITSNoPID(),1.0);
-    FillHisto1D("RecoTotEtEMCALAcceptanceITSNoPID",GetCorrectedTotEtEMCALAcceptanceITSNoPID(),1.0);
-    FillHisto1D("RecoHadEtPHOSAcceptanceITSNoPID",GetCorrectedHadEtPHOSAcceptanceITSNoPID(),1.0);
-    FillHisto1D("RecoTotEtPHOSAcceptanceITSNoPID",GetCorrectedTotEtPHOSAcceptanceITSNoPID(),1.0);
-
-    FillHisto1D("RecoRawEtFullAcceptanceTPC",GetRawEtFullAcceptanceTPC(),1.0);
-    FillHisto1D("RecoRawEtEMCALAcceptanceTPC",GetRawEtEMCALAcceptanceTPC(),1.0);
-    FillHisto1D("RecoRawEtPHOSAcceptanceTPC",GetRawEtPHOSAcceptanceTPC(),1.0);
-    FillHisto1D("RecoRawEtFullAcceptanceTPCNoPID",GetRawEtFullAcceptanceTPCNoPID(),1.0);
-    FillHisto1D("RecoRawEtEMCALAcceptanceTPCNoPID",GetRawEtEMCALAcceptanceTPCNoPID(),1.0);
-    FillHisto1D("RecoRawEtPHOSAcceptanceTPCNoPID",GetRawEtPHOSAcceptanceTPCNoPID(),1.0);
-    FillHisto1D("RecoRawEtFullAcceptanceITS",GetRawEtFullAcceptanceITS(),1.0);
-    FillHisto1D("RecoRawEtEMCALAcceptanceITS",GetRawEtEMCALAcceptanceITS(),1.0);
-    FillHisto1D("RecoRawEtPHOSAcceptanceITS",GetRawEtPHOSAcceptanceITS(),1.0);
-    FillHisto1D("RecoRawEtFullAcceptanceITSNoPID",GetRawEtFullAcceptanceITSNoPID(),1.0);
-    FillHisto1D("RecoRawEtEMCALAcceptanceITSNoPID",GetRawEtEMCALAcceptanceITSNoPID(),1.0);
-    FillHisto1D("RecoRawEtPHOSAcceptanceITSNoPID",GetRawEtPHOSAcceptanceITSNoPID(),1.0);
+    if(GetCorrectedHadEtFullAcceptanceTPC()>0.0)FillHisto1D("RecoHadEtFullAcceptanceTPC",GetCorrectedHadEtFullAcceptanceTPC(),1.0);
+    if(GetCorrectedTotEtFullAcceptanceTPC()>0.0)FillHisto1D("RecoTotEtFullAcceptanceTPC",GetCorrectedTotEtFullAcceptanceTPC(),1.0);
+    if(GetCorrectedHadEtEMCALAcceptanceTPC()>0.0)FillHisto1D("RecoHadEtEMCALAcceptanceTPC",GetCorrectedHadEtEMCALAcceptanceTPC(),1.0);
+    if(GetCorrectedTotEtEMCALAcceptanceTPC()>0.0)FillHisto1D("RecoTotEtEMCALAcceptanceTPC",GetCorrectedTotEtEMCALAcceptanceTPC(),1.0);
+    if(GetCorrectedHadEtPHOSAcceptanceTPC()>0.0)FillHisto1D("RecoHadEtPHOSAcceptanceTPC",GetCorrectedHadEtPHOSAcceptanceTPC(),1.0);
+    if(GetCorrectedTotEtPHOSAcceptanceTPC()>0.0)FillHisto1D("RecoTotEtPHOSAcceptanceTPC",GetCorrectedTotEtPHOSAcceptanceTPC(),1.0);
+    if(GetCorrectedHadEtFullAcceptanceTPCNoPID()>0.0)FillHisto1D("RecoHadEtFullAcceptanceTPCNoPID",GetCorrectedHadEtFullAcceptanceTPCNoPID(),1.0);
+    if(GetCorrectedTotEtFullAcceptanceTPCNoPID()>0.0)FillHisto1D("RecoTotEtFullAcceptanceTPCNoPID",GetCorrectedTotEtFullAcceptanceTPCNoPID(),1.0);
+    if(GetCorrectedHadEtEMCALAcceptanceTPCNoPID()>0.0)FillHisto1D("RecoHadEtEMCALAcceptanceTPCNoPID",GetCorrectedHadEtEMCALAcceptanceTPCNoPID(),1.0);
+    if(GetCorrectedTotEtEMCALAcceptanceTPCNoPID()>0.0)FillHisto1D("RecoTotEtEMCALAcceptanceTPCNoPID",GetCorrectedTotEtEMCALAcceptanceTPCNoPID(),1.0);
+    if(GetCorrectedHadEtPHOSAcceptanceTPCNoPID()>0.0)FillHisto1D("RecoHadEtPHOSAcceptanceTPCNoPID",GetCorrectedHadEtPHOSAcceptanceTPCNoPID(),1.0);
+    if(GetCorrectedTotEtPHOSAcceptanceTPCNoPID()>0.0)FillHisto1D("RecoTotEtPHOSAcceptanceTPCNoPID",GetCorrectedTotEtPHOSAcceptanceTPCNoPID(),1.0);
+    if(GetCorrectedHadEtFullAcceptanceITS()>0.0)FillHisto1D("RecoHadEtFullAcceptanceITS",GetCorrectedHadEtFullAcceptanceITS(),1.0);
+    if(GetCorrectedTotEtFullAcceptanceITS()>0.0)FillHisto1D("RecoTotEtFullAcceptanceITS",GetCorrectedTotEtFullAcceptanceITS(),1.0);
+    if(GetCorrectedHadEtEMCALAcceptanceITS()>0.0)FillHisto1D("RecoHadEtEMCALAcceptanceITS",GetCorrectedHadEtEMCALAcceptanceITS(),1.0);
+    if(GetCorrectedTotEtEMCALAcceptanceITS()>0.0)FillHisto1D("RecoTotEtEMCALAcceptanceITS",GetCorrectedTotEtEMCALAcceptanceITS(),1.0);
+    if(GetCorrectedHadEtPHOSAcceptanceITS()>0.0)FillHisto1D("RecoHadEtPHOSAcceptanceITS",GetCorrectedHadEtPHOSAcceptanceITS(),1.0);
+    if(GetCorrectedTotEtPHOSAcceptanceITS()>0.0)FillHisto1D("RecoTotEtPHOSAcceptanceITS",GetCorrectedTotEtPHOSAcceptanceITS(),1.0);
+    if(GetCorrectedHadEtFullAcceptanceITSNoPID()>0.0)FillHisto1D("RecoHadEtFullAcceptanceITSNoPID",GetCorrectedHadEtFullAcceptanceITSNoPID(),1.0);
+    if(GetCorrectedTotEtFullAcceptanceITSNoPID()>0.0)FillHisto1D("RecoTotEtFullAcceptanceITSNoPID",GetCorrectedTotEtFullAcceptanceITSNoPID(),1.0);
+    if(GetCorrectedHadEtEMCALAcceptanceITSNoPID()>0.0)FillHisto1D("RecoHadEtEMCALAcceptanceITSNoPID",GetCorrectedHadEtEMCALAcceptanceITSNoPID(),1.0);
+    if(GetCorrectedTotEtEMCALAcceptanceITSNoPID()>0.0)FillHisto1D("RecoTotEtEMCALAcceptanceITSNoPID",GetCorrectedTotEtEMCALAcceptanceITSNoPID(),1.0);
+    if(GetCorrectedHadEtPHOSAcceptanceITSNoPID()>0.0)FillHisto1D("RecoHadEtPHOSAcceptanceITSNoPID",GetCorrectedHadEtPHOSAcceptanceITSNoPID(),1.0);
+    if(GetCorrectedTotEtPHOSAcceptanceITSNoPID()>0.0)FillHisto1D("RecoTotEtPHOSAcceptanceITSNoPID",GetCorrectedTotEtPHOSAcceptanceITSNoPID(),1.0);
+
+    if(GetRawEtFullAcceptanceTPC()>0.0)FillHisto1D("RecoRawEtFullAcceptanceTPC",GetRawEtFullAcceptanceTPC(),1.0);
+    if(GetRawEtEMCALAcceptanceTPC()>0.0)FillHisto1D("RecoRawEtEMCALAcceptanceTPC",GetRawEtEMCALAcceptanceTPC(),1.0);
+    if(GetRawEtPHOSAcceptanceTPC()>0.0)FillHisto1D("RecoRawEtPHOSAcceptanceTPC",GetRawEtPHOSAcceptanceTPC(),1.0);
+    if(GetRawEtFullAcceptanceTPCNoPID()>0.0)FillHisto1D("RecoRawEtFullAcceptanceTPCNoPID",GetRawEtFullAcceptanceTPCNoPID(),1.0);
+    if(GetRawEtEMCALAcceptanceTPCNoPID()>0.0)FillHisto1D("RecoRawEtEMCALAcceptanceTPCNoPID",GetRawEtEMCALAcceptanceTPCNoPID(),1.0);
+    if(GetRawEtPHOSAcceptanceTPCNoPID()>0.0)FillHisto1D("RecoRawEtPHOSAcceptanceTPCNoPID",GetRawEtPHOSAcceptanceTPCNoPID(),1.0);
+    if(GetRawEtFullAcceptanceITS()>0.0)FillHisto1D("RecoRawEtFullAcceptanceITS",GetRawEtFullAcceptanceITS(),1.0);
+    if(GetRawEtEMCALAcceptanceITS()>0.0)FillHisto1D("RecoRawEtEMCALAcceptanceITS",GetRawEtEMCALAcceptanceITS(),1.0);
+    if(GetRawEtPHOSAcceptanceITS()>0.0)FillHisto1D("RecoRawEtPHOSAcceptanceITS",GetRawEtPHOSAcceptanceITS(),1.0);
+    if(GetRawEtFullAcceptanceITSNoPID()>0.0)FillHisto1D("RecoRawEtFullAcceptanceITSNoPID",GetRawEtFullAcceptanceITSNoPID(),1.0);
+    if(GetRawEtEMCALAcceptanceITSNoPID()>0.0)FillHisto1D("RecoRawEtEMCALAcceptanceITSNoPID",GetRawEtEMCALAcceptanceITSNoPID(),1.0);
+    if(GetRawEtPHOSAcceptanceITSNoPID()>0.0)FillHisto1D("RecoRawEtPHOSAcceptanceITSNoPID",GetRawEtPHOSAcceptanceITSNoPID(),1.0);
     delete pID;
     delete strTPC;
     delete strITS;
index a9fab88..b0b8e3c 100644 (file)
@@ -7,6 +7,10 @@
 //Created by Christine Nattrass, Rebecca Scott, Irakli Martashvili
 //University of Tennessee at Knoxville
 //_________________________________________________________________________
+//Necessary to read config macros
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TInterpreter.h>
 
 #include "TChain.h"
 #include "TList.h"
@@ -31,6 +35,8 @@ ClassImp(AliAnalysisTaskHadEt)
 //________________________________________________________________________
 AliAnalysisTaskHadEt::AliAnalysisTaskHadEt(const char *name) :
         AliAnalysisTaskSE(name)
+       ,fHadMCConfigFile("ConfigHadEtMonteCarlo.C")
+       ,fHadRecoConfigFile("ConfigHadEtReconstructed.C")
         ,fOutputList(0)
         ,fRecAnalysis(0)
         ,fMCAnalysis(0)
@@ -41,11 +47,17 @@ AliAnalysisTaskHadEt::AliAnalysisTaskHadEt(const char *name) :
 {
     // Constructor
 
-    fMCAnalysis = new AliAnalysisHadEtMonteCarlo();
-    fMCAnalysis->Init();
+  if (fHadMCConfigFile.Length()) {
+    cout<<"Rereading AliAnalysisHadEtMonteCarlo configuration file..."<<endl;
+    gROOT->LoadMacro(fHadMCConfigFile);
+    fMCAnalysis = (AliAnalysisHadEtMonteCarlo *) gInterpreter->ProcessLine("ConfigHadEtMonteCarlo()");
+  }
 
-    fRecAnalysis = new AliAnalysisHadEtReconstructed();
-    fRecAnalysis->Init();
+  if (fHadRecoConfigFile.Length()) {
+    cout<<"Rereading AliAnalysisHadEtReconstructed configuration file..."<<endl;
+    gROOT->LoadMacro(fHadRecoConfigFile);
+    fRecAnalysis = (AliAnalysisHadEtReconstructed *) gInterpreter->ProcessLine("ConfigHadEtReconstructed()");
+  }
 
     // Define input and output slots here
     // Input slot #0 works with a TChain
@@ -76,8 +88,6 @@ void AliAnalysisTaskHadEt::UserCreateOutputObjects()
   fRecAnalysis->SetHistoList(fOutputList);
   fMCAnalysis->CreateHistograms();
   fRecAnalysis->CreateHistograms();
-  fRecAnalysis->FillOutputList();
-  fMCAnalysis->FillOutputList();
 
 
     Bool_t selectPrimaries=kTRUE;
@@ -114,85 +124,53 @@ if (!event) {
   Printf("ERROR: Could not retrieve event");
   return;
  }
+//cout<<"AliAnalysisHadEtReconstructed 90"<<endl;
+
 fRecAnalysis->AnalyseEvent(event);
 
 AliMCEvent* mcEvent = MCEvent();
-if (mcEvent)
+// if (!mcEvent) {
+//   Printf("ERROR: Could not retrieve MC event");
+//  }
+if (mcEvent && event)
   {
     ((AliAnalysisHadEtMonteCarlo*)fMCAnalysis)->AnalyseEvent((AliVEvent*)mcEvent,(AliVEvent*)event);
-    //cout<<"Simulated Hadronic Et "<<fMCAnalysis->GetSimulatedHadronicEt()<<" Reconstructed Hadronic Et "<<fRecAnalysis->GetCorrectedHadEtFullAcceptanceITS()<<endl;
-    //cout<<"Simulated Total Et "<<fMCAnalysis->GetSimulatedTotalEt()<<" Reconstructed Total Et "<<fRecAnalysis->GetCorrectedTotEtFullAcceptanceITS()<<endl;
-    fMCAnalysis->FillSimTotEtVsRecoTotEtFullAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtFullAcceptanceTPC() );
-    fMCAnalysis->FillSimTotEtVsRecoTotEtFullAcceptanceITS( fRecAnalysis->GetCorrectedTotEtFullAcceptanceITS() );
-//     fMCAnalysis->FillSimTotEtVsRecoTotEtEMCALAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceTPC() );
-//     fMCAnalysis->FillSimTotEtVsRecoTotEtEMCALAcceptanceITS( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceITS() );
-//     fMCAnalysis->FillSimTotEtVsRecoTotEtPHOSAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceTPC() );
-//     fMCAnalysis->FillSimTotEtVsRecoTotEtPHOSAcceptanceITS( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceITS() );
-    fMCAnalysis->FillSimTotEtVsRecoTotEtFullAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtFullAcceptanceTPCNoPID() );
-    fMCAnalysis->FillSimTotEtVsRecoTotEtFullAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtFullAcceptanceITSNoPID() );
-//     fMCAnalysis->FillSimTotEtVsRecoTotEtEMCALAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceTPCNoPID() );
-//     fMCAnalysis->FillSimTotEtVsRecoTotEtEMCALAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceITSNoPID() );
-//     fMCAnalysis->FillSimTotEtVsRecoTotEtPHOSAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceTPCNoPID() );
-//     fMCAnalysis->FillSimTotEtVsRecoTotEtPHOSAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceITSNoPID() );
-    fMCAnalysis->FillSimHadEtVsRecoHadEtFullAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtFullAcceptanceTPC() );
-    fMCAnalysis->FillSimHadEtVsRecoHadEtFullAcceptanceITS( fRecAnalysis->GetCorrectedHadEtFullAcceptanceITS() );
-//     fMCAnalysis->FillSimHadEtVsRecoHadEtEMCALAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceTPC() );
-//     fMCAnalysis->FillSimHadEtVsRecoHadEtEMCALAcceptanceITS( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceITS() );
-//     fMCAnalysis->FillSimHadEtVsRecoHadEtPHOSAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceTPC() );
-//     fMCAnalysis->FillSimHadEtVsRecoHadEtPHOSAcceptanceITS( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceITS() );
-    fMCAnalysis->FillSimHadEtVsRecoHadEtFullAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtFullAcceptanceTPCNoPID() );
-    fMCAnalysis->FillSimHadEtVsRecoHadEtFullAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtFullAcceptanceITSNoPID() );
-//     fMCAnalysis->FillSimHadEtVsRecoHadEtEMCALAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceTPCNoPID() );
-//     fMCAnalysis->FillSimHadEtVsRecoHadEtEMCALAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceITSNoPID() );
-//     fMCAnalysis->FillSimHadEtVsRecoHadEtPHOSAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceTPCNoPID() );
-//     fMCAnalysis->FillSimHadEtVsRecoHadEtPHOSAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceITSNoPID() );
-
-
-    fMCAnalysis->FillSimTotEtMinusRecoTotEtFullAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtFullAcceptanceTPC() );
-    fMCAnalysis->FillSimTotEtMinusRecoTotEtFullAcceptanceITS( fRecAnalysis->GetCorrectedTotEtFullAcceptanceITS() );
-//     fMCAnalysis->FillSimTotEtMinusRecoTotEtEMCALAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceTPC() );
-//     fMCAnalysis->FillSimTotEtMinusRecoTotEtEMCALAcceptanceITS( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceITS() );
-//     fMCAnalysis->FillSimTotEtMinusRecoTotEtPHOSAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceTPC() );
-//     fMCAnalysis->FillSimTotEtMinusRecoTotEtPHOSAcceptanceITS( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceITS() );
-    fMCAnalysis->FillSimTotEtMinusRecoTotEtFullAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtFullAcceptanceTPCNoPID() );
-    fMCAnalysis->FillSimTotEtMinusRecoTotEtFullAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtFullAcceptanceITSNoPID() );
-//     fMCAnalysis->FillSimTotEtMinusRecoTotEtEMCALAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceTPCNoPID() );
-//     fMCAnalysis->FillSimTotEtMinusRecoTotEtEMCALAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceITSNoPID() );
-//     fMCAnalysis->FillSimTotEtMinusRecoTotEtPHOSAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceTPCNoPID() );
-//     fMCAnalysis->FillSimTotEtMinusRecoTotEtPHOSAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceITSNoPID() );
-    fMCAnalysis->FillSimHadEtMinusRecoHadEtFullAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtFullAcceptanceTPC() );
-    fMCAnalysis->FillSimHadEtMinusRecoHadEtFullAcceptanceITS( fRecAnalysis->GetCorrectedHadEtFullAcceptanceITS() );
-//     fMCAnalysis->FillSimHadEtMinusRecoHadEtEMCALAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceTPC() );
-//     fMCAnalysis->FillSimHadEtMinusRecoHadEtEMCALAcceptanceITS( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceITS() );
-//     fMCAnalysis->FillSimHadEtMinusRecoHadEtPHOSAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceTPC() );
-//     fMCAnalysis->FillSimHadEtMinusRecoHadEtPHOSAcceptanceITS( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceITS() );
-    fMCAnalysis->FillSimHadEtMinusRecoHadEtFullAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtFullAcceptanceTPCNoPID() );
-    fMCAnalysis->FillSimHadEtMinusRecoHadEtFullAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtFullAcceptanceITSNoPID() );
-//     fMCAnalysis->FillSimHadEtMinusRecoHadEtEMCALAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceTPCNoPID() );
-//     fMCAnalysis->FillSimHadEtMinusRecoHadEtEMCALAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceITSNoPID() );
-//     fMCAnalysis->FillSimHadEtMinusRecoHadEtPHOSAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceTPCNoPID() );
-//     fMCAnalysis->FillSimHadEtMinusRecoHadEtPHOSAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceITSNoPID() );
-
-
-    fMCAnalysis->FillSimTotEtMinusRawEtFullAcceptanceTPC( fRecAnalysis->GetRawEtFullAcceptanceTPC() );
-    fMCAnalysis->FillSimTotEtMinusRawEtFullAcceptanceITS( fRecAnalysis->GetRawEtFullAcceptanceITS() );
-//     fMCAnalysis->FillSimTotEtMinusRawTotEtEMCALAcceptanceTPC( fRecAnalysis->GetRawEtEMCALAcceptanceTPC() );
-//     fMCAnalysis->FillSimTotEtMinusRawTotEtEMCALAcceptanceITS( fRecAnalysis->GetRawEtEMCALAcceptanceITS() );
-//     fMCAnalysis->FillSimTotEtMinusRawTotEtPHOSAcceptanceTPC( fRecAnalysis->GetRawEtPHOSAcceptanceTPC() );
-//     fMCAnalysis->FillSimTotEtMinusRawTotEtPHOSAcceptanceITS( fRecAnalysis->GetRawEtPHOSAcceptanceITS() );
-
-    fMCAnalysis->FillSimHadEtMinusRawEtFullAcceptanceTPC( fRecAnalysis->GetRawEtFullAcceptanceTPC() );
-    fMCAnalysis->FillSimHadEtMinusRawEtFullAcceptanceITS( fRecAnalysis->GetRawEtFullAcceptanceITS() );
-//     fMCAnalysis->FillSimHadEtMinusRawHadEtEMCALAcceptanceTPC( fRecAnalysis->GetRawEtEMCALAcceptanceTPC() );
-//     fMCAnalysis->FillSimHadEtMinusRawHadEtEMCALAcceptanceITS( fRecAnalysis->GetRawEtEMCALAcceptanceITS() );
-//     fMCAnalysis->FillSimHadEtMinusRawHadEtPHOSAcceptanceTPC( fRecAnalysis->GetRawEtPHOSAcceptanceTPC() );
-//     fMCAnalysis->FillSimHadEtMinusRawHadEtPHOSAcceptanceITS( fRecAnalysis->GetRawEtPHOSAcceptanceITS() );
-
-    fMCAnalysis->FillSimPiKPMinusRecoPiKPFullAcceptanceTPC(fRecAnalysis->GetCorrectedPiKPEtFullAcceptanceTPC());
-    fMCAnalysis->FillSimPiKPMinusRecoPiKPFullAcceptanceITS(fRecAnalysis->GetCorrectedPiKPEtFullAcceptanceITS());
-    fMCAnalysis->FillSimPiKPMinusRecoPiKPFullAcceptanceTPCNoPID(fRecAnalysis->GetCorrectedPiKPEtFullAcceptanceTPCNoPID());
-    fMCAnalysis->FillSimPiKPMinusRecoPiKPFullAcceptanceITSNoPID(fRecAnalysis->GetCorrectedPiKPEtFullAcceptanceITSNoPID());
-
+    if(fMCAnalysis->Full()){
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtFullAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtFullAcceptanceTPC() );
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtFullAcceptanceITS( fRecAnalysis->GetCorrectedTotEtFullAcceptanceITS() );
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtFullAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtFullAcceptanceTPCNoPID() );
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtFullAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtFullAcceptanceITSNoPID() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtFullAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtFullAcceptanceTPC() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtFullAcceptanceITS( fRecAnalysis->GetCorrectedHadEtFullAcceptanceITS() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtFullAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtFullAcceptanceTPCNoPID() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtFullAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtFullAcceptanceITSNoPID() );
+    }
+    if(fMCAnalysis->EMCAL()){
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtEMCALAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceTPC() );
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtEMCALAcceptanceITS( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceITS() );
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtEMCALAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceTPCNoPID() );
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtEMCALAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtEMCALAcceptanceITSNoPID() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtEMCALAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceTPC() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtEMCALAcceptanceITS( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceITS() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtEMCALAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceTPCNoPID() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtEMCALAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtEMCALAcceptanceITSNoPID() );
+    }
+    if(fMCAnalysis->PHOS()){
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtPHOSAcceptanceTPC( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceTPC() );
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtPHOSAcceptanceITS( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceITS() );
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtPHOSAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceTPCNoPID() );
+      fMCAnalysis->FillSimTotEtMinusRecoTotEtPHOSAcceptanceITSNoPID( fRecAnalysis->GetCorrectedTotEtPHOSAcceptanceITSNoPID() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtPHOSAcceptanceTPC( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceTPC() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtPHOSAcceptanceITS( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceITS() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtPHOSAcceptanceTPCNoPID( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceTPCNoPID() );
+      fMCAnalysis->FillSimHadEtMinusRecoHadEtPHOSAcceptanceITSNoPID( fRecAnalysis->GetCorrectedHadEtPHOSAcceptanceITSNoPID() );
+    }
+    if(fMCAnalysis->PiKP() && fMCAnalysis->Full()){
+      fMCAnalysis->FillSimPiKPMinusRecoPiKPFullAcceptanceTPC(fRecAnalysis->GetCorrectedPiKPEtFullAcceptanceTPC());
+      fMCAnalysis->FillSimPiKPMinusRecoPiKPFullAcceptanceITS(fRecAnalysis->GetCorrectedPiKPEtFullAcceptanceITS());
+      fMCAnalysis->FillSimPiKPMinusRecoPiKPFullAcceptanceTPCNoPID(fRecAnalysis->GetCorrectedPiKPEtFullAcceptanceTPCNoPID());
+      fMCAnalysis->FillSimPiKPMinusRecoPiKPFullAcceptanceITSNoPID(fRecAnalysis->GetCorrectedPiKPEtFullAcceptanceITSNoPID());
+    }
   }
 
 // Post output data.
index 2dea3b4..856e62b 100644 (file)
@@ -33,6 +33,8 @@ public:
     AliESDtrackCuts* GetITSTrackCuts(){return (AliESDtrackCuts*) fOutputList->FindObject("fEsdTrackCutsITS");}\r
 \r
 private:\r
+    TString       fHadMCConfigFile;        // the name of the ConfigFile\r
+    TString       fHadRecoConfigFile;        // the name of the ConfigFile\r
 \r
   //Declare it private to avoid compilation warning\r
     AliAnalysisTaskHadEt & operator = (const AliAnalysisTaskHadEt & g) ;//cpy assignment\r
diff --git a/PWG4/totEt/macros/ConfigHadEtMonteCarlo.C b/PWG4/totEt/macros/ConfigHadEtMonteCarlo.C
new file mode 100644 (file)
index 0000000..c6e90d3
--- /dev/null
@@ -0,0 +1,25 @@
+
+AliAnalysisHadEtMonteCarlo * ConfigHadEtMonteCarlo(){
+  //cout<<"Hello I am configuring you"<<endl;
+  AliAnalysisHadEtMonteCarlo *hadEtMC = new AliAnalysisHadEtMonteCarlo();
+  //Whether or not to investigate the effects of efficiency, momentum resolution, PID, etc.
+  hadEtMC->InvestigateSmearing(kFALSE);
+
+  //Whether or not to look at Et(sim)-Et(reco) for full acceptance
+  hadEtMC->InvestigateFull(kFALSE);
+
+  //Whether or not to look at Et(sim)-Et(reco) for EMCAL acceptance
+  hadEtMC->InvestigateEMCAL(kTRUE);
+
+  //Whether or not to look at Et(sim)-Et(reco) for PHOS acceptance
+  hadEtMC->InvestigatePHOS(kTRUE);
+
+  //Whether or not to look at Et(sim)-Et(reco) for Pi/K/p in full acceptance (full acceptance must be turned on)
+  hadEtMC->InvestigatePiKP(kFALSE);
+
+  //Look at ITS+TPC tracks
+  hadEtMC->RequireITSHits(kTRUE);
+
+  hadEtMC->Init();
+  return hadEtMC;
+}
diff --git a/PWG4/totEt/macros/ConfigHadEtReconstructed.C b/PWG4/totEt/macros/ConfigHadEtReconstructed.C
new file mode 100644 (file)
index 0000000..f0b242c
--- /dev/null
@@ -0,0 +1,8 @@
+
+AliAnalysisHadEtReconstructed * ConfigHadEtReconstructed(){
+  //cout<<"Hello I am configuring you"<<endl;
+  AliAnalysisHadEtReconstructed *hadEtReco = new AliAnalysisHadEtReconstructed();
+  hadEtReco->Init();
+  return hadEtReco;
+}
+
index 50d8593..da8946e 100644 (file)
@@ -45,10 +45,10 @@ AliAnalysisGrid* CreateAlienHandlerCaloEtSim(TString outputDir, TString outputNa
   plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
   // Declare the analysis source files names separated by blancs. To be compiled runtime IN THE SAME ORDER THEY ARE LISTED
   // using ACLiC on the worker nodes.
-  plugin->SetAnalysisSource("AliAnalysisEtCuts.cxx AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTotEt.cxx");
+  plugin->SetAnalysisSource("AliAnalysisEtCuts.cxx AliAnalysisEtCommon.cxx AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTotEt.cxx");
   // Declare all libraries (other than the default ones for the framework. These will be
   // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
-  plugin->SetAdditionalLibs("AliAnalysisEtCuts.h AliAnalysisEt.h AliAnalysisEtMonteCarlo.h AliAnalysisEtMonteCarloPhos.h AliAnalysisEtMonteCarloEmcal.h AliAnalysisEtReconstructed.h AliAnalysisEtReconstructedPhos.h AliAnalysisEtReconstructedEmcal.h AliAnalysisTaskTotEt.h AliAnalysisEtCuts.cxx AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTotEt.cxx");
+  plugin->SetAdditionalLibs("AliAnalysisEtCuts.h AliAnalysisEt.h AliAnalysisEtMonteCarlo.h AliAnalysisEtMonteCarloPhos.h AliAnalysisEtMonteCarloEmcal.h AliAnalysisEtReconstructed.h AliAnalysisEtReconstructedPhos.h AliAnalysisEtReconstructedEmcal.h AliAnalysisTaskTotEt.h AliAnalysisEtCuts.cxx AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTotEt.cxx  AliAnalysisEtCommon.cxx  AliAnalysisEtCommon.h");
   plugin->SetExecutableCommand("aliroot -b -q");
   // add extra include files/path
   plugin->AddIncludePath("-I. -I$ALICE_ROOT/EMCAL -I$ALICE_ROOT/ANALYSIS");
index ebd8f26..f2ab9fd 100644 (file)
@@ -8,26 +8,29 @@
 
 // Overwrite all generated files, datasets and output results from a previous session
    plugin->SetOverwriteMode();
-// Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
+// Set the run modSoon a picture of Kim Jong-un (sitting far left) flashed around the world, the first known image of him since his school dayse (can be "full", "test", "offline", "submit" or "terminate")
    plugin->SetRunMode("full");  // VERY IMPORTANT - DECRIBED BELOW
    //plugin->SetRunMode("test");  // VERY IMPORTANT - DECRIBED BELOW
+   //plugin->SetCheckCopy(kFALSE);
 // Set versions of used packages
    plugin->SetAPIVersion("V1.1x");
-   plugin->SetROOTVersion("v5-27-05");
-   plugin->SetAliROOTVersion("v4-20-08-AN");
+   plugin->SetROOTVersion("v5-27-06-1");
+   plugin->SetAliROOTVersion("v4-20-12-AN");
 // Declare input data to be processed.
 
 // Method 1: Create automatically XML collections using alien 'find' command.
 // Define production directory LFN
-//   plugin->SetGridDataDir("/alice/sim/LHC10a18");
+//   plugin->SetGridDataDir("/alice/data/2010/LHC10d");
 // Set data search pattern
 //   plugin->SetDataPattern("*ESDs.root");  // simulated, tags not used
-//   plugin->SetDataPattern("*ESDs/pass4/*ESDs.root"); // real data check reco pass and data base directory
+//   plugin->SetDataPattern("*ESDs/pass2/*ESDs.root"); // real data check reco pass and data base directory
 //   plugin->SetRunPrefix("000");   // real data
 //   plugin->SetDataPattern("*tag.root");  // Use ESD tags (same applies for AOD's)
 // ...then add run numbers to be considered
 //   plugin->AddRunNumber(125020);    // simulated
-//   plugin->AddRunNumber(104065);  // real data
+//   plugin->AddRunNumber(126403);  // real data
+//   plugin->AddRunNumber(126404);  // real data
+//   plugin->AddRunNumber(126405);  // real data
 
 // Method 2: Declare existing data files (raw collections, xml collections, root file)
 // If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir())
 // using ACLiC on the worker nodes.
    //plugin->SetAnalysisSource("AliAnalysisTaskHadEt.cxx");
    //plugin->SetAnalysisSource("AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskHadEt.cxx AliAnalysisTaskTotEt.cxx");
-   plugin->SetAnalysisSource("AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskHadEt.cxx");
+   plugin->SetAnalysisSource("AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.cxx AliAnalysisEtCommon.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskHadEt.cxx");
 // Declare all libraries (other than the default ones for the framework. These will be
 // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
-   plugin->SetAdditionalLibs("AliAnalysisEtCuts.h AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.h AliAnalysisHadEtCorrections.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskHadEt.cxx AliAnalysisHadEt.h AliAnalysisHadEtMonteCarlo.h AliAnalysisHadEtReconstructed.h AliAnalysisTaskHadEt.h corrections.root ConfigHadEtAnalysis.C");
+   plugin->SetAdditionalLibs("AliAnalysisEtCuts.h AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.h AliAnalysisHadEtCorrections.cxx AliAnalysisEtCommon.h AliAnalysisEtCommon.cxx AliAnalysisHadEt.cxx AliAnalysisHadEtMonteCarlo.cxx AliAnalysisHadEtReconstructed.cxx AliAnalysisTaskHadEt.cxx AliAnalysisHadEt.h AliAnalysisHadEtMonteCarlo.h AliAnalysisHadEtReconstructed.h AliAnalysisTaskHadEt.h corrections.root ConfigHadEtAnalysis.C ConfigHadEtMonteCarlo.C ConfigHadEtReconstructed.C");
 // No need for output file names. Procedure is automatic. <-- not true
    plugin->SetDefaultOutputs(kFALSE);
    plugin->SetOutputFiles("Et.ESD.new.sim.root");
index b88a21a..c8e5c7d 100644 (file)
@@ -37,6 +37,7 @@ void runCaloEt(bool submit = false, // true or false
   }
    
   gROOT->ProcessLine(".L AliAnalysisEtCuts.cxx+g");
+  gROOT->ProcessLine(".L AliAnalysisEtCommon.cxx+g");
   gROOT->ProcessLine(".L AliAnalysisEt.cxx+g");
   gROOT->ProcessLine(".L AliAnalysisEtMonteCarlo.cxx+g");
   gROOT->ProcessLine(".L AliAnalysisEtMonteCarloPhos.cxx+g");
index f68385d..0aacc7a 100644 (file)
@@ -4,7 +4,7 @@
 //by default this runs locally
 //With the argument true this submits jobs to the grid
 //As written this requires an xml script tag.xml in the ~/et directory on the grid to submit jobs
-void runHadEt(bool submit = false) {
+void runHadEt(bool submit = false, bool data = false) {
     TStopwatch timer;
     timer.Start();
     gSystem->Load("libTree.so");
@@ -22,6 +22,7 @@ void runHadEt(bool submit = false) {
     gSystem->AddIncludePath("-I$ALICE_ROOT/include");
    gROOT->ProcessLine(".L AliAnalysisEtCuts.cxx+g");
    gROOT->ProcessLine(".L AliAnalysisHadEtCorrections.cxx+g");
+   gROOT->ProcessLine(".L AliAnalysisEtCommon.cxx+g");
    gROOT->ProcessLine(".L AliAnalysisHadEt.cxx+g");
    gROOT->ProcessLine(".L AliAnalysisHadEtMonteCarlo.cxx+g");
    gROOT->ProcessLine(".L AliAnalysisHadEtReconstructed.cxx+g");
@@ -36,7 +37,8 @@ void runHadEt(bool submit = false) {
     gSystem->Load("libRAliEn.so"); 
     TGrid::Connect("alien://") ;
   }
-  chain->Add("/data/LHC10d15/1821/AliESDs.root");
+  chain->Add("/data/LHC10d15/1821/AliESDs.root");//simulation
+  //chain->Add("/data/LHC10dpass2/10000126403050.70/AliESDs.root");//data
 
   // Make the analysis manager
   AliAnalysisManager *mgr = new AliAnalysisManager("TotEtManager");
@@ -50,8 +52,10 @@ void runHadEt(bool submit = false) {
   AliVEventHandler* esdH = new AliESDInputHandler;
   mgr->SetInputEventHandler(esdH);
   AliMCEventHandler* handler = new AliMCEventHandler;
-  handler->SetReadTR(kFALSE);
-  mgr->SetMCtruthEventHandler(handler);
+  if(!data){
+    handler->SetReadTR(kFALSE);
+    mgr->SetMCtruthEventHandler(handler);
+  }
   AliAnalysisTaskHadEt *task2 = new AliAnalysisTaskHadEt("TaskHadEt");
   mgr->AddTask(task2);
   AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();