3 #include "AliCDBMetaData.h"
9 #include "TObjString.h"
13 #include "AliMergeableCollection.h"
28 const Double_t bytes2MB = 1.0 / 1024.0 / 1024.0;
34 fBPEVO(0x0), fProductionMode(1)
52 const Int_t kSystem = AliMUONPreprocessor::kDAQ;
53 const char* kId =
"BPEVO";
58 Master()->
Log(Form(
"Reading buspatch evolution file for Run %d startTime %u endTime %u",
59 run,startTime,endTime));
66 while ( ( o = static_cast<TObjString*>(next()) ) )
68 TString fileName(
Master()->GetFile(kSystem,kId,o->GetName()));
79 Master()->
Log(
"Failed to read any bus patch evolution");
88 UInt_t hsizeBefore =
fBPEVO->EstimateSize(kFALSE);
94 UInt_t hsizeAfter =
fBPEVO->EstimateSize(kFALSE);
96 Master()->
Log(Form(
"Initial collection size shrinked from %7.3f to %7.3f MB",hsizeBefore*bytes2MB,hsizeAfter*bytes2MB));
98 std::vector<int> timeResolutions;
101 if (!timeResolutions.size())
103 Master()->
Log(
"Input mergeable collection does not seem to have time resolution histograms... Cannot work like that !");
108 for ( std::vector<int>::size_type i = 0; i < timeResolutions.size(); ++i )
110 msg += Form(
"%d s ",timeResolutions[i]);
112 Master()->
Log(Form(
"Time resolutions found : %s",msg.Data()));
119 hsizeAfter =
fBPEVO->EstimateSize(kFALSE);
122 Master()->
Log(Form(
"Final collection size is %7.3f MB",hsizeAfter*bytes2MB));
141 if (
fBPEVO->NumberOfObjects() )
143 Master()->
Log(
"Storing buspatch evolution");
145 AliCDBMetaData metaData;
146 metaData.SetBeamPeriod(0);
147 metaData.SetResponsible(
"MUON TRK");
148 TString
comment(
"Computed by AliMUONBusPatchEvolutionSubprocessor $Id$");
149 comment.ReplaceAll(
"$",
"");
150 metaData.SetComment(comment.Data());
152 Bool_t validToInfinity = kFALSE;
153 Bool_t result =
Master()->
Store(
"Calib",
"BPEVO",
fBPEVO, &metaData, 0, validToInfinity);
155 return ( result != kTRUE );
159 Master()->
Log(
"No buspatch evolution to store");
172 TString sFilename(gSystem->ExpandPathName(filename));
174 Master()->
Log(Form(
"Reading %s",sFilename.Data()));
178 if ( !f || !f->IsOpen() )
180 Master()->
Log(Form(
"Could not open %s",sFilename.Data()));
184 AliMergeableCollection* hc(0x0);
186 hc =
dynamic_cast<AliMergeableCollection*
>(f->Get(
"bpevo"));
190 fBPEVO =
static_cast<AliMergeableCollection*
>(hc->Clone());
void GetTimeResolutions(std::vector< int > &timeResolutions)
TFile * Open(const char *filename, Long64_t &nevents)
AliMUONPreprocessor * Master() const
Return the pointer to our master.
Bool_t ReadFile(const char *filename)
TFile f("CalibObjects.root")
AliMUONBusPatchEvolutionSubprocessor(AliMUONPreprocessor *master)
Base class for a shuttle sub-task for MUON (either TRK or TRG)
TTimeStamp startTime(2009, 8, 7, 0, 0, 0)
void Print(Option_t *opt="") const
int fProductionMode
! Whether or not we are using this one in production mode
virtual ~AliMUONBusPatchEvolutionSubprocessor()
AliMergeableCollection * fBPEVO
! Bus patch evolution
UInt_t Process(TMap *dcsAliasMap)
Process this sub-task.
void Log(const char *message)
Publish AliPreprocessor::Log function.
Bool_t Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
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.
Utility class to massage the output of the MCHBPEVO DA.
Implementation of AliMUONVSubprocessor for MUON TRK bus patch evolution.
Shuttle preprocessor for MUON subsystems (TRK and TRG)