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
L3MuonTrajectoryBuilder Class Reference

#include <L3MuonTrajectoryBuilder.h>

Inheritance diagram for L3MuonTrajectoryBuilder:
GlobalTrajectoryBuilderBase MuonTrajectoryBuilder

Public Member Functions

 L3MuonTrajectoryBuilder (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...
 
 ~L3MuonTrajectoryBuilder ()
 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 theTkCollName
 
TrajectoryCleanertheTrajectoryCleaner
 

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:
2009/02/24 07:07:17
Revision:
1.9
Author
N. Neumeister Purdue University
C. Liu Purdue University
A. Everett Purdue University

Definition at line 30 of file L3MuonTrajectoryBuilder.h.

Constructor & Destructor Documentation

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

constructor with Parameter Set and MuonServiceProxy

Definition at line 71 of file L3MuonTrajectoryBuilder.cc.

References edm::ParameterSet::getParameter(), theTkCollName, and theTrajectoryCleaner.

73 
75 
76  theTkCollName = par.getParameter<edm::InputTag>("tkTrajLabel");
77 
78 }
T getParameter(std::string const &) const
GlobalTrajectoryBuilderBase(const edm::ParameterSet &, const MuonServiceProxy *)
constructor with Parameter Set and MuonServiceProxy
const MuonServiceProxy * service() const
TrajectoryCleaner * theTrajectoryCleaner
L3MuonTrajectoryBuilder::~L3MuonTrajectoryBuilder ( )

destructor

Definition at line 85 of file L3MuonTrajectoryBuilder.cc.

References theTrajectoryCleaner.

85  {
87 }
TrajectoryCleaner * theTrajectoryCleaner

Member Function Documentation

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

make a TrackCand collection using tracker Track, Trajectory information

Implements GlobalTrajectoryBuilderBase.

Definition at line 178 of file L3MuonTrajectoryBuilder.cc.

References allTrackerTracks, python.rootplot.argparse::category, position, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by trajectories().

178  {
179 
180  const std::string category = "Muon|RecoMuon|L3MuonTrajectoryBuilder|makeTkCandCollection";
181 
182  vector<TrackCand> tkCandColl;
183 
184  vector<TrackCand> tkTrackCands;
185 
186  for ( unsigned int position = 0; position != allTrackerTracks->size(); ++position ) {
188  TrackCand tkCand = TrackCand((Trajectory*)(0),tkTrackRef);
189  tkCandColl.push_back(tkCand);
190  }
191 
192  for(vector<TrackCand>::const_iterator tk = tkCandColl.begin(); tk != tkCandColl.end() ; ++tk) {
193  edm::Ref<L3MuonTrajectorySeedCollection> l3seedRef = (*tk).second->seedRef().castTo<edm::Ref<L3MuonTrajectorySeedCollection> >() ;
194  reco::TrackRef staTrack = l3seedRef->l2Track();
195  if(staTrack == (staCand.second) ) tkTrackCands.push_back(*tk);
196  }
197 
198  return tkTrackCands;
199 
200 }
std::pair< const Trajectory *, reco::TrackRef > TrackCand
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
edm::Handle< reco::TrackCollection > allTrackerTracks
void L3MuonTrajectoryBuilder::setEvent ( const edm::Event event)
virtual

pass the Event to the algo at each event

Reimplemented from GlobalTrajectoryBuilderBase.

Definition at line 92 of file L3MuonTrajectoryBuilder.cc.

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

92  {
93 
94  const std::string category = "Muon|RecoMuon|L3MuonTrajectoryBuilder|setEvent";
95 
97 
98  // get tracker TrackCollection from Event
99  event.getByLabel(theTkCollName,allTrackerTracks);
100  LogDebug(category)
101  << "Found " << allTrackerTracks->size()
102  << " tracker Tracks with label "<< theTkCollName;
103 
104 }
#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 L3MuonTrajectoryBuilder::trajectories ( const TrackCand staCandIn)
virtual

reconstruct trajectories from standalone and tracker only Tracks

Implements MuonTrajectoryBuilder.

Definition at line 109 of file L3MuonTrajectoryBuilder.cc.

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

