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 135 of file SimpleCosmicBONSeeder.cc.

Member Function Documentation

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

Definition at line 136 of file SimpleCosmicBONSeeder.cc.

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

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