CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
JVFJetIdProducer Class Reference

#include <JVFJetIdProducer.h>

Inheritance diagram for JVFJetIdProducer:
edm::stream::EDProducer<>

Public Member Functions

 JVFJetIdProducer (const edm::ParameterSet &)
 
 ~JVFJetIdProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

double dZcut_
 
double JVFcut_
 
double minTrackPt_
 
int neutralJetOption_
 
edm::EDGetTokenT< reco::VertexCollectionsrcHardScatterVertex_
 
edm::EDGetTokenT< reco::PFJetCollectionsrcJets_
 
edm::EDGetTokenT< reco::PFCandidateCollectionsrcPFCandidates_
 
edm::EDGetTokenT< PFCandToVertexAssMapsrcPFCandToVertexAssociations_
 
int verbosity_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Discriminate jets originating from the hard-scatter event from pile-up jets, based on the fraction of tracks within the jet that are associated to the hard-scatter vertex. Jets outside the tracking acceptance are considered to originate from the hard-scatter event per default. Optionally, they can be classified as pile-up.

Authors
Christian Veelken, LLR

Definition at line 25 of file JVFJetIdProducer.h.

Constructor & Destructor Documentation

◆ JVFJetIdProducer()

JVFJetIdProducer::JVFJetIdProducer ( const edm::ParameterSet cfg)

Definition at line 21 of file JVFJetIdProducer.cc.

21  {
22  srcJets_ = consumes<reco::PFJetCollection>(cfg.getParameter<edm::InputTag>("srcJets"));
23 
24  srcPFCandidates_ = consumes<reco::PFCandidateCollection>(cfg.getParameter<edm::InputTag>("srcPFCandidates"));
26  consumes<PFCandToVertexAssMap>(cfg.getParameter<edm::InputTag>("srcPFCandToVertexAssociations"));
27  srcHardScatterVertex_ = consumes<reco::VertexCollection>(cfg.getParameter<edm::InputTag>("srcHardScatterVertex"));
28  minTrackPt_ = cfg.getParameter<double>("minTrackPt");
29  dZcut_ = cfg.getParameter<double>("dZcut");
30 
31  JVFcut_ = cfg.getParameter<double>("JVFcut");
32 
33  std::string neutralJetOption_string = cfg.getParameter<std::string>("neutralJetOption");
34  if (neutralJetOption_string == "PU")
36  else if (neutralJetOption_string == "noPU")
38  else
39  throw cms::Exception("JVFJetIdProducer")
40  << "Invalid Configuration Parameter 'neutralJetOption' = " << neutralJetOption_string << " !!\n";
41 
42  verbosity_ = (cfg.exists("verbosity")) ? cfg.getParameter<int>("verbosity") : 0;
43 
44  produces<edm::ValueMap<double>>("Discriminant");
45  produces<edm::ValueMap<int>>("Id");
46 }

References looper::cfg, dZcut_, Exception, JVFcut_, kNeutralJetNoPU, kNeutralJetPU, minTrackPt_, neutralJetOption_, srcHardScatterVertex_, srcJets_, srcPFCandidates_, srcPFCandToVertexAssociations_, AlCaHLTBitMon_QueryRunRegistry::string, and verbosity_.

◆ ~JVFJetIdProducer()

JVFJetIdProducer::~JVFJetIdProducer ( )
override

Definition at line 48 of file JVFJetIdProducer.cc.

48  {
49  // nothing to be done yet...
50 }

Member Function Documentation

◆ produce()

void JVFJetIdProducer::produce ( edm::Event evt,
const edm::EventSetup es 
)
overrideprivate

Definition at line 120 of file JVFJetIdProducer.cc.

120  {
121  // get jets
123  evt.getByToken(srcJets_, jets);
124 
125  // get PFCandidates
128 
129  // get PFCandidate-to-vertex associations and "the" hard-scatter vertex
130  edm::Handle<PFCandToVertexAssMap> pfCandToVertexAssociations;
131  evt.getByToken(srcPFCandToVertexAssociations_, pfCandToVertexAssociations);
132 
133  edm::Handle<reco::VertexCollection> hardScatterVertex;
134  evt.getByToken(srcHardScatterVertex_, hardScatterVertex);
135 
136  std::vector<double> jetIdDiscriminants;
137  std::vector<int> jetIdFlags;
138 
139  size_t numJets = jets->size();
140  for (size_t iJet = 0; iJet < numJets; ++iJet) {
141  reco::PFJetRef jet(jets, iJet);
142 
143  double jetJVF = computeJVF(
144  *jet, *pfCandToVertexAssociations, *hardScatterVertex, dZcut_, minTrackPt_, verbosity_ && jet->pt() > 20.);
145  jetIdDiscriminants.push_back(jetJVF);
146 
147  int jetIdFlag = 0;
148  if (jetJVF > JVFcut_)
149  jetIdFlag = 255;
150  else if (jetJVF < -0.5 && neutralJetOption_ == kNeutralJetNoPU)
151  jetIdFlag = 255;
152  jetIdFlags.push_back(jetIdFlag);
153  }
154 
155  auto jetIdDiscriminants_ptr = std::make_unique<edm::ValueMap<double>>();
156  edm::ValueMap<double>::Filler jetIdDiscriminantFiller(*jetIdDiscriminants_ptr);
157  jetIdDiscriminantFiller.insert(jets, jetIdDiscriminants.begin(), jetIdDiscriminants.end());
158  jetIdDiscriminantFiller.fill();
159 
160  auto jetIdFlags_ptr = std::make_unique<edm::ValueMap<int>>();
161  edm::ValueMap<int>::Filler jetIdFlagFiller(*jetIdFlags_ptr);
162  jetIdFlagFiller.insert(jets, jetIdFlags.begin(), jetIdFlags.end());
163  jetIdFlagFiller.fill();
164 
165  evt.put(std::move(jetIdDiscriminants_ptr), "Discriminant");
166  evt.put(std::move(jetIdFlags_ptr), "Id");
167 }

