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

Member Function Documentation

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

Definition at line 137 of file SimpleCosmicBONSeeder.cc.

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

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