CMS 3D CMS Logo

GlobalMuonTrackMatcher Class Reference

Match a standalone muon track with the most compatible tracker tracks in a TrackCollection. More...

#include <RecoMuon/GlobalTrackingTools/interface/GlobalMuonTrackMatcher.h>

List of all members.

Public Types

typedef std::pair< const
Trajectory *, reco::TrackRef
TrackCand

Public Member Functions

 GlobalMuonTrackMatcher (const edm::ParameterSet &, const MuonServiceProxy *)
 constructor
std::vector< TrackCandmatch (const TrackCand &sta, const std::vector< TrackCand > &tracks) const
 choose all tracks with a matching-chi2 less than Chi2Cut
double match (const TrackCand &sta, const TrackCand &track, int matchOption=0, int surfaceOption=1) const
 check if two tracks are compatible matchOption: 0 = chi2, 1 = distance, 2 = deltaR surfaceOption: 0 = outermost tracker surface, 1 = innermost muon system surface
bool match (const TrackCand &sta, const TrackCand &track) const
 check if two tracks are compatible (less than Chi2Cut, DeltaDCut, DeltaRCut)
std::vector< TrackCand >
::const_iterator 
matchOne (const TrackCand &sta, const std::vector< TrackCand > &tracks) const
 choose the one tracker track which best matches a muon track
virtual ~GlobalMuonTrackMatcher ()
 destructor

Private Member Functions

std::pair
< TrajectoryStateOnSurface,
TrajectoryStateOnSurface
convertToTSOSMuHit (const TrackCand &, const TrackCand &) const
std::pair
< TrajectoryStateOnSurface,
TrajectoryStateOnSurface
convertToTSOSTk (const TrackCand &, const TrackCand &) const
std::pair
< TrajectoryStateOnSurface,
TrajectoryStateOnSurface
convertToTSOSTkHit (const TrackCand &, const TrackCand &) const
double match_Chi2 (const TrajectoryStateOnSurface &, const TrajectoryStateOnSurface &) const
double match_d (const TrajectoryStateOnSurface &, const TrajectoryStateOnSurface &) const
double match_D (const TrajectoryStateOnSurface &, const TrajectoryStateOnSurface &) const
double match_dist (const TrajectoryStateOnSurface &, const TrajectoryStateOnSurface &) const
double match_R_IP (const TrackCand &, const TrackCand &) const
double match_Rmom (const TrajectoryStateOnSurface &, const TrajectoryStateOnSurface &) const
double match_Rpos (const TrajectoryStateOnSurface &, const TrajectoryStateOnSurface &) const
bool samePlane (const TrajectoryStateOnSurface &, const TrajectoryStateOnSurface &) const

Private Attributes

double theDeltaD
double theDeltaR
double theMaxChi2
double theMinP
double theMinPt
std::string theOutPropagatorName
const MuonServiceProxytheService


Detailed Description

Match a standalone muon track with the most compatible tracker tracks in a TrackCollection.

GlobalMuonTrackMatcher is used during global muon reconstruction to check the compatability of a tracker track with a standalone muon track. The compatability is determined based on a chi2 comparison of the local parameters of the two corresponding TrajectoryStates on the surface of the innermost muon measurement. If the comparison of local parameters fails to yield any matches, then it makes a comparison of the TSOS global positon. If there is still no match, then it matches the standalone muon with the tracker track that is closest in eta-phi space.

Date
2008/05/09 20:20:38
Revision
1.7

Author:
Chang Liu Purdue University

Adam Everett Purdue University

Norbert Neumeister Purdue University

Definition at line 38 of file GlobalMuonTrackMatcher.h.


Member Typedef Documentation

typedef std::pair<const Trajectory*,reco::TrackRef> GlobalMuonTrackMatcher::TrackCand

Definition at line 42 of file GlobalMuonTrackMatcher.h.


Constructor & Destructor Documentation

GlobalMuonTrackMatcher::GlobalMuonTrackMatcher ( const edm::ParameterSet par,
const MuonServiceProxy *  service 
)

constructor

Definition at line 51 of file GlobalMuonTrackMatcher.cc.

