]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG1/TRD/AliTRDpwg1Helper.cxx
update to stay in sync with modifications by Ruben (Ionut)
[u/mrichter/AliRoot.git] / PWG1 / TRD / AliTRDpwg1Helper.cxx
index 664d772f4e3c1d8e54feb20d10afb775e835952f..29ac0b74e8222360fa56141bf8d5aea330441ca0 100644 (file)
@@ -7,8 +7,8 @@
 //                                                                        //
 ////////////////////////////////////////////////////////////////////////////
 
+#include "TError.h"
 #include <Rtypes.h>
-#include <TError.h>
 #include <TMath.h>
 #include <TObjArray.h>
 #include <TObjString.h>
@@ -31,6 +31,7 @@ const Char_t * AliTRDpwg1Helper::fgkTRDtaskClassName[AliTRDpwg1Helper::kNTRDTASK
   ,"AliTRDresolution"
   ,"AliTRDcheckPID"
   ,"AliTRDv0Monitor"
+  ,"AliTRDcheckTRK"
   ,"AliTRDcalibration"
   ,"AliTRDefficiencyMC"
   ,"AliTRDalignmentTask"
@@ -47,6 +48,7 @@ const Char_t * AliTRDpwg1Helper::fgkTRDtaskOpt[AliTRDpwg1Helper::kNTRDTASKS+1] =
   ,"RES"
   ,"PID"
   ,"V0"
+  ,"TRK"
   ,"CAL"
   ,"EFFC"
   ,"ALGN"
@@ -76,6 +78,7 @@ Int_t AliTRDpwg1Helper::ParseOptions(Char_t *trd)
 //     "PID"  : TRD PID - pion efficiency
 //     "V0"   : monitor V0 performance for use in TRD PID calibration
 // ------- Calibration tasks ----------
+//     "TRK"  : multidimensional tracking performance resolution
 //     "EFFC" : TRD Tracking Efficiency Combined (barrel + stand alone) - only in case of simulations
 //     "MULT"  : TRD single track selection
 //     "CLRES": clusters Resolution
@@ -104,10 +107,11 @@ Int_t AliTRDpwg1Helper::ParseOptions(Char_t *trd)
         foundOpt = kTRUE;
         break;
       }
-      if(!foundOpt) Info("ParseOptions()", Form("TRD task %s not implemented (yet).", s.Data()));
+      if(!foundOpt) Warning("AliTRDpwg1Helper::ParseOptions()", "TRD task %s not implemented (yet).", s.Data());
     }
   }
   // extra rules for calibration tasks
+//  if(TESTBIT(fSteerTask, kCheckTRK)) SETBIT(fSteerTask, kResolution);
   if(TESTBIT(fSteerTask, kCalibration)) SETBIT(fSteerTask, kCheckDET);
   if(TESTBIT(fSteerTask, kMultiplicity)) SETBIT(fSteerTask, kEfficiency);
   if(TESTBIT(fSteerTask, kEfficiencyMC)) SETBIT(fSteerTask, kEfficiency);
@@ -138,27 +142,27 @@ void AliTRDpwg1Helper::MergeProd(const Char_t *mark, const Char_t *files, const
     gSystem->Exec(Form("echo %s >> %s", filename.c_str(), lPURGE));
     iline++;
   }
