moved AliSelector, AliSelectorRL to STEER
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 5 Oct 2006 16:24:00 +0000 (16:24 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 5 Oct 2006 16:24:00 +0000 (16:24 +0000)
splitted AliPWG0Helper classes in ESD/RL-dependent part
introduced x-sections study in selectors
many more things...

24 files changed:
PWG0/AliPWG0Helper.cxx
PWG0/AliPWG0Helper.h
PWG0/AliPWG0depHelper.cxx [new file with mode: 0644]
PWG0/AliPWG0depHelper.h [new file with mode: 0644]
PWG0/PWG0Helper.C
PWG0/PWG0baseLinkDef.h
PWG0/PWG0depLinkDef.h
PWG0/PWG0selectorsLinkDef.h
PWG0/dNdEta/AlidNdEtaAnalysisESDSelector.cxx
PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.cxx
PWG0/dNdEta/AlidNdEtaAnalysisMCSelector.h
PWG0/dNdEta/AlidNdEtaCorrection.cxx
PWG0/dNdEta/AlidNdEtaCorrectionSelector.cxx
PWG0/dNdEta/AlidNdEtaCorrectionSelector.h
PWG0/dNdEta/AlidNdEtaSystematicsSelector.cxx
PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.cxx [deleted file]
PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.h [deleted file]
PWG0/dNdEta/drawPlots.C
PWG0/dNdEta/makeSystematics.C
PWG0/dNdEta/runParticleCompositionStudy.sh
PWG0/dNdEta/testAnalysis2.C
PWG0/libPWG0base.pkg
PWG0/libPWG0dep.pkg
PWG0/libPWG0selectors.pkg

index b25baaf..b258d24 100644 (file)
 #include <AliESD.h>
 #include <AliESDVertex.h>
 
-#include <AliGenEventHeader.h>
-#include <AliGenPythiaEventHeader.h>
-#include <AliGenCocktailEventHeader.h>
-
-
 //____________________________________________________________________
 ClassImp(AliPWG0Helper)
 
@@ -119,47 +114,6 @@ Bool_t AliPWG0Helper::IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimari
 }
 
 //____________________________________________________________________
-const Int_t AliPWG0Helper::GetPythiaEventProcessType(AliHeader* aHeader, Bool_t adebug) {
-  //
-  // get the process type of the event.
-  // 
-
-  // can only read pythia headers, either directly or from cocktalil header
-  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader->GenEventHeader());
-  
-  if (!pythiaGenHeader) {
-    
-    AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(aHeader->GenEventHeader());
-    if (!genCocktailHeader) {
-      printf("AliPWG0Helper::GetProcessType : Unknown header type (not Pythia or Cocktail). \n");
-      return -1;
-    }
-
-    TList* headerList = genCocktailHeader->GetHeaders();
-    if (!headerList) {     
-      return -1;
-    }
-    
-    for (Int_t i=0; i<headerList->GetEntries(); i++) {
-      pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i));
-      if (pythiaGenHeader)
-       break;
-    }        
-    
-    if (!pythiaGenHeader) {
-      printf("AliPWG0Helper::GetProcessType : Could not find Pythia header. \n");
-      return -1;
-    }
-  }
-  
-  if (adebug) {
-    printf("AliPWG0Helper::GetProcessType : Pythia process type found: %d \n",pythiaGenHeader->ProcessType());
-  }
-
-  return pythiaGenHeader->ProcessType();        
-}
-
-//____________________________________________________________________
 void AliPWG0Helper::CreateProjections(TH3* hist)
 {
   // create projections of 3d hists to all 2d combinations
index 1ae6f62..b07d6c2 100644 (file)
@@ -20,11 +20,9 @@ class AliPWG0Helper : public TObject
     static Bool_t IsVertexReconstructed(AliESD* aEsd);
     static Bool_t IsPrimaryCharged(TParticle* aParticle, Int_t aTotalPrimaries, Bool_t adebug = kFALSE);
 
-    static const Int_t GetPythiaEventProcessType(AliHeader* aHeader, Bool_t adebug = kFALSE);
-
     static void CreateProjections(TH3* hist);
     static void CreateDividedProjections(TH3* hist, TH3* hist2, const char* axis = 0, Bool_t putErrors = kFALSE);
-    static const char* GetAxisTitle(TH3* hist, const char axis);    
+    static const char* GetAxisTitle(TH3* hist, const char axis);
     
   protected:
     ClassDef(AliPWG0Helper, 0)
diff --git a/PWG0/AliPWG0depHelper.cxx b/PWG0/AliPWG0depHelper.cxx
new file mode 100644 (file)
index 0000000..eab94a9
--- /dev/null
@@ -0,0 +1,53 @@
+/* $Id$ */
+
+#include <AliPWG0depHelper.h>
+
+#include <AliHeader.h>
+
+#include <AliGenEventHeader.h>
+#include <AliGenPythiaEventHeader.h>
+#include <AliGenCocktailEventHeader.h>
+
+//____________________________________________________________________
+ClassImp(AliPWG0depHelper)
+
+//____________________________________________________________________
+const Int_t AliPWG0depHelper::GetPythiaEventProcessType(AliHeader* aHeader, Bool_t adebug) {
+  //
+  // get the process type of the event.
+  //
+
+  // can only read pythia headers, either directly or from cocktalil header
+  AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(aHeader->GenEventHeader());
+
+  if (!pythiaGenHeader) {
+
+    AliGenCocktailEventHeader* genCocktailHeader = dynamic_cast<AliGenCocktailEventHeader*>(aHeader->GenEventHeader());
+    if (!genCocktailHeader) {
+      printf("AliPWG0depHelper::GetProcessType : Unknown header type (not Pythia or Cocktail). \n");
+      return -1;
+    }
+
+    TList* headerList = genCocktailHeader->GetHeaders();
+    if (!headerList) {
+      return -1;
+    }
+
+    for (Int_t i=0; i<headerList->GetEntries(); i++) {
+      pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(headerList->At(i));
+      if (pythiaGenHeader)
+        break;
+    }
+
+    if (!pythiaGenHeader) {
+      printf("AliPWG0depHelper::GetProcessType : Could not find Pythia header. \n");
+      return -1;
+    }
+  }
+
+  if (adebug) {
+    printf("AliPWG0depHelper::GetProcessType : Pythia process type found: %d \n",pythiaGenHeader->ProcessType());
+  }
+
+  return pythiaGenHeader->ProcessType();
+}
diff --git a/PWG0/AliPWG0depHelper.h b/PWG0/AliPWG0depHelper.h
new file mode 100644 (file)
index 0000000..62f7b24
--- /dev/null
@@ -0,0 +1,26 @@
+/* $Id$ */
+
+#ifndef ALIPWG0DEPHELPER_H
+#define ALIPWG0DEPHELPER_H
+
+#include <TObject.h>
+
+// static helper functions that depend on more than ESD
+
+class AliHeader;
+
+class AliPWG0depHelper : public TObject
+{
+  public:
+    static const Int_t GetPythiaEventProcessType(AliHeader* aHeader, Bool_t adebug = kFALSE);
+
+  protected:
+    ClassDef(AliPWG0depHelper, 0)
+
+  private:
+    AliPWG0depHelper(const AliPWG0depHelper&);
+    AliPWG0depHelper& operator=(const AliPWG0depHelper&);
+};
+
+#endif
+
index 41273e1..9ea4e48 100644 (file)
@@ -13,8 +13,6 @@ TVirtualProof* connectProof(const char* proofServer)
     return 0;
   }
 
