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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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  edm::LogVerbatim("MuonToTrackingParticleAssociatorEDProducer")
225  << "\n constructing MuonToTrackingParticleAssociatorEDProducer"
226  << "\n";
227 
228  if (iConfig.getUntrackedParameter<bool>("dumpInputCollections")) {
229  diagnostics_ = std::make_unique<InputDumper>(iConfig, consumesCollector());
230  }
231 }

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

◆ ~MuonToTrackingParticleAssociatorEDProducer()

MuonToTrackingParticleAssociatorEDProducer::~MuonToTrackingParticleAssociatorEDProducer ( )
override

Definition at line 233 of file MuonToTrackingParticleAssociatorEDProducer.cc.

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

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 291 of file MuonToTrackingParticleAssociatorEDProducer.cc.

291  {
292  // The following says we do not know what parameters are allowed so do no
293  // validation
294  // Please change this to state exactly what you do use, even if it is no
295  // parameters
297  desc.setUnknown();
298  descriptions.addDefault(desc);
299 }

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

◆ produce()

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

Definition at line 243 of file MuonToTrackingParticleAssociatorEDProducer.cc.

243  {
244  using namespace edm;
245 
246  hitExtractor_.init(iEvent, iSetup);
247 
248  // Retrieve tracker topology from geometry
250  iSetup.get<TrackerTopologyRcd>().get(tTopoHand);
251  const TrackerTopology *tTopo = tTopoHand.product();
252 
253  bool printRtS = true;
254 
255  // NOTE: This assumes that produce will not be called until the edm::Event
256  // used in the previous call
257  // has been deleted. This is true for now. In the future, we may have to have
258  // the resources own the memory.
259 
260  // Tracker hit association
261  trackertruth_ = std::make_unique<TrackerHitAssociator>(iEvent, trackerHitAssociatorConfig_);
262  // CSC hit association
263  csctruth_ = std::make_unique<CSCHitAssociator>(iEvent, iSetup, config_);
264  // DT hit association
265  printRtS = false;
266  dttruth_ = std::make_unique<DTHitAssociator>(iEvent, iSetup, config_, printRtS);
267  // RPC hit association
268  rpctruth_ = std::make_unique<RPCHitAssociator>(iEvent, iSetup, config_);
269  // GEM hit association
270  gemtruth_ = std::make_unique<GEMHitAssociator>(iEvent, iSetup, config_);
271 
273  tTopo, trackertruth_.get(), csctruth_.get(), dttruth_.get(), rpctruth_.get(), gemtruth_.get(), {}};
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(
286  iEvent.put(std::move(toPut));
287 }

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_, convertXMLtoSQLite_cfg::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:87
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
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
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
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:9
convertXMLtoSQLite_cfg.toPut
toPut
Definition: convertXMLtoSQLite_cfg.py:41
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