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
TrackAssociatorEDProducer Class Reference
Inheritance diagram for TrackAssociatorEDProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TrackAssociatorEDProducer (const edm::ParameterSet &)
 
 ~TrackAssociatorEDProducer ()
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 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

virtual void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 

Private Attributes

edm::EDGetTokenT
< reco::TrackToTrackingParticleAssociator
associatorToken_
 
bool theIgnoremissingtrackcollection
 
edm::EDGetTokenT
< TrackingParticleCollection
TPCollectionToken_
 
edm::EDGetTokenT< edm::View
< reco::Track > > 
trackCollectionToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 35 of file TrackAssociatorEDProducer.cc.

Constructor & Destructor Documentation

TrackAssociatorEDProducer::TrackAssociatorEDProducer ( const edm::ParameterSet pset)
explicit

Definition at line 51 of file TrackAssociatorEDProducer.cc.

References associatorToken_, edm::ParameterSet::getParameter(), TPCollectionToken_, and trackCollectionToken_.

51  :
52  theIgnoremissingtrackcollection(pset.getUntrackedParameter<bool>("ignoremissingtrackcollection",false))
53 {
54  produces<reco::SimToRecoCollection>();
55  produces<reco::RecoToSimCollection>();
56 
57  TPCollectionToken_ = consumes<TrackingParticleCollection>(pset.getParameter< edm::InputTag >("label_tp"));
58  trackCollectionToken_ = consumes<edm::View<reco::Track> >(pset.getParameter< edm::InputTag >("label_tr"));
59  associatorToken_ = consumes<reco::TrackToTrackingParticleAssociator>(pset.getParameter<edm::InputTag>("associator") );
60 
61 }
edm::EDGetTokenT< edm::View< reco::Track > > trackCollectionToken_
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > associatorToken_
edm::EDGetTokenT< TrackingParticleCollection > TPCollectionToken_
TrackAssociatorEDProducer::~TrackAssociatorEDProducer ( )

Definition at line 64 of file TrackAssociatorEDProducer.cc.

64  {
65 
66 }

Member Function Documentation

void TrackAssociatorEDProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 75 of file TrackAssociatorEDProducer.cc.

References associatorToken_, edm::Event::getByToken(), LogTrace, edm::Event::put(), theIgnoremissingtrackcollection, ecalTPGAnalyzer_cfg::TPCollection, TPCollectionToken_, HLT_25ns14e33_v3_cff::trackCollection, and trackCollectionToken_.

75  {
76  using namespace edm;
77 
79  iEvent.getByToken(associatorToken_,theAssociator);
80 
83 
85  bool trackAvailable = iEvent.getByToken(trackCollectionToken_, trackCollection );
86 
87  std::auto_ptr<reco::RecoToSimCollection> rts;
88  std::auto_ptr<reco::SimToRecoCollection> str;
89 
90  if (theIgnoremissingtrackcollection && !trackAvailable){
91  //the track collection is not in the event and we're being told to ignore this.
92  //do not output anything to the event, other wise this would be considered as inefficiency.
93  } else {
94  //associate tracks
95  LogTrace("TrackValidator") << "Calling associateRecoToSim method" << "\n";
96  reco::RecoToSimCollection recSimColl=theAssociator->associateRecoToSim(trackCollection,
97  TPCollection);
98 
99  LogTrace("TrackValidator") << "Calling associateSimToReco method" << "\n";
100  reco::SimToRecoCollection simRecColl=theAssociator->associateSimToReco(trackCollection,
101  TPCollection);
102 
103  rts.reset(new reco::RecoToSimCollection(recSimColl));
104  str.reset(new reco::SimToRecoCollection(simRecColl));
105 
106  iEvent.put(rts);
107  iEvent.put(str);
108  }
109 }
edm::EDGetTokenT< edm::View< reco::Track > > trackCollectionToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
#define LogTrace(id)
edm::EDGetTokenT< reco::TrackToTrackingParticleAssociator > associatorToken_
edm::EDGetTokenT< TrackingParticleCollection > TPCollectionToken_

Member Data Documentation

edm::EDGetTokenT<reco::TrackToTrackingParticleAssociator> TrackAssociatorEDProducer::associatorToken_
private

Definition at line 47 of file TrackAssociatorEDProducer.cc.

Referenced by produce(), and TrackAssociatorEDProducer().

bool TrackAssociatorEDProducer::theIgnoremissingtrackcollection
private

Definition at line 43 of file TrackAssociatorEDProducer.cc.

Referenced by produce().

edm::EDGetTokenT<TrackingParticleCollection> TrackAssociatorEDProducer::TPCollectionToken_
private

Definition at line 45 of file TrackAssociatorEDProducer.cc.

Referenced by produce(), and TrackAssociatorEDProducer().

edm::EDGetTokenT<edm::View<reco::Track> > TrackAssociatorEDProducer::trackCollectionToken_
private

Definition at line 46 of file TrackAssociatorEDProducer.cc.

Referenced by produce(), and TrackAssociatorEDProducer().