-  proof->SetParallel(20);
-
   // enable the new packetizer
   //proof->AddInput(new TNamed("PROOF_Packetizer", "TPacketizerProgressive"));
 
@@ -131,11 +129,12 @@ Bool_t EnablePackageLocal(const char* package)
 {
   printf("Enabling package %s locally...\n", package);
 
+  TString currentDir(gSystem->pwd());
   if (!gSystem->cd(package))
     return kFALSE;
 
   gROOT->ProcessLine(".x PROOF-INF/SETUP.C");
-  gSystem->cd("..");
+  gSystem->cd(currentDir);
 
   return kTRUE;
 }
index c082f9b..e557f7d 100644 (file)
@@ -8,8 +8,6 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
-#pragma link C++ class AliSelector+;
-
 #pragma link C++ class dNdEtaAnalysis+;
 #pragma link C++ class AlidNdEtaCorrection+;
 
index c79aecd..af57d1f 100644 (file)
@@ -8,6 +8,6 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
-#pragma link C++ class AliSelectorRL+;
+#pragma link C++ class AliPWG0depHelper+;
 
 #endif
index 6f176cd..3b70f65 100644 (file)
@@ -11,9 +11,9 @@
 #pragma link C++ class AlidNdEtaCorrectionSelector+;
 #pragma link C++ class AlidNdEtaAnalysisMCSelector+;
 #pragma link C++ class AlidNdEtaAnalysisESDSelector+;
-#pragma link C++ class AlidNdEtaVertexRecEffSelector+;
 #pragma link C++ class AliMultiplicityESDSelector+;
 #pragma link C++ class AliMultiplicityMCSelector+;
 #pragma link C++ class AlidNdEtaSystematicsSelector+;
+#pragma link C++ class AliTestESDtrackCutsSelector+;
 
 #endif
index 16b5d9a..1ac8138 100644 (file)
@@ -180,7 +180,7 @@ Bool_t AlidNdEtaAnalysisESDSelector::Process(Long64_t entry)
     return kTRUE;
   }
 
-  Float_t triggerCorr = fdNdEtaCorrection->GetTriggerCorrection(vtx[2], nGoodTracks);
+  Float_t triggerCorr = fdNdEtaCorrection->GetTriggerBiasCorrection(vtx[2], nGoodTracks);
   if (triggerCorr <= 0)
   {
     AliDebug(AliLog::kError, Form("INFO: Skipping event because triggerCorr is <= 0 (%f)", triggerCorr));
index fd7f46f..cc69331 100644 (file)
@@ -29,6 +29,7 @@ AlidNdEtaAnalysisMCSelector::AlidNdEtaAnalysisMCSelector() :
   fdNdEtaAnalysis(0),
   fVertex(0),
   fPartEta(0),
+  fPartPt(0),
   fEvents(0)
 {
   //
@@ -54,6 +55,7 @@ void AlidNdEtaAnalysisMCSelector::SlaveBegin(TTree * tree)
   fdNdEtaAnalysis = new dNdEtaAnalysis("dndeta", "dndeta");
   fVertex = new TH3F("vertex_check", "vertex_check", 50, -50, 50, 50, -50, 50, 50, -50, 50);
   fPartEta = new TH1F("dndeta_check", "dndeta_check", 120, -6, 6);
+  fPartPt =  new TH1F("dndeta_check_pt", "dndeta_check_pt", 1000, 0, 10);
   fPartEta->Sumw2();
 }
 
@@ -61,7 +63,7 @@ void AlidNdEtaAnalysisMCSelector::Init(TTree *tree)
 {
   AliSelectorRL::Init(tree);
 
-  tree->SetBranchStatus("ESD", 0);
+  tree->SetBranchStatus("*", 0);
 }
 
 Bool_t AlidNdEtaAnalysisMCSelector::Process(Long64_t entry)
@@ -110,6 +112,9 @@ Bool_t AlidNdEtaAnalysisMCSelector::Process(Long64_t entry)
     fVertex->Fill(particle->Vx(), particle->Vy(), particle->Vz());
 
     fPartEta->Fill(particle->Eta());
+
+    if (TMath::Abs(particle->Eta()) < 0.8)
+      fPartPt->Fill(particle->Pt());
   }
   fdNdEtaAnalysis->FillEvent(vtxMC[2], 1);
 
