CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TrackAssociatorByHitsProducer Class Reference

#include <SimTracker/TrackAssociatorProducers/plugins/TrackAssociatorByHitsProducer.cc>

Inheritance diagram for TrackAssociatorByHitsProducer:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TrackAssociatorByHitsProducer (const edm::ParameterSet &)
 
 ~TrackAssociatorByHitsProducer ()
 
- 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
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 (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &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 ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

const bool AbsoluteNumberOfHits
 
const double cut_RecoToSim
 
const double purity_SimToReco
 
const double quality_SimToReco
 
edm::EDGetTokenT
< SimHitTPAssociationList
simHitTpMapToken_
 
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
 
const bool ThreeHitTracksAreSpecial
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
const bool UseGrouped
 
const bool UsePixels
 
const bool UseSplitting
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 49 of file TrackAssociatorByHitsProducer.cc.

Constructor & Destructor Documentation

TrackAssociatorByHitsProducer::TrackAssociatorByHitsProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 87 of file TrackAssociatorByHitsProducer.cc.

References TrackAssociatorByHitsImpl::denomnone, TrackAssociatorByHitsImpl::denomreco, TrackAssociatorByHitsImpl::denomsim, Exception, edm::ParameterSet::getParameter(), SimToRecoDenominator, AlCaHLTBitMon_QueryRunRegistry::string, and tmp.

87  :
89  simHitTpMapToken_(consumes<SimHitTPAssociationList>(iConfig.getParameter<edm::InputTag>("simHitTpMapTag"))),
91  quality_SimToReco(iConfig.getParameter<double>("Quality_SimToReco")),
92  purity_SimToReco(iConfig.getParameter<double>("Purity_SimToReco")),
93  cut_RecoToSim(iConfig.getParameter<double>("Cut_RecoToSim")),
94  UsePixels(iConfig.getParameter<bool>("UsePixels")),
95  UseGrouped(iConfig.getParameter<bool>("UseGrouped")),
96  UseSplitting(iConfig.getParameter<bool>("UseSplitting")),
97  ThreeHitTracksAreSpecial(iConfig.getParameter<bool>("ThreeHitTracksAreSpecial")),
98  AbsoluteNumberOfHits(iConfig.getParameter<bool>("AbsoluteNumberOfHits"))
99 {
100  std::string tmp = iConfig.getParameter<std::string>("SimToRecoDenominator");
101  if (tmp=="sim") {
103  } else if (tmp == "reco") {
105  }
106 
108  throw cms::Exception("TrackAssociatorByHitsImpl") << "SimToRecoDenominator not specified as sim or reco";
109  }
110 
111  //register your products
112  produces<reco::TrackToTrackingParticleAssociator>();
113 }
T getParameter(std::string const &) const
TrackerHitAssociator::Config trackerHitAssociatorConfig_
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::EDGetTokenT< SimHitTPAssociationList > simHitTpMapToken_
TrackAssociatorByHitsProducer::~TrackAssociatorByHitsProducer ( )

Definition at line 116 of file TrackAssociatorByHitsProducer.cc.

117 {
118 
119  // do anything here that needs to be done at desctruction time
120  // (e.g. close files, deallocate resources etc.)
121 
122 }

Member Function Documentation

void TrackAssociatorByHitsProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 164 of file TrackAssociatorByHitsProducer.cc.

165 {
166 }
void TrackAssociatorByHitsProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 170 of file TrackAssociatorByHitsProducer.cc.

170  {
171 }
void TrackAssociatorByHitsProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 176 of file TrackAssociatorByHitsProducer.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

176  {
177  //The following says we do not know what parameters are allowed so do no validation
178  // Please change this to state exactly what you do use, even if it is no parameters
180  desc.setUnknown();
181  descriptions.addDefault(desc);
182 }
void addDefault(ParameterSetDescription const &psetDescription)
void TrackAssociatorByHitsProducer::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 131 of file TrackAssociatorByHitsProducer.cc.

References AbsoluteNumberOfHits, cut_RecoToSim, edm::EventSetup::get(), edm::Event::getByToken(), eostools::move(), edm::Event::productGetter(), purity_SimToReco, edm::Event::put(), quality_SimToReco, simHitTpMapToken_, SimToRecoDenominator, ThreeHitTracksAreSpecial, convertXMLtoSQLite_cfg::toPut, trackerHitAssociatorConfig_, UseGrouped, UsePixels, and UseSplitting.

132 {
133  using namespace edm;
134 
135  std::unique_ptr<TrackerHitAssociator> thAssoc( new TrackerHitAssociator(iEvent,trackerHitAssociatorConfig_));
136 
138  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
139 
141  //warning: make sure the TP collection used in the map is the same used in the associator!
142  iEvent.getByToken(simHitTpMapToken_,simHitsTPAssoc);
143 
144  std::unique_ptr<reco::TrackToTrackingParticleAssociatorBaseImpl> impl(
146  std::move(thAssoc),
147  &(*tTopoHand),
148  &(*simHitsTPAssoc),
153  UsePixels,
154  UseGrouped,
155  UseSplitting,
158  std::unique_ptr<reco::TrackToTrackingParticleAssociator> toPut( new reco::TrackToTrackingParticleAssociator(std::move(impl)));
159  iEvent.put(std::move(toPut));
160 }
TrackerHitAssociator::Config trackerHitAssociatorConfig_
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
EDProductGetter const & productGetter() const
Definition: Event.cc:55
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
def move
Definition: eostools.py:510
const T & get() const
Definition: EventSetup.h:56
edm::EDGetTokenT< SimHitTPAssociationList > simHitTpMapToken_

Member Data Documentation

const bool TrackAssociatorByHitsProducer::AbsoluteNumberOfHits
private

Definition at line 72 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const double TrackAssociatorByHitsProducer::cut_RecoToSim
private

Definition at line 67 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const double TrackAssociatorByHitsProducer::purity_SimToReco
private

Definition at line 66 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const double TrackAssociatorByHitsProducer::quality_SimToReco
private

Definition at line 65 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

edm::EDGetTokenT<SimHitTPAssociationList> TrackAssociatorByHitsProducer::simHitTpMapToken_
private

Definition at line 63 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

TrackAssociatorByHitsImpl::SimToRecoDenomType TrackAssociatorByHitsProducer::SimToRecoDenominator
private

Definition at line 64 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce(), and TrackAssociatorByHitsProducer().

const bool TrackAssociatorByHitsProducer::ThreeHitTracksAreSpecial
private

Definition at line 71 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

TrackerHitAssociator::Config TrackAssociatorByHitsProducer::trackerHitAssociatorConfig_
private

Definition at line 62 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const bool TrackAssociatorByHitsProducer::UseGrouped
private

Definition at line 69 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const bool TrackAssociatorByHitsProducer::UsePixels
private

Definition at line 68 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

const bool TrackAssociatorByHitsProducer::UseSplitting
private

Definition at line 70 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().