109  {
110 
111  const std::string category = "Muon|RecoMuon|L3MuonTrajectoryBuilder|trajectories";
112 
113  // cut on muons with low momenta
114  if ( (staCandIn).second->pt() < thePtCut || (staCandIn).second->innerMomentum().Rho() < thePtCut || (staCandIn).second->innerMomentum().R() < 2.5 ) return CandidateContainer();
115 
116  // convert the STA track into a Trajectory if Trajectory not already present
117  TrackCand staCand(staCandIn);
118 
119  vector<TrackCand> trackerTracks;
120 
121  vector<TrackCand> regionalTkTracks = makeTkCandCollection(staCand);
122  LogDebug(category) << "Found " << regionalTkTracks.size() << " tracks within region of interest";
123 
124  // match tracker tracks to muon track
125  trackerTracks = trackMatcher()->match(staCand, regionalTkTracks);
126 
127  LogDebug(category) << "Found " << trackerTracks.size() << " matching tracker tracks within region of interest";
128  if ( trackerTracks.empty() ) return CandidateContainer();
129 
130  // build a combined tracker-muon MuonCandidate
131  //
132  // turn tkMatchedTracks into MuonCandidates
133  //
134  LogDebug(category) << "turn tkMatchedTracks into MuonCandidates";
135  CandidateContainer tkTrajs;
136  for (vector<TrackCand>::const_iterator tkt = trackerTracks.begin(); tkt != trackerTracks.end(); tkt++) {
137  if ((*tkt).first != 0 && (*tkt).first->isValid()) {
138  //
139  MuonCandidate* muonCand = new MuonCandidate( 0 ,staCand.second,(*tkt).second, new Trajectory(*(*tkt).first));
140  tkTrajs.push_back(muonCand);
141  // LogTrace(category) << "tpush";
142  //
143  } else {
144  MuonCandidate* muonCand = new MuonCandidate( 0 ,staCand.second,(*tkt).second, 0);
145  tkTrajs.push_back(muonCand);
146  }
147  }
148 
149  if ( tkTrajs.empty() ) {
150  LogDebug(category) << "tkTrajs empty";
151  return CandidateContainer();
152  }
153 
154  CandidateContainer result = build(staCand, tkTrajs);
155  LogDebug(category) << "Found "<< result.size() << " L3Muons from one L2Cand";
156 
157  // free memory
158  if ( staCandIn.first == 0) delete staCand.first;
159 
160  for( CandidateContainer::const_iterator it = tkTrajs.begin(); it != tkTrajs.end(); ++it) {
161  if ( (*it)->trajectory() ) delete (*it)->trajectory();
162  if ( (*it)->trackerTrajectory() ) delete (*it)->trackerTrajectory();
163  if ( *it ) delete (*it);
164  }
165  tkTrajs.clear();
166 
167  for ( vector<TrackCand>::const_iterator is = regionalTkTracks.begin(); is != regionalTkTracks.end(); ++is) {
168  delete (*is).first;
169  }
170 
171  return result;
172 
173 }
#define LogDebug(id)
MuonCandidate::CandidateContainer CandidateContainer
GlobalMuonTrackMatcher * trackMatcher() const
std::pair< const Trajectory *, reco::TrackRef > TrackCand
U second(std::pair< T, U > const &p)
tuple result
Definition: query.py:137
std::vector< TrackCand > makeTkCandCollection(const TrackCand &)
make a TrackCand collection using tracker Track, Trajectory information
double match(const TrackCand &sta, const TrackCand &track, int matchOption=0, int surfaceOption=1) const
MuonTrajectoryBuilder::CandidateContainer build(const TrackCand &, MuonTrajectoryBuilder::CandidateContainer &) const
build combined trajectory from sta Track and tracker RecHits

Member Data Documentation

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

Definition at line 56 of file L3MuonTrajectoryBuilder.h.

Referenced by makeTkCandCollection(), and setEvent().

edm::InputTag L3MuonTrajectoryBuilder::theTkCollName
private

Definition at line 55 of file L3MuonTrajectoryBuilder.h.

Referenced by L3MuonTrajectoryBuilder(), and setEvent().

TrajectoryCleaner* L3MuonTrajectoryBuilder::theTrajectoryCleaner
private

Definition at line 53 of file L3MuonTrajectoryBuilder.h.

Referenced by L3MuonTrajectoryBuilder(), and ~L3MuonTrajectoryBuilder().