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
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)
 
 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::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_
 
MuonAssociatorByHitsHelper helper_
 
TrackerMuonHitExtractor hitExtractor_
 
std::unique_ptr< RPCHitAssociatorrpctruth_
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
std::unique_ptr
< TrackerHitAssociator
trackertruth_
 

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

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

203  :
204  config_(iConfig),
205  helper_(iConfig),
208 {
209  //register your products
210  produces<reco::MuonToTrackingParticleAssociator>();
211 
212  //hack for consumes
213  RPCHitAssociator rpctruth(iConfig,consumesCollector());
214  DTHitAssociator dttruth(iConfig,consumesCollector());
215  CSCHitAssociator cscruth(iConfig,consumesCollector());
216 
217  if( iConfig.getUntrackedParameter<bool>("dumpInputCollections") ) {
218  diagnostics_.reset( new InputDumper(iConfig, consumesCollector()) );
219  }
220 }
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 223 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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

Member Function Documentation

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

Definition at line 283 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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

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

Implements edm::stream::EDProducerBase.

Definition at line 238 of file MuonToTrackingParticleAssociatorEDProducer.cc.

References config_, csctruth_, diagnostics_, dttruth_, edm::EventSetup::get(), helper_, hitExtractor_, TrackerMuonHitExtractor::init(), eostools::move(), edm::Event::put(), rpctruth_, convertXMLtoSQLite_cfg::toPut, trackerHitAssociatorConfig_, and trackertruth_.

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

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

Referenced by produce().

std::unique_ptr<InputDumper> MuonToTrackingParticleAssociatorEDProducer::diagnostics_
private
std::unique_ptr<DTHitAssociator> MuonToTrackingParticleAssociatorEDProducer::dttruth_
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 187 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().