CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HcalParametersDBBuilder Class Reference
Inheritance diagram for HcalParametersDBBuilder:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &) override
 
void beginRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
void endRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
 HcalParametersDBBuilder (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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 &&)=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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

bool fromDD4Hep_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

Definition at line 17 of file HcalParametersDBBuilder.cc.

Constructor & Destructor Documentation

◆ HcalParametersDBBuilder()

HcalParametersDBBuilder::HcalParametersDBBuilder ( const edm::ParameterSet ps)

Definition at line 31 of file HcalParametersDBBuilder.cc.

32  : fromDD4Hep_(ps.getParameter<bool>("fromDD4Hep")) {
33 #ifdef EDM_ML_DEBUG
34  edm::LogVerbatim("HCalGeom") << "HcalParametersDBBuilder::HcalParametersDBBuilder called with dd4hep: "
35  << fromDD4Hep_;
36 #endif
37 }

References fromDD4Hep_.

Member Function Documentation

◆ analyze()

void HcalParametersDBBuilder::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &   
)
inlineoverridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 24 of file HcalParametersDBBuilder.cc.

24 {}

◆ beginRun()

void HcalParametersDBBuilder::beginRun ( edm::Run const &  iEvent,
edm::EventSetup const &  es 
)
override

Definition at line 45 of file HcalParametersDBBuilder.cc.

45  {
46  HcalParameters* php = new HcalParameters;
48  if (!mydbservice.isAvailable()) {
49  edm::LogError("HcalParametersDBBuilder") << "PoolDBOutputService unavailable";
50  return;
51  }
52 
53  HcalParametersFromDD builder;
54 
55  if (fromDD4Hep_) {
56 #ifdef EDM_ML_DEBUG
57  edm::LogVerbatim("HCalGeom") << "HcalParametersDBBuilder::Try to access cms::DDCompactView";
58 #endif
60  es.get<IdealGeometryRecord>().get(cpv);
61  builder.build((*cpv), *php);
62  } else {
63 #ifdef EDM_ML_DEBUG
64  edm::LogVerbatim("HCalGeom") << "HcalParametersDBBuilder::Try to access DDCompactView";
65 #endif
67  es.get<IdealGeometryRecord>().get(cpv);
68  builder.build(&(*cpv), *php);
69  }
70 
71  if (mydbservice->isNewTagRequest("HcalParametersRcd")) {
72  mydbservice->createNewIOV<HcalParameters>(
73  php, mydbservice->beginOfTime(), mydbservice->endOfTime(), "HcalParametersRcd");
74  } else {
75  edm::LogError("HcalParametersDBBuilder") << "HcalParameters and HcalParametersRcd Tag already present";
76  }
77 }

References cond::service::PoolDBOutputService::beginOfTime(), HcalParametersFromDD::build(), cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::endOfTime(), fromDD4Hep_, edm::EventSetup::get(), get, edm::Service< T >::isAvailable(), and cond::service::PoolDBOutputService::isNewTagRequest().

◆ endRun()

void HcalParametersDBBuilder::endRun ( edm::Run const &  iEvent,
edm::EventSetup const &   
)
inlineoverride

Definition at line 25 of file HcalParametersDBBuilder.cc.

25 {}

◆ fillDescriptions()

void HcalParametersDBBuilder::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 39 of file HcalParametersDBBuilder.cc.

39  {
41  desc.add<bool>("fromDD4Hep", false);
42  descriptions.add("HcalParametersWriter", desc);
43 }

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

Member Data Documentation

◆ fromDD4Hep_

bool HcalParametersDBBuilder::fromDD4Hep_
private

Definition at line 28 of file HcalParametersDBBuilder.cc.

Referenced by beginRun(), and HcalParametersDBBuilder().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:177
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
HcalParametersFromDD
Definition: HcalParametersFromDD.h:9
HcalParametersFromDD::build
bool build(const DDCompactView *, HcalParameters &)
Definition: HcalParametersFromDD.cc:57
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:107
HcalParametersDBBuilder::fromDD4Hep_
bool fromDD4Hep_
Definition: HcalParametersDBBuilder.cc:28
edm::LogError
Definition: MessageLogger.h:183
edm::Service< cond::service::PoolDBOutputService >
edm::LogVerbatim
Definition: MessageLogger.h:297
get
#define get
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:175
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HcalParameters
Definition: HcalParameters.h:6
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:90
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27