17 : fillHLT_(
true), doPUWeights_(
false), useAvgVtx_(useAvgVtx), maxAllowedWeight_(maxWeight), lumiWeights_() {
21 if ((
stat(puMCFile.c_str(), &
buf) != -1) && (
stat(puDataFile.c_str(), &
buf) != -1)) {
25 edm::LogWarning(
"L1Prompt") <<
"No PU reweighting inputs - not going to calculate weights" << std::endl;
43 const int ntrigs = hltresults->size();
45 for (
int itr = 0; itr < ntrigs; itr++) {
47 if (!hltresults->accept(itr))
49 event_.hlt.push_back(trigName);
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_;
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_
EventNumber_t event() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
L1AnalysisEvent(std::string puMCFile, std::string puMCHist, std::string puDataFile, std::string puDataHist, bool useAvgVtx, double maxWeight, edm::ConsumesCollector &&)
constexpr bool isUninitialized() const noexcept
int bunchCrossing() const
edm::LuminosityBlockNumber_t luminosityBlock() const
EventAuxiliary const & eventAuxiliary() const override
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
TimeValue_t value() const
edm::Timestamp time() const