X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=GRP%2FMakeCosmicTriggersEntry.C;h=0d2c26e1dbf5efc7eec3417602732df7e0ab87da;hp=d0981b5a077c714c176124310bae99c255f35f4c;hb=5420ed567f1daa24c5615b6005e3a21b3f62ce44;hpb=cdb216d3b5b0c5ed174153a3a665427022572227 diff --git a/GRP/MakeCosmicTriggersEntry.C b/GRP/MakeCosmicTriggersEntry.C index d0981b5a077..0d2c26e1dbf 100644 --- a/GRP/MakeCosmicTriggersEntry.C +++ b/GRP/MakeCosmicTriggersEntry.C @@ -1,4 +1,20 @@ -Bool_t MakeCosmicTriggersEntry(const char *fileName) +#include "ARVersion.h" +#include +#include +#if !defined(__CINT__) || defined(__MAKECINT__) +#include "AliCDBManager.h" +#include "AliCDBStorage.h" +#include "AliCDBId.h" +#include "AliCDBMetaData.h" +#include +#include +#include +#include +#include +#include +#endif + +Bool_t MakeCosmicTriggersEntry(const char *fileName, const char* cdbUri) { const char* macroname = "MakeCosmicTriggersEntry.C"; @@ -35,24 +51,32 @@ Bool_t MakeCosmicTriggersEntry(const char *fileName) delete file; - // save in CDB storage - TString Storage = gSystem->Getenv("STORAGE"); + // create OCDB storage + TString Storage(cdbUri); if(!Storage.BeginsWith("local://") && !Storage.BeginsWith("alien://")) { Error(macroname,"STORAGE variable set to %s is not valid. Exiting\n",Storage.Data()); - return; + return kFALSE; } - Info(macroname,"Saving alignment objects in CDB storage %s",Storage.Data()); AliCDBManager* cdb = AliCDBManager::Instance(); AliCDBStorage* storage = cdb->GetStorage(Storage.Data()); if(!storage){ Error(macroname,"Unable to open storage %s\n",Storage.Data()); - return; + return kFALSE; } + AliCDBMetaData* md = new AliCDBMetaData(); md->SetResponsible("Federico Antinori"); md->SetComment("List of the defined cosmic triggers. It is used in order to steer the reconstruction, namely in the selection of the proper event specie. It is maintained and updated by the trigger coordinator."); - md->SetAliRootVersion(gSystem->Getenv("ARVERSION")); + // Get root and AliRoot versions and set them in the metadata + const char* rootv = gROOT->GetVersion(); + TString av(ALIROOT_VERSION); + TString revnum(ALIROOT_REVISION); + av+=" - revision: "; + av+=revnum; + md->SetAliRootVersion(av.Data()); + AliCDBId id("GRP/Calib/CosmicTriggers",0,AliCDBRunRange::Infinity()); + Info(macroname,"Saving the list of defined cosmic triggers in the OCDB storage \"%s\"",Storage.Data()); storage->Put(table,id,md); table->Delete();