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

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
 
edm::ParameterSet conf_
 
const double cut_RecoToSim
 
const double purity_SimToReco
 
const double quality_SimToReco
 
edm::EDGetTokenT
< SimHitTPAssociationList
simHitTpMapToken_
 
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
 
const bool ThreeHitTracksAreSpecial
 
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
 
- 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

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 conf_, edm::EDConsumerBase::consumesCollector(), TrackAssociatorByHitsImpl::denomnone, TrackAssociatorByHitsImpl::denomreco, TrackAssociatorByHitsImpl::denomsim, Exception, edm::ParameterSet::getParameter(), SimToRecoDenominator, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, and tmp.

87  :
88  conf_(iConfig),
89  simHitTpMapToken_(consumes<SimHitTPAssociationList>(conf_.getParameter<edm::InputTag>("simHitTpMapTag"))),
91  quality_SimToReco(conf_.getParameter<double>("Quality_SimToReco")),
92  purity_SimToReco(conf_.getParameter<double>("Purity_SimToReco")),
93  cut_RecoToSim(conf_.getParameter<double>("Cut_RecoToSim")),
94  UsePixels(conf_.getParameter<bool>("UsePixels")),
95  UseGrouped(conf_.getParameter<bool>("UseGrouped")),
96  UseSplitting(conf_.getParameter<bool>("UseSplitting")),
97  ThreeHitTracksAreSpecial(conf_.getParameter<bool>("ThreeHitTracksAreSpecial")),
98  AbsoluteNumberOfHits(conf_.getParameter<bool>("AbsoluteNumberOfHits"))
99 {
100  std::string tmp = conf_.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 
115 }
T getParameter(std::string const &) const
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 118 of file TrackAssociatorByHitsProducer.cc.

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

Member Function Documentation

void TrackAssociatorByHitsProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 165 of file TrackAssociatorByHitsProducer.cc.

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

Reimplemented from edm::global::EDProducerBase.

Definition at line 171 of file TrackAssociatorByHitsProducer.cc.

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

Definition at line 177 of file TrackAssociatorByHitsProducer.cc.

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

177  {
178  //The following says we do not know what parameters are allowed so do no validation
179  // Please change this to state exactly what you do use, even if it is no parameters
181  desc.setUnknown();
182  descriptions.addDefault(desc);
183 }
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 133 of file TrackAssociatorByHitsProducer.cc.

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

134 {
135  using namespace edm;
136 
137  std::unique_ptr<TrackerHitAssociator> thAssoc( new TrackerHitAssociator(iEvent,conf_));
138 
140  iSetup.get<IdealGeometryRecord>().get(tTopoHand);
141 
143  //warning: make sure the TP collection used in the map is the same used in the associator!
144  iEvent.getByToken(simHitTpMapToken_,simHitsTPAssoc);
145 
146  std::unique_ptr<reco::TrackToTrackingParticleAssociatorBaseImpl> impl(
147  new TrackAssociatorByHitsImpl( std::move(thAssoc),
148  &(*tTopoHand),
149  &(*simHitsTPAssoc),
154  UsePixels,
155  UseGrouped,
156  UseSplitting,
159  std::unique_ptr<reco::TrackToTrackingParticleAssociator> toPut( new reco::TrackToTrackingParticleAssociator(std::move(impl)));
160  iEvent.put(std::move(toPut));
161 }
TrackAssociatorByHitsImpl::SimToRecoDenomType SimToRecoDenominator
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
def move
Definition: eostools.py:508
const T & get() const
Definition: EventSetup.h:55
edm::EDGetTokenT< SimHitTPAssociationList > simHitTpMapToken_

Member Data Documentation

const bool TrackAssociatorByHitsProducer::AbsoluteNumberOfHits
private

Definition at line 72 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce().

edm::ParameterSet TrackAssociatorByHitsProducer::conf_
private

Definition at line 62 of file TrackAssociatorByHitsProducer.cc.

Referenced by produce(), and TrackAssociatorByHitsProducer().

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().

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().