17 : fillHLT_(
true), doPUWeights_(
false), useAvgVtx_(
useAvgVtx), maxAllowedWeight_(maxWeight), lumiWeights_() {
25 edm::LogWarning(
"L1Prompt") <<
"No PU reweighting inputs - not going to calculate weights" << std::endl;
32 event_.run =
e.id().run();
33 event_.event =
e.id().event();
34 event_.time =
e.time().value();
35 event_.bx =
e.bunchCrossing();
36 event_.lumi =
e.luminosityBlock();
37 event_.orbit =
e.orbitNumber();
45 for (
int itr = 0; itr < ntrigs; itr++) {
56 if (doPUWeights_ && (!
e.eventAuxiliary().isRealData())) {
61 std::vector<PileupSummaryInfo>::const_iterator pvi;
64 for (pvi = puInfo->begin(); pvi != puInfo->end(); ++pvi) {
65 int bx = pvi->getBunchCrossing();
68 npv = useAvgVtx_ ? pvi->getTrueNumInteractions() : pvi->getPU_NumInteractions();
73 weight = lumiWeights_.weight(npv);
74 if (maxAllowedWeight_ > 0. &&
weight > maxAllowedWeight_)
75 weight = maxAllowedWeight_;
79 if (!
e.eventAuxiliary().isRealData()) {
81 e.getByToken(pileupSummaryInfoToken_, puInfo);
83 for (std::vector<PileupSummaryInfo>::const_iterator pvi = puInfo->begin(); pvi != puInfo->end(); pvi++) {
84 int bx = pvi->getBunchCrossing();
86 event_.nPV = pvi->getPU_NumInteractions();
87 event_.nPV_True = pvi->getTrueNumInteractions();
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > pileupSummaryInfoToken_
L1AnalysisEvent(std::string puMCFile, std::string puMCHist, std::string puDataFile, std::string puDataHist, bool useAvgVtx, double maxWeight, edm::ConsumesCollector &&)
constexpr bool isUninitialized() const noexcept
void Set(const edm::Event &e, const edm::EDGetTokenT< edm::TriggerResults > &hlt_)
std::string const & triggerName(unsigned int index) const
edm::LumiReWeighting lumiWeights_
Log< level::Warning, false > LogWarning