/* $Id$ */
-/// \ingroup base
-/// \class AliMUONCDB
-/// \brief Helper class to experience the OCDB
+/// \ingroup rec
+/// \namespace AliMUONCDB
+/// \brief Helper functions to experience the OCDB
///
// Author Laurent Aphecetche
-#include <TObject.h>
#include <TString.h>
+#include "AliCDBRunRange.h"
+#include <vector>
-class TList;
-class AliMUONV1DStore;
-class AliMUONV2DStore;
+class AliMUONVStore;
class TMap;
+class TClonesArray;
class AliMUONVCalibParam;
class AliMUONTriggerLut;
class AliMUONTriggerEfficiencyCells;
+class AliMUONRegionalTriggerConfig;
+class AliMUONGlobalCrateConfig;
+class AliMUONRejectList;
+class AliMUONRecoParam;
+class TH1;
-#define ALIMUONCDBINFINITY 99999999
-
-class AliMUONCDB : public TObject
+namespace AliMUONCDB
{
-public:
- /// Ctor. change the path for testing the Shuttle preprocessor, to
- /// "local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB"
- AliMUONCDB(const char* cdbpath = "local://$ALICE_ROOT");
- virtual ~AliMUONCDB();
+ Bool_t CheckOCDB(Bool_t pathOnly = kFALSE);
+ Bool_t CheckMapping(Bool_t segmentationOnly = kFALSE);
+
+ void CheckHV(Int_t runNumber, Int_t verbose=0);
+
+ Bool_t LoadField();
+ Bool_t LoadMapping(Bool_t segmentationOnly = kFALSE);
+ AliMUONRecoParam* LoadRecoParam();
+ TClonesArray* LoadAlignmentData();
- Int_t MakeNeighbourStore(AliMUONV2DStore& neighbourStore);
+ Int_t MakeNeighbourStore(AliMUONVStore& neighbourStore);
Int_t MakeHVStore(TMap& aliasMap, Bool_t defaultValues);
- Int_t MakePedestalStore(AliMUONV2DStore& pedestalStore, Bool_t defaultValues);
- Int_t MakeCapacitanceStore(AliMUONV1DStore& capaStore, Bool_t defaultValues);
- Int_t MakeGainStore(AliMUONV2DStore& gainStore, Bool_t defaultValues);
+ Int_t MakeTriggerDCSStore(TMap& aliasMap, Bool_t defaultValues);
+ Int_t MakePedestalStore(AliMUONVStore& pedestalStore, Bool_t defaultValues);
+ Int_t MakeCapacitanceStore(AliMUONVStore& capaStore, Bool_t defaultValues);
+ Int_t MakeCapacitanceStore(AliMUONVStore& capaStore, const char* file);
+ Int_t MakeGainStore(AliMUONVStore& gainStore, Bool_t defaultValues);
+ Int_t MakeOccupancyMapStore(AliMUONVStore& occupancyMap, Bool_t defaultValues);
+ AliMUONRejectList* MakeRejectListStore(Bool_t defaultValues);
- Int_t MakeLocalTriggerMaskStore(AliMUONV1DStore& ltm) const;
- Int_t MakeRegionalTriggerMaskStore(AliMUONV1DStore& rtm) const;
- Int_t MakeGlobalTriggerMaskStore(AliMUONVCalibParam& gtm) const;
- AliMUONTriggerLut* MakeTriggerLUT(const char* file="$(ALICE_ROOT)/MUON/data/lutAptLpt1Hpt1p7.root") const;
- AliMUONTriggerEfficiencyCells* MakeTriggerEfficiency(const char* file="$ALICE_ROOT/MUON/data/efficiencyCells.dat") const;
+ Int_t MakeLocalTriggerMaskStore(AliMUONVStore& ltm);
+ Int_t MakeRegionalTriggerConfigStore(AliMUONRegionalTriggerConfig& rtm);
+ Int_t MakeGlobalTriggerConfigStore(AliMUONGlobalCrateConfig& gtm);
+
+ AliMUONTriggerLut* MakeTriggerLUT(const char* file="$(ALICE_ROOT)/MUON/data/lutAptLpt1Hpt1p7.root");
+ AliMUONTriggerEfficiencyCells* MakeTriggerEfficiency(const char* file="$ALICE_ROOT/MUON/data/efficiencyCells.dat");
- /// Compute the difference between two (compatible) stores
- AliMUONV2DStore* Diff(AliMUONV2DStore& store1, AliMUONV2DStore& store2,
- const char* opt="abs");
-
- void Plot(const AliMUONV2DStore& store, const char* name, Int_t nbins=512);
+ AliMUONVStore* Diff(AliMUONVStore& store1, AliMUONVStore& store2, const char* opt="abs");
+
+ TH1** Plot(const AliMUONVStore& store, const char* name, Int_t nbins=512);
- void WriteToCDB(const char* calibpath, TObject* object,
- Int_t startRun, Int_t endRun, Bool_t defaultValues);
+ void ReadIntegers(const char* filename, std::vector<int>& integers);
- void WriteTrigger(Int_t startRun=0,Int_t endRun=ALIMUONCDBINFINITY);
- void WriteTracker(Bool_t defaultValues=kTRUE, Int_t startRun=0,Int_t endRun=ALIMUONCDBINFINITY);
+ void ShowConfig(Bool_t withStatusMap=kFALSE);
- void WriteNeighbours(Int_t startRun=0, Int_t endRun=ALIMUONCDBINFINITY);
- void WriteHV(Bool_t defaultValues, Int_t startRun, Int_t endRun);
- void WritePedestals(Bool_t defaultValues, Int_t startRun, Int_t endRun=ALIMUONCDBINFINITY);
- void WriteGains(Bool_t defaultValues, Int_t startRun, Int_t endRun=ALIMUONCDBINFINITY);
- void WriteCapacitances(Bool_t defaultValues, Int_t startRun=0, Int_t endRun=ALIMUONCDBINFINITY);
+ void ShowCapacitances();
- void WriteLocalTriggerMasks(Int_t startRun=0, Int_t endRun=ALIMUONCDBINFINITY);
- void WriteRegionalTriggerMasks(Int_t startRun=0, Int_t endRun=ALIMUONCDBINFINITY);
- void WriteGlobalTriggerMasks(Int_t startRun=0, Int_t endRun=ALIMUONCDBINFINITY);
- void WriteTriggerLut(Int_t startRun=0, Int_t endRun=ALIMUONCDBINFINITY);
- void WriteTriggerEfficiency(Int_t startRun=0, Int_t endRun=ALIMUONCDBINFINITY);
+ void ShowFaultyBusPatches(const char* runlist,
+ double occLimit=0.1,
+ const char* outputBaseName="faulty.buspatches",
+ const char* ocdbPath="raw://");
-private:
- AliMUONCDB(const AliMUONCDB& rhs);
- AliMUONCDB& operator=(const AliMUONCDB& rhs);
+ void WriteToCDB(const char* calibpath, TObject* object,
+ Int_t startRun, Int_t endRun, Bool_t defaultValues);
+ void WriteToCDB(const char* calibpath, TObject* object,
+ Int_t startRun, Int_t endRun, const char* filename);
+ void WriteToCDB(TObject* object, const char* calibpath, Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity(),
+ const char* comment="", const char* responsible="AliMUONCDB tester class");
+
+ void WriteTrigger(Bool_t defaultValues=kTRUE, Int_t startRun=0,Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteTracker(Bool_t defaultValues=kTRUE, Int_t startRun=0,Int_t endRun=AliCDBRunRange::Infinity());
-private:
- TString fCDBPath; //!< where to write stuff
- TList* fManuList; //!< full list of manus
- static const Int_t fgkMaxNofChannelsPerManu; //!< 64
+ void WriteNeighbours(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteHV(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
+ void WritePedestals(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteGains(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteCapacitances(Bool_t defaultValues, Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteCapacitances(const char* file, Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteOccupancyMap(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteRejectList(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteConfig(Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
+
+ void WriteLocalTriggerMasks(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteRegionalTriggerConfig(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteGlobalTriggerConfig(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity());
- ClassDef(AliMUONCDB,0) // Helper class to experience OCDB
-};
+ void WriteTriggerDCS(Bool_t defaultValues, Int_t startRun, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteTriggerLut(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity());
+ void WriteTriggerEfficiency(Int_t startRun=0, Int_t endRun=AliCDBRunRange::Infinity());
+}
#endif