References dZcut_, edm::Event::getByToken(), metsig::jet, singleTopDQM_cfi::jets, JVFcut_, kNeutralJetNoPU, minTrackPt_, eostools::move(), neutralJetOption_, zmumugammaAnalyzer_cfi::pfCandidates, edm::Event::put(), srcHardScatterVertex_, srcJets_, srcPFCandidates_, srcPFCandToVertexAssociations_, and verbosity_.

Member Data Documentation

◆ dZcut_

double JVFJetIdProducer::dZcut_
private

Definition at line 39 of file JVFJetIdProducer.h.

Referenced by JVFJetIdProducer(), and produce().

◆ JVFcut_

double JVFJetIdProducer::JVFcut_
private

Definition at line 41 of file JVFJetIdProducer.h.

Referenced by JVFJetIdProducer(), and produce().

◆ minTrackPt_

double JVFJetIdProducer::minTrackPt_
private

Definition at line 38 of file JVFJetIdProducer.h.

Referenced by JVFJetIdProducer(), and produce().

◆ neutralJetOption_

int JVFJetIdProducer::neutralJetOption_
private

Definition at line 43 of file JVFJetIdProducer.h.

Referenced by JVFJetIdProducer(), and produce().

◆ srcHardScatterVertex_

edm::EDGetTokenT<reco::VertexCollection> JVFJetIdProducer::srcHardScatterVertex_
private

Definition at line 37 of file JVFJetIdProducer.h.

Referenced by JVFJetIdProducer(), and produce().

◆ srcJets_

edm::EDGetTokenT<reco::PFJetCollection> JVFJetIdProducer::srcJets_
private

Definition at line 33 of file JVFJetIdProducer.h.

Referenced by JVFJetIdProducer(), and produce().

◆ srcPFCandidates_

edm::EDGetTokenT<reco::PFCandidateCollection> JVFJetIdProducer::srcPFCandidates_
private

Definition at line 35 of file JVFJetIdProducer.h.

Referenced by JVFJetIdProducer(), and produce().

◆ srcPFCandToVertexAssociations_

edm::EDGetTokenT<PFCandToVertexAssMap> JVFJetIdProducer::srcPFCandToVertexAssociations_
private

Definition at line 36 of file JVFJetIdProducer.h.

Referenced by JVFJetIdProducer(), and produce().

◆ verbosity_

int JVFJetIdProducer::verbosity_
private

Definition at line 45 of file JVFJetIdProducer.h.

Referenced by JVFJetIdProducer(), and produce().

kNeutralJetPU
Definition: JVFJetIdProducer.cc:19
zmumugammaAnalyzer_cfi.pfCandidates
pfCandidates
Definition: zmumugammaAnalyzer_cfi.py:11
JVFJetIdProducer::srcPFCandToVertexAssociations_
edm::EDGetTokenT< PFCandToVertexAssMap > srcPFCandToVertexAssociations_
Definition: JVFJetIdProducer.h:36
kNeutralJetNoPU
Definition: JVFJetIdProducer.cc:19
JVFJetIdProducer::minTrackPt_
double minTrackPt_
Definition: JVFJetIdProducer.h:38
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
JVFJetIdProducer::dZcut_
double dZcut_
Definition: JVFJetIdProducer.h:39
edm::Handle< reco::PFJetCollection >
JVFJetIdProducer::JVFcut_
double JVFcut_
Definition: JVFJetIdProducer.h:41
JVFJetIdProducer::srcPFCandidates_
edm::EDGetTokenT< reco::PFCandidateCollection > srcPFCandidates_
Definition: JVFJetIdProducer.h:35
edm::Ref< PFJetCollection >
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
looper.cfg
cfg
Definition: looper.py:296
JVFJetIdProducer::verbosity_
int verbosity_
Definition: JVFJetIdProducer.h:45
eostools.move
def move(src, dest)
Definition: eostools.py:511
metsig::jet
Definition: SignAlgoResolutions.h:47
Exception
Definition: hltDiff.cc:245
JVFJetIdProducer::neutralJetOption_
int neutralJetOption_
Definition: JVFJetIdProducer.h:43
JVFJetIdProducer::srcHardScatterVertex_
edm::EDGetTokenT< reco::VertexCollection > srcHardScatterVertex_
Definition: JVFJetIdProducer.h:37
edm::helper::Filler
Definition: ValueMap.h:22
edm::InputTag
Definition: InputTag.h:15
JVFJetIdProducer::srcJets_
edm::EDGetTokenT< reco::PFJetCollection > srcJets_
Definition: JVFJetIdProducer.h:33