#include "AliMUONHVSubprocessor.h"
#include "AliMUONGMSSubprocessor.h"
+#include "AliMpSegmentation.h"
+#include "AliMpDDLStore.h"
+
#include "AliLog.h"
#include "AliShuttleInterface.h"
#include "Riostream.h"
#include "TObjArray.h"
+//-----------------------------------------------------------------------------
/// \class AliMUONPreprocessor
///
/// Shuttle preprocessor for MUON subsystems (TRK and TRG)
/// (of type AliMUONVSubprocessor).
///
/// \author Laurent Aphecetche
+//-----------------------------------------------------------------------------
/// \cond CLASSIMP
ClassImp(AliMUONPreprocessor)
//_____________________________________________________________________________
AliMUONPreprocessor::AliMUONPreprocessor(const char* detName, AliShuttleInterface* shuttle)
: AliPreprocessor(detName, shuttle),
- fSubprocessors(new TObjArray())
+ fIsValid(kFALSE),
+ fIsApplicable(kTRUE),
+ fSubprocessors(new TObjArray()),
+ fProcessDCS(kFALSE)
{
/// ctor
}
{
/// Empty our subprocessor list
fSubprocessors->Clear();
+ fProcessDCS = kFALSE;
+ fIsValid = kFALSE;
+ fIsApplicable = kTRUE;
}
//_____________________________________________________________________________
void
-AliMUONPreprocessor::Add(AliMUONVSubprocessor* sub)
+AliMUONPreprocessor::Add(AliMUONVSubprocessor* sub, Bool_t processDCS)
{
/// Add a subprocessor to our list of workers
fSubprocessors->Add(sub);
+ if ( processDCS == kTRUE ) fProcessDCS = processDCS;
}
//_____________________________________________________________________________
void
AliMUONPreprocessor::Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
{
- /// loop over subtasks and initialize them
- for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
+ /// Load mapping and initialize subtasks
+
+ // Delete previous mapping
+ delete AliMpSegmentation::Instance(false);
+ delete AliMpDDLStore::Instance(false);
+
+ if ( ! IsApplicable() ) {
+ Log(Form("WARNING-RunType=%s is not one I should handle.",GetRunType()));
+ return;
+ }
+
+ // Load mapping from CDB for this run
+ AliCDBEntry* cdbEntry = GetFromOCDB("Calib", "Mapping");
+ if (!cdbEntry)
{
- Subprocessor(i)->Initialize(run,startTime,endTime);
+ Log("Could not get Mapping from OCDB !");
+ fIsValid = kFALSE;
}
+
+ cdbEntry = GetFromOCDB("Calib", "DDLStore");
+ if (!cdbEntry)
+ {
+ Log("Could not get DDLStore from OCDB");
+ fIsValid = kFALSE;
+ }
+
+ if (IsValid())
+ {
+ // loop over subtasks and initialize them
+ for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
+ {
+ Subprocessor(i)->Initialize(run,startTime,endTime);
+ }
+ }
+ Log(Form("Initialize was %s",( IsValid() ? "fine" : "NOT OK")));
}
//_____________________________________________________________________________
AliMUONPreprocessor::Process(TMap* dcsAliasMap)
{
/// loop over subtasks to make them work
+
+ if (!IsValid())
+ {
+ Log("Will not run as not properly initialized");
+ return 99;
+ }
+
+ if (!IsApplicable())
+ {
+ Log("Nothing to do for me");
+ return 0;
+ }
+
UInt_t rv(0);
for ( Int_t i = 0; i <= fSubprocessors->GetLast(); ++i )
{
rv += Subprocessor(i)->Process(dcsAliasMap);
}
+
return rv;
}