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

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

Definition at line 82 of file EventWithHistoryProducer.cc.

References _depth, TinyEvent::_event, _prevHE, edm::EventBase::bunchCrossing(), edm::EventID::event(), edm::EventBase::id(), eostools::move(), edm::EventBase::orbitNumber(), and edm::Event::put().

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 }
EventNumber_t event() const
Definition: EventID.h:40
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
int bunchCrossing() const
Definition: EventBase.h:64
def move
Definition: eostools.py:511
int orbitNumber() const
Definition: EventBase.h:65
Log< level::Info, false > LogInfo
edm::EventID id() const
Definition: EventBase.h:59
edm::EventNumber_t _event
Definition: TinyEvent.h:64

Member Data Documentation

const unsigned int EventWithHistoryProducer::_depth
private

Definition at line 50 of file EventWithHistoryProducer.cc.

Referenced by produce().

EventWithHistory EventWithHistoryProducer::_prevHE
private

Definition at line 51 of file EventWithHistoryProducer.cc.

Referenced by produce().