CMS 3D CMS Logo

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

#include <GlobalMuonTrajectoryBuilder.h>

Inheritance diagram for GlobalMuonTrajectoryBuilder:
GlobalTrajectoryBuilderBase MuonTrajectoryBuilder

Public Member Functions

 GlobalMuonTrajectoryBuilder (const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
 constructor with Parameter Set and MuonServiceProxy More...
 
void setEvent (const edm::Event &) override
 pass the Event to the algo at each event More...
 
MuonTrajectoryBuilder::CandidateContainer trajectories (const TrackCand &) override
 reconstruct trajectories from standalone and tracker only Tracks More...
 
MuonTrajectoryBuilder::TrajectoryContainer trajectories (const TrajectorySeed &) override
 dummy implementation, unused in this class More...
 
 ~GlobalMuonTrajectoryBuilder () override
 destructor More...
 
- Public Member Functions inherited from GlobalTrajectoryBuilderBase
 GlobalTrajectoryBuilderBase (const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
 constructor with Parameter Set and MuonServiceProxy More...
 
void setEvent (const edm::Event &) override
 pass the Event to the algo at each event More...
 
MuonTrajectoryBuilder::TrajectoryContainer trajectories (const TrajectorySeed &) override
 dummy implementation, unused in this class More...
 
 ~GlobalTrajectoryBuilderBase () override
 destructor More...
 
- Public Member Functions inherited from MuonTrajectoryBuilder
 MuonTrajectoryBuilder ()
 constructor More...
 
virtual ~MuonTrajectoryBuilder ()
 destructor More...
 

Private Member Functions

std::vector< TrackCandmakeTkCandCollection (const TrackCand &) override
 make a TrackCand collection using tracker Track, Trajectory information More...
 

Private Attributes

edm::Handle< reco::TrackCollectionallTrackerTracks
 
edm::EDGetTokenT< reco::TrackCollectionallTrackerTracksToken
 
edm::InputTag theTkTrackLabel
 

Additional Inherited Members

- Public Types inherited from GlobalTrajectoryBuilderBase
typedef MuonTransientTrackingRecHit::ConstMuonRecHitContainer ConstMuonRecHitContainer
 
typedef MuonTransientTrackingRecHit::ConstMuonRecHitPointer ConstMuonRecHitPointer
 
typedef TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
 
typedef TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
 
typedef MuonTransientTrackingRecHit::MuonRecHitContainer MuonRecHitContainer
 
typedef MuonTransientTrackingRecHit::MuonRecHitPointer MuonRecHitPointer
 
typedef TransientTrackingRecHit::RecHitContainer RecHitContainer
 
typedef TransientTrackingRecHit::RecHitPointer RecHitPointer
 
typedef std::vector< TrajectoryTC
 
typedef TC::const_iterator TI
 
- Public Types inherited from MuonTrajectoryBuilder
typedef MuonCandidate::CandidateContainer CandidateContainer
 
typedef std::pair< const Trajectory *, reco::TrackRefTrackCand
 
typedef MuonCandidate::TrajectoryContainer TrajectoryContainer
 
- Protected Types inherited from GlobalTrajectoryBuilderBase
enum  RefitDirection { inToOut, outToIn, undetermined }
 
- Protected Member Functions inherited from GlobalTrajectoryBuilderBase
void addTraj (TrackCand &)
 if TrackCand has only a TrackRef, attempt to add Trajectory* More...
 
MuonTrajectoryBuilder::CandidateContainer build (const TrackCand &, MuonTrajectoryBuilder::CandidateContainer &) const
 build combined trajectory from sta Track and tracker RecHits More...
 
void checkMuonHits (const reco::Track &, ConstRecHitContainer &, ConstRecHitContainer &, std::vector< int > &) const
 check muon RecHits, calculate chamber occupancy and select hits to be used in the final fit More...
 
RefitDirection checkRecHitsOrdering (const ConstRecHitContainer &) const
 This does nothing now. More...
 
std::vector< TrackCandchooseRegionalTrackerTracks (const TrackCand &, const std::vector< TrackCand > &)
 choose tracker tracks within region of interest More...
 
const TrajectorychooseTrajectory (const std::vector< Trajectory * > &, int) const
 choose final trajectory More...
 
RectangularEtaPhiTrackingRegion defineRegionOfInterest (const reco::TrackRef &) const
 define region of interest with tracker More...
 
void fixTEC (ConstRecHitContainer &all, double scl_x, double scl_y) const
 rescale errors of outermost TEC RecHit More...
 
TransientTrackingRecHit::ConstRecHitContainer getTransientRecHits (const reco::Track &) const
 get transient RecHits of a Track More...
 
void printHits (const ConstRecHitContainer &) const
 print all RecHits of a trajectory More...
 
ConstRecHitContainer selectMuonHits (const Trajectory &, const std::vector< int > &) const
 select muon hits compatible with trajectory; check hits in chambers with showers More...
 
ConstRecHitContainer selectTrackerHits (const ConstRecHitContainer &) const
 select tracker hits; exclude some tracker hits in the global trajectory More...
 
const MuonServiceProxyservice () const
 
GlobalMuonTrackMatchertrackMatcher () const
 
double trackProbability (const Trajectory &) const
 calculate chi2 probability (-ln(P)) More...
 
- Protected Attributes inherited from GlobalTrajectoryBuilderBase
std::string theCategory
 
float thePCut
 
float thePtCut
 

Detailed Description

class to build muon trajectory

Author
N. Neumeister Purdue University
C. Liu Purdue University
A. Everett Purdue University

Definition at line 27 of file GlobalMuonTrajectoryBuilder.h.

Constructor & Destructor Documentation

◆ GlobalMuonTrajectoryBuilder()

GlobalMuonTrajectoryBuilder::GlobalMuonTrajectoryBuilder ( const edm::ParameterSet par,
const MuonServiceProxy service,
edm::ConsumesCollector iC 
)

◆ ~GlobalMuonTrajectoryBuilder()

GlobalMuonTrajectoryBuilder::~GlobalMuonTrajectoryBuilder ( )
override

destructor

Definition at line 70 of file GlobalMuonTrajectoryBuilder.cc.

70 {}

Member Function Documentation

◆ makeTkCandCollection()

vector< GlobalMuonTrajectoryBuilder::TrackCand > GlobalMuonTrajectoryBuilder::makeTkCandCollection ( const TrackCand staCand)
overrideprivatevirtual

make a TrackCand collection using tracker Track, Trajectory information

Implements GlobalTrajectoryBuilderBase.

Definition at line 143 of file GlobalMuonTrajectoryBuilder.cc.

144  {
145  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|makeTkCandCollection";
146 
147  vector<TrackCand> tkCandColl;
148 
149  vector<TrackCand> tkTrackCands;
150 
151  for (unsigned int position = 0; position != allTrackerTracks->size(); ++position) {
153  TrackCand tkCand = TrackCand((Trajectory*)nullptr, tkTrackRef);
154  tkTrackCands.push_back(tkCand);
155  }
156 
157  tkCandColl = chooseRegionalTrackerTracks(staCand, tkTrackCands);
158 
159  return tkCandColl;
160 }

References allTrackerTracks, taus_updatedMVAIds_cff::category, GlobalTrajectoryBuilderBase::chooseRegionalTrackerTracks(), position, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by trajectories().

◆ setEvent()

void GlobalMuonTrajectoryBuilder::setEvent ( const edm::Event event)
overridevirtual

pass the Event to the algo at each event

Implements MuonTrajectoryBuilder.

Definition at line 75 of file GlobalMuonTrajectoryBuilder.cc.

75  {
76  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|setEvent";
77 
79 
80  // get tracker TrackCollection from Event
81  event.getByToken(allTrackerTracksToken, allTrackerTracks);
82  LogDebug(category) << " Found " << allTrackerTracks->size() << " tracker Tracks with label " << theTkTrackLabel;
83 }

References allTrackerTracks, allTrackerTracksToken, taus_updatedMVAIds_cff::category, LogDebug, GlobalTrajectoryBuilderBase::setEvent(), AlCaHLTBitMon_QueryRunRegistry::string, and theTkTrackLabel.

◆ trajectories() [1/2]

MuonCandidate::CandidateContainer GlobalMuonTrajectoryBuilder::trajectories ( const TrackCand staCandIn)
overridevirtual

reconstruct trajectories from standalone and tracker only Tracks

Implements MuonTrajectoryBuilder.

Definition at line 88 of file GlobalMuonTrajectoryBuilder.cc.

88  {
89  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|trajectories";
90 
91  // cut on muons with low momenta
92  LogTrace(category) << " STA pt " << staCandIn.second->pt() << " rho " << staCandIn.second->innerMomentum().Rho()
93  << " R " << staCandIn.second->innerMomentum().R() << " theCut " << thePtCut;
94 
95  // convert the STA track into a Trajectory if Trajectory not already present
96  TrackCand staCand(staCandIn);
97 
98  vector<TrackCand> regionalTkTracks = makeTkCandCollection(staCand);
99  LogTrace(category) << " Found " << regionalTkTracks.size() << " tracks within region of interest";
100 
101  // match tracker tracks to muon track
102  vector<TrackCand> trackerTracks = trackMatcher()->match(staCand, regionalTkTracks);
103  LogTrace(category) << " Found " << trackerTracks.size() << " matching tracker tracks within region of interest";
104 
105  if (trackerTracks.empty()) {
106  if (staCandIn.first == nullptr)
107  delete staCand.first;
108 
109  return CandidateContainer();
110  }
111 
112  // build a combined tracker-muon MuonCandidate
113  //
114  // turn tkMatchedTracks into MuonCandidates
115  //
116  LogTrace(category) << " Turn tkMatchedTracks into MuonCandidates";
117  CandidateContainer tkTrajs;
118  for (vector<TrackCand>::const_iterator tkt = trackerTracks.begin(); tkt != trackerTracks.end(); tkt++) {
119  tkTrajs.push_back(std::make_unique<MuonCandidate>(nullptr, staCand.second, (*tkt).second, nullptr));
120  }
121 
122  if (tkTrajs.empty()) {
123  LogTrace(category) << " tkTrajs empty";
124  if (staCandIn.first == nullptr)
125  delete staCand.first;
126 
127  return CandidateContainer();
128  }
129 
130  CandidateContainer result = build(staCand, tkTrajs);
131  LogTrace(category) << " Found " << result.size() << " GLBMuons from one STACand";
132 
133  // free memory
134  if (staCandIn.first == nullptr)
135  delete staCand.first;
136 
137  return result;
138 }

References GlobalTrajectoryBuilderBase::build(), taus_updatedMVAIds_cff::category, LogTrace, makeTkCandCollection(), GlobalMuonTrackMatcher::match(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, GlobalTrajectoryBuilderBase::thePtCut, and GlobalTrajectoryBuilderBase::trackMatcher().

◆ trajectories() [2/2]

MuonTrajectoryBuilder::TrajectoryContainer GlobalTrajectoryBuilderBase::trajectories
inlineoverride

dummy implementation, unused in this class

Definition at line 62 of file GlobalTrajectoryBuilderBase.h.

62  {
64  }

Member Data Documentation

◆ allTrackerTracks

edm::Handle<reco::TrackCollection> GlobalMuonTrajectoryBuilder::allTrackerTracks
private

Definition at line 50 of file GlobalMuonTrajectoryBuilder.h.

Referenced by makeTkCandCollection(), and setEvent().

◆ allTrackerTracksToken

edm::EDGetTokenT<reco::TrackCollection> GlobalMuonTrajectoryBuilder::allTrackerTracksToken
private

Definition at line 49 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().

◆ theTkTrackLabel

edm::InputTag GlobalMuonTrajectoryBuilder::theTkTrackLabel
private

Definition at line 48 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().

GlobalTrajectoryBuilderBase::chooseRegionalTrackerTracks
std::vector< TrackCand > chooseRegionalTrackerTracks(const TrackCand &, const std::vector< TrackCand > &)
choose tracker tracks within region of interest
Definition: GlobalTrajectoryBuilderBase.cc:302
taus_updatedMVAIds_cff.category
category
Definition: taus_updatedMVAIds_cff.py:31
service
Definition: service.py:1
GlobalTrajectoryBuilderBase::thePtCut
float thePtCut
Definition: GlobalTrajectoryBuilderBase.h:144
GlobalMuonTrackMatcher::match
double match(const TrackCand &sta, const TrackCand &track, int matchOption=0, int surfaceOption=1) const
Definition: GlobalMuonTrackMatcher.cc:100
GlobalTrajectoryBuilderBase::GlobalTrajectoryBuilderBase
GlobalTrajectoryBuilderBase(const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
constructor with Parameter Set and MuonServiceProxy
Definition: GlobalTrajectoryBuilderBase.cc:76
GlobalTrajectoryBuilderBase::trackMatcher
GlobalMuonTrackMatcher * trackMatcher() const
Definition: GlobalTrajectoryBuilderBase.h:115
GlobalTrajectoryBuilderBase::build
MuonTrajectoryBuilder::CandidateContainer build(const TrackCand &, MuonTrajectoryBuilder::CandidateContainer &) const
build combined trajectory from sta Track and tracker RecHits
Definition: GlobalTrajectoryBuilderBase.cc:155
MuonTrajectoryBuilder::CandidateContainer
MuonCandidate::CandidateContainer CandidateContainer
Definition: MuonTrajectoryBuilder.h:24
edm::Ref< TrackCollection >
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
GlobalTrajectoryBuilderBase::setEvent
void setEvent(const edm::Event &) override
pass the Event to the algo at each event
Definition: GlobalTrajectoryBuilderBase.cc:136
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MuonTrajectoryBuilder::TrajectoryContainer
MuonCandidate::TrajectoryContainer TrajectoryContainer
Definition: MuonTrajectoryBuilder.h:23
Trajectory
Definition: Trajectory.h:38
GlobalMuonTrajectoryBuilder::makeTkCandCollection
std::vector< TrackCand > makeTkCandCollection(const TrackCand &) override
make a TrackCand collection using tracker Track, Trajectory information
Definition: GlobalMuonTrajectoryBuilder.cc:143
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MuonTrajectoryBuilder::TrackCand
std::pair< const Trajectory *, reco::TrackRef > TrackCand
Definition: MuonTrajectoryBuilder.h:25
GlobalMuonTrajectoryBuilder::allTrackerTracksToken
edm::EDGetTokenT< reco::TrackCollection > allTrackerTracksToken
Definition: GlobalMuonTrajectoryBuilder.h:49
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
GlobalMuonTrajectoryBuilder::allTrackerTracks
edm::Handle< reco::TrackCollection > allTrackerTracks
Definition: GlobalMuonTrajectoryBuilder.h:50
GlobalMuonTrajectoryBuilder::theTkTrackLabel
edm::InputTag theTkTrackLabel
Definition: GlobalMuonTrajectoryBuilder.h:48