CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
StandAloneMuonProducer Class Reference

#include <StandAloneMuonProducer.h>

Inheritance diagram for StandAloneMuonProducer:
edm::stream::EDProducer<>

Public Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 reconstruct muons More...
 
 StandAloneMuonProducer (const edm::ParameterSet &)
 constructor with config More...
 
 ~StandAloneMuonProducer () override
 destructor More...
 
- 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
 

Private Member Functions

void setAlias (std::string alias)
 

Private Attributes

edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken
 
std::string theAlias
 
edm::InputTag theSeedCollectionLabel
 MuonSeed Collection Label. More...
 
std::unique_ptr< MuonServiceProxytheService
 the event setup proxy, it takes care the services update More...
 
std::unique_ptr< MuonTrackFindertheTrackFinder
 the track finder More...
 

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

StandAlone muon reconstructor: reconstructs muons using DT, CSC and RPC information,
starting from internal seeds (L2 muon track segments).

Author
R.Bellan - INFN TO

Definition at line 30 of file StandAloneMuonProducer.h.

Constructor & Destructor Documentation

◆ StandAloneMuonProducer()

StandAloneMuonProducer::StandAloneMuonProducer ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 45 of file StandAloneMuonProducer.cc.

References edm::ParameterSet::getParameter(), LogTrace, eostools::move(), edm::parameterSet(), and AlCaHLTBitMon_QueryRunRegistry::string.

45  {
46  LogTrace("Muon|RecoMuon|StandAloneMuonProducer") << "constructor called" << endl;
47 
48  // Parameter set for the Builder
49  ParameterSet trajectoryBuilderParameters = parameterSet.getParameter<ParameterSet>("STATrajBuilderParameters");
50 
51  // MuonSeed Collection Label
53 
54  // service parameters
55  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
56 
57  // TrackLoader parameters
58  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
59  edm::ConsumesCollector iC = consumesCollector();
60 
61  // the services
62  theService = std::make_unique<MuonServiceProxy>(serviceParameters, consumesCollector());
63 
64  auto trackLoader = std::make_unique<MuonTrackLoader>(trackLoaderParameters, iC, theService.get());
65  std::unique_ptr<MuonTrajectoryBuilder> trajectoryBuilder;
66  // instantiate the concrete trajectory builder in the Track Finder
67  string typeOfBuilder = parameterSet.getParameter<string>("MuonTrajectoryBuilder");
68  if (typeOfBuilder == "StandAloneMuonTrajectoryBuilder")
69  trajectoryBuilder =
70  std::make_unique<StandAloneMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService.get(), iC);
71  else if (typeOfBuilder == "DirectMuonTrajectoryBuilder")
72  trajectoryBuilder =
73  std::make_unique<DirectMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService.get(), iC);
74  else if (typeOfBuilder == "Exhaustive")
75  trajectoryBuilder =
76  std::make_unique<ExhaustiveMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService.get(), iC);
77  else {
78  LogWarning("Muon|RecoMuon|StandAloneMuonProducer")
79  << "No Trajectory builder associated with " << typeOfBuilder
80  << ". Falling down to the default (StandAloneMuonTrajectoryBuilder)";
81  trajectoryBuilder =
82  std::make_unique<StandAloneMuonTrajectoryBuilder>(trajectoryBuilderParameters, theService.get(), iC);
83  }
84  theTrackFinder = std::make_unique<MuonTrackFinder>(std::move(trajectoryBuilder), std::move(trackLoader), iC);
85 
86  setAlias(parameterSet.getParameter<std::string>("@module_label"));
87 
88  produces<reco::TrackCollection>().setBranchAlias(theAlias + "Tracks");
89  produces<reco::TrackCollection>("UpdatedAtVtx").setBranchAlias(theAlias + "UpdatedAtVtxTracks");
90  produces<TrackingRecHitCollection>().setBranchAlias(theAlias + "RecHits");
91  produces<reco::TrackExtraCollection>().setBranchAlias(theAlias + "TrackExtras");
92  produces<reco::TrackToTrackMap>().setBranchAlias(theAlias + "TrackToTrackMap");
93 
94  produces<std::vector<Trajectory> >().setBranchAlias(theAlias + "Trajectories");
95  produces<TrajTrackAssociationCollection>().setBranchAlias(theAlias + "TrajToTrackMap");
96 
97  seedToken = consumes<edm::View<TrajectorySeed> >(theSeedCollectionLabel);
98 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag theSeedCollectionLabel
MuonSeed Collection Label.
std::unique_ptr< MuonTrackFinder > theTrackFinder
the track finder
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
#define LogTrace(id)
void setAlias(std::string alias)
std::unique_ptr< MuonServiceProxy > theService
the event setup proxy, it takes care the services update
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken
def move(src, dest)
Definition: eostools.py:511

