Belle II Software development
ISuperLayer.cc
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#include <tracking/trackFindingCDC/topology/ISuperLayer.h>
9
10using namespace Belle2;
11using namespace TrackFindingCDC;
12
13const ISuperLayer ISuperLayerUtil::c_N;
14
15const ISuperLayer ISuperLayerUtil::c_InnerVolume;
16
17const ISuperLayer ISuperLayerUtil::c_OuterVolume;
18
19const ISuperLayer ISuperLayerUtil::c_Invalid;
20
21bool ISuperLayerUtil::isAxial(ISuperLayer iSuperLayer)
22{
23 return isInCDC(iSuperLayer) and (iSuperLayer % 2) == 0;
24}
25
26EStereoKind ISuperLayerUtil::getStereoKind(ISuperLayer iSuperLayer)
27{
28 if (not isInCDC(iSuperLayer)) return EStereoKind::c_Invalid;
29 if (isAxial(iSuperLayer)) {
30 return EStereoKind::c_Axial;
31 } else if ((iSuperLayer % 4) == 1) {
32 return EStereoKind::c_StereoU;
33 } else {
34 return EStereoKind::c_StereoV;
35 }
36}
37
38bool ISuperLayerUtil::isInvalid(ISuperLayer iSuperLayer)
39{
40 return not isLogical(iSuperLayer);
41}
42
43bool ISuperLayerUtil::isInCDC(ISuperLayer iSuperLayer)
44{
45 return 0 <= iSuperLayer and iSuperLayer < c_N;
46}
47
48bool ISuperLayerUtil::isLogical(ISuperLayer iSuperLayer)
49{
50 return c_InnerVolume <= iSuperLayer and iSuperLayer <= c_OuterVolume;
51}
52
53bool ISuperLayerUtil::isInnerVolume(ISuperLayer iSuperLayer)
54{
55 return c_InnerVolume == iSuperLayer;
56}
57
58bool ISuperLayerUtil::isOuterVolume(ISuperLayer iSuperLayer)
59{
60 return c_OuterVolume == iSuperLayer;
61}
62
63ISuperLayer ISuperLayerUtil::getNextInwards(ISuperLayer iSuperLayer)
64{
65 if (isInvalid(iSuperLayer) or isInnerVolume(iSuperLayer)) {
66 return c_Invalid;
67 } else {
68 return iSuperLayer - 1;
69 }
70}
71
72ISuperLayer ISuperLayerUtil::getNextOutwards(ISuperLayer iSuperLayer)
73{
74 if (isInvalid(iSuperLayer) or isOuterVolume(iSuperLayer)) {
75 return c_Invalid;
76 } else {
77 return iSuperLayer + 1;
78 }
79}
Abstract base class for different kinds of events.
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
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 bool isOuterVolume(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to the logical superlayer of the volume outside the CDC.