CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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...
 
virtual void setEvent (const edm::Event &)
 pass the Event to the algo at each event More...
 
MuonTrajectoryBuilder::CandidateContainer trajectories (const TrackCand &)
 reconstruct trajectories from standalone and tracker only Tracks More...
 
 ~GlobalMuonTrajectoryBuilder ()
 destructor More...
 
- Public Member Functions inherited from GlobalTrajectoryBuilderBase
 GlobalTrajectoryBuilderBase (const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
 constructor with Parameter Set and MuonServiceProxy More...
 
MuonTrajectoryBuilder::TrajectoryContainer trajectories (const TrajectorySeed &)
 dummy implementation, unused in this class More...
 
virtual ~GlobalTrajectoryBuilderBase ()
 destructor More...
 
- Public Member Functions inherited from MuonTrajectoryBuilder
 MuonTrajectoryBuilder ()
 constructor More...
 
virtual ~MuonTrajectoryBuilder ()
 destructor More...
 

Private Member Functions

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

Private Attributes

edm::Handle
< reco::TrackCollection
allTrackerTracks
 
edm::EDGetTokenT
< reco::TrackCollection
allTrackerTracksToken
 
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::TrackRef
TrackCand
 
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 23 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 
63  theTkTrackLabel = par.getParameter<edm::InputTag>("TrackerCollectionLabel");
65 
66 }
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
const MuonServiceProxy * service() const
GlobalTrajectoryBuilderBase(const edm::ParameterSet &, const MuonServiceProxy *, edm::ConsumesCollector &)
constructor with Parameter Set and MuonServiceProxy
GlobalMuonTrajectoryBuilder::~GlobalMuonTrajectoryBuilder ( )

destructor

Definition at line 73 of file GlobalMuonTrajectoryBuilder.cc.

73  {
74 }

Member Function Documentation

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

make a TrackCand collection using tracker Track, Trajectory information

Implements GlobalTrajectoryBuilderBase.

Definition at line 159 of file GlobalMuonTrajectoryBuilder.cc.

References allTrackerTracks, python.rootplot.argparse::category, GlobalTrajectoryBuilderBase::chooseRegionalTrackerTracks(), position, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by trajectories().

159  {
160 
161  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|makeTkCandCollection";
162 
163  vector<TrackCand> tkCandColl;
164 
165  vector<TrackCand> tkTrackCands;
166 
167  for ( unsigned int position = 0; position != allTrackerTracks->size(); ++position ) {
169  TrackCand tkCand = TrackCand((Trajectory*)(0),tkTrackRef);
170  tkTrackCands.push_back(tkCand);
171  }
172 
173 
174  tkCandColl = chooseRegionalTrackerTracks(staCand,tkTrackCands);
175 
176  return tkCandColl;
177 
178 }
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:509
void GlobalMuonTrajectoryBuilder::setEvent ( const edm::Event event)
virtual

pass the Event to the algo at each event

Reimplemented from GlobalTrajectoryBuilderBase.

Definition at line 79 of file GlobalMuonTrajectoryBuilder.cc.

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

79  {
80 
81  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|setEvent";
82 
84 
85  // get tracker TrackCollection from Event
86  event.getByToken(allTrackerTracksToken,allTrackerTracks);
87  LogDebug(category)
88  << " Found " << allTrackerTracks->size()
89  << " tracker Tracks with label "<< theTkTrackLabel;
90 
91 }
#define LogDebug(id)
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
edm::EDGetTokenT< reco::TrackCollection > allTrackerTracksToken
edm::Handle< reco::TrackCollection > allTrackerTracks
MuonCandidate::CandidateContainer GlobalMuonTrajectoryBuilder::trajectories ( const TrackCand staCandIn)
virtual

reconstruct trajectories from standalone and tracker only Tracks

Implements MuonTrajectoryBuilder.

Definition at line 96 of file GlobalMuonTrajectoryBuilder.cc.

References GlobalTrajectoryBuilderBase::build(), python.rootplot.argparse::category, LogTrace, makeTkCandCollection(), GlobalMuonTrackMatcher::match(), query::result, AlCaHLTBitMon_QueryRunRegistry::string, GlobalTrajectoryBuilderBase::thePtCut, and GlobalTrajectoryBuilderBase::trackMatcher().

96  {
97 
98  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|trajectories";
99 
100  // cut on muons with low momenta
101  LogTrace(category) << " STA pt " << staCandIn.second->pt() << " rho " << staCandIn.second->innerMomentum().Rho() << " R " << staCandIn.second->innerMomentum().R() << " theCut " << thePtCut;
102 
103  // convert the STA track into a Trajectory if Trajectory not already present
104  TrackCand staCand(staCandIn);
105 
106  vector<TrackCand> regionalTkTracks = makeTkCandCollection(staCand);
107  LogTrace(category) << " Found " << regionalTkTracks.size() << " tracks within region of interest";
108 
109  // match tracker tracks to muon track
110  vector<TrackCand> trackerTracks = trackMatcher()->match(staCand, regionalTkTracks);
111  LogTrace(category) << " Found " << trackerTracks.size() << " matching tracker tracks within region of interest";
112 
113  if ( trackerTracks.empty() ) {
114  if ( staCandIn.first == 0) 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 
127  MuonCandidate* muonCand = new MuonCandidate( 0 ,staCand.second,(*tkt).second, 0);
128  tkTrajs.push_back(muonCand);
129  }
130 
131  if ( tkTrajs.empty() ) {
132  LogTrace(category) << " tkTrajs empty";
133  if ( staCandIn.first == 0) delete staCand.first;
134 
135  return CandidateContainer();
136  }
137 
138  CandidateContainer result = build(staCand, tkTrajs);
139  LogTrace(category) << " Found "<< result.size() << " GLBMuons from one STACand";
140 
141  // free memory
142  if ( staCandIn.first == 0) delete staCand.first;
143 
144  for( CandidateContainer::const_iterator it = tkTrajs.begin(); it != tkTrajs.end(); ++it) {
145  if ( (*it)->trajectory() ) delete (*it)->trajectory();
146  if ( (*it)->trackerTrajectory() ) delete (*it)->trackerTrajectory();
147  if ( *it ) delete (*it);
148  }
149  tkTrajs.clear();
150 
151 
152  return result;
153 
154 }
std::vector< TrackCand > makeTkCandCollection(const TrackCand &)
make a TrackCand collection using tracker Track, Trajectory information
MuonCandidate::CandidateContainer CandidateContainer
GlobalMuonTrackMatcher * trackMatcher() const
std::pair< const Trajectory *, reco::TrackRef > TrackCand
tuple result
Definition: query.py:137
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 48 of file GlobalMuonTrajectoryBuilder.h.

Referenced by makeTkCandCollection(), and setEvent().

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

Definition at line 47 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().

edm::InputTag GlobalMuonTrajectoryBuilder::theTkTrackLabel
private

Definition at line 46 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().