CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~JetTracksAssociatorAtCaloFace ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
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
virtual JetTracksAssociatorAtCaloFace::~JetTracksAssociatorAtCaloFace ( )
inlinevirtual

Definition at line 24 of file JetTracksAssociatorAtCaloFace.h.

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 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 31 of file JetTracksAssociatorAtCaloFace.cc.

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

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  // Check to make sure we have inputs
51  if ( jets_h->size() == 0 ) return;
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 == 0 ) {
56  throw cms::Exception("InvalidInput") << " Jet-track association is only defined for CaloJets.";
57  }
58 
59  std::auto_ptr<reco::JetTracksAssociation::Container> jetTracks (new reco::JetTracksAssociation::Container (reco::JetRefBaseProd(jets_h)));
60 
61 
62  // format inputs
63  std::vector <edm::RefToBase<reco::Jet> > allJets;
64  allJets.reserve (jets_h->size());
65  for (unsigned i = 0; i < jets_h->size(); ++i) allJets.push_back (jets_h->refAt(i));
66  mAssociator.produce (&*jetTracks, allJets, *extrapolations_h, *pGeo, dR_ );
67 
68 
69  // store output
70  fEvent.put (jetTracks);
71 }
std::vector< reco::JetBaseRef > allJets(const Container &)
fill list of all jets associated with values. Return # of jets in the list
int i
Definition: DBlmapReader.cc:9
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
JetTracksAssociationXtrpCalo mAssociator
edm::ESHandle< CaloGeometry > pGeo
void produce(Association *, JetRefs const &, std::vector< reco::TrackExtrapolation > const &, CaloGeometry const &, double dR)
Associates tracks to jets.
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
edm::EDGetTokenT< std::vector< reco::TrackExtrapolation > > mExtrapolations
const T & get() const
Definition: EventSetup.h:56
bool isValid() const
Definition: ESHandle.h:47
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().