implementing realistic reweighting of V0s, fixing some minor coding violations, addin...
authorcnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 20 Nov 2010 23:12:07 +0000 (23:12 +0000)
committercnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sat, 20 Nov 2010 23:12:07 +0000 (23:12 +0000)
19 files changed:
PWG4/totEt/AliAnalysisEt.cxx
PWG4/totEt/AliAnalysisEt.h
PWG4/totEt/AliAnalysisEtCommon.cxx
PWG4/totEt/AliAnalysisEtCommon.h
PWG4/totEt/AliAnalysisEtReconstructed.cxx
PWG4/totEt/AliAnalysisEtReconstructed.h
PWG4/totEt/AliAnalysisHadEt.cxx
PWG4/totEt/AliAnalysisHadEt.h
PWG4/totEt/AliAnalysisHadEtMonteCarlo.cxx
PWG4/totEt/AliAnalysisHadEtMonteCarlo.h
PWG4/totEt/AliAnalysisHadEtReconstructed.cxx
PWG4/totEt/AliAnalysisHadEtReconstructed.h
PWG4/totEt/AliAnalysisTaskHadEt.cxx
PWG4/totEt/AliAnalysisTaskTotEt.cxx
PWG4/totEt/AliAnalysisTaskTotEt.h
PWG4/totEt/macros/ConfigEtMonteCarlo.C [new file with mode: 0644]
PWG4/totEt/macros/ConfigEtReconstructed.C [new file with mode: 0644]
PWG4/totEt/macros/CreateAlienHandlerCaloEtSim.C
PWG4/totEt/macros/runCaloEt.C

index ea0de20..76ac5bf 100644 (file)
@@ -24,7 +24,6 @@ ClassImp(AliAnalysisEt);
 
 
 AliAnalysisEt::AliAnalysisEt() : AliAnalysisEtCommon()
-                              ,fHistogramNameSuffix("")
                               ,fTotEt(0)
                               ,fTotEtAcc(0)
                               ,fTotNeutralEt(0)
index d550154..c225bf6 100644 (file)
@@ -74,8 +74,6 @@ public:
     void SetTPCOnlyTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsTPC = (AliESDtrackCuts *) cuts;}
 
 protected:
-       
-    TString fHistogramNameSuffix; /** The suffix for the histogram names */
 
     //AliAnalysisEtCuts *fCuts; // keeper of basic cuts
 
index 7e30c80..78786be 100644 (file)
@@ -14,6 +14,7 @@
 #include "TList.h"
 #include "TH1F.h"
 #include "TH2F.h"
+#include "TF1.h"
 #include <iostream>
 #include "AliAnalysisEtCuts.h"
 #include "AliMCEvent.h"
@@ -72,9 +73,16 @@ Float_t AliAnalysisEtCommon::fgPtITSCutOff = 0.10;
 AliAnalysisEtCommon::AliAnalysisEtCommon() :
   fHistogramNameSuffix("")
   ,fCuts(0)
+  ,fDataSet(2010)
   ,fEsdtrackCutsITSTPC(0)
   ,fEsdtrackCutsTPC(0)
   ,fEsdtrackCutsITS(0)
+  ,fK0PythiaD6T(0)
+  ,fLambdaPythiaD6T(0)
+  ,fAntiLambdaPythiaD6T(0)
+  ,fK0Data(0)
+  ,fLambdaData(0)
+  ,fAntiLambdaData(0)
 {//default constructor
 
 }
@@ -85,6 +93,12 @@ AliAnalysisEtCommon::~AliAnalysisEtCommon()
   delete fEsdtrackCutsITSTPC;
   delete fEsdtrackCutsITS;
   delete fEsdtrackCutsTPC;
+  delete fK0PythiaD6T;
+  delete fLambdaPythiaD6T;
+  delete fAntiLambdaPythiaD6T;
+  delete fK0Data;
+  delete fLambdaData;
+  delete fAntiLambdaData;
 }
 
 Int_t AliAnalysisEtCommon::AnalyseEvent(AliVEvent *event)
@@ -97,7 +111,63 @@ Int_t AliAnalysisEtCommon::AnalyseEvent(AliVEvent *event)
 
 void AliAnalysisEtCommon::Init()
 {// clear variables, set up cuts and PDG info
-
+  //MyFunction * fptr = new MyFunction(....);  // create the user function class
+  //TF1 * f = new TF1("f",fptr,&MyFunction::Evaluate,0,1,npar,"MyFunction","Evaluate");   // create TF1 class.
+  AliAnalysisLevyPt *function = new AliAnalysisLevyPt();
+  //parameter 0 = dNdy
+  //parameter 1 = temp
+  //parameter 2 = power
+  fK0PythiaD6T = new TF1("K0PythiaD6T",function, &AliAnalysisLevyPt::Evaluate,0,50,3,"AliAnalysisLevyPt","Evaluate");
+  fLambdaPythiaD6T = new TF1("LambdaPythiaD6T",function, &AliAnalysisLevyPt::Evaluate,0,50,3,"AliAnalysisLevyPt","Evaluate");
+  fAntiLambdaPythiaD6T = new TF1("LambdaPythiaD6T",function, &AliAnalysisLevyPt::Evaluate,0,50,3,"AliAnalysisLevyPt","Evaluate");
+  fK0Data = new TF1("K0Data",function, &AliAnalysisLevyPt::Evaluate,0,50,3,"AliAnalysisLevyPt","Evaluate");
+  fLambdaData = new TF1("LambdaData",function, &AliAnalysisLevyPt::Evaluate,0,50,3,"AliAnalysisLevyPt","Evaluate");
+  fAntiLambdaData = new TF1("LambdaData",function, &AliAnalysisLevyPt::Evaluate,0,50,3,"AliAnalysisLevyPt","Evaluate");
+  if(fDataSet==2009){
+    //These data are from the ALICE 900 GeV p+p paper
+    fK0PythiaD6T->SetParameter(0,0.1437);
+    fK0PythiaD6T->SetParameter(1,0.1497);
+    fK0PythiaD6T->SetParameter(2,6.94);
+    fLambdaPythiaD6T->SetParameter(0,0.0213);
+    fLambdaPythiaD6T->SetParameter(1,0.1315);
+    fLambdaPythiaD6T->SetParameter(2,4.60);
+    fAntiLambdaPythiaD6T->SetParameter(0,0.0213);
+    fAntiLambdaPythiaD6T->SetParameter(1,0.1315);
+    fAntiLambdaPythiaD6T->SetParameter(2,4.60);
+    fK0Data->SetParameter(0,0.184);
+    fK0Data->SetParameter(1,0.168);
+    fK0Data->SetParameter(2,6.6);
+    fLambdaData->SetParameter(0,0.048);
+    fLambdaData->SetParameter(1,0.229);
+    fLambdaData->SetParameter(2,10.8);
+    fAntiLambdaData->SetParameter(0,0.047);
+    fAntiLambdaData->SetParameter(1,0.210);
+    fAntiLambdaData->SetParameter(2,9.2);
+  }
+  if(fDataSet==2010){
+    //These data are from the CMS analysis note on 7 TeV spectra
+    //http://cdsweb.cern.ch/record/1279344/files/QCD-10-007-pas.pdf
+    //Note the CMS parameterization of the Levy function differs from the ALICE parameterization by a constant.
+    //CMS does not list the overall constant in their fit, the ratios of the dN/dy(y=0) is used.
+    fK0PythiaD6T->SetParameter(0,0.72);
+    fK0PythiaD6T->SetParameter(1,0.183);
+    fK0PythiaD6T->SetParameter(2,7.41);
+    fLambdaPythiaD6T->SetParameter(0,0.54);
+    fLambdaPythiaD6T->SetParameter(1,0.216);
+    fLambdaPythiaD6T->SetParameter(2,5.71);
+    fAntiLambdaPythiaD6T->SetParameter(0,0.54);
+    fAntiLambdaPythiaD6T->SetParameter(1,0.216);
+    fAntiLambdaPythiaD6T->SetParameter(2,5.71);
+    fK0Data->SetParameter(0,1.0);
+    fK0Data->SetParameter(1,0.215);
+    fK0Data->SetParameter(2,6.79);
+    fLambdaData->SetParameter(0,1.0);
+    fLambdaData->SetParameter(1,0.290);
+    fLambdaData->SetParameter(2,9.28);
+    fAntiLambdaData->SetParameter(0,1.0);
+    fAntiLambdaData->SetParameter(1,0.290);
+    fAntiLambdaData->SetParameter(2,9.28);
+  }
 }
 
 void AliAnalysisEtCommon::ResetEventValues()
