|
|
Produces the pat::MET.
More...
#include "PhysicsTools/PatAlgos/interface/PATMETProducer.h"
Produces the pat::MET.
The PATMETProducer produces the analysis-level pat::MET starting from a collection of objects of METType.
- Author
- Steven Lowette
- Version
- Id
- PATMETProducer.h,v 1.10 2009/06/25 23:49:35 gpetrucc Exp
Definition at line 36 of file PATMETProducer.h.
◆ PATMETProducer()
Definition at line 16 of file PATMETProducer.cc.
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>>();
References addEfficiencies_, addGenMET_, addResolutions_, calculateMETSignificance_, efficiencyLoader_, genMETToken_, edm::ParameterSet::getParameter(), jetResPhiType_, jetResPtType_, jetSFType_, jetToken_, lepTokens_, metSigAlgo_, METSignificance_cfi::METSignificance, metSrc_, metToken_, pfCandToken_, resolutionLoader_, rhoToken_, HLT_FULL_cff::srcWeights, AlCaHLTBitMon_QueryRunRegistry::string, userDataHelper_, useUserData_, and weightsToken_.
◆ ~PATMETProducer()
PATMETProducer::~PATMETProducer |
( |
| ) |
|
|
override |
◆ fillDescriptions()
Definition at line 134 of file PATMETProducer.cc.
142 iDesc.
add<
bool>(
"addGenMET",
false);
150 iDesc.
add(
"efficiencies", efficienciesPSet);
151 iDesc.
add<
bool>(
"addEfficiencies",
false);
159 iDesc.
add<
bool>(
"addMuonCorrections",
false);
References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), pat::helper::KinResolutionsLoader::fillDescription(), pat::PATUserDataHelper< ObjectType >::fillDescription(), HLT_FULL_cff::InputTag, edm::ParameterSetDescription::setAllowAnything(), and edm::ParameterSetDescription::setComment().
◆ getMETCovMatrix()
Definition at line 163 of file PATMETProducer.cc.
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";
References JME::JetResolution::get(), JME::JetResolutionScaleFactor::get(), metsig::METSignificance::getCovariance(), HLT_FULL_cff::inputJets, edm::EDGetTokenT< T >::isUninitialized(), jetResPhiType_, jetResPtType_, jetSFType_, jetToken_, lepTokens_, HLT_FULL_cff::leptons, BTaggingMonitor_cfi::met, metSigAlgo_, pfCandToken_, rhoToken_, met_cff::sumPtUnclustered, trackerHitRTTI::vector, HLT_FULL_cff::weights, and weightsToken_.
Referenced by produce().
◆ produce()
Definition at line 67 of file PATMETProducer.cc.
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();
96 amet.setGenMET((*genMETs)[
idx]);
102 amet.setSignificanceMatrix(sigcov);
104 amet.setMETSignificance(metSig);
129 std::unique_ptr<std::vector<MET>> myMETs(
patMETs);
References pat::PATUserDataHelper< ObjectType >::add(), addGenMET_, calculateMETSignificance_, efficiencyLoader_, pat::helper::EfficiencyLoader::enabled(), pat::helper::KinResolutionsLoader::enabled(), edm::InputTag::encode(), genMETToken_, getMETCovMatrix(), metsig::METSignificance::getSignificance(), heavyIonCSV_trainingSettings::idx, iEvent, singleTopDQM_cfi::mets, metSigAlgo_, metSrc_, metToken_, eostools::move(), pat::helper::EfficiencyLoader::newEvent(), pat::helper::KinResolutionsLoader::newEvent(), metProducer_cfi::patMETs, resolutionLoader_, pat::helper::EfficiencyLoader::setEfficiencies(), pat::MET::setGenMET(), pat::MET::setMETSignificance(), pat::MET::setMETSumPtUnclustered(), pat::helper::KinResolutionsLoader::setResolutions(), reco::MET::setSignificanceMatrix(), met_cff::sumPtUnclustered, userDataHelper_, and useUserData_.
◆ addEfficiencies_
bool pat::PATMETProducer::addEfficiencies_ |
|
private |
◆ addGenMET_
bool pat::PATMETProducer::addGenMET_ |
|
private |
◆ addMuonCorr_
bool pat::PATMETProducer::addMuonCorr_ |
|
private |
◆ addResolutions_
bool pat::PATMETProducer::addResolutions_ |
|
private |
◆ calculateMETSignificance_
bool pat::PATMETProducer::calculateMETSignificance_ |
|
private |
◆ efficiencyLoader_
◆ eTComparator_
◆ genMETToken_
◆ jetResPhiType_
std::string pat::PATMETProducer::jetResPhiType_ |
|
private |
◆ jetResPtType_
std::string pat::PATMETProducer::jetResPtType_ |
|
private |
◆ jetSFType_
std::string pat::PATMETProducer::jetSFType_ |
|
private |
◆ jetToken_
◆ lepTokens_
◆ metSigAlgo_
◆ metSrc_
◆ metToken_
◆ muonSrc_
◆ pfCandToken_
◆ resolutionLoader_
◆ rhoToken_
◆ userDataHelper_
◆ useUserData_
bool pat::PATMETProducer::useUserData_ |
|
private |
◆ weightsToken_
Assists in assimilating all pat::UserData into pat objects.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
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_
metsig::METSignificance * metSigAlgo_
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.
bool exists(std::string const ¶meterName) const
checks if a parameter exists
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_
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_
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