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::TrajectoryContainer trajectories (const TrajectorySeed &) override
 dummy implementation, unused in this class More...
 
MuonTrajectoryBuilder::CandidateContainer trajectories (const TrackCand &) override
 reconstruct trajectories from standalone and tracker only Tracks 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::EDGetTokenT< reco::VertexCollectionprimaryVertexToken
 
bool selectHighPurity_
 
edm::InputTag thePrimaryVtxLabel
 
edm::InputTag theTkTrackLabel
 
edm::Handle< reco::VertexCollectionvertexCollection
 

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 28 of file GlobalMuonTrajectoryBuilder.h.

Constructor & Destructor Documentation

◆ GlobalMuonTrajectoryBuilder()

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

constructor with Parameter Set and MuonServiceProxy

Definition at line 56 of file GlobalMuonTrajectoryBuilder.cc.

References allTrackerTracksToken, edm::ConsumesCollector::consumes(), edm::ParameterSet::getParameter(), edm::ConsumesCollector::mayConsume(), primaryVertexToken, selectHighPurity_, thePrimaryVtxLabel, and theTkTrackLabel.

60 
61 {
62  theTkTrackLabel = par.getParameter<edm::InputTag>("TrackerCollectionLabel");
64  thePrimaryVtxLabel = par.getParameter<edm::InputTag>("VertexCollectionLabel");
66  selectHighPurity_ = par.getParameter<bool>("selectHighPurity");
67 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< reco::TrackCollection > allTrackerTracksToken
edm::EDGetTokenT< reco::VertexCollection > primaryVertexToken
GlobalTrajectoryBuilderBase(const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
constructor with Parameter Set and MuonServiceProxy

◆ ~GlobalMuonTrajectoryBuilder()

GlobalMuonTrajectoryBuilder::~GlobalMuonTrajectoryBuilder ( )
override

destructor

Definition at line 73 of file GlobalMuonTrajectoryBuilder.cc.

73 {}

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 150 of file GlobalMuonTrajectoryBuilder.cc.

References allTrackerTracks, validateAlignments::category, GlobalTrajectoryBuilderBase::chooseRegionalTrackerTracks(), reco::TrackBase::highPurity, position, edm::Handle< T >::product(), selectHighPurity_, AlCaHLTBitMon_QueryRunRegistry::string, and vertexCollection.

Referenced by trajectories().

151  {
152  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|makeTkCandCollection";
153 
154  vector<TrackCand> tkCandColl;
155 
156  vector<TrackCand> tkTrackCands;
157 
158  for (unsigned int position = 0; position != allTrackerTracks->size(); ++position) {
160  TrackCand tkCand = TrackCand((Trajectory*)nullptr, tkTrackRef);
161  if (selectHighPurity_ && !tkTrackRef->quality(reco::TrackBase::highPurity)) {
162  const reco::VertexCollection* recoVertices = vertexCollection.product();
163  if (!(*recoVertices)[0].isFake())
164  continue;
165  }
166  tkTrackCands.push_back(tkCand);
167  }
168 
169  tkCandColl = chooseRegionalTrackerTracks(staCand, tkTrackCands);
170 
171  return tkCandColl;
172 }
std::pair< const Trajectory *, reco::TrackRef > TrackCand
T const * product() const
Definition: Handle.h:70
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::vector< TrackCand > chooseRegionalTrackerTracks(const TrackCand &, const std::vector< TrackCand > &)
choose tracker tracks within region of interest
edm::Handle< reco::TrackCollection > allTrackerTracks
edm::Handle< reco::VertexCollection > vertexCollection
static int position[264][3]
Definition: ReadPGInfo.cc:289

◆ setEvent()

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

pass the Event to the algo at each event

Implements MuonTrajectoryBuilder.

Definition at line 78 of file GlobalMuonTrajectoryBuilder.cc.

References allTrackerTracks, allTrackerTracksToken, validateAlignments::category, LogDebug, primaryVertexToken, GlobalTrajectoryBuilderBase::setEvent(), AlCaHLTBitMon_QueryRunRegistry::string, thePrimaryVtxLabel, theTkTrackLabel, and vertexCollection.

78  {
79  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|setEvent";
80 
82 
83  // get tracker TrackCollection from Event
84  event.getByToken(allTrackerTracksToken, allTrackerTracks);
85  LogDebug(category) << " Found " << allTrackerTracks->size() << " tracker Tracks with label " << theTkTrackLabel;
86 
87  // get primary vertex from Event
88  event.getByToken(primaryVertexToken, vertexCollection);
89  LogDebug(category) << " Found " << vertexCollection->size() << " tracker Tracks with label " << thePrimaryVtxLabel;
90 }
edm::EDGetTokenT< reco::TrackCollection > allTrackerTracksToken
edm::EDGetTokenT< reco::VertexCollection > primaryVertexToken
void setEvent(const edm::Event &) override
pass the Event to the algo at each event
edm::Handle< reco::TrackCollection > allTrackerTracks
edm::Handle< reco::VertexCollection > vertexCollection
Definition: event.py:1
#define LogDebug(id)

◆ trajectories() [1/2]

MuonTrajectoryBuilder::TrajectoryContainer GlobalTrajectoryBuilderBase::trajectories
inlineoverride

dummy implementation, unused in this class

Definition at line 66 of file GlobalTrajectoryBuilderBase.h.

66  {
68  }
MuonCandidate::TrajectoryContainer TrajectoryContainer

◆ trajectories() [2/2]

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

reconstruct trajectories from standalone and tracker only Tracks

Implements MuonTrajectoryBuilder.

Definition at line 95 of file GlobalMuonTrajectoryBuilder.cc.

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

95  {
96  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|trajectories";
97 
98  // cut on muons with low momenta
99  LogTrace(category) << " STA pt " << staCandIn.second->pt() << " rho " << staCandIn.second->innerMomentum().Rho()
100  << " R " << staCandIn.second->innerMomentum().R() << " theCut " << thePtCut;
101 
102  // convert the STA track into a Trajectory if Trajectory not already present
103  TrackCand staCand(staCandIn);
104 
105  vector<TrackCand> regionalTkTracks = makeTkCandCollection(staCand);
106  LogTrace(category) << " Found " << regionalTkTracks.size() << " tracks within region of interest";
107 
108  // match tracker tracks to muon track
109  vector<TrackCand> trackerTracks = trackMatcher()->match(staCand, regionalTkTracks);
110  LogTrace(category) << " Found " << trackerTracks.size() << " matching tracker tracks within region of interest";
111 
112  if (trackerTracks.empty()) {
113  if (staCandIn.first == nullptr)
114  delete staCand.first;
115 
116  return CandidateContainer();
117  }
118 
119  // build a combined tracker-muon MuonCandidate
120  //
121  // turn tkMatchedTracks into MuonCandidates
122  //
123  LogTrace(category) << " Turn tkMatchedTracks into MuonCandidates";
124  CandidateContainer tkTrajs;
125  for (vector<TrackCand>::const_iterator tkt = trackerTracks.begin(); tkt != trackerTracks.end(); tkt++) {
126  tkTrajs.push_back(std::make_unique<MuonCandidate>(nullptr, staCand.second, (*tkt).second, nullptr));
127  }
128 
129  if (tkTrajs.empty()) {
130  LogTrace(category) << " tkTrajs empty";
131  if (staCandIn.first == nullptr)
132  delete staCand.first;
133 
134  return CandidateContainer();
135  }
136 
137  CandidateContainer result = build(staCand, tkTrajs);
138  LogTrace(category) << " Found " << result.size() << " GLBMuons from one STACand";
139 
140  // free memory
141  if (staCandIn.first == nullptr)
142  delete staCand.first;
143 
144  return result;
145 }
MuonTrajectoryBuilder::CandidateContainer build(const TrackCand &, MuonTrajectoryBuilder::CandidateContainer &) const
build combined trajectory from sta Track and tracker RecHits
MuonCandidate::CandidateContainer CandidateContainer
std::pair< const Trajectory *, reco::TrackRef > TrackCand
std::vector< TrackCand > makeTkCandCollection(const TrackCand &) override
make a TrackCand collection using tracker Track, Trajectory information
#define LogTrace(id)
double match(const TrackCand &sta, const TrackCand &track, int matchOption=0, int surfaceOption=1) const
GlobalMuonTrackMatcher * trackMatcher() const

Member Data Documentation

◆ allTrackerTracks

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

Definition at line 51 of file GlobalMuonTrajectoryBuilder.h.

Referenced by makeTkCandCollection(), and setEvent().

◆ allTrackerTracksToken

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

Definition at line 50 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().

◆ primaryVertexToken

edm::EDGetTokenT<reco::VertexCollection> GlobalMuonTrajectoryBuilder::primaryVertexToken
private

Definition at line 53 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().

◆ selectHighPurity_

bool GlobalMuonTrajectoryBuilder::selectHighPurity_
private

◆ thePrimaryVtxLabel

edm::InputTag GlobalMuonTrajectoryBuilder::thePrimaryVtxLabel
private

Definition at line 52 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().

◆ theTkTrackLabel

edm::InputTag GlobalMuonTrajectoryBuilder::theTkTrackLabel
private

Definition at line 49 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().

◆ vertexCollection

edm::Handle<reco::VertexCollection> GlobalMuonTrajectoryBuilder::vertexCollection
private

Definition at line 54 of file GlobalMuonTrajectoryBuilder.h.

Referenced by makeTkCandCollection(), and setEvent().