12 return GlobalPoint ( 0.5*(pr.first.basicVector() + pr.second.basicVector()) );
15 inline double dist ( pair<GlobalPoint, GlobalPoint> pr ) {
16 return ( pr.first - pr.second ).mag();
23 throw cms::Exception(
"TrackingTools/PatternTools",
"TwoTrackMinimumDistance::could not compute track crossing. Check status before calling this method!");
24 switch ( theCharge ) {
25 case (hh):
return theTTMDhh.firstAngle();
break;
26 case (hl):
return theTTMDhl.firstAngle();
break;
27 case (ll):
return theTTMDll.firstAngle();
break;
35 throw cms::Exception(
"TrackingTools/PatternTools",
"TwoTrackMinimumDistance::could not compute track crossing. Check status before calling this method!");
36 switch ( theCharge ) {
37 case (hh):
return theTTMDhh.secondAngle();
break;
38 case (hl):
return theTTMDhl.secondAngle();
break;
39 case (ll):
return theTTMDll.secondAngle();
break;
48 throw cms::Exception(
"TrackingTools/PatternTools",
"TwoTrackMinimumDistance::could not compute track crossing. Check status before calling this method!");
49 switch ( theCharge ) {
50 case (hh):
return theTTMDhh.pathLength();
break;
51 case (hl):
return theTTMDhl.pathLength();
break;
52 case (ll):
return theTTMDll.pathLength();
break;
54 return std::pair<double,double>(0,0);
60 throw cms::Exception(
"TrackingTools/PatternTools",
"TwoTrackMinimumDistance::could not compute track crossing. Check status before calling this method!");
86 status_ = pointsLineLine(sta, stb);
88 status_ = pointsHelixHelix(sta, stb);
90 status_ = pointsLineLine(sta, stb);
92 status_ = pointsHelixLine(sta, stb);
102 if (theTTMDll.calculate(sta, stb))
return false;
103 points_ = theTTMDll.points();
112 if (theTTMDhl.calculate(sta, stb, 0.000001))
return false;
113 points_ = theTTMDhl.points();
126 edm::LogWarning (
"TwoTrackMinimumDistance") <<
"comparing track with itself!";
130 if ( theModus == FastMode )
133 if ( !(theTTMDhh.calculate ( sta, stb, .0001 )) )
135 points_ = theTTMDhh.points();
141 bool cairStat = theIniAlgo.calculate ( sta, stb );
144 edm::LogWarning (
"TwoTrackMinimumDistance" ) <<
"Computation HelixHelix::CAIR failed.";
145 if ( theModus == SlowMode ) {
146 if ( !(theTTMDhh.calculate ( sta, stb, .0001 )) ) {
147 points_ = theTTMDhh.points();
152 if ( !(theTTMDhh.calculate ( sta, stb, .1 )) ) {
153 points_ = theTTMDhh.points();
157 edm::LogWarning (
"TwoTrackMinimumDistance" ) <<
"TwoTrackMinimumDistanceHelixHelix failed";
160 pair<GlobalTrajectoryParameters, GlobalTrajectoryParameters >
161 ini = theIniAlgo.trajectoryParameters();
163 pair<GlobalPoint, GlobalPoint> inip ( ini.first.position(),
164 ini.second.position() );
165 if ( theTTMDhh.calculate ( ini.first, ini.second, .0001 ) ) {
168 points_ = theTTMDhh.points();
170 if ( dist ( points_ ) > dist ( inip ) ) points_ = inip;
178 return mean ( points_ );
184 return dist ( points_ );
virtual float distance() const
virtual bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb)
const GlobalTrajectoryParameters & parameters() const
virtual GlobalPoint crossingPoint() const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
Global3DPoint GlobalPoint
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
bool pointsHelixLine(const GlobalTrajectoryParameters &sta, const GlobalTrajectoryParameters &stb)
GlobalVector momentum() const
double firstAngle() const
double secondAngle() const
bool pointsLineLine(const GlobalTrajectoryParameters &sta, const GlobalTrajectoryParameters &stb)
GlobalPoint position() const
const GlobalTrajectoryParameters & globalParameters() const
std::pair< double, double > pathLength() const
const MagneticField & magneticField() const
TrackCharge charge() const
virtual std::pair< GlobalPoint, GlobalPoint > points() const
bool pointsHelixHelix(const GlobalTrajectoryParameters &sta, const GlobalTrajectoryParameters &stb)