CMS 3D CMS Logo

EventAuxiliaryHistoryProducer.cc
Go to the documentation of this file.
9 #include <deque>
10 
11 namespace edm {
12 
14  public:
16 
17  static void fillDescriptions(ConfigurationDescriptions& descriptions);
18  void produce(Event& e, EventSetup const& c) override;
19  void endJob() override;
20 
21  private:
22  unsigned int depth_;
23  std::deque<EventAuxiliary> history_;
25  };
26 
28  : depth_(ps.getParameter<unsigned int>("historyDepth")),
29  history_(),
30  token_{produces<std::vector<EventAuxiliary>>()} {}
31 
33  EventAuxiliary aux(e.id(),
34  "",
35  e.time(),
36  e.isRealData(),
37  e.experimentType(),
38  e.bunchCrossing(),
40  e.orbitNumber());
41  //EventAuxiliary const& aux = e.auxiliary(); // when available
42  if (!history_.empty()) {
43  if (history_.back().id().next(aux.luminosityBlock()) != aux.id())
44  history_.clear();
45  if (history_.size() >= depth_)
46  history_.pop_front();
47  }
48 
49  history_.push_back(aux);
50 
51  e.emplace(token_, history_.begin(), history_.end());
52  }
53 
55 
58  desc.add<unsigned int>("historyDepth");
59  descriptions.add("eventAuxiliaryHistory", desc);
60  }
61 } // namespace edm
62 
ConfigurationDescriptions.h
EDProducer.h
edm::EventAuxiliary::invalidStoreNumber
static const int invalidStoreNumber
Definition: EventAuxiliary.h:29
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDPutTokenT
Definition: EDPutToken.h:33
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::one::EDProducer
Definition: EDProducer.h:30
edm::EventAuxiliaryHistoryProducer::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: EventAuxiliaryHistoryProducer.cc:56
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::EventAuxiliaryHistoryProducer::endJob
void endJob() override
Definition: EventAuxiliaryHistoryProducer.cc:54
ParameterSetDescription.h
edm::EventAuxiliary
Definition: EventAuxiliary.h:14
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
EDPutToken.h
printConversionInfo.aux
aux
Definition: printConversionInfo.py:19
createfilelist.int
int
Definition: createfilelist.py:10
edm::EventSetup
Definition: EventSetup.h:58
edm::EventAuxiliaryHistoryProducer::EventAuxiliaryHistoryProducer
EventAuxiliaryHistoryProducer(ParameterSet const &)
Definition: EventAuxiliaryHistoryProducer.cc:27
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::EventAuxiliaryHistoryProducer
Definition: EventAuxiliaryHistoryProducer.cc:13
EventAuxiliary.h
edm::EventAuxiliaryHistoryProducer::token_
EDPutTokenT< std::vector< EventAuxiliary > > token_
Definition: EventAuxiliaryHistoryProducer.cc:24
ParameterSet.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
edm::Event
Definition: Event.h:73
edm::EventAuxiliaryHistoryProducer::produce
void produce(Event &e, EventSetup const &c) override
Definition: EventAuxiliaryHistoryProducer.cc:32
edm::EventAuxiliaryHistoryProducer::depth_
unsigned int depth_
Definition: EventAuxiliaryHistoryProducer.cc:22
edm::EventAuxiliaryHistoryProducer::history_
std::deque< EventAuxiliary > history_
Definition: EventAuxiliaryHistoryProducer.cc:23
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37