CMS 3D CMS Logo

TkLayerLess.h
Go to the documentation of this file.
1 #ifndef TkNavigation_TkLayerLess_H
2 #define TkNavigation_TkLayerLess_H
3 
9 
14 class TkLayerLess {
15 public:
16  TkLayerLess(NavigationDirection dir = insideOut, const DetLayer* fromLayer = nullptr) : theDir(dir) {
17  if (fromLayer) {
18  theOriginLayer = true;
19  theFromLayerSign = (fromLayer->position().z() > 0 ? 1 : -1);
20  } else
21  theOriginLayer = false;
22  }
23 
24  bool operator()(const DetLayer* a, const DetLayer* b) const {
25  if (!theOriginLayer) {
26  if (theDir == insideOut)
27  return insideOutLess(a, b);
28  else
29  return insideOutLess(b, a);
30  } else {
31  if (theDir == insideOut)
32  return insideOutLessSigned(a, b);
33  else
34  return insideOutLessSigned(b, a);
35  }
36  }
37 
38 private:
40  bool theOriginLayer; //true take into account next parameter, false, do as usual
41  int theFromLayerSign; //1 z>0: -1 z<0
42 
43  bool insideOutLess(const DetLayer*, const DetLayer*) const;
44  bool insideOutLessSigned(const DetLayer*, const DetLayer*) const;
45 
46  bool barrelForwardLess(const BarrelDetLayer* blb, const ForwardDetLayer* fla) const;
47 };
48 
49 #endif
TkLayerLess::barrelForwardLess
bool barrelForwardLess(const BarrelDetLayer *blb, const ForwardDetLayer *fla) const
Definition: TkLayerLess.cc:34
TkLayerLess::insideOutLessSigned
bool insideOutLessSigned(const DetLayer *, const DetLayer *) const
Definition: TkLayerLess.cc:38
TkLayerLess::theOriginLayer
bool theOriginLayer
Definition: TkLayerLess.h:40
DetLayer
Definition: DetLayer.h:21
BoundDisk.h
BoundCylinder.h
TkLayerLess::theDir
NavigationDirection theDir
Definition: TkLayerLess.h:39
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
TkLayerLess::operator()
bool operator()(const DetLayer *a, const DetLayer *b) const
Definition: TkLayerLess.h:24
TkLayerLess::theFromLayerSign
int theFromLayerSign
Definition: TkLayerLess.h:41
BarrelDetLayer.h
TkLayerLess::TkLayerLess
TkLayerLess(NavigationDirection dir=insideOut, const DetLayer *fromLayer=nullptr)
Definition: TkLayerLess.h:16
BarrelDetLayer
Definition: BarrelDetLayer.h:22
NavigationDirection
NavigationDirection
Definition: NavigationDirection.h:4
ForwardDetLayer
Definition: ForwardDetLayer.h:22
ForwardDetLayer.h
TkLayerLess::insideOutLess
bool insideOutLess(const DetLayer *, const DetLayer *) const
Definition: TkLayerLess.cc:5
insideOut
Definition: NavigationDirection.h:4
NavigationDirection.h
TkLayerLess
Definition: TkLayerLess.h:14
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23