◆ ~StandAloneMuonProducer()

StandAloneMuonProducer::~StandAloneMuonProducer ( )
override

destructor

Definition at line 101 of file StandAloneMuonProducer.cc.

References LogTrace.

101  {
102  LogTrace("Muon|RecoMuon|StandAloneMuonProducer") << "StandAloneMuonProducer destructor called" << endl;
103 }
#define LogTrace(id)

Member Function Documentation

◆ produce()

void StandAloneMuonProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
)
override

reconstruct muons

Definition at line 106 of file StandAloneMuonProducer.cc.

References options_cfi::eventSetup, LogTrace, metname, DetachedQuadStep_cff::seeds, and AlCaHLTBitMon_QueryRunRegistry::string.

106  {
107  const std::string metname = "Muon|RecoMuon|StandAloneMuonProducer";
108 
109  LogTrace(metname) << endl << endl << endl;
110  LogTrace(metname) << "Stand Alone Muon Reconstruction Started" << endl;
111 
112  // Take the seeds container
113  LogTrace(metname) << "Taking the seeds: " << theSeedCollectionLabel.label() << endl;
115  event.getByToken(seedToken, seeds);
116 
117  // Update the services
118  theService->update(eventSetup);
119 
120  // Reconstruct
121  LogTrace(metname) << "Track Reconstruction" << endl;
122  theTrackFinder->reconstruct(seeds, event, eventSetup);
123 
124  LogTrace(metname) << "Event loaded"
125  << "================================" << endl
126  << endl;
127 }
edm::InputTag theSeedCollectionLabel
MuonSeed Collection Label.
const std::string metname
std::unique_ptr< MuonTrackFinder > theTrackFinder
the track finder
std::string const & label() const
Definition: InputTag.h:36
#define LogTrace(id)
std::unique_ptr< MuonServiceProxy > theService
the event setup proxy, it takes care the services update
edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken
Definition: event.py:1

◆ setAlias()

void StandAloneMuonProducer::setAlias ( std::string  alias)
inlineprivate

Definition at line 55 of file StandAloneMuonProducer.h.

References SiStripOfflineCRack_cfg::alias, and theAlias.

55  {
56  alias.erase(alias.size() - 1, alias.size());
57  theAlias = alias;
58  }

Member Data Documentation

◆ seedToken

edm::EDGetTokenT<edm::View<TrajectorySeed> > StandAloneMuonProducer::seedToken
private

Definition at line 51 of file StandAloneMuonProducer.h.

◆ theAlias

std::string StandAloneMuonProducer::theAlias
private

Definition at line 53 of file StandAloneMuonProducer.h.

Referenced by setAlias().

◆ theSeedCollectionLabel

edm::InputTag StandAloneMuonProducer::theSeedCollectionLabel
private

MuonSeed Collection Label.

Definition at line 43 of file StandAloneMuonProducer.h.

◆ theService

std::unique_ptr<MuonServiceProxy> StandAloneMuonProducer::theService
private

the event setup proxy, it takes care the services update

Definition at line 49 of file StandAloneMuonProducer.h.

◆ theTrackFinder

std::unique_ptr<MuonTrackFinder> StandAloneMuonProducer::theTrackFinder
private

the track finder

Definition at line 46 of file StandAloneMuonProducer.h.