CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

EventWithHistoryProducer Class Reference

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

Inheritance diagram for EventWithHistoryProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 EventWithHistoryProducer (const edm::ParameterSet &)
 ~EventWithHistoryProducer ()

Private Member Functions

virtual void beginJob ()
virtual void endJob ()
virtual void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

const unsigned int _depth
EventWithHistory _prevHE

Detailed Description

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

Implementation:

Definition at line 41 of file EventWithHistoryProducer.cc.


Constructor & Destructor Documentation

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

Definition at line 69 of file EventWithHistoryProducer.cc.

                                                                                :
  _depth(iConfig.getUntrackedParameter<unsigned int>("historyDepth")),
  _prevHE() 
{

  produces<EventWithHistory>();

   //now do what ever other initialization is needed
  
}
EventWithHistoryProducer::~EventWithHistoryProducer ( )

Definition at line 81 of file EventWithHistoryProducer.cc.

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

}

Member Function Documentation

void EventWithHistoryProducer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 113 of file EventWithHistoryProducer.cc.

{
}
void EventWithHistoryProducer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 119 of file EventWithHistoryProducer.cc.

                                 {
}
void EventWithHistoryProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 96 of file EventWithHistoryProducer.cc.

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

{

  using namespace edm;

  std::auto_ptr<EventWithHistory> heOut(new EventWithHistory(iEvent.id().event(),iEvent.orbitNumber(),iEvent.bunchCrossing()));
  heOut->add(_prevHE,_depth);

  if(*heOut < _prevHE) edm::LogInfo("EventsNotInOrder") << " Events not in order " << _prevHE._event;

  _prevHE = *heOut;
  iEvent.put(heOut);
  
}

Member Data Documentation

const unsigned int EventWithHistoryProducer::_depth [private]

Definition at line 53 of file EventWithHistoryProducer.cc.

Referenced by produce().

Definition at line 54 of file EventWithHistoryProducer.cc.

Referenced by produce().