]>
Commit | Line | Data |
---|---|---|
c5bdf179 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | // $Id$ | |
17 | ||
18 | #include "AliMUONCalibrationData.h" | |
19 | ||
20 | #include "AliCDBEntry.h" | |
21 | #include "AliCDBManager.h" | |
4bec0403 | 22 | #include "AliCodeTimer.h" |
c5bdf179 | 23 | #include "AliLog.h" |
0045b488 | 24 | #include "AliMUONRejectList.h" |
e7d7fa47 | 25 | #include "AliMUONTriggerEfficiencyCells.h" |
26 | #include "AliMUONTriggerLut.h" | |
a0eca509 | 27 | #include "AliMUONVStore.h" |
28 | #include "AliMUONVStore.h" | |
c3ce65fd | 29 | #include "AliMUONVCalibParam.h" |
92c23b09 | 30 | #include "AliMUONGlobalCrateConfig.h" |
31 | #include "AliMUONRegionalTriggerConfig.h" | |
32 | ||
4bec0403 | 33 | #include <Riostream.h> |
34 | #include <TClass.h> | |
35 | #include <TMap.h> | |
c5bdf179 | 36 | |
3d1463c8 | 37 | //----------------------------------------------------------------------------- |
5398f946 | 38 | /// \class AliMUONCalibrationData |
39 | /// | |
48ed403b | 40 | /// For the moment, this class stores pedestals, gains, hv (for tracker) |
41 | /// and lut, masks and efficiencies (for trigger) that are fetched from the CDB. | |
e7d7fa47 | 42 | /// |
43 | /// This class is to be considered as a convenience class. | |
44 | /// Its aim is to ease retrieval of calibration data from the | |
45 | /// condition database. | |
46 | /// | |
47 | /// It acts as a "facade" to a bunch of underlying | |
48 | /// containers/calibration classes. | |
49 | /// | |
5398f946 | 50 | /// \author Laurent Aphecetche |
3d1463c8 | 51 | //----------------------------------------------------------------------------- |
e7d7fa47 | 52 | |
5398f946 | 53 | /// \cond CLASSIMP |
c5bdf179 | 54 | ClassImp(AliMUONCalibrationData) |
5398f946 | 55 | /// \endcond |
c5bdf179 | 56 | |
9ee1d6ff | 57 | AliMUONVStore* AliMUONCalibrationData::fgBypassPedestals(0x0); |
58 | AliMUONVStore* AliMUONCalibrationData::fgBypassGains(0x0); | |
8f29b706 | 59 | |
c5bdf179 | 60 | //_____________________________________________________________________________ |
61 | AliMUONCalibrationData::AliMUONCalibrationData(Int_t runNumber, | |
62 | Bool_t deferredInitialization) | |
63 | : TObject(), | |
64 | fIsValid(kTRUE), | |
65 | fRunNumber(runNumber), | |
66 | fGains(0x0), | |
c3ce65fd | 67 | fPedestals(0x0), |
48ed403b | 68 | fHV(0x0), |
49e110ec | 69 | fTriggerDCS(0x0), |
e7d7fa47 | 70 | fLocalTriggerBoardMasks(0x0), |
92c23b09 | 71 | fRegionalTriggerConfig(0x0), |
72 | fGlobalTriggerCrateConfig(0x0), | |
e7d7fa47 | 73 | fTriggerLut(0x0), |
c1bbaf66 | 74 | fTriggerEfficiency(0x0), |
d067ba7c | 75 | fCapacitances(0x0), |
2b8a1212 | 76 | fNeighbours(0x0), |
0045b488 | 77 | fOccupancyMap(0x0), |
6c870207 | 78 | fRejectList(0x0), |
79 | fConfig(0x0) | |
c5bdf179 | 80 | { |
5398f946 | 81 | /// Default ctor. |
82 | ||
c3ce65fd | 83 | // If deferredInitialization is false, we read *all* calibrations |
84 | // at once. | |
85 | // So when using this class to access only one kind of calibrations (e.g. | |
86 | // only pedestals), you should put deferredInitialization to kTRUE, which | |
87 | // will instruct this object to fetch the data only when neeeded. | |
5398f946 | 88 | |
c5bdf179 | 89 | if ( deferredInitialization == kFALSE ) |
90 | { | |
5562688f | 91 | Gains(); |
92 | Pedestals(); | |
7eafe398 | 93 | OccupancyMap(); |
0045b488 | 94 | RejectList(); |
5562688f | 95 | HV(); |
49e110ec | 96 | TriggerDCS(); |
5562688f | 97 | LocalTriggerBoardMasks(0); |
92c23b09 | 98 | RegionalTriggerConfig(); |
99 | GlobalTriggerCrateConfig(); | |
5562688f | 100 | TriggerLut(); |
101 | TriggerEfficiency(); | |
102 | Capacitances(); | |
103 | Neighbours(); | |
6c870207 | 104 | Config(); |
c5bdf179 | 105 | } |
106 | } | |
107 | ||
c5bdf179 | 108 | //_____________________________________________________________________________ |
109 | AliMUONCalibrationData::~AliMUONCalibrationData() | |
110 | { | |
f436adf2 | 111 | /// Destructor. Note that we're the owner of our pointers if the OCDB cache |
112 | /// is not set. Otherwise the cache is supposed to take care of them... | |
113 | if (!(AliCDBManager::Instance()->GetCacheFlag())) Reset(); | |
c3ce65fd | 114 | } |
c3ce65fd | 115 | |
116 | //_____________________________________________________________________________ | |
5562688f | 117 | AliMUONVStore* |
118 | AliMUONCalibrationData::Capacitances() const | |
c3ce65fd | 119 | { |
5562688f | 120 | /// Create (if needed) and return the internal store for capacitances. |
121 | ||
122 | if (!fCapacitances) | |
c3ce65fd | 123 | { |
5562688f | 124 | fCapacitances = CreateCapacitances(fRunNumber); |
c3ce65fd | 125 | } |
5562688f | 126 | return fCapacitances; |
c5bdf179 | 127 | } |
128 | ||
129 | //_____________________________________________________________________________ | |
5562688f | 130 | AliMUONVStore* |
143cd71a | 131 | AliMUONCalibrationData::CreateCapacitances(Int_t runNumber, Int_t* startOfValidity) |
c5bdf179 | 132 | { |
5562688f | 133 | /// Create capa store from OCDB for a given run |
134 | ||
143cd71a | 135 | return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Capacitances",startOfValidity)); |
5562688f | 136 | } |
5398f946 | 137 | |
5562688f | 138 | //_____________________________________________________________________________ |
139 | AliMUONVStore* | |
143cd71a | 140 | AliMUONCalibrationData::CreateGains(Int_t runNumber, Int_t* startOfValidity) |
5562688f | 141 | { |
142 | /// Create a new gain store from the OCDB for a given run | |
143cd71a | 143 | return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Gains",startOfValidity)); |
c5bdf179 | 144 | } |
145 | ||
146 | //_____________________________________________________________________________ | |
92c23b09 | 147 | AliMUONGlobalCrateConfig* |
143cd71a | 148 | AliMUONCalibrationData::CreateGlobalTriggerCrateConfig(Int_t runNumber, Int_t* startOfValidity) |
c5bdf179 | 149 | { |
92c23b09 | 150 | /// Create the internal store for GlobalTriggerCrateConfig from OCDB |
48ed403b | 151 | |
143cd71a | 152 | return dynamic_cast<AliMUONGlobalCrateConfig*>(CreateObject(runNumber,"MUON/Calib/GlobalTriggerCrateConfig",startOfValidity)); |
48ed403b | 153 | } |
154 | ||
92c23b09 | 155 | |
156 | ||
c1bbaf66 | 157 | //_____________________________________________________________________________ |
5562688f | 158 | TMap* |
143cd71a | 159 | AliMUONCalibrationData::CreateHV(Int_t runNumber, Int_t* startOfValidity) |
c1bbaf66 | 160 | { |
5562688f | 161 | /// Create a new HV map from the OCDB for a given run |
143cd71a | 162 | return dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/HV",startOfValidity)); |
c1bbaf66 | 163 | } |
164 | ||
49e110ec | 165 | //_____________________________________________________________________________ |
166 | TMap* | |
167 | AliMUONCalibrationData::CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity) | |
168 | { | |
169 | /// Create a new Trigger HV and curent map from the OCDB for a given run | |
170 | return dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/TriggerDCS",startOfValidity)); | |
171 | } | |
172 | ||
d067ba7c | 173 | //_____________________________________________________________________________ |
a0eca509 | 174 | AliMUONVStore* |
143cd71a | 175 | AliMUONCalibrationData::CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity) |
d067ba7c | 176 | { |
5562688f | 177 | /// Get the internal store for LocalTriggerBoardMasks from OCDB |
178 | ||
143cd71a | 179 | return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/LocalTriggerBoardMasks",startOfValidity)); |
d067ba7c | 180 | } |
181 | ||
48ed403b | 182 | //_____________________________________________________________________________ |
a0eca509 | 183 | AliMUONVStore* |
143cd71a | 184 | AliMUONCalibrationData::CreateNeighbours(Int_t runNumber, Int_t* startOfValidity) |
48ed403b | 185 | { |
5562688f | 186 | /// Create a neighbour store from the OCDB for a given run |
143cd71a | 187 | return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Neighbours",startOfValidity)); |
c5bdf179 | 188 | } |
189 | ||
d067ba7c | 190 | //_____________________________________________________________________________ |
5562688f | 191 | TObject* |
143cd71a | 192 | AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* startOfValidity) |
d067ba7c | 193 | { |
5562688f | 194 | /// Access the CDB for a given path (e.g. MUON/Calib/Pedestals), |
195 | /// and return the corresponding TObject. | |
d067ba7c | 196 | |
99c136e1 | 197 | AliCodeTimerAutoClass(Form("%d : %s",runNumber,path),0); |
4bec0403 | 198 | |
5562688f | 199 | AliCDBManager* man = AliCDBManager::Instance(); |
200 | ||
465302eb | 201 | AliCDBEntry* entry = man->Get(path,runNumber); |
5562688f | 202 | |
5562688f | 203 | if (entry) |
d067ba7c | 204 | { |
143cd71a | 205 | if ( startOfValidity ) *startOfValidity = entry->GetId().GetFirstRun(); |
206 | ||
4bec0403 | 207 | TObject* object = entry->GetObject(); |
82586209 | 208 | if (!(man->GetCacheFlag())) |
209 | { | |
210 | entry->SetOwner(kFALSE); | |
211 | delete entry; | |
212 | } | |
4bec0403 | 213 | return object; |
214 | } | |
143cd71a | 215 | else |
216 | { | |
217 | if ( startOfValidity ) *startOfValidity = AliCDBRunRange::Infinity(); | |
218 | } | |
219 | ||
0045b488 | 220 | { |
221 | ||
dd0be8a7 | 222 | AliCodeTimerAutoClass(Form("Failed to get %s for run %d",path,runNumber),1); |
0045b488 | 223 | |
224 | } | |
225 | ||
5562688f | 226 | return 0x0; |
d067ba7c | 227 | } |
228 | ||
2b8a1212 | 229 | //_____________________________________________________________________________ |
230 | AliMUONVStore* | |
7eafe398 | 231 | AliMUONCalibrationData::CreateOccupancyMap(Int_t runNumber, Int_t* startOfValidity) |
2b8a1212 | 232 | { |
7eafe398 | 233 | /// Create a new occupancy map store from the OCDB for a given run |
234 | return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/OccupancyMap",startOfValidity)); | |
2b8a1212 | 235 | } |
236 | ||
0045b488 | 237 | //_____________________________________________________________________________ |
238 | AliMUONRejectList* | |
239 | AliMUONCalibrationData::CreateRejectList(Int_t runNumber, Int_t* startOfValidity) | |
240 | { | |
241 | /// Create a new rejectlist store from the OCDB for a given run | |
242 | return dynamic_cast<AliMUONRejectList*>(CreateObject(runNumber,"MUON/Calib/RejectList",startOfValidity)); | |
243 | } | |
244 | ||
c1bbaf66 | 245 | //_____________________________________________________________________________ |
a0eca509 | 246 | AliMUONVStore* |
143cd71a | 247 | AliMUONCalibrationData::CreatePedestals(Int_t runNumber, Int_t* startOfValidity) |
c1bbaf66 | 248 | { |
5562688f | 249 | /// Create a new pedestal store from the OCDB for a given run |
143cd71a | 250 | return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Pedestals",startOfValidity)); |
c1bbaf66 | 251 | } |
252 | ||
6c870207 | 253 | //_____________________________________________________________________________ |
254 | AliMUONVStore* | |
255 | AliMUONCalibrationData::CreateConfig(Int_t runNumber, Int_t* startOfValidity) | |
256 | { | |
257 | /// Create a new config store from the OCDB for a given run | |
258 | return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Config",startOfValidity)); | |
259 | } | |
260 | ||
92c23b09 | 261 | |
c5bdf179 | 262 | //_____________________________________________________________________________ |
92c23b09 | 263 | AliMUONRegionalTriggerConfig* |
143cd71a | 264 | AliMUONCalibrationData::CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity) |
5562688f | 265 | { |
92c23b09 | 266 | /// Create the internal store for RegionalTriggerConfig from OCDB |
5562688f | 267 | |
143cd71a | 268 | return dynamic_cast<AliMUONRegionalTriggerConfig*>(CreateObject(runNumber,"MUON/Calib/RegionalTriggerConfig",startOfValidity)); |
5562688f | 269 | } |
270 | ||
271 | //_____________________________________________________________________________ | |
272 | AliMUONTriggerEfficiencyCells* | |
143cd71a | 273 | AliMUONCalibrationData::CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity) |
c5bdf179 | 274 | { |
5562688f | 275 | /// Create trigger efficiency object from OCBD |
276 | ||
143cd71a | 277 | return dynamic_cast<AliMUONTriggerEfficiencyCells*>(CreateObject(runNumber,"MUON/Calib/TriggerEfficiency",startOfValidity)); |
5562688f | 278 | } |
5398f946 | 279 | |
5562688f | 280 | //_____________________________________________________________________________ |
281 | AliMUONTriggerLut* | |
143cd71a | 282 | AliMUONCalibrationData::CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity) |
5562688f | 283 | { |
284 | /// Create trigger LUT from OCDB | |
285 | ||
143cd71a | 286 | return dynamic_cast<AliMUONTriggerLut*>(CreateObject(runNumber,"MUON/Calib/TriggerLut",startOfValidity)); |
5562688f | 287 | } |
288 | ||
289 | //_____________________________________________________________________________ | |
290 | AliMUONVStore* | |
291 | AliMUONCalibrationData::Gains() const | |
292 | { | |
293 | /// Create (if needed) and return the internal store for gains. | |
9ee1d6ff | 294 | if (fgBypassGains) return fgBypassGains; |
8f29b706 | 295 | |
c5bdf179 | 296 | if (!fGains) |
297 | { | |
5562688f | 298 | fGains = CreateGains(fRunNumber); |
c5bdf179 | 299 | } |
300 | return fGains; | |
301 | } | |
302 | ||
e7d7fa47 | 303 | //_____________________________________________________________________________ |
5562688f | 304 | AliMUONVCalibParam* |
305 | AliMUONCalibrationData::Gains(Int_t detElemId, Int_t manuId) const | |
e7d7fa47 | 306 | { |
5562688f | 307 | /// Return the gains for a given (detElemId, manuId) pair |
308 | /// Note that, unlike the DeadChannel case, if the result is 0x0, that's an | |
309 | /// error (meaning that we should get gains for all channels). | |
5398f946 | 310 | |
5562688f | 311 | AliMUONVStore* gains = Gains(); |
312 | if (!gains) | |
313 | { | |
314 | return 0x0; | |
315 | } | |
316 | ||
317 | return static_cast<AliMUONVCalibParam*>(gains->FindObject(detElemId,manuId)); | |
e7d7fa47 | 318 | } |
319 | ||
320 | //_____________________________________________________________________________ | |
92c23b09 | 321 | AliMUONGlobalCrateConfig* |
322 | AliMUONCalibrationData::GlobalTriggerCrateConfig() const | |
e7d7fa47 | 323 | { |
92c23b09 | 324 | /// Return the config for the global trigger board. |
5562688f | 325 | |
92c23b09 | 326 | if (!fGlobalTriggerCrateConfig) |
e7d7fa47 | 327 | { |
92c23b09 | 328 | fGlobalTriggerCrateConfig = CreateGlobalTriggerCrateConfig(fRunNumber); |
e7d7fa47 | 329 | } |
92c23b09 | 330 | return fGlobalTriggerCrateConfig; |
e7d7fa47 | 331 | } |
332 | ||
92c23b09 | 333 | |
e7d7fa47 | 334 | //_____________________________________________________________________________ |
5562688f | 335 | TMap* |
336 | AliMUONCalibrationData::HV() const | |
e7d7fa47 | 337 | { |
5562688f | 338 | /// Return the calibration for a given (detElemId, manuId) pair |
48ed403b | 339 | |
5562688f | 340 | if (!fHV) |
e7d7fa47 | 341 | { |
5562688f | 342 | fHV = CreateHV(fRunNumber); |
e7d7fa47 | 343 | } |
5562688f | 344 | return fHV; |
e7d7fa47 | 345 | } |
346 | ||
49e110ec | 347 | //_____________________________________________________________________________ |
348 | TMap* | |
349 | AliMUONCalibrationData::TriggerDCS() const | |
350 | { | |
351 | /// Return the calibration for a given (detElemId, manuId) pair | |
352 | ||
353 | if (!fTriggerDCS) | |
354 | { | |
355 | fTriggerDCS = CreateTriggerDCS(fRunNumber); | |
356 | } | |
357 | return fTriggerDCS; | |
358 | } | |
359 | ||
e7d7fa47 | 360 | //_____________________________________________________________________________ |
a0eca509 | 361 | AliMUONVStore* |
5562688f | 362 | AliMUONCalibrationData::Neighbours() const |
e7d7fa47 | 363 | { |
5562688f | 364 | /// Create (if needed) and return the internal store for neighbours. |
365 | if (!fNeighbours) | |
366 | { | |
367 | fNeighbours = CreateNeighbours(fRunNumber); | |
368 | } | |
369 | return fNeighbours; | |
370 | } | |
371 | ||
372 | //_____________________________________________________________________________ | |
373 | AliMUONVCalibParam* | |
374 | AliMUONCalibrationData::LocalTriggerBoardMasks(Int_t localBoardNumber) const | |
375 | { | |
376 | /// Return the masks for a given trigger local board. | |
5398f946 | 377 | |
e7d7fa47 | 378 | if (!fLocalTriggerBoardMasks) |
379 | { | |
5562688f | 380 | fLocalTriggerBoardMasks = CreateLocalTriggerBoardMasks(fRunNumber); |
381 | } | |
382 | ||
383 | if ( fLocalTriggerBoardMasks ) | |
384 | { | |
385 | AliMUONVCalibParam* ltbm = | |
386 | static_cast<AliMUONVCalibParam*>(fLocalTriggerBoardMasks->FindObject(localBoardNumber)); | |
387 | if (!ltbm) | |
e7d7fa47 | 388 | { |
5562688f | 389 | AliError(Form("Could not get mask for localBoardNumber=%d",localBoardNumber)); |
e7d7fa47 | 390 | } |
5562688f | 391 | return ltbm; |
e7d7fa47 | 392 | } |
5562688f | 393 | return 0x0; |
e7d7fa47 | 394 | } |
395 | ||
2b8a1212 | 396 | //_____________________________________________________________________________ |
397 | AliMUONVStore* | |
7eafe398 | 398 | AliMUONCalibrationData::OccupancyMap() const |
2b8a1212 | 399 | { |
7eafe398 | 400 | /// Get occupancy map |
401 | if (!fOccupancyMap) | |
2b8a1212 | 402 | { |
7eafe398 | 403 | fOccupancyMap = CreateOccupancyMap(fRunNumber); |
2b8a1212 | 404 | } |
7eafe398 | 405 | return fOccupancyMap; |
2b8a1212 | 406 | } |
407 | ||
0045b488 | 408 | //_____________________________________________________________________________ |
409 | AliMUONRejectList* | |
410 | AliMUONCalibrationData::RejectList() const | |
411 | { | |
412 | /// Get reject list | |
413 | if (!fRejectList) | |
414 | { | |
415 | fRejectList = CreateRejectList(fRunNumber); | |
416 | } | |
417 | return fRejectList; | |
418 | } | |
419 | ||
8f29b706 | 420 | //_____________________________________________________________________________ |
421 | void | |
422 | AliMUONCalibrationData::BypassStores(AliMUONVStore* ped, AliMUONVStore* gain) | |
423 | { | |
424 | /// Force the use of those pedestals and gains | |
9ee1d6ff | 425 | fgBypassPedestals = ped; |
426 | fgBypassGains = gain; | |
8f29b706 | 427 | |
428 | } | |
429 | ||
c5bdf179 | 430 | //_____________________________________________________________________________ |
a0eca509 | 431 | AliMUONVStore* |
5562688f | 432 | AliMUONCalibrationData::Pedestals() const |
c5bdf179 | 433 | { |
5562688f | 434 | /// Return pedestals |
8f29b706 | 435 | |
9ee1d6ff | 436 | if (fgBypassPedestals) return fgBypassPedestals; |
8f29b706 | 437 | |
c5bdf179 | 438 | if (!fPedestals) |
439 | { | |
5562688f | 440 | fPedestals = CreatePedestals(fRunNumber); |
c5bdf179 | 441 | } |
442 | return fPedestals; | |
443 | } | |
444 | ||
6c870207 | 445 | //_____________________________________________________________________________ |
446 | AliMUONVStore* | |
447 | AliMUONCalibrationData::Config() const | |
448 | { | |
449 | /// Return config | |
450 | ||
451 | if (!fConfig) | |
452 | { | |
453 | fConfig = CreateConfig(fRunNumber); | |
454 | } | |
455 | return fConfig; | |
456 | } | |
457 | ||
5562688f | 458 | //_____________________________________________________________________________ |
459 | AliMUONVCalibParam* | |
460 | AliMUONCalibrationData::Pedestals(Int_t detElemId, Int_t manuId) const | |
461 | { | |
462 | /// Return the pedestals for a given (detElemId, manuId) pair. | |
463 | /// A return value of 0x0 is considered an error, meaning we should get | |
464 | /// pedestals for all channels. | |
465 | ||
466 | AliMUONVStore* pedestals = Pedestals(); | |
467 | if (!pedestals) | |
468 | { | |
469 | return 0x0; | |
470 | } | |
471 | ||
472 | return static_cast<AliMUONVCalibParam*>(pedestals->FindObject(detElemId,manuId)); | |
473 | } | |
474 | ||
c5bdf179 | 475 | //_____________________________________________________________________________ |
476 | void | |
477 | AliMUONCalibrationData::Print(Option_t*) const | |
478 | { | |
5562688f | 479 | /// A very basic dump of our guts. |
5398f946 | 480 | |
c5bdf179 | 481 | cout << "RunNumber " << RunNumber() |
e7d7fa47 | 482 | << " fGains=" << fGains |
483 | << " fPedestals=" << fPedestals | |
6c870207 | 484 | << " fConfig=" << fConfig |
48ed403b | 485 | << " fHV=" << fHV |
49e110ec | 486 | << " fTriggerDCS=" << fTriggerDCS |
e7d7fa47 | 487 | << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks |
92c23b09 | 488 | << " fRegionalTriggerConfig=" << fRegionalTriggerConfig |
489 | << " fGlobalTriggerCrateConfig=" << fGlobalTriggerCrateConfig | |
e7d7fa47 | 490 | << " fTriggerLut=" << fTriggerLut |
c5bdf179 | 491 | << endl; |
492 | } | |
493 | ||
92c23b09 | 494 | |
e7d7fa47 | 495 | //_____________________________________________________________________________ |
92c23b09 | 496 | AliMUONRegionalTriggerConfig* |
497 | AliMUONCalibrationData::RegionalTriggerConfig() const | |
e7d7fa47 | 498 | { |
92c23b09 | 499 | /// Return the config for the regional trigger board. |
48ed403b | 500 | |
92c23b09 | 501 | if (!fRegionalTriggerConfig) |
e7d7fa47 | 502 | { |
92c23b09 | 503 | fRegionalTriggerConfig = CreateRegionalTriggerConfig(fRunNumber); |
e7d7fa47 | 504 | } |
92c23b09 | 505 | return fRegionalTriggerConfig; |
e7d7fa47 | 506 | } |
507 | ||
92c23b09 | 508 | |
e7d7fa47 | 509 | //_____________________________________________________________________________ |
510 | AliMUONTriggerEfficiencyCells* | |
511 | AliMUONCalibrationData::TriggerEfficiency() const | |
512 | { | |
5398f946 | 513 | /// Return the trigger efficiency. |
514 | ||
e7d7fa47 | 515 | if (!fTriggerEfficiency) |
516 | { | |
5562688f | 517 | fTriggerEfficiency = CreateTriggerEfficiency(fRunNumber); |
e7d7fa47 | 518 | } |
519 | return fTriggerEfficiency; | |
520 | } | |
521 | ||
5562688f | 522 | |
e7d7fa47 | 523 | //_____________________________________________________________________________ |
524 | AliMUONTriggerLut* | |
525 | AliMUONCalibrationData::TriggerLut() const | |
526 | { | |
5398f946 | 527 | /// Return the trigger look up table. |
528 | ||
e7d7fa47 | 529 | if (!fTriggerLut) |
530 | { | |
5562688f | 531 | fTriggerLut = CreateTriggerLut(fRunNumber); |
e7d7fa47 | 532 | } |
533 | return fTriggerLut; | |
534 | } | |
535 | ||
c1bbaf66 | 536 | //_____________________________________________________________________________ |
537 | void | |
538 | AliMUONCalibrationData::Reset() | |
539 | { | |
540 | /// Reset all data | |
541 | ||
82586209 | 542 | AliCodeTimerAuto("",0); |
543 | ||
6c870207 | 544 | delete fConfig; |
545 | fConfig = 0x0; | |
c1bbaf66 | 546 | delete fPedestals; |
547 | fPedestals = 0x0; | |
548 | delete fGains; | |
549 | fGains = 0x0; | |
550 | delete fHV; | |
551 | fHV = 0x0; | |
49e110ec | 552 | delete fTriggerDCS; |
553 | fTriggerDCS = 0x0; | |
c1bbaf66 | 554 | delete fLocalTriggerBoardMasks; |
555 | fLocalTriggerBoardMasks = 0x0; | |
92c23b09 | 556 | delete fRegionalTriggerConfig; |
557 | fRegionalTriggerConfig = 0x0; | |
558 | delete fGlobalTriggerCrateConfig; | |
559 | fGlobalTriggerCrateConfig = 0x0; | |
560 | ||
c1bbaf66 | 561 | delete fTriggerLut; |
562 | fTriggerLut = 0x0; | |
563 | delete fTriggerEfficiency; | |
564 | fTriggerEfficiency = 0x0; | |
565 | delete fCapacitances; | |
566 | fCapacitances = 0x0; | |
d067ba7c | 567 | delete fNeighbours; |
568 | fNeighbours = 0x0; | |
c1bbaf66 | 569 | } |
570 | ||
630711ed | 571 | //_____________________________________________________________________________ |
572 | void | |
573 | AliMUONCalibrationData::Check(Int_t runNumber) | |
574 | { | |
575 | /// Self-check to see if we can read all data for a given run | |
576 | /// from the current OCDB... | |
577 | ||
578 | if ( ! CreateCapacitances(runNumber) ) | |
579 | { | |
580 | AliErrorClass("Could not read capacitances"); | |
581 | } | |
582 | else | |
583 | { | |
584 | AliInfoClass("Capacitances read OK"); | |
585 | } | |
586 | ||
587 | if ( ! CreateGains(runNumber) ) | |
588 | { | |
589 | AliErrorClass("Could not read gains"); | |
590 | } | |
591 | else | |
592 | { | |
593 | AliInfoClass("Gains read OK"); | |
594 | } | |
595 | ||
596 | if ( ! CreateGlobalTriggerCrateConfig(runNumber) ) | |
597 | { | |
598 | AliErrorClass("Could not read Trigger Crate Config"); | |
599 | } | |
600 | else | |
601 | { | |
602 | AliInfoClass("TriggerBoardMasks read OK"); | |
603 | } | |
604 | ||
605 | if ( ! CreateHV(runNumber) ) | |
606 | { | |
607 | AliErrorClass("Could not read HV"); | |
608 | } | |
609 | else | |
610 | { | |
611 | AliInfoClass("HV read OK"); | |
49e110ec | 612 | } |
613 | ||
614 | if ( ! CreateTriggerDCS(runNumber) ) | |
615 | { | |
616 | AliErrorClass("Could not read Trigger HV and Currents"); | |
617 | } | |
618 | else | |
619 | { | |
620 | AliInfoClass("Trigger HV and Currents read OK"); | |
630711ed | 621 | } |
622 | ||
623 | if ( ! CreateNeighbours(runNumber) ) | |
624 | { | |
625 | AliErrorClass("Could not read Neighbours"); | |
626 | } | |
627 | else | |
628 | { | |
629 | AliInfoClass("Neighbours read OK"); | |
630 | } | |
631 | ||
632 | if ( ! CreateLocalTriggerBoardMasks(runNumber) ) | |
633 | { | |
634 | AliErrorClass("Could not read LocalTriggerBoardMasks"); | |
635 | } | |
636 | else | |
637 | { | |
638 | AliInfoClass("LocalTriggerBoardMasks read OK"); | |
639 | } | |
640 | ||
641 | if ( ! CreatePedestals(runNumber) ) | |
642 | { | |
643 | AliErrorClass("Could not read pedestals"); | |
644 | } | |
645 | else | |
646 | { | |
647 | AliInfoClass("Pedestals read OK"); | |
648 | } | |
6c870207 | 649 | |
650 | if ( ! CreateConfig(runNumber) ) | |
651 | { | |
652 | AliErrorClass("Could not read config"); | |
653 | } | |
654 | else | |
655 | { | |
656 | AliInfoClass("Config read OK"); | |
657 | } | |
630711ed | 658 | |
659 | if ( ! CreateRegionalTriggerConfig(runNumber) ) | |
660 | { | |
661 | AliErrorClass("Could not read RegionalTriggerConfig"); | |
662 | } | |
663 | else | |
664 | { | |
665 | AliInfoClass("RegionalTriggerBoardMasks read OK"); | |
666 | } | |
667 | ||
668 | if ( ! CreateTriggerLut(runNumber) ) | |
669 | { | |
670 | AliErrorClass("Could not read TriggerLut"); | |
671 | } | |
672 | else | |
673 | { | |
674 | AliInfoClass("TriggerLut read OK"); | |
675 | } | |
676 | ||
677 | if ( ! CreateTriggerEfficiency(runNumber) ) | |
678 | { | |
679 | AliErrorClass("Could not read TriggerEfficiency"); | |
680 | } | |
681 | else | |
682 | { | |
683 | AliInfoClass("TriggerEfficiency read OK"); | |
684 | } | |
685 | } | |
e7d7fa47 | 686 | |
c5bdf179 | 687 |