CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GeomDetLess.cc
Go to the documentation of this file.
5 
6 bool GeomDetLess::insideOutLess( const GeomDet* a, const GeomDet* b) const
7 {
8  if (a == b) return false;
9 
10  DetId ida(a->geographicalId());
11  DetId idb(b->geographicalId());
12 
13  if ( (ida.subdetId() == StripSubdetector::TIB || ida.subdetId() == StripSubdetector::TOB || ida.subdetId() == PixelSubdetector::PixelBarrel) &&
14  (idb.subdetId() == StripSubdetector::TIB || idb.subdetId() == StripSubdetector::TOB || idb.subdetId() == PixelSubdetector::PixelBarrel)) { // barrel with barrel
15  return a->surface().position().perp() < b->surface().position().perp();
16  }
17 
18  if ( (ida.subdetId() == StripSubdetector::TEC || ida.subdetId() == StripSubdetector::TID || ida.subdetId() == PixelSubdetector::PixelEndcap) &&
19  (idb.subdetId() == StripSubdetector::TEC || idb.subdetId() == StripSubdetector::TID || idb.subdetId() == PixelSubdetector::PixelEndcap)) { // fwd with fwd
20  return std::abs(a->surface().position().z()) < std::abs(b->surface().position().z());
21  }
22 
23  //
24  // here I have 1 barrel against one forward
25  //
26 
27  if ( (ida.subdetId() == StripSubdetector::TIB || ida.subdetId() == StripSubdetector::TOB || ida.subdetId() == PixelSubdetector::PixelBarrel) &&
28  (idb.subdetId() == StripSubdetector::TEC || idb.subdetId() == StripSubdetector::TID || idb.subdetId() == PixelSubdetector::PixelEndcap)) { // barrel with barrel
29  return barrelForwardLess( a, b);
30  }else{
31  return !barrelForwardLess( b, a);
32  }
33 
34  throw cms::Exception("GeomDetLess") << "GeomDetLess: arguments are not Ok";
35 
36 }
37 
39  const GeomDet* flb) const
40 {
41  return std::abs(bla->surface().position().z()) < std::abs( flb->position().z());
42 }
43 
44 
bool barrelForwardLess(const GeomDet *blb, const GeomDet *fla) const
Definition: GeomDetLess.cc:38
T perp() const
Definition: PV3DBase.h:72
bool insideOutLess(const GeomDet *, const GeomDet *) const
Definition: GeomDetLess.cc:6
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:41
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
Definition: DetId.h:18
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
const PositionType & position() const