68 std::vector<edm::EDGetTokenT<edm::View<reco::Candidate>>>
lepTokens_;
78 double& sumPtUnclustered)
const;
95 if (addEfficiencies_) {
116 if (!srcWeights.
label().empty())
122 std::vector<edm::InputTag> srcLeptonsTags = iConfig.
getParameter<std::vector<edm::InputTag>>(
"srcLeptons");
123 for (std::vector<edm::InputTag>::const_iterator it = srcLeptonsTags.begin(); it != srcLeptonsTags.end(); it++) {
135 produces<std::vector<MET>>();
145 if (mets->size() != 1)
147 << mets->size() <<
" instead of 1 as it should.\n";
160 std::vector<MET>*
patMETs =
new std::vector<MET>();
163 unsigned int idx = itMET - mets->begin();
173 double sumPtUnclustered = 0;
195 patMETs->push_back(amet);
202 std::unique_ptr<std::vector<MET>> myMETs(patMETs);
215 iDesc.
add<
bool>(
"addGenMET",
false);
223 iDesc.
add(
"efficiencies", efficienciesPSet);
224 iDesc.
add<
bool>(
"addEfficiencies",
false);
232 iDesc.
add<
bool>(
"addMuonCorrections",
false);
239 double& sumPtUnclustered)
const {
240 std::vector<edm::Handle<reco::CandidateView>>
leptons;
245 event.getByToken(*srcLeptons_i, leptons_i);
246 leptons.push_back(leptons_i);
271 throw cms::Exception(
"InvalidInput") <<
"MET is weighted (e.g. PUPPI), but no weights given in PATMETProducer\n";
bool enabled() const
'true' if this there is at least one efficiency configured
Analysis-level MET class.
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)
int isWeighted() const
boolean if weights were applied by algorithm (e.g. PUPPI weights)
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)
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)
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_
ROOT::Math::SMatrix< double, 2 > METCovMatrix
void setSignificanceMatrix(const reco::METCovMatrix &matrix)
std::vector< edm::EDGetTokenT< edm::View< reco::Candidate > > > lepTokens_
edm::ESGetToken< JME::JetResolutionObject, JetResolutionRcd > jetResPtToken_
constexpr bool isUninitialized() const noexcept
edm::ESGetToken< JME::JetResolutionObject, JetResolutionRcd > jetResPhiToken_
bool calculateMETSignificance_
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
static void fillDescription(edm::ParameterSetDescription &iDesc)
bool getData(T &iHolder) const
tuple METSignificance
____________________________________________________________________________||
void setComment(std::string const &value)
GreaterByEt< MET > eTComparator_
edm::EDGetTokenT< double > rhoToken_
edm::EDGetTokenT< edm::View< reco::Jet > > jetToken_
edm::EDGetTokenT< edm::ValueMap< float > > weightsToken_
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)
edm::ESGetToken< JME::JetResolutionObject, JetResolutionScaleFactorRcd > jetSFToken_
void setMETSumPtUnclustered(const double &sumPtUnclustered)
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
pat::helper::KinResolutionsLoader resolutionLoader_
edm::EDGetTokenT< edm::View< reco::GenMET > > genMETToken_
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
T getParameter(std::string const &) const
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
void setGenMET(const reco::GenMET &gm)
set the associated GenMET
const reco::METCovMatrix getMETCovMatrix(const edm::Event &event, const edm::EventSetup &iSetup, const reco::MET &met, double &sumPtUnclustered) const
PATMETProducer(const edm::ParameterSet &iConfig)
void setMETSignificance(const double &metSig)
~PATMETProducer() override