]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONCalibrationData.h
Revert previous commit on AliMUONTrigger
[u/mrichter/AliRoot.git] / MUON / AliMUONCalibrationData.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice                               */
3
4 // $Id$
5
6 /// \ingroup calib
7 /// \class AliMUONCalibrationData
8 /// \brief Single entry point to access MUON calibration data.
9 /// 
10 //  Author Laurent Aphecetche
11
12 #ifndef ALIMUONCALIBRATIONDATA_H
13 #define ALIMUONCALIBRATIONDATA_H
14
15 #ifndef ROOT_TObject
16 #include "TObject.h"
17 #endif
18
19 class AliCDBEntry;
20 class AliMUONTriggerEfficiencyCells;
21 class AliMUONTriggerLut;
22 class AliMUONVStore;
23 class AliMUONVStore;
24 class AliMUONVCalibParam;
25 class AliMUONGlobalCrateConfig;
26 class AliMUONRegionalTriggerConfig;
27 class TMap;
28
29 class AliMUONCalibrationData : public TObject
30 {
31 public:
32   /** Constructor.
33     * @param runNumber is used as a key to the CDB
34     * @param deferredInitialization if kFALSE, all the calibrations are fetched
35     * regardless of whether you'll use them or not.
36     */
37   AliMUONCalibrationData(Int_t runNumber=-1, Bool_t deferredInitialization=kTRUE);
38   virtual ~AliMUONCalibrationData();
39
40   AliMUONVStore* Capacitances() const;
41
42   /// Create a capa store (which must be deleted) from OCDB for the given run
43   static AliMUONVStore* CreateCapacitances(Int_t runNumber, Int_t* startOfValidity=0);
44
45   /// Create a gain store (which must be deleted) from OCDB for the given run
46   static AliMUONVStore* CreateGains(Int_t runNumber, Int_t* startOfValidity=0);
47
48   /// Create a global trigger mask (which must be deleted) from OCDB for the given run
49   static AliMUONGlobalCrateConfig* CreateGlobalTriggerCrateConfig(Int_t runNumber, Int_t* startOfValidity=0);
50   
51   /// Create a hv map (which must be deleted) from OCDB for the given run
52   static TMap* CreateHV(Int_t runNumber, Int_t* startOfValidity=0);
53
54   /// Create a Trigger HV and current  map (which must be deleted) from OCDB for the given run
55   static TMap* CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity=0);
56
57   /// Create a neighbours store (which must be deleted) from OCDB for the given run
58   static AliMUONVStore* CreateNeighbours(Int_t runNumber, Int_t* startOfValidity=0);
59   
60   /// Create a local trigger mask store (which must be deleted) for a given run
61   static AliMUONVStore* CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity=0);
62
63   /// Create a kill map store (which must be deleted) from OCDB for the given run
64   static AliMUONVStore* CreateKillMap(Int_t runNumber, Int_t* startOfValidity=0);
65
66   /// Create a pedestal store (which must be deleted) from OCDB for the given run
67   static AliMUONVStore* CreatePedestals(Int_t runNumber, Int_t* startOfValidity=0);
68
69   /// Create a regional trigger mask store (which must be deleted) for a given run
70   static AliMUONRegionalTriggerConfig* CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity=0);
71
72   /// Create a trigger Look Up Table (which must be deleted) for a given run
73   static AliMUONTriggerLut* CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity=0);
74   /// Create a trigger efficiency map (which must be deleted) for a given run
75   static AliMUONTriggerEfficiencyCells* CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity=0);
76   
77   /// Get all the gains
78   AliMUONVStore* Gains() const;
79
80   /// Get the configuration for the global trigger board.
81   AliMUONGlobalCrateConfig* GlobalTriggerCrateConfig() const;
82     
83   /// Get the Gain calibration object for channels within (detElemId,manuId).
84   AliMUONVCalibParam* Gains(Int_t detElemId, Int_t manuId) const;
85     
86   /// Get the HV values
87   TMap* HV() const;
88
89   /// Get the Trigger HV and current values
90   TMap* TriggerDCS() const;
91     
92   /// Whether this object is valid or not (might be invalid if fetching from CDB failed).
93   Bool_t IsValid() const { return fIsValid; }
94     
95   /// Get the mask for a given local trigger board.
96   AliMUONVCalibParam* LocalTriggerBoardMasks(Int_t localBoardNumber) const;
97     
98   /// Get the neighbours store
99   AliMUONVStore* Neighbours() const;
100   
101   /// Get the pedestal store
102   AliMUONVStore* Pedestals() const;
103
104   /// Get the kill map store
105   AliMUONVStore* KillMap() const;
106
107   /// Get the kill map calibration object for channels within (detElemId,manuId).
108   AliMUONVCalibParam* KillMap(Int_t detElemId, Int_t manuId) const;
109
110   /// Get the Pedestal calibration object for channels within (detElemId,manuId).
111   AliMUONVCalibParam* Pedestals(Int_t detElemId, Int_t manuId) const;
112   
113   /// Dump to screen.
114   virtual void Print(Option_t* opt="") const;
115
116   /// Get the config for regional trigger.
117   AliMUONRegionalTriggerConfig* RegionalTriggerConfig() const;
118
119
120   /// The runnumber used by this object.
121   Int_t RunNumber() const { return fRunNumber; }
122   
123   /// Get the trigger Look Up Table.
124   AliMUONTriggerLut* TriggerLut() const;
125   
126   /// Get the trigger efficiency map
127   AliMUONTriggerEfficiencyCells* TriggerEfficiency() const;
128   
129   void Reset();
130
131   static TObject* CreateObject(Int_t runNumber, const char* path, Int_t* startOfValidity=0x0);
132   
133   static void Check(Int_t runNumber);
134   
135 protected:
136   /// Not implemented
137   AliMUONCalibrationData(const AliMUONCalibrationData& other);
138   /// Not implemented
139   AliMUONCalibrationData& operator=(const AliMUONCalibrationData& other);
140   
141 private:
142   mutable Bool_t fIsValid; ///<  Whether we were able to correctly initialize
143   Int_t fRunNumber; ///<  The run number for which we hold calibrations
144   mutable AliMUONVStore* fGains; //!< Gains
145   mutable AliMUONVStore* fPedestals; //!< Pedestals
146   mutable TMap* fHV; //!< HV
147   mutable TMap* fTriggerDCS; //!< Trigger HV and Currents
148   mutable AliMUONVStore* fLocalTriggerBoardMasks; //!< Local trigger board maska  
149   mutable AliMUONRegionalTriggerConfig* fRegionalTriggerConfig; //!< Regional trigger config
150   mutable AliMUONGlobalCrateConfig* fGlobalTriggerCrateConfig; //!< Global trigger crate config
151   
152   mutable AliMUONTriggerLut* fTriggerLut; //!< TRigger LUTs
153   mutable AliMUONTriggerEfficiencyCells* fTriggerEfficiency; //!< Trigger efficiency cells
154   mutable AliMUONVStore* fCapacitances; //!< Manu capacitances
155   mutable AliMUONVStore* fNeighbours; //!< list of neighbours for all channels
156   
157   mutable AliMUONVStore* fKillMap; //!< kill map
158   
159   ClassDef(AliMUONCalibrationData,9) // Storage for all MUON calibration data.
160 };
161
162 #endif