@@ -155,3 +225,20 @@ Float_t AliAnalysisEtCommon::Et(Float_t p, Float_t theta, Int_t pid, Short_t cha
   cerr<<"Uh-oh!  Et not set properly!"<<endl;
   return 0.0;
 }
+
+Float_t AliAnalysisEtCommon::K0Weight(Float_t pt){
+  Float_t data = fK0Data->Eval(pt);
+  Float_t mc = fK0PythiaD6T->Eval(pt);
+  return data/mc;
+}
+Float_t AliAnalysisEtCommon::LambdaWeight(Float_t pt){
+  Float_t data = fLambdaData->Eval(pt);
+  Float_t mc = fLambdaPythiaD6T->Eval(pt);
+  return data/mc;
+}
+Float_t AliAnalysisEtCommon::AntiLambdaWeight(Float_t pt){
+  Float_t data = fAntiLambdaData->Eval(pt);
+  Float_t mc = fAntiLambdaPythiaD6T->Eval(pt);
+  return data/mc;
+}
+
index 307220e..3fccb82 100644 (file)
@@ -9,9 +9,11 @@
 #define ALIANALYSISETCOMMON_H
 
 #include "TString.h"
+#include "TMath.h"
 
 class TH2F;
 class TH1F;
+class TF1;
 class AliVEvent;
 class TList;
 class AliESDtrackCuts;
@@ -20,6 +22,29 @@ class TParticle;
 class TDatabasePDG;
 class AliAnalysisEtCuts;
 
+#ifndef ALIANALYSISLEVYPT_H
+#define ALIANALYSISLEVYPT_H
+class AliAnalysisLevyPt{
+ public:
+  virtual ~AliAnalysisLevyPt(){};
+  Double_t Evaluate(const Double_t *pt, const Double_t *par) const
+  {
+    Double_t lMass  = 0.497;
+    Double_t ldNdy  = par[0];
+    Double_t l2pi   = 2*TMath::Pi();
+    Double_t lTemp = par[1];
+    Double_t lPower = par[2];
+
+    Double_t lBigCoef = ((lPower-1)*(lPower-2)) / (l2pi*lPower*lTemp*(lPower*lTemp+lMass*(lPower-2)));
+    Double_t lInPower = 1 + (TMath::Sqrt(pt[0]*pt[0]+lMass*lMass)-lMass) / (lPower*lTemp);
+
+    return ldNdy * pt[0] * lBigCoef * TMath::Power(lInPower,(-1)*lPower);
+  };
+  ClassDef(AliAnalysisLevyPt, 1);
+};
+
+#endif // ALIANALYSISLEVYPT_H
+
 class AliAnalysisEtCommon
 {
 public:
@@ -47,7 +72,8 @@ public:
     void SetTPCITSTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsITSTPC = (AliESDtrackCuts *) cuts;}
     void SetTPCOnlyTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsTPC = (AliESDtrackCuts *) cuts;}
     void SetITSTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsITS = (AliESDtrackCuts *) cuts;}
-
+    void SetDataSet(Int_t val){fDataSet = val;}
+    Int_t DataSet()const {return fDataSet;}
 
 protected:   
     
@@ -55,6 +81,10 @@ protected:
 
     AliAnalysisEtCuts *fCuts; // keeper of basic cuts
 
+    Int_t fDataSet;//Integer corresponding to data set.  Used as a switch to set appropriate track cuts.  By default set to 2010 p+p
+    //2009 = 900 GeV p+p data from 2009
+    //2010 = 7 TeV p+p data from 2010
+
     /** 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
@@ -102,7 +132,16 @@ protected:
     static Float_t fgPtTPCCutOff;//cut off for tracks in TPC
     static Float_t fgPtITSCutOff;//cut off for tracks in ITS
     
-
+    //Set by default to the D6T scales
+    Float_t K0Weight(Float_t pt);//Function which gives the factor to reweigh a K0 so it roughly matches the data
+    Float_t LambdaWeight(Float_t pt);//Function which gives the factor to reweigh a Lambda so it roughly matches the data
+    Float_t AntiLambdaWeight(Float_t pt);//Function which gives the factor to reweigh a Lambda so it roughly matches the data
+    TF1 *fK0PythiaD6T;//function with Levy fit parameters for K0S in PYTHIA D6T
+    TF1 *fLambdaPythiaD6T;//function with Levy fit parameters for Lambda in PYTHIA D6T
+    TF1 *fAntiLambdaPythiaD6T;//function with Levy fit parameters for AntiLambda in PYTHIA D6T
+    TF1 *fK0Data;//function with Levy fit parameters for K0S in data
+    TF1 *fLambdaData;//function with Levy fit parameters for Lambda in data
+    TF1 *fAntiLambdaData;//function with Levy fit parameters for AntiLambda in data
 
  private:
     //Declare it private to avoid compilation warning
index 7d0a18d..c657b99 100644 (file)
@@ -24,6 +24,7 @@
 #include "AliESDpid.h"
 #include <iostream>
 #include "TH2F.h"
+#include "AliAnalysisHadEtCorrections.h"
 
 using namespace std;
 
@@ -32,6 +33,7 @@ ClassImp(AliAnalysisEtReconstructed);
 
 AliAnalysisEtReconstructed::AliAnalysisEtReconstructed() :
         AliAnalysisEt()
+       ,fCorrections(0)
         ,fTrackDistanceCut(0)
         ,fPidCut(0)
         ,fClusterType(0)
@@ -46,6 +48,7 @@ AliAnalysisEtReconstructed::AliAnalysisEtReconstructed() :
 
 AliAnalysisEtReconstructed::~AliAnalysisEtReconstructed() 
 {
+  delete fCorrections;
 }
 
 Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev)
index 1e5002f..e27cb27 100644 (file)
@@ -12,6 +12,7 @@
 
 class AliVParticle;
 class AliESDEvent;
+class AliAnalysisHadEtCorrections;
 
 class AliAnalysisEtReconstructed : public AliAnalysisEt
 {
@@ -27,6 +28,7 @@ public:
 
     /** Fill the objects you want to output, classes which add new histograms should overload this. */
     virtual void FillOutputList(TList *list);
+    void SetCorrections(AliAnalysisHadEtCorrections *corr){fCorrections = corr;}
 
     /** Create the histograms, must be overloaded if you want to add your own */
     virtual void CreateHistograms();
@@ -36,6 +38,8 @@ protected:
     bool CheckGoodVertex(AliVParticle *track);
     virtual bool TrackHitsCalorimeter(AliVParticle *track, Double_t magField);
 
+    AliAnalysisHadEtCorrections *fCorrections;//corrections needed for hadronic et
+
     Double_t fTrackDistanceCut; // cut on track distance    
     Double_t fPidCut; // cut on the pid probability
     
index 06dca73..d49d3c9 100644 (file)
@@ -45,7 +45,6 @@ Float_t AliAnalysisHadEt::fgPtAxis[117]=
 
 
 AliAnalysisHadEt::AliAnalysisHadEt() : AliAnalysisEtCommon()
-                                    ,fHistogramNameSuffix("")
                                     ,fSumEt(0)
                                     ,fSumEtAcc(0)
                                     ,fTotEt(0)
