#include <DummyCondDBWriter.h>
Public Member Functions | |
void | analyze (const edm::Event &e, const edm::EventSetup &es) |
DummyCondDBWriter (const edm::ParameterSet &iConfig) | |
void | endRun (const edm::Run &run, const edm::EventSetup &es) |
~DummyCondDBWriter () | |
Private Attributes | |
unsigned long long | cacheID |
edm::ParameterSet | iConfig_ |
Definition at line 21 of file DummyCondDBWriter.h.
DummyCondDBWriter< TObject, TObjectO, TRecord >::DummyCondDBWriter | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 37 of file DummyCondDBWriter.h.
References mergeVDriftHistosByStation::name.
:iConfig_(iConfig),cacheID(0){ edm::LogInfo("DummyCondDBWriter") << "DummyCondDBWriter constructor for typename " << typeid(TObject).name() << " and record " << typeid(TRecord).name() << std::endl; }
DummyCondDBWriter< TObject, TObjectO, TRecord >::~DummyCondDBWriter | ( | ) |
Definition at line 43 of file DummyCondDBWriter.h.
{ edm::LogInfo("DummyCondDBWriter") << "DummyCondDBWriter::~DummyCondDBWriter()" << std::endl; }
void DummyCondDBWriter< TObject, TObjectO, TRecord >::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | es | ||
) | [inline, virtual] |
void DummyCondDBWriter< TObject, TObjectO, TRecord >::endRun | ( | const edm::Run & | run, |
const edm::EventSetup & | es | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 48 of file DummyCondDBWriter.h.
References edm::EventSetup::get(), edm::Service< T >::isAvailable(), VarParsing::obj, edm::ESHandle< T >::product(), and edm::RunBase::run().
{ std::string rcdName=iConfig_.getParameter<std::string>("record"); if( cacheID == es.get<TRecord>().cacheIdentifier()){ edm::LogInfo("DummyCondDBWriter") << "not needed to store objects with Record "<< rcdName << " at run " << run.run() << std::endl; return; } cacheID = es.get<TRecord>().cacheIdentifier(); edm::ESHandle<TObject> esobj; es.get<TRecord>().get( esobj ); TObjectO *obj= new TObjectO(*(esobj.product())); cond::Time_t Time_; //And now write data in DB edm::Service<cond::service::PoolDBOutputService> dbservice; if( dbservice.isAvailable() ){ std::string openIovAt=iConfig_.getUntrackedParameter<std::string>("OpenIovAt","beginOfTime"); if(openIovAt=="beginOfTime") Time_=dbservice->beginOfTime(); else if (openIovAt=="currentTime") Time_=dbservice->currentTime(); else Time_=iConfig_.getUntrackedParameter<uint32_t>("OpenIovAtTime",1); dbservice->writeOne(obj, Time_, rcdName); } else{ edm::LogError("SiStripFedCablingBuilder")<<"Service is unavailable"<<std::endl; } }
unsigned long long DummyCondDBWriter< TObject, TObjectO, TRecord >::cacheID [private] |
Definition at line 33 of file DummyCondDBWriter.h.
edm::ParameterSet DummyCondDBWriter< TObject, TObjectO, TRecord >::iConfig_ [private] |
Definition at line 32 of file DummyCondDBWriter.h.