19 useUserData_(iConfig.exists(
"userData"))
30 if (addEfficiencies_) {
47 if(calculateMETSignificance_)
56 std::vector<edm::InputTag> srcLeptonsTags = iConfig.
getParameter< std::vector<edm::InputTag> >(
"srcLeptons");
57 for(std::vector<edm::InputTag>::const_iterator it=srcLeptonsTags.begin();it!=srcLeptonsTags.end();it++) {
63 produces<std::vector<MET> >();
77 if (mets->size() != 1)
throw cms::Exception(
"Corrupt Data") <<
"The input MET collection " <<
metSrc_.
encode() <<
" has size " << mets->size() <<
" instead of 1 as it should.\n";
88 std::vector<MET> *
patMETs =
new std::vector<MET>();
91 unsigned int idx = itMET - mets->begin();
122 patMETs->push_back(amet);
129 std::unique_ptr<std::vector<MET> > myMETs(patMETs);
144 iDesc.
add<
bool>(
"addGenMET",
false);
152 iDesc.
add(
"efficiencies", efficienciesPSet);
153 iDesc.
add<
bool>(
"addEfficiencies",
false);
161 iDesc.
add<
bool>(
"addMuonCorrections",
false);
168 std::vector< edm::Handle<reco::CandidateView> >
leptons;
170 srcLeptons_i !=
lepTokens_.end(); ++srcLeptons_i ) {
172 event.getByToken(*srcLeptons_i, leptons_i);
173 leptons.push_back( leptons_i );
177 event.getByToken(
jetToken_, inputJets );
192 *rho, resPtObj, resPhiObj, resSFObj, event.
isRealData());
bool enabled() const
'true' if this there is at least one efficiency configured
Analysis-level MET class.
T getParameter(std::string const &) const
Assists in assimilating all pat::UserData into pat objects.
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
metsig::METSignificance * metSigAlgo_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
static double getSignificance(const reco::METCovMatrix &cov, const reco::MET &met)
static const JetResolution get(const edm::EventSetup &, const std::string &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setAllowAnything()
allow any parameter label/value pairs
#define DEFINE_FWK_MODULE(type)
pat::PATUserDataHelper< pat::MET > userDataHelper_
void setSignificanceMatrix(const reco::METCovMatrix &matrix)
bool calculateMETSignificance_
ROOT::Math::SMatrix< double, 2 > METCovMatrix
std::string jetResPtType_
std::vector< edm::EDGetTokenT< edm::View< reco::Candidate > > > lepTokens_
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)
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
edm::EDGetTokenT< edm::View< reco::Candidate > > pfCandToken_
bool enabled() const
'true' if this there is at least one efficiency configured
const reco::METCovMatrix getMETCovMatrix(const edm::Event &event, const edm::EventSetup &iSetup) const
static void fillDescription(edm::ParameterSetDescription &iDesc)
void setComment(std::string const &value)
edm::EDGetTokenT< double > rhoToken_
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
edm::EDGetTokenT< edm::View< reco::MET > > metToken_
pat::helper::EfficiencyLoader efficiencyLoader_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
pat::helper::KinResolutionsLoader resolutionLoader_
edm::EDGetTokenT< edm::View< reco::GenMET > > genMETToken_
METSignificance
____________________________________________________________________________||
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
std::string jetResPhiType_
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
static const JetResolutionScaleFactor get(const edm::EventSetup &, const std::string &)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void setGenMET(const reco::GenMET &gm)
set the associated GenMET
PATMETProducer(const edm::ParameterSet &iConfig)
void setMETSignificance(const double &metSig)
~PATMETProducer() override