CMS 3D CMS Logo

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) override
 
 DummyCondDBWriter (const edm::ParameterSet &iConfig)
 
void endRun (const edm::Run &run, const edm::EventSetup &es) override
 
 ~DummyCondDBWriter () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

unsigned long long cacheID
 
edm::ParameterSet iConfig_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

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

Definition at line 19 of file DummyCondDBWriter.h.

Constructor & Destructor Documentation

◆ DummyCondDBWriter()

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

Definition at line 33 of file DummyCondDBWriter.h.

34  : iConfig_(iConfig), cacheID(0) {
35  edm::LogInfo("DummyCondDBWriter") << "DummyCondDBWriter constructor for typename " << typeid(TObject).name()
36  << " and record " << typeid(TRecord).name() << std::endl;
37 }

References Skims_PA_cff::name.

◆ ~DummyCondDBWriter()

template<typename TObject , typename TObjectO , typename TRecord >
DummyCondDBWriter< TObject, TObjectO, TRecord >::~DummyCondDBWriter ( )
override

Definition at line 40 of file DummyCondDBWriter.h.

40  {
41  edm::LogInfo("DummyCondDBWriter") << "DummyCondDBWriter::~DummyCondDBWriter()" << std::endl;
42 }

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 23 of file DummyCondDBWriter.h.

23 {};

◆ endRun()

template<typename TObject , typename TObjectO , typename TRecord >
void DummyCondDBWriter< TObject, TObjectO, TRecord >::endRun ( const edm::Run run,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file DummyCondDBWriter.h.

45  {
46  std::string rcdName = iConfig_.getParameter<std::string>("record");
47  std::string labelName = iConfig_.getUntrackedParameter<std::string>("label", "");
48 
49  if (cacheID == es.get<TRecord>().cacheIdentifier()) {
50  edm::LogInfo("DummyCondDBWriter") << "not needed to store objects with Record " << rcdName << " at run "
51  << run.run() << std::endl;
52  return;
53  }
54  cacheID = es.get<TRecord>().cacheIdentifier();
55 
57  es.get<TRecord>().get(labelName, esobj);
58  TObjectO* obj = new TObjectO(*(esobj.product()));
59  cond::Time_t Time_;
60 
61  //And now write data in DB
63  if (dbservice.isAvailable()) {
64  std::string openIovAt = iConfig_.getUntrackedParameter<std::string>("OpenIovAt", "beginOfTime");
65  if (openIovAt == "beginOfTime")
66  Time_ = dbservice->beginOfTime();
67  else if (openIovAt == "currentTime")
68  Time_ = dbservice->currentTime();
69  else
70  Time_ = iConfig_.getUntrackedParameter<uint32_t>("OpenIovAtTime", 1);
71 
72  dbservice->writeOne(obj, Time_, rcdName);
73  } else {
74  edm::LogError("SiStripFedCablingBuilder") << "Service is unavailable" << std::endl;
75  }
76 }

References cond::service::PoolDBOutputService::beginOfTime(), cond::service::PoolDBOutputService::currentTime(), edm::EventSetup::get(), get, edm::Service< T >::isAvailable(), getGTfromDQMFile::obj, edm::ESHandle< T >::product(), writedatasetfile::run, AlCaHLTBitMon_QueryRunRegistry::string, and cond::service::PoolDBOutputService::writeOne().

Member Data Documentation

◆ cacheID

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

Definition at line 29 of file DummyCondDBWriter.h.

◆ iConfig_

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

Definition at line 28 of file DummyCondDBWriter.h.

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:187
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ESHandle
Definition: DTSurvey.h:22
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogError
Definition: MessageLogger.h:183
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
edm::Service< cond::service::PoolDBOutputService >
DummyCondDBWriter::iConfig_
edm::ParameterSet iConfig_
Definition: DummyCondDBWriter.h:28
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
writedatasetfile.run
run
Definition: writedatasetfile.py:27
DummyCondDBWriter::cacheID
unsigned long long cacheID
Definition: DummyCondDBWriter.h:29
cond::service::PoolDBOutputService::writeOne
Hash writeOne(const T *payload, Time_t time, const std::string &recordName)
Definition: PoolDBOutputService.h:57
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:189