CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
CaloGeometryRecord
mGeometry
 
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 ( 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 }
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > mGeometry
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > mExtrapolations
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
JetTracksAssociatorAtCaloFace::~JetTracksAssociatorAtCaloFace ( )
inlineoverride

Definition at line 24 of file JetTracksAssociatorAtCaloFace.h.

24 {}

Member Function Documentation

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, edm::Event::getByToken(), edm::EventSetup::getData(), mps_fire::i, HLT_FULL_cff::jetTracks, mAssociator, mExtrapolations, mGeometry, mJets, eostools::move(), JetTracksAssociationXtrpCalo::produce(), and edm::Event::put().

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
42  fEvent.put(std::move(jetTracks));
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
60  fEvent.put(std::move(jetTracks));
61 }
std::vector< reco::JetBaseRef > allJets(const Container &)
fill list of all jets associated with values. Return # of jets in the list
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
Jets made from CaloTowers.
Definition: CaloJet.h:27
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > mGeometry
JetTracksAssociationXtrpCalo mAssociator
bool getData(T &iHolder) const
Definition: EventSetup.h:122
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.
def move
Definition: eostools.py:511
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > mExtrapolations

Member Data Documentation

double JetTracksAssociatorAtCaloFace::dR_
private

Definition at line 34 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

JetTracksAssociationXtrpCalo JetTracksAssociatorAtCaloFace::mAssociator
private

Definition at line 33 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

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

Definition at line 30 of file JetTracksAssociatorAtCaloFace.h.

Referenced by JetTracksAssociatorAtCaloFace(), and produce().

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

Definition at line 31 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

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

Definition at line 29 of file JetTracksAssociatorAtCaloFace.h.

Referenced by JetTracksAssociatorAtCaloFace(), and produce().