]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG0/multiplicity/run.C
- ESDfilter moved from PWG0base to ANALYSISalice
[u/mrichter/AliRoot.git] / PWG0 / multiplicity / run.C
index 1e3305d581b6b1d77f0d1f3b4f73eb116bea9d06..fc7b08fbb8998edc270375e0995dfdf907ebaea4 100644 (file)
@@ -1,4 +1,4 @@
-void run(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, const char* option = "")
+void run(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, Bool_t mc = kTRUE, const char* option = "")
 {
   if (aProof)
   {
@@ -15,8 +15,6 @@ void run(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, B
     gProof->EnablePackage("ANALYSIS");
     gProof->UploadPackage("PWG0base");
     gProof->EnablePackage("PWG0base");
-
-    //gProof->AddInput(new TNamed("PROOF_Packetizer", "TPacketizer"));
   }
   else
   {
@@ -24,7 +22,6 @@ void run(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, B
     gSystem->Load("libTree");
     gSystem->Load("libSTEERBase");
     gSystem->Load("libESD");
-    gSystem->Load("libAOD");
     gSystem->Load("libANALYSIS");
     gSystem->Load("libPWG0base");
   }
@@ -55,14 +52,21 @@ void run(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, B
   } else
     gROOT->Macro(taskName);
 
-  task = new AliMultiplicityTask;
+  task = new AliMultiplicityTask(option);
   task->SetTrackCuts(esdTrackCuts);
+  task->SetAnalysisMode(AliMultiplicityTask::kSPD);
+
+  if (mc)
+    task->SetReadMC();
+
   mgr->AddTask(task);
 
-  // Enable MC event handler
-  AliMCEventHandler* handler = new AliMCEventHandler;
-  handler->SetReadTR(kFALSE);
-  //mgr->SetMCtruthEventHandler(handler);
+  if (mc) {
+    // Enable MC event handler
+    AliMCEventHandler* handler = new AliMCEventHandler;
+    handler->SetReadTR(kFALSE);
+    mgr->SetMCtruthEventHandler(handler);
+  }
 
   // Add ESD handler
   AliESDInputHandler* esdH = new AliESDInputHandler;
@@ -86,11 +90,3 @@ void run(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, B
   mgr->PrintStatus();
   mgr->StartAnalysis((aProof) ? "proof" : "local", chain);
 }
-
-void runAll()
-{
-  run("part1.txt", 1000000, 0, kFALSE, kTRUE);
-  gSystem->Exec("mv multiplicityMC.root multiplicityMC_1.root");
-  run("part2.txt", 1000000, 0, kFALSE, kTRUE);
-  gSystem->Exec("mv multiplicityMC.root multiplicityMC_2.root");
-}