CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
bool operator()(const DetLayer *a, const DetLayer *b) const
Definition: TkLayerLess.h:24
NavigationDirection theDir
Definition: TkLayerLess.h:39
bool insideOutLess(const DetLayer *, const DetLayer *) const
Definition: TkLayerLess.cc:5
bool barrelForwardLess(const BarrelDetLayer *blb, const ForwardDetLayer *fla) const
Definition: TkLayerLess.cc:34
bool insideOutLessSigned(const DetLayer *, const DetLayer *) const
Definition: TkLayerLess.cc:38
TkLayerLess(NavigationDirection dir=insideOut, const DetLayer *fromLayer=nullptr)
Definition: TkLayerLess.h:16
int theFromLayerSign
Definition: TkLayerLess.h:41
double b
Definition: hdecay.h:118
double a
Definition: hdecay.h:119
bool theOriginLayer
Definition: TkLayerLess.h:40