30 #include <Riostream.h> 32 #include <TObjString.h> 34 #include <TClonesArray.h> 53 "Upload MUON Trigger masks and LUT to OCDB"),
59 fRegionalConfigToOCDB(kFALSE),
60 fLocalMasksToOCDB(kFALSE),
61 fGlobalConfigToOCDB(kFALSE),
63 fTrigScalersToOCDB(kFALSE)
88 if ( sources && sources->GetSize() == 1 )
90 return Master()->
GetFile(kSystem,fid,static_cast<TObjString*>(sources->First())->GetName());
108 TString exportedFiles(gSystem->ExpandPathName(
GetFileName(
"EXPORTED").Data()));
110 if ( exportedFiles ==
"" )
112 Master()->
Log(
"exported files not specified !");
116 if ( gSystem->AccessPathName(exportedFiles.Data(),kFileExists) )
118 Master()->
Log(Form(
"%s is not there !",exportedFiles.Data()));
124 Master()->
Log(
"FATAL ERROR : DA does not seem to have been run !!!");
132 Bool_t regionalFile(kFALSE);
133 Bool_t globalFile(kFALSE);
134 Bool_t localFile(kFALSE);
135 Bool_t lutFile(kFALSE);
136 Bool_t trigScalFile(kFALSE);
139 globalFile,regionalFile,localFile,lutFile,trigScalFile);
141 if ((globalFile+regionalFile+localFile+lutFile+trigScalFile) == 0) {
142 Master()->
Log(
"No file(s) to be processed for this run. Exiting.");
152 Master()->
Log(Form(
"Reading trigger masks for Run %d startTime %u endTime %u",
153 run,startTime,endTime));
164 Master()->
Log(
"Could not read some input file(s). Exiting");
169 if ( regionalFile ) globalFile = kTRUE;
178 regionalFile ?
GetFileName(
"REGIONAL").Data() :
"",
184 Master()->
Log(
"ERROR : ReadConfig failed");
197 Master()->
Log(Form(
"Reading trigger LUT for Run %d startTime %u endTime %u",
198 run,startTime,endTime));
210 if ( trigScalFile ) {
211 fTrigScalers =
new TClonesArray(
"AliMUONTriggerScalers",10);
215 Master()->
Log(
"ERROR : ReadTrigScalers failed");
237 Master()->
Log(Form(
"N global = %d N regional = %d N local %d N lut %d",
246 metaData.
SetComment(
"Computed by AliMUONTriggerSubprocessor $Id$");
248 Bool_t validToInfinity = kTRUE;
250 Bool_t result1(kTRUE);
251 Bool_t result2(kTRUE);
252 Bool_t result3(kTRUE);
253 Bool_t result4(kTRUE);
254 Bool_t result5(kTRUE);
259 &metaData, 0, validToInfinity);
265 &metaData, 0, validToInfinity);
271 &metaData, 0, validToInfinity);
277 &metaData, 0, validToInfinity);
283 &metaData, 0, kFALSE);
286 return ( result1 != kTRUE || result2 != kTRUE || result3 != kTRUE || result4 != kTRUE || result5 != kTRUE);
294 if (!shouldBeThere)
return 0;
298 if ( gSystem->AccessPathName(
fileName.Data(),kFileExists) )
311 Bool_t& regionalFile,
314 Bool_t& trigScalFile)
318 ifstream in(gSystem->ExpandPathName(exportedFiles));
321 regionalFile = kFALSE;
324 trigScalFile = kFALSE;
330 while ( in.getline(line,1024,
'\n') )
335 if ( sline.Contains(
"REGIONAL") ) {
336 regionalFile = kTRUE;
337 oa = sline.Tokenize(
" ");
338 if (oa->GetLast() >= 1) {
340 os = (TObjString*)oa->At(1);
347 if ( sline.Contains(
"LUT") ) {
349 oa = sline.Tokenize(
" ");
350 if (oa->GetLast() >= 1) {
352 os = (TObjString*)oa->At(1);
359 if ( sline.Contains(
"LOCAL") && sline.Contains(
"MASK") ) {
361 oa = sline.Tokenize(
" ");
362 if (oa->GetLast() >= 1) {
364 os = (TObjString*)oa->At(1);
371 if ( sline.Contains(
"GLOBAL") ) {
373 oa = sline.Tokenize(
" ");
374 if (oa->GetLast() >= 1) {
376 os = (TObjString*)oa->At(1);
383 if ( sline.Contains(
"TRIGSCAL") ) {
384 trigScalFile = kTRUE;
385 oa = sline.Tokenize(
" ");
386 if (oa->GetLast() >= 1) {
388 os = (TObjString*)oa->At(1);
398 if ( regionalFile || localFile || globalFile || lutFile || trigScalFile)
400 Master()->
Log(Form(
"Will have to read the following file types:"));
Bool_t ReadLUT(const char *lutFileToRead, AliMUONTriggerLut &lut)
AliMUONVStore * fLocalMasks
! local masks
The class defines the configuration of global crate.
TString GetFileName(const char *fid) const
AliMUONPreprocessor * Master() const
Return the pointer to our master.
Int_t GetNofTriggerCrates() const
virtual Int_t GetSize() const =0
The number of objects stored.
Bool_t fRegionalConfigToOCDB
! to store in the OCDB
Bool_t fGlobalConfigToOCDB
! to store in the OCDB
AliMUONRegionalTriggerConfig * fRegionalConfig
! regional config
void WhichFilesToRead(const char *exportedFiles, Bool_t &globalFile, Bool_t ®ionalFile, Bool_t &localFile, Bool_t &lutFile, Bool_t &trigScalFile)
Bool_t fTrigScalersToOCDB
! to store in the OCDB
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
Bool_t ReadTrigScalers(const char *scfile, TClonesArray &scalers) const
Handles read/write of masks and LUT to/from online files.
Base class for a shuttle sub-task for MUON (either TRK or TRG)
TTimeStamp startTime(2009, 8, 7, 0, 0, 0)
AliMUONGlobalCrateConfig * fGlobalConfig
! global config
Implementation of AliMUONVSubprocessor for MUON TRK masks.
const char * GetFile(Int_t system, const char *id, const char *source)
Publish AliPreprocessor::GetFile function.
Bool_t Initialize(Int_t run, UInt_t startTime, UInt_t endTime)
Int_t TestFile(const char *baseName, Bool_t shouldBeThere) const
virtual ~AliMUONTriggerSubprocessor()
void Log(const char *message)
Publish AliPreprocessor::Log function.
static Int_t TotalNofLocalBoards()
Return total number of trigger local boards.
Implementation of AliMUONVStore.
Bool_t fLUTToOCDB
! to store in the OCDB
UInt_t Process(TMap *dcsAliasMap)
Process this sub-task.
TList * GetFileSources(Int_t system, const char *id)
Publish AliPreprocessor::GetFileSources function.
Bool_t fLocalMasksToOCDB
! to store in the OCDB
TClonesArray * fTrigScalers
! trigger scalers
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.
AliMUONTriggerLut * fLUT
! look-up table(s)
Shuttle preprocessor for MUON subsystems (TRK and TRG)
void Invalidate()
Mark as invalid.
MUON trigger look up table class.
Bool_t ReadConfig(const char *localFile, const char *regionalFile, const char *globalFile, AliMUONVStore *localMasks, AliMUONRegionalTriggerConfig *regionalConfig, AliMUONGlobalCrateConfig *globalConfig)
The class defines the properties of regional trigger crate.