CMS 3D CMS Logo

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

#include <JetTracksAssociatorAtCaloFace.h>

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

Public Member Functions

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

double dR_
 
JetTracksAssociationXtrpCalo mAssociator
 
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > mExtrapolations
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordmGeometry
 
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
 

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 21 of file JetTracksAssociatorAtCaloFace.h.

Constructor & Destructor Documentation

◆ JetTracksAssociatorAtCaloFace()

JetTracksAssociatorAtCaloFace::JetTracksAssociatorAtCaloFace ( const edm::ParameterSet fConfig)

Definition at line 18 of file JetTracksAssociatorAtCaloFace.cc.

References edm::ParameterSet::getParameter(), mExtrapolations, and mJets.

19  : mGeometry(esConsumes()), dR_(fConfig.getParameter<double>("coneSize")) {
20  mJets = consumes<edm::View<reco::Jet> >(fConfig.getParameter<edm::InputTag>("jets"));
22  consumes<std::vector<reco::TrackExtrapolation> >(fConfig.getParameter<edm::InputTag>("extrapolations")),
23 
24  produces<reco::JetTracksAssociation::Container>();
25 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > mGeometry
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > mExtrapolations

◆ ~JetTracksAssociatorAtCaloFace()

JetTracksAssociatorAtCaloFace::~JetTracksAssociatorAtCaloFace ( )
inlineoverride

Definition at line 24 of file JetTracksAssociatorAtCaloFace.h.

24 {}

Member Function Documentation

◆ produce()

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

Definition at line 27 of file JetTracksAssociatorAtCaloFace.cc.

References reco::JetExtendedAssociation::allJets(), runTheMatrix::const, dR_, Exception, hcaldqm::fEvent, edm::EventSetup::getData(), mps_fire::i, HLT_2024v12_cff::jetTracks, mAssociator, mExtrapolations, mGeometry, mJets, eostools::move(), and JetTracksAssociationXtrpCalo::produce().

27  {
28  // Get geometry
29  auto const& geo = fSetup.getData(mGeometry);
30 
31  // get stuff from Event
33  fEvent.getByToken(mJets, jets_h);
35  fEvent.getByToken(mExtrapolations, extrapolations_h);
36 
37  auto jetTracks = std::make_unique<reco::JetTracksAssociation::Container>(reco::JetRefBaseProd(jets_h));
38 
39  // Check to make sure we have inputs
40  if (jets_h->empty()) {
41  // store output regardless the size of the inputs
43  return;
44  }
45  // Check to make sure the inputs are calo jets
46  reco::CaloJet const* caloJet0 = dynamic_cast<reco::CaloJet const*>(&(jets_h->at(0)));
47  // Disallowed non-CaloJet inputs
48  if (caloJet0 == nullptr) {
49  throw cms::Exception("InvalidInput") << " Jet-track association is only defined for CaloJets.";
50  }
51 
52  // format inputs
53  std::vector<edm::RefToBase<reco::Jet> > allJets;
54  allJets.reserve(jets_h->size());
55  for (unsigned i = 0; i < jets_h->size(); ++i)
56  allJets.push_back(jets_h->refAt(i));
57  mAssociator.produce(&*jetTracks, allJets, *extrapolations_h, geo, dR_);
58 
59  // store output
61 }
std::vector< reco::JetBaseRef > allJets(const Container &)
fill list of all jets associated with values. Return # of jets in the list
Jets made from CaloTowers.
Definition: CaloJet.h:27
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > mGeometry
JetTracksAssociationXtrpCalo mAssociator
edm::RefToBaseProd< reco::Jet > JetRefBaseProd
Definition: JetCollection.h:13
void produce(Association *, JetRefs const &, std::vector< reco::TrackExtrapolation > const &, CaloGeometry const &, double dR)
Associates tracks to jets.
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > mExtrapolations
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ dR_

double JetTracksAssociatorAtCaloFace::dR_
private

Definition at line 34 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

◆ mAssociator

JetTracksAssociationXtrpCalo JetTracksAssociatorAtCaloFace::mAssociator
private

Definition at line 33 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

◆ mExtrapolations

edm::EDGetTokenT<std::vector<reco::TrackExtrapolation> > JetTracksAssociatorAtCaloFace::mExtrapolations
private

Definition at line 30 of file JetTracksAssociatorAtCaloFace.h.

Referenced by JetTracksAssociatorAtCaloFace(), and produce().

◆ mGeometry

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> JetTracksAssociatorAtCaloFace::mGeometry
private

Definition at line 31 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

◆ mJets

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

Definition at line 29 of file JetTracksAssociatorAtCaloFace.h.

Referenced by JetTracksAssociatorAtCaloFace(), and produce().