]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliRecoParam.cxx
Fix for Savannah bug report 59287
[u/mrichter/AliRoot.git] / STEER / AliRecoParam.cxx
index 9da24f92c726531f07f357dd9d0fa9dd21499c57..8c89652b142908bb443b8a9150d5b9b02994cc02 100644 (file)
@@ -28,6 +28,7 @@
 #include "TClass.h"
 #include "TObjArray.h"
 #include "TMath.h"
+#include "THashTable.h"
 #include "AliDetectorRecoParam.h"
 
 #include "AliLog.h"
@@ -38,7 +39,7 @@
 
 ClassImp(AliRecoParam)
 
-TString AliRecoParam::fkgEventSpecieName[] = {"Default", "LowMultiplicity", "HighMultiplicity", "Cosmic", "Calibration", "Unknown"} ; 
+TString AliRecoParam::fkgEventSpecieName[] = {"Default", "LowMultiplicity", "HighMultiplicity", "Cosmic", "Calib", "Unknown"} ; 
 
 AliRecoParam::AliRecoParam(): 
   TObject(),
@@ -189,10 +190,11 @@ void  AliRecoParam::Print(Option_t *option) const {
   }
 }
 
-void AliRecoParam::SetEventSpecie(const AliRunInfo *runInfo, const AliEventInfo &evInfo)
+void AliRecoParam::SetEventSpecie(const AliRunInfo *runInfo, const AliEventInfo &evInfo,
+                                 const THashTable *cosmicTriggersList)
 {
-  // To be implemented
-  // Here we return always kDefault!!
+  // Implemented according to the discussions
+  // and meetings with physics and trigger coordination
 
   fEventSpecie = kDefault;
 
@@ -202,20 +204,27 @@ void AliRecoParam::SetEventSpecie(const AliRunInfo *runInfo, const AliEventInfo
     return;
   }
 
-  if (strcmp(runInfo->GetLHCState(),"STABLE_BEAMS") == 0) {
-    // In case of stable beams
-    if ((strcmp(runInfo->GetBeamType(),"A-A") == 0) ||
+  // Special DAQ events considered as calibration events
+  if (evInfo.GetEventType() != 7) {
+    // START_OF_*, END_OF_*, CALIBRATION etc events
+    fEventSpecie = kCalib;
+    return;
+  }
+
+    if ((strcmp(runInfo->GetLHCState(),"STABLE_BEAMS") == 0) &&
+       ((strcmp(runInfo->GetBeamType(),"A-A") == 0) ||
        (strcmp(runInfo->GetBeamType(),"A-") == 0) ||
-       (strcmp(runInfo->GetBeamType(),"-A") == 0)) {
-      // Heavy ion run (any beam tha is not pp, the event specie is set to kHighMult
+       (strcmp(runInfo->GetBeamType(),"-A") == 0))) {
+      // Heavy ion run (any beam that is not pp, the event specie is set to kHighMult
       fEventSpecie = kHighMult;
     }
-    else if ((strcmp(runInfo->GetBeamType(),"p-p") == 0) ||
-            (strcmp(runInfo->GetBeamType(),"p-") == 0) ||
-            (strcmp(runInfo->GetBeamType(),"-p") == 0) ||
-            (strcmp(runInfo->GetBeamType(),"P-P") == 0) ||
-            (strcmp(runInfo->GetBeamType(),"P-") == 0) ||
-            (strcmp(runInfo->GetBeamType(),"-P") == 0)) {
+    else if ((strcmp(runInfo->GetLHCState(),"STABLE_BEAMS") == 0) &&
+            ((strcmp(runInfo->GetBeamType(),"p-p") == 0) ||
+             (strcmp(runInfo->GetBeamType(),"p-") == 0) ||
+             (strcmp(runInfo->GetBeamType(),"-p") == 0) ||
+             (strcmp(runInfo->GetBeamType(),"P-P") == 0) ||
+             (strcmp(runInfo->GetBeamType(),"P-") == 0) ||
+             (strcmp(runInfo->GetBeamType(),"-P") == 0))) {
       // Proton run, the event specie is set to kLowMult
       fEventSpecie = kLowMult;
     }
@@ -223,22 +232,10 @@ void AliRecoParam::SetEventSpecie(const AliRunInfo *runInfo, const AliEventInfo
       // No beams, we assume cosmic data
       fEventSpecie = kCosmic;
     }
-    else if (strcmp(runInfo->GetBeamType(),"UNKNOWN") == 0) {
-      // No LHC beam information is available, we the default
-      // event specie
-      fEventSpecie = kDefault;
-    }
 
     // Now we look into the trigger type in order to decide
     // on the remaining cases (cosmic event within LHC run,
-    // calibration, for example TPC laser, triggers within physics run,
-    // special DAQ events considered as calibration etc...)
-    if (evInfo.GetEventType() != 7) {
-      // START_OF_*, END_OF_*, CALIBRATION etc events
-      fEventSpecie = kCalib;
-      return;
-    }
-
+    // calibration, for example TPC laser, triggers within physics run
     TString triggerClasses = evInfo.GetTriggerClasses();
     TObjArray* trClassArray = triggerClasses.Tokenize(" ");
     Int_t nTrClasses = trClassArray->GetEntriesFast();
@@ -254,27 +251,19 @@ void AliRecoParam::SetEventSpecie(const AliRunInfo *runInfo, const AliEventInfo
        continue;
       }
 
-      TObjArray* tmp = trClass.Tokenize("-");
-      TObjString* bcName = (TObjString*)tmp->At(1);
-      if (bcName) {
-       if ((bcName->String().CompareTo("ABCE") == 0) ||
-           (bcName->String().CompareTo("E")    == 0) ||
-           (bcName->String().CompareTo("NONE") == 0)) {
-         // Cosmic triggers are identified by empty bunch-crossing mask
-         // The naming comvention is:
-         // A  filled bunch from A side, empty from C side
-         // B  filled bunch from both sides
-         // C  filled bunch from C side, empty from A side
-         // E  empty bunch from both sides
+      if (cosmicTriggersList) {
+       if (cosmicTriggersList->FindObject(trClass.Data())) {
+         // Cosmic trigger accorind to the table
+         // provided in OCDB
          cosmicTrigger = kTRUE;
-         delete tmp;
+         AliDebug(1,Form("Trigger %s identified as cosmic according to the list defined in OCDB.",
+                         trClass.Data()));
          continue;
        }
       }
       else {
-       AliWarning(Form("Trigger class %s doesn't comply with the naming convention!",trClass.Data()));
+       AliDebug(1,"Cosmic trigger list is not provided, cosmic event specie is effectively disabled!");
       }
-      delete tmp;
 
       otherTrigger = kTRUE;
     }
@@ -290,7 +279,6 @@ void AliRecoParam::SetEventSpecie(const AliRunInfo *runInfo, const AliEventInfo
 
     // Here we have to add if we have other cases
     // and also HLT info if any...
-  }
 }
 
 const AliDetectorRecoParam *AliRecoParam::GetDetRecoParam(Int_t iDet) const