References edm::ParameterSet::getParameter(), theDeltaD, theDeltaR, theMaxChi2, theMinP, theMinPt, and theOutPropagatorName.

00052                                                                                 : 
00053    theService(service) {
00054   
00055   theMaxChi2 = par.getParameter<double>("Chi2Cut");
00056   theDeltaD = par.getParameter<double>("DeltaDCut");
00057   theDeltaR = par.getParameter<double>("DeltaRCut");
00058   theMinP = par.getParameter<double>("MinP");
00059   theMinPt = par.getParameter<double>("MinPt");
00060  
00061   theOutPropagatorName = par.getParameter<string>("Propagator");
00062 
00063 }

GlobalMuonTrackMatcher::~GlobalMuonTrackMatcher (  )  [virtual]

destructor

Definition at line 69 of file GlobalMuonTrackMatcher.cc.

00069                                                 {
00070 
00071 }


Member Function Documentation

std::pair< TrajectoryStateOnSurface, TrajectoryStateOnSurface > GlobalMuonTrackMatcher::convertToTSOSMuHit ( const TrackCand staCand,
const TrackCand tkCand 
) const [private]

Definition at line 317 of file GlobalMuonTrackMatcher.cc.

References empty, TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::isValid(), LogDebug, PV3DBase< T, PVType, FrameType >::mag(), TrajectoryStateTransform::outerStateOnSurface(), PV3DBase< T, PVType, FrameType >::perp(), theMinP, theMinPt, theOutPropagatorName, and theService.

Referenced by match(), and matchOne().

00318                                                                           {
00319   
00320   const string category = "GlobalMuonTrackMatcher";
00321 
00322   TrajectoryStateOnSurface empty; 
00323 
00324   TransientTrack muTT(*staCand.second,&*theService->magneticField(),theService->trackingGeometry());
00325   TrajectoryStateOnSurface innerMuTSOS = muTT.innermostMeasurementState();
00326 
00327   TrajectoryStateOnSurface outerTkTsos;
00328   if ( tkCand.second.isNonnull() ) {
00329     // make sure the tracker track has enough momentum to reach the muon chambers
00330     if ( !(tkCand.second->p() < theMinP || tkCand.second->pt() < theMinPt ) ) {
00331       TrajectoryStateTransform tsTransform;
00332       outerTkTsos = tsTransform.outerStateOnSurface(*tkCand.second,*theService->trackingGeometry(),&*theService->magneticField());
00333     }
00334   } else {
00335     const GlobalVector& mom = tkCand.first->lastMeasurement().updatedState().globalMomentum();
00336     if  ( !(mom.mag() < theMinP || mom.perp() < theMinPt) ) {
00337       outerTkTsos = tkCand.first->lastMeasurement().updatedState();
00338     }
00339   }
00340 
00341   if ( !innerMuTSOS.isValid() || !outerTkTsos.isValid() ) {
00342     LogDebug(category) << "A TSOS validity problem! MuTSOS " << innerMuTSOS.isValid() << " TkTSOS " << outerTkTsos.isValid();
00343     return pair<TrajectoryStateOnSurface,TrajectoryStateOnSurface>(empty,empty);
00344   }
00345   
00346   const Surface& refSurface = innerMuTSOS.surface();
00347   TrajectoryStateOnSurface tkAtMu = theService->propagator(theOutPropagatorName)->propagate(*outerTkTsos.freeState(),refSurface);
00348   
00349   if ( !tkAtMu.isValid() ) {
00350     LogDebug(category) << "Could not propagate Muon and Tracker track to the same muon hit surface!";
00351     return pair<TrajectoryStateOnSurface,TrajectoryStateOnSurface>(empty,empty);    
00352   }
00353   
00354   return pair<TrajectoryStateOnSurface,TrajectoryStateOnSurface>(innerMuTSOS, tkAtMu);
00355 
00356 }

std::pair< TrajectoryStateOnSurface, TrajectoryStateOnSurface > GlobalMuonTrackMatcher::convertToTSOSTk ( const TrackCand staCand,
const TrackCand tkCand 
) const [private]

