38 <<
"Invalid Configuration Parameter 'neutralJetOption' = " << neutralJetOption_string <<
" !!\n";
43 produces<edm::ValueMap<double> >(
"Discriminant");
44 produces<edm::ValueMap<int> >(
"Id");
60 <<
"<computeJVF>:" << std::endl
61 <<
" jet: Pt = " << jet.
pt() <<
", eta = " << jet.
eta() <<
", phi = " << jet.
phi() << std::endl;
63 double trackSum_isVtxAssociated = 0.;
64 double trackSum_isNotVtxAssociated = 0.;
67 for ( std::vector<reco::PFCandidatePtr>::const_iterator jetConstituent = pfConsts.begin(); jetConstituent != pfConsts.end(); ++jetConstituent ) {
69 if ( (*jetConstituent)->charge() == 0 )
continue;
72 if( (*jetConstituent)->gsfTrackRef().isNonnull() && (*jetConstituent)->gsfTrackRef().isAvailable() ) trackPt = (*jetConstituent)->gsfTrackRef()->pt();
73 else if ( (*jetConstituent)->trackRef().isNonnull() && (*jetConstituent)->trackRef().isAvailable() ) trackPt =(*jetConstituent)->trackRef()->pt();
74 else trackPt = (*jetConstituent)->pt();
76 if ( trackPt > minTrackPt ) {
80 double jetConstituentPt = (*jetConstituent)->pt();
81 if ( jetConstituent_isVtxAssociated ) {
83 <<
"associated track: Pt = " << (*jetConstituent)->pt() <<
", eta = " << (*jetConstituent)->eta() <<
", phi = " << (*jetConstituent)->phi() << std::endl
84 <<
" (vtxAssociationType = " << jetConstituent_vtxAssociationType <<
")" << std::endl;
86 trackSum_isVtxAssociated += jetConstituentPt;
89 <<
"unassociated track: Pt = " << (*jetConstituent)->pt() <<
", eta = " << (*jetConstituent)->eta() <<
", phi = " << (*jetConstituent)->phi() << std::endl
90 <<
" (vtxAssociationType = " << jetConstituent_vtxAssociationType <<
")" << std::endl;
92 trackSum_isNotVtxAssociated += jetConstituentPt;
97 double trackSum = trackSum_isVtxAssociated + trackSum_isNotVtxAssociated;
100 if (
std::abs(jet.
eta()) < 2.5 && trackSum > 5. ) {
101 jvf = trackSum_isVtxAssociated/trackSum;
105 <<
"trackSum: associated = " << trackSum_isVtxAssociated <<
", unassociated = " << trackSum_isNotVtxAssociated << std::endl
106 <<
" --> JVF = " << jvf << std::endl;
129 std::vector<double> jetIdDiscriminants;
130 std::vector<int> jetIdFlags;
132 size_t numJets = jets->size();
133 for (
size_t iJet = 0; iJet < numJets; ++iJet ) {
136 double jetJVF = computeJVF(*jet, *pfCandToVertexAssociations, *hardScatterVertex,
dZcut_,
minTrackPt_,
verbosity_ && jet->pt() > 20.);
137 jetIdDiscriminants.push_back(jetJVF);
140 if ( jetJVF >
JVFcut_ ) jetIdFlag = 255;
142 jetIdFlags.push_back(jetIdFlag);
145 auto jetIdDiscriminants_ptr = std::make_unique<edm::ValueMap<double>>();
147 jetIdDiscriminantFiller.insert(jets, jetIdDiscriminants.begin(), jetIdDiscriminants.end());
148 jetIdDiscriminantFiller.fill();
150 auto jetIdFlags_ptr = std::make_unique<edm::ValueMap<int>>();
152 jetIdFlagFiller.insert(jets, jetIdFlags.begin(), jetIdFlags.end());
153 jetIdFlagFiller.fill();
155 evt.
put(
std::move(jetIdDiscriminants_ptr),
"Discriminant");
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
virtual double phi() const final
momentum azimuthal angle
std::vector< Vertex > VertexCollection
collection of Vertex objects
Jets made from PFObjects.
std::vector< PFCandidatePtr > pfCandidates(const PFJet &jet, int particleId, bool sort=true)
edm::EDGetTokenT< PFCandToVertexAssMap > srcPFCandToVertexAssociations_
edm::EDGetTokenT< reco::PFCandidateCollection > srcPFCandidates_
JVFJetIdProducer(const edm::ParameterSet &)
Abs< T >::type abs(const T &t)
int isVertexAssociated(const reco::PFCandidatePtr &, const PFCandToVertexAssMap &, const reco::VertexCollection &, double)
edm::EDGetTokenT< reco::VertexCollection > srcHardScatterVertex_
edm::EDGetTokenT< reco::PFJetCollection > srcJets_
void produce(edm::Event &, const edm::EventSetup &)
virtual std::vector< reco::PFCandidatePtr > getPFConstituents() const
get all constituents
virtual double eta() const final
momentum pseudorapidity
virtual double pt() const final
transverse momentum