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

Public Member Functions

 MuonToTrackingParticleAssociatorEDProducer (const edm::ParameterSet &)
 
 ~MuonToTrackingParticleAssociatorEDProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

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
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 172 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 208 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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

208  :
209  config_(iConfig),
210  helper_(iConfig),
211  trackerHitAssociatorConfig_(iConfig,consumesCollector()),
212  hitExtractor_(iConfig,consumesCollector())
213 {
214  //register your products
215  produces<reco::MuonToTrackingParticleAssociator>();
216 
217  //hack for consumes
218  RPCHitAssociator rpctruth(iConfig,consumesCollector());
219  GEMHitAssociator gemtruth(iConfig,consumesCollector());
220  DTHitAssociator dttruth(iConfig,consumesCollector());
221  CSCHitAssociator cscruth(iConfig,consumesCollector());
222 
223  if( iConfig.getUntrackedParameter<bool>("dumpInputCollections") ) {
224  diagnostics_.reset( new InputDumper(iConfig, consumesCollector()) );
225  }
226 }
T getUntrackedParameter(std::string const &, T const &) const
MuonToTrackingParticleAssociatorEDProducer::~MuonToTrackingParticleAssociatorEDProducer ( )
override

Definition at line 229 of file MuonToTrackingParticleAssociatorEDProducer.cc.

230 {
231 
232  // do anything here that needs to be done at desctruction time
233  // (e.g. close files, deallocate resources etc.)
234 
235 }

Member Function Documentation

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

Definition at line 291 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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

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

Definition at line 244 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_.

245 {
246  using namespace edm;
247 
248  hitExtractor_.init(iEvent, iSetup);
249 
250  //Retrieve tracker topology from geometry
252  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
253  const TrackerTopology *tTopo=tTopoHand.product();
254 
255  bool printRtS = true;
256 
257  //NOTE: This assumes that produce will not be called until the edm::Event used in the previous call
258  // has been deleted. This is true for now. In the future, we may have to have the resources own
259  // the memory.
260 
261  // Tracker hit association
263  // CSC hit association
264  csctruth_.reset(new CSCHitAssociator(iEvent,iSetup,config_));
265  // DT hit association
266  printRtS = false;
267  dttruth_.reset(new DTHitAssociator(iEvent,iSetup,config_,printRtS));
268  // RPC hit association
269  rpctruth_.reset( new RPCHitAssociator(iEvent,iSetup,config_) );
270  // GEM hit association
271  gemtruth_.reset( new GEMHitAssociator(iEvent,iSetup,config_) );
272 
274 
275  if(diagnostics_) {
276  diagnostics_->read(iEvent);
277  resources.diagnostics_ = [this](const TrackHitsCollection& hC, const TrackingParticleCollection& pC) {
278  diagnostics_->dump(hC,pC);
279  };
280  }
281 
282  std::unique_ptr<reco::MuonToTrackingParticleAssociatorBaseImpl> impl{
284  std::unique_ptr<reco::MuonToTrackingParticleAssociator> toPut( new reco::MuonToTrackingParticleAssociator(std::move(impl)));
285  iEvent.put(std::move(toPut));
286 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
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:59
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 183 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

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

Definition at line 191 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

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

Definition at line 190 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

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

Definition at line 189 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

MuonAssociatorByHitsHelper MuonToTrackingParticleAssociatorEDProducer::helper_
private

Definition at line 184 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

TrackerMuonHitExtractor MuonToTrackingParticleAssociatorEDProducer::hitExtractor_
private

Definition at line 186 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

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

Definition at line 188 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

TrackerHitAssociator::Config MuonToTrackingParticleAssociatorEDProducer::trackerHitAssociatorConfig_
private

Definition at line 185 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

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

Definition at line 192 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().