281 std::vector<edm::ValueMap<JetCorrFactors>> jetCorrs;
286 jetCorrs.push_back(*jetCorr);
291 std::vector<edm::Handle<reco::JetFloatAssociation::Container>> jetDiscriminators;
298 std::vector<edm::Handle<edm::View<reco::BaseTagInfo>>> jetTagInfos;
320 auto patJets = std::make_unique<std::vector<Jet>>();
322 auto genJetsOut = std::make_unique<reco::GenJetCollection>();
323 auto caloTowersOut = std::make_unique<std::vector<CaloTower>>();
324 auto pfCandidatesOut = std::make_unique<reco::PFCandidateCollection>();
325 auto tagInfosOut = std::make_unique<edm::OwnVector<reco::BaseTagInfo>>();
336 unsigned int idx = itJet - jets->begin();
345 if (ajet.isCaloJet())
346 cj = dynamic_cast<const reco::CaloJet *>(jetRef.
get());
353 for (std::vector<CaloTowerPtr>::const_iterator towBegin = itowers.begin(),
354 towEnd = itowers.end(),
358 if (itow->isAvailable() && itow->isNonnull()) {
359 caloTowersOut->push_back(**itow);
362 edm::Ptr<CaloTower> caloForwardRef(h_caloTowersOut.id(), caloTowerRef.key(), h_caloTowersOut.productGetter());
369 ajet.setCaloTowers(itowersRef);
377 for (std::vector<reco::PFCandidatePtr>::const_iterator partBegin = iparticles.begin(),
378 partEnd = iparticles.end(),
382 pfCandidatesOut->push_back(**ipart);
386 h_pfCandidatesOut.id(), pfCollectionRef.key(), h_pfCandidatesOut.productGetter());
392 ajet.setPFCandidates(iparticlesRef);
401 ajet.addJECFactors(jcf);
403 std::vector<std::string>
levels = jetCorrs[0][jetRef].correctionLabels();
404 if (
std::find(levels.begin(), levels.end(),
"L2L3Residual") != levels.end()) {
405 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L2L3Residual"));
406 }
else if (
std::find(levels.begin(), levels.end(),
"L3Absolute") != levels.end()) {
407 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L3Absolute"));
409 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"Uncorrected"));
412 <<
"L2L3Residual and L3Absolute are not part of the jetCorrFactors\n"
413 <<
"of module " << jetCorrs[0][jetRef].jecSet() <<
". Jets will remain"
442 genJetsOut->push_back(*genjet);
449 ajet.setGenJetRef(genjetFwdRef);
469 for (
size_t k = 0;
k < jetDiscriminators.size(); ++
k) {
470 float value = (*jetDiscriminators[
k])[jetRef];
475 for (
size_t k = 0;
k < jetTagInfos.size(); ++
k) {
480 if ((idx < taginfos.
size()) && (taginfos[idx].
jet() == jetRef)) {
481 match = taginfos.
ptrAt(idx);
487 if (itTI->jet() == jetRef) {
488 match = taginfos.
ptrAt(itTI - taginfos.
begin());
494 tagInfosOut->push_back(match->clone());
497 h_tagInfosOut.id(), &tagInfosOut->back(), tagInfosOut->size() - 1);
509 ajet.setAssociatedTracks((*hTrackAss)[jetRef]);
512 ajet.setJetCharge((*hJetChargeAss)[jetRef]);
517 ajet.setJetID(jetId);
523 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.
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_
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.
Analysis-level calorimeter jet class.
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.
Log< level::Warning, false > LogWarning