|
|
Produces the pat::MET.
More...
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 33 of file PATMETProducer.cc.
◆ PATMETProducer()
Definition at line 83 of file PATMETProducer.cc.
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++) {
129 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 201 of file PATMETProducer.cc.
209 iDesc.
add<
bool>(
"addGenMET",
false);
217 iDesc.
add(
"efficiencies", efficienciesPSet);
218 iDesc.
add<
bool>(
"addEfficiencies",
false);
226 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 230 of file PATMETProducer.cc.
234 std::vector<edm::Handle<reco::CandidateView>>
leptons;
239 event.getByToken(*srcLeptons_i, leptons_i);
263 if (
met.isWeighted()) {
265 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 134 of file PATMETProducer.cc.
139 if (
mets->size() != 1)
141 <<
mets->size() <<
" instead of 1 as it should.\n";
154 std::vector<MET>*
patMETs =
new std::vector<MET>();
157 unsigned int idx = itMET -
mets->begin();
163 amet.setGenMET((*genMETs)[
idx]);
169 amet.setSignificanceMatrix(sigcov);
171 amet.setMETSignificance(metSig);
196 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