#if !defined(__CINT__) || defined(__MAKECINT__)
+/// \ingroup macros
+/// \file TestMUONPreprocessor.C
+/// \brief The macro for testing the shuttle preprocessors
+///
/// This macro runs the test preprocessor for MUON.
/// It uses AliTestShuttle to simulate a full Shuttle process
///
/// here by CreateDCSAliasMap() for tracker HV).
///
/// To play with it, you'll have to set/modify several lines, to
-/// a) select input files, using shuttle->AddInputFile()
-/// b) select run type, using shuttle->AddInputRunParameter() (the run type
-/// dictates which task is really performed by the MUONPreprocessor
+/// - a) select input files, using shuttle->AddInputFile()
+/// - b) select run type, using shuttle->AddInputRunParameter() (the run type
+/// dictates which task is really performed by the MUONPreprocessor
+///
+/// You must load relevant libraries (besides normal MUON ones) before
+/// compiling this macro :
+/// <pre>
+/// gSystem->Load("$ALICE_ROOT/SHUTTLE/TestShuttle/libTestShuttle");
+/// gSystem->Load("libMUONshuttle.so");
+/// </pre>
///
-/// For more information on usage, please see READMEshuttle.
+/// For more information on usage, please see the \ref README_shuttle page.
///
-// By Laurent Aphecetche, SUBATECH Nantes
+/// \author Laurent Aphecetche, SUBATECH Nantes
#include "TestMUONPreprocessor.h"
+
+#include "AliMUONTrackerPreprocessor.h"
+#include "AliMUONTriggerPreprocessor.h"
+
+#include "AliLog.h"
+
+#include "AliMpExMap.h"
+#include "AliMpHelper.h"
+#include "AliMpHVNamer.h"
+#include "AliMpCDB.h"
+
#include "AliCDBManager.h"
-#include "AliShuttleInterface.h"
+#include "AliCDBEntry.h"
#include "AliCDBId.h"
+#include "AliShuttleInterface.h"
#include "AliTestShuttle.h"
-#include "TMap.h"
+#include "AliDCSValue.h"
+
#include "Riostream.h"
#include "TSystem.h"
-#include "AliMpExMap.h"
#include "TMap.h"
-#include "TString.h"
#include "TObjArray.h"
-#include "AliMpHelper.h"
-#include "AliDCSValue.h"
#include "TObjString.h"
+#include "TString.h"
#include "TRandom.h"
-#include "AliMUONPreprocessor.h"
-#include "AliCDBEntry.h"
-#include "AliMUONHVNamer.h"
#endif
-void TestMUONPreprocessor(Int_t runNumber=1500)
+void TestMUONPreprocessor(Int_t runNumber=80, const char* runType="CALIBRATION")
{
- // load library
- gSystem->Load("../SHUTTLE/TestShuttle/libTestShuttle.so");
- gSystem->Load("libMUONshuttle.so");
+ // runType can be :
+ //
+ // PEDESTAL -> pedestals
+ // CALIBRATION -> gains
+ // PHYSICS -> HV
+ // GMS
- // initialize location of CDB
- AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
-
// create AliTestShuttle instance
// The parameters are run, startTime, endTime
AliTestShuttle* shuttle = new AliTestShuttle(runNumber, 0, 1);
+
+ const char* inputCDB = "local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB";
+
+ AliTestShuttle::SetMainCDB(inputCDB);
+ AliTestShuttle::SetMainRefStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestReference");
- // Create DCS HV aliases
- TMap* dcsAliasMap = CreateDCSAliasMap();
-
- // now give the alias map to the shuttle
- shuttle->SetDCSInput(dcsAliasMap);
-
+ TString rt(runType);
+ rt.ToUpper();
+
+ if ( rt.Contains("PHYSICS") )
+ {
+ // Create DCS HV aliases
+ TMap* dcsAliasMap = CreateDCSAliasMap(inputCDB, runNumber);
+
+ if ( dcsAliasMap )
+ {
+ // now give the alias map to the shuttle
+ shuttle->SetDCSInput(dcsAliasMap);
+ }
+ }
+
+ printf("Test Shuttle temp dir: %s\n", AliShuttleInterface::GetShuttleTempDir());
+ printf("Test Shuttle log dir: %s\n", AliShuttleInterface::GetShuttleLogDir());
+ printf("Test OCDB storage Uri: %s\n", AliShuttleInterface::GetMainCDB().Data());
+ printf("Test Reference storage Uri: %s\n", AliShuttleInterface::GetMainRefStorage().Data());
+
// The shuttle can process files that originate from DCS, DAQ and HLT.
// To test it, we provide some local files and locations where these would be found when
// the online machinery would be there.
// AddInputFile(<system>, <detector>, <id>, <source>, <local-file>)
// In this example we add 4 files originating from different LDCs but with the same id (PEDESTALS)
- shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC0","$ALICE_ROOT/MUON/data/LDC0.ped");
- shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC1","$ALICE_ROOT/MUON/data/LDC1.ped");
- shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC2","$ALICE_ROOT/MUON/data/LDC2.ped");
- shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC3","$ALICE_ROOT/MUON/data/LDC3.ped");
+// shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC0","$ALICE_ROOT/MUON/data/LDC0.ped");
+// shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC1","$ALICE_ROOT/MUON/data/LDC1.ped");
+// shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC2","$ALICE_ROOT/MUON/data/LDC2.ped");
+// shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC3","$ALICE_ROOT/MUON/data/LDC3.ped");
+
+ shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC0","$HOME/Alice/Online/GAINRUN/raw.81.LDC0.ped");
+ shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC1","$HOME/Alice/Online/GAINRUN/raw.81.LDC1.ped");
+ shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC2","$HOME/Alice/Online/GAINRUN/raw.81.LDC2.ped");
+// shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","PEDESTALS","LDC3","$HOME/Alice/Online/GAINRUN/raw.81.LDC3.ped");
+
+// shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC0","$HOME/Desktop/Jean-Luc Charvet/run000001191_MCH_ldc-MTRK-S1-0_GAINS");
+
+// shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC0","$HOME/Desktop/Jean-Luc Charvet/run000001183_MCH_ldc-MTRK-S1-0_GAINS");
+
+ shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC0","$HOME/Alice/Online/GAINRUN/LDC0.gain");
+// shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC1","$ALICE_ROOT/MUON/data/LDC1.gain");
+// shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC2","$ALICE_ROOT/MUON/data/LDC2.gain");
+// shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GAINS","LDC3","$ALICE_ROOT/MUON/data/LDC3.gain");
// and GMS file
- shuttle->AddInputFile(AliTestShuttle::kDAQ,"MCH","GMS","GMS","$ALICE_ROOT/MUON/data/GMS.root");
+ shuttle->AddInputFile(AliTestShuttle::kDCS,"MCH","GMS","GMS","$ALICE_ROOT/MUON/data/GMS.root");
+ // and then the trigger stuff
+ shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","LOCAL","LDC0","$ALICE_ROOT/MUON/data/MtgLocalMask-1.dat");
+ shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","REGIONAL","LDC0","$ALICE_ROOT/MUON/data/MtgRegionalCrate-1.dat");
+ shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","GLOBAL","LDC0","$ALICE_ROOT/MUON/data/MtgGlobalCrate-1.dat");
+ shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","LUT","LDC0","$ALICE_ROOT/MUON/data/MtgLocalLut-1.dat");
+ shuttle->AddInputFile(AliTestShuttle::kDAQ,"MTR","EXPORTED","LDC0","$ALICE_ROOT/MUON/data/ExportedFiles.dat");
+
// The shuttle can read run parameters stored in the DAQ run logbook.
// To test it, we must provide the run parameters manually. They will be retrieved in the preprocessor
// using GetRunParameter function.
// In real life the parameters will be retrieved automatically from the run logbook;
- shuttle->AddInputRunParameter("RunType", "PEDESTAL_RUN");
-// shuttle->AddInputRunParameter("RunType", "PHYSICS");
- // PEDESTAL_RUN -> pedestals
- // ELECTRONICS_CALIBRATION_RUN -> gains
- // PHYSICS ? -> HV
+ shuttle->SetInputRunType(runType);
// Create the preprocessor that should be tested, it registers itself automatically to the shuttle
- new AliMUONPreprocessor("MCH", shuttle);
-
+ new AliMUONTrackerPreprocessor(shuttle);
+ new AliMUONTriggerPreprocessor(shuttle);
+
shuttle->Print();
// Test the preprocessor
shuttle->Process();
}
-TMap* CreateDCSAliasMap()
+TMap* CreateDCSAliasMap(const char* inputCDB, Int_t runNumber)
{
/// Creates a DCS structure for MUON Tracker HV
///
/// <valueList> is a TObjArray of AliDCSValue
/// An AliDCSValue consists of timestamp and a value in form of a AliSimpleValue
+ Bool_t undefStorage(kFALSE);
+
+ AliCDBManager* man = AliCDBManager::Instance();
+ if (!man->IsDefaultStorageSet())
+ {
+ undefStorage = kTRUE;
+ man->SetDefaultStorage(inputCDB);
+ man->SetRun(runNumber);
+ }
+
+ // Load mapping
+ Bool_t ok = AliMpCDB::LoadDDLStore();
+
+ if (undefStorage)
+ {
+ man->UnsetDefaultStorage();
+ }
+
+ if (!ok)
+ {
+ AliErrorGeneral("CreateDCSAliasMap","Could not load DDLStore from OCDB");
+ return 0x0;
+ }
+
TMap* aliasMap = new TMap;
aliasMap->SetOwner(kTRUE);
TRandom random(0);
- AliMUONHVNamer hvNamer;
+ AliMpHVNamer hvNamer;
TObjArray* aliases = hvNamer.GenerateAliases();
for ( UInt_t timeStamp = 0; timeStamp < 60*15; timeStamp += 120 )
{
Float_t value = random.Gaus(1750,62.5);
- if ( aliasName == "MchHvLvLeft/Chamber01Left/Quad3Sect2.actual.vMon") value = 500;
-// if ( aliasName == "MchHvLvLeft/Chamber05Left/Slat07.actual.vMon") value = 1300;
-// if ( aliasName == "MchHvLvLeft/Chamber05Left/Slat03.actual.vMon") value = 2500;
+ if ( aliasName == "MchHvLvLeft/Chamber00Left/Quad2Sect1.actual.vMon") value = 500;
AliDCSValue* dcsValue = new AliDCSValue(value,timeStamp);
valueSet->Add(dcsValue);
}
+ if ( aliasName == "MchHvLvLeft/Chamber04Left/Slat06.actual.vMon" ) continue;
aliasMap->Add(new TObjString(*alias),valueSet);
}
}