240 if (
iEvent.isRealData()) {
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();
405 ajet.initializeJEC(jetCorrs[0][jetRef].jecLevel(
"L2L3Residual"));
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)) {
487 if (itTI->jet() == jetRef) {
493 if (
match.isNonnull()) {
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
pat::helper::EfficiencyLoader efficiencyLoader_
virtual std::vector< CaloTowerPtr > getCaloConstituents() const
get all constituents
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_
std::vector< edm::EDGetTokenT< edm::View< reco::BaseTagInfo > > > tagInfoTokens_
edm::EDGetTokenT< reco::JetTracksAssociation::Container > trackAssociationToken_
Jets made from CaloTowers.
Ptr< value_type > ptrAt(size_type i) const
std::vector< std::string > tagInfoLabels_
std::vector< edm::EDGetTokenT< edm::ValueMap< JetCorrFactors > > > jetCorrFactorsTokens_
bool addAssociatedTracks_
void setEfficiencies(pat::PATObject< T > &obj, const R &originalRef) const
Sets the efficiencies for this object, using the reference to the original objects.
pat::helper::KinResolutionsLoader resolutionLoader_
std::vector< GenJet > GenJetCollection
collection of GenJet objects
std::vector< std::string > discriminatorLabels_
bool isNonnull() const
Checks for non-null.
void setResolutions(pat::PATObject< T > &obj) const
Sets the efficiencies for this object, using the reference to the original objects.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
edm::EDGetTokenT< reco::JetFlavourInfoMatchingCollection > jetFlavourInfoToken_
Jets made from PFObjects.
GreaterByPt< Jet > pTComparator_
virtual std::vector< reco::PFCandidatePtr > getPFConstituents() const
get all constituents
edm::EDGetTokenT< reco::JetFloatAssociation::Container > jetChargeToken_
Container::value_type value_type
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.
bool enabled() const
'true' if this there is at least one efficiency configured
edm::EDGetTokenT< reco::JetIDValueMap > jetIDMapToken_
genJetMatch
switch on/off embedding of matched genJet's
const edm::RefToBase< reco::Jet > & getCaloJetRef() const
void add(ObjectType &patObject, edm::Event const &iEvent, edm::EventSetup const &iSetup)
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
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_
bool embedGenPartonMatch_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
const_iterator begin() const
Log< level::Warning, false > LogWarning
value_type const * get() const
const_iterator end() const