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.
33 iConfig.
getParameter<std::vector<edm::InputTag>>(
"jetCorrFactorsSource"),
34 [
this](
edm::InputTag const&
tag) { return mayConsume<edm::ValueMap<JetCorrFactors>>(tag); });
40 return mayConsume<reco::JetFloatAssociation::Container>(
tag);
54 if ((
pos != std::string::npos) && (
pos !=
label.length() - 7)) {
57 if (!it->instance().empty()) {
70 if ((
pos != std::string::npos) && (
pos !=
label.length() - 8)) {
85 produces<std::vector<Jet>>();
86 produces<edm::OwnVector<reco::BaseTagInfo>>(
"tagInfos");
References addBTagInfo_, addDiscriminators_, addJetCorrFactors_, addTagInfos_, discriminatorLabels_, discriminatorTags_, discriminatorTokens_, edm::ParameterSet::getParameter(), jetCorrFactorsTokens_, jetsToken_, label, sort_, 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 231 of file PATJetUpdater.cc.
239 iDesc.
add<
bool>(
"sort",
true);
242 iDesc.
add<
bool>(
"addTagInfos",
true);
243 std::vector<edm::InputTag> emptyVInputTags;
244 iDesc.
add<std::vector<edm::InputTag>>(
"tagInfoSources", emptyVInputTags);
247 iDesc.
add<
bool>(
"addJetCorrFactors",
true);
248 iDesc.
add<std::vector<edm::InputTag>>(
"jetCorrFactorsSource", emptyVInputTags);
251 iDesc.
add<
bool>(
"addBTagInfo",
true);
252 iDesc.
add<
bool>(
"addDiscriminators",
true);
253 iDesc.
add<std::vector<edm::InputTag>>(
"discriminatorSources", emptyVInputTags);
256 iDesc.
add<
bool>(
"printWarning",
true);
263 descriptions.
add(
"PATJetUpdater", iDesc);
References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), pat::PATUserDataHelper< ObjectType >::fillDescription(), HLT_FULL_cff::InputTag, and edm::ParameterSetDescription::setComment().
◆ produce()
Definition at line 91 of file PATJetUpdater.cc.
97 std::vector<edm::ValueMap<JetCorrFactors>> jetCorrs;
102 jetCorrs.push_back(*jetCorr);
107 std::vector<edm::Handle<reco::JetFloatAssociation::Container>> jetDiscriminators;
114 std::vector<edm::Handle<edm::View<reco::BaseTagInfo>>> jetTagInfos;
123 auto patJets = std::make_unique<std::vector<Jet>>();
125 auto tagInfosOut = std::make_unique<edm::OwnVector<reco::BaseTagInfo>>();
132 unsigned int idx = itJet -
jets->begin();
139 ajet.setP4(ajet.correctedP4(0));
147 ajet.addJECFactors(jcf);
149 std::vector<std::string>
levels = jetCorrs[0][jetRef].correctionLabels();
151 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L2L3Residual"));
153 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L3Absolute"));
155 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"Uncorrected"));
158 <<
"L2L3Residual and L3Absolute are not part of the jetCorrFactors\n"
159 <<
"of module " << jetCorrs[0][jetRef].jecSet() <<
". Jets will remain"
169 for (
size_t k = 0;
k < jetDiscriminators.size(); ++
k) {
170 float value = (*jetDiscriminators[
k])[jetRef];
175 for (
size_t k = 0;
k < jetTagInfos.size(); ++
k) {
180 if ((
idx < taginfos.
size()) && (taginfos[
idx].
jet() == jetRef)) {
187 if (itTI->jet() == jetRef) {
193 if (
match.isNonnull()) {
194 tagInfosOut->push_back(
match->clone());
197 h_tagInfosOut.id(), &tagInfosOut->back(), tagInfosOut->size() - 1);
214 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, heavyIonCSV_trainingSettings::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(), jetUpdater_cfi::sort, sort_, 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_
◆ sort_
bool pat::PATJetUpdater::sort_ |
|
private |
◆ 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