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,
243 /// We do here a little bit of massaging of the HV values, if needed.
245 /// The main point is to "gather" values that are within a given small amount
246 /// of time (typically 60 seconds) and infer a slope from those values
247 /// slope > 0 means it is a ramp-up, slope < 0 that's a ramp-down
249 /// This is to avoid both the "ramp-down-before-end-of-run" and the
250 /// "ramp-up-after-start-of-run" syndroms...
252 /// Use dryRun = kTRUE to fill the messages *without* altering the values
254 /// Return kFALSE is the kind of HV (trouble) case we have here
255 /// has not been identified...
258 UInt_t DELTATIME(60); // in seconds
259 Int_t IENDRU(60); // in seconds
261 // Start by finding groups of values which are not separated (each) by more than
264 Bool_t gather(kFALSE);
268 groups.SetOwner(kTRUE);
270 for ( Int_t i = values.GetLast(); i > 0; --i )
272 AliDCSValue* vi = static_cast<AliDCSValue*>(values.UncheckedAt(i));
273 AliDCSValue* vj = static_cast<AliDCSValue*>(values.UncheckedAt(i-1));
275 if ( vi->GetTimeStamp() - vj->GetTimeStamp() < DELTATIME )
290 groups.Add(new AliMpIntPair(ilast,ifirst));
298 groups.Add(new AliMpIntPair(0,ifirst));
301 TIter nextGroup(&groups,kIterBackward);
309 Int_t nEndAndShortRU(0);
314 trips.SetOwner(kTRUE);
316 while ( ( p = static_cast<AliMpIntPair*>(nextGroup()) ) )
323 AliDebugClass(1,Form("group %d:%d",p->GetFirst(),p->GetSecond()));
325 Bool_t ok = CheckHVGroup(values,p->GetFirst(),p->GetSecond(),value,slope,&groupMsg);
333 if ( p->GetFirst() == 0 )
335 // start with a ramp-up
338 else if ( p->GetSecond() == values.GetLast() && TMath::Nint(value) < IENDRU )
344 // ramp-up in the middle of nowhere...
348 else if ( slope < 0 )
350 if ( p->GetSecond() == values.GetLast() )
352 // end with a ramp-down
357 // ramp-down in the middle of nowhere
361 AliDCSValue* d = static_cast<AliDCSValue*>(values.At(p->GetSecond()));
363 if ( d->GetFloat() < AliMpDCSNamer::TrackerHVOFF() )
366 AliDCSValue* tripStart = static_cast<AliDCSValue*>(values.At(p->GetFirst()));
367 trips.Add(new AliMpIntPair(tripStart->GetTimeStamp(),TMath::Nint(tripStart->GetFloat())));
375 internalMsg += groupMsg;
381 Once we have "decoded" the groups we try to find out which of
382 the following cases we're facing :
384 case A = -------- = OK(1)
388 \ = OK, once we have removed the ramp-down (2)
392 / = OK, once we have removed the ramp-up (3)
396 / \ = OK, once we have removed the ramp-down (2) and the ramp-up (3)
400 \____ = TRIP = BAD (here the ramp-down slope should be bigger than in case C)
403 \ ----- = BAD (trip + ramp-up at end of run)
406 case G = fluctuations (within a range defined in CheckHVGroup...)
410 / = ramp-up right at the end-of-run = OK (4)
413 (1) OK means the group is identified correctly, still the value can be below ready...
414 (2) ramp-down values will be removed if the ramp is indeed the last values in the serie
415 i.e. it's really an end-of-run problem (otherwise it's not case B)
416 (3) ramp-up values will be removed if the ramp is indeed the first values in the serie
417 i.e. it's really a start-of-run problem (otherwise it's not case C)
418 (4) OK if short enough...
420 Any other case is unknown and we'll :
422 b) assume the channel is OFF.
427 AliDebugClass(1,Form("msg=%s ngroupds=%d",internalMsg.Data(),ngroups));
428 AliDebugClass(1,Form("nRU %d nRD %d nStartRU %d nEndRD %d nTripRD %d nFluct %d",
429 nRU,nRD,nStartRU,nEndRD,nTripRD,nFluct));
431 TString hvCase("OTHER");
432 int dummy(0),a(-1),b(-1);
434 Int_t nvalues = values.GetSize();
435 Int_t* indices = new Int_t[nvalues];
436 memset(indices,0,nvalues*sizeof(Int_t));
438 AliDCSValue* vfirst = static_cast<AliDCSValue*>(values.UncheckedAt(0));
439 AliDCSValue* vlast = static_cast<AliDCSValue*>(values.UncheckedAt(values.GetLast()));
441 UInt_t meanTimeStamp = ( vfirst->GetTimeStamp() + vlast->GetTimeStamp() ) / 2;
447 else if ( nTripRD > 0 )
449 const Double_t HVLOWTRIP(600); // a trip below this value is considered a "low trip"
450 // i.e. one starting for a non-operational voltage
452 internalMsg += Form("NT:%d ",nTripRD);
454 if ( nRU > 0 && nRD > 0 )
463 for ( Int_t iTrip = 0; iTrip <= trips.GetLast(); ++iTrip )
465 AliMpIntPair* tripPair = static_cast<AliMpIntPair*>(trips.At(iTrip));
466 TString tripType("TRIP");
467 if ( tripPair->GetSecond() < HVLOWTRIP)
469 tripType = "LOWTRIP";
472 internalMsg += Form("%s SV:%d TS:%d ",tripType.Data(),tripPair->GetSecond(),tripPair->GetFirst());
475 // we put here the TRIP value as SV:value
476 // for cases where there's a drop in voltage but the starting point was
477 // below operational voltage, so strictly speaking it's *not* a trip, but
478 // more a big fluctuation
481 MarkForDeletion(indices,0,values.GetLast());
482 values.Add(new AliDCSValue(static_cast<Float_t>(0),meanTimeStamp));
485 else if ( nStartRU > 0 && nRU == 0 && nRD == 0 && nEndRD == 0 )
490 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
491 MarkForDeletion(indices,a,b);
494 else if ( nStartRU > 0 && nEndRD > 0 && nRD == 0 && nRU == 0 )
499 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
500 MarkForDeletion(indices,a,b-1);
501 Int_t i = internalMsg.Index("RD",strlen("RD"),0,TString::kExact);
502 sscanf(internalMsg(i,internalMsg.Length()-i).Data(),
503 "RD%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
504 MarkForDeletion(indices,a+1,b);
507 else if ( nEndRD > 0 && nStartRU == 0 && nRU == 0 && nRD == 0 )
512 Int_t i = internalMsg.Index("RD",strlen("RD"),0,TString::kExact);
513 sscanf(internalMsg(i,internalMsg.Length()-i).Data(),
514 "RD%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
515 MarkForDeletion(indices,a,b);
518 else if ( nFluct > 0 )
523 TObjArray* af = internalMsg.Tokenize(" ");
526 while ( ( str = static_cast<TObjString*>(next()) ) )
528 TString s(str->String());
529 if ( s.BeginsWith("FLUCT") )
531 sscanf(s.Data(),"FLUCT%d[%d:%d]",&dummy,&a,&b);
532 MarkForDeletion(indices,a,b);
538 else if ( nEndAndShortRU > 0 && nStartRU == 0 && nRU == 0 && nRD == 0 && nEndRD == 0 )
543 sscanf(internalMsg.Data(),"RU%10d[%10d:%10d]%80s",&dummy,&a,&b,r);
544 MarkForDeletion(indices,a,b);
550 // here we know it's not a trip, so let's assume everything is OK
551 // if first and last value are in the same ballpark
553 const Double_t HVFLUCT(20); // volts
555 if ( TMath::Abs(vfirst->GetFloat() - vlast->GetFloat()) < HVFLUCT )
561 MarkForDeletion(indices,1,nvalues-1);
567 for ( Int_t i = 0; i < nvalues; ++i )
580 if ( !values.GetEntries() )
582 AliErrorClass(Form("No value left after patch... Check that !!! initial # of values=%d msg=%s",
583 nvalues,internalMsg.Data()));
589 // take the max of the remaining values
590 TIter nextA(&values);
592 Float_t maxval(-9999);
594 while ( ( val = static_cast<AliDCSValue*>(nextA()) ) )
596 if ( val->GetFloat() > maxval )
598 maxval = val->GetFloat();
604 values.Add(new AliDCSValue(maxval,meanTimeStamp));
607 // once the case is inferred, add a "CASE:%10d",hvCase.Data()
609 // so we can them sum up for all channels and get a summary per run...
611 internalMsg += Form("CASE:%s",hvCase.Data());
613 if (msg) *msg = internalMsg.Data();
615 return hvCase=="OTHER" ? kFALSE : kTRUE;
618 //_____________________________________________________________________________
620 AliMUONCalibrationData::CreateHV(Int_t runNumber,
621 Int_t* startOfValidity,
626 /// Create a new HV map from the OCDB for a given run
628 /// dryRun is only usefull with patched=kTRUE and non-empty messages) :
629 /// it allow to get the list of messages without altering the values at all
630 /// (A patch without a patch, so to speak...)
633 TMap* hvMap = dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/HV",startOfValidity));
635 if (!hvMap) return 0x0;
640 TObjString* hvChannelName;
642 while ( ( hvChannelName = static_cast<TObjString*>(next()) ) )
644 TString name(hvChannelName->String());
646 if ( name.Contains("sw") ) continue; // skip switches
648 if ( name.Contains("iMon") ) continue; // skip HV currents
650 TPair* hvPair = static_cast<TPair*>(hvMap->FindObject(name.Data()));
651 TObjArray* values = static_cast<TObjArray*>(hvPair->Value());
654 AliErrorClass(Form("Could not get values for alias %s",name.Data()));
660 AliDebugClass(1,Form("channel %s",name.Data()));
661 Bool_t ok = PatchHVValues(*values,&msg,dryRun);
665 messages->Add(new TObjString(Form("%s %s",hvChannelName->String().Data(),msg.Data())));
670 AliErrorClass(Form("PatchHVValue was not successfull ! This is serious ! "
671 "You'll have to check the logic for channel %s in run %09d",
672 name.Data(),runNumber));
681 Int_t a(0),b(0),c(0),d(0),e(0),f(0),g(0),h(0),u(0),z(0);
682 TIter next(messages);
686 while ( ( msg = static_cast<TObjString*>(next()) ) )
688 Int_t i = msg->String().Index("CASE",strlen("CASE"),0,TString::kExact);
692 sscanf(msg->String()(i,msg->String().Length()-i).Data(),"CASE:%10c",&hvCase);
697 case 'A': ++a; break;
698 case 'B': ++b; break;
699 case 'C': ++c; break;
700 case 'D': ++d; break;
701 case 'E': ++e; break;
702 case 'F': ++f; break;
703 case 'G': ++g; break;
704 case 'H': ++h; break;
705 case 'Z': ++z; break;
710 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)",
711 a,b,c,d,e,f,g,h,z,u)));
717 //_____________________________________________________________________________
719 AliMUONCalibrationData::CreateTriggerDCS(Int_t runNumber, Int_t* startOfValidity)
721 /// Create a new Trigger HV and curent map from the OCDB for a given run
722 return dynamic_cast<TMap*>(CreateObject(runNumber,"MUON/Calib/TriggerDCS",startOfValidity));
725 //_____________________________________________________________________________
727 AliMUONCalibrationData::CreateLocalTriggerBoardMasks(Int_t runNumber, Int_t* startOfValidity)
729 /// Get the internal store for LocalTriggerBoardMasks from OCDB
731 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/LocalTriggerBoardMasks",startOfValidity));
734 //_____________________________________________________________________________
736 AliMUONCalibrationData::CreateNeighbours(Int_t runNumber, Int_t* startOfValidity)
738 /// Create a neighbour store from the OCDB for a given run
739 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Neighbours",startOfValidity));
742 //_____________________________________________________________________________
744 AliMUONCalibrationData::CreateObject(Int_t runNumber, const char* path, Int_t* startOfValidity)
746 /// Access the CDB for a given path (e.g. MUON/Calib/Pedestals),
747 /// and return the corresponding TObject.
749 AliCodeTimerAutoClass(Form("%09d : %s",runNumber,path),0);
751 AliCDBManager* man = AliCDBManager::Instance();
753 AliCDBEntry* entry = man->Get(path,runNumber);
757 if ( startOfValidity ) *startOfValidity = entry->GetId().GetFirstRun();
759 TObject* object = entry->GetObject();
760 if (!(man->GetCacheFlag()))
762 entry->SetOwner(kFALSE);
767 // entry->SetOwner(kTRUE); //FIXME : this should be done but is causing problems with RecoParams at the end of the reco : investigate why...
773 if ( startOfValidity ) *startOfValidity = AliCDBRunRange::Infinity();
778 AliCodeTimerAutoClass(Form("Failed to get %s for run %09d",path,runNumber),1);
785 //_____________________________________________________________________________
787 AliMUONCalibrationData::CreateOccupancyMap(Int_t runNumber, Int_t* startOfValidity)
789 /// Create a new occupancy map store from the OCDB for a given run
790 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/OccupancyMap",startOfValidity));
793 //_____________________________________________________________________________
795 AliMUONCalibrationData::CreateRejectList(Int_t runNumber, Int_t* startOfValidity)
797 /// Create a new rejectlist store from the OCDB for a given run
798 return dynamic_cast<AliMUONRejectList*>(CreateObject(runNumber,"MUON/Calib/RejectList",startOfValidity));
801 //_____________________________________________________________________________
803 AliMUONCalibrationData::CreatePedestals(Int_t runNumber, Int_t* startOfValidity)
805 /// Create a new pedestal store from the OCDB for a given run
806 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Pedestals",startOfValidity));
809 //_____________________________________________________________________________
811 AliMUONCalibrationData::CreateConfig(Int_t runNumber, Int_t* startOfValidity)
813 /// Create a new config store from the OCDB for a given run
814 return dynamic_cast<AliMUONVStore*>(CreateObject(runNumber,"MUON/Calib/Config",startOfValidity));
818 //_____________________________________________________________________________
819 AliMUONRegionalTriggerConfig*
820 AliMUONCalibrationData::CreateRegionalTriggerConfig(Int_t runNumber, Int_t* startOfValidity)
822 /// Create the internal store for RegionalTriggerConfig from OCDB
824 return dynamic_cast<AliMUONRegionalTriggerConfig*>(CreateObject(runNumber,"MUON/Calib/RegionalTriggerConfig",startOfValidity));
827 //_____________________________________________________________________________
828 AliMUONTriggerEfficiencyCells*
829 AliMUONCalibrationData::CreateTriggerEfficiency(Int_t runNumber, Int_t* startOfValidity)
831 /// Create trigger efficiency object from OCBD
833 return dynamic_cast<AliMUONTriggerEfficiencyCells*>(CreateObject(runNumber,"MUON/Calib/TriggerEfficiency",startOfValidity));
836 //_____________________________________________________________________________
838 AliMUONCalibrationData::CreateTriggerLut(Int_t runNumber, Int_t* startOfValidity)
840 /// Create trigger LUT from OCDB
842 return dynamic_cast<AliMUONTriggerLut*>(CreateObject(runNumber,"MUON/Calib/TriggerLut",startOfValidity));
845 //_____________________________________________________________________________
847 AliMUONCalibrationData::Gains() const
849 /// Create (if needed) and return the internal store for gains.
850 if (fgBypassGains) return fgBypassGains;
854 fGains = CreateGains(fRunNumber);
859 //_____________________________________________________________________________
861 AliMUONCalibrationData::Gains(Int_t detElemId, Int_t manuId) const
863 /// Return the gains for a given (detElemId, manuId) pair
864 /// Note that, unlike the DeadChannel case, if the result is 0x0, that's an
865 /// error (meaning that we should get gains for all channels).
867 AliMUONVStore* gains = Gains();
873 return static_cast<AliMUONVCalibParam*>(gains->FindObject(detElemId,manuId));
876 //_____________________________________________________________________________
877 AliMUONGlobalCrateConfig*
878 AliMUONCalibrationData::GlobalTriggerCrateConfig() const
880 /// Return the config for the global trigger board.
882 if (!fGlobalTriggerCrateConfig)
884 fGlobalTriggerCrateConfig = CreateGlobalTriggerCrateConfig(fRunNumber);
886 return fGlobalTriggerCrateConfig;
890 //_____________________________________________________________________________
892 AliMUONCalibrationData::HV(Bool_t patched) const
894 /// Return the calibration for a given (detElemId, manuId) pair
898 fHV = CreateHV(fRunNumber,0,patched);
903 //_____________________________________________________________________________
905 AliMUONCalibrationData::TriggerDCS() const
907 /// Return the calibration for a given (detElemId, manuId) pair
911 fTriggerDCS = CreateTriggerDCS(fRunNumber);
916 //_____________________________________________________________________________
918 AliMUONCalibrationData::Neighbours() const
920 /// Create (if needed) and return the internal store for neighbours.
923 fNeighbours = CreateNeighbours(fRunNumber);
928 //_____________________________________________________________________________
930 AliMUONCalibrationData::LocalTriggerBoardMasks(Int_t localBoardNumber) const
932 /// Return the masks for a given trigger local board.
934 if (!fLocalTriggerBoardMasks)
936 fLocalTriggerBoardMasks = CreateLocalTriggerBoardMasks(fRunNumber);
939 if ( fLocalTriggerBoardMasks )
941 AliMUONVCalibParam* ltbm =
942 static_cast<AliMUONVCalibParam*>(fLocalTriggerBoardMasks->FindObject(localBoardNumber));
945 AliError(Form("Could not get mask for localBoardNumber=%d",localBoardNumber));
952 //_____________________________________________________________________________
954 AliMUONCalibrationData::OccupancyMap() const
956 /// Get occupancy map
959 fOccupancyMap = CreateOccupancyMap(fRunNumber);
961 return fOccupancyMap;
964 //_____________________________________________________________________________
966 AliMUONCalibrationData::RejectList() const
971 fRejectList = CreateRejectList(fRunNumber);
976 //_____________________________________________________________________________
978 AliMUONCalibrationData::BypassStores(AliMUONVStore* ped, AliMUONVStore* gain)
980 /// Force the use of those pedestals and gains
981 fgBypassPedestals = ped;
982 fgBypassGains = gain;
986 //_____________________________________________________________________________
988 AliMUONCalibrationData::Pedestals() const
992 if (fgBypassPedestals) return fgBypassPedestals;
996 fPedestals = CreatePedestals(fRunNumber);
1001 //_____________________________________________________________________________
1003 AliMUONCalibrationData::Config() const
1009 fConfig = CreateConfig(fRunNumber);
1014 //_____________________________________________________________________________
1016 AliMUONCalibrationData::Pedestals(Int_t detElemId, Int_t manuId) const
1018 /// Return the pedestals for a given (detElemId, manuId) pair.
1019 /// A return value of 0x0 is considered an error, meaning we should get
1020 /// pedestals for all channels.
1022 AliMUONVStore* pedestals = Pedestals();
1028 return static_cast<AliMUONVCalibParam*>(pedestals->FindObject(detElemId,manuId));
1031 //_____________________________________________________________________________
1033 AliMUONCalibrationData::Print(Option_t*) const
1035 /// A very basic dump of our guts.
1037 cout << "RunNumber " << RunNumber()
1038 << " fGains=" << fGains
1039 << " fPedestals=" << fPedestals
1040 << " fConfig=" << fConfig
1042 << " fTriggerDCS=" << fTriggerDCS
1043 << " fLocalTriggerBoardMasks=" << fLocalTriggerBoardMasks
1044 << " fRegionalTriggerConfig=" << fRegionalTriggerConfig
1045 << " fGlobalTriggerCrateConfig=" << fGlobalTriggerCrateConfig
1046 << " fTriggerLut=" << fTriggerLut
1051 //_____________________________________________________________________________
1052 AliMUONRegionalTriggerConfig*
1053 AliMUONCalibrationData::RegionalTriggerConfig() const
1055 /// Return the config for the regional trigger board.
1057 if (!fRegionalTriggerConfig)
1059 fRegionalTriggerConfig = CreateRegionalTriggerConfig(fRunNumber);
1061 return fRegionalTriggerConfig;
1065 //_____________________________________________________________________________
1066 AliMUONTriggerEfficiencyCells*
1067 AliMUONCalibrationData::TriggerEfficiency() const
1069 /// Return the trigger efficiency.
1071 if (!fTriggerEfficiency)
1073 fTriggerEfficiency = CreateTriggerEfficiency(fRunNumber);
1075 return fTriggerEfficiency;
1079 //_____________________________________________________________________________
1081 AliMUONCalibrationData::TriggerLut() const
1083 /// Return the trigger look up table.
1087 fTriggerLut = CreateTriggerLut(fRunNumber);
1092 //_____________________________________________________________________________
1094 AliMUONCalibrationData::Reset()
1098 AliCodeTimerAuto("",0);
1110 delete fLocalTriggerBoardMasks;
1111 fLocalTriggerBoardMasks = 0x0;
1112 delete fRegionalTriggerConfig;
1113 fRegionalTriggerConfig = 0x0;
1114 delete fGlobalTriggerCrateConfig;
1115 fGlobalTriggerCrateConfig = 0x0;
1119 delete fTriggerEfficiency;
1120 fTriggerEfficiency = 0x0;
1121 delete fCapacitances;
1122 fCapacitances = 0x0;
1127 //_____________________________________________________________________________
1129 AliMUONCalibrationData::Check(Int_t runNumber)
1131 /// Self-check to see if we can read all data for a given run
1132 /// from the current OCDB...
1134 if ( ! CreateCapacitances(runNumber) )
1136 AliErrorClass("Could not read capacitances");
1140 AliInfoClass("Capacitances read OK");
1143 if ( ! CreateGains(runNumber) )
1145 AliErrorClass("Could not read gains");
1149 AliInfoClass("Gains read OK");
1152 if ( ! CreateGlobalTriggerCrateConfig(runNumber) )
1154 AliErrorClass("Could not read Trigger Crate Config");
1158 AliInfoClass("TriggerBoardMasks read OK");
1161 if ( ! CreateHV(runNumber) )
1163 AliErrorClass("Could not read HV");
1167 AliInfoClass("HV read OK");
1170 if ( ! CreateTriggerDCS(runNumber) )
1172 AliErrorClass("Could not read Trigger HV and Currents");
1176 AliInfoClass("Trigger HV and Currents read OK");
1179 if ( ! CreateNeighbours(runNumber) )
1181 AliErrorClass("Could not read Neighbours");
1185 AliInfoClass("Neighbours read OK");
1188 if ( ! CreateLocalTriggerBoardMasks(runNumber) )
1190 AliErrorClass("Could not read LocalTriggerBoardMasks");
1194 AliInfoClass("LocalTriggerBoardMasks read OK");
1197 if ( ! CreatePedestals(runNumber) )
1199 AliErrorClass("Could not read pedestals");
1203 AliInfoClass("Pedestals read OK");
1206 if ( ! CreateConfig(runNumber) )
1208 AliErrorClass("Could not read config");
1212 AliInfoClass("Config read OK");
1215 if ( ! CreateRegionalTriggerConfig(runNumber) )
1217 AliErrorClass("Could not read RegionalTriggerConfig");
1221 AliInfoClass("RegionalTriggerBoardMasks read OK");
1224 if ( ! CreateTriggerLut(runNumber) )
1226 AliErrorClass("Could not read TriggerLut");
1230 AliInfoClass("TriggerLut read OK");
1233 if ( ! CreateTriggerEfficiency(runNumber) )
1235 AliErrorClass("Could not read TriggerEfficiency");
1239 AliInfoClass("TriggerEfficiency read OK");