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));
575 TObjString* hvChannelName;
577 while ( ( hvChannelName = static_cast<TObjString*>(next()) ) )
579 TString name(hvChannelName->String());
581 if ( name.Contains("sw") ) continue; // skip switches
583 TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(name.Data()));
584 TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
587 AliErrorClass(Form("Could not get values for alias %s",name.Data()));
593 AliDebugClass(1,Form("channel %s",name.Data()));
594 Bool_t ok = PatchHVValues(*values,&msg);
598 messages->Add(new TObjString(Form("%s:%s",hvChannelName->String().Data(),msg.Data())));
603 AliErrorClass(Form("PatchHVValue was not successfull ! This is serious ! "
604 "You'll have to check the logic for channel %s in run %09d",
605 name.Data(),runNumber));
614 Int_t a(0),b(0),c(0),d(0),e(0),f(0),g(0),h(0),u(0),z(0);
615 TIter next(messages);
619 while ( ( msg = static_cast<TObjString*>(next()) ) )
621 Int_t i = msg->String().Index("CASE",strlen("CASE"),0,TString::kExact);
625 sscanf(msg->String()(i,msg->String().Length()-i).Data(),"CASE:%c",&hvCase);
630 case 'A': ++a; break;
631 case 'B': ++b; break;
632 case 'C': ++c; break;
633 case 'D': ++d; break;
634 case 'E': ++e; break;
635 case 'F': ++f; break;
636 case 'G': ++g; break;
637 case 'H': ++h; break;
638 case 'Z': ++z; break;
643 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)",
644 a,b,c,d,e,f,g,h,z,u)));
650 //_____________________________________________________________________________
652 AliMUONCalibrationData::CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity)
654 /// Create a new Trigger HV and curent map from the OCDB for a given run
655 return dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/TriggerDCS",startOfValidity));
658 //_____________________________________________________________________________
660 AliMUONCalibrationData::CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity)
662 /// Get the internal store for LocalTriggerBoardMasks from OCDB
664 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/LocalTriggerBoardMasks",startOfValidity));
667 //_____________________________________________________________________________
669 AliMUONCalibrationData::CreateNeighbours(Int_t runNumber, Int_t* startOfValidity)
671 /// Create a neighbour store from the OCDB for a given run
672 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Neighbours",startOfValidity));
675 //_____________________________________________________________________________
677 AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* startOfValidity)
679 /// Access the CDB for a given path (e.g. MUON/Calib/Pedestals),
680 /// and return the corresponding TObject.
682 AliCodeTimerAutoClass(Form("%09d : %s",runNumber,path),0);
684 AliCDBManager* man = AliCDBManager::Instance();
686 AliCDBEntry* entry = man->Get(path,runNumber);
690 if ( startOfValidity ) *startOfValidity = entry->GetId().GetFirstRun();
692 TObject* object = entry->GetObject();
693 if (!(man->GetCacheFlag()))
695 entry->SetOwner(kFALSE);
702 if ( startOfValidity ) *startOfValidity = AliCDBRunRange::Infinity();
707 AliCodeTimerAutoClass(Form("Failed to get %s for run %09d",path,runNumber),1);
714 //_____________________________________________________________________________
716 AliMUONCalibrationData::CreateOccupancyMap(Int_t runNumber, Int_t* startOfValidity)
718 /// Create a new occupancy map store from the OCDB for a given run
719 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/OccupancyMap",startOfValidity));
722 //_____________________________________________________________________________
724 AliMUONCalibrationData::CreateRejectList(Int_t runNumber, Int_t* startOfValidity)
726 /// Create a new rejectlist store from the OCDB for a given run
727 return dynamic_cast<AliMUONRejectList*>(CreateObject(runNumber,"MUON/Calib/RejectList",startOfValidity));
730 //_____________________________________________________________________________
732 AliMUONCalibrationData::CreatePedestals(Int_t runNumber, Int_t* startOfValidity)
734 /// Create a new pedestal store from the OCDB for a given run
735 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Pedestals",startOfValidity));
738 //_____________________________________________________________________________
740 AliMUONCalibrationData::CreateConfig(Int_t runNumber, Int_t* startOfValidity)
742 /// Create a new config store from the OCDB for a given run
743 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Config",startOfValidity));
747 //_____________________________________________________________________________
748 AliMUONRegionalTriggerConfig*
749 AliMUONCalibrationData::CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity)
751 /// Create the internal store for RegionalTriggerConfig from OCDB
753 return dynamic_cast<AliMUONRegionalTriggerConfig*>(CreateObject(runNumber,"MUON/Calib/RegionalTriggerConfig",startOfValidity));
756 //_____________________________________________________________________________
757 AliMUONTriggerEfficiencyCells*
758 AliMUONCalibrationData::CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity)
760 /// Create trigger efficiency object from OCBD
762 return dynamic_cast<AliMUONTriggerEfficiencyCells*>(CreateObject(runNumber,"MUON/Calib/TriggerEfficiency",startOfValidity));
765 //_____________________________________________________________________________
767 AliMUONCalibrationData::CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity)
769 /// Create trigger LUT from OCDB
771 return dynamic_cast<AliMUONTriggerLut*>(CreateObject(runNumber,"MUON/Calib/TriggerLut",startOfValidity));
774 //_____________________________________________________________________________
776 AliMUONCalibrationData::Gains() const
778 /// Create (if needed) and return the internal store for gains.
779 if (fgBypassGains) return fgBypassGains;
783 fGains = CreateGains(fRunNumber);
788 //_____________________________________________________________________________
790 AliMUONCalibrationData::Gains(Int_t detElemId, Int_t manuId) const
792 /// Return the gains for a given (detElemId, manuId) pair
793 /// Note that, unlike the DeadChannel case, if the result is 0x0, that's an
794 /// error (meaning that we should get gains for all channels).
796 AliMUONVStore* gains = Gains();
802 return static_cast<AliMUONVCalibParam*>(gains->FindObject(detElemId,manuId));
805 //_____________________________________________________________________________
806 AliMUONGlobalCrateConfig*
807 AliMUONCalibrationData::GlobalTriggerCrateConfig() const
809 /// Return the config for the global trigger board.
811 if (!fGlobalTriggerCrateConfig)
813 fGlobalTriggerCrateConfig = CreateGlobalTriggerCrateConfig(fRunNumber);
815 return fGlobalTriggerCrateConfig;
819 //_____________________________________________________________________________
821 AliMUONCalibrationData::HV(Bool_t patched) const
823 /// Return the calibration for a given (detElemId, manuId) pair
827 fHV = CreateHV(fRunNumber,0,patched);
832 //_____________________________________________________________________________
834 AliMUONCalibrationData::TriggerDCS() const
836 /// Return the calibration for a given (detElemId, manuId) pair
840 fTriggerDCS = CreateTriggerDCS(fRunNumber);
845 //_____________________________________________________________________________
847 AliMUONCalibrationData::Neighbours() const
849 /// Create (if needed) and return the internal store for neighbours.
852 fNeighbours = CreateNeighbours(fRunNumber);
857 //_____________________________________________________________________________
859 AliMUONCalibrationData::LocalTriggerBoardMasks(Int_t localBoardNumber) const
861 /// Return the masks for a given trigger local board.
863 if (!fLocalTriggerBoardMasks)
865 fLocalTriggerBoardMasks = CreateLocalTriggerBoardMasks(fRunNumber);
868 if ( fLocalTriggerBoardMasks )
870 AliMUONVCalibParam* ltbm =
871 static_cast<AliMUONVCalibParam*>(fLocalTriggerBoardMasks->FindObject(localBoardNumber));
874 AliError(Form("Could not get mask for localBoardNumber=%d",localBoardNumber));
881 //_____________________________________________________________________________
883 AliMUONCalibrationData::OccupancyMap() const
885 /// Get occupancy map
888 fOccupancyMap = CreateOccupancyMap(fRunNumber);
890 return fOccupancyMap;
893 //_____________________________________________________________________________
895 AliMUONCalibrationData::RejectList() const
900 fRejectList = CreateRejectList(fRunNumber);
905 //_____________________________________________________________________________
907 AliMUONCalibrationData::BypassStores(AliMUONVStore* ped, AliMUONVStore* gain)
909 /// Force the use of those pedestals and gains
910 fgBypassPedestals = ped;
911 fgBypassGains = gain;
915 //_____________________________________________________________________________
917 AliMUONCalibrationData::Pedestals() const
921 if (fgBypassPedestals) return fgBypassPedestals;
925 fPedestals = CreatePedestals(fRunNumber);
930 //_____________________________________________________________________________
932 AliMUONCalibrationData::Config() const
938 fConfig = CreateConfig(fRunNumber);
943 //_____________________________________________________________________________
945 AliMUONCalibrationData::Pedestals(Int_t detElemId, Int_t manuId) const
947 /// Return the pedestals for a given (detElemId, manuId) pair.
948 /// A return value of 0x0 is considered an error, meaning we should get
949 /// pedestals for all channels.
951 AliMUONVStore* pedestals = Pedestals();
957 return static_cast<AliMUONVCalibParam*>(pedestals->FindObject(detElemId,manuId));
960 //_____________________________________________________________________________
962 AliMUONCalibrationData::Print(Option_t*) const
964 /// A very basic dump of our guts.
966 cout << "RunNumber " << RunNumber()
967 << " fGains=" << fGains
968 << " fPedestals=" << fPedestals
969 << " fConfig=" << fConfig
971 << " fTriggerDCS=" << fTriggerDCS
972 << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks
973 << " fRegionalTriggerConfig=" << fRegionalTriggerConfig
974 << " fGlobalTriggerCrateConfig=" << fGlobalTriggerCrateConfig
975 << " fTriggerLut=" << fTriggerLut
980 //_____________________________________________________________________________
981 AliMUONRegionalTriggerConfig*
982 AliMUONCalibrationData::RegionalTriggerConfig() const
984 /// Return the config for the regional trigger board.
986 if (!fRegionalTriggerConfig)
988 fRegionalTriggerConfig = CreateRegionalTriggerConfig(fRunNumber);
990 return fRegionalTriggerConfig;
994 //_____________________________________________________________________________
995 AliMUONTriggerEfficiencyCells*
996 AliMUONCalibrationData::TriggerEfficiency() const
998 /// Return the trigger efficiency.
1000 if (!fTriggerEfficiency)
1002 fTriggerEfficiency = CreateTriggerEfficiency(fRunNumber);
1004 return fTriggerEfficiency;
1008 //_____________________________________________________________________________
1010 AliMUONCalibrationData::TriggerLut() const
1012 /// Return the trigger look up table.
1016 fTriggerLut = CreateTriggerLut(fRunNumber);
1021 //_____________________________________________________________________________
1023 AliMUONCalibrationData::Reset()
1027 AliCodeTimerAuto("",0);
1039 delete fLocalTriggerBoardMasks;
1040 fLocalTriggerBoardMasks = 0x0;
1041 delete fRegionalTriggerConfig;
1042 fRegionalTriggerConfig = 0x0;
1043 delete fGlobalTriggerCrateConfig;
1044 fGlobalTriggerCrateConfig = 0x0;
1048 delete fTriggerEfficiency;
1049 fTriggerEfficiency = 0x0;
1050 delete fCapacitances;
1051 fCapacitances = 0x0;
1056 //_____________________________________________________________________________
1058 AliMUONCalibrationData::Check(Int_t runNumber)
1060 /// Self-check to see if we can read all data for a given run
1061 /// from the current OCDB...
1063 if ( ! CreateCapacitances(runNumber) )
1065 AliErrorClass("Could not read capacitances");
1069 AliInfoClass("Capacitances read OK");
1072 if ( ! CreateGains(runNumber) )
1074 AliErrorClass("Could not read gains");
1078 AliInfoClass("Gains read OK");
1081 if ( ! CreateGlobalTriggerCrateConfig(runNumber) )
1083 AliErrorClass("Could not read Trigger Crate Config");
1087 AliInfoClass("TriggerBoardMasks read OK");
1090 if ( ! CreateHV(runNumber) )
1092 AliErrorClass("Could not read HV");
1096 AliInfoClass("HV read OK");
1099 if ( ! CreateTriggerDCS(runNumber) )
1101 AliErrorClass("Could not read Trigger HV and Currents");
1105 AliInfoClass("Trigger HV and Currents read OK");
1108 if ( ! CreateNeighbours(runNumber) )
1110 AliErrorClass("Could not read Neighbours");
1114 AliInfoClass("Neighbours read OK");
1117 if ( ! CreateLocalTriggerBoardMasks(runNumber) )
1119 AliErrorClass("Could not read LocalTriggerBoardMasks");
1123 AliInfoClass("LocalTriggerBoardMasks read OK");
1126 if ( ! CreatePedestals(runNumber) )
1128 AliErrorClass("Could not read pedestals");
1132 AliInfoClass("Pedestals read OK");
1135 if ( ! CreateConfig(runNumber) )
1137 AliErrorClass("Could not read config");
1141 AliInfoClass("Config read OK");
1144 if ( ! CreateRegionalTriggerConfig(runNumber) )
1146 AliErrorClass("Could not read RegionalTriggerConfig");
1150 AliInfoClass("RegionalTriggerBoardMasks read OK");
1153 if ( ! CreateTriggerLut(runNumber) )
1155 AliErrorClass("Could not read TriggerLut");
1159 AliInfoClass("TriggerLut read OK");
1162 if ( ! CreateTriggerEfficiency(runNumber) )
1164 AliErrorClass("Could not read TriggerEfficiency");
1168 AliInfoClass("TriggerEfficiency read OK");