Do not fail if the corresponding pedestal run was obviously bad, i.e. if the number...
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 May 2010 12:38:32 +0000 (12:38 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 May 2010 12:38:32 +0000 (12:38 +0000)
MUON/AliMUONPedestalSubprocessor.cxx
MUON/AliMUONPreprocessor.h
MUON/TestMUONPreprocessor.C

index a6f7de1..12d1e3a 100644 (file)
@@ -157,10 +157,24 @@ AliMUONPedestalSubprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endT
   if (!n)
   {
     Master()->Log("Failed to read any pedestals");
+
     delete fPedestals;
     fPedestals = 0;
     delete fConfig;
     fConfig = 0;
+
+    // OK, we did not get our pedestals. Check if the ped run itself
+    // was bad, i.e. too few events
+    TString nevents(Master()->GetRunParameter("totalEvents"));
+    
+    if ( nevents.Atoi() < 50 ) 
+    {
+      Master()->Log(Form("The run had only %d events, so the failure to read pedestals is normal",nevents.Atoi()));
+      // too few events, failure is normal, returns OK.
+      return kTRUE;
+    }
+    
+    // no ped, but run looks clean, that's an error
     return kFALSE;
   }
   
index 2a0ce63..53330db 100644 (file)
@@ -45,6 +45,12 @@ public:
                                   validityStart,validityInfinite);
   }
   
+  /// Publish AliPreprocessor::GetRunParameter
+  const char* GetRunParameter(const char* param)
+  {
+    return AliPreprocessor::GetRunParameter(param);
+  }
+  
   /// Publish AliPreprocessor::GetFile function
   const char* GetFile(Int_t system, const char* id, const char* source)
   {
index 1909348..340879a 100644 (file)
@@ -238,6 +238,8 @@ void TestMUONPreprocessor(Int_t runNumber=80,
   // In real life the parameters will be retrieved automatically from the run logbook;
   shuttle->SetInputRunType(runType);
   
+  shuttle->AddInputRunParameter("totalEvents","20");
+                                
   // Create the preprocessor that should be tested, it registers itself automatically to the shuttle
   new AliMUONTrackerPreprocessor(shuttle);
   new AliMUONTriggerPreprocessor(shuttle);