update to AliTRDpwg1Helper class by Markus
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Aug 2010 13:20:23 +0000 (13:20 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 Aug 2010 13:20:23 +0000 (13:20 +0000)
18 files changed:
EVE/EveDet/AliEveTRDTrackList.cxx
PWG1/TRD/AliTRDinfoGen.cxx
PWG1/TRD/AliTRDpwg1Helper.cxx
PWG1/TRD/AliTRDpwg1Helper.h
PWG1/TRD/macros/AddTRDcheckDET.C
PWG1/TRD/macros/AddTRDcheckESD.C
PWG1/TRD/macros/AddTRDcheckPID.C
PWG1/TRD/macros/AddTRDefficiency.C
PWG1/TRD/macros/AddTRDinfoGen.C
PWG1/TRD/macros/AddTRDresolution.C
PWG1/TRD/macros/AddTRDv0Monitor.C
PWG1/TRD/macros/AliTRDperformanceTrain.h [deleted file]
PWG1/TRD/macros/helper.C [deleted file]
PWG1/TRD/macros/makeCalibResults.C
PWG1/TRD/macros/makeResults.C
PWG1/TRD/macros/mergeResults.C
PWG1/TRD/run.C
PWG1/macros/AddTrainPerformanceTRD.C

index bc88e7d..68450f3 100644 (file)
@@ -78,7 +78,7 @@
 #include <EveDet/AliEveTRDTrackListEditor.h>
 
 #include <../PWG1/TRD/AliTRDrecoTask.h>
-#include <../PWG1/TRD/macros/AliTRDperformanceTrain.h>
+#include <../PWG1/TRD/AliTRDpwg1Helper.h>
 
 ClassImp(AliEveTRDTrackList)
 
@@ -264,7 +264,7 @@ void AliEveTRDTrackList::AddStandardContent()
 {
   // Adds standard macros to the macro list.
 
-  // Add your standard macros here, e.g.: 
+  // Add your standard macros here, e.g.:
   // To add a macro use:
   // AddMacro("$(ALICE_ROOT)/myFolder", "myMacroName.C");
   // -> If the file does not exist, nothing happens. So if you want to handle this,
@@ -279,10 +279,19 @@ void AliEveTRDTrackList::AddStandardContent()
     return;
   }
 
-  AliTRDrecoTask *task = 0x0;
-  TList *fPlots = 0x0;
-  for(Int_t it=2; it<NTRDQATASKS; it++){
-    TClass c(fgkTRDtaskClassName[it]);
+  const Char_t *fgkTRDPWG1taskClassName[AliTRDpwg1Helper::kNTRDQATASKS] = {
+    "AliTRDcheckESD"
+    ,"AliTRDinfoGen"
+    ,"AliTRDcheckDET"
+    ,"AliTRDefficiency"
+    ,"AliTRDresolution"
+    ,"AliTRDcheckPID"
+    ,"AliTRDv0Monitor"
+  };
+  AliTRDrecoTask *task(NULL);
+  TList *fPlots(NULL);
+  for(Int_t it=2; it<AliTRDpwg1Helper::kNTRDQATASKS; it++){
+    TClass c(fgkTRDPWG1taskClassName[it]);
     task = (AliTRDrecoTask*)c.New();
     task->SetMCdata(kFALSE);
     if(!(fPlots = task->GetPlotFunctors())){
@@ -297,7 +306,7 @@ void AliEveTRDTrackList::AddStandardContent()
     }
 
     // export task to CINT and add functions
-    gROOT->ProcessLine(Form("%s* %s = (%s*)%p;", fgkTRDtaskClassName[it], task->GetName(), fgkTRDtaskClassName[it], (void*)task));
+    gROOT->ProcessLine(Form("%s* %s = (%s*)%p;", fgkTRDPWG1taskClassName[it], task->GetName(), fgkTRDPWG1taskClassName[it], (void*)task));
     TIter iter(fPlots); TMethodCall *m = 0x0;
     while((m = dynamic_cast<TMethodCall*>(iter()))){
       AddMacroFast("", Form("%s->%s", task->GetName(), m->GetMethodName()), kSingleTrackHisto);
@@ -305,6 +314,7 @@ void AliEveTRDTrackList::AddStandardContent()
   }
 }
 
+
 //______________________________________________________
 Bool_t AliEveTRDTrackList::ApplyProcessMacros(const TList* selIterator, const TList* procIterator)
 {
index 85b5542..c4e6b88 100644 (file)
 #include "AliTRDseedV1.h"
 #include "AliTRDcluster.h"
 #include "AliTRDinfoGen.h"
+#include "AliTRDpwg1Helper.h"
 #include "info/AliTRDtrackInfo.h"
 #include "info/AliTRDeventInfo.h"
 #include "info/AliTRDv0Info.h"
 #include "info/AliTRDeventCuts.h"
-#include "macros/AliTRDperformanceTrain.h"
 
 ClassImp(AliTRDinfoGen)
 
@@ -153,12 +153,12 @@ AliTRDinfoGen::AliTRDinfoGen(char* name)
   // Default constructor
   //
   SetTitle("MC-REC TRD-track list generator");
-  DefineOutput(kTracksBarrel, TObjArray::Class());
-  DefineOutput(kTracksSA, TObjArray::Class());
-  DefineOutput(kTracksKink, TObjArray::Class());
-  DefineOutput(kEventInfo, AliTRDeventInfo::Class());
-  DefineOutput(kV0List, TObjArray::Class());
-  DefineOutput(kMonitor, TObjArray::Class()); // histogram list
+  DefineOutput(AliTRDpwg1Helper::kTracksBarrel, TObjArray::Class());
+  DefineOutput(AliTRDpwg1Helper::kTracksSA, TObjArray::Class());
+  DefineOutput(AliTRDpwg1Helper::kTracksKink, TObjArray::Class());
+  DefineOutput(AliTRDpwg1Helper::kEventInfo, AliTRDeventInfo::Class());
+  DefineOutput(AliTRDpwg1Helper::kV0List, TObjArray::Class());
+  DefineOutput(AliTRDpwg1Helper::kMonitor, TObjArray::Class()); // histogram list
 }
 
 //____________________________________________________________________
@@ -242,7 +242,7 @@ void AliTRDinfoGen::UserCreateOutputObjects()
   ax->SetBinLabel(11, "Kink");
   ax->SetBinLabel(12, "KinkMC");
   fContainer->AddAt(h, 0);
-  PostData(kMonitor, fContainer);
+  PostData(AliTRDpwg1Helper::kMonitor, fContainer);
 }
 
 //____________________________________________________________________
@@ -678,11 +678,11 @@ void AliTRDinfoGen::UserExec(Option_t *){
   h->Fill(10., nKink);
   h->Fill(11., nKinkMC);
 
-  PostData(kTracksBarrel, fTracksBarrel);
-  PostData(kTracksSA, fTracksSA);
-  PostData(kTracksKink, fTracksKink);
-  PostData(kEventInfo, fEventInfo);
-  PostData(kV0List, fV0List);
+  PostData(AliTRDpwg1Helper::kTracksBarrel, fTracksBarrel);
+  PostData(AliTRDpwg1Helper::kTracksSA, fTracksSA);
+  PostData(AliTRDpwg1Helper::kTracksKink, fTracksKink);
+  PostData(AliTRDpwg1Helper::kEventInfo, fEventInfo);
+  PostData(AliTRDpwg1Helper::kV0List, fV0List);
 }
 
 //____________________________________________________________________
index e53a935..187fee3 100644 (file)
@@ -11,7 +11,7 @@
 
 #include "AliTRDpwg1Helper.h"
 
-Char_t const* AliTRDpwg1Helper::fgkTRDtaskClassName[AliTRDpwg1Helper::kNTRDTASKS] = {
+const Char_t * AliTRDpwg1Helper::fgkTRDtaskClassName[AliTRDpwg1Helper::kNTRDTASKS] = {
   "AliTRDcheckESD"
   ,"AliTRDinfoGen"
   ,"AliTRDcheckDET"
@@ -27,7 +27,7 @@ Char_t const* AliTRDpwg1Helper::fgkTRDtaskClassName[AliTRDpwg1Helper::kNTRDTASKS
   ,"AliTRDmultiplicity"
 };
 
-Char_t const* AliTRDpwg1Helper::fgkTRDtaskOpt[AliTRDpwg1Helper::kNTRDTASKS+1] = {
+const Char_t * AliTRDpwg1Helper::fgkTRDtaskOpt[AliTRDpwg1Helper::kNTRDTASKS+1] = {
   "ESD"
   ,"GEN"
   ,"DET"
index dec8816..4119bf9 100644 (file)
@@ -2,49 +2,50 @@
 #define ALITRDPWG1HELPER_H
 
 class AliTRDpwg1Helper{
-  public:
-    enum ETRDinfoGenOutSlots {
-      kEventInfo     = 1
-      ,kTracksBarrel  = 2
-      ,kTracksSA      = 3
-      ,kTracksKink    = 4
-      ,kV0List        = 5
-      ,kMonitor       = 6
-      ,kNOutSlots     = 7
-    };
+public:
+  enum ETRDinfoGenOutSlots {
+    kEventInfo     = 1
+    ,kTracksBarrel  = 2
+    ,kTracksSA      = 3
+    ,kTracksKink    = 4
+    ,kV0List        = 5
+    ,kMonitor       = 6
+    ,kNOutSlots     = 7
+  };
 
-    enum ETRDrecoTasks{
-      kCheckESD      = 0
-      ,kInfoGen       = 1
-      ,kCheckDET      = 2
-      ,kEfficiency    = 3
-      ,kResolution    = 4
-      ,kCheckPID      = 5
-      ,kV0Monitor     = 6 
-      ,kCalibration   = 7
-      ,kEfficiencyMC  = 8
-      ,kAlignment     = 9
-      ,kPIDRefMaker   =10
-      ,kClErrParam    =11
-      ,kMultiplicity  =12
-    };
+  enum ETRDrecoTasks{
+    kCheckESD      = 0
+    ,kInfoGen       = 1
+    ,kCheckDET      = 2
+    ,kEfficiency    = 3
+    ,kResolution    = 4
+    ,kCheckPID      = 5
+    ,kV0Monitor     = 6
+    ,kCalibration   = 7
+    ,kEfficiencyMC  = 8
+    ,kAlignment     = 9
+    ,kPIDRefMaker   =10
+    ,kClErrParam    =11
+    ,kMultiplicity  =12
+  };
 
-    enum{
-      kNTRDQATASKS = 7,
-      kNTRDCALIBTASKS = 6,
-      kNTRDTASKS = kNTRDQATASKS + kNTRDCALIBTASKS
-    };
-    static const Char_t * fgkTRDtaskClassName[kNTRDTASKS];
-    static const Char_t * fgkTRDtaskOpt[kNTRDTASKS + 1];
+  enum{
+    kNTRDQATASKS = 7,
+    kNTRDCALIBTASKS = 6,
+    kNTRDTASKS = kNTRDQATASKS + kNTRDCALIBTASKS
+  };
+  static const Char_t * fgkTRDtaskOpt[kNTRDTASKS + 1];
+  static const Char_t * fgkTRDtaskClassName[kNTRDTASKS];
 
-    static Int_t  GetTaskIndex(const Char_t *name);
-    static Bool_t HasReadMCData(Char_t *opt);
-    static Bool_t HasReadFriendData(Char_t *opt);
+  static Int_t  GetTaskIndex(const Char_t *name);
+  static Bool_t HasReadMCData(Char_t *opt);
+  static Bool_t HasReadFriendData(Char_t *opt);
 
-    static void   MergeProd(const Char_t *mark, const Char_t *files, Int_t nBatch);
-    static Int_t  ParseOptions(Char_t *trd);
+  static void   MergeProd(const Char_t *mark, const Char_t *files, Int_t nBatch);
+  static Int_t  ParseOptions(Char_t *trd);
 
-    AliTRDpwg1Helper();
-    ~AliTRDpwg1Helper();
+  AliTRDpwg1Helper();
+  ~AliTRDpwg1Helper();
 };
+
 #endif
index 1dfba1d..457404a 100644 (file)
@@ -3,7 +3,7 @@
 #include "AliLog.h"
 #include "AliAnalysisManager.h"
 #include "AliAnalysisDataContainer.h"
-#include "PWG1/TRD/macros/AliTRDperformanceTrain.h"
+#include "PWG1/TRD/AliTRDpwg1Helper.h"
 #include "PWG1/TRD/AliTRDcheckDET.h"
 #include "PWG1/TRD/AliTRDcalibration.h"
 #endif
@@ -27,7 +27,7 @@ void AddTRDcheckDET(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContainer
   
 
   // CALIBRATION
-  if(!(TSTBIT(map, kCalibration))) return;
+  if(!(TESTBIT(map, AliTRDpwg1Helper::kCalibration))) return;
   AliTRDcalibration *ctask(NULL);
   mgr->AddTask(ctask = new AliTRDcalibration((char*)"calibration"));
   ctask->SetHisto2d(kTRUE);
index 75b79c4..bf3fd8e 100644 (file)
@@ -10,7 +10,8 @@ void AddTRDcheckESD(AliAnalysisManager *mgr)
   //AliLog::SetClassDebugLevel("AliTRDcheckESD", 5);
   AliTRDcheckESD *checkESD = new AliTRDcheckESD((char*)"TRDcheckESD");
   mgr->AddTask(checkESD);
-  checkESD->SetMC(mgr->GetMCtruthEventHandler());
+  Bool_t mc = mgr->GetMCtruthEventHandler();
+  checkESD->SetMC(mc);
   checkESD->SetCollision(/*kFALSE*/);
   checkESD->SetDebugLevel(0);
 
index e310981..26baad1 100644 (file)
@@ -4,7 +4,7 @@
 #include "AliLog.h"
 #include "AliAnalysisManager.h"
 #include "AliAnalysisDataContainer.h"
-#include "PWG1/TRD/macros/AliTRDperformanceTrain.h"
+#include "PWG1/TRD/AliTRDpwg1Helper.h"
 #include "PWG1/TRD/AliTRDcheckPID.h"
 #include "PWG1/TRD/AliTRDpidRefMaker.h"
 #include "PWG1/TRD/AliTRDpidRefMakerNN.h"
@@ -29,7 +29,7 @@ void AddTRDcheckPID(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContainer
   mgr->ConnectOutput(pid, 1, mgr->CreateContainer(pid->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Performance",mgr->GetCommonFileName())));
   mgr->ConnectOutput(pid, 2, co[0]);
 
-  if(TSTBIT(map, kPIDRefMaker)){
+  if(TESTBIT(map, AliTRDpwg1Helper::kPIDRefMaker)){
 
     //AliLog::SetClassDebugLevel("AliTRDpidRefMaker", 3);
     //AliLog::SetClassDebugLevel("AliTRDpidRefMakerNN", 3);
index b5103cf..f1ecdc2 100644 (file)
@@ -2,7 +2,7 @@
 #include "TError.h"
 #include "AliAnalysisManager.h"
 #include "AliAnalysisDataContainer.h"
-#include "PWG1/TRD/macros/AliTRDperformanceTrain.h"
+#include "PWG1/TRD/AliTRDpwg1Helper.h"
 #include "PWG1/TRD/AliTRDefficiency.h"
 #include "PWG1/TRD/AliTRDefficiencyMC.h"
 #include "PWG1/TRD/AliTRDmultiplicity.h"
@@ -22,7 +22,7 @@ void AddTRDefficiency(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContain
     
 
   // TRD combined tracking efficiency
-  if(mgr->GetMCtruthEventHandler() && TSTBIT(map, kEfficiencyMC)) {
+  if(mgr->GetMCtruthEventHandler() && TESTBIT(map, AliTRDpwg1Helper::kEfficiencyMC)) {
     mgr->AddTask(eff = new AliTRDefficiencyMC((char*)"TRDefficiencyMC"));
     eff->SetDebugLevel(0);
     //AliLog::SetClassDebugLevel("AliTRDefficiencyMC", 5);  
@@ -34,7 +34,7 @@ void AddTRDefficiency(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContain
   }
 
   // TRD single track selection
-  if(!(TSTBIT(map, kMultiplicity))) return;
+  if(!(TESTBIT(map, AliTRDpwg1Helper::kMultiplicity))) return;
 
   mgr->AddTask(eff = new AliTRDmultiplicity((char*)"TRDmultiplicity"));
   eff->SetDebugLevel(0);
index 997ee24..96033eb 100644 (file)
@@ -3,13 +3,13 @@
 #include "AliAnalysisManager.h"
 #include "AliAnalysisDataContainer.h"
 #include "PWG1/TRD/AliTRDinfoGen.h"
+#include "PWG1/TRD/AliTRDpwg1Helper.h"
 #include "PWG1/TRD/info/AliTRDeventInfo.h"
-#include "PWG1/TRD/macros/AliTRDperformanceTrain.h"
 #endif
 
 void AddTRDinfoGen(AliAnalysisManager *mgr, Int_t /*map*/, AliAnalysisDataContainer **/*ci*/, AliAnalysisDataContainer **co)
 {
-  Bool_t mc(mgr->GetMCtruthEventHandler()?kTRUE:kFALSE);
+  Bool_t mc=mgr->GetMCtruthEventHandler();
   //AliLog::SetClassDebugLevel("AliTRDinfoGen", 2);
   AliTRDinfoGen *info(NULL);
   mgr->AddTask(info = new AliTRDinfoGen((char*)"TRDinfoGen"));
@@ -30,15 +30,15 @@ void AddTRDinfoGen(AliAnalysisManager *mgr, Int_t /*map*/, AliAnalysisDataContai
   
   // Connect IO slots
   mgr->ConnectInput (info, 0, mgr->GetCommonInputContainer());
-  co[kEventInfo] = mgr->CreateContainer("eventInfo", AliTRDeventInfo::Class(), AliAnalysisManager::kExchangeContainer);
-  co[kTracksBarrel] = mgr->CreateContainer("tracksBarrel", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
-  co[kTracksSA] = mgr->CreateContainer("tracksSA", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
-  co[kTracksKink] = mgr->CreateContainer("tracksKink", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
-  co[kV0List] = mgr->CreateContainer("v0List", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
-  for(Int_t ios(1);ios<kNOutSlots-1;ios++) mgr->ConnectOutput(info, ios, co[ios]);
+  co[AliTRDpwg1Helper::kEventInfo] = mgr->CreateContainer("eventInfo", AliTRDeventInfo::Class(), AliAnalysisManager::kExchangeContainer);
+  co[AliTRDpwg1Helper::kTracksBarrel] = mgr->CreateContainer("tracksBarrel", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
+  co[AliTRDpwg1Helper::kTracksSA] = mgr->CreateContainer("tracksSA", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
+  co[AliTRDpwg1Helper::kTracksKink] = mgr->CreateContainer("tracksKink", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
+  co[AliTRDpwg1Helper::kV0List] = mgr->CreateContainer("v0List", TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
+  for(Int_t ios(1);ios<AliTRDpwg1Helper::kNOutSlots-1;ios++) mgr->ConnectOutput(info, ios, co[ios]);
   
   // add last monitor container
   AliAnalysisDataContainer *mon=mgr->CreateContainer(info->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Performance",mgr->GetCommonFileName()));
-  mgr->ConnectOutput(info, kNOutSlots-1, mon);
+  mgr->ConnectOutput(info, AliTRDpwg1Helper::kNOutSlots-1, mon);
 }
 
index d887a15..866c3ca 100644 (file)
@@ -5,7 +5,7 @@
 #include "AliAnalysisManager.h"
 #include "AliAnalysisDataContainer.h"
 #include "TRD/AliTRDgeometry.h"
-#include "PWG1/TRD/macros/AliTRDperformanceTrain.h"
+#include "PWG1/TRD/AliTRDpwg1Helper.h"
 #include "PWG1/TRD/AliTRDresolution.h"
 #include "PWG1/TRD/AliTRDclusterResolution.h"
 #include "PWG1/TRD/AliTRDalignmentTask.h"
@@ -15,8 +15,8 @@ void AddTRDresolution(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContain
 {
   Info("AddTRDresolution", Form("[0]=\"%s\" [1]=\"%s\" [2]=\"%s\"", ci[0]->GetName(), ci[1]->GetName(), ci[2]->GetName()));
 
-  AliLog::SetClassDebugLevel("AliTRDrecoTask", 2);
-  AliLog::SetClassDebugLevel("AliTRDresolution", 2);
+  //AliLog::SetClassDebugLevel("AliTRDrecoTask", 2);
+  //AliLog::SetClassDebugLevel("AliTRDresolution", 2);
   AliTRDresolution *res(NULL);
   const Char_t *suffix[]={"", "SA", "K"};
   for(Int_t itq=0; itq<1/*3*/; itq++){
@@ -39,7 +39,7 @@ void AddTRDresolution(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContain
     
     TObjArray *coa = mgr->GetContainers();
     // Cluster Error Parameterization
-    if(TSTBIT(map, kClErrParam)){
+    if(TESTBIT(map, AliTRDpwg1Helper::kClErrParam)){
       AliTRDclusterResolution *taskCl(NULL);
       AliLog::SetClassDebugLevel("AliTRDclusterResolution", 2);
       for(Int_t idet(10); idet<11/*AliTRDgeometry::kNdet*/; idet++){
@@ -62,7 +62,7 @@ void AddTRDresolution(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContain
   }
 
   // TRD alignment
-  if(TSTBIT(map, kAlignment)){
+  if(TESTBIT(map, AliTRDpwg1Helper::kAlignment)){
     AliTRDalignmentTask *taskAlign(NULL);
     mgr->AddTask(taskAlign = new AliTRDalignmentTask((char*)"TRDalignment"));
     taskAlign->SetDebugLevel(0);
index a4c3f5d..6a2c2c8 100644 (file)
@@ -4,7 +4,6 @@
 #include "AliLog.h"
 #include "AliAnalysisManager.h"
 #include "AliAnalysisDataContainer.h"
-#include "PWG1/TRD/macros/AliTRDperformanceTrain.h"
 #include "PWG1/TRD/AliTRDv0Monitor.h"
 #endif
 
diff --git a/PWG1/TRD/macros/AliTRDperformanceTrain.h b/PWG1/TRD/macros/AliTRDperformanceTrain.h
deleted file mode 100644 (file)
index 03186d0..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef ALITRDPERFORMANCETRAIN_H
-#define ALITRDPERFORMANCETRAIN_H
-
-#define BITBIT(n)      (1 << (n))
-#define SETBITT(n,i) ((n) |= BITBIT(i))
-#define TSTBIT(n,i) ((Bool_t)(((n) & BITBIT(i)) != 0))
-#define CLRBITT(n,i) ((n) &= ~BITBIT(i))
-
-#define NTRDQATASKS 7
-#define NTRDCALIBTASKS 6
-const Int_t NTRDTASKS = NTRDQATASKS+NTRDCALIBTASKS;
-
-enum ETRDinfoGenOutSlots {
-   kEventInfo     = 1
-  ,kTracksBarrel  = 2
-  ,kTracksSA      = 3
-  ,kTracksKink    = 4
-  ,kV0List        = 5
-  ,kMonitor       = 6
-  ,kNOutSlots     = 7
-};
-
-enum ETRDrecoTasks{
-   kCheckESD      = 0
-  ,kInfoGen       = 1
-  ,kCheckDET      = 2
-  ,kEfficiency    = 3
-  ,kResolution    = 4
-  ,kCheckPID      = 5
-  ,kV0Monitor     = 6 
-  ,kCalibration   = 7
-  ,kEfficiencyMC  = 8
-  ,kAlignment     = 9
-  ,kPIDRefMaker   =10
-  ,kClErrParam    =11
-  ,kMultiplicity  =12
-};
-
-Char_t const* fgkTRDtaskClassName[NTRDTASKS] = {
-  "AliTRDcheckESD"
-  ,"AliTRDinfoGen"
-  ,"AliTRDcheckDET"
-  ,"AliTRDefficiency"
-  ,"AliTRDresolution"
-  ,"AliTRDcheckPID"
-  ,"AliTRDv0Monitor"
-  ,"AliTRDcalibration"
-  ,"AliTRDefficiencyMC"
-  ,"AliTRDalignmentTask"
-  ,"AliTRDpidRefMaker"
-  ,"AliTRDclusterResolution"
-  ,"AliTRDmultiplicity"
-};
-
-Char_t const* fgkTRDtaskOpt[NTRDTASKS+1] = {
-  "ESD"
-  ,"GEN"
-  ,"DET"
-  ,"EFF"
-  ,"RES"
-  ,"PID"
-  ,"V0"
-  ,"CAL"
-  ,"EFFC"
-  ,"ALGN"
-  ,"PIDR"
-  ,"CLRES"
-  ,"MULT"
-  ,"ALL"
-};
-
-#include <cstring>
-
-//____________________________________________
-Bool_t HasReadMCData(Char_t *opt){
-  return !(Bool_t)strstr(opt, "NOMC");
-}
-
-//____________________________________________
-Bool_t HasReadFriendData(Char_t *opt){
-  return !(Bool_t)strstr(opt, "NOFR");
-}
-
-#endif
-
diff --git a/PWG1/TRD/macros/helper.C b/PWG1/TRD/macros/helper.C
deleted file mode 100644 (file)
index f6c95ed..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#if ! defined (__CINT__) || defined (__MAKECINT__)
-#include "TFileMerger.h"
-#include "TSystem.h"
-#include "TString.h"
-#include "TObjString.h"
-#include "TObjArray.h"
-#include "TError.h"
-#include "TRandom.h"
-#include <fstream>
-#endif
-
-#ifndef HELPER_C
-#define HELPER_C
-
-//____________________________________________
-Int_t ParseOptions(Char_t *trd)
-{
-  Int_t fSteerTask = 0;
-  TObjArray *tasksArray = TString(trd).Tokenize(" ");
-  for(Int_t isel = 0; isel < tasksArray->GetEntriesFast(); isel++){
-    TString s = (dynamic_cast<TObjString *>(tasksArray->UncheckedAt(isel)))->String();
-    if(s.CompareTo("ALL") == 0){
-      for(Int_t itask = 0; itask < NTRDQATASKS; itask++) SETBITT(fSteerTask, itask);
-      continue;
-    } else if(s.CompareTo("NOMC") == 0 || s.CompareTo("NOFR") == 0){
-      continue; // taken care by special functions
-    } else { 
-      Bool_t foundOpt = kFALSE;  
-      for(Int_t itask = 0; itask < NTRDTASKS; itask++){
-        if(s.CompareTo(fgkTRDtaskOpt[itask]) != 0) continue;
-        SETBITT(fSteerTask, itask); 
-        if(itask>1) SETBITT(fSteerTask, kInfoGen);
-        foundOpt = kTRUE;
-        break;
-      }
-      if(!foundOpt) Info("ParseOptions()", Form("TRD task %s not implemented (yet).", s.Data()));
-    }
-  }
-  // extra rules for calibration tasks
-  if(TSTBIT(fSteerTask, kCalibration)) SETBITT(fSteerTask, kCheckDET);
-  if(TSTBIT(fSteerTask, kMultiplicity)) SETBITT(fSteerTask, kEfficiency);
-  if(TSTBIT(fSteerTask, kEfficiencyMC)) SETBITT(fSteerTask, kEfficiency);
-  if(TSTBIT(fSteerTask, kClErrParam)) SETBITT(fSteerTask, kResolution);
-  if(TSTBIT(fSteerTask, kAlignment)) SETBITT(fSteerTask, kResolution);
-  if(TSTBIT(fSteerTask, kPIDRefMaker)) SETBITT(fSteerTask, kCheckPID);
-  if(TSTBIT(fSteerTask, kV0Monitor)) SETBITT(fSteerTask, kCheckPID);
-
-  return fSteerTask;
-}
-
-//______________________________________________________
-void mergeProd(const Char_t *mark, const Char_t *files, const Int_t nBatch = 20)
-{
-
-
-  // Clear first predefines
-  Char_t MERGE[8]; sprintf(MERGE, "%d.lst", (Int_t)gRandom->Uniform(9999.));
-  Char_t PURGE[8]; sprintf(PURGE, "%d.lst", (Int_t)gRandom->Uniform(9999.));
-  gSystem->Exec("mkdir -p merge; rm -rf merge/*");
-
-  // purge file list
-  std::string filename;
-  std::ifstream file(files);
-  Int_t iline(0);
-  while(getline(file, filename)){
-    if(Int_t(filename.find(mark)) < 0) continue;
-    gSystem->Exec(Form("echo %s >> %s", filename.c_str(), PURGE));
-    iline++;
-  }
-  Int_t nBatches(iline/nBatch);
-
-  for(Int_t ibatch(0); ibatch<nBatches; ibatch++){
-    Int_t first(ibatch*nBatch);
-    if(!gSystem->Exec(Form("root.exe -b -q \'$ALICE_ROOT/PWG1/TRD/macros/mergeBatch.C(\"%s\", \"%s\", %d, %d)\'", mark, PURGE, nBatch, first))) continue;
-    gSystem->Exec(Form("mv %d_%s merge/", first, mark));
-    gSystem->Exec(Form("echo %s/merge/%d_%s >> %s", gSystem->ExpandPathName("$PWD"), first, mark, MERGE));
-  }
-  gSystem->Exec(Form("root.exe -b -q \'$ALICE_ROOT/PWG1/TRD/macros/mergeBatch.C(\"%s\", \"%s\", %d, 0, kFALSE, kTRUE)\'", mark, MERGE, nBatches));
-  gSystem->Exec(Form("mv 0_%s %s", mark, mark));
-  
-  gSystem->Exec(Form("rm -rfv %s %s merge", MERGE, PURGE));
-}
-
-#endif
index 1165cf0..8c63097 100644 (file)
 
 #endif
 
-#include "AliTRDperformanceTrain.h"
-#include "helper.C"
-//#include "../../PWG1/macros/AddPerformanceTask.h"
-
 Char_t const *libs[] = {"libProofPlayer.so", "libANALYSIS.so", "libANALYSISalice.so", "libTENDER.so", "libSTAT.so", "libPWG1.so"};
 
 // define setup
@@ -107,10 +103,10 @@ void makeCalibResults(Char_t *opt, Char_t const *files=NULL, Bool_t kGRID=kFALSE
 
   if(!c) c=new TCanvas("c", "Calibration", 10, 10, 800, 500);
 
-  for(Int_t itask = NTRDQATASKS; itask<NTRDTASKS; itask++){
-    if(!TSTBIT(fSteerTask, itask)) continue;
+  for(Int_t itask = AliTRDpwg1Helper::kNTRDQATASKS; itask<AliTRDpwg1Helper::NTRDTASKS; itask++){
+    if(!TESTBIT(fSteerTask, itask)) continue;
     switch(itask){
-    case kPIDRefMaker:
+    case AliTRDpwg1Helper::kPIDRefMaker:
       calibrateTRD(itask, "AliTRDpidRefMakerLQ", "PIDrefMaker");
       //calibrateTRD(itask, "AliTRDpidRefMakerNN", "PIDrefMaker");
       break;
@@ -127,7 +123,7 @@ void makeCalibResults(Char_t *opt, Char_t const *files=NULL, Bool_t kGRID=kFALSE
 //______________________________________________________
 void calibrateTRD(Int_t itask, Char_t const* ntask, Char_t const* nfile)
 {
-  if(!ntask) ntask=fgkTRDtaskClassName[itask];
+  if(!ntask) ntask=AliTRDpwg1Helper::fgkTRDtaskClassName[itask];
   new(ctask) TClass(ntask);
   if(!ctask){
     Error("makeCalibResults.C", Form("Asking for wrong class name [%s].", ntask));
index d553b7b..152d9a3 100644 (file)
 
 #endif
 
-#include "AliTRDperformanceTrain.h"
-#include "helper.C"
-//#include "../../PWG1/macros/AddPerformanceTask.h"
-
 Char_t *libs[] = {"libProofPlayer.so", "libANALYSIS.so", "libANALYSISalice.so", "libTENDER.so", "libPWG1.so"};
 // define setup
 TCanvas *c = 0x0;
@@ -97,19 +93,19 @@ void makeResults(Char_t *opt = "ALL", const Char_t *files="QAResults.root", Char
     return;
   }
 
-  mc = HasReadMCData(opt);
-  friends = HasReadFriendData(opt);
+  mc      = AliTRDpwg1Helper::HasReadMCData(opt);
+  friends = AliTRDpwg1Helper::HasReadFriendData(opt);
 
   gStyle->SetOptStat(0);
   gStyle->SetOptFit(0);
   TString outputFile;
   if(!TString(files).EndsWith(".root")){ 
     outputFile = Form("%s/QAResults.root", gSystem->ExpandPathName("$PWD"));
-    mergeProd("QAResults.root", files);
+    AliTRDpwg1Helper::MergeProd("QAResults.root", files);
   } else {
     outputFile = files;
   }
-  Int_t fSteerTask = ParseOptions(opt);
+  Int_t fSteerTask = AliTRDpwg1Helper::ParseOptions(opt);
 
   if(!dosummary){
     summary = kFALSE;
@@ -118,9 +114,9 @@ void makeResults(Char_t *opt = "ALL", const Char_t *files="QAResults.root", Char
 
   TClass *ctask = new TClass;
   AliAnalysisTask *task = 0x0;
-  for(Int_t itask = NTRDQATASKS; itask--;){
-    if(!TSTBIT(fSteerTask, itask)) continue;
-    new(ctask) TClass(fgkTRDtaskClassName[itask]);
+  for(Int_t itask = AliTRDpwg1Helper::kNTRDQATASKS; itask--;){
+    if(!TESTBIT(fSteerTask, itask)) continue;
+    new(ctask) TClass(AliTRDpwg1Helper::fgkTRDtaskClassName[itask]);
     task = (AliAnalysisTask*)ctask->New();
     task->SetName(Form("%s%s", task->GetName(), cid));
     printf(" *** task %s, output file %s\n", task->GetName(), outputFile.Data());
index ad7a086..ea8a935 100644 (file)
@@ -1,4 +1,4 @@
-#include "helper.C"
+#include "AliTRDpwg1Helper.h"
 void mergeResults(Char_t *files, Char_t *file="QAresults.root"){
-  mergeProd(file, files, 10);
+  AliTRDpwg1Helper::MergeProd(file, files, 10);
 }
\ No newline at end of file
index 29e8549..d986a8a 100644 (file)
 #include "TRD/AliTRDtrackerV1.h"
 #include "TRD/AliTRDcalibDB.h"
 
-#include "PWG1/TRD/macros/AliTRDperformanceTrain.h"
 #include "PWG1/TRD/macros/AddTRDcheckESD.C"
 #include "PWG1/TRD/macros/AddTRDinfoGen.C"
 #include "PWG1/TRD/macros/AddTRDcheckDET.C"
 #include "PWG1/TRD/macros/AddTRDefficiency.C"
 #include "PWG1/TRD/macros/AddTRDresolution.C"
 #include "PWG1/TRD/macros/AddTRDcheckPID.C"
-
 #endif
 
-#include "macros/AliTRDperformanceTrain.h"
-
-
 Bool_t MEM = kFALSE;
 
-TChain* MakeChainLST(const char* filename = 0x0);
-TChain* MakeChainXML(const char* filename = 0x0);
-void run(Char_t *optList="ALL", const Char_t *files=0x0, Long64_t nev=1234567890, Long64_t first = 0)
+TChain* MakeChainLST(const char* filename = NULL);
+TChain* MakeChainXML(const char* filename = NULL);
+Bool_t UseMC(Char_t *opt);
+Bool_t UseFriends(Char_t *opt);
+void run(Char_t *optList="ALL", const Char_t *files=NULL, Long64_t nev=1234567890, Long64_t first = 0)
 {
-  TMemStat *mem = 0x0;
+  TMemStat *mem = NULL;
   if(MEM){ 
     if(gSystem->Load("libMemStat.so")<0) return;
     if(gSystem->Load("libMemStatGui.so")<0) return;
@@ -106,17 +103,17 @@ void run(Char_t *optList="ALL", const Char_t *files=0x0, Long64_t nev=1234567890
 
   // VERY GENERAL SETTINGS
   //AliLog::SetGlobalLogLevel(AliLog::kError);
-  gStyle->SetOptStat(0);
   if(gSystem->Load("libANALYSIS.so")<0) return;
   if(gSystem->Load("libANALYSISalice.so")<0) return;
   if(gSystem->Load("libTENDER.so")<0) return;
   if(gSystem->Load("libPWG1.so")<0) return;
 
-  Bool_t fHasMCdata =  HasReadMCData(optList);
-  Bool_t fHasFriends = HasReadFriendData(optList);
+  printf("Reconstructor[%p]\n", AliTRDinfoGen::Reconstructor());
+  Bool_t fHasMCdata = UseMC(optList);
+  Bool_t fHasFriends = UseFriends(optList);
   
   // DEFINE DATA CHAIN
-  TChain *chain = 0x0;
+  TChain *chain = NULL;
   if(!files) chain = MakeChainLST();
   else{
     TString fn(files);
@@ -134,8 +131,10 @@ void run(Char_t *optList="ALL", const Char_t *files=0x0, Long64_t nev=1234567890
   AliAnalysisManager *mgr = new AliAnalysisManager("TRD Reconstruction Performance & Calibration");
   AliESDInputHandlerRP *esdH(NULL);
   mgr->SetInputEventHandler(esdH = new AliESDInputHandlerRP);
-  esdH->SetReadFriends(kTRUE);
-  esdH->SetActiveBranches("ESDfriend");
+  if(fHasFriends){
+    esdH->SetReadFriends(kTRUE);
+    esdH->SetActiveBranches("ESDfriend");
+  }
   AliMCEventHandler *mcH(NULL);
   if(fHasMCdata) mgr->SetMCtruthEventHandler(mcH = new AliMCEventHandler());
   //mgr->SetDebugLevel(10);
@@ -203,24 +202,24 @@ TChain* MakeChainXML(const char* xmlfile)
 {
   if (!TFile::Open(xmlfile)) {
     Error("MakeChainXML", Form("No file %s was found", xmlfile));
-    return 0x0;
+    return NULL;
   }
 
-  if(gSystem->Load("libNetx.so")<0) return 0x0;
-  if(gSystem->Load("libRAliEn.so")<0) return 0x0;
+  if(gSystem->Load("libNetx.so")<0) return NULL;
+  if(gSystem->Load("libRAliEn.so")<0) return NULL;
   TGrid::Connect("alien://") ;
 
   TGridCollection *collection = (TGridCollection*) TAlienCollection::Open(xmlfile);
   if (!collection) {
     Error("MakeChainXML", Form("No collection found in %s", xmlfile)) ; 
-    return 0x0; 
+    return NULL;
   }
   //collection->CheckIfOnline();
 
   TGridResult* result = collection->GetGridResult("",0 ,0);
   if(!result->GetEntries()){
     Error("MakeChainXML", Form("No entries found in %s", xmlfile)) ; 
-    return 0x0; 
+    return NULL;
   }
   // Makes the ESD chain 
   TChain* chain = new TChain("esdTree");
@@ -229,3 +228,13 @@ TChain* MakeChainXML(const char* xmlfile)
   }
   return chain;
 }
+
+//______________________________________________________
+Bool_t UseMC(Char_t *opt){
+  return !(Bool_t)strstr(opt, "NOMC");
+}
+
+//____________________________________________
+Bool_t UseFriends(Char_t *opt){
+  return !(Bool_t)strstr(opt, "NOFR");
+}
index 1df86e5..85cac54 100644 (file)
@@ -63,7 +63,6 @@
 #include "TRD/AliTRDtrackerV1.h"
 #include "TRD/AliTRDcalibDB.h"
 
-#include "PWG1/TRD/macros/AliTRDperformanceTrain.h"
 #include "PWG1/TRD/macros/AddTRDcheckESD.C"
 #include "PWG1/TRD/macros/AddTRDinfoGen.C"
 #include "PWG1/TRD/macros/AddTRDcheckDET.C"
@@ -73,9 +72,6 @@
 #include "PWG1/TRD/macros/AddTRDv0Monitor.C"
 #endif
 
-#include "../TRD/macros/AliTRDperformanceTrain.h"
-#include "../TRD/macros/helper.C"
-
 TString opt("");
 const Char_t* Translate(Bool_t doCheckESD=kTRUE, Bool_t doCheckDET=kTRUE, Bool_t doEffic=kTRUE, Bool_t doResolution=kTRUE, Bool_t doCheckPID=kTRUE, Bool_t doV0Monitor=kTRUE);
 Bool_t AddTrainPerformanceTRD(Char_t *trd="ALL", const Char_t *addMacroPath = "$ALICE_ROOT/PWG1/TRD/macros")
@@ -87,53 +83,53 @@ Bool_t AddTrainPerformanceTRD(Char_t *trd="ALL", const Char_t *addMacroPath = "$
   }
 
   // TRD data containers
-  AliAnalysisDataContainer *ci[kNOutSlots];
+  AliAnalysisDataContainer *ci[AliTRDpwg1Helper::kNOutSlots];
   AliAnalysisDataContainer *ce[5];
 
   Info("AddTrainPerformanceTRD", Form("Add Macros taken from %s", addMacroPath));
   Info("AddTrainPerformanceTRD", Form("TRD wagons \"%s\"", trd));
-  Int_t bitmap = ParseOptions(trd);
-  for(Int_t it=0; it<NTRDQATASKS; it++){
-    if(!TSTBIT(bitmap, it)) continue;
-    if(gROOT->LoadMacro(Form("%s/Add%s.C++", addMacroPath, TString(fgkTRDtaskClassName[it])(3,20).Data()))) {
-      Error("AddTrainPerformanceTRD()", Form("Error loading %s task.", fgkTRDtaskClassName[it]));
+  Int_t bitmap = AliTRDpwg1Helper::ParseOptions(trd);
+  for(Int_t it=0; it<AliTRDpwg1Helper::kNTRDQATASKS; it++){
+    //if(!TESTBIT(bitmap, it)) continue;
+    if(gROOT->LoadMacro(Form("%s/Add%s.C+", addMacroPath, TString(AliTRDpwg1Helper::fgkTRDtaskClassName[it])(3,20).Data()))) {
+      Error("AddTrainPerformanceTRD()", Form("Error loading %s task.", AliTRDpwg1Helper::fgkTRDtaskClassName[it]));
       return kFALSE;
     } 
 
     switch(it){
-    case kCheckESD:
+    case AliTRDpwg1Helper::kCheckESD:
       AddTRDcheckESD(mgr); break;
-    case kInfoGen:
+    case AliTRDpwg1Helper::kInfoGen:
       AddTRDinfoGen(mgr, 0, NULL, ci); break;
-    case kCheckDET:
+    case AliTRDpwg1Helper::kCheckDET:
       // map slots
-      ce[0]=ci[kEventInfo];
-      ce[1]=ci[kTracksBarrel];
-      ce[2]=ci[kTracksSA];
-      ce[3]=ci[kTracksKink];
+      ce[0]=ci[AliTRDpwg1Helper::kEventInfo];
+      ce[1]=ci[AliTRDpwg1Helper::kTracksBarrel];
+      ce[2]=ci[AliTRDpwg1Helper::kTracksSA];
+      ce[3]=ci[AliTRDpwg1Helper::kTracksKink];
       AddTRDcheckDET(mgr, bitmap, ce);
       break;
-    case kEfficiency:
+    case AliTRDpwg1Helper::kEfficiency:
       // map slots
-      ce[0]=ci[kTracksBarrel];
-      ce[1]=ci[kTracksSA];
-      ce[2]=ci[kTracksKink];
+      ce[0]=ci[AliTRDpwg1Helper::kTracksBarrel];
+      ce[1]=ci[AliTRDpwg1Helper::kTracksSA];
+      ce[2]=ci[AliTRDpwg1Helper::kTracksKink];
       AddTRDefficiency(mgr, bitmap, ce);
       break;
-    case kResolution:
+    case AliTRDpwg1Helper::kResolution:
       // map slots
-      ce[0]=ci[kTracksBarrel];
-      ce[1]=ci[kTracksSA];
-      ce[2]=ci[kTracksKink];
+      ce[0]=ci[AliTRDpwg1Helper::kTracksBarrel];
+      ce[1]=ci[AliTRDpwg1Helper::kTracksSA];
+      ce[2]=ci[AliTRDpwg1Helper::kTracksKink];
       AddTRDresolution(mgr, bitmap, ce); 
       break;
-    case kCheckPID:
+    case AliTRDpwg1Helper::kCheckPID:
       // map slots
-      ce[0]=ci[kTracksBarrel];
-      ce[1]=ci[kV0List];
+      ce[0]=ci[AliTRDpwg1Helper::kTracksBarrel];
+      ce[1]=ci[AliTRDpwg1Helper::kV0List];
       AddTRDcheckPID(mgr, bitmap, ce, &ce[2]); 
       break;
-    case kV0Monitor:
+    case AliTRDpwg1Helper::kV0Monitor:
       // slots already mapped by checkPID
       AddTRDv0Monitor(mgr, 0, ce);
       break;