Belle II Software development
ISuperLayer.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <cdc/topology/EStereoKind.h>
11
12#include <tracking/trackingUtilities/utilities/FunctorTag.h>
13
14#include <climits>
15
16namespace Belle2 {
21 namespace CDC {
22
24 using ISuperLayer = signed short;
25
30
32 template<class T, class SFINAE = decltype(&T::getISuperLayer)>
33 ISuperLayer operator()(const T& t) const
34 {
35 return t.getISuperLayer();
36 }
37
39 template < class T, class SFINAE = decltype(std::declval<T>()->getISuperLayer()) >
40 auto operator()(const T& t) const -> decltype(t->getISuperLayer())
41 {
42 return t->getISuperLayer();
43 }
44 };
45
51
53 ISuperLayerUtil() = delete;
54
56 static const ISuperLayer c_N = 9;
57
59 static const ISuperLayer c_InnerVolume = -1;
60
62 static const ISuperLayer c_OuterVolume = 9;
63
65 static const ISuperLayer c_Invalid = SHRT_MIN;
66
68 static bool isInvalid(ISuperLayer iSuperLayer);
69
71 static bool isInCDC(ISuperLayer iSuperLayer);
72
74 static bool isLogical(ISuperLayer iSuperLayer);
75
77 static bool isInnerVolume(ISuperLayer iSuperLayer);
78
80 static bool isOuterVolume(ISuperLayer iSuperLayer);
81
83 static bool isAxial(ISuperLayer iSuperLayer);
84
86 static EStereoKind getStereoKind(ISuperLayer iSuperLayer);
87
92 static ISuperLayer getNextInwards(ISuperLayer iSuperLayer);
93
98 static ISuperLayer getNextOutwards(ISuperLayer iSuperLayer);
99
101 template<class T>
102 static ISuperLayer getFrom(const T& t)
103 {
104 return GetISuperLayer()(t);
105 }
106 };
107 }
109}
EStereoKind
Type for the stereo property of the wire.
Definition EStereoKind.h:20
signed short ISuperLayer
The type of the layer and superlayer ids.
Definition ISuperLayer.h:24
Abstract base class for different kinds of events.
Generic functor to get the superlayer id from an object.
Definition ISuperLayer.h:27
ISuperLayer operator()(const T &t) const
Returns the superlayer of an object.
Definition ISuperLayer.h:33
static const ISuperLayer c_Invalid
Constant making an invalid superlayer id.
Definition ISuperLayer.h:65
static bool isAxial(ISuperLayer iSuperLayer)
Returns if the super layer with the given id is axial.
static const ISuperLayer c_N
Constant representing the total number of cdc superlayers.
Definition ISuperLayer.h:56
static ISuperLayer getNextInwards(ISuperLayer iSuperLayer)
Returns the super layer that is inside of the given super layer.
static bool isInvalid(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to a true cdc superlayer - excludes the logic ids for inner...
static const ISuperLayer c_InnerVolume
Constant marking the subdetectors closer to the IP than the CDC.
Definition ISuperLayer.h:59
ISuperLayerUtil()=delete
Utility classes should not be instantiated.
static bool isLogical(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to a logical superlayer - includes the logic ids for inner ...
static bool isInnerVolume(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to the logical superlayer of the column inside the CDC.
static ISuperLayer getNextOutwards(ISuperLayer iSuperLayer)
Returns the super layer that is outside of the given super layer.
static bool isInCDC(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to a true cdc superlayer - excludes the logic ids for inner...
static const ISuperLayer c_OuterVolume
Constant marking the subdetectors further away from the IP than the CDC.
Definition ISuperLayer.h:62
static EStereoKind getStereoKind(ISuperLayer iSuperLayer)
Returns the stereo kind of the super layer.
static ISuperLayer getFrom(const T &t)
Returns the superlayer of an object.
static bool isOuterVolume(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to the logical superlayer of the volume outside the CDC.
Tag class to facilitate marking of class as a functor in the sense of this code.
Definition FunctorTag.h:20