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 "AliMUONConstants.h"
28 #include "AliMUONGlobalCrateConfig.h"
29 #include "AliMUONRegionalTriggerConfig.h"
30 #include "AliMUONRejectList.h"
31 #include "AliMUONTriggerEfficiencyCells.h"
32 #include "AliMUONTriggerLut.h"
33 #include "AliMUONVCalibParam.h"
34 #include "AliMUONVStore.h"
35 #include "AliMUONVStore.h"
37 #include <Riostream.h>
42 //-----------------------------------------------------------------------------
43 /// \class AliMUONCalibrationData
45 /// For the moment, this class stores pedestals, gains, hv (for tracker)
46 /// and lut, masks and efficiencies (for trigger) that are fetched from the CDB.
48 /// This class is to be considered as a convenience class.
49 /// Its aim is to ease retrieval of calibration data from the
50 /// condition database.
52 /// It acts as a "facade" to a bunch of underlying
53 /// containers/calibration classes.
55 /// \author Laurent Aphecetche
56 //-----------------------------------------------------------------------------
59 ClassImp(AliMUONCalibrationData)
62 AliMUONVStore* AliMUONCalibrationData::fgBypassPedestals(0x0);
63 AliMUONVStore* AliMUONCalibrationData::fgBypassGains(0x0);
67 void MarkForDeletion(Int_t* indices, Int_t first, Int_t last)
69 for ( Int_t i = first; i <= last; ++i )
76 //_____________________________________________________________________________
77 AliMUONCalibrationData::AliMUONCalibrationData(Int_t runNumber,
78 Bool_t deferredInitialization)
81 fRunNumber(runNumber),
86 fLocalTriggerBoardMasks(0x0),
87 fRegionalTriggerConfig(0x0),
88 fGlobalTriggerCrateConfig(0x0),
90 fTriggerEfficiency(0x0),
99 // If deferredInitialization is false, we read *all* calibrations
101 // So when using this class to access only one kind of calibrations (e.g.
102 // only pedestals), you should put deferredInitialization to kTRUE, which
103 // will instruct this object to fetch the data only when neeeded.
105 if ( deferredInitialization == kFALSE )
113 LocalTriggerBoardMasks(0);
114 RegionalTriggerConfig();
115 GlobalTriggerCrateConfig();
124 //_____________________________________________________________________________
125 AliMUONCalibrationData::~AliMUONCalibrationData()
127 /// Destructor. Note that we're the owner of our pointers if the OCDB cache
128 /// is not set. Otherwise the cache is supposed to take care of them...
129 if (!(AliCDBManager::Instance()->GetCacheFlag())) Reset();
132 //_____________________________________________________________________________
134 AliMUONCalibrationData::Capacitances() const
136 /// Create (if needed) and return the internal store for capacitances.
140 fCapacitances = CreateCapacitances(fRunNumber);
142 return fCapacitances;
145 //_____________________________________________________________________________
147 AliMUONCalibrationData::CreateCapacitances(Int_t runNumber, Int_t* startOfValidity)
149 /// Create capa store from OCDB for a given run
151 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Capacitances",startOfValidity));
154 //_____________________________________________________________________________
156 AliMUONCalibrationData::CreateGains(Int_t runNumber, Int_t* startOfValidity)
158 /// Create a new gain store from the OCDB for a given run
159 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Gains",startOfValidity));
162 //_____________________________________________________________________________
163 AliMUONGlobalCrateConfig*
164 AliMUONCalibrationData::CreateGlobalTriggerCrateConfig(Int_t runNumber, Int_t* startOfValidity)
166 /// Create the internal store for GlobalTriggerCrateConfig from OCDB
168 return dynamic_cast<AliMUONGlobalCrateConfig*>(CreateObject(runNumber,"MUON/Calib/GlobalTriggerCrateConfig",startOfValidity));
172 //______________________________________________________________________________
173 Bool_t AliMUONCalibrationData::CheckHVGroup(TObjArray& values, Int_t first, Int_t last, Double_t& value, Int_t& slope, TString* msg)
175 // Get the HV of the values between first and last indices
176 // return the HV slope (in Volt per second) and a message
177 // Return kFALSE if we must discard the group
182 if ( last < first ) return kFALSE;
183 if ( last - first < 2 ) return kFALSE;
188 Float_t HVSAME(1); // 1 volts
190 AliDCSValue* vfirst = static_cast<AliDCSValue*>(values.UncheckedAt(first));
191 AliDCSValue* vlast = static_cast<AliDCSValue*>(values.UncheckedAt(last));
193 Int_t deltaHV = TMath::Nint(TMath::Abs(vfirst->GetFloat()-vlast->GetFloat()));
195 if ( deltaHV < HVSAME ) return kFALSE;
197 for ( Int_t i = first; i <= last; ++i )
199 AliDCSValue* v = static_cast<AliDCSValue*>(values.UncheckedAt(i));
201 Double_t y = v->GetFloat() - vfirst->GetFloat();
202 Double_t x = v->GetTimeStamp() - vfirst->GetTimeStamp();
209 slope = value > 0 ? 1 : -1;
210 value = TMath::Abs(value);
212 UInt_t deltaTime = vlast->GetTimeStamp() - vfirst->GetTimeStamp();
216 if (slope>0) (*msg) = Form("RU%d[%d:%d](%d)",TMath::Nint(value),first,last,deltaTime);
217 if (slope<0) (*msg) = Form("RD%d[%d:%d](%d)",TMath::Nint(value),first,last,deltaTime);
219 if ( TMath::Nint(value) == 0 )
221 // this is to protect for the few cases
222 // (see e.g. MchHvLvLeft/Chamber00Left/Quad2Sect0.actual.vMon in run 134497)
223 // where we can have *lots* of values (2483 in this example) but that
224 // are more or less constant...
226 // or simply to remove small ramps
229 value = (vfirst->GetFloat()+vlast->GetFloat())/2.0;
230 *msg = Form("FLUCT%d[%d:%d]",TMath::Nint(value),first,last);
237 //______________________________________________________________________________
238 Bool_t AliMUONCalibrationData::PatchHVValues(TObjArray& values,
241 /// We do here a little bit of massaging of the HV values, if needed.
243 /// The main point is to "gather" values that are within a given small amount
244 /// of time (typically 60 seconds) and infer a slope from those values
245 /// slope > 0 means it is a ramp-up, slope < 0 that's a ramp-down
247 /// This is to avoid both the "ramp-down-before-end-of-run" and the
248 /// "ramp-up-after-start-of-run" syndroms...
250 /// Return kFALSE is the kind of HV (trouble) case we have here
251 /// has not been identified...
254 UInt_t DELTATIME(60); // in seconds
255 Int_t IENDRU(60); // in seconds
257 // Start by finding groups of values which are not separated (each) by more than
260 Bool_t gather(kFALSE);
264 groups.SetOwner(kTRUE);
266 for ( Int_t i = values.GetLast(); i > 0; --i )
268 AliDCSValue* vi = static_cast<AliDCSValue*>(values.UncheckedAt(i));
269 AliDCSValue* vj = static_cast<AliDCSValue*>(values.UncheckedAt(i-1));
271 if ( vi->GetTimeStamp() - vj->GetTimeStamp() < DELTATIME )
286 groups.Add(new AliMpIntPair(ilast,ifirst));
294 groups.Add(new AliMpIntPair(0,ifirst));
297 TIter nextGroup(&groups,kIterBackward);
305 Int_t nEndAndShortRU(0);
310 while ( ( p = static_cast<AliMpIntPair*>(nextGroup()) ) )
317 AliDebugClass(1,Form("group %d:%d",p->GetFirst(),p->GetSecond()));
319 Bool_t ok = CheckHVGroup(values,p->GetFirst(),p->GetSecond(),value,slope,&groupMsg);
327 if ( p->GetFirst() == 0 )
329 // start with a ramp-up
332 else if ( p->GetSecond() == values.GetLast() && TMath::Nint(value) < IENDRU )
338 // ramp-up in the middle of nowhere...
342 else if ( slope < 0 )
344 if ( p->GetSecond() == values.GetLast() )
346 // end with a ramp-down
351 // ramp-down in the middle of nowhere
355 AliDCSValue* d = static_cast<AliDCSValue*>(values.At(p->GetSecond()));
357 if ( d->GetFloat() < AliMpDCSNamer::TrackerHVOFF() )
367 internalMsg += groupMsg;
373 Once we have "decoded" the groups we try to find out which of
374 the following cases we're facing :
376 case A = -------- = OK(1)
380 \ = OK, once we have removed the ramp-down (2)
384 / = OK, once we have removed the ramp-up (3)
388 / \ = OK, once we have removed the ramp-down (2) and the ramp-up (3)
392 \____ = TRIP = BAD (here the ramp-down slope should be bigger than in case C)
395 \ ----- = BAD (trip + ramp-up at end of run)
398 case G = fluctuations (within a range defined in CheckHVGroup...)
402 / = ramp-up right at the end-of-run = OK (4)
405 (1) OK means the group is identified correctly, still the value can be below ready...
406 (2) ramp-down values will be removed if the ramp is indeed the last values in the serie
407 i.e. it's really an end-of-run problem (otherwise it's not case B)
408 (3) ramp-up values will be removed if the ramp is indeed the first values in the serie
409 i.e. it's really a start-of-run problem (otherwise it's not case C)
410 (4) OK if short enough...
412 Any other case is unknown and we'll :
414 b) assume the channel is OFF.
419 AliDebugClass(1,Form("msg=%s ngroupds=%d",internalMsg.Data(),ngroups));
420 AliDebugClass(1,Form("nRU %d nRD %d nStartRU %d nEndRD %d nTripRD %d nFluct %d",
421 nRU,nRD,nStartRU,nEndRD,nTripRD,nFluct));
423 TString hvCase("OTHER");
424 int dummy(0),a(-1),b(-1);
426 Int_t nvalues = values.GetSize();
427 Int_t* indices = new Int_t[nvalues];
428 memset(indices,0,nvalues*sizeof(Int_t));
430 AliDCSValue* vfirst = static_cast<AliDCSValue*>(values.UncheckedAt(0));
431 AliDCSValue* vlast = static_cast<AliDCSValue*>(values.UncheckedAt(values.GetLast()));
433 UInt_t meanTimeStamp = ( vfirst->GetTimeStamp() + vlast->GetTimeStamp() ) / 2;
439 else if ( nTripRD > 0 )
441 if ( nRU > 0 && nRD > 0 )
449 internalMsg += "TRIP ";
450 MarkForDeletion(indices,0,values.GetLast());
451 values.Add(new AliDCSValue(static_cast<Float_t>(0),meanTimeStamp));
453 else if ( nStartRU > 0 && nRU == 0 && nRD == 0 && nEndRD == 0 )
456 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
457 MarkForDeletion(indices,a,b);
459 else if ( nStartRU > 0 && nEndRD > 0 && nRD == 0 && nRU == 0 )
462 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
463 MarkForDeletion(indices,a,b-1);
464 Int_t i = internalMsg.Index("RD",strlen("RD"),0,TString::kExact);
465 sscanf(internalMsg(i,internalMsg.Length()-i).Data(),
466 "RD%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
467 MarkForDeletion(indices,a+1,b);
469 else if ( nEndRD > 0 && nStartRU == 0 && nRU == 0 && nRD == 0 )
472 Int_t i = internalMsg.Index("RD",strlen("RD"),0,TString::kExact);
473 sscanf(internalMsg(i,internalMsg.Length()-i).Data(),
474 "RD%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
475 MarkForDeletion(indices,a,b);
477 else if ( nFluct > 0 )
480 TObjArray* af = internalMsg.Tokenize(" ");
483 while ( ( str = static_cast<TObjString*>(next()) ) )
485 TString s(str->String());
486 if ( s.BeginsWith("FLUCT") )
488 sscanf(s.Data(),"FLUCT%d[%d:%d]",&dummy,&a,&b);
489 MarkForDeletion(indices,a,b);
494 else if ( nEndAndShortRU > 0 && nStartRU == 0 && nRU == 0 && nRD == 0 && nEndRD == 0 )
497 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
498 MarkForDeletion(indices,a,b);
503 // here we know it's not a trip, so let's assume everything is OK
504 // if first and last value are in the same ballpark
506 const Double_t HVFLUCT(20); // volts
508 if ( TMath::Abs(vfirst->GetFloat() - vlast->GetFloat()) < HVFLUCT )
512 MarkForDeletion(indices,1,nvalues-1);
515 for ( Int_t i = 0; i < nvalues; ++i )
527 if ( !values.GetEntries() )
529 AliErrorClass(Form("No value left after patch... Check that !!! initial # of values=%d msg=%s",
530 nvalues,internalMsg.Data()));
534 // take the max of the remaining values
535 TIter nextA(&values);
537 Float_t maxval(-9999);
539 while ( ( val = static_cast<AliDCSValue*>(nextA()) ) )
541 if ( val->GetFloat() > maxval )
543 maxval = val->GetFloat();
549 values.Add(new AliDCSValue(maxval,meanTimeStamp));
551 // once the case is inferred, add a "CASE:%10d",hvCase.Data()
553 // so we can them sum up for all channels and get a summary per run...
555 internalMsg += Form("CASE:%s",hvCase.Data());
557 if (msg) *msg = internalMsg.Data();
559 return hvCase=="OTHER" ? kFALSE : kTRUE;
562 //_____________________________________________________________________________
564 AliMUONCalibrationData::CreateHV(Int_t runNumber,
565 Int_t* startOfValidity,
569 /// Create a new HV map from the OCDB for a given run
570 TMap* hvMap = dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/HV",startOfValidity));
572 if (!hvMap) return 0x0;
577 TObjString* hvChannelName;
579 while ( ( hvChannelName = static_cast<TObjString*>(next()) ) )
581 TString name(hvChannelName->String());
583 if ( name.Contains("sw") ) continue; // skip switches
585 TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(name.Data()));
586 TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
589 AliErrorClass(Form("Could not get values for alias %s",name.Data()));
595 AliDebugClass(1,Form("channel %s",name.Data()));
596 Bool_t ok = PatchHVValues(*values,&msg);
600 messages->Add(new TObjString(Form("%s:%s",hvChannelName->String().Data(),msg.Data())));
605 AliErrorClass(Form("PatchHVValue was not successfull ! This is serious ! "
606 "You'll have to check the logic for channel %s in run %09d",
607 name.Data(),runNumber));
616 Int_t a(0),b(0),c(0),d(0),e(0),f(0),g(0),h(0),u(0),z(0);
617 TIter next(messages);
621 while ( ( msg = static_cast<TObjString*>(next()) ) )
623 Int_t i = msg->String().Index("CASE",strlen("CASE"),0,TString::kExact);
627 sscanf(msg->String()(i,msg->String().Length()-i).Data(),"CASE:%10c",&hvCase);
632 case 'A': ++a; break;
633 case 'B': ++b; break;
634 case 'C': ++c; break;
635 case 'D': ++d; break;
636 case 'E': ++e; break;
637 case 'F': ++f; break;
638 case 'G': ++g; break;
639 case 'H': ++h; break;
640 case 'Z': ++z; break;
645 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)",
646 a,b,c,d,e,f,g,h,z,u)));
652 //_____________________________________________________________________________
654 AliMUONCalibrationData::CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity)
656 /// Create a new Trigger HV and curent map from the OCDB for a given run
657 return dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/TriggerDCS",startOfValidity));
660 //_____________________________________________________________________________
662 AliMUONCalibrationData::CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity)
664 /// Get the internal store for LocalTriggerBoardMasks from OCDB
666 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/LocalTriggerBoardMasks",startOfValidity));
669 //_____________________________________________________________________________
671 AliMUONCalibrationData::CreateNeighbours(Int_t runNumber, Int_t* startOfValidity)
673 /// Create a neighbour store from the OCDB for a given run
674 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Neighbours",startOfValidity));
677 //_____________________________________________________________________________
679 AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* startOfValidity)
681 /// Access the CDB for a given path (e.g. MUON/Calib/Pedestals),
682 /// and return the corresponding TObject.
684 AliCodeTimerAutoClass(Form("%09d : %s",runNumber,path),0);
686 AliCDBManager* man = AliCDBManager::Instance();
688 AliCDBEntry* entry = man->Get(path,runNumber);
692 if ( startOfValidity ) *startOfValidity = entry->GetId().GetFirstRun();
694 TObject* object = entry->GetObject();
695 if (!(man->GetCacheFlag()))
697 entry->SetOwner(kFALSE);
704 if ( startOfValidity ) *startOfValidity = AliCDBRunRange::Infinity();
709 AliCodeTimerAutoClass(Form("Failed to get %s for run %09d",path,runNumber),1);
716 //_____________________________________________________________________________
718 AliMUONCalibrationData::CreateOccupancyMap(Int_t runNumber, Int_t* startOfValidity)
720 /// Create a new occupancy map store from the OCDB for a given run
721 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/OccupancyMap",startOfValidity));
724 //_____________________________________________________________________________
726 AliMUONCalibrationData::CreateRejectList(Int_t runNumber, Int_t* startOfValidity)
728 /// Create a new rejectlist store from the OCDB for a given run
729 return dynamic_cast<AliMUONRejectList*>(CreateObject(runNumber,"MUON/Calib/RejectList",startOfValidity));
732 //_____________________________________________________________________________
734 AliMUONCalibrationData::CreatePedestals(Int_t runNumber, Int_t* startOfValidity)
736 /// Create a new pedestal store from the OCDB for a given run
737 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Pedestals",startOfValidity));
740 //_____________________________________________________________________________
742 AliMUONCalibrationData::CreateConfig(Int_t runNumber, Int_t* startOfValidity)
744 /// Create a new config store from the OCDB for a given run
745 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Config",startOfValidity));
749 //_____________________________________________________________________________
750 AliMUONRegionalTriggerConfig*
751 AliMUONCalibrationData::CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity)
753 /// Create the internal store for RegionalTriggerConfig from OCDB
755 return dynamic_cast<AliMUONRegionalTriggerConfig*>(CreateObject(runNumber,"MUON/Calib/RegionalTriggerConfig",startOfValidity));
758 //_____________________________________________________________________________
759 AliMUONTriggerEfficiencyCells*
760 AliMUONCalibrationData::CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity)
762 /// Create trigger efficiency object from OCBD
764 return dynamic_cast<AliMUONTriggerEfficiencyCells*>(CreateObject(runNumber,"MUON/Calib/TriggerEfficiency",startOfValidity));
767 //_____________________________________________________________________________
769 AliMUONCalibrationData::CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity)
771 /// Create trigger LUT from OCDB
773 return dynamic_cast<AliMUONTriggerLut*>(CreateObject(runNumber,"MUON/Calib/TriggerLut",startOfValidity));
776 //_____________________________________________________________________________
778 AliMUONCalibrationData::Gains() const
780 /// Create (if needed) and return the internal store for gains.
781 if (fgBypassGains) return fgBypassGains;
785 fGains = CreateGains(fRunNumber);
790 //_____________________________________________________________________________
792 AliMUONCalibrationData::Gains(Int_t detElemId, Int_t manuId) const
794 /// Return the gains for a given (detElemId, manuId) pair
795 /// Note that, unlike the DeadChannel case, if the result is 0x0, that's an
796 /// error (meaning that we should get gains for all channels).
798 AliMUONVStore* gains = Gains();
804 return static_cast<AliMUONVCalibParam*>(gains->FindObject(detElemId,manuId));
807 //_____________________________________________________________________________
808 AliMUONGlobalCrateConfig*
809 AliMUONCalibrationData::GlobalTriggerCrateConfig() const
811 /// Return the config for the global trigger board.
813 if (!fGlobalTriggerCrateConfig)
815 fGlobalTriggerCrateConfig = CreateGlobalTriggerCrateConfig(fRunNumber);
817 return fGlobalTriggerCrateConfig;
821 //_____________________________________________________________________________
823 AliMUONCalibrationData::HV(Bool_t patched) const
825 /// Return the calibration for a given (detElemId, manuId) pair
829 fHV = CreateHV(fRunNumber,0,patched);
834 //_____________________________________________________________________________
836 AliMUONCalibrationData::TriggerDCS() const
838 /// Return the calibration for a given (detElemId, manuId) pair
842 fTriggerDCS = CreateTriggerDCS(fRunNumber);
847 //_____________________________________________________________________________
849 AliMUONCalibrationData::Neighbours() const
851 /// Create (if needed) and return the internal store for neighbours.
854 fNeighbours = CreateNeighbours(fRunNumber);
859 //_____________________________________________________________________________
861 AliMUONCalibrationData::LocalTriggerBoardMasks(Int_t localBoardNumber) const
863 /// Return the masks for a given trigger local board.
865 if (!fLocalTriggerBoardMasks)
867 fLocalTriggerBoardMasks = CreateLocalTriggerBoardMasks(fRunNumber);
870 if ( fLocalTriggerBoardMasks )
872 AliMUONVCalibParam* ltbm =
873 static_cast<AliMUONVCalibParam*>(fLocalTriggerBoardMasks->FindObject(localBoardNumber));
876 AliError(Form("Could not get mask for localBoardNumber=%d",localBoardNumber));
883 //_____________________________________________________________________________
885 AliMUONCalibrationData::OccupancyMap() const
887 /// Get occupancy map
890 fOccupancyMap = CreateOccupancyMap(fRunNumber);
892 return fOccupancyMap;
895 //_____________________________________________________________________________
897 AliMUONCalibrationData::RejectList() const
902 fRejectList = CreateRejectList(fRunNumber);
907 //_____________________________________________________________________________
909 AliMUONCalibrationData::BypassStores(AliMUONVStore* ped, AliMUONVStore* gain)
911 /// Force the use of those pedestals and gains
912 fgBypassPedestals = ped;
913 fgBypassGains = gain;
917 //_____________________________________________________________________________
919 AliMUONCalibrationData::Pedestals() const
923 if (fgBypassPedestals) return fgBypassPedestals;
927 fPedestals = CreatePedestals(fRunNumber);
932 //_____________________________________________________________________________
934 AliMUONCalibrationData::Config() const
940 fConfig = CreateConfig(fRunNumber);
945 //_____________________________________________________________________________
947 AliMUONCalibrationData::Pedestals(Int_t detElemId, Int_t manuId) const
949 /// Return the pedestals for a given (detElemId, manuId) pair.
950 /// A return value of 0x0 is considered an error, meaning we should get
951 /// pedestals for all channels.
953 AliMUONVStore* pedestals = Pedestals();
959 return static_cast<AliMUONVCalibParam*>(pedestals->FindObject(detElemId,manuId));
962 //_____________________________________________________________________________
964 AliMUONCalibrationData::Print(Option_t*) const
966 /// A very basic dump of our guts.
968 cout << "RunNumber " << RunNumber()
969 << " fGains=" << fGains
970 << " fPedestals=" << fPedestals
971 << " fConfig=" << fConfig
973 << " fTriggerDCS=" << fTriggerDCS
974 << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks
975 << " fRegionalTriggerConfig=" << fRegionalTriggerConfig
976 << " fGlobalTriggerCrateConfig=" << fGlobalTriggerCrateConfig
977 << " fTriggerLut=" << fTriggerLut
982 //_____________________________________________________________________________
983 AliMUONRegionalTriggerConfig*
984 AliMUONCalibrationData::RegionalTriggerConfig() const
986 /// Return the config for the regional trigger board.
988 if (!fRegionalTriggerConfig)
990 fRegionalTriggerConfig = CreateRegionalTriggerConfig(fRunNumber);
992 return fRegionalTriggerConfig;
996 //_____________________________________________________________________________
997 AliMUONTriggerEfficiencyCells*
998 AliMUONCalibrationData::TriggerEfficiency() const
1000 /// Return the trigger efficiency.
1002 if (!fTriggerEfficiency)
1004 fTriggerEfficiency = CreateTriggerEfficiency(fRunNumber);
1006 return fTriggerEfficiency;
1010 //_____________________________________________________________________________
1012 AliMUONCalibrationData::TriggerLut() const
1014 /// Return the trigger look up table.
1018 fTriggerLut = CreateTriggerLut(fRunNumber);
1023 //_____________________________________________________________________________
1025 AliMUONCalibrationData::Reset()
1029 AliCodeTimerAuto("",0);
1041 delete fLocalTriggerBoardMasks;
1042 fLocalTriggerBoardMasks = 0x0;
1043 delete fRegionalTriggerConfig;
1044 fRegionalTriggerConfig = 0x0;
1045 delete fGlobalTriggerCrateConfig;
1046 fGlobalTriggerCrateConfig = 0x0;
1050 delete fTriggerEfficiency;
1051 fTriggerEfficiency = 0x0;
1052 delete fCapacitances;
1053 fCapacitances = 0x0;
1058 //_____________________________________________________________________________
1060 AliMUONCalibrationData::Check(Int_t runNumber)
1062 /// Self-check to see if we can read all data for a given run
1063 /// from the current OCDB...
1065 if ( ! CreateCapacitances(runNumber) )
1067 AliErrorClass("Could not read capacitances");
1071 AliInfoClass("Capacitances read OK");
1074 if ( ! CreateGains(runNumber) )
1076 AliErrorClass("Could not read gains");
1080 AliInfoClass("Gains read OK");
1083 if ( ! CreateGlobalTriggerCrateConfig(runNumber) )
1085 AliErrorClass("Could not read Trigger Crate Config");
1089 AliInfoClass("TriggerBoardMasks read OK");
1092 if ( ! CreateHV(runNumber) )
1094 AliErrorClass("Could not read HV");
1098 AliInfoClass("HV read OK");
1101 if ( ! CreateTriggerDCS(runNumber) )
1103 AliErrorClass("Could not read Trigger HV and Currents");
1107 AliInfoClass("Trigger HV and Currents read OK");
1110 if ( ! CreateNeighbours(runNumber) )
1112 AliErrorClass("Could not read Neighbours");
1116 AliInfoClass("Neighbours read OK");
1119 if ( ! CreateLocalTriggerBoardMasks(runNumber) )
1121 AliErrorClass("Could not read LocalTriggerBoardMasks");
1125 AliInfoClass("LocalTriggerBoardMasks read OK");
1128 if ( ! CreatePedestals(runNumber) )
1130 AliErrorClass("Could not read pedestals");
1134 AliInfoClass("Pedestals read OK");
1137 if ( ! CreateConfig(runNumber) )
1139 AliErrorClass("Could not read config");
1143 AliInfoClass("Config read OK");
1146 if ( ! CreateRegionalTriggerConfig(runNumber) )
1148 AliErrorClass("Could not read RegionalTriggerConfig");
1152 AliInfoClass("RegionalTriggerBoardMasks read OK");
1155 if ( ! CreateTriggerLut(runNumber) )
1157 AliErrorClass("Could not read TriggerLut");
1161 AliInfoClass("TriggerLut read OK");
1164 if ( ! CreateTriggerEfficiency(runNumber) )
1166 AliErrorClass("Could not read TriggerEfficiency");
1170 AliInfoClass("TriggerEfficiency read OK");