Definition at line 255 of file GlobalMuonTrackMatcher.cc.

References empty, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::isValid(), LogDebug, PV3DBase< T, PVType, FrameType >::mag(), TrajectoryStateTransform::outerStateOnSurface(), PV3DBase< T, PVType, FrameType >::perp(), samePlane(), TrajectoryStateOnSurface::surface(), theMinP, theMinPt, theOutPropagatorName, and theService.

00256                                                                        {
00257   
00258   const string category = "GlobalMuonTrackMatcher";
00259 
00260   TrajectoryStateOnSurface empty; 
00261   
00262   TransientTrack muTT(*staCand.second,&*theService->magneticField(),theService->trackingGeometry());
00263   TrajectoryStateOnSurface impactMuTSOS = muTT.impactPointState();
00264 
00265   TrajectoryStateOnSurface outerTkTsos;
00266   if (tkCand.second.isNonnull()) {
00267     // make sure the tracker track has enough momentum to reach the muon chambers
00268     if ( !(tkCand.second->p() < theMinP || tkCand.second->pt() < theMinPt )) {
00269       TrajectoryStateTransform tsTransform;
00270       outerTkTsos = tsTransform.outerStateOnSurface(*tkCand.second,*theService->trackingGeometry(),&*theService->magneticField());
00271     }
00272   } else {
00273     const GlobalVector& mom = tkCand.first->firstMeasurement().updatedState().globalMomentum();
00274     if ( !(mom.mag() < theMinP || mom.perp() < theMinPt)) {
00275       outerTkTsos = tkCand.first->lastMeasurement().updatedState();
00276     }
00277   }
00278   
00279   if ( !impactMuTSOS.isValid() || !outerTkTsos.isValid() ) return pair<TrajectoryStateOnSurface,TrajectoryStateOnSurface>(empty,empty);
00280   
00281   // define StateOnTrackerBound object
00282   StateOnTrackerBound fromInside(&*theService->propagator(theOutPropagatorName));
00283   
00284   // extrapolate to outer tracker surface
00285   TrajectoryStateOnSurface tkTsosFromMu = fromInside(impactMuTSOS);
00286   TrajectoryStateOnSurface tkTsosFromTk = fromInside(outerTkTsos);
00287 
00288   if ( !samePlane(tkTsosFromMu,tkTsosFromTk) ) {
00289     // propagate tracker track to same surface as muon
00290     bool same1, same2;
00291     TrajectoryStateOnSurface newTkTsosFromTk, newTkTsosFromMu;
00292     if ( tkTsosFromMu.isValid() ) newTkTsosFromTk = theService->propagator(theOutPropagatorName)->propagate(outerTkTsos,tkTsosFromMu.surface());
00293     same1 = samePlane(newTkTsosFromTk,tkTsosFromMu);
00294     LogDebug(category) << "Propagating to same tracker surface (Mu):" << same1;
00295     if ( !same1 ) {
00296       if ( tkTsosFromTk.isValid() ) newTkTsosFromMu = theService->propagator(theOutPropagatorName)->propagate(impactMuTSOS,tkTsosFromTk.surface());
00297       same2 = samePlane(newTkTsosFromMu,tkTsosFromTk);
00298       LogDebug(category) << "Propagating to same tracker surface (Tk):" << same2;
00299     }
00300     if (same1) tkTsosFromTk = newTkTsosFromTk;
00301     else if (same2) tkTsosFromMu = newTkTsosFromMu;
00302     else  {
00303       LogDebug(category) << "Could not propagate Muon and Tracker track to the same tracker bound!";
00304       return pair<TrajectoryStateOnSurface,TrajectoryStateOnSurface>(empty, empty);
00305     }
00306   }
00307  
00308   return pair<TrajectoryStateOnSurface,TrajectoryStateOnSurface>(tkTsosFromMu, tkTsosFromTk);
00309 
00310 }

std::pair< TrajectoryStateOnSurface, TrajectoryStateOnSurface > GlobalMuonTrackMatcher::convertToTSOSTkHit ( const TrackCand staCand,
const TrackCand tkCand 
) const [private]

