CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
GeomDetLess Class Reference

#include <GeomDetLess.h>

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.

15  :
16  theDir(dir) {}
PropagationDirection theDir
Definition: GeomDetLess.h:25
dbl *** dir
Definition: mlp_gen.cc:35

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

43 {
44  return std::abs(bla->surface().position().z()) < std::abs( flb->position().z());
45 }
#define abs(x)
Definition: mlp_lapack.h:159
bool GeomDetLess::insideOutLess ( const GeomDet a,
const GeomDet b 
) const
private

Definition at line 8 of file GeomDetLess.cc.

References abs, barrelForwardLess(), GeomDet::geographicalId(), PV3DBase< T, PVType, FrameType >::perp(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, GloballyPositioned< T >::position(), GeomDet::surface(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, and PV3DBase< T, PVType, FrameType >::z().

Referenced by operator()().

9 {
10  if (a == b) return false;
11 
12  DetId ida(a->geographicalId());
13  DetId idb(b->geographicalId());
14 
15  if ( (ida.subdetId() == StripSubdetector::TIB || ida.subdetId() == StripSubdetector::TOB || ida.subdetId() == PixelSubdetector::PixelBarrel) &&
16  (idb.subdetId() == StripSubdetector::TIB || idb.subdetId() == StripSubdetector::TOB || idb.subdetId() == PixelSubdetector::PixelBarrel)) { // barrel with barrel
17  return a->surface().position().perp() < b->surface().position().perp();
18  }
19 
20  if ( (ida.subdetId() == StripSubdetector::TEC || ida.subdetId() == StripSubdetector::TID || ida.subdetId() == PixelSubdetector::PixelEndcap) &&
21  (idb.subdetId() == StripSubdetector::TEC || idb.subdetId() == StripSubdetector::TID || idb.subdetId() == PixelSubdetector::PixelEndcap)) { // fwd with fwd
22  return std::abs(a->surface().position().z()) < std::abs(b->surface().position().z());
23  }
24 
25  //
26  // here I have 1 barrel against one forward
27  //
28 
29  if ( (ida.subdetId() == StripSubdetector::TIB || ida.subdetId() == StripSubdetector::TOB || ida.subdetId() == PixelSubdetector::PixelBarrel) &&
30  (idb.subdetId() == StripSubdetector::TEC || idb.subdetId() == StripSubdetector::TID || idb.subdetId() == PixelSubdetector::PixelEndcap)) { // barrel with barrel
31  return barrelForwardLess( a, b);
32  }else{
33  return !barrelForwardLess( b, a);
34  }
35 
36  //throw DetLogicError("GeomDetLess: arguments are not Barrel or Forward GeomDets");
37  throw Genexception("GeomDetLess: arguments are not Ok");
38 
39 }
bool barrelForwardLess(const GeomDet *blb, const GeomDet *fla) const
Definition: GeomDetLess.cc:41
T perp() const
Definition: PV3DBase.h:71
#define abs(x)
Definition: mlp_lapack.h:159
T z() const
Definition: PV3DBase.h:63
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
Definition: DetId.h:20
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
const PositionType & position() const
bool GeomDetLess::operator() ( const GeomDet a,
const GeomDet b 
) const
inline

Definition at line 18 of file GeomDetLess.h.

References alongMomentum, insideOutLess(), and theDir.

18  {
19  if (theDir == alongMomentum) return insideOutLess( a, b);
20  else return insideOutLess( b, a);
21  }
bool insideOutLess(const GeomDet *, const GeomDet *) const
Definition: GeomDetLess.cc:8
PropagationDirection theDir
Definition: GeomDetLess.h:25

Member Data Documentation

PropagationDirection GeomDetLess::theDir
private

Definition at line 25 of file GeomDetLess.h.

Referenced by operator()().