CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
HigherInnerHit Struct Reference

Public Member Functions

bool operator() (const OrderedHitTriplet &trip1, const OrderedHitTriplet &trip2) const
 

Detailed Description

Definition at line 137 of file SimpleCosmicBONSeeder.cc.

Member Function Documentation

bool HigherInnerHit::operator() ( const OrderedHitTriplet trip1,
const OrderedHitTriplet trip2 
) const
inline

Definition at line 138 of file SimpleCosmicBONSeeder.cc.

References OrderedHitTriplet::inner(), OrderedHitTriplet::middle(), and OrderedHitTriplet::outer().

138  {
139  //FIXME: inner gives a SEGV
140 #if 0
141  //const TransientTrackingRecHit::ConstRecHitPointer &ihit1 = trip1.inner();
142  //const TransientTrackingRecHit::ConstRecHitPointer &ihit2 = trip2.inner();
145  const TransientTrackingRecHit::ConstRecHitPointer &ohit1 = trip1.outer();
146  const TransientTrackingRecHit::ConstRecHitPointer &ohit2 = trip2.outer();
147 #endif
152  float iy1 = ihit1->globalPosition().y();
153  float oy1 = ohit1->globalPosition().y();
154  float iy2 = ihit2->globalPosition().y();
155  float oy2 = ohit2->globalPosition().y();
156  if (oy1 - iy1 > 0) { // 1 Downgoing
157  if (oy2 - iy2 > 0) { // 2 Downgoing
158  // sort by inner, or by outer if inners are the same
159  return (iy1 != iy2 ? (iy1 > iy2) : (oy1 > oy2));
160  } else return true; // else prefer downgoing
161  } else if (oy2 - iy2 > 0) {
162  return false; // prefer downgoing
163  } else { // both upgoing
164  // sort by inner, or by outer
165  return (iy1 != iy2 ? (iy1 < iy2) : (oy1 < oy2));
166  }
167  }
const OuterRecHit & outer() const
const InnerRecHit & inner() const
const MiddleRecHit & middle() const