CMS 3D CMS Logo

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
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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)
 

Private Member Functions

void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &, const edm::EventSetup &) final
 
template<typename R , typename T >
const Tget (const edm::EventSetup &setup)
 
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::EDPutTokenT< edm::ConditionsInRunBlockrunToken_
 

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)
 
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<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)
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 47 of file ConditionDumperInEdm.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file ConditionDumperInEdm.cc.

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

16  : gtEvmDigisLabel_{iConfig.getParameter<edm::InputTag>("gtEvmDigisLabel")},
17  gtEvmDigisLabelToken_{consumes<L1GlobalTriggerEvmReadoutRecord>(gtEvmDigisLabel_)},
18  //per LUMI products
19  lumiToken_{produces<edm::ConditionsInLumiBlock, edm::Transition::EndLuminosityBlock>()},
20  //per RUN products
21  runToken_{produces<edm::ConditionsInRunBlock, edm::Transition::EndRun>()},
22  //per EVENT products
23  eventToken_{produces<edm::ConditionsInEventBlock>()} {}
T getParameter(std::string const &) const
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmDigisLabelToken_
const edm::InputTag gtEvmDigisLabel_
const edm::EDPutTokenT< edm::ConditionsInEventBlock > eventToken_
const edm::EDPutTokenT< edm::ConditionsInLumiBlock > lumiToken_
const edm::EDPutTokenT< edm::ConditionsInRunBlock > runToken_
ConditionDumperInEdm::~ConditionDumperInEdm ( )
override

Definition at line 25 of file ConditionDumperInEdm.cc.

25 {}

Member Function Documentation

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

Definition at line 35 of file ConditionDumperInEdm.cc.

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

Referenced by globalEndLuminosityBlock().

35  {
36  lumi.emplace(lumiToken_, std::move(*luminosityBlockCache(lumi.index())));
37 }
LuminosityBlockIndex index() const
void emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
const edm::EDPutTokenT< edm::ConditionsInLumiBlock > lumiToken_
def move(src, dest)
Definition: eostools.py:511
void ConditionDumperInEdm::endRunProduce ( edm::Run run,
const edm::EventSetup setup 
)
finalprivate

Definition at line 44 of file ConditionDumperInEdm.cc.

References edm::Run::emplace(), edm::EventSetup::get(), edm::Run::index(), RunInfo::m_avg_current, RunInfo::m_start_current, RunInfo::m_stop_current, eostools::move(), and runToken_.

Referenced by globalEndRun().

44  {
45  //dump of RunInfo
46  auto& runBlock = *(runCache(run.index()));
47  {
49  setup.get<RunInfoRcd>().get(sum);
50  runBlock.BStartCurrent = sum->m_start_current;
51  runBlock.BStopCurrent = sum->m_stop_current;
52  runBlock.BAvgCurrent = sum->m_avg_current;
53  }
54 
55  run.emplace(runToken_, std::move(runBlock));
56 }
void emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Run.h:245
RunIndex index() const
Definition: Run.cc:21
float m_stop_current
Definition: RunInfo.h:27
float m_avg_current
Definition: RunInfo.h:28
float m_start_current
Definition: RunInfo.h:26
T get() const
Definition: EventSetup.h:73
const edm::EDPutTokenT< edm::ConditionsInRunBlock > runToken_
def move(src, dest)
Definition: eostools.py:511
template<typename R , typename T >
const T* ConditionDumperInEdm::get ( const edm::EventSetup setup)
inlineprivate
std::shared_ptr< edm::ConditionsInLumiBlock > ConditionDumperInEdm::globalBeginLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
) const
finalprivate

Definition at line 30 of file ConditionDumperInEdm.cc.

31  {
32  return std::make_shared<edm::ConditionsInLumiBlock>();
33 }
std::shared_ptr< edm::ConditionsInRunBlock > ConditionDumperInEdm::globalBeginRun ( edm::Run const &  ,
const edm::EventSetup  
) const
finalprivate

Definition at line 39 of file ConditionDumperInEdm.cc.

Referenced by globalEndLuminosityBlock().

40  {
41  return std::make_shared<edm::ConditionsInRunBlock>();
42 }
void ConditionDumperInEdm::globalEndLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
inlinefinalprivate

Definition at line 58 of file ConditionDumperInEdm.h.

References endLuminosityBlockProduce(), and globalBeginRun().

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

Definition at line 61 of file ConditionDumperInEdm.h.

References endRunProduce(), and produce().

61 {}
void ConditionDumperInEdm::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
finalprivate

Definition at line 59 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_, L1GlobalTriggerEvmReadoutRecord::gtfeWord(), edm::LuminosityBlock::index(), edm::Run::index(), edm::HandleBase::isValid(), L1GtfeExtWord::lhcFillNumber(), LogDebug, L1GtfeExtWord::totalIntensityBeam1(), L1GtfeExtWord::totalIntensityBeam2(), edm::ConditionsInEventBlock::turnCountNumber, and L1GtfeExtWord::turnCountNumber().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), HTMLExport.HTMLExportStatic::export(), and globalEndRun().

59  {
60  //get the L1 object
62  iEvent.getByToken(gtEvmDigisLabelToken_, gtReadoutRecordData);
63 
64  if (!gtReadoutRecordData.isValid()) {
65  LogDebug("ConditionDumperInEdm") << "\nWarning: L1GlobalTriggerEvmReadoutRecord with input tag " << gtEvmDigisLabel_
66  << "\nrequested in configuration, but not found in the event."
67  << "\nNo BST quantities retrieved." << std::endl;
68 
70 
71  return;
72  }
73 
74  const L1GtfeExtWord& gtfeBlockData = gtReadoutRecordData->gtfeWord();
75 
76  //lumi info
77  auto& lumiBlock = *luminosityBlockCache(iEvent.getLuminosityBlock().index());
78  lumiBlock.totalIntensityBeam1 = gtfeBlockData.totalIntensityBeam1();
79  lumiBlock.totalIntensityBeam2 = gtfeBlockData.totalIntensityBeam2();
80 
81  //run info
82  auto& runBlock = *runCache(iEvent.getRun().index());
83  runBlock.beamMomentum = gtfeBlockData.beamMomentum();
84  runBlock.beamMode = gtfeBlockData.beamMode();
85  runBlock.lhcFillNumber = gtfeBlockData.lhcFillNumber();
86 
87  //event info
90 
92 }
#define LogDebug(id)
LuminosityBlockIndex index() const
const edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmDigisLabelToken_
const edm::InputTag gtEvmDigisLabel_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
const edm::EDPutTokenT< edm::ConditionsInEventBlock > eventToken_
Run const & getRun() const
Definition: Event.cc:108
const cms_uint16_t bstMasterStatus() const
const cms_uint16_t beamMomentum() const
RunIndex index() const
Definition: Run.cc:21
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:98
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:421
edm::ConditionsInEventBlock eventBlock_
const cms_uint32_t lhcFillNumber() const
const cms_uint32_t turnCountNumber() const
const cms_uint16_t beamMode() const

Member Data Documentation

edm::ConditionsInEventBlock ConditionDumperInEdm::eventBlock_
private

Definition at line 76 of file ConditionDumperInEdm.h.

Referenced by produce().

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

Definition at line 81 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and produce().

const edm::InputTag ConditionDumperInEdm::gtEvmDigisLabel_
private

Definition at line 74 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and produce().

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

Definition at line 78 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and produce().

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

Definition at line 79 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and endLuminosityBlockProduce().

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

Definition at line 80 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and endRunProduce().