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") && cdbPath.Contains(
"/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)
268 AliErrorClass(Form(
"Could not create data for type=%s",type));
289 while ( ( s = static_cast<TObjString*>(next()) ) )
291 TString name(s->String());
297 if ( hvIndex >= 0 && detElemId < 0 )
305 AliErrorClass(Form(
"Got an invalid DE = %d from alias = %s",
306 detElemId,name.Data()));
311 Int_t indexMin = nPCBs ? 0 : hvIndex;
312 Int_t indexMax = nPCBs ? nPCBs : hvIndex+1;
316 for (
int i = indexMin ; i < indexMax; ++i )
318 Float_t switchValue(1.0);
324 TPair* p =
static_cast<TPair*
>(m.FindObject(switchName.Data()));
332 if (!manus)
continue;
334 TPair* p =
static_cast<TPair*
>(m.FindObject(name.Data()));
342 while ( ( v = static_cast<AliDCSValue*>(n2()) ) )
344 hvValue += v->GetFloat();
348 hvValue *= switchValue;
350 if ( n ) hvValue /= n;
352 if (noff>0 && noff<n)
360 for ( Int_t k = 0 ; k < manus->
GetSize(); ++k )
369 for ( Int_t j = 0 ; j < nofChannels; ++j )
393 while ( ( s = static_cast<TObjString*>(next()) ) )
395 TString name(s->String());
399 if ( name.Contains(
"ann") ) index = 0;
400 if ( name.Contains(
"dig") ) index = 1;
401 if ( name.Contains(
"anp") ) index = 2;
403 Int_t* detElemId(0x0);
404 Int_t numberOfDetectionElements;
411 std::cout <<
"cool " << detElemId[0] << std::endl;
415 Float_t lvValue(0.0);
417 TPair* p =
static_cast<TPair*
>(m.FindObject(name.Data()));
424 while ( ( v = static_cast<AliDCSValue*>(n2()) ) )
426 lvValue += v->GetFloat();
431 if ( n ) lvValue /= n;
433 if (noff>0 && noff<n)
444 for (
int i = 0; i < numberOfDetectionElements; ++i )
451 while (manuIterator.
Next(de,manuId))
453 if ( de != detElemId[i] )
continue;
467 for ( Int_t j = 0 ; j < nofChannels; ++j )
491 Int_t detElemId, manuId;
493 while (it.
Next(detElemId,manuId))
496 for ( Int_t i = 0; i < np->
Size(); ++i )
498 Int_t value = calibrator.
PadStatus(detElemId,manuId,i);
518 Int_t detElemId, manuId;
520 while (it.
Next(detElemId,manuId))
523 for ( Int_t i = 0; i < np->
Size(); ++i )
525 Int_t value = calibrator.
StatusMap(detElemId,manuId,i);
541 Int_t& startOfValidity)
549 Bool_t ocdb = (runNumber>=0);
574 if (store) store =
static_cast<AliMUONVStore*
>(store->Clone());
637 while ( ( p = static_cast<AliMUONVCalibParam*>(next()) ) )
643 for ( Int_t i = 0; i < c->
Size(); ++i )
661 AliError(
"Not implemented. Does it have sense ?");
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 * 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.
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 AliMUONVStore * CreateLVStore(TMap &m)
Producer of some AliMUONVTrackerData.
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 Float_t TrackerLVOFF()
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)
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.
Bool_t DecodeDCSMCHLVAlias(const char *dcsAlias, Int_t *&detElemId, Int_t &numberOfDetectionElements, AliMp::PlaneType &planeType) const
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.
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 AliMUONVTrackerData * CreateData(const char *type, AliMUONVStore &source, Int_t startOfValidity)
static Int_t DecodePedestals(const char *data, AliMUONVStore &pedStore)
static TMap * CreateLV(Int_t runNumber, Int_t *startOfValidity=0)
Create a MCH LV map (which must be deleted) from OCDB for the given run.
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)
static Bool_t IsLV(const char *type)
Whether type is of LV flavour.
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 const char * ShortNameForLV()
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)
static Int_t ManuMask(AliMp::PlaneType planeType)
virtual void SetValueAsDouble(Int_t i, Int_t j, Double_t value)
Producer of AliMUONVTrackerData from OCDB or ASCII condition files.