Definition at line 363 of file GlobalMuonTrackMatcher.cc.

References empty, TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::isValid(), LogDebug, PV3DBase< T, PVType, FrameType >::mag(), TrajectoryStateTransform::outerStateOnSurface(), PV3DBase< T, PVType, FrameType >::perp(), TrajectoryStateOnSurface::surface(), theMinP, theMinPt, theOutPropagatorName, and theService.

Referenced by match().

00364                                                                           {
00365   
00366   const string category = "GlobalMuonTrackMatcher";
00367 
00368   TrajectoryStateOnSurface empty; 
00369 
00370   TransientTrack muTT(*staCand.second,&*theService->magneticField(),theService->trackingGeometry());
00371   TrajectoryStateOnSurface impactMuTSOS = muTT.impactPointState();
00372 
00373   TrajectoryStateOnSurface outerTkTsos;
00374   if ( tkCand.second.isNonnull() ) {
00375     // make sure the tracker track has enough momentum to reach the muon chambers
00376     if ( !(tkCand.second->p() < theMinP || tkCand.second->pt() < theMinPt )) {
00377       TrajectoryStateTransform tsTransform;
00378       outerTkTsos = tsTransform.outerStateOnSurface(*tkCand.second,*theService->trackingGeometry(),&*theService->magneticField());
00379     }
00380   } else {
00381     const GlobalVector& mom = tkCand.first->lastMeasurement().updatedState().globalMomentum();
00382     if (!(mom.mag() < theMinP || mom.perp() < theMinPt)) {
00383       outerTkTsos = tkCand.first->lastMeasurement().updatedState();
00384     }
00385   }
00386 
00387   if ( !impactMuTSOS.isValid() || !outerTkTsos.isValid() ) {
00388     LogDebug(category) << "A TSOS validity problem! MuTSOS " << impactMuTSOS.isValid() << " TkTSOS " << outerTkTsos.isValid();
00389     return pair<TrajectoryStateOnSurface,TrajectoryStateOnSurface>(empty,empty);
00390   }
00391 
00392   const Surface& refSurface = outerTkTsos.surface();
00393   TrajectoryStateOnSurface muAtTk = theService->propagator(theOutPropagatorName)->propagate(*impactMuTSOS.freeState(),refSurface);
00394   
00395   if ( !muAtTk.isValid() ) {
00396     LogDebug(category) << "Could not propagate Muon and Tracker track to the same tracker hit surface!";
00397     return pair<TrajectoryStateOnSurface,TrajectoryStateOnSurface>(empty,empty);    
00398   }
00399 
00400   return pair<TrajectoryStateOnSurface,TrajectoryStateOnSurface>(muAtTk, outerTkTsos);
00401 
00402 }

std::vector<TrackCand> GlobalMuonTrackMatcher::match ( const TrackCand sta,
const std::vector< TrackCand > &  tracks 
) const

choose all tracks with a matching-chi2 less than Chi2Cut

double GlobalMuonTrackMatcher::match ( const TrackCand sta,
const TrackCand track,
int  matchOption = 0,
int  surfaceOption = 1 
) const

check if two tracks are compatible matchOption: 0 = chi2, 1 = distance, 2 = deltaR surfaceOption: 0 = outermost tracker surface, 1 = innermost muon system surface

Definition at line 102 of file GlobalMuonTrackMatcher.cc.

References convertToTSOSMuHit(), convertToTSOSTkHit(), match_Chi2(), match_d(), and match_Rpos().

00105                                                        {
00106 
00107   std::pair<TrajectoryStateOnSurface, TrajectoryStateOnSurface> tsosPair;
00108   if ( surfaceOption == 0 ) tsosPair = convertToTSOSMuHit(sta,track);
00109   if ( surfaceOption == 1 ) tsosPair = convertToTSOSTkHit(sta,track);
00110   if ( surfaceOption != 0 && surfaceOption != 1 ) return -1.0;
00111 
00112   if ( matchOption == 0 ) {
00113     // chi^2
00114     return  match_Chi2(tsosPair.first,tsosPair.second);
00115   }
00116   else if ( matchOption == 1 ) {
00117     // distance
00118     return match_d(tsosPair.first,tsosPair.second);
00119   }
00120   else if ( matchOption == 2 ) {
00121     // deltaR
00122     return match_Rpos(tsosPair.first,tsosPair.second);
00123   }
00124   else {
00125     return -1.0;
00126   }
00127 
00128 }

