CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

edm::EventAuxiliaryHistoryProducer Class Reference

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

List of all members.

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)

Private Attributes

unsigned int depth_
std::deque< EventAuxiliaryhistory_

Detailed Description

Definition at line 12 of file EventAuxiliaryHistoryProducer.cc.


Constructor & Destructor Documentation

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

Definition at line 26 of file EventAuxiliaryHistoryProducer.cc.

                                                                                    :
    depth_(ps.getParameter<unsigned int>("historyDepth")),
    history_() {
      produces<std::vector<EventAuxiliary> > ();
  }
edm::EventAuxiliaryHistoryProducer::~EventAuxiliaryHistoryProducer ( ) [virtual]

Definition at line 32 of file EventAuxiliaryHistoryProducer.cc.

                                                                {
  }

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 54 of file EventAuxiliaryHistoryProducer.cc.

                                             {
  }
void edm::EventAuxiliaryHistoryProducer::fillDescriptions ( ConfigurationDescriptions descriptions) [static]

Reimplemented from edm::EDProducer.

Definition at line 59 of file EventAuxiliaryHistoryProducer.cc.

References edm::ParameterSetDescription::add(), and edm::ConfigurationDescriptions::add().

                                                                                         {
    ParameterSetDescription desc;
    desc.add<unsigned int>("historyDepth");
    descriptions.add("eventAuxiliaryHistory", desc);
  }
void edm::EventAuxiliaryHistoryProducer::produce ( Event e,
EventSetup const &  c 
) [virtual]

Implements edm::EDProducer.

Definition at line 35 of file EventAuxiliaryHistoryProducer.cc.

References printConversionInfo::aux, edm::EventBase::bunchCrossing(), depth_, edm::EventBase::experimentType(), history_, edm::EventBase::id(), edm::EventAuxiliary::invalidStoreNumber, edm::EventBase::isRealData(), j, edm::EventBase::orbitNumber(), edm::Event::put(), query::result, and edm::EventBase::time().

                                                                         {
    EventAuxiliary aux(e.id(), "", e.time(), e.isRealData(), e.experimentType(),
                       e.bunchCrossing(), EventAuxiliary::invalidStoreNumber, e.orbitNumber()); 
  //EventAuxiliary const& aux = e.auxiliary(); // when available
    if(history_.size() > 0) {
      if(history_.back().id().next(aux.luminosityBlock()) != aux.id()) history_.clear();
      if(history_.size() >= depth_) history_.pop_front();
    }

    history_.push_back(aux);

    //Serialize into std::vector 
    std::auto_ptr<std::vector<EventAuxiliary > > result(new std::vector<EventAuxiliary>);
    for(size_t j = 0; j < history_.size(); ++j) { 
      result->push_back(history_[j]);
    }
    e.put(result);
  }

Member Data Documentation

Definition at line 22 of file EventAuxiliaryHistoryProducer.cc.

Referenced by produce().

Definition at line 23 of file EventAuxiliaryHistoryProducer.cc.

Referenced by produce().