1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 #include "AliMUONCalibrationData.h"
20 #include "AliCDBEntry.h"
21 #include "AliCDBManager.h"
22 #include "AliCodeTimer.h"
23 #include "AliDCSValue.h"
25 #include "AliMpDCSNamer.h"
26 #include "AliMpIntPair.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"
36 #include <Riostream.h>
41 //-----------------------------------------------------------------------------
42 /// \class AliMUONCalibrationData
44 /// For the moment, this class stores pedestals, gains, hv (for tracker)
45 /// and lut, masks and efficiencies (for trigger) that are fetched from the CDB.
47 /// This class is to be considered as a convenience class.
48 /// Its aim is to ease retrieval of calibration data from the
49 /// condition database.
51 /// It acts as a "facade" to a bunch of underlying
52 /// containers/calibration classes.
54 /// \author Laurent Aphecetche
55 //-----------------------------------------------------------------------------
58 ClassImp(AliMUONCalibrationData)
61 AliMUONVStore* AliMUONCalibrationData::fgBypassPedestals(0x0);
62 AliMUONVStore* AliMUONCalibrationData::fgBypassGains(0x0);
66 void MarkForDeletion(Int_t* indices, Int_t first, Int_t last)
68 for ( Int_t i = first; i <= last; ++i )
75 //_____________________________________________________________________________
76 AliMUONCalibrationData::AliMUONCalibrationData(Int_t runNumber,
77 Bool_t deferredInitialization)
80 fRunNumber(runNumber),
85 fLocalTriggerBoardMasks(0x0),
86 fRegionalTriggerConfig(0x0),
87 fGlobalTriggerCrateConfig(0x0),
89 fTriggerEfficiency(0x0),
98 // If deferredInitialization is false, we read *all* calibrations
100 // So when using this class to access only one kind of calibrations (e.g.
101 // only pedestals), you should put deferredInitialization to kTRUE, which
102 // will instruct this object to fetch the data only when neeeded.
104 if ( deferredInitialization == kFALSE )
112 LocalTriggerBoardMasks(0);
113 RegionalTriggerConfig();
114 GlobalTriggerCrateConfig();
123 //_____________________________________________________________________________
124 AliMUONCalibrationData::~AliMUONCalibrationData()
126 /// Destructor. Note that we're the owner of our pointers if the OCDB cache
127 /// is not set. Otherwise the cache is supposed to take care of them...
128 if (!(AliCDBManager::Instance()->GetCacheFlag())) Reset();
131 //_____________________________________________________________________________
133 AliMUONCalibrationData::Capacitances() const
135 /// Create (if needed) and return the internal store for capacitances.
139 fCapacitances = CreateCapacitances(fRunNumber);
141 return fCapacitances;
144 //_____________________________________________________________________________
146 AliMUONCalibrationData::CreateCapacitances(Int_t runNumber, Int_t* startOfValidity)
148 /// Create capa store from OCDB for a given run
150 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Capacitances",startOfValidity));
153 //_____________________________________________________________________________
155 AliMUONCalibrationData::CreateGains(Int_t runNumber, Int_t* startOfValidity)
157 /// Create a new gain store from the OCDB for a given run
158 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Gains",startOfValidity));
161 //_____________________________________________________________________________
162 AliMUONGlobalCrateConfig*
163 AliMUONCalibrationData::CreateGlobalTriggerCrateConfig(Int_t runNumber, Int_t* startOfValidity)
165 /// Create the internal store for GlobalTriggerCrateConfig from OCDB
167 return dynamic_cast<AliMUONGlobalCrateConfig*>(CreateObject(runNumber,"MUON/Calib/GlobalTriggerCrateConfig",startOfValidity));
171 //______________________________________________________________________________
172 Bool_t AliMUONCalibrationData::CheckHVGroup(TObjArray& values, Int_t first, Int_t last, Double_t& value, Int_t& slope, TString* msg)
174 // Get the HV of the values between first and last indices
175 // return the HV slope (in Volt per second) and a message
176 // Return kFALSE if we must discard the group
181 if ( last < first ) return kFALSE;
182 if ( last - first < 2 ) return kFALSE;
187 Float_t HVSAME(1); // 1 volts
189 AliDCSValue* vfirst = static_cast<AliDCSValue*>(values.UncheckedAt(first));
190 AliDCSValue* vlast = static_cast<AliDCSValue*>(values.UncheckedAt(last));
192 Int_t deltaHV = TMath::Nint(TMath::Abs(vfirst->GetFloat()-vlast->GetFloat()));
194 if ( deltaHV < HVSAME ) return kFALSE;
196 for ( Int_t i = first; i <= last; ++i )
198 AliDCSValue* v = static_cast<AliDCSValue*>(values.UncheckedAt(i));
200 Double_t y = v->GetFloat() - vfirst->GetFloat();
201 Double_t x = v->GetTimeStamp() - vfirst->GetTimeStamp();
208 slope = value > 0 ? 1 : -1;
209 value = TMath::Abs(value);
211 UInt_t deltaTime = vlast->GetTimeStamp() - vfirst->GetTimeStamp();
215 if (slope>0) (*msg) = Form("RU%d[%d:%d](%d)",TMath::Nint(value),first,last,deltaTime);
216 if (slope<0) (*msg) = Form("RD%d[%d:%d](%d)",TMath::Nint(value),first,last,deltaTime);
218 if ( TMath::Nint(value) == 0 )
220 // this is to protect for the few cases
221 // (see e.g. MchHvLvLeft/Chamber00Left/Quad2Sect0.actual.vMon in run 134497)
222 // where we can have *lots* of values (2483 in this example) but that
223 // are more or less constant...
225 // or simply to remove small ramps
228 value = (vfirst->GetFloat()+vlast->GetFloat())/2.0;
229 *msg = Form("FLUCT%d[%d:%d]",TMath::Nint(value),first,last);
236 //______________________________________________________________________________
237 Bool_t AliMUONCalibrationData::PatchHVValues(TObjArray& values,
240 /// We do here a little bit of massaging of the HV values, if needed.
242 /// The main point is to "gather" values that are within a given small amount
243 /// of time (typically 60 seconds) and infer a slope from those values
244 /// slope > 0 means it is a ramp-up, slope < 0 that's a ramp-down
246 /// This is to avoid both the "ramp-down-before-end-of-run" and the
247 /// "ramp-up-after-start-of-run" syndroms...
249 /// Return kFALSE is the kind of HV (trouble) case we have here
250 /// has not been identified...
253 UInt_t DELTATIME(60); // in seconds
254 Int_t IENDRU(60); // in seconds
256 // Start by finding groups of values which are not separated (each) by more than
259 Bool_t gather(kFALSE);
263 groups.SetOwner(kTRUE);
265 for ( Int_t i = values.GetLast(); i > 0; --i )
267 AliDCSValue* vi = static_cast<AliDCSValue*>(values.UncheckedAt(i));
268 AliDCSValue* vj = static_cast<AliDCSValue*>(values.UncheckedAt(i-1));
270 if ( vi->GetTimeStamp() - vj->GetTimeStamp() < DELTATIME )
285 groups.Add(new AliMpIntPair(ilast,ifirst));
293 groups.Add(new AliMpIntPair(0,ifirst));
296 TIter nextGroup(&groups,kIterBackward);
304 Int_t nEndAndShortRU(0);
309 while ( ( p = static_cast<AliMpIntPair*>(nextGroup()) ) )
316 AliDebugClass(1,Form("group %d:%d",p->GetFirst(),p->GetSecond()));
318 Bool_t ok = CheckHVGroup(values,p->GetFirst(),p->GetSecond(),value,slope,&groupMsg);
326 if ( p->GetFirst() == 0 )
328 // start with a ramp-up
331 else if ( p->GetSecond() == values.GetLast() && TMath::Nint(value) < IENDRU )
337 // ramp-up in the middle of nowhere...
341 else if ( slope < 0 )
343 if ( p->GetSecond() == values.GetLast() )
345 // end with a ramp-down
350 // ramp-down in the middle of nowhere
354 AliDCSValue* d = static_cast<AliDCSValue*>(values.At(p->GetSecond()));
356 if ( d->GetFloat() < AliMpDCSNamer::TrackerHVOFF() )
366 internalMsg += groupMsg;
372 Once we have "decoded" the groups we try to find out which of
373 the following cases we're facing :
375 case A = -------- = OK(1)
379 \ = OK, once we have removed the ramp-down (2)
383 / = OK, once we have removed the ramp-up (3)
387 / \ = OK, once we have removed the ramp-down (2) and the ramp-up (3)
391 \____ = TRIP = BAD (here the ramp-down slope should be bigger than in case C)
394 \ ----- = BAD (trip + ramp-up at end of run)
397 case G = fluctuations (within a range defined in CheckHVGroup...)
401 / = ramp-up right at the end-of-run = OK (4)
404 (1) OK means the group is identified correctly, still the value can be below ready...
405 (2) ramp-down values will be removed if the ramp is indeed the last values in the serie
406 i.e. it's really an end-of-run problem (otherwise it's not case B)
407 (3) ramp-up values will be removed if the ramp is indeed the first values in the serie
408 i.e. it's really a start-of-run problem (otherwise it's not case C)
409 (4) OK if short enough...
411 Any other case is unknown and we'll :
413 b) assume the channel is OFF.
418 AliDebugClass(1,Form("msg=%s ngroupds=%d",internalMsg.Data(),ngroups));
419 AliDebugClass(1,Form("nRU %d nRD %d nStartRU %d nEndRD %d nTripRD %d nFluct %d",
420 nRU,nRD,nStartRU,nEndRD,nTripRD,nFluct));
422 TString hvCase("OTHER");
423 int dummy(0),a(-1),b(-1);
425 Int_t nvalues = values.GetSize();
426 Int_t* indices = new Int_t[nvalues];
427 memset(indices,0,nvalues*sizeof(Int_t));
429 AliDCSValue* vfirst = static_cast<AliDCSValue*>(values.UncheckedAt(0));
430 AliDCSValue* vlast = static_cast<AliDCSValue*>(values.UncheckedAt(values.GetLast()));
432 UInt_t meanTimeStamp = ( vfirst->GetTimeStamp() + vlast->GetTimeStamp() ) / 2;
438 else if ( nTripRD > 0 )
440 if ( nRU > 0 && nRD > 0 )
448 internalMsg += "TRIP ";
449 MarkForDeletion(indices,0,values.GetLast());
450 values.Add(new AliDCSValue(static_cast<Float_t>(0),meanTimeStamp));
452 else if ( nStartRU > 0 && nRU == 0 && nRD == 0 && nEndRD == 0 )
455 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
456 MarkForDeletion(indices,a,b);
458 else if ( nStartRU > 0 && nEndRD > 0 && nRD == 0 && nRU == 0 )
461 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
462 MarkForDeletion(indices,a,b-1);
463 Int_t i = internalMsg.Index("RD",strlen("RD"),0,TString::kExact);
464 sscanf(internalMsg(i,internalMsg.Length()-i).Data(),
465 "RD%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
466 MarkForDeletion(indices,a+1,b);
468 else if ( nEndRD > 0 && nStartRU == 0 && nRU == 0 && nRD == 0 )
471 Int_t i = internalMsg.Index("RD",strlen("RD"),0,TString::kExact);
472 sscanf(internalMsg(i,internalMsg.Length()-i).Data(),
473 "RD%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
474 MarkForDeletion(indices,a,b);
476 else if ( nFluct > 0 )
479 TObjArray* af = internalMsg.Tokenize(" ");
482 while ( ( str = static_cast<TObjString*>(next()) ) )
484 TString s(str->String());
485 if ( s.BeginsWith("FLUCT") )
487 sscanf(s.Data(),"FLUCT%d[%d:%d]",&dummy,&a,&b);
488 MarkForDeletion(indices,a,b);
493 else if ( nEndAndShortRU > 0 && nStartRU == 0 && nRU == 0 && nRD == 0 && nEndRD == 0 )
496 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
497 MarkForDeletion(indices,a,b);
502 // here we know it's not a trip, so let's assume everything is OK
503 // if first and last value are in the same ballpark
505 const Double_t HVFLUCT(20); // volts
507 if ( TMath::Abs(vfirst->GetFloat() - vlast->GetFloat()) < HVFLUCT )
511 MarkForDeletion(indices,1,nvalues-1);
514 for ( Int_t i = 0; i < nvalues; ++i )
526 if ( !values.GetEntries() )
528 AliErrorClass(Form("No value left after patch... Check that !!! initial # of values=%d msg=%s",
529 nvalues,internalMsg.Data()));
533 // take the max of the remaining values
534 TIter nextA(&values);
536 Float_t maxval(-9999);
538 while ( ( val = static_cast<AliDCSValue*>(nextA()) ) )
540 if ( val->GetFloat() > maxval )
542 maxval = val->GetFloat();
548 values.Add(new AliDCSValue(maxval,meanTimeStamp));
550 // once the case is inferred, add a "CASE:%10d",hvCase.Data()
552 // so we can them sum up for all channels and get a summary per run...
554 internalMsg += Form("CASE:%s",hvCase.Data());
556 if (msg) *msg = internalMsg.Data();
558 return hvCase=="OTHER" ? kFALSE : kTRUE;
561 //_____________________________________________________________________________
563 AliMUONCalibrationData::CreateHV(Int_t runNumber,
564 Int_t* startOfValidity,
568 /// Create a new HV map from the OCDB for a given run
569 TMap* hvMap = dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/HV",startOfValidity));
571 if (!hvMap) return 0x0;
576 TObjString* hvChannelName;
578 while ( ( hvChannelName = static_cast<TObjString*>(next()) ) )
580 TString name(hvChannelName->String());
582 if ( name.Contains("sw") ) continue; // skip switches
584 TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(name.Data()));
585 TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
588 AliErrorClass(Form("Could not get values for alias %s",name.Data()));
594 AliDebugClass(1,Form("channel %s",name.Data()));
595 Bool_t ok = PatchHVValues(*values,&msg);
599 messages->Add(new TObjString(Form("%s:%s",hvChannelName->String().Data(),msg.Data())));
604 AliErrorClass(Form("PatchHVValue was not successfull ! This is serious ! "
605 "You'll have to check the logic for channel %s in run %09d",
606 name.Data(),runNumber));
615 Int_t a(0),b(0),c(0),d(0),e(0),f(0),g(0),h(0),u(0),z(0);
616 TIter next(messages);
620 while ( ( msg = static_cast<TObjString*>(next()) ) )
622 Int_t i = msg->String().Index("CASE",strlen("CASE"),0,TString::kExact);
626 sscanf(msg->String()(i,msg->String().Length()-i).Data(),"CASE:%10c",&hvCase);
631 case 'A': ++a; break;
632 case 'B': ++b; break;
633 case 'C': ++c; break;
634 case 'D': ++d; break;
635 case 'E': ++e; break;
636 case 'F': ++f; break;
637 case 'G': ++g; break;
638 case 'H': ++h; break;
639 case 'Z': ++z; break;
644 messages->Add(new TObjString(Form("SUMMARY : # of cases A(%3d) B(%3d) C(%3d) D(%3d) E(%3d) F(%3d) G(%3d) H(%3d) Z(%3d) OTHER(%3d)",
645 a,b,c,d,e,f,g,h,z,u)));
651 //_____________________________________________________________________________
653 AliMUONCalibrationData::CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity)
655 /// Create a new Trigger HV and curent map from the OCDB for a given run
656 return dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/TriggerDCS",startOfValidity));
659 //_____________________________________________________________________________
661 AliMUONCalibrationData::CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity)
663 /// Get the internal store for LocalTriggerBoardMasks from OCDB
665 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/LocalTriggerBoardMasks",startOfValidity));
668 //_____________________________________________________________________________
670 AliMUONCalibrationData::CreateNeighbours(Int_t runNumber, Int_t* startOfValidity)
672 /// Create a neighbour store from the OCDB for a given run
673 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Neighbours",startOfValidity));
676 //_____________________________________________________________________________
678 AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* startOfValidity)
680 /// Access the CDB for a given path (e.g. MUON/Calib/Pedestals),
681 /// and return the corresponding TObject.
683 AliCodeTimerAutoClass(Form("%09d : %s",runNumber,path),0);
685 AliCDBManager* man = AliCDBManager::Instance();
687 AliCDBEntry* entry = man->Get(path,runNumber);
691 if ( startOfValidity ) *startOfValidity = entry->GetId().GetFirstRun();
693 TObject* object = entry->GetObject();
694 if (!(man->GetCacheFlag()))
696 entry->SetOwner(kFALSE);
703 if ( startOfValidity ) *startOfValidity = AliCDBRunRange::Infinity();
708 AliCodeTimerAutoClass(Form("Failed to get %s for run %09d",path,runNumber),1);
715 //_____________________________________________________________________________
717 AliMUONCalibrationData::CreateOccupancyMap(Int_t runNumber, Int_t* startOfValidity)
719 /// Create a new occupancy map store from the OCDB for a given run
720 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/OccupancyMap",startOfValidity));
723 //_____________________________________________________________________________
725 AliMUONCalibrationData::CreateRejectList(Int_t runNumber, Int_t* startOfValidity)
727 /// Create a new rejectlist store from the OCDB for a given run
728 return dynamic_cast<AliMUONRejectList*>(CreateObject(runNumber,"MUON/Calib/RejectList",startOfValidity));
731 //_____________________________________________________________________________
733 AliMUONCalibrationData::CreatePedestals(Int_t runNumber, Int_t* startOfValidity)
735 /// Create a new pedestal store from the OCDB for a given run
736 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Pedestals",startOfValidity));
739 //_____________________________________________________________________________
741 AliMUONCalibrationData::CreateConfig(Int_t runNumber, Int_t* startOfValidity)
743 /// Create a new config store from the OCDB for a given run
744 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Config",startOfValidity));
748 //_____________________________________________________________________________
749 AliMUONRegionalTriggerConfig*
750 AliMUONCalibrationData::CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity)
752 /// Create the internal store for RegionalTriggerConfig from OCDB
754 return dynamic_cast<AliMUONRegionalTriggerConfig*>(CreateObject(runNumber,"MUON/Calib/RegionalTriggerConfig",startOfValidity));
757 //_____________________________________________________________________________
758 AliMUONTriggerEfficiencyCells*
759 AliMUONCalibrationData::CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity)
761 /// Create trigger efficiency object from OCBD
763 return dynamic_cast<AliMUONTriggerEfficiencyCells*>(CreateObject(runNumber,"MUON/Calib/TriggerEfficiency",startOfValidity));
766 //_____________________________________________________________________________
768 AliMUONCalibrationData::CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity)
770 /// Create trigger LUT from OCDB
772 return dynamic_cast<AliMUONTriggerLut*>(CreateObject(runNumber,"MUON/Calib/TriggerLut",startOfValidity));
775 //_____________________________________________________________________________
777 AliMUONCalibrationData::Gains() const
779 /// Create (if needed) and return the internal store for gains.
780 if (fgBypassGains) return fgBypassGains;
784 fGains = CreateGains(fRunNumber);
789 //_____________________________________________________________________________
791 AliMUONCalibrationData::Gains(Int_t detElemId, Int_t manuId) const
793 /// Return the gains for a given (detElemId, manuId) pair
794 /// Note that, unlike the DeadChannel case, if the result is 0x0, that's an
795 /// error (meaning that we should get gains for all channels).
797 AliMUONVStore* gains = Gains();
803 return static_cast<AliMUONVCalibParam*>(gains->FindObject(detElemId,manuId));
806 //_____________________________________________________________________________
807 AliMUONGlobalCrateConfig*
808 AliMUONCalibrationData::GlobalTriggerCrateConfig() const
810 /// Return the config for the global trigger board.
812 if (!fGlobalTriggerCrateConfig)
814 fGlobalTriggerCrateConfig = CreateGlobalTriggerCrateConfig(fRunNumber);
816 return fGlobalTriggerCrateConfig;
820 //_____________________________________________________________________________
822 AliMUONCalibrationData::HV(Bool_t patched) const
824 /// Return the calibration for a given (detElemId, manuId) pair
828 fHV = CreateHV(fRunNumber,0,patched);
833 //_____________________________________________________________________________
835 AliMUONCalibrationData::TriggerDCS() const
837 /// Return the calibration for a given (detElemId, manuId) pair
841 fTriggerDCS = CreateTriggerDCS(fRunNumber);
846 //_____________________________________________________________________________
848 AliMUONCalibrationData::Neighbours() const
850 /// Create (if needed) and return the internal store for neighbours.
853 fNeighbours = CreateNeighbours(fRunNumber);
858 //_____________________________________________________________________________
860 AliMUONCalibrationData::LocalTriggerBoardMasks(Int_t localBoardNumber) const
862 /// Return the masks for a given trigger local board.
864 if (!fLocalTriggerBoardMasks)
866 fLocalTriggerBoardMasks = CreateLocalTriggerBoardMasks(fRunNumber);
869 if ( fLocalTriggerBoardMasks )
871 AliMUONVCalibParam* ltbm =
872 static_cast<AliMUONVCalibParam*>(fLocalTriggerBoardMasks->FindObject(localBoardNumber));
875 AliError(Form("Could not get mask for localBoardNumber=%d",localBoardNumber));
882 //_____________________________________________________________________________
884 AliMUONCalibrationData::OccupancyMap() const
886 /// Get occupancy map
889 fOccupancyMap = CreateOccupancyMap(fRunNumber);
891 return fOccupancyMap;
894 //_____________________________________________________________________________
896 AliMUONCalibrationData::RejectList() const
901 fRejectList = CreateRejectList(fRunNumber);
906 //_____________________________________________________________________________
908 AliMUONCalibrationData::BypassStores(AliMUONVStore* ped, AliMUONVStore* gain)
910 /// Force the use of those pedestals and gains
911 fgBypassPedestals = ped;
912 fgBypassGains = gain;
916 //_____________________________________________________________________________
918 AliMUONCalibrationData::Pedestals() const
922 if (fgBypassPedestals) return fgBypassPedestals;
926 fPedestals = CreatePedestals(fRunNumber);
931 //_____________________________________________________________________________
933 AliMUONCalibrationData::Config() const
939 fConfig = CreateConfig(fRunNumber);
944 //_____________________________________________________________________________
946 AliMUONCalibrationData::Pedestals(Int_t detElemId, Int_t manuId) const
948 /// Return the pedestals for a given (detElemId, manuId) pair.
949 /// A return value of 0x0 is considered an error, meaning we should get
950 /// pedestals for all channels.
952 AliMUONVStore* pedestals = Pedestals();
958 return static_cast<AliMUONVCalibParam*>(pedestals->FindObject(detElemId,manuId));
961 //_____________________________________________________________________________
963 AliMUONCalibrationData::Print(Option_t*) const
965 /// A very basic dump of our guts.
967 cout << "RunNumber " << RunNumber()
968 << " fGains=" << fGains
969 << " fPedestals=" << fPedestals
970 << " fConfig=" << fConfig
972 << " fTriggerDCS=" << fTriggerDCS
973 << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks
974 << " fRegionalTriggerConfig=" << fRegionalTriggerConfig
975 << " fGlobalTriggerCrateConfig=" << fGlobalTriggerCrateConfig
976 << " fTriggerLut=" << fTriggerLut
981 //_____________________________________________________________________________
982 AliMUONRegionalTriggerConfig*
983 AliMUONCalibrationData::RegionalTriggerConfig() const
985 /// Return the config for the regional trigger board.
987 if (!fRegionalTriggerConfig)
989 fRegionalTriggerConfig = CreateRegionalTriggerConfig(fRunNumber);
991 return fRegionalTriggerConfig;
995 //_____________________________________________________________________________
996 AliMUONTriggerEfficiencyCells*
997 AliMUONCalibrationData::TriggerEfficiency() const
999 /// Return the trigger efficiency.
1001 if (!fTriggerEfficiency)
1003 fTriggerEfficiency = CreateTriggerEfficiency(fRunNumber);
1005 return fTriggerEfficiency;
1009 //_____________________________________________________________________________
1011 AliMUONCalibrationData::TriggerLut() const
1013 /// Return the trigger look up table.
1017 fTriggerLut = CreateTriggerLut(fRunNumber);
1022 //_____________________________________________________________________________
1024 AliMUONCalibrationData::Reset()
1028 AliCodeTimerAuto("",0);
1040 delete fLocalTriggerBoardMasks;
1041 fLocalTriggerBoardMasks = 0x0;
1042 delete fRegionalTriggerConfig;
1043 fRegionalTriggerConfig = 0x0;
1044 delete fGlobalTriggerCrateConfig;
1045 fGlobalTriggerCrateConfig = 0x0;
1049 delete fTriggerEfficiency;
1050 fTriggerEfficiency = 0x0;
1051 delete fCapacitances;
1052 fCapacitances = 0x0;
1057 //_____________________________________________________________________________
1059 AliMUONCalibrationData::Check(Int_t runNumber)
1061 /// Self-check to see if we can read all data for a given run
1062 /// from the current OCDB...
1064 if ( ! CreateCapacitances(runNumber) )
1066 AliErrorClass("Could not read capacitances");
1070 AliInfoClass("Capacitances read OK");
1073 if ( ! CreateGains(runNumber) )
1075 AliErrorClass("Could not read gains");
1079 AliInfoClass("Gains read OK");
1082 if ( ! CreateGlobalTriggerCrateConfig(runNumber) )
1084 AliErrorClass("Could not read Trigger Crate Config");
1088 AliInfoClass("TriggerBoardMasks read OK");
1091 if ( ! CreateHV(runNumber) )
1093 AliErrorClass("Could not read HV");
1097 AliInfoClass("HV read OK");
1100 if ( ! CreateTriggerDCS(runNumber) )
1102 AliErrorClass("Could not read Trigger HV and Currents");
1106 AliInfoClass("Trigger HV and Currents read OK");
1109 if ( ! CreateNeighbours(runNumber) )
1111 AliErrorClass("Could not read Neighbours");
1115 AliInfoClass("Neighbours read OK");
1118 if ( ! CreateLocalTriggerBoardMasks(runNumber) )
1120 AliErrorClass("Could not read LocalTriggerBoardMasks");
1124 AliInfoClass("LocalTriggerBoardMasks read OK");
1127 if ( ! CreatePedestals(runNumber) )
1129 AliErrorClass("Could not read pedestals");
1133 AliInfoClass("Pedestals read OK");
1136 if ( ! CreateConfig(runNumber) )
1138 AliErrorClass("Could not read config");
1142 AliInfoClass("Config read OK");
1145 if ( ! CreateRegionalTriggerConfig(runNumber) )
1147 AliErrorClass("Could not read RegionalTriggerConfig");
1151 AliInfoClass("RegionalTriggerBoardMasks read OK");
1154 if ( ! CreateTriggerLut(runNumber) )
1156 AliErrorClass("Could not read TriggerLut");
1160 AliInfoClass("TriggerLut read OK");
1163 if ( ! CreateTriggerEfficiency(runNumber) )
1165 AliErrorClass("Could not read TriggerEfficiency");
1169 AliInfoClass("TriggerEfficiency read OK");