Produces pat::Jet's.
More...
#include "PhysicsTools/PatAlgos/interface/PATJetUpdater.h"
Produces pat::Jet's.
The PATJetUpdater produces analysis-level pat::Jet's starting from a collection of pat::Jet's and updates information.
- Author
- Andreas Hinzmann
- Version
- Id
- PATJetUpdater.h,v 1.00 2014/03/11 18:13:54 srappocc Exp
Definition at line 33 of file PATJetUpdater.h.
◆ PATJetUpdater()
Definition at line 25 of file PATJetUpdater.cc.
32 iConfig.
getParameter<std::vector<edm::InputTag>>(
"jetCorrFactorsSource"),
33 [
this](
edm::InputTag const&
tag) { return mayConsume<edm::ValueMap<JetCorrFactors>>(tag); });
39 return mayConsume<reco::JetFloatAssociation::Container>(
tag);
53 if ((
pos != std::string::npos) && (
pos !=
label.length() - 7)) {
56 if (!it->instance().empty()) {
69 if ((
pos != std::string::npos) && (
pos !=
label.length() - 8)) {
84 produces<std::vector<Jet>>();
85 produces<edm::OwnVector<reco::BaseTagInfo>>(
"tagInfos");
References addBTagInfo_, addDiscriminators_, addJetCorrFactors_, addTagInfos_, discriminatorLabels_, discriminatorTags_, discriminatorTokens_, edm::ParameterSet::getParameter(), jetCorrFactorsTokens_, jetsToken_, label, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, tagInfoLabels_, tagInfoTags_, tagInfoTokens_, userDataHelper_, useUserData_, and edm::vector_transform().
◆ ~PATJetUpdater()
PATJetUpdater::~PATJetUpdater |
( |
| ) |
|
|
override |
◆ fillDescriptions()
Definition at line 228 of file PATJetUpdater.cc.
236 iDesc.
add<
bool>(
"addTagInfos",
true);
237 std::vector<edm::InputTag> emptyVInputTags;
238 iDesc.
add<std::vector<edm::InputTag>>(
"tagInfoSources", emptyVInputTags);
241 iDesc.
add<
bool>(
"addJetCorrFactors",
true);
242 iDesc.
add<std::vector<edm::InputTag>>(
"jetCorrFactorsSource", emptyVInputTags);
245 iDesc.
add<
bool>(
"addBTagInfo",
true);
246 iDesc.
add<
bool>(
"addDiscriminators",
true);
247 iDesc.
add<std::vector<edm::InputTag>>(
"discriminatorSources", emptyVInputTags);
250 iDesc.
add<
bool>(
"printWarning",
true);
257 descriptions.
add(
"PATJetUpdater", iDesc);
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), pat::PATUserDataHelper< ObjectType >::fillDescription(), HLT_2018_cff::InputTag, and edm::ParameterSetDescription::setComment().
◆ produce()
Definition at line 90 of file PATJetUpdater.cc.
96 std::vector<edm::ValueMap<JetCorrFactors>> jetCorrs;
101 jetCorrs.push_back(*jetCorr);
106 std::vector<edm::Handle<reco::JetFloatAssociation::Container>> jetDiscriminators;
113 std::vector<edm::Handle<edm::View<reco::BaseTagInfo>>> jetTagInfos;
122 auto patJets = std::make_unique<std::vector<Jet>>();
124 auto tagInfosOut = std::make_unique<edm::OwnVector<reco::BaseTagInfo>>();
131 unsigned int idx = itJet -
jets->begin();
138 ajet.setP4(ajet.correctedP4(0));
146 ajet.addJECFactors(jcf);
148 std::vector<std::string>
levels = jetCorrs[0][jetRef].correctionLabels();
150 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L2L3Residual"));
152 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L3Absolute"));
154 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"Uncorrected"));
157 <<
"L2L3Residual and L3Absolute are not part of the jetCorrFactors\n"
158 <<
"of module " << jetCorrs[0][jetRef].jecSet() <<
". Jets will remain"
168 for (
size_t k = 0;
k < jetDiscriminators.size(); ++
k) {
169 float value = (*jetDiscriminators[
k])[jetRef];
174 for (
size_t k = 0;
k < jetTagInfos.size(); ++
k) {
179 if ((
idx < taginfos.
size()) && (taginfos[
idx].
jet() == jetRef)) {
186 if (itTI->jet() == jetRef) {
192 if (
match.isNonnull()) {
193 tagInfosOut->push_back(
match->clone());
196 h_tagInfosOut.id(), &tagInfosOut->back(), tagInfosOut->size() - 1);
213 ajet.refToOrig_ = patJetRef->originalObjectRef();
References pat::PATUserDataHelper< ObjectType >::add(), pat::Jet::addBDiscriminatorPair(), addBTagInfo_, addDiscriminators_, pat::Jet::addJECFactors(), addJetCorrFactors_, pat::Jet::addTagInfo(), addTagInfos_, edm::View< T >::begin(), edm::RefToBase< T >::castTo(), pat::Jet::correctedP4(), discriminatorLabels_, discriminatorTokens_, edm::View< T >::end(), spr::find(), mps_fire::i, training_settings::idx, iEvent, pat::Jet::initializeJEC(), pat::Jet::jec_, metsig::jet, jetCorrFactorsTokens_, singleTopDQM_cfi::jets, jetsToken_, dqmdumpme::k, jets_cff::levels, match(), eostools::move(), hemisphereProducer_cfi::patJets, printWarning_, pTComparator_, edm::View< T >::ptrAt(), pat::PATObject< ObjectType >::refToOrig_, reco::LeafCandidate::setP4(), edm::View< T >::size(), tagInfoLabels_, tagInfoTokens_, userDataHelper_, and useUserData_.
◆ addBTagInfo_
bool pat::PATJetUpdater::addBTagInfo_ |
|
private |
◆ addDiscriminators_
bool pat::PATJetUpdater::addDiscriminators_ |
|
private |
◆ addJetCorrFactors_
bool pat::PATJetUpdater::addJetCorrFactors_ |
|
private |
◆ addTagInfos_
bool pat::PATJetUpdater::addTagInfos_ |
|
private |
◆ discriminatorLabels_
std::vector<std::string> pat::PATJetUpdater::discriminatorLabels_ |
|
private |
◆ discriminatorTags_
std::vector<edm::InputTag> pat::PATJetUpdater::discriminatorTags_ |
|
private |
◆ discriminatorTokens_
◆ jetCorrFactorsTokens_
◆ jetsToken_
◆ printWarning_
bool pat::PATJetUpdater::printWarning_ |
|
private |
◆ pTComparator_
◆ tagInfoLabels_
std::vector<std::string> pat::PATJetUpdater::tagInfoLabels_ |
|
private |
◆ tagInfoTags_
◆ tagInfoTokens_
◆ userDataHelper_
◆ useUserData_
bool pat::PATJetUpdater::useUserData_ |
|
private |
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Container::value_type value_type