199 std::vector<edm::ValueMap<JetCorrFactors>> jetCorrs;
204 jetCorrs.push_back(*jetCorr);
209 std::vector<edm::Handle<reco::JetFloatAssociation::Container>> jetDiscriminators;
216 std::vector<edm::Handle<edm::View<reco::BaseTagInfo>>> jetTagInfos;
238 auto patJets = std::make_unique<std::vector<Jet>>();
240 auto genJetsOut = std::make_unique<reco::GenJetCollection>();
241 auto caloTowersOut = std::make_unique<std::vector<CaloTower>>();
242 auto pfCandidatesOut = std::make_unique<reco::PFCandidateCollection>();
243 auto tagInfosOut = std::make_unique<edm::OwnVector<reco::BaseTagInfo>>();
254 unsigned int idx = itJet - jets->begin();
263 if (ajet.isCaloJet())
264 cj = dynamic_cast<const reco::CaloJet *>(jetRef.
get());
271 for (std::vector<CaloTowerPtr>::const_iterator towBegin = itowers.begin(),
272 towEnd = itowers.end(),
276 if (itow->isAvailable() && itow->isNonnull()) {
277 caloTowersOut->push_back(**itow);
280 edm::Ptr<CaloTower> caloForwardRef(h_caloTowersOut.id(), caloTowerRef.key(), h_caloTowersOut.productGetter());
287 ajet.setCaloTowers(itowersRef);
295 for (std::vector<reco::PFCandidatePtr>::const_iterator partBegin = iparticles.begin(),
296 partEnd = iparticles.end(),
300 pfCandidatesOut->push_back(**ipart);
304 h_pfCandidatesOut.id(), pfCollectionRef.key(), h_pfCandidatesOut.productGetter());
310 ajet.setPFCandidates(iparticlesRef);
319 ajet.addJECFactors(jcf);
321 std::vector<std::string>
levels = jetCorrs[0][jetRef].correctionLabels();
322 if (
std::find(levels.begin(), levels.end(),
"L2L3Residual") != levels.end()) {
323 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L2L3Residual"));
324 }
else if (
std::find(levels.begin(), levels.end(),
"L3Absolute") != levels.end()) {
325 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L3Absolute"));
327 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"Uncorrected"));
330 <<
"L2L3Residual and L3Absolute are not part of the jetCorrFactors\n" 331 <<
"of module " << jetCorrs[0][jetRef].jecSet() <<
". Jets will remain" 360 genJetsOut->push_back(*genjet);
367 ajet.setGenJetRef(genjetFwdRef);
387 for (
size_t k = 0;
k < jetDiscriminators.size(); ++
k) {
388 float value = (*jetDiscriminators[
k])[jetRef];
393 for (
size_t k = 0;
k < jetTagInfos.size(); ++
k) {
398 if ((idx < taginfos.
size()) && (taginfos[idx].
jet() == jetRef)) {
399 match = taginfos.
ptrAt(idx);
405 if (itTI->jet() == jetRef) {
406 match = taginfos.
ptrAt(itTI - taginfos.
begin());
412 tagInfosOut->push_back(match->
clone());
415 h_tagInfosOut.id(), &tagInfosOut->back(), tagInfosOut->size() - 1);
427 ajet.setAssociatedTracks((*hTrackAss)[jetRef]);
430 ajet.setJetCharge((*hJetChargeAss)[jetRef]);
435 ajet.setJetID(jetId);
441 ajet.setJetID(jetId);
bool enabled() const
'true' if this there is at least one efficiency configured
value_type const * get() const
pat::helper::EfficiencyLoader efficiencyLoader_
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
edm::EDGetTokenT< edm::View< reco::Jet > > jetsToken_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool isNonnull() const
Checks for non-null.
std::vector< edm::EDGetTokenT< edm::View< reco::BaseTagInfo > > > tagInfoTokens_
edm::EDGetTokenT< reco::JetTracksAssociation::Container > trackAssociationToken_
Jets made from CaloTowers.
virtual BaseTagInfo * clone(void) const
clone
std::vector< std::string > tagInfoLabels_
std::vector< edm::EDGetTokenT< edm::ValueMap< JetCorrFactors > > > jetCorrFactorsTokens_
bool addAssociatedTracks_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Ptr< value_type > ptrAt(size_type i) const
pat::helper::KinResolutionsLoader resolutionLoader_
std::vector< GenJet > GenJetCollection
collection of GenJet objects
std::vector< std::string > discriminatorLabels_
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
virtual std::vector< CaloTowerPtr > getCaloConstituents() const
get all constituents
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
edm::EDGetTokenT< reco::JetFlavourInfoMatchingCollection > jetFlavourInfoToken_
Jets made from PFObjects.
GreaterByPt< Jet > pTComparator_
bool enabled() const
'true' if this there is at least one efficiency configured
edm::EDGetTokenT< reco::JetFloatAssociation::Container > jetChargeToken_
Container::value_type value_type
const_iterator begin() const
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
Jets made from CaloJets corrected for ZSP and tracks.
Class for the storage of jet correction factors.
edm::EDGetTokenT< reco::JetIDValueMap > jetIDMapToken_
genJetMatch
switch on/off embedding of matched genJet's
RefProd< PROD > getRefBeforePut()
bool isNonnull() const
Checks for non-null.
pat::PATUserDataHelper< pat::Jet > userDataHelper_
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< reco::JetFlavourMatchingCollection > jetPartonMapToken_
bool useLegacyJetMCFlavour_
std::vector< edm::FwdPtr< CaloTower > > CaloTowerFwdPtrCollection
std::vector< edm::FwdPtr< reco::PFCandidate > > PFCandidateFwdPtrCollection
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
edm::EDGetTokenT< edm::Association< reco::GenJetCollection > > genJetToken_
std::vector< edm::EDGetTokenT< reco::JetFloatAssociation::Container > > discriminatorTokens_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
edm::EDGetTokenT< edm::Association< reco::GenParticleCollection > > genPartonToken_
virtual std::vector< reco::PFCandidatePtr > getPFConstituents() const
get all constituents
const_iterator end() const
bool embedGenPartonMatch_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.