CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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
 
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)
 
 ~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
 
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 Member Functions

void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &, const edm::EventSetup &) final
 
std::shared_ptr
< edm::ConditionsInLumiBlock
globalBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const final
 
std::shared_ptr
< edm::ConditionsInRunBlock
globalBeginRun (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::ConditionsInEventBlock
eventToken_
 
const edm::InputTag gtEvmDigisLabel_
 
const edm::EDGetTokenT
< L1GlobalTriggerEvmReadoutRecord
gtEvmDigisLabelToken_
 
const edm::EDPutTokenT
< edm::ConditionsInLumiBlock
lumiToken_
 
const edm::ESGetToken< RunInfo,
RunInfoRcd
runInfoToken_
 
const edm::EDPutTokenT
< edm::ConditionsInRunBlock
runToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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
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 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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 49 of file ConditionDumperInEdm.h.

Constructor & Destructor Documentation

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

Definition at line 12 of file ConditionDumperInEdm.cc.

References eventToken_, edm::ParameterSet::getParameter(), gtEvmDigisLabel_, gtEvmDigisLabelToken_, lumiToken_, runInfoToken_, and runToken_.

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>()} {}
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmDigisLabelToken_
const edm::InputTag gtEvmDigisLabel_
const edm::EDPutTokenT< edm::ConditionsInEventBlock > eventToken_
const edm::EDPutTokenT< edm::ConditionsInLumiBlock > lumiToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
const edm::EDPutTokenT< edm::ConditionsInRunBlock > runToken_
ConditionDumperInEdm::~ConditionDumperInEdm ( )
override

Definition at line 23 of file ConditionDumperInEdm.cc.

23 {}

Member Function Documentation

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

Definition at line 33 of file ConditionDumperInEdm.cc.

References edm::LuminosityBlock::emplace(), edm::LuminosityBlock::index(), and lumiToken_.

33  {
34  lumi.emplace(lumiToken_, *luminosityBlockCache(lumi.index()));
35 }
LuminosityBlockIndex index() const
void emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
const edm::EDPutTokenT< edm::ConditionsInLumiBlock > lumiToken_
void ConditionDumperInEdm::endRunProduce ( edm::Run run,
const edm::EventSetup setup 
)
finalprivate

Definition at line 42 of file ConditionDumperInEdm.cc.

References edm::Run::emplace(), edm::EventSetup::getData(), edm::Run::index(), runInfoToken_, and runToken_.

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 }
void emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Run.h:248
bool getData(T &iHolder) const
Definition: EventSetup.h:122
RunIndex index() const
Definition: Run.cc:26
const edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
const edm::EDPutTokenT< edm::ConditionsInRunBlock > runToken_
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 }
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 }
void ConditionDumperInEdm::globalEndLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
inlinefinalprivate

Definition at line 60 of file ConditionDumperInEdm.h.

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

Definition at line 63 of file ConditionDumperInEdm.h.

63 {}
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(), edm::Event::emplace(), eventBlock_, eventToken_, edm::Event::getByToken(), edm::Event::getLuminosityBlock(), edm::Event::getRun(), gtEvmDigisLabel_, gtEvmDigisLabelToken_, edm::LuminosityBlock::index(), edm::Run::index(), 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 
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 
89 }
LuminosityBlockIndex index() const
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmDigisLabelToken_
const edm::InputTag gtEvmDigisLabel_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
const edm::EDPutTokenT< edm::ConditionsInEventBlock > eventToken_
Run const & getRun() const
Definition: Event.cc:112
const cms_uint16_t bstMasterStatus() const
const cms_uint16_t beamMomentum() const
RunIndex index() const
Definition: Run.cc:26
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:100
bool isValid() const
Definition: HandleBase.h:70
const cms_uint32_t totalIntensityBeam2() const
const cms_uint32_t totalIntensityBeam1() const
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:433
edm::ConditionsInEventBlock eventBlock_
const cms_uint32_t lhcFillNumber() const
const cms_uint32_t turnCountNumber() const
const cms_uint16_t beamMode() const
#define LogDebug(id)

Member Data Documentation

edm::ConditionsInEventBlock ConditionDumperInEdm::eventBlock_
private

Definition at line 71 of file ConditionDumperInEdm.h.

Referenced by produce().

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

Definition at line 77 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and produce().

const edm::InputTag ConditionDumperInEdm::gtEvmDigisLabel_
private

Definition at line 69 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and produce().

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

Definition at line 73 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and produce().

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

Definition at line 75 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and endLuminosityBlockProduce().

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

Definition at line 74 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and endRunProduce().

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

Definition at line 76 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and endRunProduce().