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::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &es) override
 
void beginRun (const edm::Run &run, 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::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::ParameterSet iConfig_
 
edm::ESGetToken< TObject, TRecord > token_
 
edm::ESWatcher< TRecord > watcher_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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 34 of file DummyCondDBWriter.h.

References edm::ParameterSet::getUntrackedParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

35  : iConfig_(iConfig),
36  token_(esConsumes<edm::Transition::EndRun>(
37  edm::ESInputTag{"", iConfig.getUntrackedParameter<std::string>("label", "")})) {
38  edm::LogInfo("DummyCondDBWriter") << "DummyCondDBWriter constructor for typename " << typeid(TObject).name()
39  << " and record " << typeid(TRecord).name() << std::endl;
40 }
T getUntrackedParameter(std::string const &, T const &) const
Log< level::Info, false > LogInfo
edm::ESGetToken< TObject, TRecord > token_
edm::ParameterSet iConfig_

◆ ~DummyCondDBWriter()

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

Definition at line 43 of file DummyCondDBWriter.h.

43  {
44  edm::LogInfo("DummyCondDBWriter") << "DummyCondDBWriter::~DummyCondDBWriter()" << std::endl;
45 }
Log< level::Info, false > LogInfo

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::one::EDAnalyzerBase.

Definition at line 23 of file DummyCondDBWriter.h.

23 {};

◆ beginRun()

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

Definition at line 24 of file DummyCondDBWriter.h.

24 {};

◆ endRun()

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

Definition at line 48 of file DummyCondDBWriter.h.

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

48  {
49  std::string rcdName = iConfig_.getParameter<std::string>("record");
50 
51  if (!watcher_.check(es)) {
52  edm::LogInfo("DummyCondDBWriter") << "not needed to store objects with Record " << rcdName << " at run "
53  << run.run() << std::endl;
54  return;
55  }
56 
57  auto obj = std::make_unique<TObjectO>(es.getData(token_));
58  cond::Time_t Time_;
59 
60  //And now write data in DB
62  if (dbservice.isAvailable()) {
63  std::string openIovAt = iConfig_.getUntrackedParameter<std::string>("OpenIovAt", "beginOfTime");
64  if (openIovAt == "beginOfTime")
65  Time_ = dbservice->beginOfTime();
66  else if (openIovAt == "currentTime")
67  Time_ = dbservice->currentTime();
68  else
69  Time_ = iConfig_.getUntrackedParameter<uint32_t>("OpenIovAtTime", 1);
70 
71  dbservice->writeOneIOV(*obj, Time_, rcdName);
72  } else {
73  edm::LogError("SiStripFedCablingBuilder") << "Service is unavailable" << std::endl;
74  }
75 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ESWatcher< TRecord > watcher_
Log< level::Error, false > LogError
T getUntrackedParameter(std::string const &, T const &) const
unsigned long long Time_t
Definition: Time.h:14
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
bool getData(T &iHolder) const
Definition: EventSetup.h:122
Log< level::Info, false > LogInfo
edm::ESGetToken< TObject, TRecord > token_
edm::ParameterSet iConfig_
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
bool isAvailable() const
Definition: Service.h:40

Member Data Documentation

◆ iConfig_

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

Definition at line 28 of file DummyCondDBWriter.h.

◆ token_

template<typename TObject , typename TObjectO , typename TRecord >
edm::ESGetToken<TObject, TRecord> DummyCondDBWriter< TObject, TObjectO, TRecord >::token_
private

Definition at line 30 of file DummyCondDBWriter.h.

◆ watcher_

template<typename TObject , typename TObjectO , typename TRecord >
edm::ESWatcher<TRecord> DummyCondDBWriter< TObject, TObjectO, TRecord >::watcher_
private

Definition at line 29 of file DummyCondDBWriter.h.