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();
149 if (
std::find(levels.begin(), levels.end(),
"L2L3Residual") != levels.end()) {
150 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L2L3Residual"));
151 }
else if (
std::find(levels.begin(), levels.end(),
"L3Absolute") != levels.end()) {
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)) {
180 match = taginfos.
ptrAt(idx);
186 if (itTI->jet() == jetRef) {
187 match = taginfos.
ptrAt(itTI - taginfos.
begin());
193 tagInfosOut->push_back(match->
clone());
196 h_tagInfosOut.id(), &tagInfosOut->back(), tagInfosOut->size() - 1);
213 ajet.refToOrig_ = patJetRef->originalObjectRef();
GreaterByPt< Jet > pTComparator_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
virtual BaseTagInfo * clone(void) const
clone
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Ptr< value_type > ptrAt(size_type i) const
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< edm::EDGetTokenT< edm::View< reco::BaseTagInfo > > > tagInfoTokens_
std::vector< edm::EDGetTokenT< reco::JetFloatAssociation::Container > > discriminatorTokens_
Container::value_type value_type
const_iterator begin() const
Class for the storage of jet correction factors.
RefProd< PROD > getRefBeforePut()
bool isNonnull() const
Checks for non-null.
std::vector< std::string > discriminatorLabels_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
const_iterator end() const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
pat::PATUserDataHelper< pat::Jet > userDataHelper_
std::vector< std::string > tagInfoLabels_
std::vector< edm::EDGetTokenT< edm::ValueMap< JetCorrFactors > > > jetCorrFactorsTokens_