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