CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
DummyCondDBWriter< TObject, TObjectO, TRecord > Class Template Reference

#include <DummyCondDBWriter.h>

Inheritance diagram for DummyCondDBWriter< TObject, TObjectO, TRecord >:
edm::EDAnalyzer

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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

unsigned long long cacheID
 
edm::ParameterSet iConfig_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

template<typename TObject, typename TObjectO, typename TRecord>
class DummyCondDBWriter< TObject, TObjectO, TRecord >

Definition at line 21 of file DummyCondDBWriter.h.

Constructor & Destructor Documentation

template<typename TObject , typename TObjectO , typename TRecord >
DummyCondDBWriter< TObject, TObjectO, TRecord >::DummyCondDBWriter ( const edm::ParameterSet iConfig)
explicit

Definition at line 37 of file DummyCondDBWriter.h.

References AlCaRecoCosmics_cfg::name.

37  :iConfig_(iConfig),cacheID(0){
38  edm::LogInfo("DummyCondDBWriter") << "DummyCondDBWriter constructor for typename " << typeid(TObject).name() << " and record " << typeid(TRecord).name() << std::endl;
39 }
unsigned long long cacheID
edm::ParameterSet iConfig_
template<typename TObject , typename TObjectO , typename TRecord >
DummyCondDBWriter< TObject, TObjectO, TRecord >::~DummyCondDBWriter ( )

Definition at line 43 of file DummyCondDBWriter.h.

43  {
44  edm::LogInfo("DummyCondDBWriter") << "DummyCondDBWriter::~DummyCondDBWriter()" << std::endl;
45 }

Member Function Documentation

template<typename TObject , typename TObjectO , typename TRecord >
void DummyCondDBWriter< TObject, TObjectO, TRecord >::analyze ( const edm::Event e,
const edm::EventSetup es 
)
inlinevirtual

Implements edm::EDAnalyzer.

Definition at line 27 of file DummyCondDBWriter.h.

27 {};
template<typename TObject , typename TObjectO , typename TRecord >
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 cond::service::PoolDBOutputService::beginOfTime(), cond::service::PoolDBOutputService::currentTime(), edm::EventSetup::get(), edm::Service< T >::isAvailable(), VarParsing::obj, edm::ESHandle< class >::product(), edm::RunBase::run(), and cond::service::PoolDBOutputService::writeOne().

48  {
49 
50  std::string rcdName=iConfig_.getParameter<std::string>("record");
51 
52  if( cacheID == es.get<TRecord>().cacheIdentifier()){
53  edm::LogInfo("DummyCondDBWriter") << "not needed to store objects with Record "<< rcdName << " at run " << run.run() << std::endl; return;
54  }
55  cacheID = es.get<TRecord>().cacheIdentifier();
56 
58  es.get<TRecord>().get( esobj );
59  TObjectO *obj= new TObjectO(*(esobj.product()));
60  cond::Time_t Time_;
61 
62  //And now write data in DB
64  if( dbservice.isAvailable() ){
65 
66  std::string openIovAt=iConfig_.getUntrackedParameter<std::string>("OpenIovAt","beginOfTime");
67  if(openIovAt=="beginOfTime")
68  Time_=dbservice->beginOfTime();
69  else if (openIovAt=="currentTime")
70  Time_=dbservice->currentTime();
71  else
72  Time_=iConfig_.getUntrackedParameter<uint32_t>("OpenIovAtTime",1);
73 
74  dbservice->writeOne(obj, 0, Time_, rcdName);
75  } else{
76  edm::LogError("SiStripFedCablingBuilder")<<"Service is unavailable"<<std::endl;
77  }
78 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
RunNumber_t run() const
Definition: RunBase.h:44
tuple obj
Example code starts here #.
Definition: VarParsing.py:655
unsigned long long Time_t
Definition: Time.h:16
bool isAvailable() const
Definition: Service.h:47
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
unsigned long long cacheID
edm::ParameterSet iConfig_
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62

Member Data Documentation

template<typename TObject , typename TObjectO , typename TRecord >
unsigned long long DummyCondDBWriter< TObject, TObjectO, TRecord >::cacheID
private

Definition at line 33 of file DummyCondDBWriter.h.

template<typename TObject , typename TObjectO , typename TRecord >
edm::ParameterSet DummyCondDBWriter< TObject, TObjectO, TRecord >::iConfig_
private

Definition at line 32 of file DummyCondDBWriter.h.