30 #include "AliCDBManager.h"
31 #include "AliCDBStorage.h"
32 #include "AliDCSValue.h"
53 #include "Riostream.h"
56 #include "TObjString.h"
75 fSource(Form(
"%s-%010d-%s",ocdbPath,runNumber,type)),
80 AliCDBStorage* storage = AliCDBManager::Instance()->GetDefaultStorage();
82 AliCDBManager::Instance()->SetDefaultStorage(ocdbPath);
84 Int_t startOfValidity;
101 AliDebug(1,Form(
"runNumber=%d ocdbPath=%s type=%s startOfValidity=%d store=%p",
102 runNumber,ocdbPath,type,startOfValidity,store));
108 AliDebug(1,Form(
"runNumber=%d ocdbPath=%s type=%s startOfValidity=%d store=%p",
109 runNumber,ocdbPath,type,startOfValidity,store));
116 TString shortName(
fData->GetName());
117 TString cdbPath(ocdbPath);
121 shortName += Form(
"%d",startOfValidity);
125 if ( cdbPath.Contains(
"cvmfs/alice") )
127 shortName +=
"cvmfs";
129 else if ( cdbPath.BeginsWith(
"alien://folder=/alice/data") )
131 shortName +=
"alien";
133 else if ( cdbPath.BeginsWith(
"alien") && cdbPath.Contains(
"user") )
135 shortName.ReplaceAll(
"/alice.cern.ch/user/",
"...");
139 shortName += cdbPath;
145 fData->SetName(shortName);
148 AliCDBManager::Instance()->SetDefaultStorage(storage);
155 fSource(Form(
"%s-%s",filename,type)),
156 fIsOwnerOfData(kTRUE)
160 TString sFilename(gSystem->ExpandPathName(filename));
162 std::ifstream in(sFilename.Data());
165 std::ostringstream stream;
167 while ( in.getline(line,1024) )
169 stream << line <<
"\n";
190 fSource(Form(
"direct-%s",type)),
191 fIsOwnerOfData(kTRUE)
278 AliErrorClass(Form(
"Could not create data for type=%s",type));
299 while ( ( s = static_cast<TObjString*>(next()) ) )
301 TString name(s->String());
307 if ( hvIndex >= 0 && detElemId < 0 )
315 AliErrorClass(Form(
"Got an invalid DE = %d from alias = %s",
316 detElemId,name.Data()));
321 Int_t indexMin = nPCBs ? 0 : hvIndex;
322 Int_t indexMax = nPCBs ? nPCBs : hvIndex+1;
326 for (
int i = indexMin ; i < indexMax; ++i )
328 Float_t switchValue(1.0);
334 TPair* p =
static_cast<TPair*
>(m.FindObject(switchName.Data()));
342 if (!manus)
continue;
344 TPair* p =
static_cast<TPair*
>(m.FindObject(name.Data()));
352 while ( ( v = static_cast<AliDCSValue*>(n2()) ) )
354 hvValue += v->GetFloat();
358 hvValue *= switchValue;
360 if ( n ) hvValue /= n;
362 if (noff>0 && noff<n)
370 for ( Int_t k = 0 ; k < manus->
GetSize(); ++k )
379 for ( Int_t j = 0 ; j < nofChannels; ++j )
402 Int_t detElemId, manuId;
404 while (it.
Next(detElemId,manuId))
407 for ( Int_t i = 0; i < np->
Size(); ++i )
409 Int_t value = calibrator.
PadStatus(detElemId,manuId,i);
429 Int_t detElemId, manuId;
431 while (it.
Next(detElemId,manuId))
434 for ( Int_t i = 0; i < np->
Size(); ++i )
436 Int_t value = calibrator.
StatusMap(detElemId,manuId,i);
452 Int_t& startOfValidity)
460 Bool_t ocdb = (runNumber>=0);
513 if (store) store =
static_cast<AliMUONVStore*
>(store->Clone());
570 while ( ( p = static_cast<AliMUONVCalibParam*>(next()) ) )
576 for ( Int_t i = 0; i < c->
Size(); ++i )
594 AliError(
"Not implemented. Does it have sense ?");
612 while ( ( param = static_cast<AliMUONVCalibParam*>(next()) ) )
618 for ( Int_t i = 0; i < param->Size(); ++i )
622 Int_t q1 = (qual & 0xF0) >> 4;
623 Int_t q2 = qual & 0xF;
626 if ( param->ValueAsFloat(i,0) > 1E-9 ) gain = 1.0/param->ValueAsFloat(i,0)/0.2;
virtual TIterator * CreateIterator() const =0
Return an iterator to loop over the whole store.
virtual void DisableChannelLevel()=0
Disable recording of information at the channel level.
Implementation of AliMUONVTrackerData.
static Bool_t IsOccupancy(const char *type)
Whether type is of Occupancy flavour.
static AliMUONVStore * PatchGainStore(const AliMUONVStore &gains)
static AliMUONVStore * CreateOccupancyMap(Int_t runNumber, Int_t *startOfValidity=0)
Create an occupancy map store (which must be deleted) from OCDB for the given run.
static AliMUONVStore * ExpandConfig(const AliMUONVStore &config)
static const char * ShortNameForStatusMap()
static Float_t SwitchValue(const TObjArray &dcsArray)
Implementation of AliMUONVCalibParam for tuples of floats.
static const char * ShortNameForCapacitances()
virtual Int_t Size() const =0
The number of channels handled by this object.
static Float_t TrackerHVOFF()
virtual void SetValueAsFloat(Int_t i, Int_t j, Float_t value)=0
Set one value, for channel i, dimension j. Consider value is a float.
static Bool_t IsPedestals(const char *type)
Whether type is of Pedestals flavour.
static const char * ShortNameForGains()
static Int_t DecodeGains(const char *data, AliMUONVStore &gainStore, TString &comment)
Producer of some AliMUONVTrackerData.
static AliMUONVStore * CreateCapacitances(Int_t runNumber, Int_t *startOfValidity=0)
Create a capa store (which must be deleted) from OCDB for the given run.
Collection of methods usefull to DCS handling for MUON TRK and TRG.
Int_t StatusMap(Int_t detElemId, Int_t manuId, Int_t manuChannel) const
static Int_t DecodeConfig(const char *data, AliMUONVStore &confStore)
Int_t NumberOfPCBs(Int_t detElemId) const
static AliMUONVStore * CreateConfig(Int_t runNumber, Int_t *startOfValidity=0)
Create a configuration store (which must be deleted) from OCDB for the given run. ...
virtual void SetValueAsInt(Int_t i, Int_t j, Int_t value)=0
Set one value, for channel i, dimension j. Consider value is an integer.
AliMpDetElement * GetDetElement(Int_t detElemId, Bool_t warn=true) const
The class defines the electronics properties of detection element.
static Int_t DecodeCapacitances(const char *data, AliMUONVStore &capaStore)
Bool_t Next(Int_t &detElemId, Int_t &manuId)
Class to loop over all manus of MUON Tracker.
static const char * ShortNameForConfig()
static AliMUONVStore * CreateStatusMapStore(Int_t runNumber)
static AliMUONVStore * CreateGains(Int_t runNumber, Int_t *startOfValidity=0)
Create a gain store (which must be deleted) from OCDB for the given run.
AliMUONVTrackerData * fData
our data
static Bool_t IsConfig(const char *type)
Whether type is of Configuration flavour.
Container of calibration values for a given number of channels.
static AliMpDDLStore * Instance(Bool_t warn=true)
static Int_t ManuNofChannels()
Max number of channels per manu.
virtual AliMUONVStore * Create() const =0
Create an empty copy of this.
Implementation of AliMUONVCalibParam for tuples of ints.
static AliMUONVStore * CreateHVStore(TMap &m)
static Bool_t IsStatusMap(const char *type)
Whether type is of StatusMap flavour.
Class to calibrate the digits.
virtual Long64_t Merge(TCollection *li)
Merge.
Implementation of AliMUONVCalibParam for tuples of double.
virtual void SetDimensionName(Int_t index, const char *value)=0
Set the name of a given dimension.
Int_t DCSIndexFromDCSAlias(const char *dcsAlias) const
Helper class for sorted integer array.
static Int_t SelfDeadMask()
Return status bit map to tell a pad is bad.
static Bool_t IsCapacitances(const char *type)
Whether type is of Capacitance flavour.
virtual ~AliMUONTrackerConditionDataMaker()
Int_t PadStatus(Int_t detElemId, Int_t manuId, Int_t manuChannel) const
Basic implementation of AliMUONVStore container using AliMpExMap internally.
virtual Bool_t Add(TObject *object)=0
Add an object to the store.
static Bool_t IsGains(const char *type)
Whether type is of Gains flavour.
static AliMUONVTrackerData * CreateData(const char *type, AliMUONVStore &source, Int_t startOfValidity)
static Int_t DecodePedestals(const char *data, AliMUONVStore &pedStore)
static const char * ShortNameForOccupancy()
static const char * ShortNameForHV()
virtual Bool_t Add(const AliMUONVStore &store, TArrayI *arrayOfNofEventsPerDDL=0x0)=0
Add values for one event from one full store.
static Bool_t IsRejectList(const char *type)
Whether type is of RejectList flavour.
static Bool_t IsStatus(const char *type)
Whether type is of Status flavour.
static const char * ShortNameForPedestals()
Object to hold the list of elements we want to reject from the reconstruction.
static Int_t DecodeOccupancy(const char *data, AliMUONVStore &occupancyMap)
TString DCSSwitchAliasName(Int_t detElemId, Int_t pcbNumber) const
Bool_t fIsOwnerOfData
is fData ours or not
static TMap * CreateHV(Int_t runNumber, Int_t *startOfValidity=0, Bool_t patched=kTRUE, TList *messages=0x0, Bool_t dryRun=kFALSE)
Create a hv map (which must be deleted) from OCDB for the given run.
const AliMpArrayI * ManusForHV(Int_t hvIndex) const
Int_t GetValue(Int_t index) const
static AliMUONVStore * CreateStatusStore(Int_t runNumber)
virtual Int_t ValueAsInt(Int_t i, Int_t j=0) const
Int_t DetElemIdFromDCSAlias(const char *dcsAlias) const
Base class for MUON data stores.
static const char * ShortNameForStatus()
Bool_t IsExistingChannel(Int_t manuId, Int_t manuChannel) const
AliMUONTrackerConditionDataMaker()
Base class for MUON data that can be presented at different levels in the hierarchy of the MUON syste...
static Bool_t IsValidDetElemId(Int_t detElemId, Bool_t warn=false)
static Bool_t IsHV(const char *type)
Whether type is of HV flavour.
static AliMUONRejectList * CreateRejectList(Int_t runNumber, Int_t *startOfValidity=0)
Create a rejectlist store (which must be deleted) from OCDB for the given run.
static AliMUONVStore * CreatePedestals(Int_t runNumber, Int_t *startOfValidity=0)
Create a pedestal store (which must be deleted) from OCDB for the given run.
virtual TObject * FindObject(const char *name) const
Find an object by name.
static AliMUONVStore * CreateStore(Int_t runNumber, const char *source, const char *type, Int_t &startOfValidity)
virtual void SetValueAsDouble(Int_t i, Int_t j, Double_t value)
Producer of AliMUONVTrackerData from OCDB or ASCII condition files.