CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
WriteEcalMiscalibConstantsMC Class Reference

#include <CalibCalorimetry/WriteEcalMiscalibConstantsMC/src/WriteEcalMiscalibConstantsMC.cc>

Inheritance diagram for WriteEcalMiscalibConstantsMC:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 WriteEcalMiscalibConstantsMC (const edm::ParameterSet &)
 
 ~WriteEcalMiscalibConstantsMC () 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
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

std::string newTagRequest_
 

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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
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 = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 24 of file WriteEcalMiscalibConstantsMC.h.

Constructor & Destructor Documentation

◆ WriteEcalMiscalibConstantsMC()

WriteEcalMiscalibConstantsMC::WriteEcalMiscalibConstantsMC ( const edm::ParameterSet iConfig)
explicit

Definition at line 46 of file WriteEcalMiscalibConstantsMC.cc.

46  {
47  //now do what ever initialization is needed
48  newTagRequest_ = iConfig.getParameter<std::string>("NewTagRequest");
49 }

References edm::ParameterSet::getParameter(), newTagRequest_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~WriteEcalMiscalibConstantsMC()

WriteEcalMiscalibConstantsMC::~WriteEcalMiscalibConstantsMC ( )
override

Definition at line 51 of file WriteEcalMiscalibConstantsMC.cc.

51  {
52  // do anything here that needs to be done at desctruction time
53  // (e.g. close files, deallocate resources etc.)
54 }

Member Function Documentation

◆ analyze()

void WriteEcalMiscalibConstantsMC::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 61 of file WriteEcalMiscalibConstantsMC.cc.

61  {
62  using namespace edm;
63  // Intercalib constants
65  iSetup.get<EcalIntercalibConstantsMCRcd>().get(pIcal);
66  const EcalIntercalibConstantsMC* Mcal = pIcal.product();
67 
69  if (poolDbService.isAvailable()) {
70  if (poolDbService->isNewTagRequest(newTagRequest_)) {
71  std::cout << " Creating a new one " << std::endl;
72  poolDbService->createNewIOV<const EcalIntercalibConstantsMC>(
73  Mcal, poolDbService->beginOfTime(), poolDbService->endOfTime(), newTagRequest_);
74  std::cout << "Done" << std::endl;
75  } else {
76  std::cout << "Old One " << std::endl;
77  poolDbService->appendSinceTime<const EcalIntercalibConstantsMC>(
78  Mcal, poolDbService->currentTime(), newTagRequest_);
79  }
80  }
81 }

References cond::service::PoolDBOutputService::appendSinceTime(), cond::service::PoolDBOutputService::beginOfTime(), gather_cfg::cout, cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::currentTime(), cond::service::PoolDBOutputService::endOfTime(), edm::EventSetup::get(), get, edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), newTagRequest_, and edm::ESHandle< T >::product().

◆ beginJob()

void WriteEcalMiscalibConstantsMC::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 84 of file WriteEcalMiscalibConstantsMC.cc.

84 {}

◆ endJob()

void WriteEcalMiscalibConstantsMC::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 89 of file WriteEcalMiscalibConstantsMC.cc.

89  {
90  std::cout << "Here is the end" << std::endl;
91 }

References gather_cfg::cout.

Referenced by o2olib.O2ORunMgr::executeJob().

Member Data Documentation

◆ newTagRequest_

std::string WriteEcalMiscalibConstantsMC::newTagRequest_
private

Definition at line 35 of file WriteEcalMiscalibConstantsMC.h.

Referenced by analyze(), and WriteEcalMiscalibConstantsMC().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:215
edm
HLT enums.
Definition: AlignableModifier.h:19
gather_cfg.cout
cout
Definition: gather_cfg.py:144
cond::service::PoolDBOutputService::appendSinceTime
void appendSinceTime(const T *payloadObj, cond::Time_t sinceTime, const std::string &recordName)
Definition: PoolDBOutputService.h:141
EcalCondObjectContainer
Definition: EcalCondObjectContainer.h:13
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:116
edm::ESHandle
Definition: DTSurvey.h:22
EcalIntercalibConstantsMCRcd
Definition: EcalIntercalibConstantsMCRcd.h:5
edm::Service< cond::service::PoolDBOutputService >
get
#define get
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:213
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:128
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
WriteEcalMiscalibConstantsMC::newTagRequest_
std::string newTagRequest_
Definition: WriteEcalMiscalibConstantsMC.h:35
cond::service::PoolDBOutputService::currentTime
cond::Time_t currentTime() const
Definition: PoolDBOutputService.cc:217