]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG0/dNdEta/AlidNdEtaCorrectionSelector.cxx
RICH becomes HMPID
[u/mrichter/AliRoot.git] / PWG0 / dNdEta / AlidNdEtaCorrectionSelector.cxx
index ca90821cf20164918afa580d65d3b13e7372469b..74e018cf1e67014461b335f4e7ec46a2d52bc235 100644 (file)
 #include <TFile.h>
 
 #include <AliLog.h>
-#include <AliGenEventHeader.h>
 #include <AliTracker.h>
-#include <AliHeader.h>
 #include <AliESDVertex.h>
 #include <AliESD.h>
 #include <AliESDtrack.h>
 #include <AliRunLoader.h>
 #include <AliStack.h>
 
+#include <AliHeader.h>
+#include <AliGenEventHeader.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)
 
@@ -146,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
@@ -166,6 +190,9 @@ Bool_t AlidNdEtaCorrectionSelector::Process(Long64_t entry)
   //  Assuming that fTree is the pointer to the TChain being processed,
   //  use fTree->GetTree()->GetEntry(entry).
 
+  AliDebug(AliLog::kDebug+1,"Processing event ...\n");
+
+
   if (AliSelectorRL::Process(entry) == kFALSE)
     return kFALSE;
 
@@ -230,16 +257,12 @@ Bool_t AlidNdEtaCorrectionSelector::Process(Long64_t entry)
     Float_t eta = particle->Eta();
     Float_t pt = particle->Pt();
 
-    if (vertexReconstructed)
-    {
+    if (vertexReconstructed) {
       fdNdEtaCorrection->FillParticle(vtxMC[2], eta, pt);
+
       if (pt > 0.1 && pt < 0.2)
-        fPIDParticles->Fill(particle->GetPdgCode());
+       fPIDParticles->Fill(particle->GetPdgCode());
     }
-
-    fdNdEtaCorrection->FillParticleAllEvents(eta, pt);
-    if (eventTriggered)
-      fdNdEtaCorrection->FillParticleWhenEventTriggered(eta, pt);
   }// end of mc particle
 
   // ########################################################
@@ -282,8 +305,8 @@ Bool_t AlidNdEtaCorrectionSelector::Process(Long64_t entry)
     {
       fdNdEtaCorrection->FillParticleWhenMeasuredTrack(vtxMC[2], particle->Eta(), particle->Pt());
       if (particle->Pt() > 0.1 && particle->Pt() < 0.2)
-      {
-        fPIDTracks->Fill(particle->GetPdgCode());
+       {
+         fPIDTracks->Fill(particle->GetPdgCode());
         if (particle->GetPDG()->Charge() > 0)
         {
           fClustersITSPos->Fill(esdTrack->GetITSclusters(0));
@@ -298,14 +321,28 @@ Bool_t AlidNdEtaCorrectionSelector::Process(Long64_t entry)
     }
   } // end of track loop
 
-  fdNdEtaCorrection->FillEvent(vtxMC[2], nGoodTracks);
-  if (eventTriggered)
-  {
+  // stuff regarding the vertex reco correction and trigger bias correction
+  if (eventTriggered) {
     fdNdEtaCorrection->FillEventWithTrigger(vtxMC[2], nGoodTracks);
     if (vertexReconstructed)
       fdNdEtaCorrection->FillEventWithTriggerWithReconstructedVertex(vtxMC[2], nGoodTracks);
   }
 
+  // getting process information
+  Int_t processtype = AliPWG0depHelper::GetPythiaEventProcessType(header);
+  AliDebug(AliLog::kDebug+1,Form(" Found pythia procces type %d", processtype));
+
+  if (processtype<0)
+    AliDebug(AliLog::kError, Form("Unkown Pythia process type %d.", processtype));
+  
+  fdNdEtaCorrection->FillEventAll(vtxMC[2], nGoodTracks, "INEL");
+  
+  if (processtype!=92 && processtype!=93)
+    fdNdEtaCorrection->FillEventAll(vtxMC[2], nGoodTracks, "NSD");
+  
+  if (processtype!=92 && processtype!=93 && processtype!=94)
+    fdNdEtaCorrection->FillEventAll(vtxMC[2], nGoodTracks, "ND");
+
   return kTRUE;
 }