-  Int_t nBatches(TMath::Ceil(Double_t(iline)/nBatch));
-  Info("MergeProd()", Form("Merge %d files in %d batches.", iline, nBatches));
+  Int_t nBatches=Int_t(TMath::Ceil(Double_t(iline)/nBatch));
+  Info("MergeProd()", "Merge %d files in %d batches.", iline, nBatches);
 
   Int_t first(0);
   for(Int_t ibatch(0); ibatch<nBatches; ibatch++){
     first = ibatch*nBatch;
-     if(!gSystem->Exec(Form("aliroot -b -q \'$ALICE_ROOT/PWG1/TRD/macros/mergeBatch.C(\"%s\", \"%s\", %d, %d)\'", mark, lPURGE, nBatch, first))) continue;
+    if(gSystem->Exec(Form("aliroot -b -q \'$ALICE_ROOT/PWG1/TRD/macros/mergeBatch.C(\"%s\", \"%s\", %d, %d)\'", mark, lPURGE, nBatch, first))) continue;
     gSystem->Exec(Form("mv %d_%s merge/%d_%d_%s", first, mark, level, first, mark));
     gSystem->Exec(Form("echo %s/merge/%d_%d_%s >> %s", gSystem->ExpandPathName("$PWD"), level, first, mark, lMERGE));
   }
 
   if(nBatches==1){
-    Info("MergeProd()", "Rename 1 merged file.");
+    Info("AliTRDpwg1Helper::MergeProd()", "Rename 1 merged file.");
     gSystem->Exec(Form("mv merge/%d_%d_%s %s", level, first, mark, mark));
   } else if(nBatches<=nBatch){
-    Info("MergeProd()", Form("Merge %d files in 1 batch.", nBatches));
+    Info("AliTRDpwg1Helper::MergeProd()", "Merge %d files in 1 batch.", nBatches);
     if(!gSystem->Exec(Form("aliroot -b -q \'$ALICE_ROOT/PWG1/TRD/macros/mergeBatch.C(\"%s\", \"%s\", %d, 0, kFALSE)\'", mark, lMERGE, nBatches))) return;
     gSystem->Exec(Form("mv 0_%s %s", mark, mark));
   } else {
     level++;
-    Info("MergeProd()", Form("Merge level %d.", level));
+    Info("AliTRDpwg1Helper::MergeProd()", "Merge level %d.", level);
     MergeProd(mark, lMERGE, nBatch, level);
   }
   gSystem->Exec(Form("rm -fv %s %s", lMERGE, lPURGE));
@@ -166,7 +170,7 @@ void AliTRDpwg1Helper::MergeProd(const Char_t *mark, const Char_t *files, const
 
 
 //______________________________________________________
-const Char_t* AliTRDpwg1Helper::MergeBatch(const Char_t *mark, const Char_t *files, const Int_t nfiles, const Int_t first, Bool_t kSVN, Bool_t kCLEAR)
+Int_t AliTRDpwg1Helper::MergeBatch(const Char_t *mark, const Char_t *files, const Int_t nfiles, const Int_t first, Bool_t kSVN, Bool_t kCLEAR)
 {
 // Merge files specified in the file list "files" by the token "mark".
 // The script will merge "nfiles" files starting from the "first" file.
@@ -190,25 +194,29 @@ const Char_t* AliTRDpwg1Helper::MergeBatch(const Char_t *mark, const Char_t *fil
     if(kSVN){ // download SVN info for trending
       if(gSystem->Exec(Form("if [ ! -f svnInfo.log ]; then cp -v %s/svnInfo.log %s; fi", Dirname(filename.c_str()), gSystem->ExpandPathName("$PWD"))) == 0) kSVN=kFALSE;
     }
-    Info("MergeBatch()", filename.c_str());
+    Info("AliTRDpwg1Helper::MergeBatch()", "%s", filename.c_str());
     if(!fFM.AddFile(filename.c_str())) return NULL;
     arr.Add(new TObjString(filename.c_str()));
     nbatch++;
     if(nbatch==nfiles) break;
   }
   if(!nbatch){
-    Warning("MergeBatch()", "NOTHING TO MERGE"); return NULL;
+    Warning("AliTRDpwg1Helper::MergeBatch()", "NOTHING TO MERGE"); return NULL;
   } else {
-    Info("MergeBatch()", "MERGING FILES[%d] START[%d] %s ... ", nbatch, first, ((nbatch<nfiles)?"INCOMPLETE":""));
+    Info("AliTRDpwg1Helper::MergeBatch()", "MERGING FILES[%d] START[%d] %s ... ", nbatch, first, ((nbatch<nfiles)?"INCOMPLETE":""));
   }
-  if(!fFM.Merge()) return NULL;
+  if(!fFM.Merge()){
+    Info("AliTRDpwg1Helper::MergeBatch()", "Failed [%s]", fFM.GetOutputFileName());
+    return 1;
+  }
+  Info("AliTRDpwg1Helper::MergeBatch()", "Done [%s]", fFM.GetOutputFileName());
 
   if(kCLEAR){
     for(Int_t ifile(0); ifile<arr.GetEntries(); ifile++){
       gSystem->Exec(Form("rm -fv %s", ((TObjString*)arr.At(ifile))->GetString().Data()));
     }
   }
-  return fFM.GetOutputFileName();
+  return 0;
 }
 
 //______________________________________________________