bool GlobalMuonTrackMatcher::match ( const TrackCand sta,
const TrackCand track 
) const

check if two tracks are compatible (less than Chi2Cut, DeltaDCut, DeltaRCut)

Definition at line 78 of file GlobalMuonTrackMatcher.cc.

References convertToTSOSMuHit(), deltaR(), match_Chi2(), match_D(), match_Rpos(), theDeltaD, theDeltaR, and theMaxChi2.

Referenced by GlobalCosmicMuonTrajectoryBuilder::match(), L3MuonTrajectoryBuilder::trajectories(), FastL3MuonTrajectoryBuilder::trajectories(), and GlobalMuonTrajectoryBuilder::trajectories().

00079                                                             {
00080 
00081   std::pair<TrajectoryStateOnSurface, TrajectoryStateOnSurface> tsosPair
00082       = convertToTSOSMuHit(sta,track);
00083 
00084   double chi2 = match_Chi2(tsosPair.first,tsosPair.second);
00085   if ( chi2 > 0. && chi2 < theMaxChi2 ) return true;
00086 
00087   double distance = match_D(tsosPair.first,tsosPair.second);
00088   if ( distance > 0. && distance < theDeltaD ) return true;
00089 
00090   double deltaR = match_Rpos(tsosPair.first,tsosPair.second);
00091   if ( deltaR > 0. && deltaR < theDeltaR ) return true;
00092 
00093   return false;
00094 
00095 }

double GlobalMuonTrackMatcher::match_Chi2 ( const TrajectoryStateOnSurface tsos1,
const TrajectoryStateOnSurface tsos2 
) const [private]

Definition at line 433 of file GlobalMuonTrackMatcher.cc.

References TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), LogDebug, m, LocalTrajectoryError::matrix(), v, and LocalTrajectoryParameters::vector().

Referenced by match(), and matchOne().

00434                                                                                 {
00435   
00436   const string category = "GlobalMuonTrackMatcher";
00437   LogDebug(category) << "match_Chi2 sanity check: " << tsos1.isValid() << " " << tsos2.isValid();
00438   if ( !tsos1.isValid() || !tsos2.isValid() ) return -1.;
00439   
00440   AlgebraicVector5 v(tsos1.localParameters().vector() - tsos2.localParameters().vector());
00441   AlgebraicSymMatrix55 m(tsos1.localError().matrix() + tsos2.localError().matrix());
00442   
00443   LogDebug(category) << "vector v " << v;
00444 
00445   bool ierr = !m.Invert();
00446  
00447   if ( ierr ) { 
00448     edm::LogInfo(category) << "Error inverting covariance matrix";
00449     return -1;
00450   }
00451  
00452   double est = ROOT::Math::Similarity(v,m);
00453  
00454   LogDebug(category) << "Chi2 " << est;
00455 
00456   return est;
00457 
00458 }

double GlobalMuonTrackMatcher::match_d ( const TrajectoryStateOnSurface sta,
const TrajectoryStateOnSurface tk 
) const [private]

Definition at line 528 of file GlobalMuonTrackMatcher.cc.

References TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localPosition(), and muonGeometry::mag().

Referenced by match(), and samePlane().

00529                                                                           {
00530 
00531   if ( !sta.isValid() || !tk.isValid() ) return -1;
00532   return (sta.localPosition() - tk.localPosition()).mag();
00533 
00534 }

double GlobalMuonTrackMatcher::match_D ( const TrajectoryStateOnSurface sta,
const TrajectoryStateOnSurface tk 
) const [private]

Definition at line 515 of file GlobalMuonTrackMatcher.cc.

References TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), and muonGeometry::mag().

Referenced by match(), and samePlane().

