Produces pat::Jet's.
More...
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 37 of file PATJetUpdater.cc.
◆ PATJetUpdater()
Definition at line 75 of file PATJetUpdater.cc.
83 iConfig.
getParameter<std::vector<edm::InputTag>>(
"jetCorrFactorsSource"),
84 [
this](
edm::InputTag const&
tag) { return mayConsume<edm::ValueMap<JetCorrFactors>>(tag); });
90 return mayConsume<reco::JetFloatAssociation::Container>(
tag);
104 if ((
pos != std::string::npos) && (
pos !=
label.length() - 7)) {
107 if (!it->instance().empty()) {
120 if ((
pos != std::string::npos) && (
pos !=
label.length() - 8)) {
135 produces<std::vector<Jet>>();
136 produces<edm::OwnVector<reco::BaseTagInfo>>(
"tagInfos");
References addBTagInfo_, addDiscriminators_, addJetCorrFactors_, addTagInfos_, discriminatorLabels_, discriminatorTags_, discriminatorTokens_, edm::ParameterSet::getParameter(), jetCorrFactorsTokens_, jetsToken_, label, sort_, AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, tagInfoLabels_, tagInfoTags_, tagInfoTokens_, userDataHelper_, useUserData_, and edm::vector_transform().
◆ ~PATJetUpdater()
PATJetUpdater::~PATJetUpdater |
( |
| ) |
|
|
override |
◆ fillDescriptions()
Definition at line 281 of file PATJetUpdater.cc.
289 iDesc.
add<
bool>(
"sort",
true);
292 iDesc.
add<
bool>(
"addTagInfos",
true);
293 std::vector<edm::InputTag> emptyVInputTags;
294 iDesc.
add<std::vector<edm::InputTag>>(
"tagInfoSources", emptyVInputTags);
297 iDesc.
add<
bool>(
"addJetCorrFactors",
true);
298 iDesc.
add<std::vector<edm::InputTag>>(
"jetCorrFactorsSource", emptyVInputTags);
301 iDesc.
add<
bool>(
"addBTagInfo",
true);
302 iDesc.
add<
bool>(
"addDiscriminators",
true);
303 iDesc.
add<std::vector<edm::InputTag>>(
"discriminatorSources", emptyVInputTags);
306 iDesc.
add<
bool>(
"printWarning",
true);
313 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 141 of file PATJetUpdater.cc.
147 std::vector<edm::ValueMap<JetCorrFactors>> jetCorrs;
152 jetCorrs.push_back(*jetCorr);
157 std::vector<edm::Handle<reco::JetFloatAssociation::Container>> jetDiscriminators;
164 std::vector<edm::Handle<edm::View<reco::BaseTagInfo>>> jetTagInfos;
173 auto patJets = std::make_unique<std::vector<Jet>>();
175 auto tagInfosOut = std::make_unique<edm::OwnVector<reco::BaseTagInfo>>();
182 unsigned int idx = itJet -
jets->begin();
189 ajet.setP4(ajet.correctedP4(0));
197 ajet.addJECFactors(jcf);
199 std::vector<std::string>
levels = jetCorrs[0][jetRef].correctionLabels();
201 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L2L3Residual"));
203 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L3Absolute"));
205 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"Uncorrected"));
208 <<
"L2L3Residual and L3Absolute are not part of the jetCorrFactors\n"
209 <<
"of module " << jetCorrs[0][jetRef].jecSet() <<
". Jets will remain"
219 for (
size_t k = 0;
k < jetDiscriminators.size(); ++
k) {
220 float value = (*jetDiscriminators[
k])[jetRef];
225 for (
size_t k = 0;
k < jetTagInfos.size(); ++
k) {
230 if ((
idx < taginfos.
size()) && (taginfos[
idx].
jet() == jetRef)) {
237 if (itTI->jet() == jetRef) {
243 if (
match.isNonnull()) {
244 tagInfosOut->push_back(
match->clone());
247 h_tagInfosOut.id(), &tagInfosOut->back(), tagInfosOut->size() - 1);
264 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