@@ -134,6 +139,7 @@ void AlidNdEtaAnalysisMCSelector::SlaveTerminate()
   }
 
   fOutput->Add(fdNdEtaAnalysis);
+  fOutput->Add(fPartPt);
 }
 
 void AlidNdEtaAnalysisMCSelector::Terminate()
@@ -143,10 +149,11 @@ void AlidNdEtaAnalysisMCSelector::Terminate()
   AliSelectorRL::Terminate();
 
   fdNdEtaAnalysis = dynamic_cast<dNdEtaAnalysis*> (fOutput->FindObject("dndeta"));
+  fPartPt = dynamic_cast<TH1F*> (fOutput->FindObject("dndeta_check_pt"));
 
-  if (!fdNdEtaAnalysis)
+  if (!fdNdEtaAnalysis || !fPartPt)
   {
-    AliDebug(AliLog::kError, Form("ERROR: Histograms not available %p", (void*) fdNdEtaAnalysis));
+    AliDebug(AliLog::kError, Form("ERROR: Histograms not available %p %p", (void*) fdNdEtaAnalysis, (void*) fPartPt));
     return;
   }
 
@@ -173,4 +180,13 @@ void AlidNdEtaAnalysisMCSelector::Terminate()
     canvas->cd(2);
     fPartEta->Draw();
   }
+
+  if (fPartPt)
+  {
+    fPartPt->Scale(1.0/fEvents);
+    fPartPt->Scale(1.0/fPartPt->GetBinWidth(1));
+
+    new TCanvas("control2", "control2", 500, 500);
+    fPartPt->Draw();
+  }
 }
index bf1a4d2..8b8d12e 100644 (file)
@@ -27,6 +27,7 @@ class AlidNdEtaAnalysisMCSelector : public AliSelectorRL {
 
     TH3F* fVertex;  //! vertex of counted particles
     TH1F* fPartEta; //! counted particles as function of eta
+    TH1F* fPartPt; //! counted particles as function of pt
     Int_t fEvents;  //! number of processed events
 
     AlidNdEtaAnalysisMCSelector(const AlidNdEtaAnalysisMCSelector&);
index 2b2ac24..ac46691 100644 (file)
@@ -33,12 +33,12 @@ AlidNdEtaCorrection::AlidNdEtaCorrection(const Char_t* name, const Char_t* title
   // constructor
   //
 
-  Float_t binLimitsPt[] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.5, 2.0, 10.0, 100.0};
+  Float_t binLimitsPt[] = {0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.5, 2.0, 5.0, 10.0, 100.0};
 
   TString matrixName;
   matrixName.Form("%s_nTrackToNPart", name);
 
-  fTrack2ParticleCorrection = new AliCorrectionMatrix3D(matrixName, matrixName, 40, -20, 20, 60, -6, 6, 14, binLimitsPt);
+  fTrack2ParticleCorrection = new AliCorrectionMatrix3D(matrixName, matrixName, 40, -20, 20, 20, -2, 2, 15, binLimitsPt);
 
   Float_t binLimitsN[]   = {-0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5,
                            10.5, 12.5, 14.5, 16.5, 18.5, 20.5, 25.5, 30.5, 40.5, 50.5, 100.5, 300.5};
@@ -59,7 +59,6 @@ AlidNdEtaCorrection::AlidNdEtaCorrection(const Char_t* name, const Char_t* title
   fTriggerBiasCorrectionMBToINEL ->SetAxisTitles("vtx z [cm]", "Ntracks");
   fTriggerBiasCorrectionMBToNSD  ->SetAxisTitles("vtx z [cm]", "Ntracks");
   fTriggerBiasCorrectionMBToND   ->SetAxisTitles("vtx z [cm]", "Ntracks");
-
 }
 
 //____________________________________________________________________
index d70a5e0..74e018c 100644 (file)
 
 #include <AliHeader.h>
 #include <AliGenEventHeader.h>
-#include <AliGenPythiaEventHeader.h>
-#include <AliGenCocktailEventHeader.h>
+#include <../PYTHIA6/AliGenPythiaEventHeader.h>
+#include <../EVGEN/AliGenCocktailEventHeader.h>
 
 #include "esdTrackCuts/AliESDtrackCuts.h"
 #include "dNdEta/AlidNdEtaCorrection.h"
 #include "AliPWG0Helper.h"
+#include "AliPWG0depHelper.h"
 
 ClassImp(AlidNdEtaCorrectionSelector)
 
@@ -149,6 +150,26 @@ void AlidNdEtaCorrectionSelector::SlaveBegin(TTree * tree)
   fClustersTPCNeg = new TH1F("clusters_tpc_neg", "clusters_tpc_neg", 160, -0.5, 159.5);
 }
 
