Go to the documentation of this file.
55 std::vector<edm::InputTag> srcLeptonsTags = iConfig.
getParameter<std::vector<edm::InputTag>>(
"srcLeptons");
56 for (std::vector<edm::InputTag>::const_iterator it = srcLeptonsTags.begin(); it != srcLeptonsTags.end(); it++) {
62 produces<std::vector<MET>>();
72 if (
mets->size() != 1)
74 <<
mets->size() <<
" instead of 1 as it should.\n";
87 std::vector<MET>*
patMETs =
new std::vector<MET>();
90 unsigned int idx = itMET -
mets->begin();
129 std::unique_ptr<std::vector<MET>> myMETs(
patMETs);
142 iDesc.
add<
bool>(
"addGenMET",
false);
150 iDesc.
add(
"efficiencies", efficienciesPSet);
151 iDesc.
add<
bool>(
"addEfficiencies",
false);
159 iDesc.
add<
bool>(
"addMuonCorrections",
false);
167 std::vector<edm::Handle<reco::CandidateView>>
leptons;
172 event.getByToken(*srcLeptons_i, leptons_i);
196 if (
met.isWeighted()) {
198 throw cms::Exception(
"InvalidInput") <<
"MET is weighted (e.g. PUPPI), but no weights given in PATMETProducer\n";
Assists in assimilating all pat::UserData into pat objects.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void setMETSignificance(const double &metSig)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::EDGetTokenT< edm::View< reco::GenMET > > genMETToken_
static void fillDescription(edm::ParameterSetDescription &iDesc)
bool enabled() const
'true' if this there is at least one efficiency configured
constexpr bool isUninitialized() const noexcept
METSignificance
____________________________________________________________________________||
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
bool enabled() const
'true' if this there is at least one efficiency configured
std::vector< edm::EDGetTokenT< edm::View< reco::Candidate > > > lepTokens_
void setSignificanceMatrix(const reco::METCovMatrix &matrix)
metsig::METSignificance * metSigAlgo_
#define DEFINE_FWK_MODULE(type)
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
pat::PATUserDataHelper< pat::MET > userDataHelper_
bool calculateMETSignificance_
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
void setGenMET(const reco::GenMET &gm)
set the associated GenMET
~PATMETProducer() override
void setComment(std::string const &value)
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
edm::EDGetTokenT< edm::ValueMap< float > > weightsToken_
edm::EDGetTokenT< edm::View< reco::Candidate > > pfCandToken_
PATMETProducer(const edm::ParameterSet &iConfig)
Analysis-level MET class.
void setAllowAnything()
allow any parameter label/value pairs
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
std::string jetResPtType_
const reco::METCovMatrix getMETCovMatrix(const edm::Event &event, const edm::EventSetup &iSetup, const reco::MET &met, double &sumPtUnclustered) const
static const JetResolutionScaleFactor get(const edm::EventSetup &, const std::string &)
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
pat::helper::KinResolutionsLoader resolutionLoader_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
reco::METCovMatrix getCovariance(const edm::View< reco::Jet > &jets, const std::vector< edm::Handle< reco::CandidateView > > &leptons, const edm::Handle< edm::View< reco::Candidate > > &pfCandidates, double rho, JME::JetResolution &resPtObj, JME::JetResolution &resPhiObj, JME::JetResolutionScaleFactor &resSFObj, bool isRealData, double &sumPtUnclustered, edm::ValueMap< float > const *weights=nullptr)
T getParameter(std::string const &) const
pat::helper::EfficiencyLoader efficiencyLoader_
static double getSignificance(const reco::METCovMatrix &cov, const reco::MET &met)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::EDGetTokenT< double > rhoToken_
static const JetResolution get(const edm::EventSetup &, const std::string &)
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
std::string jetResPhiType_
ROOT::Math::SMatrix< double, 2 > METCovMatrix
void setMETSumPtUnclustered(const double &sumPtUnclustered)