Belle II Software  release-05-02-19
ISuperLayer.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2014 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
13 
14 #include <tracking/trackFindingCDC/utilities/FunctorTag.h>
15 
16 #include <climits>
17 
18 namespace Belle2 {
23  namespace TrackFindingCDC {
24 
26  using ISuperLayer = signed short;
27 
29  struct GetISuperLayer {
31  operator FunctorTag();
32 
34  template<class T, class SFINAE = decltype(&T::getISuperLayer)>
35  ISuperLayer operator()(const T& t) const
36  {
37  return t.getISuperLayer();
38  }
39 
41  template < class T, class SFINAE = decltype(std::declval<T>()->getISuperLayer()) >
42  auto operator()(const T& t) const -> decltype(t->getISuperLayer())
43  {
44  return t->getISuperLayer();
45  }
46  };
47 
52  struct ISuperLayerUtil {
53 
55  ISuperLayerUtil() = delete;
56 
58  static const ISuperLayer c_N = 9;
59 
61  static const ISuperLayer c_InnerVolume = -1;
62 
64  static const ISuperLayer c_OuterVolume = 9;
65 
67  static const ISuperLayer c_Invalid = SHRT_MIN;
68 
70  static bool isInvalid(ISuperLayer iSuperLayer);
71 
73  static bool isInCDC(ISuperLayer iSuperLayer);
74 
76  static bool isLogical(ISuperLayer iSuperLayer);
77 
79  static bool isInnerVolume(ISuperLayer iSuperLayer);
80 
82  static bool isOuterVolume(ISuperLayer iSuperLayer);
83 
85  static bool isAxial(ISuperLayer iSuperLayer);
86 
88  static EStereoKind getStereoKind(ISuperLayer iSuperLayer);
89 
94  static ISuperLayer getNextInwards(ISuperLayer iSuperLayer);
95 
100  static ISuperLayer getNextOutwards(ISuperLayer iSuperLayer);
101 
103  template<class T>
104  static ISuperLayer getFrom(const T& t)
105  {
106  return GetISuperLayer()(t);
107  }
108  };
109  }
111 }
Belle2::TrackFindingCDC::ISuperLayerUtil::ISuperLayerUtil
ISuperLayerUtil()=delete
Utility classes should not be instantiated.
Belle2::TrackFindingCDC::ISuperLayerUtil::c_N
static const ISuperLayer c_N
Constant representing the total number of cdc superlayers.
Definition: ISuperLayer.h:66
Belle2::TrackFindingCDC::ISuperLayerUtil::getFrom
static ISuperLayer getFrom(const T &t)
Returns the superlayer of an object.
Definition: ISuperLayer.h:112
Belle2::TrackFindingCDC::ISuperLayerUtil::getStereoKind
static EStereoKind getStereoKind(ISuperLayer iSuperLayer)
Returns the stereo kind of the super layer.
Definition: ISuperLayer.cc:28
Belle2::TrackFindingCDC::ISuperLayerUtil::c_Invalid
static const ISuperLayer c_Invalid
Constant making an invalid superlayer id.
Definition: ISuperLayer.h:75
Belle2::TrackFindingCDC::ISuperLayerUtil::c_OuterVolume
static const ISuperLayer c_OuterVolume
Constant marking the subdetectors further away from the IP than the CDC.
Definition: ISuperLayer.h:72
Belle2::TrackFindingCDC::ISuperLayerUtil::getNextOutwards
static ISuperLayer getNextOutwards(ISuperLayer iSuperLayer)
Returns the super layer that is outside of the given super layer.
Definition: ISuperLayer.cc:74
Belle2::TrackFindingCDC::GetISuperLayer::operator()
ISuperLayer operator()(const T &t) const
Returns the superlayer of an object.
Definition: ISuperLayer.h:43
Belle2::TrackFindingCDC::ISuperLayerUtil::isLogical
static bool isLogical(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to a logical superlayer - includes the logic ids for inner ...
Definition: ISuperLayer.cc:50
Belle2::TrackFindingCDC::ISuperLayerUtil::isInvalid
static bool isInvalid(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to a true cdc superlayer - excludes the logic ids for inner...
Definition: ISuperLayer.cc:40
Belle2::TrackFindingCDC::ISuperLayerUtil::isInnerVolume
static bool isInnerVolume(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to the logical superlayer of the column inside the CDC.
Definition: ISuperLayer.cc:55
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::ISuperLayerUtil::getNextInwards
static ISuperLayer getNextInwards(ISuperLayer iSuperLayer)
Returns the super layer that is inside of the given super layer.
Definition: ISuperLayer.cc:65
Belle2::TrackFindingCDC::ISuperLayerUtil::isInCDC
static bool isInCDC(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to a true cdc superlayer - excludes the logic ids for inner...
Definition: ISuperLayer.cc:45
Belle2::TrackFindingCDC::ISuperLayerUtil::isAxial
static bool isAxial(ISuperLayer iSuperLayer)
Returns if the super layer with the given id is axial.
Definition: ISuperLayer.cc:23
Belle2::TrackFindingCDC::ISuperLayerUtil::isOuterVolume
static bool isOuterVolume(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to the logical superlayer of the volumn outside the CDC.
Definition: ISuperLayer.cc:60
Belle2::TrackFindingCDC::ISuperLayerUtil::c_InnerVolume
static const ISuperLayer c_InnerVolume
Constant marking the subdetectors closer to the IP than the CDC.
Definition: ISuperLayer.h:69