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