00516                                                                           {
00517 
00518   if ( !sta.isValid() || !tk.isValid() ) return -1;
00519   return (sta.globalPosition() - tk.globalPosition()).mag();
00520 
00521 }

double GlobalMuonTrackMatcher::match_dist ( const TrajectoryStateOnSurface sta,
const TrajectoryStateOnSurface tk 
) const [private]

Definition at line 542 of file GlobalMuonTrackMatcher.cc.

References TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), LogDebug, m, LocalTrajectoryError::positionError(), v, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), and LocalError::yy().

00543                                                                              {
00544   
00545   const string category = "GlobalMuonTrackMatcher";
00546   
00547   if ( !sta.isValid() || !tk.isValid() ) return -1;
00548   
00549   AlgebraicMatrix22 m;
00550   m(0,0) = tk.localError().positionError().xx() + sta.localError().positionError().xx();
00551   m(1,0) = m(0,1) = tk.localError().positionError().xy() + sta.localError().positionError().xy();
00552   m(1,1) = tk.localError().positionError().yy() + sta.localError().positionError().yy();
00553   AlgebraicVector2 v;
00554   v[0] = tk.localDirection().x() - sta.localDirection().x();
00555   v[1] = tk.localDirection().y() - sta.localDirection().y();
00556   
00557   if ( !m.Invert() ) {
00558     LogDebug(category) << "Error inverting local matrix ";
00559     return -1;
00560   }
00561   
00562   return ROOT::Math::Similarity(v,m);
00563 
00564 }

double GlobalMuonTrackMatcher::match_R_IP ( const TrackCand staCand,
const TrackCand tkCand 
) const [private]

Definition at line 465 of file GlobalMuonTrackMatcher.cc.

00466                                                                   {
00467 
00468   double dR = 99.0;
00469   if (tkCand.second.isNonnull()) {
00470     dR = (deltaR<double>(staCand.second->eta(),staCand.second->phi(),
00471                          tkCand.second->eta(),tkCand.second->phi()));
00472   } else {
00473     dR = (deltaR<double>(staCand.second->eta(),staCand.second->phi(),
00474                          tkCand.first->firstMeasurement().updatedState().globalMomentum().eta(),
00475                          tkCand.first->firstMeasurement().updatedState().globalMomentum().phi()));
00476   }
00477 
00478   return dR;
00479 
00480 }

double GlobalMuonTrackMatcher::match_Rmom ( const TrajectoryStateOnSurface sta,
const TrajectoryStateOnSurface tk 
) const [private]

Definition at line 487 of file GlobalMuonTrackMatcher.cc.

