CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

GeomDetLess Class Reference

#include <GeomDetLess.h>

List of all members.

Public Member Functions

 GeomDetLess (PropagationDirection dir=alongMomentum)
bool operator() (const GeomDet *a, const GeomDet *b) const

Private Member Functions

bool barrelForwardLess (const GeomDet *blb, const GeomDet *fla) const
bool insideOutLess (const GeomDet *, const GeomDet *) const

Private Attributes

PropagationDirection theDir

Detailed Description

Defines order of layers in the Tracker as seen by straight tracks coming from the interaction region.

Definition at line 12 of file GeomDetLess.h.


Constructor & Destructor Documentation

GeomDetLess::GeomDetLess ( PropagationDirection  dir = alongMomentum) [inline]

Definition at line 15 of file GeomDetLess.h.

                                                         :
    theDir(dir) {}

Member Function Documentation

bool GeomDetLess::barrelForwardLess ( const GeomDet blb,
const GeomDet fla 
) const [private]

Definition at line 41 of file GeomDetLess.cc.

References abs, GeomDet::position(), GloballyPositioned< T >::position(), GeomDet::surface(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by insideOutLess().

{
  return std::abs(bla->surface().position().z()) < std::abs( flb->position().z());
}
bool GeomDetLess::insideOutLess ( const GeomDet a,
const GeomDet b 
) const [private]

Definition at line 8 of file GeomDetLess.cc.

References abs, barrelForwardLess(), GeomDet::geographicalId(), GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, GloballyPositioned< T >::position(), GeomDet::surface(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by operator()().

{
  if (a == b) return false;

  DetId ida(a->geographicalId());
  DetId idb(b->geographicalId());

  if      ( (ida.subdetId() == StripSubdetector::TIB || ida.subdetId() == StripSubdetector::TOB || ida.subdetId() == PixelSubdetector::PixelBarrel) &&
            (idb.subdetId() == StripSubdetector::TIB || idb.subdetId() == StripSubdetector::TOB || idb.subdetId() == PixelSubdetector::PixelBarrel)) {  // barrel with barrel
    return a->surface().position().perp() < b->surface().position().perp();
  }

  if      ( (ida.subdetId() == StripSubdetector::TEC || ida.subdetId() == StripSubdetector::TID || ida.subdetId() == PixelSubdetector::PixelEndcap) &&
            (idb.subdetId() == StripSubdetector::TEC || idb.subdetId() == StripSubdetector::TID || idb.subdetId() == PixelSubdetector::PixelEndcap)) {  // fwd with fwd
    return std::abs(a->surface().position().z()) < std::abs(b->surface().position().z());
  }
  
  //
  //  here I have 1 barrel against one forward
  //

  if      ( (ida.subdetId() == StripSubdetector::TIB || ida.subdetId() == StripSubdetector::TOB || ida.subdetId() == PixelSubdetector::PixelBarrel) &&
            (idb.subdetId() == StripSubdetector::TEC || idb.subdetId() == StripSubdetector::TID || idb.subdetId() == PixelSubdetector::PixelEndcap)) {  // barrel with barrel
    return barrelForwardLess( a, b);
  }else{
    return !barrelForwardLess( b, a);
  }
  
  //throw DetLogicError("GeomDetLess: arguments are not Barrel or Forward GeomDets");
  throw Genexception("GeomDetLess: arguments are not Ok");
  
}
bool GeomDetLess::operator() ( const GeomDet a,
const GeomDet b 
) const [inline]

Definition at line 18 of file GeomDetLess.h.

References alongMomentum, insideOutLess(), and theDir.

                                                             {
    if (theDir == alongMomentum) return insideOutLess( a, b);
    else return insideOutLess( b, a);
  }

Member Data Documentation

Definition at line 25 of file GeomDetLess.h.

Referenced by operator()().