+void AlidNdEtaCorrectionSelector::Init(TTree* tree)
+{
+  // read the user objects
+
+  AliSelectorRL::Init(tree);
+
+  // Enable only the needed branches
+  if (tree)
+  {
+    tree->SetBranchStatus("*", 0);
+    tree->SetBranchStatus("fTriggerMask", 1);
+    tree->SetBranchStatus("fSPDVertex*", 1);
+    tree->SetBranchStatus("fTracks.fLabel", 1);
+    tree->SetBranchStatus("fTracks.fITSncls", 1);
+    tree->SetBranchStatus("fTracks.fTPCncls", 1);
+
+    AliESDtrackCuts::EnableNeededBranches(tree);
+  }
+}
+
 Bool_t AlidNdEtaCorrectionSelector::Process(Long64_t entry)
 {
   // The Process() function is called for each entry in the tree (or possibly
@@ -308,7 +329,7 @@ Bool_t AlidNdEtaCorrectionSelector::Process(Long64_t entry)
   }
 
   // getting process information
-  Int_t processtype = AliPWG0Helper::GetPythiaEventProcessType(header);
+  Int_t processtype = AliPWG0depHelper::GetPythiaEventProcessType(header);
   AliDebug(AliLog::kDebug+1,Form(" Found pythia procces type %d", processtype));
 
   if (processtype<0)
index bd2479b..3a5e3a1 100644 (file)
@@ -18,6 +18,7 @@ class AlidNdEtaCorrectionSelector : public AliSelectorRL {
     void ReadUserObjects(TTree* tree);
     virtual void    Begin(TTree *tree);
     virtual void    SlaveBegin(TTree *tree);
+    virtual void    Init(TTree *tree);
     virtual Bool_t  Process(Long64_t entry);
     virtual void    SlaveTerminate();
     virtual void    Terminate();
index f8c7332..1822ed5 100644 (file)
 #include <AliStack.h>
 #include <AliHeader.h>
 #include <AliGenEventHeader.h>
-#include <AliGenPythiaEventHeader.h>
-#include <AliGenCocktailEventHeader.h>
-
+#include <../PYTHIA6/AliGenPythiaEventHeader.h>
+#include <../EVGEN/AliGenCocktailEventHeader.h>
 
 #include "esdTrackCuts/AliESDtrackCuts.h"
 #include "AliPWG0Helper.h"
+#include "AliPWG0depHelper.h"
 #include "dNdEta/AlidNdEtaCorrection.h"
 
 ClassImp(AlidNdEtaSystematicsSelector)
@@ -206,7 +206,7 @@ Bool_t AlidNdEtaSystematicsSelector::Process(Long64_t entry)
     }
 
     // getting process information
-    Int_t processtype = AliPWG0Helper::GetPythiaEventProcessType(header);
+    Int_t processtype = AliPWG0depHelper::GetPythiaEventProcessType(header);
 
     AliDebug(AliLog::kInfo, Form("Pythia process type %d.",processtype));
 
@@ -232,11 +232,11 @@ Bool_t AlidNdEtaSystematicsSelector::Process(Long64_t entry)
       if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[0]->FillEventAll(vtxMC[2], nGoodTracks);
 
       if (eventTriggered) {
-       if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[0]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
-       if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[0]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+        if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[0]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+        if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[0]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
 
-       if (vertexReconstructed)
-         if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[0]->FillEventWithTriggerWithReconstructedVertex(vtxMC[2], nGoodTracks);
+        if (vertexReconstructed)
+          if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[0]->FillEventWithTriggerWithReconstructedVertex(vtxMC[2], nGoodTracks);
       }
     }
 
@@ -245,11 +245,11 @@ Bool_t AlidNdEtaSystematicsSelector::Process(Long64_t entry)
       if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[1]->FillEventAll(vtxMC[2], nGoodTracks);
 
       if (eventTriggered) {
-       if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[1]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
-       if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[1]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+        if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[1]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+        if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[1]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
 
-       if (vertexReconstructed)
-         if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[1]->FillEventWithTriggerWithReconstructedVertex(vtxMC[2], nGoodTracks);
+        if (vertexReconstructed)
+          if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[1]->FillEventWithTriggerWithReconstructedVertex(vtxMC[2], nGoodTracks);
       }
     }
 
@@ -258,11 +258,11 @@ Bool_t AlidNdEtaSystematicsSelector::Process(Long64_t entry)
       if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[2]->FillEventAll(vtxMC[2], nGoodTracks);
 
       if (eventTriggered) {
-       if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[2]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
-       if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[2]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+        if (triggerBiasStudy) fdNdEtaCorrectionTriggerBias[2]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
+        if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[2]->FillEventWithTrigger(vtxMC[2], nGoodTracks);
 
-       if (vertexReconstructed)
-         if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[2]->FillEventWithTriggerWithReconstructedVertex(vtxMC[2], nGoodTracks);
+        if (vertexReconstructed)
+          if (vertexRecoStudy) fdNdEtaCorrectionVertexReco[2]->FillEventWithTriggerWithReconstructedVertex(vtxMC[2], nGoodTracks);
       }
     }
   }
