]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONCalibrationData.h
- Moving AliMUONTriggerCrateStore from base to trigger,
[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);
44
45   /// Create a gain store (which must be deleted) from OCDB for the given run
46   static AliMUONVStore* CreateGains(Int_t runNumber);
47
48   /// Create a global trigger mask (which must be deleted) from OCDB for the given run
49   static AliMUONGlobalCrateConfig* CreateGlobalTriggerCrateConfig(Int_t runNumber);
50   
51   /// Create a hv map (which must be deleted) from OCDB for the given run
52   static TMap* CreateHV(Int_t runNumber);
53
54   /// Create a neighbours store (which must be deleted) from OCDB for the given run
55   static AliMUONVStore* CreateNeighbours(Int_t runNumber);
56   
57   /// Create a local trigger mask store (which must be deleted) for a given run
58   static AliMUONVStore* CreateLocalTriggerBoardMasks(Int_t runNumber);
59
60   /// Create a pedestal store (which must be deleted) from OCDB for the given run
61   static AliMUONVStore* CreatePedestals(Int_t runNumber);
62
63   /// Create a regional trigger mask store (which must be deleted) for a given run
64   static AliMUONRegionalTriggerConfig* CreateRegionalTriggerConfig(Int_t runNumber);
65
66   /// Create a trigger Look Up Table (which must be deleted) for a given run
67   static AliMUONTriggerLut* CreateTriggerLut(Int_t runNumber);
68   
69   /// Create a trigger efficiency map (which must be deleted) for a given run
70   static AliMUONTriggerEfficiencyCells* CreateTriggerEfficiency(Int_t runNumber);
71   
72   /// Get all the gains
73   AliMUONVStore* Gains() const;
74
75   /// Get the configuration for the global trigger board.
76   AliMUONGlobalCrateConfig* GlobalTriggerCrateConfig() const;
77     
78   /// Get the Gain calibration object for channels within (detElemId,manuId).
79   AliMUONVCalibParam* Gains(Int_t detElemId, Int_t manuId) const;
80     
81   /// Get the HV values
82   TMap* HV() const;
83     
84   /// Whether this object is valid or not (might be invalid if fetching from CDB failed).
85   Bool_t IsValid() const { return fIsValid; }
86     
87   /// Get the mask for a given local trigger board.
88   AliMUONVCalibParam* LocalTriggerBoardMasks(Int_t localBoardNumber) const;
89     
90   /// Get the neighbours store
91   AliMUONVStore* Neighbours() const;
92   
93   /// Get the pedestal store
94   AliMUONVStore* Pedestals() const;
95   
96   /// Get the Pedestal calibration object for channels within (detElemId,manuId).
97   AliMUONVCalibParam* Pedestals(Int_t detElemId, Int_t manuId) const;
98   
99   /// Dump to screen.
100   virtual void Print(Option_t* opt="") const;
101
102   /// Get the config for regional trigger.
103   AliMUONRegionalTriggerConfig* RegionalTriggerConfig() const;
104
105
106   /// The runnumber used by this object.
107   Int_t RunNumber() const { return fRunNumber; }
108   
109   /// Get the trigger Look Up Table.
110   AliMUONTriggerLut* TriggerLut() const;
111   
112   /// Get the trigger efficiency map
113   AliMUONTriggerEfficiencyCells* TriggerEfficiency() const;
114   
115   void Reset();
116
117   static TObject* CreateObject(Int_t runNumber, const char* path);
118   
119 protected:
120   /// Not implemented
121   AliMUONCalibrationData(const AliMUONCalibrationData& other);
122   /// Not implemented
123   AliMUONCalibrationData& operator=(const AliMUONCalibrationData& other);
124   
125 private:
126   mutable Bool_t fIsValid; ///<  Whether we were able to correctly initialize
127   Int_t fRunNumber; ///<  The run number for which we hold calibrations
128   mutable AliMUONVStore* fGains; //!< Gains
129   mutable AliMUONVStore* fPedestals; //!< Pedestals
130   mutable TMap* fHV; //!< HV
131   mutable AliMUONVStore* fLocalTriggerBoardMasks; //!< Local trigger board maska  
132   mutable AliMUONRegionalTriggerConfig* fRegionalTriggerConfig; //!< Regional trigger config
133   mutable AliMUONGlobalCrateConfig* fGlobalTriggerCrateConfig; //!< Global trigger crate config
134   
135   mutable AliMUONTriggerLut* fTriggerLut; //!< TRigger LUTs
136   mutable AliMUONTriggerEfficiencyCells* fTriggerEfficiency; //!< Trigger efficiency cells
137   mutable AliMUONVStore* fCapacitances; //!< Manu capacitances
138   mutable AliMUONVStore* fNeighbours; //!< list of neighbours for all channels
139   
140   ClassDef(AliMUONCalibrationData,7) // Storage for all MUON calibration data.
141 };
142
143 #endif