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.
2 //#include "CommonDet/DetUtilities/interface/DetExceptions.h"
3 // temporary solution
7 
8 bool GeomDetLess::insideOutLess( const GeomDet* a, const GeomDet* b) const
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 }
40 
42  const GeomDet* flb) const
43 {
44  return std::abs(bla->surface().position().z()) < std::abs( flb->position().z());
45 }
46 
47 
bool barrelForwardLess(const GeomDet *blb, const GeomDet *fla) const
Definition: GeomDetLess.cc:41
T perp() const
Definition: PV3DBase.h:66
#define abs(x)
Definition: mlp_lapack.h:159
bool insideOutLess(const GeomDet *, const GeomDet *) const
Definition: GeomDetLess.cc:8
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
T z() const
Definition: PV3DBase.h:58
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
Definition: DetId.h:20
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
const PositionType & position() const
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37