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 *)
 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 *)
 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::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

Date:
2010/03/08 15:44:58
Revision:
1.68
Author
N. Neumeister Purdue University
C. Liu Purdue University
A. Everett Purdue University

Definition at line 24 of file GlobalMuonTrajectoryBuilder.h.

Constructor & Destructor Documentation

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

constructor with Parameter Set and MuonServiceProxy

Definition at line 58 of file GlobalMuonTrajectoryBuilder.cc.

References edm::ParameterSet::getParameter(), and theTkTrackLabel.

60 
61 {
62 
63  theTkTrackLabel = par.getParameter<edm::InputTag>("TrackerCollectionLabel");
64 
65 }
T getParameter(std::string const &) const
GlobalTrajectoryBuilderBase(const edm::ParameterSet &, const MuonServiceProxy *)
constructor with Parameter Set and MuonServiceProxy
const MuonServiceProxy * service() const
GlobalMuonTrajectoryBuilder::~GlobalMuonTrajectoryBuilder ( )

destructor

Definition at line 72 of file GlobalMuonTrajectoryBuilder.cc.

72  {
73 }

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

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

Referenced by trajectories().

158  {
159 
160  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|makeTkCandCollection";
161 
162  vector<TrackCand> tkCandColl;
163 
164  vector<TrackCand> tkTrackCands;
165 
166  for ( unsigned int position = 0; position != allTrackerTracks->size(); ++position ) {
168  TrackCand tkCand = TrackCand((Trajectory*)(0),tkTrackRef);
169  tkTrackCands.push_back(tkCand);
170  }
171 
172 
173  tkCandColl = chooseRegionalTrackerTracks(staCand,tkTrackCands);
174 
175  return tkCandColl;
176 
177 }
std::pair< const Trajectory *, reco::TrackRef > TrackCand
std::vector< TrackCand > chooseRegionalTrackerTracks(const TrackCand &, const std::vector< TrackCand > &)
choose tracker tracks within region of interest
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
edm::Handle< reco::TrackCollection > allTrackerTracks
void GlobalMuonTrajectoryBuilder::setEvent ( const edm::Event event)
virtual

pass the Event to the algo at each event

Reimplemented from GlobalTrajectoryBuilderBase.

Definition at line 78 of file GlobalMuonTrajectoryBuilder.cc.

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

78  {
79 
80  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|setEvent";
81 
83 
84  // get tracker TrackCollection from Event
85  event.getByLabel(theTkTrackLabel,allTrackerTracks);
86  LogDebug(category)
87  << " Found " << allTrackerTracks->size()
88  << " tracker Tracks with label "<< theTkTrackLabel;
89 
90 }
#define LogDebug(id)
virtual void setEvent(const edm::Event &)
pass the Event to the algo at each event
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 95 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().

95  {
96 
97  const std::string category = "Muon|RecoMuon|GlobalMuonTrajectoryBuilder|trajectories";
98 
99  // cut on muons with low momenta
100  LogTrace(category) << " STA pt " << staCandIn.second->pt() << " rho " << staCandIn.second->innerMomentum().Rho() << " 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 == 0) delete staCand.first;
114 
115  return CandidateContainer();
116  }
117 
118  // build a combined tracker-muon MuonCandidate
119  //
120  // turn tkMatchedTracks into MuonCandidates
121  //
122  LogTrace(category) << " Turn tkMatchedTracks into MuonCandidates";
123  CandidateContainer tkTrajs;
124  for (vector<TrackCand>::const_iterator tkt = trackerTracks.begin(); tkt != trackerTracks.end(); tkt++) {
125 
126  MuonCandidate* muonCand = new MuonCandidate( 0 ,staCand.second,(*tkt).second, 0);
127  tkTrajs.push_back(muonCand);
128  }
129 
130  if ( tkTrajs.empty() ) {
131  LogTrace(category) << " tkTrajs empty";
132  if ( staCandIn.first == 0) 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 == 0) delete staCand.first;
142 
143  for( CandidateContainer::const_iterator it = tkTrajs.begin(); it != tkTrajs.end(); ++it) {
144  if ( (*it)->trajectory() ) delete (*it)->trajectory();
145  if ( (*it)->trackerTrajectory() ) delete (*it)->trackerTrajectory();
146  if ( *it ) delete (*it);
147  }
148  tkTrajs.clear();
149 
150 
151  return result;
152 
153 }
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 49 of file GlobalMuonTrajectoryBuilder.h.

Referenced by makeTkCandCollection(), and setEvent().

edm::InputTag GlobalMuonTrajectoryBuilder::theTkTrackLabel
private

Definition at line 47 of file GlobalMuonTrajectoryBuilder.h.

Referenced by GlobalMuonTrajectoryBuilder(), and setEvent().