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 | Private Member Functions | Private Attributes
ConditionDumperInEdm Class Reference

#include <FWCore/ConditionDumperInEdm/src/ConditionDumperInEdm.cc>

Inheritance diagram for ConditionDumperInEdm:
edm::one::EDProducer< edm::RunCache< edm::ConditionsInRunBlock >, edm::LuminosityBlockCache< edm::ConditionsInLumiBlock >, edm::EndRunProducer, edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ConditionDumperInEdm (const edm::ParameterSet &)
 
 ~ConditionDumperInEdm () override
 
- Public Member Functions inherited from edm::one::EDProducer< edm::RunCache< edm::ConditionsInRunBlock >, edm::LuminosityBlockCache< edm::ConditionsInLumiBlock >, edm::EndRunProducer, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &, const edm::EventSetup &) final
 
std::shared_ptr< edm::ConditionsInLumiBlockglobalBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const final
 
std::shared_ptr< edm::ConditionsInRunBlockglobalBeginRun (edm::Run const &, const edm::EventSetup &) const final
 
void globalEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void globalEndRun (edm::Run const &, const edm::EventSetup &) final
 
void produce (edm::Event &, const edm::EventSetup &) final
 

Private Attributes

edm::ConditionsInEventBlock eventBlock_
 
const edm::EDPutTokenT< edm::ConditionsInEventBlockeventToken_
 
const edm::InputTag gtEvmDigisLabel_
 
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecordgtEvmDigisLabelToken_
 
const edm::EDPutTokenT< edm::ConditionsInLumiBlocklumiToken_
 
const edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 
const edm::EDPutTokenT< edm::ConditionsInRunBlockrunToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- 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 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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 49 of file ConditionDumperInEdm.h.

Constructor & Destructor Documentation

◆ ConditionDumperInEdm()

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

Definition at line 12 of file ConditionDumperInEdm.cc.

References edm::ParameterSet::getParameter().

13  : gtEvmDigisLabel_{iConfig.getParameter<edm::InputTag>("gtEvmDigisLabel")},
14  gtEvmDigisLabelToken_{consumes<L1GlobalTriggerEvmReadoutRecord>(gtEvmDigisLabel_)},
15  runInfoToken_{esConsumes<edm::Transition::EndRun>()},
16  //per LUMI products
17  lumiToken_{produces<edm::ConditionsInLumiBlock, edm::Transition::EndLuminosityBlock>()},
18  //per RUN products
19  runToken_{produces<edm::ConditionsInRunBlock, edm::Transition::EndRun>()},
20  //per EVENT products
21  eventToken_{produces<edm::ConditionsInEventBlock>()} {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmDigisLabelToken_
const edm::InputTag gtEvmDigisLabel_
const edm::EDPutTokenT< edm::ConditionsInEventBlock > eventToken_
const edm::EDPutTokenT< edm::ConditionsInLumiBlock > lumiToken_
const edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
const edm::EDPutTokenT< edm::ConditionsInRunBlock > runToken_

◆ ~ConditionDumperInEdm()

ConditionDumperInEdm::~ConditionDumperInEdm ( )
override

Definition at line 23 of file ConditionDumperInEdm.cc.

23 {}

Member Function Documentation

◆ endLuminosityBlockProduce()

void ConditionDumperInEdm::endLuminosityBlockProduce ( edm::LuminosityBlock lumi,
edm::EventSetup const &  setup 
)
finalprivate

Definition at line 33 of file ConditionDumperInEdm.cc.

References lumiToken_.

33  {
34  lumi.emplace(lumiToken_, *luminosityBlockCache(lumi.index()));
35 }
const edm::EDPutTokenT< edm::ConditionsInLumiBlock > lumiToken_

◆ endRunProduce()

void ConditionDumperInEdm::endRunProduce ( edm::Run run,
const edm::EventSetup setup 
)
finalprivate

Definition at line 42 of file ConditionDumperInEdm.cc.

References writedatasetfile::run, runInfoToken_, runToken_, and singleTopDQM_cfi::setup.

42  {
43  //dump of RunInfo
44  auto& runBlock = *(runCache(run.index()));
45  {
46  auto const& sum = setup.getData(runInfoToken_);
47  runBlock.BStartCurrent = sum.m_start_current;
48  runBlock.BStopCurrent = sum.m_stop_current;
49  runBlock.BAvgCurrent = sum.m_avg_current;
50  }
51 
52  run.emplace(runToken_, runBlock);
53 }
const edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
const edm::EDPutTokenT< edm::ConditionsInRunBlock > runToken_

◆ globalBeginLuminosityBlock()

std::shared_ptr< edm::ConditionsInLumiBlock > ConditionDumperInEdm::globalBeginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
) const
finalprivate

Definition at line 28 of file ConditionDumperInEdm.cc.

29  {
30  return std::make_shared<edm::ConditionsInLumiBlock>();
31 }

◆ globalBeginRun()

std::shared_ptr< edm::ConditionsInRunBlock > ConditionDumperInEdm::globalBeginRun ( edm::Run const &  ,
const edm::EventSetup  
) const
finalprivate

Definition at line 37 of file ConditionDumperInEdm.cc.

38  {
39  return std::make_shared<edm::ConditionsInRunBlock>();
40 }