index 5c75f60..995d9a1 100644 (file)
@@ -74,9 +74,6 @@ public:
 
 protected:   
     
-    TString fHistogramNameSuffix; /** The suffix for the histogram names */
-
-    
     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 */
     Double_t fTotEt;/** Total Et in the event (without acceptance cuts) */
index 6c67c12..211c6fa 100644 (file)
@@ -400,7 +400,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
             continue;
          }
 
-        TParticlePDG *pc = part->GetPDG(0);
+        //TParticlePDG *pc = part->GetPDG(0);
 
         // Check if it is a primary particle
        if (stack->IsPhysicalPrimary(iPart)){//primaries
@@ -591,6 +591,8 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
              //cout<<"I am a simulated lambda! pt "<<part->Pt()<<" eta "<<part->Eta()<<endl;
              FillHisto2D("EtSimulatedLambda",part->Pt(),part->Eta(),myEt);
              FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
+             Float_t weight = LambdaWeight(part->Pt());
+             FillHisto2D("EtSimulatedLambdaReweighted",part->Pt(),part->Eta(),myEt*weight);
              Int_t ndaughters = part->GetNDaughters();
              for(Int_t idaughter = 0;idaughter<ndaughters;idaughter++){
                Int_t daughterindex = part->GetDaughter(idaughter);
@@ -602,6 +604,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
                    if(daughtercode==fgPiMinusCode || daughtercode==fgProtonCode){
                      myEt = Et(daughter);
                      FillHisto2D("EtSimulatedLambdaDaughters",daughter->Pt(),daughter->Eta(),myEt);
+                     FillHisto2D("EtSimulatedLambdaDaughtersReweighted",daughter->Pt(),daughter->Eta(),myEt*weight);
                      //cout<<"Lambda daughter is a "<<daughter->GetName()<<endl;
                    }
                  }
@@ -618,6 +621,8 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
              fSimTotEt += myEt;
              FillHisto2D("EtSimulatedAntiLambda",part->Pt(),part->Eta(),myEt);
              FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
+             Float_t weight = AntiLambdaWeight(part->Pt());
+             FillHisto2D("EtSimulatedAntiLambdaReweighted",part->Pt(),part->Eta(),myEt*weight);
              Int_t ndaughters = part->GetNDaughters();
              for(Int_t idaughter = 0;idaughter<ndaughters;idaughter++){
                Int_t daughterindex = part->GetDaughter(idaughter);
@@ -629,6 +634,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
                    if(daughtercode==fgPiPlusCode || daughtercode==fgAntiProtonCode){
                      myEt = Et(daughter);
                      FillHisto2D("EtSimulatedAntiLambdaDaughters",daughter->Pt(),daughter->Eta(),myEt);
+                     FillHisto2D("EtSimulatedAntiLambdaDaughtersReweighted",daughter->Pt(),daughter->Eta(),myEt*weight);
                      //cout<<"AntiLambda daughter is a "<<daughter->GetName()<<endl;
                    }
                  }
@@ -645,6 +651,8 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
              fSimTotEt += myEt;
              FillHisto2D("EtSimulatedK0S",part->Pt(),part->Eta(),myEt);
              FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
+             Float_t weight = K0Weight(part->Pt());
+             FillHisto2D("EtSimulatedK0SReweighted",part->Pt(),part->Eta(),myEt*weight);
              Int_t ndaughters = part->GetNDaughters();
              for(Int_t idaughter = 0;idaughter<ndaughters;idaughter++){
                Int_t daughterindex = part->GetDaughter(idaughter);
@@ -657,6 +665,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
                    if(daughtercode==fgPiMinusCode || daughtercode==fgPiPlusCode){
                      myEt = Et(daughter);
                      FillHisto2D("EtSimulatedK0SDaughters",daughter->Pt(),daughter->Eta(),myEt);
+                     FillHisto2D("EtSimulatedK0SDaughtersReweighted",daughter->Pt(),daughter->Eta(),myEt*weight);
                      //cout<<"K0S daughter is a "<<daughter->GetName()<<endl;
                    }
                  }
@@ -673,6 +682,8 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
              fSimTotEt += myEt;
              FillHisto2D("EtSimulatedK0L",part->Pt(),part->Eta(),myEt);
              FillHisto2D("EtSimulatedAllHadron",part->Pt(),part->Eta(),myEt);
+             Float_t weight = K0Weight(part->Pt());
+             FillHisto2D("EtSimulatedK0LReweighted",part->Pt(),part->Eta(),myEt*weight);
              filled = true;
            }
            if(pdgCode == fgOmegaCode){
@@ -884,7 +895,7 @@ Int_t AliAnalysisHadEtMonteCarlo::AnalyseEvent(AliVEvent* ev)
            }
            if(!filled){
              //if( strcmp(pc->ParticleClass(),"Baryon")==0 || strcmp(pc->ParticleClass(),"Meson")==0 ){
-               cout<<"Did not find a place for "<<part->GetName()<<" "<<pdgCode<<" which is a "<<pc->ParticleClass()<<endl;
+             //cout<<"Did not find a place for "<<part->GetName()<<" "<<pdgCode<<" which is a "<<pc->ParticleClass()<<endl;
                //}
            }
          }
@@ -919,7 +930,6 @@ void AliAnalysisHadEtMonteCarlo::Init()
     AliAnalysisHadEt::Init();
     if(!fPtSmearer) fPtSmearer = new TRandom();
 }
