CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
edm::EventAuxiliaryHistoryProducer Class Reference
Inheritance diagram for edm::EventAuxiliaryHistoryProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void endJob () override
 
 EventAuxiliaryHistoryProducer (ParameterSet const &)
 
void produce (Event &e, EventSetup const &c) override
 
 ~EventAuxiliaryHistoryProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Attributes

unsigned int depth_
 
std::deque< EventAuxiliaryhistory_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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.

26  :
27  depth_(ps.getParameter<unsigned int>("historyDepth")),
28  history_() {
29  produces<std::vector<EventAuxiliary> > ();
30  }
edm::EventAuxiliaryHistoryProducer::~EventAuxiliaryHistoryProducer ( )
override

Definition at line 32 of file EventAuxiliaryHistoryProducer.cc.

32  {
33  }

Member Function Documentation

void edm::EventAuxiliaryHistoryProducer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 54 of file EventAuxiliaryHistoryProducer.cc.

54  {
55  }
void edm::EventAuxiliaryHistoryProducer::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Definition at line 59 of file EventAuxiliaryHistoryProducer.cc.

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

59  {
61  desc.add<unsigned int>("historyDepth");
62  descriptions.add("eventAuxiliaryHistory", desc);
63  }
void edm::EventAuxiliaryHistoryProducer::produce ( Event e,
EventSetup const &  c 
)
overridevirtual

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(), eostools::move(), edm::EventBase::orbitNumber(), edm::Event::put(), mps_fire::result, and edm::EventBase::time().

35  {
36  EventAuxiliary aux(e.id(), "", e.time(), e.isRealData(), e.experimentType(),
37  e.bunchCrossing(), EventAuxiliary::invalidStoreNumber, e.orbitNumber());
38  //EventAuxiliary const& aux = e.auxiliary(); // when available
39  if(!history_.empty()) {
40  if(history_.back().id().next(aux.luminosityBlock()) != aux.id()) history_.clear();
41  if(history_.size() >= depth_) history_.pop_front();
42  }
43 
44  history_.push_back(aux);
45 
46  //Serialize into std::vector
47  auto result = std::make_unique<std::vector<EventAuxiliary>>();
48  for(size_t j = 0; j < history_.size(); ++j) {
49  result->push_back(history_[j]);
50  }
51  e.put(std::move(result));
52  }
static int const invalidStoreNumber
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

unsigned int edm::EventAuxiliaryHistoryProducer::depth_
private

Definition at line 22 of file EventAuxiliaryHistoryProducer.cc.

Referenced by produce().

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

Definition at line 23 of file EventAuxiliaryHistoryProducer.cc.

Referenced by produce().