CMS 3D CMS Logo

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

#include <DPGAnalysis/SiStripTools/plugins/EventWithHistoryProducer.cc>

Inheritance diagram for EventWithHistoryProducer:
edm::stream::EDProducer<>

Public Member Functions

 EventWithHistoryProducer (const edm::ParameterSet &)
 
 ~EventWithHistoryProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
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
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const unsigned int _depth
 
EventWithHistory _prevHE
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Description: EDProducer of EventWithHistory which rely on the presence of the previous event in the analyzed dataset

Implementation:

Definition at line 40 of file EventWithHistoryProducer.cc.

Constructor & Destructor Documentation

◆ EventWithHistoryProducer()

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

Definition at line 65 of file EventWithHistoryProducer.cc.

66  : _depth(iConfig.getUntrackedParameter<unsigned int>("historyDepth")), _prevHE() {
67  produces<EventWithHistory>();
68 
69  //now do what ever other initialization is needed
70 }
T getUntrackedParameter(std::string const &, T const &) const

◆ ~EventWithHistoryProducer()

EventWithHistoryProducer::~EventWithHistoryProducer ( )
override

Definition at line 72 of file EventWithHistoryProducer.cc.

72  {
73  // do anything here that needs to be done at desctruction time
74  // (e.g. close files, deallocate resources etc.)
75 }

Member Function Documentation

◆ produce()

void EventWithHistoryProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 82 of file EventWithHistoryProducer.cc.

References _depth, TinyEvent::_event, _prevHE, iEvent, and eostools::move().

82  {
83  using namespace edm;
84 
85  std::unique_ptr<EventWithHistory> heOut(
86  new EventWithHistory(iEvent.id().event(), iEvent.orbitNumber(), iEvent.bunchCrossing()));
87  heOut->add(_prevHE, _depth);
88 
89  if (*heOut < _prevHE)
90  edm::LogInfo("EventsNotInOrder") << " Events not in order " << _prevHE._event;
91 
92  _prevHE = *heOut;
93  iEvent.put(std::move(heOut));
94 }
int iEvent
Definition: GenABIO.cc:224
Log< level::Info, false > LogInfo
HLT enums.
edm::EventNumber_t _event
Definition: TinyEvent.h:64
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ _depth

const unsigned int EventWithHistoryProducer::_depth
private

Definition at line 50 of file EventWithHistoryProducer.cc.

Referenced by produce().

◆ _prevHE

EventWithHistory EventWithHistoryProducer::_prevHE
private

Definition at line 51 of file EventWithHistoryProducer.cc.

Referenced by produce().