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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 21 of file JetTracksAssociatorAtCaloFace.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file JetTracksAssociatorAtCaloFace.cc.

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

22  : firstRun(true),
23  dR_(fConfig.getParameter<double>("coneSize"))
24 {
25  mJets = consumes<edm::View <reco::Jet> >(fConfig.getParameter<edm::InputTag> ("jets"));
26  mExtrapolations = consumes<std::vector<reco::TrackExtrapolation> >(fConfig.getParameter<edm::InputTag> ("extrapolations")),
27 
28  produces<reco::JetTracksAssociation::Container> ();
29 }
T getParameter(std::string const &) const
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > mExtrapolations
edm::EDGetTokenT< edm::View< reco::Jet > > mJets
JetTracksAssociatorAtCaloFace::~JetTracksAssociatorAtCaloFace ( )
inlineoverride

Definition at line 24 of file JetTracksAssociatorAtCaloFace.h.

References produce().

24 {}
JetTracksAssociatorAtCaloFace::JetTracksAssociatorAtCaloFace ( )
inlineprivate

Definition at line 30 of file JetTracksAssociatorAtCaloFace.h.

30 {}

Member Function Documentation

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

Definition at line 31 of file JetTracksAssociatorAtCaloFace.cc.

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

Referenced by ~JetTracksAssociatorAtCaloFace().

31  {
32 
33 
34  // Get geometry
35  if ( firstRun ) {
36  fSetup.get<CaloGeometryRecord>().get(pGeo);
37  firstRun = false;
38  }
39 
40  if ( !pGeo.isValid() ) {
41  throw cms::Exception("InvalidInput") << "Did not get geometry" << std::endl;
42  }
43 
44  // get stuff from Event
46  fEvent.getByToken (mJets, jets_h);
48  fEvent.getByToken (mExtrapolations, extrapolations_h);
49 
50  auto jetTracks = std::make_unique<reco::JetTracksAssociation::Container>(reco::JetRefBaseProd(jets_h));
51 
52  // Check to make sure we have inputs
53  if ( jets_h->empty() ){
54  // store output regardless the size of the inputs
55  fEvent.put(std::move(jetTracks));
56  return;
57  }
58  // Check to make sure the inputs are calo jets
59  reco::CaloJet const * caloJet0 = dynamic_cast<reco::CaloJet const *>( & (jets_h->at(0)) );
60  // Disallowed non-CaloJet inputs
61  if ( caloJet0 == nullptr ) {
62  throw cms::Exception("InvalidInput") << " Jet-track association is only defined for CaloJets.";
63  }
64 
65 
66  // format inputs
67  std::vector <edm::RefToBase<reco::Jet> > allJets;
68  allJets.reserve (jets_h->size());
69  for (unsigned i = 0; i < jets_h->size(); ++i) allJets.push_back (jets_h->refAt(i));
70  mAssociator.produce (&*jetTracks, allJets, *extrapolations_h, *pGeo, dR_ );
71 
72 
73  // store output
74  fEvent.put(std::move(jetTracks));
75 }
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:127
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
JetTracksAssociationXtrpCalo mAssociator
edm::ESHandle< CaloGeometry > pGeo
edm::RefToBaseProd< reco::Jet > JetRefBaseProd
Definition: JetCollection.h:14
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
const T & get() const
Definition: EventSetup.h:55
bool isValid() const
Definition: ESHandle.h:47
def move(src, dest)
Definition: eostools.py:510
edm::EDGetTokenT< edm::View< reco::Jet > > mJets

Member Data Documentation

double JetTracksAssociatorAtCaloFace::dR_
private

Definition at line 37 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

bool JetTracksAssociatorAtCaloFace::firstRun
private

Definition at line 36 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

JetTracksAssociationXtrpCalo JetTracksAssociatorAtCaloFace::mAssociator
private

Definition at line 34 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().

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

Definition at line 33 of file JetTracksAssociatorAtCaloFace.h.

Referenced by JetTracksAssociatorAtCaloFace(), and produce().

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

Definition at line 32 of file JetTracksAssociatorAtCaloFace.h.

Referenced by JetTracksAssociatorAtCaloFace(), and produce().

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

Definition at line 35 of file JetTracksAssociatorAtCaloFace.h.

Referenced by produce().