@@ -603,6 +603,14 @@ void AlidNdEtaSystematicsSelector::Terminate()
     fdNdEtaCorrectionSpecies[i] = dynamic_cast<AlidNdEtaCorrection*> (fOutput->FindObject(Form("correction_%d", i)));
   fSigmaVertex = dynamic_cast<TH1F*> (fOutput->FindObject("fSigmaVertex"));
 
+  fdNdEtaCorrectionVertexReco[0] = dynamic_cast<AlidNdEtaCorrection*> (fOutput->FindObject("vertexRecoND"));
+  fdNdEtaCorrectionVertexReco[1] = dynamic_cast<AlidNdEtaCorrection*> (fOutput->FindObject("vertexRecoSD"));
+  fdNdEtaCorrectionVertexReco[2] = dynamic_cast<AlidNdEtaCorrection*> (fOutput->FindObject("vertexRecoDD"));
+
+  fdNdEtaCorrectionTriggerBias[0] = dynamic_cast<AlidNdEtaCorrection*> (fOutput->FindObject("triggerBiasND"));
+  fdNdEtaCorrectionTriggerBias[1] = dynamic_cast<AlidNdEtaCorrection*> (fOutput->FindObject("triggerBiasSD"));
+  fdNdEtaCorrectionTriggerBias[2] = dynamic_cast<AlidNdEtaCorrection*> (fOutput->FindObject("triggerBiasDD"));
+
   if (fPIDParticles)
   {
     TDatabasePDG* pdgDB = new TDatabasePDG;
diff --git a/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.cxx b/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.cxx
deleted file mode 100644 (file)
index 4a4cb2e..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-/* $Id$ */
-
-#include "AlidNdEtaVertexRecEffSelector.h"
-
-#include <TCanvas.h>
-#include <TH1F.h>
-#include <TTree.h>
-#include <TParticle.h>
-#include <TFile.h>
-
-#include <AliLog.h>
-#include <AliGenEventHeader.h>
-#include <AliHeader.h>
-#include <AliESD.h>
-#include <AliESDVertex.h>
-
-#include "AliPWG0Helper.h"
-
-//
-// This class plots the vertex reconstruction efficiency
-// If a vertex was reconstructed is decided by the function CheckVertex()
-// In any case the *generated* multiplicity is filled into the histogram
-//
-
-ClassImp(AlidNdEtaVertexRecEffSelector)
-
-const Float_t AlidNdEtaVertexRecEffSelector::fkEtaRange = 0.9;
-
-AlidNdEtaVertexRecEffSelector::AlidNdEtaVertexRecEffSelector() :
-  AliSelectorRL(),
-  fdNGen(0),
-  fdNRec(0),
-  fVtxGen(0),
-  fVtxRec(0)
-{
-  //
-  // Constructor. Initialization of pointers
-  //
-}
-
-AlidNdEtaVertexRecEffSelector::~AlidNdEtaVertexRecEffSelector()
-{
-  //
-  // Destructor
-  //
-
-  // histograms are in the output list and deleted when the output
-  // list is deleted by the TSelector dtor
-}
-
-void AlidNdEtaVertexRecEffSelector::SlaveBegin(TTree * tree)
-{
-  // initializes the histograms
-
-  AliSelectorRL::SlaveBegin(tree);
-
-  fdNGen = new TH1F("dNGen", "dNGen", 90, 0, 50);
-  fdNRec = dynamic_cast<TH1F*>(fdNGen->Clone("dNRec"));
-
-  fdNGen->SetTitle("Generated Events;dN_{Gen};Count");
-  fdNRec->SetTitle("Events with reconstructed vertex;dN_{Gen};Count");
-  
-  fVtxGen = new TH1F("VtxGen", "VtxGen", 200, -20, 20);
-  fVtxRec = dynamic_cast<TH1F*>(fVtxGen->Clone("VtxRec"));
-}
-
-Bool_t AlidNdEtaVertexRecEffSelector::CheckVertex()
-{
-  //
-  // check if the vertex has been reconstructed well enough
-  //  
-  if (!fESD)
-    return kFALSE;
-
-  const AliESDVertex* vtxESD = fESD->GetVertex();
-
-  // the vertex should be reconstructed
-  if (strcmp(vtxESD->GetName(),"default")==0)
-    return kFALSE;
-
-  Double_t vtxRes[3];
-  vtxRes[0] = vtxESD->GetXRes();
-  vtxRes[1] = vtxESD->GetYRes();
-  vtxRes[2] = vtxESD->GetZRes();
-
-  // the resolution should be reasonable???
-  if (vtxRes[2]==0 || vtxRes[2]>0.1)
-    return kFALSE;
-
-  return kTRUE;
-}
-
-Bool_t AlidNdEtaVertexRecEffSelector::Process(Long64_t entry)
-{
-  //
-  // fills fdNGen and fdNRec
-  //
-
-  if (AliSelectorRL::Process(entry) == kFALSE)
-    return kFALSE;
-
-  // check prerequisites
-  if (!fESD)
-  {
-    AliDebug(AliLog::kError, "ESD branch not available");
-    return kFALSE;
-  }
-
-  AliHeader* header = GetHeader();
-  if (!header)
-  {
-    AliDebug(AliLog::kError, "Header not available");
-    return kFALSE;
-  }
-
-
-  // loop over mc particles
-  TTree* particleTree = GetKinematics();
-  TParticle* particle = 0;
-  particleTree->SetBranchAddress("Particles", &particle);
-
-  Int_t nPrim  = header->GetNprimary();
-  Int_t nTotal = header->GetNtrack();
-
-  Int_t n = 0;
-
-  for (Int_t iMc = nTotal - nPrim; iMc < nTotal; ++iMc)
-  {
-    particleTree->GetEntry(iMc);
-
-    if (!particle)
-      continue;
-
-    if (AliPWG0Helper::IsPrimaryCharged(particle, nPrim) == kFALSE)
-      continue;
-
-    if (TMath::Abs(particle->Eta()) < fkEtaRange)
-      ++n;
-  }// end of mc particle
-
-  Float_t dN = (Float_t) n / (fkEtaRange*2);
-
-  fdNGen->Fill(dN);
-
-  // check vertex reconstruction
-  if (CheckVertex() != kFALSE)
-    fdNRec->Fill(dN);
-
-  AliGenEventHeader* genHeader = header->GenEventHeader();
-
-  TArrayF vtxMC(3);
-  genHeader->PrimaryVertex(vtxMC);
-  
-  fVtxGen->Fill(vtxMC[2]);
-
-  if (CheckVertex() != kFALSE)
-    fVtxRec->Fill(vtxMC[2]);
-
-  return kTRUE;
-}
-
-void AlidNdEtaVertexRecEffSelector::SlaveTerminate()
-{
-  // The SlaveTerminate() function is called after all entries or objects
-  // have been processed. When running with PROOF SlaveTerminate() is called
-  // on each slave server.
-
-  AliSelectorRL::SlaveTerminate();
-
-  // Add the histograms to the output on each slave server
-  if (!fOutput)
-  {
-    AliDebug(AliLog::kError, "ERROR: Output list not initialized");
-    return;
-  }
-
-  fOutput->Add(fdNGen);
-  fOutput->Add(fdNRec);
-  fOutput->Add(fVtxGen);
-  fOutput->Add(fVtxRec);
-}
-
-void AlidNdEtaVertexRecEffSelector::Terminate()
-{
-  // The Terminate() function is the last function to be called during
-  // a query. It always runs on the client, it can be used to present
-  // the results graphically or save the results to file.
-
-  AliSelectorRL::Terminate();
-
-  if (!fOutput)
-  {
-    AliDebug(AliLog::kError, "ERROR: Output list not initialized");
-    return;
-  }
-
-  fdNGen = dynamic_cast<TH1F*> (fOutput->FindObject("dNGen"));
-  fdNRec = dynamic_cast<TH1F*> (fOutput->FindObject("dNRec"));
-  fVtxGen = dynamic_cast<TH1F*> (fOutput->FindObject("VtxGen"));
-  fVtxRec = dynamic_cast<TH1F*> (fOutput->FindObject("VtxRec"));
-  if (!fdNGen || !fdNRec || !fVtxGen || !fVtxRec)
-  {
-    AliDebug(AliLog::kError, Form("ERROR: Histograms not available %p %p %p %p", (void*) fdNGen, (void*) fdNRec, (void*) fVtxGen, (void*) fVtxRec));
-    return;
-  }
-
-  TFile* fout = new TFile("vertexRecEff.root","RECREATE");
-
-  fdNGen->Write();
-  fdNRec->Write();
-
-  fVtxGen->Write();
-  fVtxRec->Write();
-
-  fout->Write();
-  fout->Close();
-
-  TCanvas* canvas = new TCanvas("dN", "dN", 900, 450);
-  canvas->Divide(2, 1);
-
-  canvas->cd(1);
-  fdNGen->Draw();
-  fdNRec->SetLineColor(kRed);
-  fdNRec->Draw("SAME");
-
-  canvas->cd(2);
-  fVtxGen->Draw();
-  fVtxRec->SetLineColor(kRed);
-  fVtxRec->Draw("SAME");
-}
diff --git a/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.h b/PWG0/dNdEta/AlidNdEtaVertexRecEffSelector.h
deleted file mode 100644 (file)
index 48d2455..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* $Id$ */
-
-#ifndef ALIDNDETAVERTEXRECEFFSELECTOR_H
-#define ALIDNDETAVERTEXRECEFFSELECTOR_H
-
-// This class plots the vertex reconstruction efficiency
-
-#include "AliSelectorRL.h"
-
-class TH1F;
-
-class AlidNdEtaVertexRecEffSelector : public AliSelectorRL {
-  public:
-    AlidNdEtaVertexRecEffSelector();
-    virtual ~AlidNdEtaVertexRecEffSelector();
-
-    virtual void    SlaveBegin(TTree *tree);
-    virtual Bool_t  Process(Long64_t entry);
-    virtual void    SlaveTerminate();
-    virtual void    Terminate();
-
- protected:
-    static const Float_t fkEtaRange;
-
-    Bool_t CheckVertex();
-
-    TH1F* fdNGen;  //! generated multiplicity
-    TH1F* fdNRec;  //! generated multiplicity of events with reconstructed vertex
-
-    TH1F* fVtxGen;  //! generated vertex z 
-    TH1F* fVtxRec;  //! generated vertex z of events with reconstructed vertex
-
- private:
-    AlidNdEtaVertexRecEffSelector(const AlidNdEtaVertexRecEffSelector&);
-    AlidNdEtaVertexRecEffSelector& operator=(const AlidNdEtaVertexRecEffSelector&);
-
-  ClassDef(AlidNdEtaVertexRecEffSelector, 0);
-};
-
-#endif
index 7dd18d3..6bd6047 100644 (file)
@@ -128,10 +128,12 @@ void dNdEta(Bool_t onlyESD = kFALSE)
   dummy->SetYTitle("dN_{ch}/d#eta");
   dummy->GetYaxis()->SetTitleOffset(1);
 
-  histESDMBVtx->GetXaxis()->SetRangeUser(-0.7999, 0.7999);
-  histESDMB->GetXaxis()->SetRangeUser(-0.7999, 0.7999);
-  histESD->GetXaxis()->SetRangeUser(-0.7999, 0.7999);
-  histESDNoPt->GetXaxis()->SetRangeUser(-0.7999, 0.7999);
+  Float_t etaLimit = 1.1999;
+
+  histESDMBVtx->GetXaxis()->SetRangeUser(-etaLimit, etaLimit);
+  histESDMB->GetXaxis()->SetRangeUser(-etaLimit, etaLimit);
+  histESD->GetXaxis()->SetRangeUser(-etaLimit, etaLimit);
+  histESDNoPt->GetXaxis()->SetRangeUser(-etaLimit, etaLimit);
 
   dummy->DrawCopy();
   histESDMBVtx->Draw("SAME");
@@ -214,6 +216,11 @@ void dNdEta(Bool_t onlyESD = kFALSE)
   ratio->Draw();
   ratioNoPt->Draw("SAME");
 
+  TLegend* legend = new TLegend(0.6, 0.7, 0.95, 0.9);
+  legend->SetFillColor(0);
+  legend->AddEntry(ratio, "mc/esd");
+  legend->AddEntry(ratioNoPt, "mc/esd, not pt cut off corrected");
+  legend->Draw();
 }
 
 void ptSpectrum()
