CMS 3D CMS Logo

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

#include <JetTracksAssociatorAtVertex.h>

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

Public Member Functions

 JetTracksAssociatorAtVertex (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~JetTracksAssociatorAtVertex () 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 Attributes

JetTracksAssociationDRVertex mAssociator
 
JetTracksAssociationDRVertexAssigned mAssociatorAssigned
 
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
 
int mTrackQuality
 
edm::EDGetTokenT< reco::TrackCollectionmTracks
 
edm::EDGetTokenT< reco::VertexCollectionpvSrc
 if true, use the track/jet association with vertex assignment to tracks More...
 
bool useAssigned
 

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

Definition at line 19 of file JetTracksAssociatorAtVertex.h.

Constructor & Destructor Documentation

◆ JetTracksAssociatorAtVertex()

JetTracksAssociatorAtVertex::JetTracksAssociatorAtVertex ( const edm::ParameterSet fConfig)

Definition at line 18 of file JetTracksAssociatorAtVertex.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), mJets, mTracks, pvSrc, and useAssigned.

19  : mAssociator(fConfig.getParameter<double>("coneSize")),
20  mAssociatorAssigned(fConfig.getParameter<double>("coneSize")),
21  useAssigned(false),
22  pvSrc() {
23  mJets = consumes<edm::View<reco::Jet> >(fConfig.getParameter<edm::InputTag>("jets"));
24  mTracks = consumes<reco::TrackCollection>(fConfig.getParameter<edm::InputTag>("tracks"));
25  if (fConfig.exists("useAssigned")) {
26  useAssigned = fConfig.getParameter<bool>("useAssigned");
27  pvSrc = consumes<reco::VertexCollection>(fConfig.getParameter<edm::InputTag>("pvSrc"));
28  }
29 
30  produces<reco::JetTracksAssociation::Container>();
31 }
edm::EDGetTokenT< reco::TrackCollection > mTracks
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool exists(std::string const &parameterName) const
checks if a parameter exists
edm::EDGetTokenT< reco::VertexCollection > pvSrc
if true, use the track/jet association with vertex assignment to tracks
JetTracksAssociationDRVertexAssigned mAssociatorAssigned
JetTracksAssociationDRVertex mAssociator
edm::EDGetTokenT< edm::View< reco::Jet > > mJets

◆ ~JetTracksAssociatorAtVertex()

JetTracksAssociatorAtVertex::~JetTracksAssociatorAtVertex ( )
override

Definition at line 33 of file JetTracksAssociatorAtVertex.cc.

33 {}

Member Function Documentation

◆ produce()

void JetTracksAssociatorAtVertex::produce ( edm::Event fEvent,
const edm::EventSetup fSetup 
)
override

Definition at line 35 of file JetTracksAssociatorAtVertex.cc.

References reco::JetExtendedAssociation::allJets(), muonTagProbeFilters_cff::allTracks, hcaldqm::fEvent, mps_fire::i, HLT_2022v15_cff::jetTracks, mAssociator, mAssociatorAssigned, mJets, eostools::move(), mTracks, JetTracksAssociationDRVertex::produce(), JetTracksAssociationDRVertexAssigned::produce(), edm::Handle< T >::product(), pvSrc, useAssigned, and AlignmentTracksFromVertexSelector_cfi::vertices.

35  {
37  fEvent.getByToken(mJets, jets_h);
39  fEvent.getByToken(mTracks, tracks_h);
40 
41  auto jetTracks = std::make_unique<reco::JetTracksAssociation::Container>(reco::JetRefBaseProd(jets_h));
42 
43  // format inputs
44  std::vector<edm::RefToBase<reco::Jet> > allJets;
45  allJets.reserve(jets_h->size());
46  for (unsigned i = 0; i < jets_h->size(); ++i)
47  allJets.push_back(jets_h->refAt(i));
48  std::vector<reco::TrackRef> allTracks;
49  allTracks.reserve(tracks_h->size());
50  // run algo
51  for (unsigned i = 0; i < tracks_h->size(); ++i) {
52  allTracks.push_back(reco::TrackRef(tracks_h, i));
53  }
54  if (!useAssigned) {
56  } else {
58  fEvent.getByToken(pvSrc, pvHandle);
59  const reco::VertexCollection& vertices = *pvHandle.product();
61  }
62 
63  // store output
65 }
std::vector< reco::JetBaseRef > allJets(const Container &)
fill list of all jets associated with values. Return # of jets in the list
edm::EDGetTokenT< reco::TrackCollection > mTracks
T const * product() const
Definition: Handle.h:70
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::RefToBaseProd< reco::Jet > JetRefBaseProd
Definition: JetCollection.h:13
edm::EDGetTokenT< reco::VertexCollection > pvSrc
if true, use the track/jet association with vertex assignment to tracks
JetTracksAssociationDRVertexAssigned mAssociatorAssigned
JetTracksAssociationDRVertex mAssociator
void produce(reco::JetTracksAssociation::Container *fAssociation, const std::vector< edm::RefToBase< reco::Jet > > &fJets, const std::vector< reco::TrackRef > &fTracks) const
void produce(reco::JetTracksAssociation::Container *fAssociation, const std::vector< edm::RefToBase< reco::Jet > > &fJets, const std::vector< reco::TrackRef > &fTracks, const reco::VertexCollection &vertices) const
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ mAssociator

JetTracksAssociationDRVertex JetTracksAssociatorAtVertex::mAssociator
private

Definition at line 31 of file JetTracksAssociatorAtVertex.h.

Referenced by produce().

◆ mAssociatorAssigned

JetTracksAssociationDRVertexAssigned JetTracksAssociatorAtVertex::mAssociatorAssigned
private

Definition at line 32 of file JetTracksAssociatorAtVertex.h.

Referenced by produce().

◆ mJets

edm::EDGetTokenT<edm::View<reco::Jet> > JetTracksAssociatorAtVertex::mJets
private

Definition at line 27 of file JetTracksAssociatorAtVertex.h.

Referenced by JetTracksAssociatorAtVertex(), and produce().

◆ mTrackQuality

int JetTracksAssociatorAtVertex::mTrackQuality
private

Definition at line 30 of file JetTracksAssociatorAtVertex.h.

◆ mTracks

edm::EDGetTokenT<reco::TrackCollection> JetTracksAssociatorAtVertex::mTracks
private

Definition at line 28 of file JetTracksAssociatorAtVertex.h.

Referenced by JetTracksAssociatorAtVertex(), and produce().

◆ pvSrc

edm::EDGetTokenT<reco::VertexCollection> JetTracksAssociatorAtVertex::pvSrc
private

if true, use the track/jet association with vertex assignment to tracks

Definition at line 34 of file JetTracksAssociatorAtVertex.h.

Referenced by JetTracksAssociatorAtVertex(), and produce().

◆ useAssigned

bool JetTracksAssociatorAtVertex::useAssigned
private

Definition at line 33 of file JetTracksAssociatorAtVertex.h.

Referenced by JetTracksAssociatorAtVertex(), and produce().