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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () 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

const edm::ParameterSet 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::MuonToTrackingParticleAssociatorEDProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 210 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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_ = std::make_unique<InputDumper>(iConfig, consumesCollector());
226  }
227 }

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

◆ ~MuonToTrackingParticleAssociatorEDProducer()

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

◆ fillDescriptions()

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

Definition at line 287 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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 }

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

◆ produce()

void MuonToTrackingParticleAssociatorEDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 239 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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
257  trackertruth_ = std::make_unique<TrackerHitAssociator>(iEvent, trackerHitAssociatorConfig_);
258  // CSC hit association
259  csctruth_ = std::make_unique<CSCHitAssociator>(iEvent, iSetup, config_);
260  // DT hit association
261  printRtS = false;
262  dttruth_ = std::make_unique<DTHitAssociator>(iEvent, iSetup, config_, printRtS);
263  // RPC hit association
264  rpctruth_ = std::make_unique<RPCHitAssociator>(iEvent, iSetup, config_);
265  // GEM hit association
266  gemtruth_ = std::make_unique<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 }

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

Member Data Documentation

◆ config_

const edm::ParameterSet MuonToTrackingParticleAssociatorEDProducer::config_
private

Definition at line 186 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

◆ csctruth_

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

Definition at line 194 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

◆ diagnostics_

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

◆ dttruth_

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

Definition at line 193 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

◆ gemtruth_

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

Definition at line 192 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

◆ helper_

MuonAssociatorByHitsHelper MuonToTrackingParticleAssociatorEDProducer::helper_
private

Definition at line 187 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

◆ hitExtractor_

TrackerMuonHitExtractor MuonToTrackingParticleAssociatorEDProducer::hitExtractor_
private

Definition at line 189 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

◆ rpctruth_

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

Definition at line 191 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

◆ trackerHitAssociatorConfig_

TrackerHitAssociator::Config MuonToTrackingParticleAssociatorEDProducer::trackerHitAssociatorConfig_
private

Definition at line 188 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

◆ trackertruth_

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

Definition at line 195 of file MuonToTrackingParticleAssociatorEDProducer.cc.

Referenced by produce().

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
reco::MuonToTrackingParticleAssociator
Definition: MuonToTrackingParticleAssociator.h:15
MuonToTrackingParticleAssociatorEDProducer::config_
const edm::ParameterSet config_
Definition: MuonToTrackingParticleAssociatorEDProducer.cc:186
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
MuonToTrackingParticleAssociatorByHitsImpl
Definition: MuonToTrackingParticleAssociatorByHitsImpl.h:32
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
MuonToTrackingParticleAssociatorEDProducer::trackerHitAssociatorConfig_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
Definition: MuonToTrackingParticleAssociatorEDProducer.cc:188
muonAssociatorByHitsDiagnostics::TrackHitsCollection
MuonAssociatorByHitsHelper::TrackHitsCollection TrackHitsCollection
Definition: MuonAssociatorByHits.cc:23
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
DTHitAssociator
Definition: DTHitAssociator.h:22
edm::ESHandle< TrackerTopology >
TrackerMuonHitExtractor::init
void init(const edm::Event &, const edm::EventSetup &)
Definition: TrackerMuonHitExtractor.cc:30
MuonToTrackingParticleAssociatorEDProducer::dttruth_
std::unique_ptr< DTHitAssociator > dttruth_
Definition: MuonToTrackingParticleAssociatorEDProducer.cc:193
MuonToTrackingParticleAssociatorEDProducer::helper_
MuonAssociatorByHitsHelper helper_
Definition: MuonToTrackingParticleAssociatorEDProducer.cc:187
iEvent
int iEvent
Definition: GenABIO.cc:224
DBConfiguration_cff.toPut
toPut
Definition: DBConfiguration_cff.py:25
get
#define get
MuonToTrackingParticleAssociatorEDProducer::trackertruth_
std::unique_ptr< TrackerHitAssociator > trackertruth_
Definition: MuonToTrackingParticleAssociatorEDProducer.cc:195
MuonAssociatorByHitsHelper::Resources
Definition: MuonAssociatorByHitsHelper.h:38
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
impl
Definition: trackAlgoPriorityOrder.h:18
eostools.move
def move(src, dest)
Definition: eostools.py:511
RPCHitAssociator
Definition: RPCHitAssociator.h:32
MuonToTrackingParticleAssociatorEDProducer::rpctruth_
std::unique_ptr< RPCHitAssociator > rpctruth_
Definition: MuonToTrackingParticleAssociatorEDProducer.cc:191
mps_fire.resources
resources
Definition: mps_fire.py:263
TrackingParticleCollection
std::vector< TrackingParticle > TrackingParticleCollection
Definition: TrackingParticleFwd.h:8
MuonToTrackingParticleAssociatorEDProducer::gemtruth_
std::unique_ptr< GEMHitAssociator > gemtruth_
Definition: MuonToTrackingParticleAssociatorEDProducer.cc:192
CSCHitAssociator
Definition: CSCHitAssociator.h:24
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
MuonToTrackingParticleAssociatorEDProducer::csctruth_
std::unique_ptr< CSCHitAssociator > csctruth_
Definition: MuonToTrackingParticleAssociatorEDProducer.cc:194
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
MuonToTrackingParticleAssociatorEDProducer::hitExtractor_
TrackerMuonHitExtractor hitExtractor_
Definition: MuonToTrackingParticleAssociatorEDProducer.cc:189
MuonToTrackingParticleAssociatorEDProducer::diagnostics_
std::unique_ptr< InputDumper > diagnostics_
Definition: MuonToTrackingParticleAssociatorEDProducer.cc:196
GEMHitAssociator
Definition: GEMHitAssociator.h:33