Working on the electron cut
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Feb 2012 15:59:28 +0000 (15:59 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Feb 2012 15:59:28 +0000 (15:59 +0000)
PWGLF/SPECTRA/ChargedHadrons/multPbPb/AliAnalysisMultPbTrackHistoManager.cxx
PWGLF/SPECTRA/ChargedHadrons/multPbPb/AliAnalysisMultPbTrackHistoManager.h
PWGLF/SPECTRA/ChargedHadrons/multPbPb/AliAnalysisTaskMultPbTracks.cxx
PWGLF/SPECTRA/ChargedHadrons/multPbPb/AliAnalysisTaskMultPbTracks.h
PWGLF/SPECTRA/ChargedHadrons/multPbPb/CreateAlienHandler.C
PWGLF/SPECTRA/ChargedHadrons/multPbPb/run.C
PWGLF/SPECTRA/ChargedHadrons/multPbPb/run.sh

index 01833ab26fef7ad019a0d0472389b974bcd6d4e6..b14964664ecf3902c875c042754698ccf7b134d5 100644 (file)
@@ -6,9 +6,11 @@
 #include "TROOT.h"
 #include "TMCProcess.h"
 #include "AliMCParticle.h"
-
+#include "TMap.h"
 #include <iostream>
 #include "TH2D.h"
+#include "TDatabasePDG.h"
+#include "TParameter.h"
 
 using namespace std;
 
@@ -22,12 +24,12 @@ const char * AliAnalysisMultPbTrackHistoManager::kHistoPrefix[]     = { "hGen",
 const char * AliAnalysisMultPbTrackHistoManager::kSpeciesName[]     = { "pi+", "K+", "p", "l+",  "pi-", "K-", "barp", "l-", "Others"};
 
 
-AliAnalysisMultPbTrackHistoManager::AliAnalysisMultPbTrackHistoManager() : AliHistoListWrapper(), fHNameSuffix(""){ 
+AliAnalysisMultPbTrackHistoManager::AliAnalysisMultPbTrackHistoManager() : AliHistoListWrapper(), fHNameSuffix(""), fParticleSpecies(0)
   // standard ctor
 
 }
 
-AliAnalysisMultPbTrackHistoManager::AliAnalysisMultPbTrackHistoManager(const char * name, const char * title): AliHistoListWrapper(name,title), fHNameSuffix("")  {
+AliAnalysisMultPbTrackHistoManager::AliAnalysisMultPbTrackHistoManager(const char * name, const char * title): AliHistoListWrapper(name,title), fHNameSuffix(""), fParticleSpecies(0)  {
   //named ctor
 };
 
@@ -41,6 +43,26 @@ AliAnalysisMultPbTrackHistoManager::~AliAnalysisMultPbTrackHistoManager() {
 
 }
 
+TH2D * AliAnalysisMultPbTrackHistoManager::GetHistoElectronCutQA() {
+  // Get a p vs dE/dx plot, to check the histos we are rejecting
+  TString name = "histoElectronCutQA";
+
+  TH2D * h = (TH2D*) GetHisto(name);
+  
+  if (!h) {
+    AliInfo(Form("Booking %s", (name+fHNameSuffix).Data()));    
+    Bool_t oldStatus = TH1::AddDirectoryStatus();
+    TH1::AddDirectory(kFALSE);
+    h = new TH2D (name+fHNameSuffix, name+fHNameSuffix, 100, 0, 3, 50, 0, 200);
+    fList->Add(h);
+    TH1::AddDirectory(oldStatus);
+
+  }
+
+  return h;
+}
+
+
 TH3D * AliAnalysisMultPbTrackHistoManager::GetHistoPtEtaVz(Histo_t id, Int_t particle) {
   // Returns a 3D histo of Pt/eta/vtx. It it does not exist, books it.
 
@@ -489,9 +511,8 @@ TH3D * AliAnalysisMultPbTrackHistoManager::BookHistoPtEtaVz(const char * name, c
   h->SetZTitle("V_{z}^{tracks} (cm)");
   h->Sumw2();
   
-  fList->Add(h);
-
   TH1::AddDirectory(oldStatus);
+  fList->Add(h);
   return h;
 }
 
@@ -620,6 +641,22 @@ Int_t AliAnalysisMultPbTrackHistoManager::GetLocalParticleID(AliMCParticle * par
 }
 
 
+void AliAnalysisMultPbTrackHistoManager::FillSpeciesMap(Int_t pdgCode) {
+
+  // Fills map of species vs ID
+  if(!fParticleSpecies) fParticleSpecies = new TMap;
+  
+  TObjString * key = new TObjString(Form("%s",TDatabasePDG::Instance()->GetParticle(pdgCode)->GetName()));
+  TParameter<Long64_t>* count = dynamic_cast<TParameter<Long64_t>*> (fParticleSpecies->GetValue(key));
+  if (!count)
+  {
+    count = new TParameter<Long64_t>(key->String().Data(), 0);
+    fParticleSpecies->Add(key, count);
+  }
+  count->SetVal(count->GetVal() + 1);
+
+}
+
  
 Long64_t AliAnalysisMultPbTrackHistoManager::Merge(TCollection* list)
 {
@@ -630,10 +667,8 @@ Long64_t AliAnalysisMultPbTrackHistoManager::Merge(TCollection* list)
   // the same order. We thus also have to sort the list (sorting is
   // done by name in TList).
 
-  //  AliInfo("Merging");
-
+  AliInfo("Merging");
   if (!list)
-    return 0;
 
   if (list->IsEmpty())
     return 1;
@@ -647,13 +682,57 @@ Long64_t AliAnalysisMultPbTrackHistoManager::Merge(TCollection* list)
   Int_t count = 0;
 
   while ((obj = iter->Next())) {
-    Bool_t foundDiffinThisIterStep = kFALSE;
+    cout << "1" << endl;
+    //    AliHistoListWrapper* entry = dynamic_cast<AliHistoListWrapper*> (obj);
+    AliAnalysisMultPbTrackHistoManager* entry = dynamic_cast<AliAnalysisMultPbTrackHistoManager*> (obj);
+    cout << "2 " << endl;
+    if (entry == 0) 
+      continue;
+    cout << "3 " << entry->GetName() << endl;
 
-    //    Printf("%d - %s",count, obj->GetName());
-    AliHistoListWrapper* entry = dynamic_cast<AliHistoListWrapper*> (obj);
+    // Merge map fParticleSpecies        
+    if(!entry->fParticleSpecies){
+      AliInfo("Cannot get fParticleSpecies");
+      continue;
+    }
+    TIterator* iter2 = entry->fParticleSpecies->MakeIterator();
+    TObjString* obj2 = 0;
+    cout << "4" << endl;
+    while ((obj2 = dynamic_cast<TObjString*> (iter2->Next())))
+    {
+      cout << "5" << endl;
+      TParameter<Long64_t>* param2 = static_cast<TParameter<Long64_t>*> (entry->fParticleSpecies->GetValue(obj2));
+      
+      TParameter<Long64_t>* param1 = dynamic_cast<TParameter<Long64_t>*> (fParticleSpecies->GetValue(obj2));
+      cout << " - (other)" << param2->GetName() << " " << param2->GetVal();
+      if (param1)
+      {
+       cout << " (this) " << param1->GetName() << " " << param1->GetVal() << endl;
+        param1->SetVal(param1->GetVal() + param2->GetVal());
+      }
+      else
+      {
+       cout << "" << endl;     
+        param1 = dynamic_cast<TParameter<Long64_t>*> (param2->Clone());
+        fParticleSpecies->Add(new TObjString(obj2->String()), param1);
+      }
+    }    
+    delete iter2;
+
+  }
+
+  // merge histograms
+  // We need a separate loop as this one could be restarted if needed.
+  iter->Reset();
+  while ((obj = iter->Next())) {
+    AliAnalysisMultPbTrackHistoManager* entry = dynamic_cast<AliAnalysisMultPbTrackHistoManager*> (obj);
     if (entry == 0) 
       continue;
 
+    Bool_t foundDiffinThisIterStep = kFALSE;
+
+    //    Printf("%d - %s",count, obj->GetName());
+
     TList * hlist = entry->GetList();
 
     // Check if all histos in this fList are also in the one from entry and viceversa
@@ -758,5 +837,7 @@ Long64_t AliAnalysisMultPbTrackHistoManager::Merge(TCollection* list)
   
   delete iter;
 
+  AliInfo("Merged");
+
   return count+1;
 }
index bde7afffba977cf977bbada18a2660531ef0ae4b..386efaf0df8db80f8abe601919c739e9d13158f0 100644 (file)
@@ -8,6 +8,7 @@ class TH3D;
 class TH1D;
 class TH1I;
 class AliMCParticle;
+class TMap;
 
 //#define WEIGHTED_DCA
 #define TRANSVERSE_DCA
@@ -64,11 +65,16 @@ public:
   TH1D * GetHistoPtEvent(Histo_t id);
   TH1D * GetHistoMeanPt (Histo_t id);
 
+  TH2D * GetHistoElectronCutQA();
+
+  TMap * GetParticleSpecies(){return fParticleSpecies;}
 
   // Misch utils
   void ScaleHistos (Double_t nev, Option_t * option="");
   Int_t GetLocalParticleID(AliMCParticle * part);
   void FillParticleID(Histo_t id, AliMCParticle * part) { GetHistoSpecies(id)->Fill(GetLocalParticleID(part));}
+  void FillSpeciesMap(Int_t pdgCode);
+
 
   // Histo bookers
   TH3D * BookHistoPtEtaVz(const char * name, const char * title);
@@ -79,7 +85,7 @@ public:
   // 
   TH1 * GetHisto(const char * name);
 
-  virtual void Print(Option_t* option = "") const {fList->Print();}
+  virtual void Print(Option_t* option = "") const {fList->Print(option);}
 
 
   Long64_t Merge(TCollection* list); // need to override this because of the mean pts
@@ -92,10 +98,12 @@ private:
   static const char * kHistoPrefix[];   // prefix for histo names // FIXME: remove the others and keep only this 
   static const char * kSpeciesName[];   // Particle species
   TString fHNameSuffix; // Suffix added to all histo names. Useful if you have in the same session e.g. MC and data.
+  
+  TMap * fParticleSpecies;// Map assiciating PDG code to number of particles in the physical primary sample.
 
   AliAnalysisMultPbTrackHistoManager& operator=(const AliAnalysisMultPbTrackHistoManager& task);
   
-  ClassDef(AliAnalysisMultPbTrackHistoManager, 3)
+  ClassDef(AliAnalysisMultPbTrackHistoManager, 4)
 
 
 };
index 5ac73641fca410018386011d82cf9045e1d7782b..ac97265ef1e2fcfeacb3332e90dea785993b9429 100644 (file)
@@ -30,7 +30,7 @@ ClassImp(AliAnalysisTaskMultPbTracks)
 
 AliAnalysisTaskMultPbTracks::AliAnalysisTaskMultPbTracks()
 : AliAnalysisTaskSE("TaskMultPbTracks"),
-  fESD(0),fHistoManager(0),fCentrSelector(0),fTrackCuts(0),fTrackCutsNoDCA(0),fOfflineTrigger(0), fIsMC(0),fIsTPCOnly(0), fTriggerAnalysis(0),fPIDResponse(0)
+  fESD(0),fHistoManager(0),fCentrSelector(0),fTrackCuts(0),fTrackCutsNoDCA(0),fOfflineTrigger(0), fIsMC(0),fIsTPCOnly(0), fTriggerAnalysis(0),fPIDResponse(0),fRejectElectrons(0)
 {
   // constructor
 
@@ -44,7 +44,7 @@ AliAnalysisTaskMultPbTracks::AliAnalysisTaskMultPbTracks()
 }
 AliAnalysisTaskMultPbTracks::AliAnalysisTaskMultPbTracks(const char * name)
   : AliAnalysisTaskSE(name),
-    fESD(0),fHistoManager(0),fCentrSelector(0),fTrackCuts(0),fTrackCutsNoDCA(0),fOfflineTrigger(0),fIsMC(0),fIsTPCOnly(0), fTriggerAnalysis(0),fPIDResponse(0)
+    fESD(0),fHistoManager(0),fCentrSelector(0),fTrackCuts(0),fTrackCutsNoDCA(0),fOfflineTrigger(0),fIsMC(0),fIsTPCOnly(0), fTriggerAnalysis(0),fPIDResponse(0),fRejectElectrons(0)
 {
   //
   // Standard constructur which should be used
@@ -60,7 +60,7 @@ AliAnalysisTaskMultPbTracks::AliAnalysisTaskMultPbTracks(const char * name)
 }
 
 AliAnalysisTaskMultPbTracks::AliAnalysisTaskMultPbTracks(const AliAnalysisTaskMultPbTracks& obj) : 
-  AliAnalysisTaskSE(obj) ,fESD (0), fHistoManager(0), fCentrSelector(0), fTrackCuts(0),fTrackCutsNoDCA(0),fOfflineTrigger(0),fIsMC(0),fIsTPCOnly(0), fTriggerAnalysis(0),fPIDResponse(0)
+  AliAnalysisTaskSE(obj) ,fESD (0), fHistoManager(0), fCentrSelector(0), fTrackCuts(0),fTrackCutsNoDCA(0),fOfflineTrigger(0),fIsMC(0),fIsTPCOnly(0), fTriggerAnalysis(0),fPIDResponse(0),fRejectElectrons(0)
 {
   //copy ctor
   fESD = obj.fESD ;
@@ -110,6 +110,11 @@ void AliAnalysisTaskMultPbTracks::UserCreateOutputObjects()
   AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
   fPIDResponse = inputHandler->GetPIDResponse();
 
+  PostData(1,fHistoManager);
+  PostData(2,fTrackCuts);
+  PostData(3,fCentrSelector);
+
+
 }
 
 
@@ -201,8 +206,14 @@ void AliAnalysisTaskMultPbTracks::UserExec(Option_t *)
        // We don't care about neutrals and non-physical primaries
        if(mcPart->Charge() == 0) continue;
 
-       //check if current particle is a physical primary
+       // If we are cutting away electrons, also exclude them here:
+       if(fRejectElectrons) 
+         if (TMath::Abs(mcPart->PdgCode())==11) continue;
+
+       //check if current particle is a physical primary and fill map of physical primaries
        if(!IsPhysicalPrimaryAndTransportBit(ipart)) continue;
+       fHistoManager->FillSpeciesMap(mcPart->PdgCode());
+
        if(TMath::Abs(mcPart->Zv()-zvGen)>1e-6) {
          // This cures a bug in Hijing
          // A little hack here: I put those in the underflow bin of the process type to keep track of them
@@ -297,19 +308,17 @@ void AliAnalysisTaskMultPbTracks::UserExec(Option_t *)
     Bool_t accepted = fTrackCuts->AcceptTrack(esdTrack);
     Bool_t acceptedNoDCA = fTrackCutsNoDCA->AcceptTrack(esdTrack);
 
-    // accepted = accepted && ((fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kElectron) > 2) ||
-    //                             (fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kPion    ) < 1) || 
-    //                             (fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kProton  ) < 1) || 
-    //                             (fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kKaon    ) < 1) 
-    //                             //                      (esdTrack->P() > 1.2)
-    //                             );//FIXME SKIP ELECTRONS below p = 1.2 gev, make configurable. Keep particles if they are in the crossing
+    //fHistoManager->GetHistoElectronCutQA()->Fill(esdTrack->Pt(), esdTrack->GetTPCsignal()); FIXME: temporary hack
 
-    // acceptedNoDCA = acceptedNoDCA && ((fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kElectron) > 2) ||
-    //                                       (fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kPion    ) < 1) || 
-    //                                       (fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kProton  ) < 1) || 
-    //                                       (fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kKaon    ) < 1) 
-    //                                       //                                      (esdTrack->P() > 1.2)
-    //                                       );//FIXME SKIP ELECTRONS below p = 1.2 gev, make configurable. Keep particles if they are in the crossing
+    if(fRejectElectrons && acceptedNoDCA) { // don't check this for tracks to be anyways rejected
+      Bool_t isEl = IsElectron(esdTrack);
+      if(isEl) {
+       //      cout << " --> FOUND!" << endl;  
+       fHistoManager->GetHistoElectronCutQA()->Fill(esdTrack->Pt(), esdTrack->GetTPCsignal());
+      }
+      accepted = accepted && !isEl;
+      acceptedNoDCA = acceptedNoDCA && !isEl;
+    }
 
     if(accepted) acceptedTracks++;
 
@@ -391,7 +400,9 @@ void AliAnalysisTaskMultPbTracks::UserExec(Option_t *)
                partCode == AliAnalysisMultPbTrackHistoManager::kPartKPlus   || 
                partCode == AliAnalysisMultPbTrackHistoManager::kPartKMinus  ||
                partCode == AliAnalysisMultPbTrackHistoManager::kPartP       || 
-               partCode == AliAnalysisMultPbTrackHistoManager::kPartPBar  
+               partCode == AliAnalysisMultPbTrackHistoManager::kPartPBar    ||
+               partCode == AliAnalysisMultPbTrackHistoManager::kPartLPlus   || 
+               partCode == AliAnalysisMultPbTrackHistoManager::kPartKMinus 
                )
              fHistoManager->GetHistoPtEtaVz(AliAnalysisMultPbTrackHistoManager::kHistoRecPrim, partCode);
          }
@@ -481,6 +492,25 @@ Bool_t AliAnalysisTaskMultPbTracks::IsPhysicalPrimaryAndTransportBit(Int_t ipart
 
 }
 
+Bool_t AliAnalysisTaskMultPbTracks::IsElectron(AliESDtrack * esdTrack) {
+  Bool_t isElectron = kFALSE;
+    // ((fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kElectron) < 2 ) &&
+    //  (fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kPion    ) > 1 ) && 
+    //  (fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kProton  ) > 1 ) && 
+    //  (fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kKaon    ) > 1 ) 
+    //  );//FIXME SKIP ELECTRONS below p = 1.2 gev, make configurable. Keep particles if they are in the crossing
+
+  // cout << " - TPC: " << fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kElectron) << ", TOF: " << fPIDResponse->NumberOfSigmasTOF(esdTrack,AliPID::kElectron);
+  // printf("[%f,%f,%d]\n", esdTrack->Pt(), esdTrack->Eta(), esdTrack->GetTPCclusters(0));  
+  // if (fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kElectron) <0){
+
+    
+  // } 
+  isElectron = (TMath::Abs(fPIDResponse->NumberOfSigmasTPC(esdTrack,AliPID::kElectron)) < 2) && (TMath::Abs(fPIDResponse->NumberOfSigmasTOF(esdTrack,AliPID::kElectron) < 3));
+
+  return isElectron;
+}
+
 // void AliAnalysisTaskEvil::PrintProcInfo()
 // {
 //   ProcInfo_t info;
index 6b959293c5769a1d803dcb49964bb78571776b19..b2f32a9fdd23de529be196bb8734790d57d8ab84 100644 (file)
@@ -38,6 +38,8 @@ public:
   void SetIsMC(Bool_t flag=kTRUE) { fIsMC = flag;}
   AliAnalysisMultPbTrackHistoManager * GetHistoManager() { return fHistoManager;}
   Bool_t IsPhysicalPrimaryAndTransportBit(Int_t ipart) ;
+  Bool_t IsElectron(AliESDtrack *  esdTrack);
+  void RejectElectrons(Bool_t rejElectron) { fRejectElectrons = rejElectron;}
   void SetOfflineTrigger(UInt_t mask) { fOfflineTrigger = mask; }
 
   virtual void   UserCreateOutputObjects();
@@ -62,7 +64,7 @@ private:
   Bool_t fIsTPCOnly; // if you only want to use TPC tracks
   AliTriggerAnalysis * fTriggerAnalysis; // for offline triggers
   AliPIDResponse *fPIDResponse;     //! PID response object
-
+  Bool_t fRejectElectrons; // reject electrons
 
   AliAnalysisTaskMultPbTracks& operator=(const AliAnalysisTaskMultPbTracks& task);
   
index 8b6859798b0593db27243025c6a7c87c5c9d4a08..a48964f671a564418de8534714813935b7c9cc7a 100644 (file)
 
-AliAnalysisGrid* CreateAlienHandler(TString dataset, TList * listToLoad, const char * mode = "full", Bool_t isMC = 0)
+AliAnalysisGrid* CreateAlienHandler(TString dataset, const char * runList, const char * suffix, TList * listToLoad, const char * mode = "full", Bool_t isMC = 0)
 {
   
+  TGrid::Connect("alien:"); // Connecto to alien
 
-// Check if user has a valid token, otherwise make one. This has limitations.
-// One can always follow the standard procedure of calling alien-token-init then
-//   source /tmp/gclient_env_$UID in the current shell.
-//   if (!AliAnalysisGrid::CreateToken()) return NULL;
-  TGrid::Connect("alien:");
-
-   AliAnalysisAlien *plugin = new AliAnalysisAlien();
-// Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
-   plugin->SetRunMode(mode);
-   //plugin->SetRunMode("test");
-// Set versions of used packages
-   plugin->SetAPIVersion("V1.1x");
-   plugin->SetROOTVersion("v5-27-06-2");
-   plugin->SetAliROOTVersion("v4-21-03-AN");
-// Declare input data to be processed.
-// Method 1: Create automatically XML collections using alien 'find' command.
-// Define production directory LFN
-// LHC09d
-// /alice/data/2009/LHC09d/000104892/ESDs/pass6/
-   plugin->SetGridDataDir(dataset);
-// Set data search pattern
-   plugin->SetDataPattern("AliESDs.root");
-// ...then add run numbers to be considered
-//   plugin->AddRunNumber(104892);
-//   plugin->AddRunNumber(300001);
-// 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())
-// XML collections added via this method can be combined with the first method if
-// the content is compatible (using or not tags)
-   // plugin->AddDataFile("tag.xml");
-   // plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root");
-// Define alien work directory where all files will be copied. Relative to alien $HOME.
-   TString output = "MultPb/Output_";
-   dataset.ReplaceAll("/","_");
-   output += dataset;
-   plugin->SetGridWorkingDir(output.Data());
-// Declare alien output directory. Relative to working directory.
-   plugin->SetGridOutputDir("out"); 
-// Declare the analysis source files names separated by blancs. To be compiled runtime
-// using ACLiC on the worker nodes.
-   TIterator * iter = listToLoad->MakeIterator();
-   TObjString * name = 0;
-   TString sources = "";
-   // while (name = (TObjString *)iter->Next()) {
-   //   gSystem->ExpandPathName(name->String());
-   //   name->String().ReplaceAll("+","");
-   //   sources = sources + name->String() + " ";
-   // }
-   while (name = (TObjString *)iter->Next()) {
+  AliAnalysisAlien * handler = new AliAnalysisAlien("test");
+  // input
+  handler->SetGridDataDir(dataset);
+  handler->AddRunNumber(runList);
+  if(dataset.Contains("sim")) handler->SetDataPattern("*AliESDs.root");
+  else handler->SetDataPattern("*pass2/*AliESDs.root");
+  handler->SetAnalysisMacro("MultPb.C");
+  handler->SetJDLName("MultPb.jdl");
+  handler->SetAdditionalRootLibs("libCore libTree libGeom libVMC libPhysics libSTEERBase libESD libAOD libANALYSIS libOADB libANALYSISalice");   
+  handler->SetRunMode(mode);
+  TIterator * iter = listToLoad->MakeIterator();
+  TObjString * name = 0;
+  TString sources = "";
+  TString sourcescxxOnly = "";
+  while (name = (TObjString *)iter->Next()) {
      gSystem->ExpandPathName(name->String());
      name->String().ReplaceAll("+","");     
      sources = sources + gSystem->BaseName(name->String().Data()) + " ";
+     TString header = gSystem->BaseName(name->String().Data());
+     header.ReplaceAll("cxx","h");
+     sources = sources + header.Data() + " ";
+     if(name->String().Contains("cxx")) sourcescxxOnly = sourcescxxOnly + gSystem->BaseName(name->String().Data()) + " ";
    }
-   plugin->SetAnalysisSource(sources.Data());
-// 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("AliCollisionsNormalization.cxx AliCollisionNormalizationTask.cxx AliPhysicsSelection.cxx AliCollisionsNormalization.h AliCollisionNormalizationTask.h AliPhysicsSelection.h");
-   // iter = listToLoad->MakeIterator();
-   // name = 0;
-   // sources = "";
-   // while (name = (TObjString *)iter->Next()) {
-   //   gSystem->ExpandPathName(name->String());
-   //   name->String().ReplaceAll("+","");     
-   //   sources = sources + gSystem->BaseName(name->String().Data()) + " ";
-   // }
-   // while (name = (TObjString *)iter->Next()) {
-   //   gSystem->ExpandPathName(name->String());
-   //   name->String().ReplaceAll("+","");
-   //   sources = sources + name->String() + " ";
-   // }
-   plugin->SetAdditionalLibs(sources.Data());
-   // I'm using a modified ANALYSISalice package, so I need to load par files for everything
-   // plugin->EnablePackage("STEERBase");
-   // plugin->EnablePackage("ESD");
-   // plugin->EnablePackage("AOD");
-   // plugin->EnablePackage("CORRFW");
-   // plugin->EnablePackage("ANALYSIS");
-   // plugin->EnablePackage("ANALYSISalice");
+  handler->SetAnalysisSource(sourcescxxOnly.Data());
+  handler->SetAdditionalLibs(sources.Data());   
+
+  // Alirootversion
+  //VO_ALICE@GEANT3::v1-12  
+  handler->SetAPIVersion("V1.1x");
+  handler->SetROOTVersion   ("v5-30-03-1")    ;
+  handler->SetAliROOTVersion("v5-02-12-AN") ;
+
+  // output
+  TString runs = runList;
+  runs.ReplaceAll(" ","_");
+  handler->SetGridWorkingDir(TString("MultPbPb_") + gSystem->BaseName(dataset)+suffix+"_"+runs);
+  handler->SetGridOutputDir("out");
+  //  handler->SetOutputFiles("sec.root");
+  handler->SetMergeExcludes("sec.root EventStat_temp.root event_stat.root multPbPbtracks.root"); // don't merge files; FIXME: if processing many bin, the name of files not to be merged should be changed
+
+  return handler;
 
-// Declare the output file names separated by blancs.
-// (can be like: file.root or file.root@ALICE::Niham::File)
-//   plugin->SetDefaultOutputs(kFALSE);
-   //   plugin->SetOutputFiles(Form("EventStat_temp.root %s",outfilename));
-   //   plugin->SetOutputFiles("EventStat_temp.root multPbPbtracks.root");
-// Optionally define the files to be archived.
-//   plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:*.root@ALICE::NIHAM::File");
-//   plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
-// Optionally set a name for the generated analysis macro (default MyAnalysis.C)
-   plugin->SetAnalysisMacro("AnalysisMultPb.C");
-// Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
-   plugin->SetSplitMaxInputFileNumber(100);
-// Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
-   plugin->SetMaxInitFailed(5);
-// Optionally resubmit threshold.
-   plugin->SetMasterResubmitThreshold(90);
-// Optionally set time to live (default 30000 sec)
-   plugin->SetTTL(30000);
-// Optionally set input format (default xml-single)
-   plugin->SetInputFormat("xml-single");
-// Optionally modify the name of the generated JDL (default analysis.jdl)
-   plugin->SetJDLName("TaskMultPb.jdl");
-// Optionally modify job price (default 1)
-   plugin->SetPrice(1);      
-// Optionally modify split mode (default 'se')    
-   plugin->SetSplitMode("se");
-   return plugin;
 }
index fe6cb62d751e0e6a55e56af408f61942f4aeed72..86368017efc13472b31848a9b94baa4470e40e10 100644 (file)
@@ -3,7 +3,7 @@
 // 2. Run with many centrality bins at once
 #include <string.h>
 
-enum { kMyRunModeLocal = 0, kMyRunModeCAF, kMyRunModeGRID};
+enum { kMyRunModeLocal = 0, kMyRunModeCAF, kMyRunModeGRID, kMyRunModeProofLite};
 
 TList * listToLoad = new TList();
 
@@ -11,7 +11,7 @@ TChain * GetAnalysisChain(const char * incollection);
 
 void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kFALSE, Int_t runMode = 0, Bool_t isMC = 0, 
         Int_t centrBin = 0, const char * centrEstimator = "VOM", Int_t useOtherCentralityCut = 0, Int_t trackMin=0, Int_t trackMax=10000, 
-        const char* option = "",TString customSuffix = "", Int_t workers = -1, Bool_t useSingleBin=kTRUE)
+        const char* option = "",TString customSuffix = "", Int_t workers = -1, Bool_t useSingleBin=kTRUE, const char * runList = 0)
 {
   // runMode:
   //
@@ -39,11 +39,64 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
   }
 
 
+
+  // Parse option strings
+  TString optionStr(option);
+  
+  // remove SAVE option if set
+  // This  is copied from a macro by Jan. The reason I kept it is that I may want to pass textual options to the new task at some point
+  Bool_t doSave = kFALSE;
+  TString optionStr(option);
+  if (optionStr.Contains("SAVE"))
+    {
+      optionStr = optionStr(0,optionStr.Index("SAVE")) + optionStr(optionStr.Index("SAVE")+4, optionStr.Length());
+      doSave = kTRUE;
+    }
+
+  AliESDtrackCuts * cuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kFALSE);  
+  TString pathsuffix = "";
+
+  if(!useSingleBin) pathsuffix += "_AllCentr";
+
+  if (optionStr.Contains("DCA")) {
+    delete cuts;
+    //    cuts = AliESDtrackCuts::GetStandardITSPureSATrackCuts2009();
+    cout << ">>>> USING DCA cut" << endl;
+    cuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();  
+    cuts->SetMaxChi2TPCConstrainedGlobal(); // remove golden cut
+    pathsuffix+="_DCAcut";
+  }
+
+  if (optionStr.Contains("ITSsa")) {
+    delete cuts;
+    cuts = AliESDtrackCuts::GetStandardITSPureSATrackCuts2009();
+    cout << ">>>> USING ITS sa tracks" << endl;
+    pathsuffix+="_ITSsa";
+  }
+
+  if (optionStr.Contains("TPC")) {
+    delete cuts;
+    cuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+    cout << ">>>> USING TPC only tracks" << endl;
+    pathsuffix+="_TPC";
+  }
+
+  if(optionStr.Contains("NoElectrons")) pathsuffix +="_NoElectrons";
+
+
+
+  Bool_t useMCKinematics = isMC;
+  if (optionStr.Contains("NOMCKIN")) {
+    cout << ">>>> Ignoring MC kinematics" << endl;
+    useMCKinematics=kFALSE;
+    pathsuffix+="_NOMCKIN";
+  }
+  
   // If we are running on grid, we need the alien handler
   if (runMode == kMyRunModeGRID) {
     // Create and configure the alien handler plugin
     gROOT->LoadMacro("CreateAlienHandler.C");
-    AliAnalysisGrid *alienHandler = CreateAlienHandler(data, listToLoad, "full", isMC);  
+    AliAnalysisGrid *alienHandler = CreateAlienHandler(data, runList, pathsuffix.Data(), listToLoad, "full", isMC);  // full
     if (!alienHandler) {
       cout << "Cannot create alien handler" << endl;    
       exit(1);
@@ -53,6 +106,7 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
 
 
 
+  // Add tasks
   // physics selection
   gROOT->ProcessLine(".L $ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
   physicsSelectionTask = AddTaskPhysicsSelection(isMC);
@@ -61,25 +115,21 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
   gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
   AddTaskPIDResponse(isMC); 
 
+  // // PID QA:
+  // gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C");
+  // AddTaskPIDqa();
+
 
   // Centrality
-  AliCentralitySelectionTask *taskCentr = new AliCentralitySelectionTask("CentralitySelection");
+  gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
+  AliCentralitySelectionTask *taskCentr = AddTaskCentrality();
+  // OBSOLETE
   const char * file1 = "$ALICE_ROOT/ANALYSIS/macros/test_AliCentralityBy1D.root";
   const char * file2 = "$ALICE_ROOT/ANALYSIS/macros/test_AliCentralityByFunction.root";
+  // END of OBSOLETE
   if(isMC) taskCentr-> SetMCInput();
   taskCentr->SetPass(2);
 
-  // const char * file1 = "$ALICE_ROOT/ANALYSIS/macros/AliCentralityBy1D_LHC10g2a_100.root";
-  // const char * file2 = "$ALICE_ROOT/ANALYSIS/macros/AliCentralityByFunction_LHC10g2a_100.root";
-  // const char * file1 = "$ALICE_ROOT/ANALYSIS/macros/AliCentralityBy1D_137161_GLAU.root";
-  // const char * file2 = "$ALICE_ROOT/ANALYSIS/macros/test_AliCentralityByFunction.root";
-  
-  // taskCentr->SetPercentileFile (file1);
-  // taskCentr->SetPercentileFile2(file2);
-  //FIXME: include back centrality estimator
-  mgr->AddTask(taskCentr);
-  mgr->ConnectInput (taskCentr,0, mgr->GetCommonInputContainer());
-
   // Create my own centrality selector
   AliAnalysisMultPbCentralitySelector * centrSelector = new AliAnalysisMultPbCentralitySelector();
   centrSelector->SetIsMC(isMC);
@@ -88,7 +138,6 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
   if (!useSingleBin) centrSelector->SetCentralityBin(0); // FIXME: ok?
   centrSelector->SetCentralityEstimator(centrEstimator);
 
-  
   if(useOtherCentralityCut == 1){
     cout << "Setting centrality by MULT" << endl;
     centrSelector->SetUseMultRange();
@@ -106,56 +155,6 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
     centrSelector->SetMultRange(trackMin,trackMax);
   }
 
-  // Parse option strings
-  TString optionStr(option);
-  
-  // remove SAVE option if set
-  // This  is copied from a macro by Jan. The reason I kept it is that I may want to pass textual options to the new task at some point
-  Bool_t doSave = kFALSE;
-  TString optionStr(option);
-  if (optionStr.Contains("SAVE"))
-    {
-      optionStr = optionStr(0,optionStr.Index("SAVE")) + optionStr(optionStr.Index("SAVE")+4, optionStr.Length());
-      doSave = kTRUE;
-    }
-
-  AliESDtrackCuts * cuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kFALSE);  
-  TString pathsuffix = "";
-
-  if(!useSingleBin) pathsuffix += "_AllCentr";
-
-  if (optionStr.Contains("DCA")) {
-    delete cuts;
-    //    cuts = AliESDtrackCuts::GetStandardITSPureSATrackCuts2009();
-    cout << ">>>> USING DCA cut" << endl;
-    cuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kFALSE);  
-    pathsuffix+="_DCAcut";
-  }
-
-  if (optionStr.Contains("ITSsa")) {
-    delete cuts;
-    cuts = AliESDtrackCuts::GetStandardITSPureSATrackCuts2009();
-    cout << ">>>> USING ITS sa tracks" << endl;
-    pathsuffix+="_ITSsa";
-  }
-
-  if (optionStr.Contains("TPC")) {
-    delete cuts;
-    cuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
-    cout << ">>>> USING TPC only tracks" << endl;
-    pathsuffix+="_TPC";
-  }
-
-  Bool_t useMCKinematics = isMC;
-  if (optionStr.Contains("NOMCKIN")) {
-    cout << ">>>> Ignoring MC kinematics" << endl;
-    useMCKinematics=kFALSE;
-    pathsuffix+="_NOMCKIN";
-  }
-  
-  AliLog::SetClassDebugLevel("AliESDtrackCuts", AliLog::kDebug);// FIXME
-  cuts->DefineHistograms();
-  
   // load my task
   if (useSingleBin) {
     gROOT->ProcessLine(".L $ALICE_ROOT/PWG0/multPbPb/AddTaskMultPbPbTracks.C");
@@ -163,6 +162,7 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
     task->SetIsMC(useMCKinematics);
     task->SetOfflineTrigger(AliVEvent::kMB);
     if(optionStr.Contains("TPC")) task->SetTPCOnly();
+    if(optionStr.Contains("NoElectrons")) task->RejectElectrons(kTRUE);
     if(useMCKinematics) task->GetHistoManager()->SetSuffix("MC");
     if(customSuffix!=""){
       cout << "Setting custom suffix: " << customSuffix << endl;    
@@ -183,6 +183,7 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
       tasks[icentr]->SetIsMC(useMCKinematics);
       tasks[icentr]->SetOfflineTrigger(AliVEvent::kMB);
       if(optionStr.Contains("TPC")) tasks[icentr]->SetTPCOnly();
+      if(optionStr.Contains("NoElectrons")) task[icentr]->RejectElectrons(kTRUE);
       if(useMCKinematics) tasks[icentr]->GetHistoManager()->SetSuffix("MC");
       if(customSuffix!=""){
        cout << "Setting custom suffix: " << customSuffix+long(icentr) << endl;    
@@ -199,9 +200,13 @@ void run(Char_t* data, Long64_t nev = -1, Long64_t offset = 0, Bool_t debug = kF
     // If running in local mode, create chain of ESD files
     cout << "RUNNING LOCAL, CHAIN" << endl;    
     TChain * chain = GetAnalysisChain(data);
-    //    chain->Print();
+    chain->Print();
     mgr->StartAnalysis("local",chain,nev);
-  } else if (runMode == kMyRunModeCAF) {
+  } else if (runMode == kMyRunModeProofLite) {
+    TChain * chain = GetAnalysisChain(data);
+    mgr->StartAnalysis("proof",chain,nev);
+  } 
+  else if (runMode == kMyRunModeCAF) {
     mgr->StartAnalysis("proof",TString(data)+"#esdTree",nev);
   } else if (runMode == kMyRunModeGRID) {
     mgr->StartAnalysis("grid");
@@ -283,11 +288,14 @@ void InitAndLoadLibs(Int_t runMode=kMyRunModeLocal, Int_t workers=0,Bool_t debug
   // Loads libs and par files + custom task and classes
 
   // Custom stuff to be loaded
-  listToLoad->Add(new TObjString("$ALICE_ROOT/ANALYSIS/AliCentralitySelectionTask.cxx+"));
-  listToLoad->Add(new TObjString("$ALICE_ROOT/PWGPP/background/AliHistoListWrapper.cxx+"));
-  listToLoad->Add(new TObjString("$ALICE_ROOT/PWG0/multPbPb/AliAnalysisMultPbTrackHistoManager.cxx+"));
-  listToLoad->Add(new TObjString("$ALICE_ROOT/PWG0/multPbPb/AliAnalysisMultPbCentralitySelector.cxx+"));
-  listToLoad->Add(new TObjString("$ALICE_ROOT/PWG0/multPbPb/AliAnalysisTaskMultPbTracks.cxx+"));
+  //  listToLoad->Add(new TObjString("$ALICE_ROOT/ANALYSIS/AliCentralitySelectionTask.cxx+"));
+  listToLoad->Add(new TObjString("/Users/mfloris/Work/AliSoft/AliRoot-trunk/PWGPP/background/AliHistoListWrapper.cxx+")); // FIXME
+  listToLoad->Add(new TObjString("AliAnalysisMultPbTrackHistoManager.cxx+"));
+  listToLoad->Add(new TObjString("AliAnalysisMultPbCentralitySelector.cxx+"));
+  listToLoad->Add(new TObjString("AliAnalysisTaskMultPbTracks.cxx+"));
+  // listToLoad->Add(new TObjString("$ALICE_ROOT/PWG0/multPbPb/AliAnalysisMultPbTrackHistoManager.cxx+"));
+  // listToLoad->Add(new TObjString("$ALICE_ROOT/PWG0/multPbPb/AliAnalysisMultPbCentralitySelector.cxx+"));
+  // listToLoad->Add(new TObjString("$ALICE_ROOT/PWG0/multPbPb/AliAnalysisTaskMultPbTracks.cxx+"));
 
 
   if (runMode == kMyRunModeCAF)
@@ -295,18 +303,20 @@ void InitAndLoadLibs(Int_t runMode=kMyRunModeLocal, Int_t workers=0,Bool_t debug
       cout << "Init in CAF mode" << endl;
     
       gEnv->SetValue("XSec.GSI.DelegProxy", "2");
+      //      TProof::Mgr("alice-caf.cern.ch")->SetROOTVersion("VO_ALICE@ROOT::v5-30-03-1");
+      TProof::Mgr("alice-caf.cern.ch")->SetROOTVersion("current");
       TProof * p = TProof::Open("alice-caf.cern.ch", workers>0 ? Form("workers=%d",workers) : "1x");
       //      TProof * p = TProof::Open("skaf.saske.sk", workers>0 ? Form("workers=%d",workers) : "");    
       p->Exec("TObject *o = gEnv->GetTable()->FindObject(\"Proof.UseMergers\"); gEnv->GetTable()->Remove(o);", kTRUE);
 
-      TProof::Mgr("alice-caf.cern.ch")->SetROOTVersion("VO_ALICE@ROOT::v5-28-00f");
-      //      TProof::Mgr("alice-caf.cern.ch")->SetROOTVersion("5.28/00f");
-      gProof->EnablePackage("VO_ALICE@AliRoot::v4-21-33-AN");
+      //      TProof::Mgr("alice-caf.cern.ch")->SetROOTVersion("VO_ALICE@ROOT::v5-28-00f");
+      gProof->EnablePackage("VO_ALICE@AliRoot::v5-02-12-AN");
       gSystem->Load("libCore.so");  
       gSystem->Load("libTree.so");
       gSystem->Load("libGeom.so");
       gSystem->Load("libVMC.so");
       gSystem->Load("libPhysics.so");
+      gSystem->Load("libMinuit");
       gSystem->Load("libSTEERBase");
       gSystem->Load("libESD");
       gSystem->Load("libAOD");
@@ -329,8 +339,24 @@ void InitAndLoadLibs(Int_t runMode=kMyRunModeLocal, Int_t workers=0,Bool_t debug
       // gProof->EnablePackage("$ALICE_ROOT/obj/ANALYSISalice");
       // gProof->UploadPackage("$ALICE_ROOT/obj/PWG0base");
       // gProof->EnablePackage("$ALICE_ROOT/obj/PWG0base");
-      gROOT->ProcessLine(gSystem->ExpandPathName(".include $ALICE_ROOT/PWG0/multPb"));
-      gROOT->ProcessLine(gSystem->ExpandPathName(".include $ALICE_ROOT/PWGPP/background"));
+      // gROOT->ProcessLine(gSystem->ExpandPathName(".include $ALICE_ROOT/include"));
+      // gROOT->ProcessLine(gSystem->ExpandPathName(".include $ALICE_ROOT/PWG0/multPb"));
+      // gROOT->ProcessLine(gSystem->ExpandPathName(".include $ALICE_ROOT/PWG1/background"));
+    }
+  else if (runMode == kMyRunModeProofLite)
+    {
+      cout << "Init in CAF mode" << endl;
+    
+      gEnv->SetValue("XSec.GSI.DelegProxy", "2");
+      TProof * p = TProof::Open("");
+      //      TProof * p = TProof::Open("skaf.saske.sk", workers>0 ? Form("workers=%d",workers) : "");    
+      //      p->Exec("TObject *o = gEnv->GetTable()->FindObject(\"Proof.UseMergers\"); gEnv->GetTable()->Remove(o);", kTRUE);
+
+      //      TProof::Mgr("alice-caf.cern.ch")->SetROOTVersion("VO_ALICE@ROOT::v5-28-00f");
+      //      TProof::Mgr("alice-caf.cern.ch")->SetROOTVersion("5.28/00f");
+      gProof->UploadPackage("$ALICE_ROOT/ANALYSIS/macros/AliRootProofLite.par");
+      gProof->EnablePackage("AliRootProofLite");
+
     }
   else
     {
@@ -340,6 +366,7 @@ void InitAndLoadLibs(Int_t runMode=kMyRunModeLocal, Int_t workers=0,Bool_t debug
       gSystem->Load("libGeom.so");
       gSystem->Load("libVMC.so");
       gSystem->Load("libPhysics.so");
+      gSystem->Load("libMinuit");
       gSystem->Load("libSTEERBase");
       gSystem->Load("libESD");
       gSystem->Load("libAOD");
@@ -368,7 +395,7 @@ void InitAndLoadLibs(Int_t runMode=kMyRunModeLocal, Int_t workers=0,Bool_t debug
   while (name = (TObjString *)iter->Next()) {
     gSystem->ExpandPathName(name->String());
     cout << name->String().Data();
-    if (runMode == kMyRunModeCAF) {
+    if (runMode == kMyRunModeCAF || runMode == kMyRunModeProofLite) {
       gProof->Load(name->String()+(debug?"+g":""));   
     } else {
       gROOT->LoadMacro(name->String()+(debug?"+g":""));   
index a99096d2a8da4d6e4b2791bf08564dad4b6a34d0..63147644d99f43734834986c5370eb3c1d7e108a 100755 (executable)
@@ -45,19 +45,22 @@ Available options:
                                Modes [default=$runmode]:
                                   0 local
                                   1 caf    
-                                  2 grid    
+                                  2 grid    (remeber to set run list)
+                                  3 prooflite
   -c <data,mc>                 Run the correction data and MC are names of the folders. 
                                ./output/ is added automatically in front of the folder names
   -s                           Run the trigger study task (by default it runs the multiplicity analysis)
  Proof settings
   -w nworkers                  Set the number of worker nodes (0 == 1 worker per node)
-  -n <nev>                     Number of events to be analized 
+  -n <nev>                     Number of events to be analized
+ Grid Settings
+  -u <runs>                    Runs to be processed in the data folder
  Misc
   -d <dataset>                 Dataset or data collection (according to run mode) [default=$dataset]
                                 - local mode: a single ESD file, an xml collection of files on 
                                   grid or a text file with a ESD per line
                                 - caf mode: a dataset
-                                - grid mode: a directory on alien
+                                - grid mode: a directory on alien (don't forget the run list)
   -h                           This help
  Options specific to the multiplicity analysis
   -l                           Run over all centrality bins
@@ -68,6 +71,8 @@ Available options:
                                 - ITSsa:    Use ITSsa tracks
                                 - TPC:      Use TPC only tracks
                                 - NOMCKINE: Skip MC kinematics (runs way faster)
+                                - NoElectrons: apply cuts to reject electrons in the rec sample, 
+                                  exclude electrons by PDG code in the MC sample
                                 * == can be used in trigger studies task
   -t <option>                  Command line option for root [defaul=$ropt]
   -m                           Use this to run on Monte Carlo
@@ -109,7 +114,7 @@ ENDOFGUIDE
 
 }
 
-while getopts "x:sr:c:gmd:o:w:n:e:b:t:k:vy:0:2:hz:a:lp:" opt; do
+while getopts "x:sr:c:gmd:o:w:n:e:b:t:k:vy:0:2:hz:a:lp:u:" opt; do
   case $opt in
     r)
       run=yes
@@ -117,7 +122,10 @@ while getopts "x:sr:c:gmd:o:w:n:e:b:t:k:vy:0:2:hz:a:lp:" opt; do
       ;;      
     l)
       useSingleBin=kFALSE
-      ;;      
+      ;;
+    u) 
+      runList=$OPTARG
+      ;;
     y)
       useTrackCentralityCut=1
       trackMin=${OPTARG%%,*}
@@ -220,7 +228,7 @@ if [ "$run" = "yes" ]
        then
        root $ropt runTriggerStudy.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$ntrackletsTrigger,$rejectBGV0Trigger,\"$option\",$workers\)
     else
-       root $ropt run.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$centrBin,\"$centrEstimator\",$useTrackCentralityCut,$trackMin,$trackMax,\"$option\",\"$customSuffix\",$workers,$useSingleBin\)
+       root $ropt run.C\(\"$dataset\",$nev,$offset,$debug,$runmode,$isMC,$centrBin,\"$centrEstimator\",$useTrackCentralityCut,$trackMin,$trackMax,\"$option\",\"$customSuffix\",$workers,$useSingleBin,\"$runList\"\)
     fi
 fi