@@ -581,6 +588,7 @@ void Track2Particle1D(const char* fileName = "correction_map.root", const char*
   pave->Draw();
 
   canvas->SaveAs(Form("Track2Particle1D_etapt_%s_%f.eps", fileName, upperPtLimit));
+  canvas->SaveAs(Form("Track2Particle1D_etapt_%s_%f.gif", fileName, upperPtLimit));
 }
 
 void CompareTrack2Particle1D(Float_t upperPtLimit = 9.9)
index 26a3183..a3e92cb 100644 (file)
@@ -12,7 +12,7 @@ void makeSystematics(Char_t* dataDir, Int_t nRuns=20, Int_t offset = 0, Bool_t d
   if (aProof)
     connectProof("proof01@lxb6046");
 
-  TString libraries("libEG;libGeom;libESD;libPWG0base;libVMC;libMinuit;libSTEER;libPWG0dep;libEVGEN;libFASTSIM;libmicrocern;libpdf;libpythia6;libEGPythia6;libAliPythia6");
+  TString libraries("libEG;libGeom;libESD;libVMC;libMinuit;libSTEER;libEVGEN;libFASTSIM;libmicrocern;libpdf;libpythia6;libEGPythia6;libAliPythia6;libPWG0base;libPWG0dep");
   TString packages("PWG0base;PWG0dep");
 
   if (!prepareQuery(libraries, packages, kTRUE))
index e5b2c40..c68e0c7 100755 (executable)
@@ -1,4 +1,4 @@
-/* $Id$ */
+# /* $Id$ */
 
 # This script runs the dN/dEta analysis with different correction maps to gather systematics
 # It runs with the "normal map", and with 4 other different cases where particle species are enhanced
@@ -10,7 +10,7 @@
 
 function run
 {
-  root -l -q testAnalysis2.C\(\"analysisInput.txt\",10000,0,kFALSE,kFALSE,kTRUE,\"$1\",\"$2\"\)
+  root -l -q testAnalysis2.C\(\"analysisInputMerged.txt\",10000,0,kFALSE,kFALSE,kTRUE,\"$1\",\"$2\"\)
   mv analysis_esd.root $3
 
   if [ "$?" -ne "0" ]
@@ -24,9 +24,41 @@ function run
 
 rm analysis_esd.root
 
+## this runs particle composition study
 #run correction_map.root dndeta_correction systematics_dndeta_reference.root
 #run new_compositions.root KBoosted systematics_dndeta_KBoosted.root
 #run new_compositions.root KReduced systematics_dndeta_KReduced.root
-run new_compositions.root pBoosted systematics_dndeta_pBoosted.root
-run new_compositions.root pReduced systematics_dndeta_pReduced.root
+#run new_compositions.root pBoosted systematics_dndeta_pBoosted.root
+#run new_compositions.root pReduced systematics_dndeta_pReduced.root
 
+## this runs vertex reco study
+
+#run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vertexreco_pythia systematics_vtxreco_pythia.root
+#run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vertexreco_ddmore systematics_vtxreco_ddmore.root
+#run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vertexreco_ddless systematics_vtxreco_ddless.root
+#run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vertexreco_sdmore systematics_vtxreco_sdmore.root
+#run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vertexreco_sdless systematics_vtxreco_sdless.root
+#run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vertexreco_dmore systematics_vtxreco_dmore.root
+#run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vertexreco_dless systematics_vtxreco_dless.root
+
+
+## this runs trigger bias study
+
+#run systematics_vtxtrigger_compositions.root dndeta_correction_syst_trigger_pythia systematics_trigger_pythia.root
+#run systematics_vtxtrigger_compositions.root dndeta_correction_syst_trigger_ddmore systematics_trigger_ddmore.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_trigger_ddless systematics_trigger_ddless.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_trigger_sdmore systematics_trigger_sdmore.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_trigger_sdless systematics_trigger_sdless.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_trigger_dmore systematics_trigger_dmore.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_trigger_dless systematics_trigger_dless.root
+
+
+## this runs trigger bias and vertex reco study
+
+#run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vtxtrigger_pythia systematics_vtxtrigger_pythia.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vtxtrigger_ddmore systematics_vtxtrigger_ddmore.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vtxtrigger_ddless systematics_vtxtrigger_ddless.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vtxtrigger_sdmore systematics_vtxtrigger_sdmore.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vtxtrigger_sdless systematics_vtxtrigger_sdless.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vtxtrigger_dmore systematics_vtxtrigger_dmore.root
+run systematics_vtxtrigger_compositions.root dndeta_correction_syst_vtxtrigger_dless systematics_vtxtrigger_dless.root
index 752e06b..d0d58c6 100644 (file)
 #include "../CreateESDChain.C"
 #include "../PWG0Helper.C"
 
-void testAnalysis2(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kFALSE, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, const char* correctionMapFile = "correction_map.root", const char* correctionMapFolder = "dndeta_correction", const char* option = "")
+void testAnalysis2(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kFALSE, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, const char* correctionMapFile = "correction_map.root", const char* correctionMapFolder = "dndeta_correction", const char* option = "", const char* proofServer = "jgrosseo@lxb6046")
 {
   if (aProof)
-    connectProof("proof01@lxb6046");
+    connectProof(proofServer);
 
   TString libraries("libEG;libGeom;libESD;libPWG0base");
   TString packages("PWG0base");
   if (aMC != kFALSE)
   {
-    libraries += ";libVMC;libMinuit;libSTEER;libPWG0dep;libEVGEN;libFASTSIM;libmicrocern;libpdf;libpythia6;libEGPythia6;libAliPythia6";
+    libraries += ";libVMC;libMinuit;libSTEER;libEVGEN;libFASTSIM;libmicrocern;libpdf;libpythia6;libEGPythia6;libAliPythia6;libPWG0dep";
     packages += ";PWG0dep";
   }
 
@@ -33,19 +33,21 @@ void testAnalysis2(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kF
 
   TChain* chain = CreateESDChain(data, nRuns, offset);
 
-  // selection of esd tracks
-  AliESDtrackCuts* esdTrackCuts = CreateTrackCuts();
-  if (!esdTrackCuts)
-  {
-    printf("ERROR: esdTrackCuts could not be created\n");
-    return;
-  }
 
   TList inputList;
-  inputList.Add(esdTrackCuts);
 
   if (aMC == kFALSE)
   {
+    // selection of esd tracks
+    AliESDtrackCuts* esdTrackCuts = CreateTrackCuts();
+    if (!esdTrackCuts)
+    {
+      printf("ERROR: esdTrackCuts could not be created\n");
+      return;
+    }
+
+    inputList.Add(esdTrackCuts);
+
     AlidNdEtaCorrection* dNdEtaCorrection = new AlidNdEtaCorrection(correctionMapFolder, correctionMapFolder);
     dNdEtaCorrection->LoadHistograms(correctionMapFile, correctionMapFolder);
     dNdEtaCorrection->ReduceInformation();
@@ -58,7 +60,7 @@ void testAnalysis2(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aMC = kF
   TString selectorName = ((aMC == kFALSE) ? "AlidNdEtaAnalysisESDSelector" : "AlidNdEtaAnalysisMCSelector");
   AliLog::SetClassDebugLevel(selectorName, AliLog::kInfo);
 
-  selectorName += ".cxx++";
+  selectorName += ".cxx+";
 
   if (aDebug != kFALSE)
     selectorName += "g";
index 0b7d564..75458b8 100644 (file)
@@ -1,7 +1,6 @@
 # $Id$
 
-HDRS = AliSelector.h \
-      dNdEta/dNdEtaAnalysis.h \
+HDRS = dNdEta/dNdEtaAnalysis.h \
       dNdEta/AlidNdEtaCorrection.h \
       esdTrackCuts/AliESDtrackCuts.h \
       AliCorrectionMatrix.h \
@@ -13,6 +12,6 @@ SRCS = $(HDRS:.h=.cxx)
 
 DHDR= PWG0baseLinkDef.h
 
-EINCLUDE=
+EINCLUDE= 
 
 all-PWG0: all-PWG0base all-PWG0selectors all-PWG0dep
index d015c7c..24e7950 100644 (file)
@@ -2,10 +2,10 @@
 
 # this library contains classed that depend on STEER
 
-HDRS = AliSelectorRL.h
+HDRS = AliPWG0depHelper.h
 
 SRCS = $(HDRS:.h=.cxx)
 
 DHDR= PWG0depLinkDef.h
 
-EINCLUDE=
+EINCLUDE= EVGEN PYTHIA6
index aa2439e..cf20add 100644 (file)
@@ -6,10 +6,10 @@
 HDRS = dNdEta/AlidNdEtaCorrectionSelector.h \
        dNdEta/AlidNdEtaAnalysisMCSelector.h \
        dNdEta/AlidNdEtaAnalysisESDSelector.h \
-       dNdEta/AlidNdEtaVertexRecEffSelector.h \
        dNdEta/AliMultiplicityESDSelector.h \
        dNdEta/AliMultiplicityMCSelector.h \
-       dNdEta/AlidNdEtaSystematicsSelector.h
+       dNdEta/AlidNdEtaSystematicsSelector.h \
+       esdTrackCuts/AliTestESDtrackCutsSelector.h
 
 SRCS = $(HDRS:.h=.cxx)