void METAnalyser::analyse(const EventPtr event) { histMan_->setCurrentHistogramFolder(histogramFolder_); weight_ = event->weight() * prescale_ * scale_; for (unsigned index = 0; index < METAlgorithm::NUMBER_OF_METALGORITHMS; ++index) { std::string prefix = METAlgorithm::prefixes.at(index); METAlgorithm::value metType = (METAlgorithm::value) index; if (!MET::isAvailableInNTupleVersion(Globals::NTupleVersion, index)) continue; bool isMCOnlyMET = MET::isMCOnlyMETType(index); if (isMCOnlyMET && event->isRealData()) //these METs are MC only (Jet resolution systematics) continue; const METPointer met(event->MET(metType)); histMan_->setCurrentHistogramFolder(histogramFolder_ + "/" + prefix); histMan_->H1D_BJetBinned("MET")->Fill(met->et(), weight_); if (index != METAlgorithm::GenMET && !event->isRealData()) { histMan_->H2D_BJetBinned("RecoMET_vs_GenMET")->Fill(event->GenMET()->et(), met->et(), weight_); } //do not fill other histograms for met systematics if ((index > METAlgorithm::patType1p2CorrectedPFMet) && (index != METAlgorithm::recoMetPFlow)) continue; histMan_->H1D_BJetBinned("MET_phi")->Fill(met->phi(), weight_); histMan_->H1D_BJetBinned("METsignificance")->Fill(met->significance(), weight_); histMan_->H2D_BJetBinned("METsignificance_vs_MET")->Fill(met->et(), met->significance(), weight_); } }