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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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
 
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)
 
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::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 ESProduct , Transition Tr = Transition::Event>
auto esConsumes (eventsetup::EventSetupRecordKey const &, 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 48 of file ConditionDumperInEdm.h.

Constructor & Destructor Documentation

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

Definition at line 16 of file ConditionDumperInEdm.cc.

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

16  :
17  gtEvmDigisLabel_{iConfig.getParameter<edm::InputTag>("gtEvmDigisLabel")},
18  gtEvmDigisLabelToken_{consumes<L1GlobalTriggerEvmReadoutRecord>(gtEvmDigisLabel_)},
19  //per LUMI products
20  lumiToken_{produces<edm::ConditionsInLumiBlock,edm::Transition::EndLuminosityBlock>()},
21  //per RUN products
22  runToken_{produces<edm::ConditionsInRunBlock,edm::Transition::EndRun>()},
23  //per EVENT products
24  eventToken_{produces<edm::ConditionsInEventBlock>()}
25 {
26 }
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 29 of file ConditionDumperInEdm.cc.

30 {
31 }

Member Function Documentation

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

Definition at line 42 of file ConditionDumperInEdm.cc.

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

Referenced by globalEndLuminosityBlock().

42  {
43  lumi.emplace(lumiToken_,std::move(*luminosityBlockCache(lumi.index())));
44 }
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 51 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().

51  {
52  //dump of RunInfo
53  auto& runBlock = *(runCache(run.index()));
54  {
56  setup.get<RunInfoRcd>().get(sum);
57  runBlock.BStartCurrent=sum->m_start_current;
58  runBlock.BStopCurrent=sum->m_stop_current;
59  runBlock.BAvgCurrent=sum->m_avg_current;
60  }
61 
62  run.emplace(runToken_,std::move(runBlock));
63 }
void emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Run.h:262
RunIndex index() const
Definition: Run.cc:24
float m_stop_current
Definition: RunInfo.h:28
float m_avg_current
Definition: RunInfo.h:29
float m_start_current
Definition: RunInfo.h:27
T get() const
Definition: EventSetup.h:68
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 38 of file ConditionDumperInEdm.cc.

38  {
39  return std::make_shared<edm::ConditionsInLumiBlock>();
40 }
std::shared_ptr< edm::ConditionsInRunBlock > ConditionDumperInEdm::globalBeginRun ( edm::Run const &  ,
const edm::EventSetup  
) const
finalprivate

Definition at line 47 of file ConditionDumperInEdm.cc.

Referenced by globalEndLuminosityBlock().

47  {
48  return std::make_shared<edm::ConditionsInRunBlock>();
49 }
void ConditionDumperInEdm::globalEndLuminosityBlock ( edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
inlinefinalprivate

Definition at line 59 of file ConditionDumperInEdm.h.

References endLuminosityBlockProduce(), and globalBeginRun().

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

Definition at line 62 of file ConditionDumperInEdm.h.

References endRunProduce(), and produce().

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

Definition at line 67 of file ConditionDumperInEdm.cc.

References L1GtfeExtWord::beamMode(), L1GtfeExtWord::beamMomentum(), 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().

68 {
69 
70  //get the L1 object
72  iEvent.getByToken(gtEvmDigisLabelToken_, gtReadoutRecordData);
73 
74  if (!gtReadoutRecordData.isValid()) {
75  LogDebug("ConditionDumperInEdm")
76  << "\nWarning: L1GlobalTriggerEvmReadoutRecord with input tag " << gtEvmDigisLabel_
77  << "\nrequested in configuration, but not found in the event."
78  << "\nNo BST quantities retrieved." << std::endl;
79 
81 
82  return;
83  }
84 
85  const L1GtfeExtWord& gtfeBlockData = gtReadoutRecordData->gtfeWord();
86 
87  //lumi info
88  auto& lumiBlock = *luminosityBlockCache(iEvent.getLuminosityBlock().index());
89  lumiBlock.totalIntensityBeam1=gtfeBlockData.totalIntensityBeam1();
90  lumiBlock.totalIntensityBeam2=gtfeBlockData.totalIntensityBeam2();
91 
92  //run info
93  auto& runBlock = *runCache(iEvent.getRun().index());
94  runBlock.beamMomentum=gtfeBlockData.beamMomentum();
95  runBlock.beamMode=gtfeBlockData.beamMode();
96  runBlock.lhcFillNumber=gtfeBlockData.lhcFillNumber();
97 
98  //event info
99  eventBlock_. bstMasterStatus= gtfeBlockData.bstMasterStatus() ;
100  eventBlock_.turnCountNumber = gtfeBlockData.turnCountNumber();
101 
103 }
#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:579
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:114
const cms_uint16_t bstMasterStatus() const
const cms_uint16_t beamMomentum() const
RunIndex index() const
Definition: Run.cc:24
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:101
bool isValid() const
Definition: HandleBase.h:74
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:453
edm::ConditionsInEventBlock eventBlock_
const cms_uint32_t lhcFillNumber() const
boost::uint32_t turnCountNumber
const cms_uint32_t turnCountNumber() const
const cms_uint16_t beamMode() const

Member Data Documentation

edm::ConditionsInEventBlock ConditionDumperInEdm::eventBlock_
private

Definition at line 77 of file ConditionDumperInEdm.h.

Referenced by produce().

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

Definition at line 82 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and produce().

const edm::InputTag ConditionDumperInEdm::gtEvmDigisLabel_
private

Definition at line 75 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and produce().

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

Definition at line 79 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and produce().

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

Definition at line 80 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and endLuminosityBlockProduce().

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

Definition at line 81 of file ConditionDumperInEdm.h.

Referenced by ConditionDumperInEdm(), and endRunProduce().