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 
17  TkLayerLess( NavigationDirection dir = insideOut, const DetLayer * fromLayer = nullptr) :
18  theDir(dir) {
19  if (fromLayer){
20  theOriginLayer = true;
21  theFromLayerSign = (fromLayer->position().z()>0 ? 1 : -1) ;
22  }else theOriginLayer = false;
23  }
24 
25  bool operator()( const DetLayer* a, const DetLayer* b) const {
26  if (!theOriginLayer){
27  if (theDir == insideOut) return insideOutLess( a, b);
28  else return insideOutLess( b, a);
29  }
30  else{
31  if (theDir == insideOut) return insideOutLessSigned( a, b);
32  else return insideOutLessSigned(b, a);
33  }
34  }
35 
36 private:
37 
39  bool theOriginLayer; //true take into account next parameter, false, do as usual
40  int theFromLayerSign; //1 z>0: -1 z<0
41 
42  bool insideOutLess( const DetLayer*,const DetLayer*) const;
43  bool insideOutLessSigned( const DetLayer*,const DetLayer*) const;
44 
45  bool barrelForwardLess( const BarrelDetLayer* blb,
46  const ForwardDetLayer* fla) const;
47 
48 };
49 
50 #endif
TkLayerLess(NavigationDirection dir=insideOut, const DetLayer *fromLayer=0)
Definition: TkLayerLess.h:17
bool operator()(const DetLayer *a, const DetLayer *b) const
Definition: TkLayerLess.h:25
NavigationDirection theDir
Definition: TkLayerLess.h:38
bool insideOutLess(const DetLayer *, const DetLayer *) const
Definition: TkLayerLess.cc:5
bool barrelForwardLess(const BarrelDetLayer *blb, const ForwardDetLayer *fla) const
Definition: TkLayerLess.cc:39
bool insideOutLessSigned(const DetLayer *, const DetLayer *) const
Definition: TkLayerLess.cc:46
int theFromLayerSign
Definition: TkLayerLess.h:40
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
dbl *** dir
Definition: mlp_gen.cc:35
bool theOriginLayer
Definition: TkLayerLess.h:39