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...
 
 ~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 ( 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(), and theTkTrackLabel.

60 
61 {
62  theTkTrackLabel = par.getParameter<edm::InputTag>("TrackerCollectionLabel");
64 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
edm::EDGetTokenT< reco::TrackCollection > allTrackerTracksToken
GlobalTrajectoryBuilderBase(const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
constructor with Parameter Set and MuonServiceProxy
GlobalMuonTrajectoryBuilder::~GlobalMuonTrajectoryBuilder ( )
override

destructor

Definition at line 70 of file GlobalMuonTrajectoryBuilder.cc.

70 {}

Member Function Documentation

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

make a TrackCand collection using tracker Track, Trajectory information

Implements GlobalTrajectoryBuilderBase.

Definition at line 154 of file GlobalMuonTrajectoryBuilder.cc.

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

Referenced by trajectories().

155  {
156  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|makeTkCandCollection";
157 
158  vector<TrackCand> tkCandColl;
159 
160  vector<TrackCand> tkTrackCands;
161 
162  for (unsigned int position = 0; position != allTrackerTracks->size(); ++position) {
164  TrackCand tkCand = TrackCand((Trajectory*)nullptr, tkTrackRef);
165  tkTrackCands.push_back(tkCand);
166  }
167 
168  tkCandColl = chooseRegionalTrackerTracks(staCand, tkTrackCands);
169 
170  return tkCandColl;
171 }
std::pair< const Trajectory *, reco::TrackRef > TrackCand
std::vector< TrackCand > chooseRegionalTrackerTracks(const TrackCand &, const std::vector< TrackCand > &)
choose tracker tracks within region of interest
edm::Handle< reco::TrackCollection > allTrackerTracks
static int position[264][3]
Definition: ReadPGInfo.cc:289
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.

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

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 }
#define LogDebug(id)
edm::EDGetTokenT< reco::TrackCollection > allTrackerTracksToken
void setEvent(const edm::Event &) override
pass the Event to the algo at each event
edm::Handle< reco::TrackCollection > allTrackerTracks
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.

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

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  MuonCandidate* muonCand = new MuonCandidate(nullptr, staCand.second, (*tkt).second, nullptr);
120  tkTrajs.push_back(muonCand);
121  }
122 
123  if (tkTrajs.empty()) {
124  LogTrace(category) << " tkTrajs empty";
125  if (staCandIn.first == nullptr)
126  delete staCand.first;
127 
128  return CandidateContainer();
129  }
130 
131  CandidateContainer result = build(staCand, tkTrajs);
132  LogTrace(category) << " Found " << result.size() << " GLBMuons from one STACand";
133 
134  // free memory
135  if (staCandIn.first == nullptr)
136  delete staCand.first;
137 
138  for (CandidateContainer::const_iterator it = tkTrajs.begin(); it != tkTrajs.end(); ++it) {
139  if ((*it)->trajectory())
140  delete (*it)->trajectory();
141  if ((*it)->trackerTrajectory())
142  delete (*it)->trackerTrajectory();
143  if (*it)
144  delete (*it);
145  }
146  tkTrajs.clear();
147 
148  return result;
149 }
MuonCandidate::CandidateContainer CandidateContainer
GlobalMuonTrackMatcher * trackMatcher() const
std::pair< const Trajectory *, reco::TrackRef > TrackCand
std::vector< TrackCand > makeTkCandCollection(const TrackCand &) override
make a TrackCand collection using tracker Track, Trajectory information
double match(const TrackCand &sta, const TrackCand &track, int matchOption=0, int surfaceOption=1) const
#define LogTrace(id)
MuonTrajectoryBuilder::CandidateContainer build(const TrackCand &, MuonTrajectoryBuilder::CandidateContainer &) const
build combined trajectory from sta Track and tracker RecHits

Member Data Documentation

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

Definition at line 50 of file GlobalMuonTrajectoryBuilder.h.

Referenced by makeTkCandCollection(), and setEvent().

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

Definition at line 49 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().

edm::InputTag GlobalMuonTrajectoryBuilder::theTkTrackLabel
private

Definition at line 48 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().