CMS 3D CMS Logo

Public Member Functions

HigherInnerHit Struct Reference

List of all members.

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().

                                                                                          {
        //FIXME: inner gives a SEGV
#if 0
        //const TransientTrackingRecHit::ConstRecHitPointer &ihit1 = trip1.inner();
        //const TransientTrackingRecHit::ConstRecHitPointer &ihit2 = trip2.inner();
        const TransientTrackingRecHit::ConstRecHitPointer &ihit1 = trip1.middle();
        const TransientTrackingRecHit::ConstRecHitPointer &ihit2 = trip2.middle();
        const TransientTrackingRecHit::ConstRecHitPointer &ohit1 = trip1.outer();
        const TransientTrackingRecHit::ConstRecHitPointer &ohit2 = trip2.outer();
#endif
        TransientTrackingRecHit::ConstRecHitPointer ihit1 = trip1.inner();
        TransientTrackingRecHit::ConstRecHitPointer ihit2 = trip2.inner();
        TransientTrackingRecHit::ConstRecHitPointer ohit1 = trip1.outer();
        TransientTrackingRecHit::ConstRecHitPointer ohit2 = trip2.outer();
        float iy1 = ihit1->globalPosition().y();
        float oy1 = ohit1->globalPosition().y();
        float iy2 = ihit2->globalPosition().y();
        float oy2 = ohit2->globalPosition().y();
        if (oy1 - iy1 > 0) { // 1 Downgoing
            if (oy2 - iy2 > 0) { // 2 Downgoing
                // sort by inner, or by outer if inners are the same
                return (iy1 != iy2 ? (iy1 > iy2) : (oy1 > oy2));
            } else return true; // else prefer downgoing
        } else if (oy2 - iy2 > 0) {
            return false; // prefer downgoing
        } else { // both upgoing
            // sort by inner, or by outer
            return (iy1 != iy2 ? (iy1 < iy2) : (oy1 < oy2));
        }
    }