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 edm::EDConsumerBase

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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

unsigned long long cacheID
 
edm::ParameterSet iConfig_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 mergeVDriftHistosByStation::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(), getGTfromDQMFile::obj, edm::ESHandle< class >::product(), edm::RunBase::run(), AlCaHLTBitMon_QueryRunRegistry::string, and cond::service::PoolDBOutputService::writeOne().

48  {
49 
50  std::string rcdName=iConfig_.getParameter<std::string>("record");
52 
53  if( cacheID == es.get<TRecord>().cacheIdentifier()){
54  edm::LogInfo("DummyCondDBWriter") << "not needed to store objects with Record "<< rcdName << " at run " << run.run() << std::endl; return;
55  }
56  cacheID = es.get<TRecord>().cacheIdentifier();
57 
59  es.get<TRecord>().get( labelName, esobj );
60  TObjectO *obj= new TObjectO(*(esobj.product()));
61  cond::Time_t Time_;
62 
63  //And now write data in DB
65  if( dbservice.isAvailable() ){
66 
67  std::string openIovAt=iConfig_.getUntrackedParameter<std::string>("OpenIovAt","beginOfTime");
68  if(openIovAt=="beginOfTime")
69  Time_=dbservice->beginOfTime();
70  else if (openIovAt=="currentTime")
71  Time_=dbservice->currentTime();
72  else
73  Time_=iConfig_.getUntrackedParameter<uint32_t>("OpenIovAtTime",1);
74 
75  dbservice->writeOne(obj, Time_, rcdName);
76  } else{
77  edm::LogError("SiStripFedCablingBuilder")<<"Service is unavailable"<<std::endl;
78  }
79 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
RunNumber_t run() const
Definition: RunBase.h:42
unsigned long long Time_t
Definition: Time.h:16
bool isAvailable() const
Definition: Service.h:46
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:86

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.