20 #include "AliCDBMetaData.h"
21 #include "AliCDBEntry.h"
31 #include "TObjString.h"
32 #include <Riostream.h>
34 #include <TObjString.h>
59 "Upload MUON Tracker pedestals to OCDB"),
62 fConfigChanged(kFALSE),
86 AliError(
"Could not get MUON/Calib/Config entry for current run ! That's not OK !");
92 AliError(
"Could not get MUON/Calib/Config object for current run (wrong type ?) ! That's not OK !");
104 while ( ( old = static_cast<AliMUONVCalibParam*>(next()) ) )
106 Int_t detElemId = old->
ID0();
107 Int_t manuId = old->ID1();
109 if ( ! newConfig.
FindObject(detElemId,manuId) )
127 const Int_t kSystem = AliMUONPreprocessor::kDAQ;
128 const char* kId =
"PEDESTALS";
138 Master()->
Log(Form(
"Reading pedestal files for Run %d startTime %u endTime %u",
139 run,startTime,endTime));
147 while ( ( o = static_cast<TObjString*>(next()) ) )
149 TString fileName(
Master()->GetFile(kSystem,kId,o->GetName()));
162 Master()->
Log(
"Failed to read any pedestals");
171 TString nevents(
Master()->GetRunParameter(
"totalEvents"));
173 if ( nevents.Atoi() < 50 )
175 Master()->
Log(Form(
"The run had only %d events, so the failure to read pedestals is normal",nevents.Atoi()));
185 const char* kIdConf =
"CONFIG";
188 TIter nextConf(sources);
192 while ( ( o = static_cast<TObjString*>(nextConf()) ) )
194 TString fileName(
Master()->GetFile(kSystem,kIdConf,o->GetName()));
205 if ( npedFiles != nconfFiles )
207 Master()->
Log(Form(
"ERROR : Number of config files (%d) different from number of pedestal files (%d)",nconfFiles,npedFiles));
253 lines.SetOwner(kTRUE);
255 validator.
Report(lines,*chambers);
260 while ( ( line = static_cast<TObjString*>(next()) ) )
269 Master()->
Log(
"...and configuration, as it has changed");
272 AliCDBMetaData metaData;
273 metaData.SetBeamPeriod(0);
274 metaData.SetResponsible(
"MUON TRK");
275 TString
comment(
"Computed by AliMUONPedestalSubprocessor $Id$");
276 comment.ReplaceAll(
"$",
"");
277 metaData.SetComment(comment.Data());
279 Bool_t validToInfinity = kTRUE;
283 result = result &&
Master()->
Store(
"Calib",
"Config",
fConfig, &metaData, 0, validToInfinity);
285 return ( result != kTRUE );
301 TString sFilename(gSystem->ExpandPathName(filename));
303 Master()->
Log(Form(
"Reading %s",sFilename.Data()));
310 Master()->
Log(Form(
"Could not open %s",sFilename.Data()));
327 TString sFilename(gSystem->ExpandPathName(filename));
329 Master()->
Log(Form(
"Reading %s",sFilename.Data()));
336 Master()->
Log(Form(
"Could not open %s",sFilename.Data()));
virtual TIterator * CreateIterator() const =0
Return an iterator to loop over the whole store.
AliMUONVStore * fConfig
! Configuration (i.e. list of (buspatch,manu)) for the MUON TRK
AliCDBEntry * GetFromOCDB(const char *pathLevel2, const char *pathLevel3)
Publish AliPreprocessor::GetFromOCDB function.
AliMUONPreprocessor * Master() const
Return the pointer to our master.
Bool_t fTooFewEvents
! whether the current run was a failed ped run, basically
virtual void Print(Option_t *wildcard="") const
Print all objects whose name matches wildcard.
Implementation of AliMUONVSubprocessor for MUON TRK pedestals.
Bool_t HasConfigChanged(const AliMUONVStore &newConfig) const
Bool_t fConfigChanged
! flag to trigger the saving of the configuration
Bool_t Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
virtual Int_t GetSize() const =0
The number of objects stored.
Int_t ReadPedestalFile(const char *filename)
Container of calibration values for a given number of channels.
Base class for a shuttle sub-task for MUON (either TRK or TRG)
TTimeStamp startTime(2009, 8, 7, 0, 0, 0)
static Int_t ReadPedestals(const char *filename, AliMUONVStore &pedStore)
virtual Int_t ID0() const
First id of this object.
void Log(const char *message)
Publish AliPreprocessor::Log function.
void Print(Option_t *opt="") const
TObjArray * Validate(const AliMUONVStore &store, Float_t invalidFloatValue, AliMUONVStore *config=0x0)
Basic implementation of AliMUONVStore container using AliMpExMap internally.
virtual ~AliMUONPedestalSubprocessor()
void Report(TList &lines) const
Reports what is missing, trying to be as concise as possible.
Int_t ReadConfigFile(const char *filename)
TList * GetFileSources(Int_t system, const char *id)
Publish AliPreprocessor::GetFileSources function.
Bool_t Store(const char *pathLevel2, const char *pathLevel3, TObject *object, AliCDBMetaData *metaData, Int_t validityStart=0, Bool_t validityInfinite=kFALSE)
Publish AliPreprocessor::Store function.
AliMUONVStore * fPedestals
! Pedestals for the MUON TRK
Shuttle preprocessor for MUON subsystems (TRK and TRG)
UInt_t Process(TMap *dcsAliasMap)
Process this sub-task.
Determine which channels, manus, DEs, stations are missing from a 2DStore.
static Int_t ReadConfig(const char *filename, AliMUONVStore &confStore)
Base class for MUON data stores.
virtual TObject * FindObject(const char *name) const
Find an object by name.