]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONCalibrationData.h
https://savannah.cern.ch/bugs/index.php?98544
[u/mrichter/AliRoot.git] / MUON / AliMUONCalibrationData.h
CommitLineData
c5bdf179 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2* See cxx source for full Copyright notice */
3
4// $Id$
5
e41c38cf 6/// \ingroup calib
c5bdf179 7/// \class AliMUONCalibrationData
c3ce65fd 8/// \brief Single entry point to access MUON calibration data.
c5bdf179 9///
5398f946 10// Author Laurent Aphecetche
c5bdf179 11
12#ifndef ALIMUONCALIBRATIONDATA_H
13#define ALIMUONCALIBRATIONDATA_H
14
15#ifndef ROOT_TObject
16#include "TObject.h"
17#endif
18
19class AliCDBEntry;
0045b488 20class AliMUONGlobalCrateConfig;
21class AliMUONRegionalTriggerConfig;
22class AliMUONRejectList;
e7d7fa47 23class AliMUONTriggerEfficiencyCells;
24class AliMUONTriggerLut;
0045b488 25class AliMUONVCalibParam;
a0eca509 26class AliMUONVStore;
27class AliMUONVStore;
48ed403b 28class TMap;
c5bdf179 29
30class AliMUONCalibrationData : public TObject
31{
32public:
c3ce65fd 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 */
c5bdf179 38 AliMUONCalibrationData(Int_t runNumber=-1, Bool_t deferredInitialization=kTRUE);
39 virtual ~AliMUONCalibrationData();
c3ce65fd 40
a0eca509 41 AliMUONVStore* Capacitances() const;
5562688f 42
43 /// Create a capa store (which must be deleted) from OCDB for the given run
143cd71a 44 static AliMUONVStore* CreateCapacitances(Int_t runNumber, Int_t* startOfValidity=0);
5562688f 45
46 /// Create a gain store (which must be deleted) from OCDB for the given run
143cd71a 47 static AliMUONVStore* CreateGains(Int_t runNumber, Int_t* startOfValidity=0);
5562688f 48
49 /// Create a global trigger mask (which must be deleted) from OCDB for the given run
143cd71a 50 static AliMUONGlobalCrateConfig* CreateGlobalTriggerCrateConfig(Int_t runNumber, Int_t* startOfValidity=0);
c1bbaf66 51
5562688f 52 /// Create a hv map (which must be deleted) from OCDB for the given run
b37b9546 53 static TMap* CreateHV(Int_t runNumber, Int_t* startOfValidity=0, Bool_t patched=kTRUE, TList* messages=0x0);
5562688f 54
49e110ec 55 /// Create a Trigger HV and current map (which must be deleted) from OCDB for the given run
56 static TMap* CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity=0);
57
5562688f 58 /// Create a neighbours store (which must be deleted) from OCDB for the given run
143cd71a 59 static AliMUONVStore* CreateNeighbours(Int_t runNumber, Int_t* startOfValidity=0);
c5bdf179 60
5562688f 61 /// Create a local trigger mask store (which must be deleted) for a given run
143cd71a 62 static AliMUONVStore* CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity=0);
e7d7fa47 63
7eafe398 64 /// Create an occupancy map store (which must be deleted) from OCDB for the given run
65 static AliMUONVStore* CreateOccupancyMap(Int_t runNumber, Int_t* startOfValidity=0);
2b8a1212 66
0045b488 67 /// Create a rejectlist store (which must be deleted) from OCDB for the given run
68 static AliMUONRejectList* CreateRejectList(Int_t runNumber, Int_t* startOfValidity=0);
69
5562688f 70 /// Create a pedestal store (which must be deleted) from OCDB for the given run
143cd71a 71 static AliMUONVStore* CreatePedestals(Int_t runNumber, Int_t* startOfValidity=0);
c3ce65fd 72
6c870207 73 /// Create a configuration store (which must be deleted) from OCDB for the given run
74 static AliMUONVStore* CreateConfig(Int_t runNumber, Int_t* startOfValidity=0);
75
5562688f 76 /// Create a regional trigger mask store (which must be deleted) for a given run
143cd71a 77 static AliMUONRegionalTriggerConfig* CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity=0);
48ed403b 78
5562688f 79 /// Create a trigger Look Up Table (which must be deleted) for a given run
143cd71a 80 static AliMUONTriggerLut* CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity=0);
5562688f 81 /// Create a trigger efficiency map (which must be deleted) for a given run
143cd71a 82 static AliMUONTriggerEfficiencyCells* CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity=0);
5562688f 83
84 /// Get all the gains
85 AliMUONVStore* Gains() const;
86
92c23b09 87 /// Get the configuration for the global trigger board.
88 AliMUONGlobalCrateConfig* GlobalTriggerCrateConfig() const;
5562688f 89
90 /// Get the Gain calibration object for channels within (detElemId,manuId).
91 AliMUONVCalibParam* Gains(Int_t detElemId, Int_t manuId) const;
92
32f1b761 93 /// Get the HV values. Use patched=kFALSE to get unprocessed (i.e. "raw") values as they are in the OCDB
94 TMap* HV(Bool_t patched=kTRUE) const;
49e110ec 95
96 /// Get the Trigger HV and current values
97 TMap* TriggerDCS() const;
5562688f 98
c3ce65fd 99 /// Whether this object is valid or not (might be invalid if fetching from CDB failed).
100 Bool_t IsValid() const { return fIsValid; }
5562688f 101
102 /// Get the mask for a given local trigger board.
103 AliMUONVCalibParam* LocalTriggerBoardMasks(Int_t localBoardNumber) const;
104
105 /// Get the neighbours store
106 AliMUONVStore* Neighbours() const;
c5bdf179 107
5562688f 108 /// Get the pedestal store
a0eca509 109 AliMUONVStore* Pedestals() const;
2b8a1212 110
6c870207 111 /// Get the config store
112 AliMUONVStore* Config() const;
113
7eafe398 114 /// Get the occupancy map store
115 AliMUONVStore* OccupancyMap() const;
2b8a1212 116
0045b488 117 /// Get the reject list store
118 AliMUONRejectList* RejectList() const;
119
c3ce65fd 120 /// Get the Pedestal calibration object for channels within (detElemId,manuId).
e7d7fa47 121 AliMUONVCalibParam* Pedestals(Int_t detElemId, Int_t manuId) const;
c5bdf179 122
c3ce65fd 123 /// Dump to screen.
c5bdf179 124 virtual void Print(Option_t* opt="") const;
e7d7fa47 125
92c23b09 126 /// Get the config for regional trigger.
127 AliMUONRegionalTriggerConfig* RegionalTriggerConfig() const;
128
e7d7fa47 129
c3ce65fd 130 /// The runnumber used by this object.
131 Int_t RunNumber() const { return fRunNumber; }
c5bdf179 132
e7d7fa47 133 /// Get the trigger Look Up Table.
134 AliMUONTriggerLut* TriggerLut() const;
135
136 /// Get the trigger efficiency map
137 AliMUONTriggerEfficiencyCells* TriggerEfficiency() const;
138
c1bbaf66 139 void Reset();
0145e89a 140
143cd71a 141 static TObject* CreateObject(Int_t runNumber, const char* path, Int_t* startOfValidity=0x0);
c1bbaf66 142
630711ed 143 static void Check(Int_t runNumber);
b37b9546 144
8f29b706 145 static void BypassStores(AliMUONVStore* ped, AliMUONVStore* gain);
146
884a73f1 147protected:
71a2d3aa 148 /// Not implemented
e7d7fa47 149 AliMUONCalibrationData(const AliMUONCalibrationData& other);
71a2d3aa 150 /// Not implemented
e7d7fa47 151 AliMUONCalibrationData& operator=(const AliMUONCalibrationData& other);
b37b9546 152
153 static Bool_t PatchHVValues(TObjArray& values, TString* msg=0x0);
154
155 static Bool_t CheckHVGroup(TObjArray& values, Int_t first, Int_t last, Double_t& value,
156 Int_t& slope, TString* msg);
e7d7fa47 157
5562688f 158private:
71a2d3aa 159 mutable Bool_t fIsValid; ///< Whether we were able to correctly initialize
160 Int_t fRunNumber; ///< The run number for which we hold calibrations
a0eca509 161 mutable AliMUONVStore* fGains; //!< Gains
162 mutable AliMUONVStore* fPedestals; //!< Pedestals
71a2d3aa 163 mutable TMap* fHV; //!< HV
49e110ec 164 mutable TMap* fTriggerDCS; //!< Trigger HV and Currents
92c23b09 165 mutable AliMUONVStore* fLocalTriggerBoardMasks; //!< Local trigger board maska
166 mutable AliMUONRegionalTriggerConfig* fRegionalTriggerConfig; //!< Regional trigger config
167 mutable AliMUONGlobalCrateConfig* fGlobalTriggerCrateConfig; //!< Global trigger crate config
168
71a2d3aa 169 mutable AliMUONTriggerLut* fTriggerLut; //!< TRigger LUTs
170 mutable AliMUONTriggerEfficiencyCells* fTriggerEfficiency; //!< Trigger efficiency cells
a0eca509 171 mutable AliMUONVStore* fCapacitances; //!< Manu capacitances
172 mutable AliMUONVStore* fNeighbours; //!< list of neighbours for all channels
c5bdf179 173
7eafe398 174 mutable AliMUONVStore* fOccupancyMap; //!< occupancy map
2b8a1212 175
0045b488 176 mutable AliMUONRejectList* fRejectList; //!< reject list
8f29b706 177
9ee1d6ff 178 static AliMUONVStore* fgBypassPedestals;
179 static AliMUONVStore* fgBypassGains;
6c870207 180
181 mutable AliMUONVStore* fConfig; //!< configuration of the tracker
182
183 ClassDef(AliMUONCalibrationData,13) // Storage for all MUON calibration data.
c5bdf179 184};
185
186#endif