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 //-----------------------------------------------------------------------------
60 ClassImp(AliMUONCalibrationData)
63 AliMUONVStore* AliMUONCalibrationData::fgBypassPedestals(0x0);
64 AliMUONVStore* AliMUONCalibrationData::fgBypassGains(0x0);
68 void MarkForDeletion(Int_t* indices, Int_t first, Int_t last)
70 for ( Int_t i = first; i <= last; ++i )
77 //_____________________________________________________________________________
78 AliMUONCalibrationData::AliMUONCalibrationData(Int_t runNumber,
79 Bool_t deferredInitialization)
82 fRunNumber(runNumber),
87 fLocalTriggerBoardMasks(0x0),
88 fRegionalTriggerConfig(0x0),
89 fGlobalTriggerCrateConfig(0x0),
91 fTriggerEfficiency(0x0),
100 // If deferredInitialization is false, we read *all* calibrations
102 // So when using this class to access only one kind of calibrations (e.g.
103 // only pedestals), you should put deferredInitialization to kTRUE, which
104 // will instruct this object to fetch the data only when neeeded.
106 if ( deferredInitialization == kFALSE )
114 LocalTriggerBoardMasks(0);
115 RegionalTriggerConfig();
116 GlobalTriggerCrateConfig();
125 //_____________________________________________________________________________
126 AliMUONCalibrationData::~AliMUONCalibrationData()
128 /// Destructor. Note that we're the owner of our pointers if the OCDB cache
129 /// is not set. Otherwise the cache is supposed to take care of them...
130 if (!(AliCDBManager::Instance()->GetCacheFlag())) Reset();
133 //_____________________________________________________________________________
135 AliMUONCalibrationData::Capacitances() const
137 /// Create (if needed) and return the internal store for capacitances.
141 fCapacitances = CreateCapacitances(fRunNumber);
143 return fCapacitances;
146 //_____________________________________________________________________________
148 AliMUONCalibrationData::CreateCapacitances(Int_t runNumber, Int_t* startOfValidity)
150 /// Create capa store from OCDB for a given run
152 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Capacitances",startOfValidity));
155 //_____________________________________________________________________________
157 AliMUONCalibrationData::CreateGains(Int_t runNumber, Int_t* startOfValidity)
159 /// Create a new gain store from the OCDB for a given run
160 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Gains",startOfValidity));
163 //_____________________________________________________________________________
164 AliMUONGlobalCrateConfig*
165 AliMUONCalibrationData::CreateGlobalTriggerCrateConfig(Int_t runNumber, Int_t* startOfValidity)
167 /// Create the internal store for GlobalTriggerCrateConfig from OCDB
169 return dynamic_cast<AliMUONGlobalCrateConfig*>(CreateObject(runNumber,"MUON/Calib/GlobalTriggerCrateConfig",startOfValidity));
173 //______________________________________________________________________________
174 Bool_t AliMUONCalibrationData::CheckHVGroup(TObjArray& values, Int_t first, Int_t last, Double_t& value, Int_t& slope, TString* msg)
176 // Get the HV of the values between first and last indices
177 // return the HV slope (in Volt per second) and a message
178 // Return kFALSE if we must discard the group
183 if ( last < first ) return kFALSE;
184 if ( last - first < 2 ) return kFALSE;
189 Float_t HVSAME(1); // 1 volts
191 AliDCSValue* vfirst = static_cast<AliDCSValue*>(values.UncheckedAt(first));
192 AliDCSValue* vlast = static_cast<AliDCSValue*>(values.UncheckedAt(last));
194 Int_t deltaHV = TMath::Nint(TMath::Abs(vfirst->GetFloat()-vlast->GetFloat()));
196 if ( deltaHV < HVSAME ) return kFALSE;
198 for ( Int_t i = first; i <= last; ++i )
200 AliDCSValue* v = static_cast<AliDCSValue*>(values.UncheckedAt(i));
202 Double_t y = v->GetFloat() - vfirst->GetFloat();
203 Double_t x = v->GetTimeStamp() - vfirst->GetTimeStamp();
210 slope = value > 0 ? 1 : -1;
211 value = TMath::Abs(value);
213 UInt_t deltaTime = vlast->GetTimeStamp() - vfirst->GetTimeStamp();
217 if (slope>0) (*msg) = Form("RU%d[%d:%d](%d)",TMath::Nint(value),first,last,deltaTime);
218 if (slope<0) (*msg) = Form("RD%d[%d:%d](%d)",TMath::Nint(value),first,last,deltaTime);
220 if ( TMath::Nint(value) == 0 )
222 // this is to protect for the few cases
223 // (see e.g. MchHvLvLeft/Chamber00Left/Quad2Sect0.actual.vMon in run 134497)
224 // where we can have *lots* of values (2483 in this example) but that
225 // are more or less constant...
227 // or simply to remove small ramps
230 value = (vfirst->GetFloat()+vlast->GetFloat())/2.0;
231 *msg = Form("FLUCT%d[%d:%d]",TMath::Nint(value),first,last);
238 //______________________________________________________________________________
239 Bool_t AliMUONCalibrationData::PatchHVValues(TObjArray& values,
242 /// We do here a little bit of massaging of the HV values, if needed.
244 /// The main point is to "gather" values that are within a given small amount
245 /// of time (typically 60 seconds) and infer a slope from those values
246 /// slope > 0 means it is a ramp-up, slope < 0 that's a ramp-down
248 /// This is to avoid both the "ramp-down-before-end-of-run" and the
249 /// "ramp-up-after-start-of-run" syndroms...
251 /// Return kFALSE is the kind of HV (trouble) case we have here
252 /// has not been identified...
255 UInt_t DELTATIME(60); // in seconds
256 Int_t IENDRU(60); // in seconds
258 // Start by finding groups of values which are not separated (each) by more than
261 Bool_t gather(kFALSE);
265 groups.SetOwner(kTRUE);
267 for ( Int_t i = values.GetLast(); i > 0; --i )
269 AliDCSValue* vi = static_cast<AliDCSValue*>(values.UncheckedAt(i));
270 AliDCSValue* vj = static_cast<AliDCSValue*>(values.UncheckedAt(i-1));
272 if ( vi->GetTimeStamp() - vj->GetTimeStamp() < DELTATIME )
287 groups.Add(new AliMpIntPair(ilast,ifirst));
295 groups.Add(new AliMpIntPair(0,ifirst));
298 TIter nextGroup(&groups,kIterBackward);
306 Int_t nEndAndShortRU(0);
311 while ( ( p = static_cast<AliMpIntPair*>(nextGroup()) ) )
318 AliDebugClass(1,Form("group %d:%d",p->GetFirst(),p->GetSecond()));
320 Bool_t ok = CheckHVGroup(values,p->GetFirst(),p->GetSecond(),value,slope,&groupMsg);
328 if ( p->GetFirst() == 0 )
330 // start with a ramp-up
333 else if ( p->GetSecond() == values.GetLast() && TMath::Nint(value) < IENDRU )
339 // ramp-up in the middle of nowhere...
343 else if ( slope < 0 )
345 if ( p->GetSecond() == values.GetLast() )
347 // end with a ramp-down
352 // ramp-down in the middle of nowhere
356 AliDCSValue* d = static_cast<AliDCSValue*>(values.At(p->GetSecond()));
358 if ( d->GetFloat() < AliMpDCSNamer::TrackerHVOFF() )
368 internalMsg += groupMsg;
374 Once we have "decoded" the groups we try to find out which of
375 the following cases we're facing :
377 case A = -------- = OK(1)
381 \ = OK, once we have removed the ramp-down (2)
385 / = OK, once we have removed the ramp-up (3)
389 / \ = OK, once we have removed the ramp-down (2) and the ramp-up (3)
393 \____ = TRIP = BAD (here the ramp-down slope should be bigger than in case C)
396 \ ----- = BAD (trip + ramp-up at end of run)
399 case G = fluctuations (within a range defined in CheckHVGroup...)
403 / = ramp-up right at the end-of-run = OK (4)
406 (1) OK means the group is identified correctly, still the value can be below ready...
407 (2) ramp-down values will be removed if the ramp is indeed the last values in the serie
408 i.e. it's really an end-of-run problem (otherwise it's not case B)
409 (3) ramp-up values will be removed if the ramp is indeed the first values in the serie
410 i.e. it's really a start-of-run problem (otherwise it's not case C)
411 (4) OK if short enough...
413 Any other case is unknown and we'll :
415 b) assume the channel is OFF.
420 AliDebugClass(1,Form("msg=%s ngroupds=%d",internalMsg.Data(),ngroups));
421 AliDebugClass(1,Form("nRU %d nRD %d nStartRU %d nEndRD %d nTripRD %d nFluct %d",
422 nRU,nRD,nStartRU,nEndRD,nTripRD,nFluct));
424 TString hvCase("OTHER");
425 int dummy(0),a(-1),b(-1);
427 Int_t nvalues = values.GetSize();
428 Int_t* indices = new Int_t[nvalues];
429 memset(indices,0,nvalues*sizeof(Int_t));
431 AliDCSValue* vfirst = static_cast<AliDCSValue*>(values.UncheckedAt(0));
432 AliDCSValue* vlast = static_cast<AliDCSValue*>(values.UncheckedAt(values.GetLast()));
434 UInt_t meanTimeStamp = ( vfirst->GetTimeStamp() + vlast->GetTimeStamp() ) / 2;
440 else if ( nTripRD > 0 )
442 if ( nRU > 0 && nRD > 0 )
450 internalMsg += "TRIP ";
451 MarkForDeletion(indices,0,values.GetLast());
452 values.Add(new AliDCSValue(static_cast<Float_t>(0),meanTimeStamp));
454 else if ( nStartRU > 0 && nRU == 0 && nRD == 0 && nEndRD == 0 )
457 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
458 MarkForDeletion(indices,a,b);
460 else if ( nStartRU > 0 && nEndRD > 0 && nRD == 0 && nRU == 0 )
463 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
464 MarkForDeletion(indices,a,b-1);
465 Int_t i = internalMsg.Index("RD",strlen("RD"),0,TString::kExact);
466 sscanf(internalMsg(i,internalMsg.Length()-i).Data(),
467 "RD%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
468 MarkForDeletion(indices,a+1,b);
470 else if ( nEndRD > 0 && nStartRU == 0 && nRU == 0 && nRD == 0 )
473 Int_t i = internalMsg.Index("RD",strlen("RD"),0,TString::kExact);
474 sscanf(internalMsg(i,internalMsg.Length()-i).Data(),
475 "RD%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
476 MarkForDeletion(indices,a,b);
478 else if ( nFluct > 0 )
481 TObjArray* af = internalMsg.Tokenize(" ");
484 while ( ( str = static_cast<TObjString*>(next()) ) )
486 TString s(str->String());
487 if ( s.BeginsWith("FLUCT") )
489 sscanf(s.Data(),"FLUCT%d[%d:%d]",&dummy,&a,&b);
490 MarkForDeletion(indices,a,b);
495 else if ( nEndAndShortRU > 0 && nStartRU == 0 && nRU == 0 && nRD == 0 && nEndRD == 0 )
498 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
499 MarkForDeletion(indices,a,b);
504 // here we know it's not a trip, so let's assume everything is OK
505 // if first and last value are in the same ballpark
507 const Double_t HVFLUCT(20); // volts
509 if ( TMath::Abs(vfirst->GetFloat() - vlast->GetFloat()) < HVFLUCT )
513 MarkForDeletion(indices,1,nvalues-1);
516 for ( Int_t i = 0; i < nvalues; ++i )
528 if ( !values.GetEntries() )
530 AliErrorClass(Form("No value left after patch... Check that !!! initial # of values=%d msg=%s",
531 nvalues,internalMsg.Data()));
535 // take the max of the remaining values
536 TIter nextA(&values);
538 Float_t maxval(-9999);
540 while ( ( val = static_cast<AliDCSValue*>(nextA()) ) )
542 if ( val->GetFloat() > maxval )
544 maxval = val->GetFloat();
550 values.Add(new AliDCSValue(maxval,meanTimeStamp));
552 // once the case is inferred, add a "CASE:%10d",hvCase.Data()
554 // so we can them sum up for all channels and get a summary per run...
556 internalMsg += Form("CASE:%s",hvCase.Data());
558 if (msg) *msg = internalMsg.Data();
560 return hvCase=="OTHER" ? kFALSE : kTRUE;
563 //_____________________________________________________________________________
565 AliMUONCalibrationData::CreateHV(Int_t runNumber,
566 Int_t* startOfValidity,
570 /// Create a new HV map from the OCDB for a given run
571 TMap* hvMap = dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/HV",startOfValidity));
573 if (!hvMap) return 0x0;
578 TObjString* hvChannelName;
580 while ( ( hvChannelName = static_cast<TObjString*>(next()) ) )
582 TString name(hvChannelName->String());
584 if ( name.Contains("sw") ) continue; // skip switches
586 TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(name.Data()));
587 TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
590 AliErrorClass(Form("Could not get values for alias %s",name.Data()));
596 AliDebugClass(1,Form("channel %s",name.Data()));
597 Bool_t ok = PatchHVValues(*values,&msg);
601 messages->Add(new TObjString(Form("%s:%s",hvChannelName->String().Data(),msg.Data())));
606 AliErrorClass(Form("PatchHVValue was not successfull ! This is serious ! "
607 "You'll have to check the logic for channel %s in run %09d",
608 name.Data(),runNumber));
617 Int_t a(0),b(0),c(0),d(0),e(0),f(0),g(0),h(0),u(0),z(0);
618 TIter next(messages);
622 while ( ( msg = static_cast<TObjString*>(next()) ) )
624 Int_t i = msg->String().Index("CASE",strlen("CASE"),0,TString::kExact);
628 sscanf(msg->String()(i,msg->String().Length()-i).Data(),"CASE:%10c",&hvCase);
633 case 'A': ++a; break;
634 case 'B': ++b; break;
635 case 'C': ++c; break;
636 case 'D': ++d; break;
637 case 'E': ++e; break;
638 case 'F': ++f; break;
639 case 'G': ++g; break;
640 case 'H': ++h; break;
641 case 'Z': ++z; break;
646 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)",
647 a,b,c,d,e,f,g,h,z,u)));
653 //_____________________________________________________________________________
655 AliMUONCalibrationData::CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity)
657 /// Create a new Trigger HV and curent map from the OCDB for a given run
658 return dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/TriggerDCS",startOfValidity));
661 //_____________________________________________________________________________
663 AliMUONCalibrationData::CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity)
665 /// Get the internal store for LocalTriggerBoardMasks from OCDB
667 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/LocalTriggerBoardMasks",startOfValidity));
670 //_____________________________________________________________________________
672 AliMUONCalibrationData::CreateNeighbours(Int_t runNumber, Int_t* startOfValidity)
674 /// Create a neighbour store from the OCDB for a given run
675 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Neighbours",startOfValidity));
678 //_____________________________________________________________________________
680 AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* startOfValidity)
682 /// Access the CDB for a given path (e.g. MUON/Calib/Pedestals),
683 /// and return the corresponding TObject.
685 AliCodeTimerAutoClass(Form("%09d : %s",runNumber,path),0);
687 AliCDBManager* man = AliCDBManager::Instance();
689 AliCDBEntry* entry = man->Get(path,runNumber);
693 if ( startOfValidity ) *startOfValidity = entry->GetId().GetFirstRun();
695 TObject* object = entry->GetObject();
696 if (!(man->GetCacheFlag()))
698 entry->SetOwner(kFALSE);
703 // entry->SetOwner(kTRUE); //FIXME : this should be done but is causing problems with RecoParams at the end of the reco : investigate why...
709 if ( startOfValidity ) *startOfValidity = AliCDBRunRange::Infinity();
714 AliCodeTimerAutoClass(Form("Failed to get %s for run %09d",path,runNumber),1);
721 //_____________________________________________________________________________
723 AliMUONCalibrationData::CreateOccupancyMap(Int_t runNumber, Int_t* startOfValidity)
725 /// Create a new occupancy map store from the OCDB for a given run
726 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/OccupancyMap",startOfValidity));
729 //_____________________________________________________________________________
731 AliMUONCalibrationData::CreateRejectList(Int_t runNumber, Int_t* startOfValidity)
733 /// Create a new rejectlist store from the OCDB for a given run
734 return dynamic_cast<AliMUONRejectList*>(CreateObject(runNumber,"MUON/Calib/RejectList",startOfValidity));
737 //_____________________________________________________________________________
739 AliMUONCalibrationData::CreatePedestals(Int_t runNumber, Int_t* startOfValidity)
741 /// Create a new pedestal store from the OCDB for a given run
742 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Pedestals",startOfValidity));
745 //_____________________________________________________________________________
747 AliMUONCalibrationData::CreateConfig(Int_t runNumber, Int_t* startOfValidity)
749 /// Create a new config store from the OCDB for a given run
750 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Config",startOfValidity));
754 //_____________________________________________________________________________
755 AliMUONRegionalTriggerConfig*
756 AliMUONCalibrationData::CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity)
758 /// Create the internal store for RegionalTriggerConfig from OCDB
760 return dynamic_cast<AliMUONRegionalTriggerConfig*>(CreateObject(runNumber,"MUON/Calib/RegionalTriggerConfig",startOfValidity));
763 //_____________________________________________________________________________
764 AliMUONTriggerEfficiencyCells*
765 AliMUONCalibrationData::CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity)
767 /// Create trigger efficiency object from OCBD
769 return dynamic_cast<AliMUONTriggerEfficiencyCells*>(CreateObject(runNumber,"MUON/Calib/TriggerEfficiency",startOfValidity));
772 //_____________________________________________________________________________
774 AliMUONCalibrationData::CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity)
776 /// Create trigger LUT from OCDB
778 return dynamic_cast<AliMUONTriggerLut*>(CreateObject(runNumber,"MUON/Calib/TriggerLut",startOfValidity));
781 //_____________________________________________________________________________
783 AliMUONCalibrationData::Gains() const
785 /// Create (if needed) and return the internal store for gains.
786 if (fgBypassGains) return fgBypassGains;
790 fGains = CreateGains(fRunNumber);
795 //_____________________________________________________________________________
797 AliMUONCalibrationData::Gains(Int_t detElemId, Int_t manuId) const
799 /// Return the gains for a given (detElemId, manuId) pair
800 /// Note that, unlike the DeadChannel case, if the result is 0x0, that's an
801 /// error (meaning that we should get gains for all channels).
803 AliMUONVStore* gains = Gains();
809 return static_cast<AliMUONVCalibParam*>(gains->FindObject(detElemId,manuId));
812 //_____________________________________________________________________________
813 AliMUONGlobalCrateConfig*
814 AliMUONCalibrationData::GlobalTriggerCrateConfig() const
816 /// Return the config for the global trigger board.
818 if (!fGlobalTriggerCrateConfig)
820 fGlobalTriggerCrateConfig = CreateGlobalTriggerCrateConfig(fRunNumber);
822 return fGlobalTriggerCrateConfig;
826 //_____________________________________________________________________________
828 AliMUONCalibrationData::HV(Bool_t patched) const
830 /// Return the calibration for a given (detElemId, manuId) pair
834 fHV = CreateHV(fRunNumber,0,patched);
839 //_____________________________________________________________________________
841 AliMUONCalibrationData::TriggerDCS() const
843 /// Return the calibration for a given (detElemId, manuId) pair
847 fTriggerDCS = CreateTriggerDCS(fRunNumber);
852 //_____________________________________________________________________________
854 AliMUONCalibrationData::Neighbours() const
856 /// Create (if needed) and return the internal store for neighbours.
859 fNeighbours = CreateNeighbours(fRunNumber);
864 //_____________________________________________________________________________
866 AliMUONCalibrationData::LocalTriggerBoardMasks(Int_t localBoardNumber) const
868 /// Return the masks for a given trigger local board.
870 if (!fLocalTriggerBoardMasks)
872 fLocalTriggerBoardMasks = CreateLocalTriggerBoardMasks(fRunNumber);
875 if ( fLocalTriggerBoardMasks )
877 AliMUONVCalibParam* ltbm =
878 static_cast<AliMUONVCalibParam*>(fLocalTriggerBoardMasks->FindObject(localBoardNumber));
881 AliError(Form("Could not get mask for localBoardNumber=%d",localBoardNumber));
888 //_____________________________________________________________________________
890 AliMUONCalibrationData::OccupancyMap() const
892 /// Get occupancy map
895 fOccupancyMap = CreateOccupancyMap(fRunNumber);
897 return fOccupancyMap;
900 //_____________________________________________________________________________
902 AliMUONCalibrationData::RejectList() const
907 fRejectList = CreateRejectList(fRunNumber);
912 //_____________________________________________________________________________
914 AliMUONCalibrationData::BypassStores(AliMUONVStore* ped, AliMUONVStore* gain)
916 /// Force the use of those pedestals and gains
917 fgBypassPedestals = ped;
918 fgBypassGains = gain;
922 //_____________________________________________________________________________
924 AliMUONCalibrationData::Pedestals() const
928 if (fgBypassPedestals) return fgBypassPedestals;
932 fPedestals = CreatePedestals(fRunNumber);
937 //_____________________________________________________________________________
939 AliMUONCalibrationData::Config() const
945 fConfig = CreateConfig(fRunNumber);
950 //_____________________________________________________________________________
952 AliMUONCalibrationData::Pedestals(Int_t detElemId, Int_t manuId) const
954 /// Return the pedestals for a given (detElemId, manuId) pair.
955 /// A return value of 0x0 is considered an error, meaning we should get
956 /// pedestals for all channels.
958 AliMUONVStore* pedestals = Pedestals();
964 return static_cast<AliMUONVCalibParam*>(pedestals->FindObject(detElemId,manuId));
967 //_____________________________________________________________________________
969 AliMUONCalibrationData::Print(Option_t*) const
971 /// A very basic dump of our guts.
973 cout << "RunNumber " << RunNumber()
974 << " fGains=" << fGains
975 << " fPedestals=" << fPedestals
976 << " fConfig=" << fConfig
978 << " fTriggerDCS=" << fTriggerDCS
979 << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks
980 << " fRegionalTriggerConfig=" << fRegionalTriggerConfig
981 << " fGlobalTriggerCrateConfig=" << fGlobalTriggerCrateConfig
982 << " fTriggerLut=" << fTriggerLut
987 //_____________________________________________________________________________
988 AliMUONRegionalTriggerConfig*
989 AliMUONCalibrationData::RegionalTriggerConfig() const
991 /// Return the config for the regional trigger board.
993 if (!fRegionalTriggerConfig)
995 fRegionalTriggerConfig = CreateRegionalTriggerConfig(fRunNumber);
997 return fRegionalTriggerConfig;
1001 //_____________________________________________________________________________
1002 AliMUONTriggerEfficiencyCells*
1003 AliMUONCalibrationData::TriggerEfficiency() const
1005 /// Return the trigger efficiency.
1007 if (!fTriggerEfficiency)
1009 fTriggerEfficiency = CreateTriggerEfficiency(fRunNumber);
1011 return fTriggerEfficiency;
1015 //_____________________________________________________________________________
1017 AliMUONCalibrationData::TriggerLut() const
1019 /// Return the trigger look up table.
1023 fTriggerLut = CreateTriggerLut(fRunNumber);
1028 //_____________________________________________________________________________
1030 AliMUONCalibrationData::Reset()
1034 AliCodeTimerAuto("",0);
1046 delete fLocalTriggerBoardMasks;
1047 fLocalTriggerBoardMasks = 0x0;
1048 delete fRegionalTriggerConfig;
1049 fRegionalTriggerConfig = 0x0;
1050 delete fGlobalTriggerCrateConfig;
1051 fGlobalTriggerCrateConfig = 0x0;
1055 delete fTriggerEfficiency;
1056 fTriggerEfficiency = 0x0;
1057 delete fCapacitances;
1058 fCapacitances = 0x0;
1063 //_____________________________________________________________________________
1065 AliMUONCalibrationData::Check(Int_t runNumber)
1067 /// Self-check to see if we can read all data for a given run
1068 /// from the current OCDB...
1070 if ( ! CreateCapacitances(runNumber) )
1072 AliErrorClass("Could not read capacitances");
1076 AliInfoClass("Capacitances read OK");
1079 if ( ! CreateGains(runNumber) )
1081 AliErrorClass("Could not read gains");
1085 AliInfoClass("Gains read OK");
1088 if ( ! CreateGlobalTriggerCrateConfig(runNumber) )
1090 AliErrorClass("Could not read Trigger Crate Config");
1094 AliInfoClass("TriggerBoardMasks read OK");
1097 if ( ! CreateHV(runNumber) )
1099 AliErrorClass("Could not read HV");
1103 AliInfoClass("HV read OK");
1106 if ( ! CreateTriggerDCS(runNumber) )
1108 AliErrorClass("Could not read Trigger HV and Currents");
1112 AliInfoClass("Trigger HV and Currents read OK");
1115 if ( ! CreateNeighbours(runNumber) )
1117 AliErrorClass("Could not read Neighbours");
1121 AliInfoClass("Neighbours read OK");
1124 if ( ! CreateLocalTriggerBoardMasks(runNumber) )
1126 AliErrorClass("Could not read LocalTriggerBoardMasks");
1130 AliInfoClass("LocalTriggerBoardMasks read OK");
1133 if ( ! CreatePedestals(runNumber) )
1135 AliErrorClass("Could not read pedestals");
1139 AliInfoClass("Pedestals read OK");
1142 if ( ! CreateConfig(runNumber) )
1144 AliErrorClass("Could not read config");
1148 AliInfoClass("Config read OK");
1151 if ( ! CreateRegionalTriggerConfig(runNumber) )
1153 AliErrorClass("Could not read RegionalTriggerConfig");
1157 AliInfoClass("RegionalTriggerBoardMasks read OK");
1160 if ( ! CreateTriggerLut(runNumber) )
1162 AliErrorClass("Could not read TriggerLut");
1166 AliInfoClass("TriggerLut read OK");
1169 if ( ! CreateTriggerEfficiency(runNumber) )
1171 AliErrorClass("Could not read TriggerEfficiency");
1175 AliInfoClass("TriggerEfficiency read OK");