/*
$Log$
+Revision 1.7 2006/07/10 14:37:09 jgrosseo
+small fix + todo comment
+
Revision 1.6 2006/07/10 13:01:41 jgrosseo
enhanced storing of last sucessfully processed run (alberto)
//______________________________________________________________________________________________
UInt_t AliShuttle::Store(const char* detector,
- TObject* object, AliCDBMetaData* metaData)
+ TObject* object, AliCDBMetaData* metaData, Int_t /*validityStart*/, Bool_t /*validityInfinite*/)
{
// store data into CDB
+ //
+ // validityStart is the start validity of the data, if not 0 GetCurrentRun() - validityStart is taken
+ // validityInfinite defines if the data is valid until new data arrives (e.g. for calibration runs)
+ //
// returns 0 if fail
// 1 if stored in main (Grid) storage
// 2 if stored in backup (Local) storage
+ // TODO implement use of two parameters
+ // TODO shouldn't the path be given by the preprocessor???
AliCDBId id(AliCDBPath(detector, "DCS", "Data"),
GetCurrentRun(), GetCurrentRun());
UInt_t GetCurrentStartTime() const {return fCurrentStartTime;};
UInt_t GetCurrentEndTime() const {return fCurrentEndTime;};
- virtual UInt_t Store(const char* detector, TObject* object, AliCDBMetaData* metaData);
+ virtual UInt_t Store(const char* detector, TObject* object, AliCDBMetaData* metaData, Int_t validityStart = 0, Bool_t validityInfinite = kFALSE);
virtual const char* GetFile(Int_t system, const char* detector,
const char* id, const char* source);
virtual TList* GetFileSources(Int_t system, const char* detector, const char* id);
/*
$Log$
+Revision 1.2 2006/06/06 14:20:05 jgrosseo
+o) updated test preprocessor (alberto)
+o) added comments to example macro
+o) test shuttle implements new interface
+
Revision 1.2 2006/03/07 07:52:34 hristov
New version (B.Yordanov)
ClassImp(AliTestShuttle)
//______________________________________________________________________________________________
-AliTestShuttle::AliTestShuttle() :
+AliTestShuttle::AliTestShuttle(Int_t run, UInt_t startTime, UInt_t endTime) :
+ fRun(run),
+ fStartTime(startTime),
+ fEndTime(endTime),
fInputFiles(0),
fPreprocessors(0),
fDcsAliasMap(0)
}
//______________________________________________________________________________________________
-UInt_t AliTestShuttle::Store(const char* detector, TObject* object, AliCDBMetaData* metaData)
+UInt_t AliTestShuttle::Store(const char* detector, TObject* object, AliCDBMetaData* metaData, Int_t validityStart, Bool_t validityInfinite)
{
// Stores the CDB object
// This function should be called at the end of the preprocessor cycle
// This implementation just stores it on the local disk, the full AliShuttle
// puts it to the Grid FileCatalog
- AliCDBId id(Form("%s/SHUTTLE/Data", detector), 0, 0);
+
+ Int_t startRun = fRun;
+ Int_t endRun = fRun;
+
+ if (validityStart > 0)
+ startRun -= validityStart;
+
+ // TODO put define for infinite
+ if (validityInfinite != kFALSE)
+ endRun = 999999999;
+
+ AliCDBId id(Form("%s/SHUTTLE/Data", detector), startRun, endRun);
return AliCDBManager::Instance()->Put(object, id, metaData);
}
AliPreprocessor* preprocessor = dynamic_cast<AliPreprocessor*> (fPreprocessors->At(i));
if (preprocessor)
{
- preprocessor->Initialize(0, 1, 0);
+ preprocessor->Initialize(fRun, fStartTime, fEndTime);
preprocessor->Process(fDcsAliasMap);
}
}
class AliTestShuttle : public AliShuttleInterface
{
public:
- AliTestShuttle();
+ AliTestShuttle(Int_t run, UInt_t startTime, UInt_t endTime);
virtual ~AliTestShuttle();
void AddInputFile(Int_t system, const char* detector, const char* id, const char* source, const char* fileName);
void Process();
// AliShuttleInterface functions
- virtual UInt_t Store(const char* detector, TObject* object, AliCDBMetaData* metaData);
+ virtual UInt_t Store(const char* detector, TObject* object, AliCDBMetaData* metaData, Int_t validityStart = 0, Bool_t validityInfinite = kFALSE);
virtual const char* GetFile(Int_t system, const char* detector, const char* id, const char* source);
virtual TList* GetFileSources(Int_t system, const char* detector, const char* id);
virtual void Log(const char* detector, const char* message);
virtual void RegisterPreprocessor(AliPreprocessor* preprocessor);
protected:
+ Int_t fRun; // run that is simulated with the AliTestShuttle
+ UInt_t fStartTime; // starttime that is simulated with the AliTestShuttle
+ UInt_t fEndTime; // endtime that is simulated with the AliTestShuttle
+
TMap* fInputFiles; // files for GetFile, GetFileSources
TObjArray* fPreprocessors; // list of preprocessors that are to be tested
TMap* fDcsAliasMap; // DCS data for testing
AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/SHUTTLE/TestShuttle/TestCDB");
// create AliTestShuttle instance
- AliTestShuttle* shuttle = new AliTestShuttle();
+ // The parameters are run, startTime, endTime
+ AliTestShuttle* shuttle = new AliTestShuttle(7, 0, 1);
// TODO(1)
//
/*
$Log$
+Revision 1.2 2006/06/06 16:36:49 jgrosseo
+minor changes in AliShuttleInterface and AliPreprocessor
+
Revision 1.1 2006/06/02 14:14:36 hristov
Separate library for CDB (Jan)
fEndTime = endTime;
}
-UInt_t AliPreprocessor::Store(TObject* object, AliCDBMetaData* metaData)
+UInt_t AliPreprocessor::Store(TObject* object, AliCDBMetaData* metaData, Int_t validityStart, Bool_t validityInfinite)
{
// Stores the CDB object
// This function should be called at the end of the preprocessor cycle
//
+ // The parameters are
+ // 1) the object to be stored
+ // 2) the metaData to be associated with the object
+ // 3) the validity start run number w.r.t. the current run, if the data is valid only for this run leave the default 0
+ // 4) specifies if the calibration data is valid for infinity (this means until updated), typical for calibration runs, the default is kFALSE
+ //
// The call is delegated to AliShuttleInterface
- return fShuttle->Store(GetName(), object, metaData);
+ return fShuttle->Store(GetName(), object, metaData, validityStart, validityInfinite);
}
const char* AliPreprocessor::GetFile(Int_t system, const char* id, const char* source)
virtual UInt_t Process(TMap* dcsAliasMap) = 0;
protected:
- UInt_t Store(TObject* object, AliCDBMetaData* metaData);
+ UInt_t Store(TObject* object, AliCDBMetaData* metaData, Int_t validityStart = 0, Bool_t validityInfinite = kFALSE);
const char* GetFile(Int_t system, const char* id, const char* source);
TList* GetFileSources(Int_t system, const char* id);
void Log(const char* message);
enum { kDAQ = 0, kDCS, kHLT };
static const char* fkSystemNames[3]; // names of the systems providing data to the shuttle
- virtual UInt_t Store(const char* detector, TObject* object, AliCDBMetaData* metaData) = 0;
+ virtual UInt_t Store(const char* detector, TObject* object, AliCDBMetaData* metaData, Int_t validityStart = 0, Bool_t validityInfinite = kFALSE) = 0;
virtual const char* GetFile(Int_t system, const char* detector, const char* id, const char* source) = 0;
virtual TList* GetFileSources(Int_t system, const char* detector, const char* id) = 0;
virtual void Log(const char* detector, const char* message) = 0;