-
 void AliAnalysisHadEtMonteCarlo::CreateHistograms(){
   //for simulated Et only (no reconstruction)
   CreateEtaPtHisto2D(TString("EtSimulatedPiPlus"),TString("Simulated E_{T} from #pi^{+}"));
@@ -950,6 +960,10 @@ void AliAnalysisHadEtMonteCarlo::CreateHistograms(){
   CreateEtaPtHisto2D("EtSimulatedAntiLambda","Simulated E_{T} from #bar{#Lambda}");
   CreateEtaPtHisto2D("EtSimulatedK0S","Simulated E_{T} from K^{0}_{S}");
   CreateEtaPtHisto2D("EtSimulatedK0L","Simulated E_{T} from K^{0}_{L}");
+  CreateEtaPtHisto2D("EtSimulatedLambdaReweighted","Simulated E_{T} from #Lambda");
+  CreateEtaPtHisto2D("EtSimulatedAntiLambdaReweighted","Simulated E_{T} from #bar{#Lambda}");
+  CreateEtaPtHisto2D("EtSimulatedK0SReweighted","Simulated E_{T} from K^{0}_{S}");
+  CreateEtaPtHisto2D("EtSimulatedK0LReweighted","Simulated E_{T} from K^{0}_{L}");
   CreateEtaPtHisto2D("EtSimulatedNeutron","Simulated E_{T} from neutrons");
   CreateEtaPtHisto2D("EtSimulatedAntiNeutron","Simulated E_{T} from #bar{n}");
   CreateEtaPtHisto2D("EtSimulatedEPlus","Simulated E_{T} from e^{+}");
@@ -968,6 +982,9 @@ void AliAnalysisHadEtMonteCarlo::CreateHistograms(){
   CreateEtaPtHisto2D("EtSimulatedLambdaDaughters","Simulated E_{T} from #Lambda Daughters");
   CreateEtaPtHisto2D("EtSimulatedAntiLambdaDaughters","Simulated E_{T} from #bar{#Lambda} Daughters");
   CreateEtaPtHisto2D("EtSimulatedK0SDaughters","Simulated E_{T} from K^{0}_{S} Daughters");
+  CreateEtaPtHisto2D("EtSimulatedLambdaDaughtersReweighted","Simulated E_{T} from #Lambda Daughters");
+  CreateEtaPtHisto2D("EtSimulatedAntiLambdaDaughtersReweighted","Simulated E_{T} from #bar{#Lambda} Daughters");
+  CreateEtaPtHisto2D("EtSimulatedK0SDaughtersReweighted","Simulated E_{T} from K^{0}_{S} Daughters");
   CreateEtaPtHisto2D("EtSimulatedOmegaDaughters","Simulated E_{T} from #Omega^{-} Daughters");
   CreateEtaPtHisto2D("EtSimulatedAntiOmegaDaughters","Simulated E_{T} from #Omega^{+} Daughters");
   CreateEtaPtHisto2D("EtSimulatedXiDaughters","Simulated E_{T} from #Xi^{-} Daughters");
index c5c3dfc..e8d5888 100644 (file)
@@ -127,6 +127,7 @@ public:
     Bool_t fInvestigatePiKP;//Turns on and off functions and histos for looking pi/k/p Et event-by-event
     Bool_t fRequireITSHits;
 
+
     void ResetEventValues();
 
     //Float_t fSimPiKPEtSmeared[4];//simulated Et for pi,k,p smeared for each event by different momentum resolutions
index 0352439..4ab909e 100644 (file)
@@ -36,44 +36,43 @@ AliAnalysisHadEtReconstructed::AliAnalysisHadEtReconstructed() :
         AliAnalysisHadEt()
        ,fCorrections(0)
        ,fConfigFile("ConfigHadEtAnalysis.C")
-    ,fCorrTotEtFullAcceptanceTPC(0)
-    ,fCorrTotEtFullAcceptanceITS(0)
-    ,fCorrHadEtFullAcceptanceTPC(0)
-    ,fCorrHadEtFullAcceptanceITS(0)
-    ,fCorrTotEtEMCALAcceptanceTPC(0)
-    ,fCorrTotEtEMCALAcceptanceITS(0)
-    ,fCorrHadEtEMCALAcceptanceTPC(0)
-    ,fCorrHadEtEMCALAcceptanceITS(0)
-    ,fCorrTotEtPHOSAcceptanceTPC(0)
-    ,fCorrTotEtPHOSAcceptanceITS(0)
-    ,fCorrHadEtPHOSAcceptanceTPC(0)
-    ,fCorrHadEtPHOSAcceptanceITS(0)
-    ,fCorrectedHadEtFullAcceptanceTPCNoPID(0)
-    ,fCorrectedHadEtFullAcceptanceITSNoPID(0)
-    ,fCorrectedHadEtEMCALAcceptanceTPCNoPID(0)
-    ,fCorrectedHadEtEMCALAcceptanceITSNoPID(0)
-    ,fCorrectedHadEtPHOSAcceptanceTPCNoPID(0)
-    ,fCorrectedHadEtPHOSAcceptanceITSNoPID(0)
-    ,fCorrectedHadEtFullAcceptanceTPC(0)
-    ,fCorrectedHadEtFullAcceptanceITS(0)
-    ,fCorrectedHadEtEMCALAcceptanceTPC(0)
-    ,fCorrectedHadEtEMCALAcceptanceITS(0)
-    ,fCorrectedHadEtPHOSAcceptanceTPC(0)
-    ,fCorrectedHadEtPHOSAcceptanceITS(0)
-    ,fRawEtFullAcceptanceTPC(0)
-    ,fRawEtFullAcceptanceITS(0)
-    ,fRawEtEMCALAcceptanceTPC(0)
-    ,fRawEtEMCALAcceptanceITS(0)
-    ,fRawEtPHOSAcceptanceTPC(0)
-    ,fRawEtPHOSAcceptanceITS(0)
-    ,fRawEtFullAcceptanceTPCNoPID(0)
-    ,fRawEtFullAcceptanceITSNoPID(0)
-    ,fRawEtEMCALAcceptanceTPCNoPID(0)
-    ,fRawEtEMCALAcceptanceITSNoPID(0)
-    ,fRawEtPHOSAcceptanceTPCNoPID(0)
-    ,fRawEtPHOSAcceptanceITSNoPID(0)
+       ,fCorrTotEtFullAcceptanceTPC(0)
+       ,fCorrTotEtFullAcceptanceITS(0)
+       ,fCorrHadEtFullAcceptanceTPC(0)
+       ,fCorrHadEtFullAcceptanceITS(0)
+       ,fCorrTotEtEMCALAcceptanceTPC(0)
+       ,fCorrTotEtEMCALAcceptanceITS(0)
+       ,fCorrHadEtEMCALAcceptanceTPC(0)
+       ,fCorrHadEtEMCALAcceptanceITS(0)
+       ,fCorrTotEtPHOSAcceptanceTPC(0)
+       ,fCorrTotEtPHOSAcceptanceITS(0)
+       ,fCorrHadEtPHOSAcceptanceTPC(0)
+       ,fCorrHadEtPHOSAcceptanceITS(0)
+       ,fCorrectedHadEtFullAcceptanceTPCNoPID(0)
+       ,fCorrectedHadEtFullAcceptanceITSNoPID(0)
+       ,fCorrectedHadEtEMCALAcceptanceTPCNoPID(0)
+       ,fCorrectedHadEtEMCALAcceptanceITSNoPID(0)
+       ,fCorrectedHadEtPHOSAcceptanceTPCNoPID(0)
+       ,fCorrectedHadEtPHOSAcceptanceITSNoPID(0)
+       ,fCorrectedHadEtFullAcceptanceTPC(0)
+       ,fCorrectedHadEtFullAcceptanceITS(0)
+       ,fCorrectedHadEtEMCALAcceptanceTPC(0)
+       ,fCorrectedHadEtEMCALAcceptanceITS(0)
+       ,fCorrectedHadEtPHOSAcceptanceTPC(0)
+       ,fCorrectedHadEtPHOSAcceptanceITS(0)
+       ,fRawEtFullAcceptanceTPC(0)
+       ,fRawEtFullAcceptanceITS(0)
+       ,fRawEtEMCALAcceptanceTPC(0)
+       ,fRawEtEMCALAcceptanceITS(0)
+       ,fRawEtPHOSAcceptanceTPC(0)
+       ,fRawEtPHOSAcceptanceITS(0)
+       ,fRawEtFullAcceptanceTPCNoPID(0)
+       ,fRawEtFullAcceptanceITSNoPID(0)
+       ,fRawEtEMCALAcceptanceTPCNoPID(0)
+       ,fRawEtEMCALAcceptanceITSNoPID(0)
+       ,fRawEtPHOSAcceptanceTPCNoPID(0)
+       ,fRawEtPHOSAcceptanceITSNoPID(0)
 {
-  //cout<<"test "<<fgChristineTestjunk<<endl;
 }
 
 AliAnalysisHadEtReconstructed::~AliAnalysisHadEtReconstructed() 
@@ -115,7 +114,6 @@ Int_t AliAnalysisHadEtReconstructed::AnalyseEvent(AliVEvent* ev)
        return -1;
       }
       Int_t nGoodTracks = list->GetEntries();
-      //cout<<nGoodTracks<<" "<<cutName->Data()<<" tracks"<<endl;
       for (Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++)
        {
 
@@ -127,7 +125,6 @@ Int_t AliAnalysisHadEtReconstructed::AnalyseEvent(AliVEvent* ev)
              continue;
            }
          else{
-           //if(!isTPC) cout<<"I should add an ITS track..."<<endl;
            if(TMath::Abs(track->Eta())>fCorrections->GetEtaCut()) continue;
            Float_t nSigmaPion,nSigmaProton,nSigmaKaon,nSigmaElectron;
            if(cutset!=1){
@@ -147,16 +144,13 @@ Int_t AliAnalysisHadEtReconstructed::AnalyseEvent(AliVEvent* ev)
            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 && !isPion);
            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);
-           //if(!(fCorrections->GetEfficiencyPionTPC())) cerr<<"Uh-oh!  No histogram!"<<endl;
 
            Float_t corrBkgd=0.0;
            Float_t corrNotID=0.0;
@@ -243,59 +237,11 @@ Int_t AliAnalysisHadEtReconstructed::AnalyseEvent(AliVEvent* ev)
            }
            if(!isTPC){
              etpartialcorrected = etpartialcorrectedNoID;//Not using PID for ITS
-             //cout<<"I should add an ITS track..."<<endl;
            }
            AddEt(et,etNoID,etpartialcorrected,etpartialcorrectedNoID,track->Pt(),isTPC,inPHOS,inEMCAL);
-           // cout<<"Pt "<<track->Pt()<<" et corrected no id "<<etpartialcorrectedNoID<<"="<<corrNoID<<"*"<<corrBkgd<<"*"<<corrEffNoID<<"*"<<etNoID<<endl;
-//         if(isTPC){
-//           //if(!unidentified){
-//           //cout<<"Pt "<<track->Pt()<<" et corrected   pid "<<etpartialcorrected<<"="<<corrBkgd<<"*"<<corrEff<<"*"<<et;
-//           cout<<"Pt "<<track->Pt()<<" et corrected  pid "<<etpartialcorrected<<"="<<corrNotID<<"*"<<corrBkgd<<"*"<<corrEff<<"*"<<et;
-//           if(isPion)cout<<" pion";
-//           if(isProton)cout<<" proton";
-//           if(isKaon)cout<<" kaon";
-//           if(isElectron)cout<<" electron";
-//           if(unidentified)cout<<" unidentified";
-//           cout<<endl;
-//             //}
-//           //else{cout<<"Pt "<<track->Pt()<<" et corrected  !pid "<<etpartialcorrected<<"="<<corrBkgd<<"*"<<corrEff<<"*"<<corrNotID<<"*"<<et<<" Not identified"<<endl;}
-//         }
-           //if(inEMCAL) cout<<"I should add a track"<<endl;
          }
        }
     }
