#include <TwoTrackMinimumDistance.h>
General interface to calculate the PCA of two tracks. According to the charge of the tracks, the correct algorithm is used:
Definition at line 19 of file TwoTrackMinimumDistance.h.
enum TwoTrackMinimumDistance::Charge [private] |
Definition at line 23 of file TwoTrackMinimumDistance.h.
TwoTrackMinimumDistance::TwoTrackMinimumDistance | ( | const Mode | m = FastMode | ) | [inline] |
bool TwoTrackMinimumDistance::calculate | ( | const TrajectoryStateOnSurface & | sta, |
const TrajectoryStateOnSurface & | stb | ||
) | [virtual] |
Implements ClosestApproachOnHelices.
Definition at line 65 of file TwoTrackMinimumDistance.cc.
References TrajectoryStateOnSurface::globalParameters().
Referenced by VZeroFinder::checkTrackPair(), CrossingPtBasedLinearizationPointFinder::getLinearizationPoint(), InclusiveVertexFinder::nearTracks(), TSCBLBuilderNoMaterial::operator()(), and CrossingPtBasedLinearizationPointFinder::useAllTracks().
{ return calculate ( sta.globalParameters(), stb.globalParameters() ); }
bool TwoTrackMinimumDistance::calculate | ( | const FreeTrajectoryState & | sta, |
const FreeTrajectoryState & | stb | ||
) | [virtual] |
Implements ClosestApproachOnHelices.
Definition at line 73 of file TwoTrackMinimumDistance.cc.
References FreeTrajectoryState::parameters().
{ // pair<GlobalPoint, GlobalPoint> ret = theIniAlgo.points ( sta, stb ); return calculate ( sta.parameters(), stb.parameters() ); }
bool TwoTrackMinimumDistance::calculate | ( | const GlobalTrajectoryParameters & | sta, |
const GlobalTrajectoryParameters & | stb | ||
) | [virtual] |
Definition at line 81 of file TwoTrackMinimumDistance.cc.
References GlobalTrajectoryParameters::charge(), MagneticField::inTesla(), GlobalTrajectoryParameters::magneticField(), GlobalTrajectoryParameters::position(), and z.
{ if ((sta.magneticField().inTesla(sta.position()).z() == 0.)|| (stb.magneticField().inTesla(stb.position()).z() == 0.)) { status_ = pointsLineLine(sta, stb); } else if ( sta.charge() != 0. && stb.charge() != 0. ) { status_ = pointsHelixHelix(sta, stb); } else if ( sta.charge() == 0. && stb.charge() == 0. ) { status_ = pointsLineLine(sta, stb); } else { status_ = pointsHelixLine(sta, stb); } return status_; }
virtual TwoTrackMinimumDistance* TwoTrackMinimumDistance::clone | ( | void | ) | const [inline, virtual] |
Clone method
Implements ClosestApproachOnHelices.
Definition at line 54 of file TwoTrackMinimumDistance.h.
References TwoTrackMinimumDistance().
{ return new TwoTrackMinimumDistance(* this); }
GlobalPoint TwoTrackMinimumDistance::crossingPoint | ( | ) | const [virtual] |
arithmetic mean of the two points of closest approach
Implements ClosestApproachOnHelices.
Definition at line 176 of file TwoTrackMinimumDistance.cc.
References timingPdfMaker::mean.
Referenced by VZeroFinder::checkTrackPair(), and InclusiveVertexFinder::nearTracks().
float TwoTrackMinimumDistance::distance | ( | ) | const [virtual] |
distance between the two points of closest approach in 3D
Implements ClosestApproachOnHelices.
Definition at line 182 of file TwoTrackMinimumDistance.cc.
Referenced by VZeroFinder::checkTrackPair(), and InclusiveVertexFinder::nearTracks().
{ return dist ( points_ ); }
double TwoTrackMinimumDistance::firstAngle | ( | ) | const |
Definition at line 20 of file TwoTrackMinimumDistance.cc.
References Exception.
Referenced by VZeroFinder::checkTrackPair(), and TSCBLBuilderNoMaterial::operator()().
{ if (!status_) throw cms::Exception("TrackingTools/PatternTools","TwoTrackMinimumDistance::could not compute track crossing. Check status before calling this method!"); switch ( theCharge ) { case (hh): return theTTMDhh.firstAngle(); break; case (hl): return theTTMDhl.firstAngle(); break; case (ll): return theTTMDll.firstAngle(); break; } return 0; }
pair< double, double > TwoTrackMinimumDistance::pathLength | ( | ) | const |
Definition at line 45 of file TwoTrackMinimumDistance.cc.
References Exception.
Referenced by TSCBLBuilderNoMaterial::operator()().
{ if (!status_) throw cms::Exception("TrackingTools/PatternTools","TwoTrackMinimumDistance::could not compute track crossing. Check status before calling this method!"); switch ( theCharge ) { case (hh): return theTTMDhh.pathLength(); break; case (hl): return theTTMDhl.pathLength(); break; case (ll): return theTTMDll.pathLength(); break; } return std::pair<double,double>(0,0); }
pair< GlobalPoint, GlobalPoint > TwoTrackMinimumDistance::points | ( | ) | const [virtual] |
Returns the two PCA on the trajectories.
Implements ClosestApproachOnHelices.
Definition at line 57 of file TwoTrackMinimumDistance.cc.
References Exception.
Referenced by VZeroFinder::checkTrackPair(), CrossingPtBasedLinearizationPointFinder::getLinearizationPoint(), InclusiveVertexFinder::nearTracks(), TSCBLBuilderNoMaterial::operator()(), and CrossingPtBasedLinearizationPointFinder::useAllTracks().
{ if (!status_) throw cms::Exception("TrackingTools/PatternTools","TwoTrackMinimumDistance::could not compute track crossing. Check status before calling this method!"); return points_; }
bool TwoTrackMinimumDistance::pointsHelixHelix | ( | const GlobalTrajectoryParameters & | sta, |
const GlobalTrajectoryParameters & | stb | ||
) | [private] |
Definition at line 118 of file TwoTrackMinimumDistance.cc.
References GlobalTrajectoryParameters::charge(), f, mag2(), GlobalTrajectoryParameters::momentum(), and GlobalTrajectoryParameters::position().
{ if ( ( sta.position() - stb.position() ).mag2() < 1e-7f && ( sta.momentum() - stb.momentum() ).mag2() < 1e-7f && sta.charge()==stb.charge() ) { edm::LogWarning ( "TwoTrackMinimumDistance") << "comparing track with itself!"; }; theCharge = hh; if ( theModus == FastMode ) { // first we try directly - in FastMode only ... if ( !(theTTMDhh.calculate ( sta, stb, .0001 )) ) { points_ = theTTMDhh.points(); return true; }; }; // okay. did not work. so we use CAIR, and then TTMD again. bool cairStat = theIniAlgo.calculate ( sta, stb ); if (!cairStat) { // yes. CAIR may fail. edm::LogWarning ( "TwoTrackMinimumDistance" ) << "Computation HelixHelix::CAIR failed."; if ( theModus == SlowMode ) { // we can still try ttmd here. if ( !(theTTMDhh.calculate ( sta, stb, .0001 )) ) { points_ = theTTMDhh.points(); return true; } }; // we can try with more sloppy settings if ( !(theTTMDhh.calculate ( sta, stb, .1 )) ) { points_ = theTTMDhh.points(); return true; } return false; edm::LogWarning ( "TwoTrackMinimumDistance" ) << "TwoTrackMinimumDistanceHelixHelix failed"; }; pair<GlobalTrajectoryParameters, GlobalTrajectoryParameters > ini = theIniAlgo.trajectoryParameters(); pair<GlobalPoint, GlobalPoint> inip ( ini.first.position(), ini.second.position() ); if ( theTTMDhh.calculate ( ini.first, ini.second, .0001 ) ) { points_ = inip; } else { points_ = theTTMDhh.points(); // if we are still worse than CAIR, we use CAIR results. if ( dist ( points_ ) > dist ( inip ) ) points_ = inip; }; return true; }
bool TwoTrackMinimumDistance::pointsHelixLine | ( | const GlobalTrajectoryParameters & | sta, |
const GlobalTrajectoryParameters & | stb | ||
) | [private] |
bool TwoTrackMinimumDistance::pointsLineLine | ( | const GlobalTrajectoryParameters & | sta, |
const GlobalTrajectoryParameters & | stb | ||
) | [private] |
double TwoTrackMinimumDistance::secondAngle | ( | ) | const |
Definition at line 32 of file TwoTrackMinimumDistance.cc.
References Exception.
Referenced by VZeroFinder::checkTrackPair().
{ if (!status_) throw cms::Exception("TrackingTools/PatternTools","TwoTrackMinimumDistance::could not compute track crossing. Check status before calling this method!"); switch ( theCharge ) { case (hh): return theTTMDhh.secondAngle(); break; case (hl): return theTTMDhl.secondAngle(); break; case (ll): return theTTMDll.secondAngle(); break; } return 0; }
virtual bool TwoTrackMinimumDistance::status | ( | void | ) | const [inline, virtual] |
Implements ClosestApproachOnHelices.
Definition at line 36 of file TwoTrackMinimumDistance.h.
References status_.
{return status_;}
std::pair<GlobalPoint, GlobalPoint> TwoTrackMinimumDistance::points_ [private] |
Definition at line 71 of file TwoTrackMinimumDistance.h.
bool TwoTrackMinimumDistance::status_ [private] |
Definition at line 70 of file TwoTrackMinimumDistance.h.
Referenced by status(), and TwoTrackMinimumDistance().
Charge TwoTrackMinimumDistance::theCharge [mutable, private] |
Definition at line 65 of file TwoTrackMinimumDistance.h.
Definition at line 66 of file TwoTrackMinimumDistance.h.
Mode TwoTrackMinimumDistance::theModus [private] |
Definition at line 64 of file TwoTrackMinimumDistance.h.
Referenced by TwoTrackMinimumDistance().
TwoTrackMinimumDistanceHelixHelix TwoTrackMinimumDistance::theTTMDhh [mutable, private] |
Definition at line 67 of file TwoTrackMinimumDistance.h.
TwoTrackMinimumDistanceHelixLine TwoTrackMinimumDistance::theTTMDhl [mutable, private] |
Definition at line 69 of file TwoTrackMinimumDistance.h.
TwoTrackMinimumDistanceLineLine TwoTrackMinimumDistance::theTTMDll [mutable, private] |
Definition at line 68 of file TwoTrackMinimumDistance.h.