Belle II Software  release-08-01-10
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 
10 using namespace Belle2;
11 using namespace TrackFindingCDC;
12 
13 const ISuperLayer ISuperLayerUtil::c_N;
14 
15 const ISuperLayer ISuperLayerUtil::c_InnerVolume;
16 
17 const ISuperLayer ISuperLayerUtil::c_OuterVolume;
18 
19 const ISuperLayer ISuperLayerUtil::c_Invalid;
20 
21 bool ISuperLayerUtil::isAxial(ISuperLayer iSuperLayer)
22 {
23  return isInCDC(iSuperLayer) and (iSuperLayer % 2) == 0;
24 }
25 
26 EStereoKind 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 
38 bool ISuperLayerUtil::isInvalid(ISuperLayer iSuperLayer)
39 {
40  return not isLogical(iSuperLayer);
41 }
42 
43 bool ISuperLayerUtil::isInCDC(ISuperLayer iSuperLayer)
44 {
45  return 0 <= iSuperLayer and iSuperLayer < c_N;
46 }
47 
48 bool ISuperLayerUtil::isLogical(ISuperLayer iSuperLayer)
49 {
50  return c_InnerVolume <= iSuperLayer and iSuperLayer <= c_OuterVolume;
51 }
52 
53 bool ISuperLayerUtil::isInnerVolume(ISuperLayer iSuperLayer)
54 {
55  return c_InnerVolume == iSuperLayer;
56 }
57 
58 bool ISuperLayerUtil::isOuterVolume(ISuperLayer iSuperLayer)
59 {
60  return c_OuterVolume == iSuperLayer;
61 }
62 
63 ISuperLayer 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 
72 ISuperLayer 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.
Definition: ISuperLayer.cc:21
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.
Definition: ISuperLayer.cc:63
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:38
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 ...
Definition: ISuperLayer.cc:48
static bool isInnerVolume(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to the logical superlayer of the column inside the CDC.
Definition: ISuperLayer.cc:53
static ISuperLayer getNextOutwards(ISuperLayer iSuperLayer)
Returns the super layer that is outside of the given super layer.
Definition: ISuperLayer.cc:72
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:43
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.
Definition: ISuperLayer.cc:26
static bool isOuterVolume(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to the logical superlayer of the volumn outside the CDC.
Definition: ISuperLayer.cc:58