37 <<
"Invalid Configuration Parameter 'neutralJetOption' = " << neutralJetOption_string <<
" !!\n";
42 produces<edm::ValueMap<double> >(
"Discriminant");
43 produces<edm::ValueMap<int> >(
"Id");
59 <<
"<computeJVF>:" << std::endl
60 <<
" jet: Pt = " << jet.
pt() <<
", eta = " << jet.
eta() <<
", phi = " << jet.
phi() << std::endl;
62 double trackSum_isVtxAssociated = 0.;
63 double trackSum_isNotVtxAssociated = 0.;
66 for ( std::vector<reco::PFCandidatePtr>::const_iterator jetConstituent = pfConsts.begin(); jetConstituent != pfConsts.end(); ++jetConstituent ) {
68 if ( (*jetConstituent)->charge() != 0 ) {
70 if ( (*jetConstituent)->gsfTrackRef().isNonnull() && (*jetConstituent)->gsfTrackRef().isAvailable() ) trackPt = (*jetConstituent)->gsfTrackRef()->pt();
71 else if ( (*jetConstituent)->trackRef().isNonnull() && (*jetConstituent)->trackRef().isAvailable() ) trackPt = (*jetConstituent)->trackRef()->pt();
72 else trackPt = (*jetConstituent)->pt();
74 if ( trackPt > minTrackPt ) {
75 int jetConstituent_vtxAssociationType =
isVertexAssociated( (*jetConstituent), pfCandToVertexAssociations, vertices, dZ);
77 double jetConstituentPt = (*jetConstituent)->pt();
78 if ( jetConstituent_isVtxAssociated ) {
80 <<
"associated track: Pt = " << (*jetConstituent)->pt() <<
", eta = " << (*jetConstituent)->eta() <<
", phi = " << (*jetConstituent)->phi() << std::endl
81 <<
" (vtxAssociationType = " << jetConstituent_vtxAssociationType <<
")" << std::endl;
83 trackSum_isVtxAssociated += jetConstituentPt;
86 <<
"unassociated track: Pt = " << (*jetConstituent)->pt() <<
", eta = " << (*jetConstituent)->eta() <<
", phi = " << (*jetConstituent)->phi() << std::endl
87 <<
" (vtxAssociationType = " << jetConstituent_vtxAssociationType <<
")" << std::endl;
89 trackSum_isNotVtxAssociated += jetConstituentPt;
95 double trackSum = trackSum_isVtxAssociated + trackSum_isNotVtxAssociated;
99 jvf = trackSum_isVtxAssociated/trackSum;
103 <<
"trackSum: associated = " << trackSum_isVtxAssociated <<
", unassociated = " << trackSum_isNotVtxAssociated << std::endl
104 <<
" --> JVF = " << jvf << std::endl;
127 std::vector<double> jetIdDiscriminants;
128 std::vector<int> jetIdFlags;
130 size_t numJets = jets->size();
131 for (
size_t iJet = 0; iJet < numJets; ++iJet ) {
134 double jetJVF = computeJVF(*jet, *pfCandToVertexAssociations, *hardScatterVertex,
dZcut_,
minTrackPt_,
verbosity_ && jet->pt() > 20.);
135 jetIdDiscriminants.push_back(jetJVF);
138 if ( jetJVF >
JVFcut_ ) jetIdFlag = 255;
140 jetIdFlags.push_back(jetIdFlag);
145 jetIdDiscriminantFiller.
insert(jets, jetIdDiscriminants.begin(), jetIdDiscriminants.end());
146 jetIdDiscriminantFiller.
fill();
150 jetIdFlagFiller.
insert(jets, jetIdFlags.begin(), jetIdFlags.end());
151 jetIdFlagFiller.
fill();
153 evt.
put(jetIdDiscriminants_ptr,
"Discriminant");
154 evt.
put(jetIdFlags_ptr,
"Id");
T getParameter(std::string const &) const
virtual float pt() const
transverse momentum
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual float phi() const
momentum azimuthal angle
void insert(const H &h, I begin, I end)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
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_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< reco::PFCandidateCollection > srcPFCandidates_
virtual float eta() const
momentum pseudorapidity
JVFJetIdProducer(const edm::ParameterSet &)
Abs< T >::type abs(const T &t)
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