-//   cout<<"Finishing with Raw/Corrected Et in full, PHOS, EMCAL acceptance of "
-//       << GetRawEtFullAcceptanceITS() <<"/"
-//       << GetCorrectedHadEtFullAcceptanceITS() <<", "
-//       << GetRawEtPHOSAcceptanceITS() <<"/"
-//       << GetCorrectedHadEtPHOSAcceptanceITS() <<", "
-//       << GetRawEtEMCALAcceptanceITS() <<"/"
-//       << GetCorrectedHadEtEMCALAcceptanceITS() <<endl;
-//   cout<<"Finishing with Raw/Corrected Et w/o PID in full, PHOS, EMCAL acceptance of "
-//       << GetRawEtFullAcceptanceITSNoPID() <<"/"
-//       << GetCorrectedHadEtFullAcceptanceITSNoPID() <<", "
-//       << GetRawEtPHOSAcceptanceITSNoPID() <<"/"
-//       << GetCorrectedHadEtPHOSAcceptanceITSNoPID() <<", "
-//       << GetRawEtEMCALAcceptanceITSNoPID() <<"/"
-//       << GetCorrectedHadEtEMCALAcceptanceITSNoPID() <<endl;
-//   cout<<"Finishing with Raw/Corrected Et in full, PHOS, EMCAL acceptance of "
-//       << GetRawEtFullAcceptanceTPC() <<"/"
-//       << GetCorrectedHadEtFullAcceptanceTPC() <<", "
-//       << GetRawEtPHOSAcceptanceTPC() <<"/"
-//       << GetCorrectedHadEtPHOSAcceptanceTPC() <<", "
-//       << GetRawEtEMCALAcceptanceTPC() <<"/"
-//       << GetCorrectedHadEtEMCALAcceptanceTPC() <<endl;
-//   cout<<"Finishing with Raw/Corrected Et w/o PID in full, PHOS, EMCAL acceptance of "
-//       << GetRawEtFullAcceptanceTPCNoPID() <<"/"
-//       << GetCorrectedHadEtFullAcceptanceTPCNoPID() <<", "
-//       << GetRawEtPHOSAcceptanceTPCNoPID() <<"/"
-//       << GetCorrectedHadEtPHOSAcceptanceTPCNoPID() <<", "
-//       << GetRawEtEMCALAcceptanceTPCNoPID() <<"/"
-//       << GetCorrectedHadEtEMCALAcceptanceTPCNoPID() <<endl;
-//   cout<<"Correction factors "
-//       <<fCorrTotEtFullAcceptanceTPC<<", "<<fCorrTotEtFullAcceptanceITS<<", "<<fCorrHadEtFullAcceptanceTPC<<", "<<fCorrHadEtFullAcceptanceITS<<","
-//       <<fCorrTotEtEMCALAcceptanceTPC<<", "<<fCorrTotEtEMCALAcceptanceITS<<", "<<fCorrHadEtEMCALAcceptanceTPC<<", "<<fCorrHadEtEMCALAcceptanceITS<<","
-//       <<fCorrTotEtPHOSAcceptanceTPC<<", "<<fCorrTotEtPHOSAcceptanceITS<<", "<<fCorrHadEtPHOSAcceptanceTPC<<", "<<fCorrHadEtPHOSAcceptanceITS<<endl;
     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);
