]>
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 | |
8f29b706 | 57 | AliMUONVStore* AliMUONCalibrationData::fBypassPedestals(0x0); |
58 | AliMUONVStore* AliMUONCalibrationData::fBypassGains(0x0); | |
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 | { | |
c1bbaf66 | 111 | /// Destructor. Note that we're the owner of our pointers. |
23b1bc04 | 112 | //PH The owner of the objects is CDB, do not delete them! |
113 | // 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(); |
208 | entry->SetOwner(kFALSE); | |
465302eb | 209 | if (!(man->GetCacheFlag())) delete entry; |
4bec0403 | 210 | return object; |
211 | } | |
143cd71a | 212 | else |
213 | { | |
214 | if ( startOfValidity ) *startOfValidity = AliCDBRunRange::Infinity(); | |
215 | } | |
216 | ||
0045b488 | 217 | { |
218 | ||
dd0be8a7 | 219 | AliCodeTimerAutoClass(Form("Failed to get %s for run %d",path,runNumber),1); |
0045b488 | 220 | |
221 | } | |
222 | ||
5562688f | 223 | return 0x0; |
d067ba7c | 224 | } |
225 | ||
2b8a1212 | 226 | //_____________________________________________________________________________ |
227 | AliMUONVStore* | |
7eafe398 | 228 | AliMUONCalibrationData::CreateOccupancyMap(Int_t runNumber, Int_t* startOfValidity) |
2b8a1212 | 229 | { |
7eafe398 | 230 | /// Create a new occupancy map store from the OCDB for a given run |
231 | return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/OccupancyMap",startOfValidity)); | |
2b8a1212 | 232 | } |
233 | ||
0045b488 | 234 | //_____________________________________________________________________________ |
235 | AliMUONRejectList* | |
236 | AliMUONCalibrationData::CreateRejectList(Int_t runNumber, Int_t* startOfValidity) | |
237 | { | |
238 | /// Create a new rejectlist store from the OCDB for a given run | |
239 | return dynamic_cast<AliMUONRejectList*>(CreateObject(runNumber,"MUON/Calib/RejectList",startOfValidity)); | |
240 | } | |
241 | ||
c1bbaf66 | 242 | //_____________________________________________________________________________ |
a0eca509 | 243 | AliMUONVStore* |
143cd71a | 244 | AliMUONCalibrationData::CreatePedestals(Int_t runNumber, Int_t* startOfValidity) |
c1bbaf66 | 245 | { |
5562688f | 246 | /// Create a new pedestal store from the OCDB for a given run |
143cd71a | 247 | return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Pedestals",startOfValidity)); |
c1bbaf66 | 248 | } |
249 | ||
6c870207 | 250 | //_____________________________________________________________________________ |
251 | AliMUONVStore* | |
252 | AliMUONCalibrationData::CreateConfig(Int_t runNumber, Int_t* startOfValidity) | |
253 | { | |
254 | /// Create a new config store from the OCDB for a given run | |
255 | return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Config",startOfValidity)); | |
256 | } | |
257 | ||
92c23b09 | 258 | |
c5bdf179 | 259 | //_____________________________________________________________________________ |
92c23b09 | 260 | AliMUONRegionalTriggerConfig* |
143cd71a | 261 | AliMUONCalibrationData::CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity) |
5562688f | 262 | { |
92c23b09 | 263 | /// Create the internal store for RegionalTriggerConfig from OCDB |
5562688f | 264 | |
143cd71a | 265 | return dynamic_cast<AliMUONRegionalTriggerConfig*>(CreateObject(runNumber,"MUON/Calib/RegionalTriggerConfig",startOfValidity)); |
5562688f | 266 | } |
267 | ||
268 | //_____________________________________________________________________________ | |
269 | AliMUONTriggerEfficiencyCells* | |
143cd71a | 270 | AliMUONCalibrationData::CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity) |
c5bdf179 | 271 | { |
5562688f | 272 | /// Create trigger efficiency object from OCBD |
273 | ||
143cd71a | 274 | return dynamic_cast<AliMUONTriggerEfficiencyCells*>(CreateObject(runNumber,"MUON/Calib/TriggerEfficiency",startOfValidity)); |
5562688f | 275 | } |
5398f946 | 276 | |
5562688f | 277 | //_____________________________________________________________________________ |
278 | AliMUONTriggerLut* | |
143cd71a | 279 | AliMUONCalibrationData::CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity) |
5562688f | 280 | { |
281 | /// Create trigger LUT from OCDB | |
282 | ||
143cd71a | 283 | return dynamic_cast<AliMUONTriggerLut*>(CreateObject(runNumber,"MUON/Calib/TriggerLut",startOfValidity)); |
5562688f | 284 | } |
285 | ||
286 | //_____________________________________________________________________________ | |
287 | AliMUONVStore* | |
288 | AliMUONCalibrationData::Gains() const | |
289 | { | |
290 | /// Create (if needed) and return the internal store for gains. | |
8f29b706 | 291 | if (fBypassGains) return fBypassGains; |
292 | ||
c5bdf179 | 293 | if (!fGains) |
294 | { | |
5562688f | 295 | fGains = CreateGains(fRunNumber); |
c5bdf179 | 296 | } |
297 | return fGains; | |
298 | } | |
299 | ||
e7d7fa47 | 300 | //_____________________________________________________________________________ |
5562688f | 301 | AliMUONVCalibParam* |
302 | AliMUONCalibrationData::Gains(Int_t detElemId, Int_t manuId) const | |
e7d7fa47 | 303 | { |
5562688f | 304 | /// Return the gains for a given (detElemId, manuId) pair |
305 | /// Note that, unlike the DeadChannel case, if the result is 0x0, that's an | |
306 | /// error (meaning that we should get gains for all channels). | |
5398f946 | 307 | |
5562688f | 308 | AliMUONVStore* gains = Gains(); |
309 | if (!gains) | |
310 | { | |
311 | return 0x0; | |
312 | } | |
313 | ||
314 | return static_cast<AliMUONVCalibParam*>(gains->FindObject(detElemId,manuId)); | |
e7d7fa47 | 315 | } |
316 | ||
317 | //_____________________________________________________________________________ | |
92c23b09 | 318 | AliMUONGlobalCrateConfig* |
319 | AliMUONCalibrationData::GlobalTriggerCrateConfig() const | |
e7d7fa47 | 320 | { |
92c23b09 | 321 | /// Return the config for the global trigger board. |
5562688f | 322 | |
92c23b09 | 323 | if (!fGlobalTriggerCrateConfig) |
e7d7fa47 | 324 | { |
92c23b09 | 325 | fGlobalTriggerCrateConfig = CreateGlobalTriggerCrateConfig(fRunNumber); |
e7d7fa47 | 326 | } |
92c23b09 | 327 | return fGlobalTriggerCrateConfig; |
e7d7fa47 | 328 | } |
329 | ||
92c23b09 | 330 | |
e7d7fa47 | 331 | //_____________________________________________________________________________ |
5562688f | 332 | TMap* |
333 | AliMUONCalibrationData::HV() const | |
e7d7fa47 | 334 | { |
5562688f | 335 | /// Return the calibration for a given (detElemId, manuId) pair |
48ed403b | 336 | |
5562688f | 337 | if (!fHV) |
e7d7fa47 | 338 | { |
5562688f | 339 | fHV = CreateHV(fRunNumber); |
e7d7fa47 | 340 | } |
5562688f | 341 | return fHV; |
e7d7fa47 | 342 | } |
343 | ||
49e110ec | 344 | //_____________________________________________________________________________ |
345 | TMap* | |
346 | AliMUONCalibrationData::TriggerDCS() const | |
347 | { | |
348 | /// Return the calibration for a given (detElemId, manuId) pair | |
349 | ||
350 | if (!fTriggerDCS) | |
351 | { | |
352 | fTriggerDCS = CreateTriggerDCS(fRunNumber); | |
353 | } | |
354 | return fTriggerDCS; | |
355 | } | |
356 | ||
e7d7fa47 | 357 | //_____________________________________________________________________________ |
a0eca509 | 358 | AliMUONVStore* |
5562688f | 359 | AliMUONCalibrationData::Neighbours() const |
e7d7fa47 | 360 | { |
5562688f | 361 | /// Create (if needed) and return the internal store for neighbours. |
362 | if (!fNeighbours) | |
363 | { | |
364 | fNeighbours = CreateNeighbours(fRunNumber); | |
365 | } | |
366 | return fNeighbours; | |
367 | } | |
368 | ||
369 | //_____________________________________________________________________________ | |
370 | AliMUONVCalibParam* | |
371 | AliMUONCalibrationData::LocalTriggerBoardMasks(Int_t localBoardNumber) const | |
372 | { | |
373 | /// Return the masks for a given trigger local board. | |
5398f946 | 374 | |
e7d7fa47 | 375 | if (!fLocalTriggerBoardMasks) |
376 | { | |
5562688f | 377 | fLocalTriggerBoardMasks = CreateLocalTriggerBoardMasks(fRunNumber); |
378 | } | |
379 | ||
380 | if ( fLocalTriggerBoardMasks ) | |
381 | { | |
382 | AliMUONVCalibParam* ltbm = | |
383 | static_cast<AliMUONVCalibParam*>(fLocalTriggerBoardMasks->FindObject(localBoardNumber)); | |
384 | if (!ltbm) | |
e7d7fa47 | 385 | { |
5562688f | 386 | AliError(Form("Could not get mask for localBoardNumber=%d",localBoardNumber)); |
e7d7fa47 | 387 | } |
5562688f | 388 | return ltbm; |
e7d7fa47 | 389 | } |
5562688f | 390 | return 0x0; |
e7d7fa47 | 391 | } |
392 | ||
2b8a1212 | 393 | //_____________________________________________________________________________ |
394 | AliMUONVStore* | |
7eafe398 | 395 | AliMUONCalibrationData::OccupancyMap() const |
2b8a1212 | 396 | { |
7eafe398 | 397 | /// Get occupancy map |
398 | if (!fOccupancyMap) | |
2b8a1212 | 399 | { |
7eafe398 | 400 | fOccupancyMap = CreateOccupancyMap(fRunNumber); |
2b8a1212 | 401 | } |
7eafe398 | 402 | return fOccupancyMap; |
2b8a1212 | 403 | } |
404 | ||
0045b488 | 405 | //_____________________________________________________________________________ |
406 | AliMUONRejectList* | |
407 | AliMUONCalibrationData::RejectList() const | |
408 | { | |
409 | /// Get reject list | |
410 | if (!fRejectList) | |
411 | { | |
412 | fRejectList = CreateRejectList(fRunNumber); | |
413 | } | |
414 | return fRejectList; | |
415 | } | |
416 | ||
8f29b706 | 417 | //_____________________________________________________________________________ |
418 | void | |
419 | AliMUONCalibrationData::BypassStores(AliMUONVStore* ped, AliMUONVStore* gain) | |
420 | { | |
421 | /// Force the use of those pedestals and gains | |
422 | fBypassPedestals = ped; | |
423 | fBypassGains = gain; | |
424 | ||
425 | } | |
426 | ||
c5bdf179 | 427 | //_____________________________________________________________________________ |
a0eca509 | 428 | AliMUONVStore* |
5562688f | 429 | AliMUONCalibrationData::Pedestals() const |
c5bdf179 | 430 | { |
5562688f | 431 | /// Return pedestals |
8f29b706 | 432 | |
433 | if (fBypassPedestals) return fBypassPedestals; | |
434 | ||
c5bdf179 | 435 | if (!fPedestals) |
436 | { | |
5562688f | 437 | fPedestals = CreatePedestals(fRunNumber); |
c5bdf179 | 438 | } |
439 | return fPedestals; | |
440 | } | |
441 | ||
6c870207 | 442 | //_____________________________________________________________________________ |
443 | AliMUONVStore* | |
444 | AliMUONCalibrationData::Config() const | |
445 | { | |
446 | /// Return config | |
447 | ||
448 | if (!fConfig) | |
449 | { | |
450 | fConfig = CreateConfig(fRunNumber); | |
451 | } | |
452 | return fConfig; | |
453 | } | |
454 | ||
5562688f | 455 | //_____________________________________________________________________________ |
456 | AliMUONVCalibParam* | |
457 | AliMUONCalibrationData::Pedestals(Int_t detElemId, Int_t manuId) const | |
458 | { | |
459 | /// Return the pedestals for a given (detElemId, manuId) pair. | |
460 | /// A return value of 0x0 is considered an error, meaning we should get | |
461 | /// pedestals for all channels. | |
462 | ||
463 | AliMUONVStore* pedestals = Pedestals(); | |
464 | if (!pedestals) | |
465 | { | |
466 | return 0x0; | |
467 | } | |
468 | ||
469 | return static_cast<AliMUONVCalibParam*>(pedestals->FindObject(detElemId,manuId)); | |
470 | } | |
471 | ||
c5bdf179 | 472 | //_____________________________________________________________________________ |
473 | void | |
474 | AliMUONCalibrationData::Print(Option_t*) const | |
475 | { | |
5562688f | 476 | /// A very basic dump of our guts. |
5398f946 | 477 | |
c5bdf179 | 478 | cout << "RunNumber " << RunNumber() |
e7d7fa47 | 479 | << " fGains=" << fGains |
480 | << " fPedestals=" << fPedestals | |
6c870207 | 481 | << " fConfig=" << fConfig |
48ed403b | 482 | << " fHV=" << fHV |
49e110ec | 483 | << " fTriggerDCS=" << fTriggerDCS |
e7d7fa47 | 484 | << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks |
92c23b09 | 485 | << " fRegionalTriggerConfig=" << fRegionalTriggerConfig |
486 | << " fGlobalTriggerCrateConfig=" << fGlobalTriggerCrateConfig | |
e7d7fa47 | 487 | << " fTriggerLut=" << fTriggerLut |
c5bdf179 | 488 | << endl; |
489 | } | |
490 | ||
92c23b09 | 491 | |
e7d7fa47 | 492 | //_____________________________________________________________________________ |
92c23b09 | 493 | AliMUONRegionalTriggerConfig* |
494 | AliMUONCalibrationData::RegionalTriggerConfig() const | |
e7d7fa47 | 495 | { |
92c23b09 | 496 | /// Return the config for the regional trigger board. |
48ed403b | 497 | |
92c23b09 | 498 | if (!fRegionalTriggerConfig) |
e7d7fa47 | 499 | { |
92c23b09 | 500 | fRegionalTriggerConfig = CreateRegionalTriggerConfig(fRunNumber); |
e7d7fa47 | 501 | } |
92c23b09 | 502 | return fRegionalTriggerConfig; |
e7d7fa47 | 503 | } |
504 | ||
92c23b09 | 505 | |
e7d7fa47 | 506 | //_____________________________________________________________________________ |
507 | AliMUONTriggerEfficiencyCells* | |
508 | AliMUONCalibrationData::TriggerEfficiency() const | |
509 | { | |
5398f946 | 510 | /// Return the trigger efficiency. |
511 | ||
e7d7fa47 | 512 | if (!fTriggerEfficiency) |
513 | { | |
5562688f | 514 | fTriggerEfficiency = CreateTriggerEfficiency(fRunNumber); |
e7d7fa47 | 515 | } |
516 | return fTriggerEfficiency; | |
517 | } | |
518 | ||
5562688f | 519 | |
e7d7fa47 | 520 | //_____________________________________________________________________________ |
521 | AliMUONTriggerLut* | |
522 | AliMUONCalibrationData::TriggerLut() const | |
523 | { | |
5398f946 | 524 | /// Return the trigger look up table. |
525 | ||
e7d7fa47 | 526 | if (!fTriggerLut) |
527 | { | |
5562688f | 528 | fTriggerLut = CreateTriggerLut(fRunNumber); |
e7d7fa47 | 529 | } |
530 | return fTriggerLut; | |
531 | } | |
532 | ||
c1bbaf66 | 533 | //_____________________________________________________________________________ |
534 | void | |
535 | AliMUONCalibrationData::Reset() | |
536 | { | |
537 | /// Reset all data | |
538 | ||
6c870207 | 539 | delete fConfig; |
540 | fConfig = 0x0; | |
c1bbaf66 | 541 | delete fPedestals; |
542 | fPedestals = 0x0; | |
543 | delete fGains; | |
544 | fGains = 0x0; | |
545 | delete fHV; | |
546 | fHV = 0x0; | |
49e110ec | 547 | delete fTriggerDCS; |
548 | fTriggerDCS = 0x0; | |
c1bbaf66 | 549 | delete fLocalTriggerBoardMasks; |
550 | fLocalTriggerBoardMasks = 0x0; | |
92c23b09 | 551 | delete fRegionalTriggerConfig; |
552 | fRegionalTriggerConfig = 0x0; | |
553 | delete fGlobalTriggerCrateConfig; | |
554 | fGlobalTriggerCrateConfig = 0x0; | |
555 | ||
c1bbaf66 | 556 | delete fTriggerLut; |
557 | fTriggerLut = 0x0; | |
558 | delete fTriggerEfficiency; | |
559 | fTriggerEfficiency = 0x0; | |
560 | delete fCapacitances; | |
561 | fCapacitances = 0x0; | |
d067ba7c | 562 | delete fNeighbours; |
563 | fNeighbours = 0x0; | |
c1bbaf66 | 564 | } |
565 | ||
630711ed | 566 | //_____________________________________________________________________________ |
567 | void | |
568 | AliMUONCalibrationData::Check(Int_t runNumber) | |
569 | { | |
570 | /// Self-check to see if we can read all data for a given run | |
571 | /// from the current OCDB... | |
572 | ||
573 | if ( ! CreateCapacitances(runNumber) ) | |
574 | { | |
575 | AliErrorClass("Could not read capacitances"); | |
576 | } | |
577 | else | |
578 | { | |
579 | AliInfoClass("Capacitances read OK"); | |
580 | } | |
581 | ||
582 | if ( ! CreateGains(runNumber) ) | |
583 | { | |
584 | AliErrorClass("Could not read gains"); | |
585 | } | |
586 | else | |
587 | { | |
588 | AliInfoClass("Gains read OK"); | |
589 | } | |
590 | ||
591 | if ( ! CreateGlobalTriggerCrateConfig(runNumber) ) | |
592 | { | |
593 | AliErrorClass("Could not read Trigger Crate Config"); | |
594 | } | |
595 | else | |
596 | { | |
597 | AliInfoClass("TriggerBoardMasks read OK"); | |
598 | } | |
599 | ||
600 | if ( ! CreateHV(runNumber) ) | |
601 | { | |
602 | AliErrorClass("Could not read HV"); | |
603 | } | |
604 | else | |
605 | { | |
606 | AliInfoClass("HV read OK"); | |
49e110ec | 607 | } |
608 | ||
609 | if ( ! CreateTriggerDCS(runNumber) ) | |
610 | { | |
611 | AliErrorClass("Could not read Trigger HV and Currents"); | |
612 | } | |
613 | else | |
614 | { | |
615 | AliInfoClass("Trigger HV and Currents read OK"); | |
630711ed | 616 | } |
617 | ||
618 | if ( ! CreateNeighbours(runNumber) ) | |
619 | { | |
620 | AliErrorClass("Could not read Neighbours"); | |
621 | } | |
622 | else | |
623 | { | |
624 | AliInfoClass("Neighbours read OK"); | |
625 | } | |
626 | ||
627 | if ( ! CreateLocalTriggerBoardMasks(runNumber) ) | |
628 | { | |
629 | AliErrorClass("Could not read LocalTriggerBoardMasks"); | |
630 | } | |
631 | else | |
632 | { | |
633 | AliInfoClass("LocalTriggerBoardMasks read OK"); | |
634 | } | |
635 | ||
636 | if ( ! CreatePedestals(runNumber) ) | |
637 | { | |
638 | AliErrorClass("Could not read pedestals"); | |
639 | } | |
640 | else | |
641 | { | |
642 | AliInfoClass("Pedestals read OK"); | |
643 | } | |
6c870207 | 644 | |
645 | if ( ! CreateConfig(runNumber) ) | |
646 | { | |
647 | AliErrorClass("Could not read config"); | |
648 | } | |
649 | else | |
650 | { | |
651 | AliInfoClass("Config read OK"); | |
652 | } | |
630711ed | 653 | |
654 | if ( ! CreateRegionalTriggerConfig(runNumber) ) | |
655 | { | |
656 | AliErrorClass("Could not read RegionalTriggerConfig"); | |
657 | } | |
658 | else | |
659 | { | |
660 | AliInfoClass("RegionalTriggerBoardMasks read OK"); | |
661 | } | |
662 | ||
663 | if ( ! CreateTriggerLut(runNumber) ) | |
664 | { | |
665 | AliErrorClass("Could not read TriggerLut"); | |
666 | } | |
667 | else | |
668 | { | |
669 | AliInfoClass("TriggerLut read OK"); | |
670 | } | |
671 | ||
672 | if ( ! CreateTriggerEfficiency(runNumber) ) | |
673 | { | |
674 | AliErrorClass("Could not read TriggerEfficiency"); | |
675 | } | |
676 | else | |
677 | { | |
678 | AliInfoClass("TriggerEfficiency read OK"); | |
679 | } | |
680 | } | |
e7d7fa47 | 681 | |
c5bdf179 | 682 |