CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
MuonToTrackingParticleAssociatorEDProducer Class Reference
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

MuonToTrackingParticleAssociatorEDProducer.cc SimMuon/MCTruth/plugins/MuonToTrackingParticleAssociatorEDProducer.cc

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 175 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 210 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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

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

Definition at line 229 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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

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
289  // validation
290  // Please change this to state exactly what you do use, even if it is no
291  // parameters
293  desc.setUnknown();
294  descriptions.addDefault(desc);
295 }
void addDefault(ParameterSetDescription const &psetDescription)
void MuonToTrackingParticleAssociatorEDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

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

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
252  // used in the previous call
253  // has been deleted. This is true for now. In the future, we may have to have
254  // the resources own the memory.
255 
256  // Tracker hit association
258  // CSC hit association
259  csctruth_.reset(new CSCHitAssociator(iEvent, iSetup, config_));
260  // DT hit association
261  printRtS = false;
262  dttruth_.reset(new DTHitAssociator(iEvent, iSetup, config_, printRtS));
263  // RPC hit association
264  rpctruth_.reset(new RPCHitAssociator(iEvent, iSetup, config_));
265  // GEM hit association
266  gemtruth_.reset(new GEMHitAssociator(iEvent, iSetup, config_));
267 
269  tTopo, trackertruth_.get(), csctruth_.get(), dttruth_.get(), rpctruth_.get(), gemtruth_.get()};
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(
282  iEvent.put(std::move(toPut));
283 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
std::vector< TrackingParticle > TrackingParticleCollection
std::function< void(const TrackHitsCollection &, const TrackingParticleCollection &)> diagnostics_
MuonAssociatorByHitsHelper::TrackHitsCollection TrackHitsCollection
void init(const edm::Event &, const edm::EventSetup &)
HLT enums.
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

edm::ParameterSet const MuonToTrackingParticleAssociatorEDProducer::config_
private

Definition at line 186 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

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

Definition at line 194 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

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

Definition at line 193 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

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

Definition at line 192 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

MuonAssociatorByHitsHelper MuonToTrackingParticleAssociatorEDProducer::helper_
private

Definition at line 187 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

TrackerMuonHitExtractor MuonToTrackingParticleAssociatorEDProducer::hitExtractor_
private

Definition at line 189 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

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

Definition at line 191 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

TrackerHitAssociator::Config MuonToTrackingParticleAssociatorEDProducer::trackerHitAssociatorConfig_
private

Definition at line 188 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

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

Definition at line 195 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().