@@ -342,8 +288,6 @@ Int_t AliAnalysisHadEtReconstructed::AnalyseEvent(AliVEvent* ev)
 void AliAnalysisHadEtReconstructed::AddEt(Float_t rawEt, Float_t rawEtNoPID, Float_t corrEt, Float_t corrEtNoPID, Float_t pt, Bool_t IsTPC, Bool_t InPHOS, Bool_t InEMCAL) {//Adding Et to each of the variables that tracks et event by event
   if(pt>=AliAnalysisHadEt::fgPtTPCCutOff && IsTPC){//TPC tracks
     //adding to the raw Et
-    //if(InEMCAL)
-    //cout<<"Adding "<<rawEt<<" to the raw TPC Et"<<endl;
     fRawEtFullAcceptanceTPC += rawEt;
     if(InPHOS)fRawEtPHOSAcceptanceTPC += rawEt;
     if(InEMCAL)fRawEtEMCALAcceptanceTPC += rawEt;
@@ -351,14 +295,12 @@ void AliAnalysisHadEtReconstructed::AddEt(Float_t rawEt, Float_t rawEtNoPID, Flo
     if(InPHOS)fRawEtPHOSAcceptanceTPCNoPID += rawEtNoPID;
     if(InEMCAL)fRawEtEMCALAcceptanceTPCNoPID += rawEtNoPID;
     //adding to the corrected Et
-    //if(InPHOS) cout<<"Adding "<<corrEt<<" to the corrected Et"<<endl;
     fCorrectedHadEtFullAcceptanceTPC += corrEt;
     if(InPHOS)fCorrectedHadEtPHOSAcceptanceTPC += corrEt;
     if(InEMCAL)fCorrectedHadEtEMCALAcceptanceTPC += corrEt;
     fCorrectedHadEtFullAcceptanceTPCNoPID += corrEtNoPID;
     if(InPHOS)fCorrectedHadEtPHOSAcceptanceTPCNoPID += corrEtNoPID;
     if(InEMCAL)fCorrectedHadEtEMCALAcceptanceTPCNoPID += corrEtNoPID;
-    //cout<<"Adding "<<corrEt<<" to the corrected Et, TPC pT "<<pt<<endl;
   }
   if(pt<AliAnalysisHadEt::fgPtTPCCutOff &&pt>=AliAnalysisHadEt::fgPtITSCutOff && !IsTPC){//ITS tracks
     //adding to the raw Et
@@ -368,7 +310,6 @@ void AliAnalysisHadEtReconstructed::AddEt(Float_t rawEt, Float_t rawEtNoPID, Flo
     fRawEtFullAcceptanceITSNoPID += rawEtNoPID;
     if(InPHOS)fRawEtPHOSAcceptanceITSNoPID += rawEtNoPID;
     if(InEMCAL)fRawEtEMCALAcceptanceITSNoPID += rawEtNoPID;
-    //cout<<"Adding "<<rawEt<<" to the raw ITS Et"<<endl;
     //adding to the corrected Et
     fCorrectedHadEtFullAcceptanceITS += corrEt;
     if(InPHOS)fCorrectedHadEtPHOSAcceptanceITS += corrEt;
@@ -376,7 +317,6 @@ void AliAnalysisHadEtReconstructed::AddEt(Float_t rawEt, Float_t rawEtNoPID, Flo
     fCorrectedHadEtFullAcceptanceITSNoPID += corrEtNoPID;
     if(InPHOS)fCorrectedHadEtPHOSAcceptanceITSNoPID += corrEtNoPID;
     if(InEMCAL)fCorrectedHadEtEMCALAcceptanceITSNoPID += corrEtNoPID;
-    //cout<<"Adding "<<corrEt<<" to the corrected Et, ITS pT "<<pt<<endl;
   }
 }
 
@@ -386,7 +326,6 @@ Bool_t AliAnalysisHadEtReconstructed::IsInPHOS(AliESDtrack *track){//This functi
     && track->Phi()*180.0/TMath::Pi() < fCuts->GetGeometryPhosPhiAccMaxCut();//less than the maximum phi
 }
 Bool_t AliAnalysisHadEtReconstructed::IsInEMCAL(AliESDtrack *track){//This function will need to be elaborated on later to include EMCAL dead channels
-  //cout<<"Eta: |"<<track->Eta()<<"|<"<< fCuts->GetGeometryEmcalEtaAccCut() <<"; phi: "<<fCuts->GetGeometryEmcalPhiAccMinCut()<<"<"<<track->Phi()*180.0/TMath::Pi()<<"<"<<fCuts->GetGeometryEmcalPhiAccMaxCut()<<endl;
   return   TMath::Abs(track->Eta()) < fCuts->GetGeometryEmcalEtaAccCut()//in eta acceptance
     && track->Phi()*180.0/TMath::Pi() > fCuts->GetGeometryEmcalPhiAccMinCut()//greater than the minimum phi
     && track->Phi()*180.0/TMath::Pi() < fCuts->GetGeometryEmcalPhiAccMaxCut();//less than the maximum phi
@@ -410,9 +349,7 @@ Bool_t AliAnalysisHadEtReconstructed::CheckGoodVertex(AliVParticle* track)
 void AliAnalysisHadEtReconstructed::Init()
 { // Init
   AliAnalysisHadEt::Init();
-  if (fConfigFile.Length() && !fCorrections) {
-    gROOT->LoadMacro(fConfigFile);
-    fCorrections = (AliAnalysisHadEtCorrections *) gInterpreter->ProcessLine("ConfigHadEtAnalysis()");
+  if(fCorrections){
     fCorrTotEtFullAcceptanceTPC = fCorrections->GetConstantCorrections(kTRUE,fgPtTPCCutOff,"Full");
     fCorrTotEtFullAcceptanceITS = fCorrections->GetConstantCorrections(kTRUE,fgPtITSCutOff,"Full");
     fCorrHadEtFullAcceptanceTPC = fCorrections->GetConstantCorrections(kFALSE,fgPtTPCCutOff,"Full");
@@ -425,7 +362,9 @@ void AliAnalysisHadEtReconstructed::Init()
     fCorrTotEtPHOSAcceptanceITS = fCorrections->GetConstantCorrections(kTRUE,fgPtITSCutOff,"PHOS");
     fCorrHadEtPHOSAcceptanceTPC = fCorrections->GetConstantCorrections(kFALSE,fgPtTPCCutOff,"PHOS");
     fCorrHadEtPHOSAcceptanceITS = fCorrections->GetConstantCorrections(kFALSE,fgPtITSCutOff,"PHOS");
-
+  }
+  else{
+    cout<<"Warning!  You have not set corrections.  Your code will crash.  You have to set the corrections."<<endl;
   }
 }
 
@@ -458,7 +397,7 @@ void AliAnalysisHadEtReconstructed::ResetEventValues(){//resetting event by even
 
      if(TMath::Abs(fCorrTotEtFullAcceptanceTPC)<1e-3){
        if (fConfigFile.Length()) {
-        cout<<"Rereading fCorrections file..."<<endl;
+        cout<<"Warning: Rereading fCorrections file..."<<endl;
         gROOT->LoadMacro(fConfigFile);
         fCorrections = (AliAnalysisHadEtCorrections *) gInterpreter->ProcessLine("ConfigHadEtAnalysis()");
         fCorrTotEtFullAcceptanceTPC = fCorrections->GetConstantCorrections(kTRUE,fgPtTPCCutOff,"Full");
index 462330e..387de15 100644 (file)
@@ -24,7 +24,6 @@ public:
     AliAnalysisHadEtReconstructed();
     virtual ~AliAnalysisHadEtReconstructed();
    
-    virtual void SetConfigFile(const char *c) {fConfigFile = c;}
     virtual Int_t AnalyseEvent(AliVEvent* event);
 
     //the "Corrected" variables are only corrected for the track-by-track fCorrections
@@ -68,6 +67,7 @@ public:
     Float_t GetCorrectedPiKPEtFullAcceptanceITS() const {return fCorrectedHadEtFullAcceptanceITS+fCorrectedHadEtFullAcceptanceTPC;}
     Float_t GetCorrectedPiKPEtFullAcceptanceTPCNoPID() const {return fCorrectedHadEtFullAcceptanceTPCNoPID;}
     Float_t GetCorrectedPiKPEtFullAcceptanceITSNoPID() const {return fCorrectedHadEtFullAcceptanceITSNoPID+fCorrectedHadEtFullAcceptanceTPCNoPID;}
+    void SetCorrections(AliAnalysisHadEtCorrections *corr){fCorrections = corr;}
 
     void CreateHistograms();
      virtual void Init();
index b0b8e3c..352cd20 100644 (file)
@@ -89,8 +89,13 @@ void AliAnalysisTaskHadEt::UserCreateOutputObjects()
   fMCAnalysis->CreateHistograms();
   fRecAnalysis->CreateHistograms();
 
+  if(fRecAnalysis->DataSet() != fMCAnalysis->DataSet()){
+    cout<<"Warning: Reconstruction data set and Monte Carlo data set are not the same!  Setting data set to "<<fRecAnalysis->DataSet()<<endl;
+  }
 
-    Bool_t selectPrimaries=kTRUE;
+  Bool_t selectPrimaries=kTRUE;
+  if(fRecAnalysis->DataSet()==2009){
+    cout<<"Setting track cuts for the 2009 p+p collisions at 900 GeV"<<endl;
     fEsdtrackCutsITSTPC = AliESDtrackCuts::GetStandardITSTPCTrackCuts2009(selectPrimaries);
     fEsdtrackCutsITSTPC->SetName("fEsdTrackCuts");
     fEsdtrackCutsTPC = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
@@ -98,22 +103,34 @@ void AliAnalysisTaskHadEt::UserCreateOutputObjects()
     //ITS stand alone cuts - similar to 2009 cuts but with only ITS hits required
     fEsdtrackCutsITS =  AliESDtrackCuts::GetStandardITSPureSATrackCuts2009(kTRUE,kFALSE);//we do want primaries but we do not want to require PID info
     fEsdtrackCutsITS->SetName("fEsdTrackCutsITS");
+  }
+  if(fRecAnalysis->DataSet()==2010){
+    //cout<<"Setting track cuts for the 2010 p+p collisions at 7 GeV"<<endl;
+    cout<<"Warning:  Have not set 2010 track cuts yet!!"<<endl;
+    fEsdtrackCutsITSTPC = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
+    fEsdtrackCutsITSTPC->SetName("fEsdTrackCuts");
+    fEsdtrackCutsTPC = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+    fEsdtrackCutsTPC->SetName("fEsdTrackCutsTPCOnly");
+    //ITS stand alone cuts - similar to 2009 cuts but with only ITS hits required
+    fEsdtrackCutsITS =  AliESDtrackCuts::GetStandardITSPureSATrackCuts2009(kTRUE,kFALSE);//we do want primaries but we do not want to require PID info
+    fEsdtrackCutsITS->SetName("fEsdTrackCutsITS");
+  }
 
-    fOutputList->Add(fEsdtrackCutsITSTPC);
-    fOutputList->Add(fEsdtrackCutsTPC);
-    fOutputList->Add(fEsdtrackCutsITS);
-    if(fEsdtrackCutsITSTPC && fEsdtrackCutsTPC){
-      fRecAnalysis->SetITSTrackCuts( GetITSTrackCuts());
-      fMCAnalysis->SetITSTrackCuts( GetITSTrackCuts());
-      fRecAnalysis->SetTPCITSTrackCuts( GetTPCITSTrackCuts());
-      fMCAnalysis->SetTPCITSTrackCuts( GetTPCITSTrackCuts());
-      fRecAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
-      fMCAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
-      //add ITS stuff!
-    }
-    else{
-      Printf("Error: no track cuts!");
-    }
+  fOutputList->Add(fEsdtrackCutsITSTPC);
+  fOutputList->Add(fEsdtrackCutsTPC);
+  fOutputList->Add(fEsdtrackCutsITS);
+  if(fEsdtrackCutsITSTPC && fEsdtrackCutsTPC){
+    fRecAnalysis->SetITSTrackCuts( GetITSTrackCuts());
+    fMCAnalysis->SetITSTrackCuts( GetITSTrackCuts());
+    fRecAnalysis->SetTPCITSTrackCuts( GetTPCITSTrackCuts());
+    fMCAnalysis->SetTPCITSTrackCuts( GetTPCITSTrackCuts());
+    fRecAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
+    fMCAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
+    //add ITS stuff!
+  }
+  else{
+    Printf("Error: no track cuts!");
+  }
 }
 
 //________________________________________________________________________
index 53a6dad..3b52c27 100644 (file)
@@ -6,6 +6,10 @@
 //
 //*-- Authors: Oystein Djuvsland (Bergen), David Silvermyr (ORNL)
 //_________________________________________________________________________
+//Necessary to read config macros
+#include <TROOT.h>
+#include <TSystem.h>
+#include <TInterpreter.h>
 
 #include "TChain.h"
 #include "TList.h"
@@ -30,11 +34,15 @@ ClassImp(AliAnalysisTaskTotEt)
 //________________________________________________________________________
 AliAnalysisTaskTotEt::AliAnalysisTaskTotEt(const char *name) :
         AliAnalysisTaskSE(name)
+       ,fMCConfigFile("ConfigEtMonteCarlo.C")
+       ,fRecoConfigFile("ConfigEtReconstructed.C")
         ,fOutputList(0)
         ,fRecAnalysis(0)
         ,fMCAnalysis(0)
         ,fHistEtRecvsEtMC(0)
+        ,fEsdtrackCutsITSTPC(0)
         ,fEsdtrackCutsTPC(0)
+        ,fEsdtrackCutsITS(0)
 {
     // Constructor
 
@@ -43,17 +51,31 @@ AliAnalysisTaskTotEt::AliAnalysisTaskTotEt(const char *name) :
     TString t(name);
     t.ToUpper();
     if (t.Contains("EMC")) {
-      fRecAnalysis = new AliAnalysisEtReconstructedEmcal(); 
-      fMCAnalysis = new AliAnalysisEtMonteCarloEmcal();
+      if (fMCConfigFile.Length()) {
+       cout<<"Rereading AliAnalysisEtMonteCarloEmcal configuration file..."<<endl;
+       gROOT->LoadMacro(fMCConfigFile);
+       fMCAnalysis = (AliAnalysisEtMonteCarloEmcal *) gInterpreter->ProcessLine("ConfigEtMonteCarlo()");
+      }
+
+      if (fRecoConfigFile.Length()) {
+       cout<<"Rereading AliAnalysisEtReconstructedEmcal configuration file..."<<endl;
+       gROOT->LoadMacro(fRecoConfigFile);
+       fRecAnalysis = (AliAnalysisEtReconstructedEmcal *) gInterpreter->ProcessLine("ConfigEtReconstructed()");
+      }
     }
-    else {
-      fRecAnalysis = new AliAnalysisEtReconstructedPhos(); 
-      fMCAnalysis = new AliAnalysisEtMonteCarloPhos();
+    else{
+      if (fMCConfigFile.Length()) {
+       cout<<"Rereading AliAnalysisEtMonteCarloPhos configuration file..."<<endl;
+       gROOT->LoadMacro(fMCConfigFile);
+       fMCAnalysis = (AliAnalysisEtMonteCarloPhos *) gInterpreter->ProcessLine("ConfigEtMonteCarlo()");
+      }
+
+      if (fRecoConfigFile.Length()) {
+       cout<<"Rereading AliAnalysisEtReconstructedPhos configuration file..."<<endl;
+       gROOT->LoadMacro(fRecoConfigFile);
+       fRecAnalysis = (AliAnalysisEtReconstructedPhos *) gInterpreter->ProcessLine("ConfigEtReconstructed()");
+      }
     }
-
-    fRecAnalysis->Init();
-    fMCAnalysis->Init();
-
     // Define input and output slots here
     // Input slot #0 works with a TChain
     DefineInput(0, TChain::Class());
@@ -67,7 +89,9 @@ AliAnalysisTaskTotEt::~AliAnalysisTaskTotEt(){//Destructor
   delete fOutputList;
   delete fRecAnalysis;
   delete fMCAnalysis;
+  delete fEsdtrackCutsITSTPC;
   delete fEsdtrackCutsTPC;
+  delete fEsdtrackCutsITS;
 }
 
 //________________________________________________________________________
@@ -84,17 +108,44 @@ void AliAnalysisTaskTotEt::UserCreateOutputObjects()
     fHistEtRecvsEtMC = new TH2F("fHistEtRecvsEtMC", "Reconstructed E_{t} vs MC E_{t}", 1000, 0.000, 100, 1000, 0.0001, 100);
     fOutputList->Add(fHistEtRecvsEtMC);
 
-
+  Bool_t selectPrimaries=kTRUE;
+  if(fRecAnalysis->DataSet()==2009){
+    cout<<"Setting track cuts for the 2009 p+p collisions at 900 GeV"<<endl;
+    fEsdtrackCutsITSTPC = AliESDtrackCuts::GetStandardITSTPCTrackCuts2009(selectPrimaries);
+    fEsdtrackCutsITSTPC->SetName("fEsdTrackCuts");
     fEsdtrackCutsTPC = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
     fEsdtrackCutsTPC->SetName("fEsdTrackCutsTPCOnly");
-    fOutputList->Add(fEsdtrackCutsTPC);
-    if(fEsdtrackCutsTPC){
-      fRecAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
-      fMCAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
-    }
-    else{
-      Printf("Error: no track cuts!");
-    }
+    //ITS stand alone cuts - similar to 2009 cuts but with only ITS hits required
+    fEsdtrackCutsITS =  AliESDtrackCuts::GetStandardITSPureSATrackCuts2009(kTRUE,kFALSE);//we do want primaries but we do not want to require PID info
+    fEsdtrackCutsITS->SetName("fEsdTrackCutsITS");
+  }
+  if(fRecAnalysis->DataSet()==2010){
+    //cout<<"Setting track cuts for the 2010 p+p collisions at 7 GeV"<<endl;
+    cout<<"Warning:  Have not set 2010 track cuts yet!!"<<endl;
+    fEsdtrackCutsITSTPC = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(selectPrimaries);
+    fEsdtrackCutsITSTPC->SetName("fEsdTrackCuts");
+    fEsdtrackCutsTPC = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+    fEsdtrackCutsTPC->SetName("fEsdTrackCutsTPCOnly");
+    //ITS stand alone cuts - similar to 2009 cuts but with only ITS hits required
+    fEsdtrackCutsITS =  AliESDtrackCuts::GetStandardITSPureSATrackCuts2009(kTRUE,kFALSE);//we do want primaries but we do not want to require PID info
+    fEsdtrackCutsITS->SetName("fEsdTrackCutsITS");
+  }
+
+  fOutputList->Add(fEsdtrackCutsITSTPC);
+  fOutputList->Add(fEsdtrackCutsTPC);
+  fOutputList->Add(fEsdtrackCutsITS);
+  if(fEsdtrackCutsITSTPC && fEsdtrackCutsTPC){
+    fRecAnalysis->SetITSTrackCuts( GetITSTrackCuts());
+    fMCAnalysis->SetITSTrackCuts( GetITSTrackCuts());
+    fRecAnalysis->SetTPCITSTrackCuts( GetTPCITSTrackCuts());
+    fMCAnalysis->SetTPCITSTrackCuts( GetTPCITSTrackCuts());
+    fRecAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
+    fMCAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
+    //add ITS stuff!
+  }
+  else{
+    Printf("Error: no track cuts!");
+  }
 
 }
 
index d25c0f2..284538e 100644 (file)
@@ -29,7 +29,12 @@ public:
   virtual void   UserExec(Option_t *option);\r
   virtual void   Terminate(Option_t *);\r
     \r
+\r
+  TString       fMCConfigFile;        // the name of the ConfigFile\r
+  TString       fRecoConfigFile;        // the name of the ConfigFile\r
+  AliESDtrackCuts* GetTPCITSTrackCuts(){return (AliESDtrackCuts*) fOutputList->FindObject("fEsdTrackCuts");}\r
   AliESDtrackCuts* GetTPCOnlyTrackCuts(){return (AliESDtrackCuts*) fOutputList->FindObject("fEsdTrackCutsTPCOnly");}\r
+  AliESDtrackCuts* GetITSTrackCuts(){return (AliESDtrackCuts*) fOutputList->FindObject("fEsdTrackCutsITS");}\r
 \r
 private:\r
   \r
@@ -44,7 +49,9 @@ private:
   \r
   TH2F *fHistEtRecvsEtMC; // Rec vs MC histo\r
 \r
+  AliESDtrackCuts* fEsdtrackCutsITSTPC; // track cuts ITS&TPC\r
   AliESDtrackCuts* fEsdtrackCutsTPC; // track cuts TPC\r
+  AliESDtrackCuts* fEsdtrackCutsITS; // track cuts ITS\r
   \r
   ClassDef(AliAnalysisTaskTotEt, 1); // example of analysis\r
 };\r
diff --git a/PWG4/totEt/macros/ConfigEtMonteCarlo.C b/PWG4/totEt/macros/ConfigEtMonteCarlo.C
new file mode 100644 (file)
index 0000000..a888013
--- /dev/null
@@ -0,0 +1,20 @@
+
+AliAnalysisEtMonteCarlo * ConfigEtMonteCarlo(){
+  Bool_t EMCAL = true;
+  if(EMCAL){
+    AliAnalysisEtMonteCarloEmcal *totEtMC = new AliAnalysisEtMonteCarloEmcal();
+    //Look at the 2010 p+p data...
+    totEtMC->SetDataSet(2010);
+    
+    totEtMC->Init();
+    return totEtMC;
+  }
+  else{
+    AliAnalysisEtMonteCarloPhos *totEtMC = new AliAnalysisEtMonteCarloPhos();
+    //Look at the 2010 p+p data...
+    totEtMC->SetDataSet(2010);
+    
+    totEtMC->Init();
+    return totEtMC;
+  }
+}
diff --git a/PWG4/totEt/macros/ConfigEtReconstructed.C b/PWG4/totEt/macros/ConfigEtReconstructed.C
new file mode 100644 (file)
index 0000000..6494584
--- /dev/null
@@ -0,0 +1,33 @@
+
+AliAnalysisEtReconstructed * ConfigEtReconstructed(){
+  Bool_t EMCAL = true;
+  if(EMCAL){
+    AliAnalysisEtReconstructedEmcal *totEtReco = new AliAnalysisEtReconstructedEmcal();
+    totEtReco->SetDataSet(2010);
+    //Set corrections...
+    
+    TFile *infile = new TFile("corrections.root");
+    corrections = (AliAnalysisHadEtCorrections *)infile->Get("hadCorrectionEMCAL");
+    cout<<"Setting the AliAnalysisHadEtCorrections to "<<corrections->GetName()<<endl;
+    cout<<"eta cut is "<<corrections->GetEtaCut()<<endl;
+    totEtReco->SetCorrections(corrections);
+    
+    totEtReco->Init();
+    return totEtReco;
+  }
+  else{
+    AliAnalysisEtReconstructedPhos *totEtReco = new AliAnalysisEtReconstructedPhos();
+    totEtReco->SetDataSet(2010);
+    //Set corrections...
+    
+    TFile *infile = new TFile("corrections.root");
+    corrections = (AliAnalysisHadEtCorrections *)infile->Get("hadCorrectionPHOS");
+    cout<<"Setting the AliAnalysisHadEtCorrections to "<<corrections->GetName()<<endl;
+    cout<<"eta cut is "<<corrections->GetEtaCut()<<endl;
+    totEtReco->SetCorrections(corrections);
+    
+    totEtReco->Init();
+    return totEtReco;
+  }
+}
+
index da8946e..ecb3cd0 100644 (file)
@@ -14,9 +14,9 @@ AliAnalysisGrid* CreateAlienHandlerCaloEtSim(TString outputDir, TString outputNa
   plugin->SetRunMode(pluginRunMode);  // VERY IMPORTANT - DECRIBED BELOW
 
   // Set versions of used packages
-  plugin->SetAPIVersion("V1.1x");
-  plugin->SetROOTVersion("v5-27-05-build1");
-  plugin->SetAliROOTVersion("v4-20-09-AN-build1");
+   plugin->SetAPIVersion("V1.1x");
+   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.
@@ -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 AliAnalysisEtCommon.cxx AliAnalysisEt.cxx AliAnalysisEtMonteCarlo.cxx AliAnalysisEtMonteCarloPhos.cxx AliAnalysisEtMonteCarloEmcal.cxx AliAnalysisEtReconstructed.cxx AliAnalysisEtReconstructedPhos.cxx AliAnalysisEtReconstructedEmcal.cxx AliAnalysisTaskTotEt.cxx");
+  plugin->SetAnalysisSource("AliAnalysisEtCuts.cxx AliAnalysisHadEtCorrections.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  AliAnalysisEtCommon.cxx  AliAnalysisEtCommon.h");
+  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 AliAnalysisHadEtCorrections.h AliAnalysisHadEtCorrections.cxx ConfigEtMonteCarlo.C ConfigEtReconstructed.C");
   plugin->SetExecutableCommand("aliroot -b -q");
   // add extra include files/path
   plugin->AddIncludePath("-I. -I$ALICE_ROOT/EMCAL -I$ALICE_ROOT/ANALYSIS");
index c8e5c7d..a6cb9e0 100644 (file)
@@ -37,7 +37,8 @@ void runCaloEt(bool submit = false, // true or false
   }
    
   gROOT->ProcessLine(".L AliAnalysisEtCuts.cxx+g");
-  gROOT->ProcessLine(".L AliAnalysisEtCommon.cxx+g");
+  gROOT->ProcessLine(".L AliAnalysisHadEtCorrections.cxx+g");//new
+   gROOT->ProcessLine(".L AliAnalysisEtCommon.cxx+g");
   gROOT->ProcessLine(".L AliAnalysisEt.cxx+g");
   gROOT->ProcessLine(".L AliAnalysisEtMonteCarlo.cxx+g");
   gROOT->ProcessLine(".L AliAnalysisEtMonteCarloPhos.cxx+g");