CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
MuonToTrackingParticleAssociatorEDProducer Class Reference

#include <SimMuon/MCTruth/plugins/MuonToTrackingParticleAssociatorEDProducer.cc>

Inheritance diagram for MuonToTrackingParticleAssociatorEDProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MuonToTrackingParticleAssociatorEDProducer (const edm::ParameterSet &)
 
 ~MuonToTrackingParticleAssociatorEDProducer ()
 
- 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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 & itemsToGetFromEvent () 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)
 

Static Public Member Functions

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

Private Member Functions

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

Private Attributes

edm::ParameterSet const config_
 
std::unique_ptr< CSCHitAssociatorcsctruth_
 
std::unique_ptr< InputDumper > diagnostics_
 
std::unique_ptr< DTHitAssociatordttruth_
 
std::unique_ptr< GEMHitAssociatorgemtruth_
 
MuonAssociatorByHitsHelper helper_
 
TrackerMuonHitExtractor hitExtractor_
 
std::unique_ptr< RPCHitAssociatorrpctruth_
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
std::unique_ptr< TrackerHitAssociatortrackertruth_
 

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
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 168 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 204 of file MuonToTrackingParticleAssociatorEDProducer.cc.

References edm::EDConsumerBase::consumesCollector(), diagnostics_, and edm::ParameterSet::getUntrackedParameter().

204  :
205  config_(iConfig),
206  helper_(iConfig),
209 {
210  //register your products
211  produces<reco::MuonToTrackingParticleAssociator>();
212 
213  //hack for consumes
214  RPCHitAssociator rpctruth(iConfig,consumesCollector());
215  GEMHitAssociator gemtruth(iConfig,consumesCollector());
216  DTHitAssociator dttruth(iConfig,consumesCollector());
217  CSCHitAssociator cscruth(iConfig,consumesCollector());
218 
219  if( iConfig.getUntrackedParameter<bool>("dumpInputCollections") ) {
220  diagnostics_.reset( new InputDumper(iConfig, consumesCollector()) );
221  }
222 }
T getUntrackedParameter(std::string const &, T const &) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
MuonToTrackingParticleAssociatorEDProducer::~MuonToTrackingParticleAssociatorEDProducer ( )

Definition at line 225 of file MuonToTrackingParticleAssociatorEDProducer.cc.

226 {
227 
228  // do anything here that needs to be done at desctruction time
229  // (e.g. close files, deallocate resources etc.)
230 
231 }

Member Function Documentation

void MuonToTrackingParticleAssociatorEDProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 287 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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

287  {
288  //The following says we do not know what parameters are allowed so do no validation
289  // Please change this to state exactly what you do use, even if it is no parameters
291  desc.setUnknown();
292  descriptions.addDefault(desc);
293 }
void addDefault(ParameterSetDescription const &psetDescription)
void MuonToTrackingParticleAssociatorEDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Definition at line 240 of file MuonToTrackingParticleAssociatorEDProducer.cc.

References config_, csctruth_, MuonAssociatorByHitsHelper::Resources::diagnostics_, diagnostics_, dttruth_, gemtruth_, edm::EventSetup::get(), helper_, hitExtractor_, TrackerMuonHitExtractor::init(), eostools::move(), edm::ESHandle< T >::product(), edm::Event::put(), mps_fire::resources, rpctruth_, DBConfiguration_cff::toPut, trackerHitAssociatorConfig_, and trackertruth_.

241 {
242  using namespace edm;
243 
244  hitExtractor_.init(iEvent, iSetup);
245 
246  //Retrieve tracker topology from geometry
248  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
249  const TrackerTopology *tTopo=tTopoHand.product();
250 
251  bool printRtS = true;
252 
253  //NOTE: This assumes that produce will not be called until the edm::Event used in the previous call
254  // has been deleted. This is true for now. In the future, we may have to have the resources own
255  // the memory.
256 
257  // Tracker hit association
259  // CSC hit association
260  csctruth_.reset(new CSCHitAssociator(iEvent,iSetup,config_));
261  // DT hit association
262  printRtS = false;
263  dttruth_.reset(new DTHitAssociator(iEvent,iSetup,config_,printRtS));
264  // RPC hit association
265  rpctruth_.reset( new RPCHitAssociator(iEvent,iSetup,config_) );
266  // GEM hit association
267  gemtruth_.reset( new GEMHitAssociator(iEvent,iSetup,config_) );
268 
270 
271  if(diagnostics_) {
272  diagnostics_->read(iEvent);
273  resources.diagnostics_ = [this](const TrackHitsCollection& hC, const TrackingParticleCollection& pC) {
274  diagnostics_->dump(hC,pC);
275  };
276  }
277 
278  std::unique_ptr<reco::MuonToTrackingParticleAssociatorBaseImpl> impl{
280  std::unique_ptr<reco::MuonToTrackingParticleAssociator> toPut( new reco::MuonToTrackingParticleAssociator(std::move(impl)));
281  iEvent.put(std::move(toPut));
282 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::vector< TrackingParticle > TrackingParticleCollection
std::function< void(const TrackHitsCollection &, const TrackingParticleCollection &)> diagnostics_
MuonAssociatorByHitsHelper::TrackHitsCollection TrackHitsCollection
void init(const edm::Event &, const edm::EventSetup &)
const T & get() const
Definition: EventSetup.h:56
HLT enums.
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::ParameterSet const MuonToTrackingParticleAssociatorEDProducer::config_
private

Definition at line 179 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

std::unique_ptr<CSCHitAssociator> MuonToTrackingParticleAssociatorEDProducer::csctruth_
private

Definition at line 187 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

std::unique_ptr<InputDumper> MuonToTrackingParticleAssociatorEDProducer::diagnostics_
private
std::unique_ptr<DTHitAssociator> MuonToTrackingParticleAssociatorEDProducer::dttruth_
private

Definition at line 186 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

std::unique_ptr<GEMHitAssociator> MuonToTrackingParticleAssociatorEDProducer::gemtruth_
private

Definition at line 185 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

MuonAssociatorByHitsHelper MuonToTrackingParticleAssociatorEDProducer::helper_
private

Definition at line 180 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

TrackerMuonHitExtractor MuonToTrackingParticleAssociatorEDProducer::hitExtractor_
private

Definition at line 182 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

std::unique_ptr<RPCHitAssociator> MuonToTrackingParticleAssociatorEDProducer::rpctruth_
private

Definition at line 184 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

TrackerHitAssociator::Config MuonToTrackingParticleAssociatorEDProducer::trackerHitAssociatorConfig_
private

Definition at line 181 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

std::unique_ptr<TrackerHitAssociator> MuonToTrackingParticleAssociatorEDProducer::trackertruth_
private

Definition at line 188 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().