CMS 3D CMS Logo

edm::EventAuxiliaryHistoryProducer Class Reference

#include <FWCore/Modules/src/EventAuxiliaryHistoryProducer.h>

Inheritance diagram for edm::EventAuxiliaryHistoryProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

void endJob ()
 EventAuxiliaryHistoryProducer (edm::ParameterSet const &)
virtual void produce (edm::Event &e, edm::EventSetup const &c)
virtual ~EventAuxiliaryHistoryProducer ()

Private Attributes

unsigned int depth_
std::deque< edm::EventAuxiliaryhistory_


Detailed Description

Definition at line 10 of file EventAuxiliaryHistoryProducer.h.


Constructor & Destructor Documentation

edm::EventAuxiliaryHistoryProducer::EventAuxiliaryHistoryProducer ( edm::ParameterSet const &  ps  )  [explicit]

Definition at line 7 of file EventAuxiliaryHistoryProducer.cc.

00007                                                                                        :
00008     depth_(ps.getParameter<unsigned int>("historyDepth")),
00009     history_()
00010   {
00011       produces<std::vector<EventAuxiliary> > ();
00012   }

edm::EventAuxiliaryHistoryProducer::~EventAuxiliaryHistoryProducer (  )  [virtual]

Definition at line 14 of file EventAuxiliaryHistoryProducer.cc.

00015   {
00016   }


Member Function Documentation

void edm::EventAuxiliaryHistoryProducer::endJob ( void   )  [virtual]

Reimplemented from edm::EDProducer.

Definition at line 42 of file EventAuxiliaryHistoryProducer.cc.

00043   {
00044   }

void edm::EventAuxiliaryHistoryProducer::produce ( edm::Event e,
edm::EventSetup const &  c 
) [virtual]

Implements edm::EDProducer.

Definition at line 18 of file EventAuxiliaryHistoryProducer.cc.

References edm::aux, edm::Event::bunchCrossing(), depth_, edm::Event::experimentType(), history_, edm::Event::id(), edm::EventAuxiliary::invalidStoreNumber, edm::Event::isRealData(), j, edm::Event::luminosityBlock(), edm::Event::orbitNumber(), out, edm::Event::put(), HLT_VtxMuL3::result, and edm::Event::time().

00019   {
00020   EventAuxiliary aux( e.id(), "", e.time(), e.luminosityBlock(), e.isRealData(), e.experimentType(),
00021                       e.bunchCrossing(), EventAuxiliary::invalidStoreNumber,  e.orbitNumber()); 
00022   //const EventAuxiliary & aux = e.auxiliary(); // when available
00023   if(history_.size() > 0)
00024     {
00025     if(history_.back().id().next() != aux.id())    history_.clear();
00026     if(history_.size() >= depth_) history_.pop_front();
00027     }
00028 
00029    history_.push_back(aux);
00030 
00031    //Serialize into std::vector 
00032    std::vector<EventAuxiliary> *  out = new   std::vector<EventAuxiliary>;
00033    std::auto_ptr<std::vector<EventAuxiliary > > result(out);
00034    for(size_t j = 0 ; j < history_.size(); j++)  
00035    { 
00036     out->push_back(history_[j]);
00037    }
00038    e.put(result);
00039 
00040   }


Member Data Documentation

unsigned int edm::EventAuxiliaryHistoryProducer::depth_ [private]

Definition at line 20 of file EventAuxiliaryHistoryProducer.h.

Referenced by produce().

std::deque<edm::EventAuxiliary> edm::EventAuxiliaryHistoryProducer::history_ [private]

Definition at line 21 of file EventAuxiliaryHistoryProducer.h.

Referenced by produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:40:53 2009 for CMSSW by  doxygen 1.5.4