CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
virtual void produce (Event &e, EventSetup const &c) override
 
virtual ~EventAuxiliaryHistoryProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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)
 

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

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(), and edm::ParameterSetDescription::add().

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(), j, edm::EventBase::orbitNumber(), edm::Event::put(), query::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_.size() > 0) {
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  std::unique_ptr<std::vector<EventAuxiliary > > result(new 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  }
tuple result
Definition: query.py:137
int j
Definition: DBlmapReader.cc:9
static int const invalidStoreNumber

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