]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONCalibrationData.cxx
more secure string operations
[u/mrichter/AliRoot.git] / MUON / AliMUONCalibrationData.cxx
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"
22 #include "AliCodeTimer.h"
23 #include "AliDCSValue.h"
24 #include "AliLog.h"
25 #include "AliMpDCSNamer.h"
26 #include "AliMUONConstants.h"
27 #include "AliMUONGlobalCrateConfig.h"
28 #include "AliMUONRegionalTriggerConfig.h"
29 #include "AliMUONRejectList.h"
30 #include "AliMUONTriggerEfficiencyCells.h"
31 #include "AliMUONTriggerLut.h"
32 #include "AliMUONVCalibParam.h"
33 #include "AliMUONVStore.h"
34 #include "AliMUONVStore.h"
35
36 #include <Riostream.h>
37 #include <TClass.h>
38 #include <TMap.h>
39
40 //-----------------------------------------------------------------------------
41 /// \class AliMUONCalibrationData
42 ///
43 /// For the moment, this class stores pedestals, gains, hv (for tracker)
44 /// and lut, masks and efficiencies (for trigger) that are fetched from the CDB.
45 ///
46 /// This class is to be considered as a convenience class.
47 /// Its aim is to ease retrieval of calibration data from the 
48 /// condition database.
49 ///
50 /// It acts as a "facade" to a bunch of underlying 
51 /// containers/calibration classes.
52 ///
53 /// \author Laurent Aphecetche
54 //-----------------------------------------------------------------------------
55
56 /// \cond CLASSIMP
57 ClassImp(AliMUONCalibrationData)
58 /// \endcond
59
60 AliMUONVStore* AliMUONCalibrationData::fgBypassPedestals(0x0);
61 AliMUONVStore* AliMUONCalibrationData::fgBypassGains(0x0);
62
63 //_____________________________________________________________________________
64 AliMUONCalibrationData::AliMUONCalibrationData(Int_t runNumber, 
65                                                Bool_t deferredInitialization) 
66 : TObject(), 
67 fIsValid(kTRUE),
68 fRunNumber(runNumber), 
69 fGains(0x0), 
70 fPedestals(0x0),
71 fHV(0x0),
72 fTriggerDCS(0x0),
73 fLocalTriggerBoardMasks(0x0),
74 fRegionalTriggerConfig(0x0),
75 fGlobalTriggerCrateConfig(0x0),
76 fTriggerLut(0x0),
77 fTriggerEfficiency(0x0),
78 fCapacitances(0x0),
79 fNeighbours(0x0),
80 fOccupancyMap(0x0),
81 fRejectList(0x0),
82 fConfig(0x0)
83 {
84 /// Default ctor.
85
86   // If deferredInitialization is false, we read *all* calibrations
87   // at once.
88   // So when using this class to access only one kind of calibrations (e.g.
89   // only pedestals), you should put deferredInitialization to kTRUE, which
90   // will instruct this object to fetch the data only when neeeded.
91
92   if ( deferredInitialization == kFALSE )
93   {
94     Gains();
95     Pedestals();
96     OccupancyMap();
97     RejectList();
98     HV();
99     TriggerDCS();
100     LocalTriggerBoardMasks(0);
101     RegionalTriggerConfig();
102     GlobalTriggerCrateConfig();
103     TriggerLut();
104     TriggerEfficiency();
105     Capacitances();
106     Neighbours();
107     Config();
108   }
109 }
110
111 //_____________________________________________________________________________
112 AliMUONCalibrationData::~AliMUONCalibrationData()
113 {
114   /// Destructor. Note that we're the owner of our pointers if the OCDB cache
115   /// is not set. Otherwise the cache is supposed to take care of them...
116   if (!(AliCDBManager::Instance()->GetCacheFlag())) Reset();
117 }
118
119 //_____________________________________________________________________________
120 AliMUONVStore*
121 AliMUONCalibrationData::Capacitances() const
122 {
123   /// Create (if needed) and return the internal store for capacitances.
124   
125   if (!fCapacitances)
126   {
127     fCapacitances = CreateCapacitances(fRunNumber);
128   }
129   return fCapacitances;
130 }
131
132 //_____________________________________________________________________________
133 AliMUONVStore*
134 AliMUONCalibrationData::CreateCapacitances(Int_t runNumber, Int_t* startOfValidity)
135 {
136   /// Create capa store from OCDB for a given run
137   
138   return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Capacitances",startOfValidity));
139 }
140
141 //_____________________________________________________________________________
142 AliMUONVStore*
143 AliMUONCalibrationData::CreateGains(Int_t runNumber, Int_t* startOfValidity)
144 {
145   /// Create a new gain store from the OCDB for a given run
146   return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Gains",startOfValidity));
147 }
148
149 //_____________________________________________________________________________
150 AliMUONGlobalCrateConfig*
151 AliMUONCalibrationData::CreateGlobalTriggerCrateConfig(Int_t runNumber, Int_t* startOfValidity)
152 {
153   /// Create the internal store for GlobalTriggerCrateConfig from OCDB
154   
155   return dynamic_cast<AliMUONGlobalCrateConfig*>(CreateObject(runNumber,"MUON/Calib/GlobalTriggerCrateConfig",startOfValidity));
156 }
157
158
159 //______________________________________________________________________________
160 void AliMUONCalibrationData::PatchHVValues(TObjArray& values,
161                                            Int_t& nbelowready,
162                                            Int_t& noff,
163                                            Int_t& ntrips,
164                                            Int_t& neor,
165                                            TString* msg)
166 {
167   /// We do here a little bit of massaging of the HV values, if needed.
168   ///
169   /// The main point is to "gather" the values near the end of the run (the last XX seconds)
170   /// to avoid the ramp-down before end-of-run syndrom...
171   ///
172   /// The rest is more of a debug/expert tool to have closer look at trends
173   ///
174   
175   Double_t HVBEAMTUNING(1300); 
176   
177   Bool_t eorProblem(kFALSE);
178   
179   UInt_t mergeDelay(300); // in seconds
180   
181   // First start by removing values within the last mergeDelay seconds, keeping only
182   // the last one
183   
184   AliDCSValue* last = static_cast<AliDCSValue*>(values.At(values.GetLast()));
185   
186   Int_t* toberemoved = new Int_t[values.GetLast()+1];
187   
188   memset(toberemoved,0,(values.GetLast()+1)*sizeof(Int_t));
189   
190   Int_t ntoberemoved(0);
191   
192   for ( Int_t i = values.GetLast()-1; i > 0; --i ) 
193   {
194     AliDCSValue* val = static_cast<AliDCSValue*>(values.At(i));
195     
196     if ( last->GetTimeStamp() - val->GetTimeStamp() < mergeDelay )
197     {
198       toberemoved[i]=1;
199       ++ntoberemoved;
200     }
201   }
202   
203   if (ntoberemoved)
204   {
205     // ok, we have some values within the same mergeDelay seconds
206     // we'll "merge" them by taking the last one, except if
207     // the last one is below HVBEAMTUNING, in which case we
208     // remove that one too (meaning the ramp-down was requesting
209     // before the end-of-run)
210     
211     if ( last->GetFloat() < HVBEAMTUNING ) 
212     {
213       eorProblem=kTRUE;
214       if (msg) *msg = "ERROR RAMP-DOWN BEFORE EOR";
215       toberemoved[values.GetLast()]=1;
216     }
217     
218     for ( Int_t i = 0; i <= values.GetLast(); ++i ) 
219     {
220       if ( toberemoved[i] ) values.RemoveAt(i);
221     }
222     
223     values.Compress();
224     
225   }
226   
227   delete[] toberemoved;
228   
229   if (eorProblem)
230   {
231     ++neor;
232     return;
233   }
234   
235   // now for the rest of the diagnosis
236   
237   Int_t ntmpoff(0);
238   Int_t ntmpready(0);
239   
240   for ( Int_t i = 0; i <= values.GetLast(); ++i ) 
241   {
242     AliDCSValue* val = static_cast<AliDCSValue*>(values.At(i));
243     
244     if ( val->GetFloat() < AliMpDCSNamer::TrackerHVOFF() ) 
245     {
246       ++ntmpoff;
247     }
248     else if ( val->GetFloat() < HVBEAMTUNING )
249     {
250       ++ntmpready;
251     }
252   }
253   
254   if ( ntmpoff )
255   {
256     if ( ntmpoff == values.GetLast()+1 ) 
257     {
258       if (msg) *msg = "ERROR HV OFF";
259       ++noff;
260     }
261     else
262     {
263       if (msg) *msg = "ERROR TRIP";
264       ++ntrips;    
265     }
266   }
267   
268   if ( ntmpready == values.GetLast()+1 ) 
269   {
270     if (msg) *msg = "ERROR BELOW READY";    
271   }      
272   
273   if (ntmpready) ++nbelowready;
274 }
275
276 //_____________________________________________________________________________
277 TMap*
278 AliMUONCalibrationData::CreateHV(Int_t runNumber, Int_t* startOfValidity, Bool_t patched)
279 {
280   /// Create a new HV map from the OCDB for a given run
281   TMap* hvMap = dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/HV",startOfValidity));
282   if (patched)
283   {
284     TIter next(hvMap);
285     TObjString* hvChannelName;
286     
287     while ( ( hvChannelName = static_cast<TObjString*>(next()) ) )
288     {
289       TString name(hvChannelName->String());
290       
291       if ( name.Contains("sw") ) continue; // skip switches
292       
293       TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(name.Data()));
294       TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
295       if (!values)
296       {
297         AliErrorClass(Form("Could not get values for alias %s",name.Data()));
298       }
299       else
300       {
301         int nbelowready(0);
302         int noff(0);
303         int ntrips(0);
304         int neor(0);
305         
306         PatchHVValues(*values,nbelowready,noff,ntrips,neor,0x0);
307         if (neor)
308         {
309           nbelowready=noff=ntrips=neor=0;
310           PatchHVValues(*values,nbelowready,noff,ntrips,neor,0x0);
311           if (neor)
312           {
313             AliErrorClass("neor is not null after PatchHVValue ! This is serious !");
314           }
315         }
316       }
317     }
318     
319   }
320   return hvMap;
321 }
322
323 //_____________________________________________________________________________
324 TMap*
325 AliMUONCalibrationData::CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity)
326 {
327   /// Create a new Trigger HV and curent map from the OCDB for a given run
328   return dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/TriggerDCS",startOfValidity));
329 }
330
331 //_____________________________________________________________________________
332 AliMUONVStore*
333 AliMUONCalibrationData::CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity)
334 {
335   /// Get the internal store for LocalTriggerBoardMasks from OCDB
336   
337   return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/LocalTriggerBoardMasks",startOfValidity));
338 }
339
340 //_____________________________________________________________________________
341 AliMUONVStore*
342 AliMUONCalibrationData::CreateNeighbours(Int_t runNumber, Int_t* startOfValidity)
343 {
344   /// Create a neighbour store from the OCDB for a given run
345   return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Neighbours",startOfValidity));
346 }
347
348 //_____________________________________________________________________________
349 TObject*
350 AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* startOfValidity)
351 {
352   /// Access the CDB for a given path (e.g. MUON/Calib/Pedestals),
353   /// and return the corresponding TObject.
354   
355   AliCodeTimerAutoClass(Form("%d : %s",runNumber,path),0);
356   
357   AliCDBManager* man = AliCDBManager::Instance();
358   
359   AliCDBEntry* entry =  man->Get(path,runNumber);
360   
361   if (entry)
362   {
363                 if ( startOfValidity ) *startOfValidity = entry->GetId().GetFirstRun();
364                 
365     TObject* object = entry->GetObject();
366     if (!(man->GetCacheFlag()))
367     {
368       entry->SetOwner(kFALSE);
369       delete entry;      
370     }
371     return object;
372   }
373         else
374         {
375                 if ( startOfValidity )  *startOfValidity = AliCDBRunRange::Infinity();
376   }
377         
378   {
379     
380     AliCodeTimerAutoClass(Form("Failed to get %s for run %d",path,runNumber),1);
381
382   }
383   
384   return 0x0;
385 }
386
387 //_____________________________________________________________________________
388 AliMUONVStore*
389 AliMUONCalibrationData::CreateOccupancyMap(Int_t runNumber, Int_t* startOfValidity)
390 {
391   /// Create a new occupancy map store from the OCDB for a given run
392   return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/OccupancyMap",startOfValidity));
393 }
394
395 //_____________________________________________________________________________
396 AliMUONRejectList*
397 AliMUONCalibrationData::CreateRejectList(Int_t runNumber, Int_t* startOfValidity)
398 {
399   /// Create a new rejectlist store from the OCDB for a given run
400   return dynamic_cast<AliMUONRejectList*>(CreateObject(runNumber,"MUON/Calib/RejectList",startOfValidity));
401 }
402
403 //_____________________________________________________________________________
404 AliMUONVStore*
405 AliMUONCalibrationData::CreatePedestals(Int_t runNumber, Int_t* startOfValidity)
406 {
407   /// Create a new pedestal store from the OCDB for a given run
408   return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Pedestals",startOfValidity));
409 }
410
411 //_____________________________________________________________________________
412 AliMUONVStore*
413 AliMUONCalibrationData::CreateConfig(Int_t runNumber, Int_t* startOfValidity)
414 {
415   /// Create a new config store from the OCDB for a given run
416   return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Config",startOfValidity));
417 }
418
419
420 //_____________________________________________________________________________
421 AliMUONRegionalTriggerConfig*
422 AliMUONCalibrationData::CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity)
423 {
424   /// Create the internal store for RegionalTriggerConfig from OCDB
425   
426   return dynamic_cast<AliMUONRegionalTriggerConfig*>(CreateObject(runNumber,"MUON/Calib/RegionalTriggerConfig",startOfValidity));
427 }
428
429 //_____________________________________________________________________________
430 AliMUONTriggerEfficiencyCells* 
431 AliMUONCalibrationData::CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity)
432 {
433   /// Create trigger efficiency object from OCBD
434   
435   return dynamic_cast<AliMUONTriggerEfficiencyCells*>(CreateObject(runNumber,"MUON/Calib/TriggerEfficiency",startOfValidity));
436 }
437
438 //_____________________________________________________________________________
439 AliMUONTriggerLut* 
440 AliMUONCalibrationData::CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity)
441 {
442   /// Create trigger LUT from OCDB
443   
444   return dynamic_cast<AliMUONTriggerLut*>(CreateObject(runNumber,"MUON/Calib/TriggerLut",startOfValidity));
445 }
446
447 //_____________________________________________________________________________
448 AliMUONVStore*
449 AliMUONCalibrationData::Gains() const
450 {
451   /// Create (if needed) and return the internal store for gains.
452   if (fgBypassGains) return fgBypassGains;
453   
454   if (!fGains)
455   {
456     fGains = CreateGains(fRunNumber);
457   }
458   return fGains;
459 }
460
461 //_____________________________________________________________________________
462 AliMUONVCalibParam*
463 AliMUONCalibrationData::Gains(Int_t detElemId, Int_t manuId) const
464 {
465 /// Return the gains for a given (detElemId, manuId) pair
466 /// Note that, unlike the DeadChannel case, if the result is 0x0, that's an
467 /// error (meaning that we should get gains for all channels).
468
469   AliMUONVStore* gains = Gains();
470   if (!gains)
471   {
472     return 0x0;
473   }
474   
475   return static_cast<AliMUONVCalibParam*>(gains->FindObject(detElemId,manuId));
476 }
477
478 //_____________________________________________________________________________
479 AliMUONGlobalCrateConfig* 
480 AliMUONCalibrationData::GlobalTriggerCrateConfig() const
481 {
482   /// Return the config for the global trigger board.
483   
484   if (!fGlobalTriggerCrateConfig)
485   {
486     fGlobalTriggerCrateConfig = CreateGlobalTriggerCrateConfig(fRunNumber);
487   }
488   return fGlobalTriggerCrateConfig;
489 }
490
491
492 //_____________________________________________________________________________
493 TMap*
494 AliMUONCalibrationData::HV(Bool_t patched) const
495 {
496   /// Return the calibration for a given (detElemId, manuId) pair
497   
498   if (!fHV)
499   {
500     fHV = CreateHV(fRunNumber,0,patched);
501   }
502   return fHV;
503 }
504
505 //_____________________________________________________________________________
506 TMap*
507 AliMUONCalibrationData::TriggerDCS() const
508 {
509   /// Return the calibration for a given (detElemId, manuId) pair
510   
511   if (!fTriggerDCS)
512   {
513     fTriggerDCS = CreateTriggerDCS(fRunNumber);
514   }
515   return fTriggerDCS;
516 }
517
518 //_____________________________________________________________________________
519 AliMUONVStore*
520 AliMUONCalibrationData::Neighbours() const
521 {
522   /// Create (if needed) and return the internal store for neighbours.
523   if (!fNeighbours)
524   {
525     fNeighbours = CreateNeighbours(fRunNumber);
526   }
527   return fNeighbours;
528 }
529
530 //_____________________________________________________________________________
531 AliMUONVCalibParam* 
532 AliMUONCalibrationData::LocalTriggerBoardMasks(Int_t localBoardNumber) const
533 {
534 /// Return the masks for a given trigger local board.
535
536   if (!fLocalTriggerBoardMasks)
537   {
538     fLocalTriggerBoardMasks = CreateLocalTriggerBoardMasks(fRunNumber);
539   }
540
541   if ( fLocalTriggerBoardMasks ) 
542   {
543     AliMUONVCalibParam* ltbm = 
544       static_cast<AliMUONVCalibParam*>(fLocalTriggerBoardMasks->FindObject(localBoardNumber));
545     if (!ltbm)
546     {
547       AliError(Form("Could not get mask for localBoardNumber=%d",localBoardNumber));
548     }
549     return ltbm;  
550   }
551   return 0x0;
552 }
553
554 //_____________________________________________________________________________
555 AliMUONVStore*
556 AliMUONCalibrationData::OccupancyMap() const
557 {
558   /// Get occupancy map
559   if (!fOccupancyMap)
560   {
561     fOccupancyMap = CreateOccupancyMap(fRunNumber);
562   }
563   return fOccupancyMap;
564 }
565
566 //_____________________________________________________________________________
567 AliMUONRejectList*
568 AliMUONCalibrationData::RejectList() const
569 {
570   /// Get reject list
571   if (!fRejectList)
572   {
573     fRejectList = CreateRejectList(fRunNumber);
574   }
575   return fRejectList;
576 }
577
578 //_____________________________________________________________________________
579 void
580 AliMUONCalibrationData::BypassStores(AliMUONVStore* ped, AliMUONVStore* gain)
581 {
582   /// Force the use of those pedestals and gains
583   fgBypassPedestals = ped;
584   fgBypassGains = gain;
585   
586 }
587
588 //_____________________________________________________________________________
589 AliMUONVStore*
590 AliMUONCalibrationData::Pedestals() const
591 {
592   /// Return pedestals
593   
594   if (fgBypassPedestals) return fgBypassPedestals;
595   
596   if (!fPedestals)
597   {
598     fPedestals = CreatePedestals(fRunNumber);
599   }
600   return fPedestals;
601 }
602
603 //_____________________________________________________________________________
604 AliMUONVStore*
605 AliMUONCalibrationData::Config() const
606 {
607   /// Return config
608   
609   if (!fConfig)
610   {
611     fConfig = CreateConfig(fRunNumber);
612   }
613   return fConfig;
614 }
615
616 //_____________________________________________________________________________
617 AliMUONVCalibParam*
618 AliMUONCalibrationData::Pedestals(Int_t detElemId, Int_t manuId) const
619 {
620   /// Return the pedestals for a given (detElemId, manuId) pair.
621   /// A return value of 0x0 is considered an error, meaning we should get
622   /// pedestals for all channels.
623   
624   AliMUONVStore* pedestals = Pedestals();
625   if (!pedestals) 
626   {
627     return 0x0;
628   }
629   
630   return static_cast<AliMUONVCalibParam*>(pedestals->FindObject(detElemId,manuId));
631 }
632
633 //_____________________________________________________________________________
634 void
635 AliMUONCalibrationData::Print(Option_t*) const
636 {
637   /// A very basic dump of our guts.
638
639   cout << "RunNumber " << RunNumber()
640   << " fGains=" << fGains
641   << " fPedestals=" << fPedestals
642   << " fConfig=" << fConfig
643   << " fHV=" << fHV
644   << " fTriggerDCS=" << fTriggerDCS
645   << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks
646   << " fRegionalTriggerConfig=" << fRegionalTriggerConfig
647   << " fGlobalTriggerCrateConfig=" << fGlobalTriggerCrateConfig
648   << " fTriggerLut=" << fTriggerLut
649   << endl;
650 }
651
652
653 //_____________________________________________________________________________
654 AliMUONRegionalTriggerConfig* 
655 AliMUONCalibrationData::RegionalTriggerConfig() const
656 {
657   /// Return the config for the regional trigger board.
658   
659   if (!fRegionalTriggerConfig)
660   {
661     fRegionalTriggerConfig = CreateRegionalTriggerConfig(fRunNumber);
662     }
663   return fRegionalTriggerConfig;
664 }
665
666
667 //_____________________________________________________________________________
668 AliMUONTriggerEfficiencyCells*
669 AliMUONCalibrationData::TriggerEfficiency() const
670 {
671 /// Return the trigger efficiency.
672
673   if (!fTriggerEfficiency)
674   {
675     fTriggerEfficiency = CreateTriggerEfficiency(fRunNumber);
676   }
677   return fTriggerEfficiency;
678 }
679
680
681 //_____________________________________________________________________________
682 AliMUONTriggerLut*
683 AliMUONCalibrationData::TriggerLut() const
684 {
685 /// Return the trigger look up table.
686
687   if (!fTriggerLut)
688   {
689     fTriggerLut = CreateTriggerLut(fRunNumber);
690   }
691   return fTriggerLut;
692 }
693
694 //_____________________________________________________________________________
695 void
696 AliMUONCalibrationData::Reset()
697 {
698 /// Reset all data
699
700   AliCodeTimerAuto("",0);
701   
702   delete fConfig;
703   fConfig = 0x0;
704   delete fPedestals;
705   fPedestals = 0x0;
706   delete fGains;
707   fGains = 0x0;
708   delete fHV;
709   fHV = 0x0;
710   delete fTriggerDCS;
711   fTriggerDCS = 0x0;
712   delete fLocalTriggerBoardMasks;
713   fLocalTriggerBoardMasks = 0x0;
714   delete fRegionalTriggerConfig;
715   fRegionalTriggerConfig = 0x0;
716   delete fGlobalTriggerCrateConfig;
717   fGlobalTriggerCrateConfig = 0x0;
718   
719   delete fTriggerLut;
720   fTriggerLut = 0x0;
721   delete fTriggerEfficiency;
722   fTriggerEfficiency = 0x0;
723   delete fCapacitances;
724   fCapacitances = 0x0;
725   delete fNeighbours;
726   fNeighbours = 0x0;
727 }
728
729 //_____________________________________________________________________________
730 void
731 AliMUONCalibrationData::Check(Int_t runNumber)
732 {
733   /// Self-check to see if we can read all data for a given run 
734   /// from the current OCDB...
735   
736   if ( ! CreateCapacitances(runNumber) )
737   {
738     AliErrorClass("Could not read capacitances");
739   }
740   else
741   {
742     AliInfoClass("Capacitances read OK");
743   }
744
745   if ( ! CreateGains(runNumber) ) 
746   {
747     AliErrorClass("Could not read gains");
748   }
749   else
750   {
751     AliInfoClass("Gains read OK");
752   }
753
754   if ( ! CreateGlobalTriggerCrateConfig(runNumber) ) 
755   {
756     AliErrorClass("Could not read Trigger Crate Config");
757   }
758   else
759   {
760     AliInfoClass("TriggerBoardMasks read OK");
761   }
762
763   if ( !  CreateHV(runNumber) )
764   {
765     AliErrorClass("Could not read HV");
766   }
767   else
768   {
769     AliInfoClass("HV read OK");
770   }
771
772   if ( !  CreateTriggerDCS(runNumber) )
773   {
774     AliErrorClass("Could not read Trigger HV and Currents");
775   }
776   else
777   {
778     AliInfoClass("Trigger HV and Currents read OK");
779   }
780
781   if ( ! CreateNeighbours(runNumber) )
782   {
783     AliErrorClass("Could not read Neighbours");
784   }
785   else
786   {
787     AliInfoClass("Neighbours read OK");
788   }
789
790   if ( !  CreateLocalTriggerBoardMasks(runNumber) )
791   {
792     AliErrorClass("Could not read LocalTriggerBoardMasks");
793   }
794   else
795   {
796     AliInfoClass("LocalTriggerBoardMasks read OK");
797   }
798   
799   if ( ! CreatePedestals(runNumber) )
800   {
801     AliErrorClass("Could not read pedestals");
802   }
803   else
804   {
805     AliInfoClass("Pedestals read OK");
806   }
807
808   if ( ! CreateConfig(runNumber) )
809   {
810     AliErrorClass("Could not read config");
811   }
812   else
813   {
814     AliInfoClass("Config read OK");
815   }
816   
817   if ( ! CreateRegionalTriggerConfig(runNumber) )
818   {
819     AliErrorClass("Could not read RegionalTriggerConfig");
820   }
821   else
822   {
823     AliInfoClass("RegionalTriggerBoardMasks read OK");
824   }
825   
826   if ( ! CreateTriggerLut(runNumber) )
827   {
828     AliErrorClass("Could not read TriggerLut");
829   }
830   else
831   {
832     AliInfoClass("TriggerLut read OK");
833   }
834
835   if ( ! CreateTriggerEfficiency(runNumber) )
836   {
837     AliErrorClass("Could not read TriggerEfficiency");
838   }
839   else    
840   {
841     AliInfoClass("TriggerEfficiency read OK");
842   }
843 }
844
845