Line data Source code
1 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 : * See cxx source for full Copyright notice */
3 :
4 : // $Id: AliMUONCalibrationData.h 59457 2012-11-06 12:36:48Z laphecet $
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 AliMUONGlobalCrateConfig;
21 : class AliMUONRegionalTriggerConfig;
22 : class AliMUONRejectList;
23 : class AliMUONTriggerEfficiencyCells;
24 : class AliMUONTriggerLut;
25 : class AliMUONVCalibParam;
26 : class AliMUONVStore;
27 : class AliMUONVStore;
28 : class TMap;
29 :
30 : class AliMUONCalibrationData : public TObject
31 : {
32 : public:
33 : /** Constructor.
34 : * @param runNumber is used as a key to the CDB
35 : * @param deferredInitialization if kFALSE, all the calibrations are fetched
36 : * regardless of whether you'll use them or not.
37 : */
38 : AliMUONCalibrationData(Int_t runNumber=-1, Bool_t deferredInitialization=kTRUE);
39 : virtual ~AliMUONCalibrationData();
40 :
41 : /// Create a global trigger mask (which must be deleted) from OCDB for the given run
42 : static AliMUONGlobalCrateConfig* CreateGlobalTriggerCrateConfig(Int_t runNumber, Int_t* startOfValidity=0);
43 :
44 : /// Create a hv map (which must be deleted) from OCDB for the given run
45 : static TMap* CreateHV(Int_t runNumber, Int_t* startOfValidity=0, Bool_t patched=kTRUE, TList* messages=0x0, Bool_t dryRun=kFALSE);
46 :
47 : /// Create a Trigger HV and current map (which must be deleted) from OCDB for the given run
48 : static TMap* CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity=0);
49 :
50 : /// Create a MCH LV map (which must be deleted) from OCDB for the given run
51 : static TMap* CreateLV(Int_t runNumber, Int_t* startOfValidity=0);
52 :
53 : /// Create a neighbours store (which must be deleted) from OCDB for the given run
54 : static AliMUONVStore* CreateNeighbours(Int_t runNumber, Int_t* startOfValidity=0);
55 :
56 : /// Create a local trigger mask store (which must be deleted) for a given run
57 : static AliMUONVStore* CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity=0);
58 :
59 : /// Create an occupancy map store (which must be deleted) from OCDB for the given run
60 : static AliMUONVStore* CreateOccupancyMap(Int_t runNumber, Int_t* startOfValidity=0);
61 :
62 : /// Create a rejectlist store (which must be deleted) from OCDB for the given run
63 : static AliMUONRejectList* CreateRejectList(Int_t runNumber, Int_t* startOfValidity=0);
64 :
65 : /// Create a pedestal store (which must be deleted) from OCDB for the given run
66 : static AliMUONVStore* CreatePedestals(Int_t runNumber, Int_t* startOfValidity=0);
67 :
68 : /// Create a configuration store (which must be deleted) from OCDB for the given run
69 : static AliMUONVStore* CreateConfig(Int_t runNumber, Int_t* startOfValidity=0);
70 :
71 : /// Create a regional trigger mask store (which must be deleted) for a given run
72 : static AliMUONRegionalTriggerConfig* CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity=0);
73 :
74 : /// Create a trigger Look Up Table (which must be deleted) for a given run
75 : static AliMUONTriggerLut* CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity=0);
76 : /// Create a trigger efficiency map (which must be deleted) for a given run
77 : static AliMUONTriggerEfficiencyCells* CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity=0);
78 :
79 : /// Get the configuration for the global trigger board.
80 : AliMUONGlobalCrateConfig* GlobalTriggerCrateConfig() const;
81 :
82 : /// Get the HV values. Use patched=kFALSE to get unprocessed (i.e. "raw") values as they are in the OCDB
83 : TMap* HV(Bool_t patched=kTRUE) const;
84 :
85 : /// Get the Trigger HV and current values
86 : TMap* TriggerDCS() const;
87 :
88 : /// Get the MCH LV
89 : TMap* LV() const;
90 :
91 : /// Whether this object is valid or not (might be invalid if fetching from CDB failed).
92 4 : Bool_t IsValid() const { return fIsValid; }
93 :
94 : /// Get the mask for a given local trigger board.
95 : AliMUONVCalibParam* LocalTriggerBoardMasks(Int_t localBoardNumber) const;
96 :
97 : /// Get the neighbours store
98 : AliMUONVStore* Neighbours() const;
99 :
100 : /// Get the pedestal store
101 : AliMUONVStore* Pedestals() const;
102 :
103 : /// Get the config store
104 : AliMUONVStore* Config() const;
105 :
106 : /// Get the occupancy map store
107 : AliMUONVStore* OccupancyMap() const;
108 :
109 : /// Get the reject list store
110 : AliMUONRejectList* RejectList() const;
111 :
112 : /// Get the Pedestal calibration object for channels within (detElemId,manuId).
113 : AliMUONVCalibParam* Pedestals(Int_t detElemId, Int_t manuId) const;
114 :
115 : /// Dump to screen.
116 : virtual void Print(Option_t* opt="") const;
117 :
118 : /// Get the config for regional trigger.
119 : AliMUONRegionalTriggerConfig* RegionalTriggerConfig() const;
120 :
121 :
122 : /// The runnumber used by this object.
123 0 : Int_t RunNumber() const { return fRunNumber; }
124 :
125 : /// Get the trigger Look Up Table.
126 : AliMUONTriggerLut* TriggerLut() const;
127 :
128 : /// Get the trigger efficiency map
129 : AliMUONTriggerEfficiencyCells* TriggerEfficiency() const;
130 :
131 : void Reset();
132 :
133 : static TObject* CreateObject(Int_t runNumber, const char* path, Int_t* startOfValidity=0x0);
134 :
135 : static void Check(Int_t runNumber);
136 :
137 : static void BypassStores(AliMUONVStore* ped);
138 :
139 : static void PatchSt1DCSAliases(TMap& hvMap);
140 :
141 : static Bool_t PatchHVValues(TObjArray& values, TString* msg=0x0, Bool_t dryRun=kFALSE);
142 :
143 12 : static UInt_t PatchHVDCSAliasesSt1WasAppliedMask() { return fgkPatchHVDCSAliasesSt1WasAppliedMask; }
144 :
145 12 : static UInt_t PatchHVAllWasAppliedMask() { return fgkPatchHVAllWasAppliedMask; }
146 :
147 : protected:
148 : /// Not implemented
149 : AliMUONCalibrationData(const AliMUONCalibrationData& other);
150 : /// Not implemented
151 : AliMUONCalibrationData& operator=(const AliMUONCalibrationData& other);
152 :
153 : static Bool_t CheckHVGroup(TObjArray& values, Int_t first, Int_t last, Double_t& value,
154 : Int_t& slope, TString* msg);
155 :
156 : static void AddToMap(const TMap& sourceMap,
157 : TMap& destMap,
158 : const TString& key,
159 : const char* source,
160 : const char* dest);
161 :
162 : private:
163 : mutable Bool_t fIsValid; ///< Whether we were able to correctly initialize
164 : Int_t fRunNumber; ///< The run number for which we hold calibrations
165 : mutable AliMUONVStore* fPedestals; //!<! Pedestals
166 : mutable TMap* fHV; //!<! HV
167 : mutable TMap* fTriggerDCS; //!<! Trigger HV and Currents
168 : mutable AliMUONVStore* fLocalTriggerBoardMasks; //!<! Local trigger board maska
169 : mutable AliMUONRegionalTriggerConfig* fRegionalTriggerConfig; //!<! Regional trigger config
170 : mutable AliMUONGlobalCrateConfig* fGlobalTriggerCrateConfig; //!<! Global trigger crate config
171 :
172 : mutable AliMUONTriggerLut* fTriggerLut; //!<! TRigger LUTs
173 : mutable AliMUONTriggerEfficiencyCells* fTriggerEfficiency; //!<! Trigger efficiency cells
174 : mutable AliMUONVStore* fNeighbours; //!<! list of neighbours for all channels
175 :
176 : mutable AliMUONVStore* fOccupancyMap; //!<! occupancy map
177 :
178 : mutable AliMUONRejectList* fRejectList; //!<! reject list
179 :
180 : static AliMUONVStore* fgBypassPedestals;
181 :
182 : mutable AliMUONVStore* fConfig; //!<! configuration of the tracker
183 :
184 : mutable TMap* fLV; //!<! MCH LV
185 :
186 : static UInt_t fgkPatchHVDCSAliasesSt1WasAppliedMask; //!<! mask to indicate that the DCS alias naming is not messed up in St1
187 : static UInt_t fgkPatchHVAllWasAppliedMask; //!<! mask to indicate that HV values were massaged already
188 :
189 88 : ClassDef(AliMUONCalibrationData,17) // Storage for all MUON calibration data.
190 : };
191 :
192 : #endif
|