#include "AliCDBMetaData.h"
#include "AliLog.h"
#include "AliMUON2DMap.h"
-#include "AliMUON2DStoreValidator.h"
#include "AliMUONCalibParam2F.h"
#include "AliMUONConstants.h"
#include "AliMUONObjectPair.h"
delete fPedestals;
fPedestals = new AliMUON2DMap(kTRUE);
- AliInfo(Form("Reading pedestal files for Run %d startTime %ld endTime %ld",
- run,startTime,endTime));
+ Master()->Log(Form("Reading pedestal files for Run %d startTime %ld endTime %ld",
+ run,startTime,endTime));
TList* sources = Master()->GetFileSources(kSystem,kId);
TIter next(sources);
TObjString* o(0x0);
+ Int_t n(0);
+
while ( ( o = static_cast<TObjString*>(next()) ) )
{
TString fileName(Master()->GetFile(kSystem,kId,o->GetName()));
- Bool_t ok = ReadFile(fileName.Data());
+ Int_t ok = ReadFile(fileName.Data());
if (!ok)
{
- AliError(Form("Could not read file %s",fileName.Data()));
+ Master()->Log(Form("Could not read file %s",fileName.Data()));
+ }
+ else
+ {
+ n += ok;
}
}
+
+ if (!n)
+ {
+ Master()->Log("Failed to read any pedestals");
+ delete fPedestals;
+ fPedestals = 0;
+ }
delete sources;
}
// Store the pedestals into the CDB
if (!fPedestals) return 0;
-
- AliInfo("Validating pedestals");
- AliMUON2DStoreValidator validator;
- TObjArray* missing =
- validator.Validate(*fPedestals,AliMUONCalibParam2F::InvalidFloatValue());
-
- if (missing)
- {
- validator.Report(*missing);
-// AliError("Will not write into CDB as some pieces are missing...");
-// return 0;
- }
-
- AliInfo("Storing pedestals");
+
+ Master()->Log("Storing pedestals");
AliCDBMetaData metaData;
metaData.SetBeamPeriod(0);
metaData.SetResponsible("MUON TRK");
metaData.SetComment("Computed by AliMUONPedestalSubprocessor $Id$");
- UInt_t result = Master()->Store("Calib", "Pedestals", fPedestals, &metaData, 0, 0);
+ Bool_t validToInfinity = kTRUE;
+ UInt_t result = Master()->Store("Calib", "Pedestals", fPedestals, &metaData, 0, validToInfinity);
return result;
}
//_____________________________________________________________________________
-Bool_t
+Int_t
AliMUONPedestalSubprocessor::ReadFile(const char* filename)
{
// Read the pedestals from an ASCII file.
// Return kFALSE if reading was not successfull.
//
- AliInfo(Form("Reading %s",filename));
+ TString sFilename(gSystem->ExpandPathName(filename));
- std::ifstream in(gSystem->ExpandPathName(filename));
- if (!in.good()) return kFALSE;
+ Master()->Log(Form("Reading %s",sFilename.Data()));
+ std::ifstream in(sFilename.Data());
+ if (!in.good())
+ {
+ return 0;
+ }
char line[80];
Int_t busPatchID, manuID, manuChannel;
Float_t pedMean, pedSigma;
static const Int_t kNchannels(64);
static Bool_t replace(kFALSE);
+ Int_t n(0);
while ( in.getline(line,80) )
{
}
ped->SetValueAsFloat(manuChannel,0,pedMean);
ped->SetValueAsFloat(manuChannel,1,pedSigma);
+ ++n;
}
in.close();
- return kTRUE;
+ return n;
}