References PV3DBase< T, PVType, FrameType >::eta(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::isValid(), and PV3DBase< T, PVType, FrameType >::phi().

00488                                                                              {
00489 
00490   if( !sta.isValid() || !tk.isValid() ) return -1;
00491   return (deltaR<double>(sta.globalMomentum().eta(),sta.globalMomentum().phi(),
00492                          tk.globalMomentum().eta(),tk.globalMomentum().phi()));
00493 
00494 }

double GlobalMuonTrackMatcher::match_Rpos ( const TrajectoryStateOnSurface sta,
const TrajectoryStateOnSurface tk 
) const [private]

Definition at line 501 of file GlobalMuonTrackMatcher.cc.

References PV3DBase< T, PVType, FrameType >::eta(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), and PV3DBase< T, PVType, FrameType >::phi().

Referenced by match().

00502                                                                              {
00503 
00504   if ( !sta.isValid() || !tk.isValid() ) return -1;
00505   return (deltaR<double>(sta.globalPosition().eta(),sta.globalPosition().phi(),
00506                          tk.globalPosition().eta(),tk.globalPosition().phi()));
00507 
00508 }

std::vector< GlobalMuonTrackMatcher::TrackCand >::const_iterator GlobalMuonTrackMatcher::matchOne ( const TrackCand sta,
const std::vector< TrackCand > &  tracks 
) const

choose the one tracker track which best matches a muon track

Definition at line 136 of file GlobalMuonTrackMatcher.cc.

References convertToTSOSMuHit(), match_Chi2(), and HLT_VtxMuL3::result.

00137                                                                            {
00138 
00139   if ( tracks.empty() ) return tracks.end();
00140 
00141   double minChi2 = 1000.0;
00142   vector<TrackCand>::const_iterator result = tracks.end();
00143   for (vector<TrackCand>::const_iterator is = tracks.begin(); is != tracks.end(); ++is) {
00144     // propagate to common surface
00145     std::pair<TrajectoryStateOnSurface, TrajectoryStateOnSurface> tsosPair
00146       = convertToTSOSMuHit(sta,*is);
00147 
00148     // calculate chi^2 of local track parameters
00149     double chi2 = match_Chi2(tsosPair.first,tsosPair.second);
00150     if ( chi2 > 0. && chi2 <= minChi2 ) {
00151       minChi2 = chi2;
00152       result = is;
00153     }
00154 
00155   }
00156 
00157   return result;
00158 
00159 }

bool GlobalMuonTrackMatcher::samePlane ( const TrajectoryStateOnSurface tsos1,
const TrajectoryStateOnSurface tsos2 
) const [private]

Definition at line 409 of file GlobalMuonTrackMatcher.cc.

References funct::abs(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localPosition(), match_D(), match_d(), p1, p2, TrajectoryStateOnSurface::surface(), and Surface::tangentPlane().

Referenced by convertToTSOSTk().

00410                                                                                {
00411 
00412   if ( !tsos1.isValid() || !tsos2.isValid() ) return false;
00413 
00414   if ( abs(match_D(tsos1,tsos2) - match_d(tsos1,tsos2)) > 0.1 ) return false;
00415 
00416   const float maxtilt = 0.999;
00417   const float maxdist = 0.01; // in cm
00418 
00419   ReferenceCountingPointer<TangentPlane> p1(tsos1.surface().tangentPlane(tsos1.localPosition()));
00420   ReferenceCountingPointer<TangentPlane> p2(tsos2.surface().tangentPlane(tsos2.localPosition()));
00421 
00422   bool returnValue = ( (fabs(p1->normalVector().dot(p2->normalVector())) > maxtilt) || (fabs((p1->toLocal(p2->position())).z()) < maxdist) ) ? true : false;
00423 
00424   return returnValue; 
00425  
00426 }


Member Data Documentation

double GlobalMuonTrackMatcher::theDeltaD [private]

Definition at line 91 of file GlobalMuonTrackMatcher.h.

Referenced by GlobalMuonTrackMatcher(), and match().

double GlobalMuonTrackMatcher::theDeltaR [private]

Definition at line 92 of file GlobalMuonTrackMatcher.h.

Referenced by GlobalMuonTrackMatcher(), and match().

double GlobalMuonTrackMatcher::theMaxChi2 [private]

Definition at line 90 of file GlobalMuonTrackMatcher.h.

Referenced by GlobalMuonTrackMatcher(), and match().

double GlobalMuonTrackMatcher::theMinP [private]

Definition at line 88 of file GlobalMuonTrackMatcher.h.

Referenced by convertToTSOSMuHit(), convertToTSOSTk(), convertToTSOSTkHit(), and GlobalMuonTrackMatcher().

double GlobalMuonTrackMatcher::theMinPt [private]

Definition at line 89 of file GlobalMuonTrackMatcher.h.

Referenced by convertToTSOSMuHit(), convertToTSOSTk(), convertToTSOSTkHit(), and GlobalMuonTrackMatcher().

std::string GlobalMuonTrackMatcher::theOutPropagatorName [private]

Definition at line 95 of file GlobalMuonTrackMatcher.h.

Referenced by convertToTSOSMuHit(), convertToTSOSTk(), convertToTSOSTkHit(), and GlobalMuonTrackMatcher().

const MuonServiceProxy* GlobalMuonTrackMatcher::theService [private]

Definition at line 94 of file GlobalMuonTrackMatcher.h.

Referenced by convertToTSOSMuHit(), convertToTSOSTk(), and convertToTSOSTkHit().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:21:42 2009 for CMSSW by  doxygen 1.5.4