◆ globalEndLuminosityBlock()

void ConditionDumperInEdm::globalEndLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
inlinefinalprivate

Definition at line 60 of file ConditionDumperInEdm.h.

60 {}

◆ globalEndRun()

void ConditionDumperInEdm::globalEndRun ( edm::Run const &  ,
const edm::EventSetup  
)
inlinefinalprivate

Definition at line 63 of file ConditionDumperInEdm.h.

63 {}

◆ produce()

void ConditionDumperInEdm::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
finalprivatevirtual

Implements edm::one::EDProducerBase.

Definition at line 56 of file ConditionDumperInEdm.cc.

References L1GtfeExtWord::beamMode(), L1GtfeExtWord::beamMomentum(), edm::ConditionsInEventBlock::bstMasterStatus, L1GtfeExtWord::bstMasterStatus(), eventBlock_, eventToken_, gtEvmDigisLabel_, gtEvmDigisLabelToken_, L1GlobalTriggerEvmReadoutRecord::gtfeWord(), iEvent, edm::HandleBase::isValid(), L1GtfeExtWord::lhcFillNumber(), LogDebug, L1GtfeExtWord::totalIntensityBeam1(), L1GtfeExtWord::totalIntensityBeam2(), edm::ConditionsInEventBlock::turnCountNumber, and L1GtfeExtWord::turnCountNumber().

56  {
57  //get the L1 object
59  iEvent.getByToken(gtEvmDigisLabelToken_, gtReadoutRecordData);
60 
61  if (!gtReadoutRecordData.isValid()) {
62  LogDebug("ConditionDumperInEdm") << "\nWarning: L1GlobalTriggerEvmReadoutRecord with input tag " << gtEvmDigisLabel_
63  << "\nrequested in configuration, but not found in the event."
64  << "\nNo BST quantities retrieved." << std::endl;
65 
66  iEvent.emplace(eventToken_, eventBlock_);
67 
68  return;
69  }
70 
71  const L1GtfeExtWord& gtfeBlockData = gtReadoutRecordData->gtfeWord();
72 
73  //lumi info
74  auto& lumiBlock = *luminosityBlockCache(iEvent.getLuminosityBlock().index());
75  lumiBlock.totalIntensityBeam1 = gtfeBlockData.totalIntensityBeam1();
76  lumiBlock.totalIntensityBeam2 = gtfeBlockData.totalIntensityBeam2();
77 
78  //run info
79  auto& runBlock = *runCache(iEvent.getRun().index());
80  runBlock.beamMomentum = gtfeBlockData.beamMomentum();
81  runBlock.beamMode = gtfeBlockData.beamMode();
82  runBlock.lhcFillNumber = gtfeBlockData.lhcFillNumber();
83 
84  //event info
87 
88  iEvent.emplace(eventToken_, eventBlock_);
89 }
const cms_uint16_t beamMode() const
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmDigisLabelToken_
const edm::InputTag gtEvmDigisLabel_
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
const edm::EDPutTokenT< edm::ConditionsInEventBlock > eventToken_
const cms_uint16_t bstMasterStatus() const
int iEvent
Definition: GenABIO.cc:224
const cms_uint32_t turnCountNumber() const
const cms_uint32_t lhcFillNumber() const
edm::ConditionsInEventBlock eventBlock_
const cms_uint16_t beamMomentum() const
bool isValid() const
Definition: HandleBase.h:70
const cms_uint32_t totalIntensityBeam2() const
const cms_uint32_t totalIntensityBeam1() const
#define LogDebug(id)

Member Data Documentation

◆ eventBlock_

edm::ConditionsInEventBlock ConditionDumperInEdm::eventBlock_
private

Definition at line 71 of file ConditionDumperInEdm.h.

Referenced by produce().

◆ eventToken_

const edm::EDPutTokenT<edm::ConditionsInEventBlock> ConditionDumperInEdm::eventToken_
private

Definition at line 77 of file ConditionDumperInEdm.h.

Referenced by produce().

◆ gtEvmDigisLabel_

const edm::InputTag ConditionDumperInEdm::gtEvmDigisLabel_
private

Definition at line 69 of file ConditionDumperInEdm.h.

Referenced by produce().

◆ gtEvmDigisLabelToken_

const edm::EDGetTokenT<L1GlobalTriggerEvmReadoutRecord> ConditionDumperInEdm::gtEvmDigisLabelToken_
private

Definition at line 73 of file ConditionDumperInEdm.h.

Referenced by produce().

◆ lumiToken_

const edm::EDPutTokenT<edm::ConditionsInLumiBlock> ConditionDumperInEdm::lumiToken_
private

Definition at line 75 of file ConditionDumperInEdm.h.

Referenced by endLuminosityBlockProduce().

◆ runInfoToken_

const edm::ESGetToken<RunInfo, RunInfoRcd> ConditionDumperInEdm::runInfoToken_
private

Definition at line 74 of file ConditionDumperInEdm.h.

Referenced by endRunProduce().

◆ runToken_

const edm::EDPutTokenT<edm::ConditionsInRunBlock> ConditionDumperInEdm::runToken_
private

Definition at line 76 of file ConditionDumperInEdm.h.

Referenced by endRunProduce().