CMS 3D CMS Logo

List of all members | Public Member Functions | Private 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 Member Functions

 JetTracksAssociatorAtCaloFace ()
 

Private Attributes

double dR_
 
bool firstRun
 
JetTracksAssociationXtrpCalo mAssociator
 
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > mExtrapolations
 
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
 
edm::ESHandle< CaloGeometrypGeo
 

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() [1/2]

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

Definition at line 18 of file JetTracksAssociatorAtCaloFace.cc.

19  : firstRun(true), 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 }

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

◆ ~JetTracksAssociatorAtCaloFace()

JetTracksAssociatorAtCaloFace::~JetTracksAssociatorAtCaloFace ( )
inlineoverride

Definition at line 24 of file JetTracksAssociatorAtCaloFace.h.

24 {}

◆ JetTracksAssociatorAtCaloFace() [2/2]

JetTracksAssociatorAtCaloFace::JetTracksAssociatorAtCaloFace ( )
inlineprivate

Definition at line 29 of file JetTracksAssociatorAtCaloFace.h.

29 {}

Member Function Documentation

◆ produce()

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

Definition at line 27 of file JetTracksAssociatorAtCaloFace.cc.

27  {
28  // Get geometry
29  if (firstRun) {
30  fSetup.get<CaloGeometryRecord>().get(pGeo);
31  firstRun = false;
32  }
33 
34  if (!pGeo.isValid()) {
35  throw cms::Exception("InvalidInput") << "Did not get geometry" << std::endl;
36  }
37 
38  // get stuff from Event
40  fEvent.getByToken(mJets, jets_h);
42  fEvent.getByToken(mExtrapolations, extrapolations_h);
43 
44  auto jetTracks = std::make_unique<reco::JetTracksAssociation::Container>(reco::JetRefBaseProd(jets_h));
45 
46  // Check to make sure we have inputs
47  if (jets_h->empty()) {
48  // store output regardless the size of the inputs
50  return;
51  }
52  // Check to make sure the inputs are calo jets
53  reco::CaloJet const* caloJet0 = dynamic_cast<reco::CaloJet const*>(&(jets_h->at(0)));
54  // Disallowed non-CaloJet inputs
55  if (caloJet0 == nullptr) {
56  throw cms::Exception("InvalidInput") << " Jet-track association is only defined for CaloJets.";
57  }
58 
59  // format inputs
60  std::vector<edm::RefToBase<reco::Jet> > allJets;
61  allJets.reserve(jets_h->size());
62  for (unsigned i = 0; i < jets_h->size(); ++i)
63  allJets.push_back(jets_h->refAt(i));
64  mAssociator.produce(&*jetTracks, allJets, *extrapolations_h, *pGeo, dR_);
65 
66  // store output
68 }

References reco::JetExtendedAssociation::allJets(), dR_, Exception, hcaldqm::fEvent, firstRun, edm::EventSetup::get(), get, mps_fire::i, edm::ESHandleBase::isValid(), HLT_FULL_cff::jetTracks, mAssociator, mExtrapolations, mJets, eostools::move(), pGeo, and JetTracksAssociationXtrpCalo::produce().

Member Data Documentation

◆ dR_

double JetTracksAssociatorAtCaloFace::dR_
private

Definition at line 36 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

◆ firstRun

bool JetTracksAssociatorAtCaloFace::firstRun
private

Definition at line 35 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 32 of file JetTracksAssociatorAtCaloFace.h.

Referenced by JetTracksAssociatorAtCaloFace(), and produce().

◆ mJets

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

Definition at line 31 of file JetTracksAssociatorAtCaloFace.h.

Referenced by JetTracksAssociatorAtCaloFace(), and produce().

◆ pGeo

edm::ESHandle<CaloGeometry> JetTracksAssociatorAtCaloFace::pGeo
private

Definition at line 34 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

reco::CaloJet
Jets made from CaloTowers.
Definition: CaloJet.h:27
mps_fire.i
i
Definition: mps_fire.py:428
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm::Handle
Definition: AssociativeIterator.h:50
JetTracksAssociatorAtCaloFace::mAssociator
JetTracksAssociationXtrpCalo mAssociator
Definition: JetTracksAssociatorAtCaloFace.h:33
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
JetTracksAssociatorAtCaloFace::pGeo
edm::ESHandle< CaloGeometry > pGeo
Definition: JetTracksAssociatorAtCaloFace.h:34
HLT_FULL_cff.jetTracks
jetTracks
Definition: HLT_FULL_cff.py:50876
reco::JetExtendedAssociation::allJets
std::vector< reco::JetBaseRef > allJets(const Container &)
fill list of all jets associated with values. Return # of jets in the list
Definition: JetExtendedAssociation.cc:60
get
#define get
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
hcaldqm::fEvent
Definition: DQTask.h:32
JetTracksAssociatorAtCaloFace::firstRun
bool firstRun
Definition: JetTracksAssociatorAtCaloFace.h:35
eostools.move
def move(src, dest)
Definition: eostools.py:511
JetTracksAssociatorAtCaloFace::mExtrapolations
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > mExtrapolations
Definition: JetTracksAssociatorAtCaloFace.h:32
JetTracksAssociatorAtCaloFace::mJets
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
Definition: JetTracksAssociatorAtCaloFace.h:31
Exception
Definition: hltDiff.cc:245
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
JetTracksAssociatorAtCaloFace::dR_
double dR_
Definition: JetTracksAssociatorAtCaloFace.h:36
edm::InputTag
Definition: InputTag.h:15
JetTracksAssociationXtrpCalo::produce
void produce(Association *, JetRefs const &, std::vector< reco::TrackExtrapolation > const &, CaloGeometry const &, double dR)
Associates tracks to jets.
Definition: JetTracksAssociationXtrpCalo.cc:30
edm::RefToBaseProd
Definition: RefToBase.h:65