Belle II Software development
MuidElementNumbers Class Reference

Muid element numbers. More...

#include <MuidElementNumbers.h>

Public Types

enum  Outcome {
  c_NotReached = 0 ,
  c_StopInBarrel = 1 ,
  c_StopInForwardEndcap = 2 ,
  c_ExitBarrel = 3 ,
  c_ExitForwardEndcap = 4 ,
  c_StopInBackwardEndcap = 5 ,
  c_ExitBackwardEndcap = 6 ,
  c_CrossBarrelStopInForwardMin = 7 ,
  c_CrossBarrelStopInForwardMax = 21 ,
  c_CrossBarrelStopInBackwardMin = 22 ,
  c_CrossBarrelStopInBackwardMax = 36 ,
  c_CrossBarrelExitForwardMin = 37 ,
  c_CrossBarrelExitForwardMax = 51 ,
  c_CrossBarrelExitBackwardMin = 52 ,
  c_CrossBarrelExitBackwardMax = 66
}
 Outcome of the track extrapolation. More...
 
enum  DetectorsCrossed {
  c_Both = 0 ,
  c_OnlyBarrel = KLMElementNumbers::c_BKLM ,
  c_OnlyEndcap = KLMElementNumbers::c_EKLM
}
 Labels for detectors crossed. More...
 
enum  Hypothesis {
  c_NotValid = -1 ,
  c_Positron = 0 ,
  c_Electron = 1 ,
  c_Deuteron = 2 ,
  c_AntiDeuteron = 3 ,
  c_Proton = 4 ,
  c_AntiProton = 5 ,
  c_PionPlus = 6 ,
  c_PionMinus = 7 ,
  c_KaonPlus = 8 ,
  c_KaonMinus = 9 ,
  c_MuonPlus = 10 ,
  c_MuonMinus = 11
}
 Hypothesis number. More...
 
enum  IdentifierBits {
  c_OutcomeBit = 7 ,
  c_LastLayerBit = 4 ,
  c_DetectorBit = 2 ,
  c_DegreesOfFreedomBit = 6
}
 Bits used for unique identifiers in getLongitudinalID() and in getTransverseID(). More...
 

Public Member Functions

 MuidElementNumbers ()
 Constructor.
 
 ~MuidElementNumbers ()
 Destructor.
 

Static Public Member Functions

static bool checkExtrapolationOutcome (unsigned int outcome, int lastLayer)
 Check the track extrapolation outcome.
 
static unsigned int calculateExtrapolationOutcome (bool isForward, bool escaped, int lastBarrelLayer, int lastEndcapLayer)
 Calculate the track extrapolation outcome.
 
static Hypothesis calculateHypothesisFromPDG (int pdg)
 Calculate hypothesis number from PDG code.
 
static constexpr int getMaximalBarrelLayer ()
 Get maximal barrel layer number (0-based).
 
static constexpr int getMaximalEndcapForwardLayer ()
 Get maximal endcap-forward layer number (0-based).
 
static constexpr int getMaximalEndcapBackwardLayer ()
 Get maximal endcap-forward layer number (0-based).
 
static constexpr int getMaximalOutcome ()
 Get maximal value of the track extrapolation outcome.
 
static constexpr int getMaximalDetector ()
 Get maximal value of the detector selector (for transverse scattering).
 
static constexpr int getMaximalHalfNdof ()
 Get maximal value of NDof/2 (for transverse scattering).
 
static constexpr int getSizeReducedChiSquared ()
 Get size of array with reduced chi-squared values (for transverse scattering).
 
static constexpr double getMaximalReducedChiSquared ()
 Get maximal value of reduced chi-squared (for transverse scattering).
 
static std::vector< int > getPDGVector (int charge)
 Get a vector with all the hypothesis PDG codes used for Muid.
 
static std::vector< int > getPDGVector ()
 Get a vector with all the hypothesis PDG codes used for Muid.
 
static int getLongitudinalID (int hypothesis, int outcome, int lastLayer)
 Get the unique longitudinal identifier for given hypothesis, outcome and last layer crossed.
 
static int getTransverseID (int hypothesis, int detector, int degreesOfFreedom)
 Get the unique transverse identifier for given hypothesis, detector and degrees of freedom.
 

Static Protected Attributes

static constexpr int m_MaximalBarrelLayer = BKLMElementNumbers::getMaximalLayerNumber() - 1
 Maximal barrel layer number (0-based).
 
static constexpr int m_MaximalEndcapForwardLayer = EKLMElementNumbers::getMaximalLayerNumber() - 1
 Maximal endcap-forward layer number (0-based).
 
static constexpr int m_MaximalEndcapBackwardLayer = m_MaximalEndcapForwardLayer - 2
 Maximal endcap-backward layer number (0-based).
 
static constexpr int m_MaximalOutcome = c_CrossBarrelExitBackwardMax
 Maximal value of the outcome extrapolation.
 
static constexpr int m_MaximalDetector = c_OnlyEndcap
 Maximal value of the detector selector (for transverse scattering).
 
static constexpr int m_MaximalHalfNDof = 18
 Maximal value of NDof/2 (for transverse scattering).
 
static constexpr int m_SizeReducedChiSquared = 100
 Size of array with reduced chi-squared values (for transverse scattering).
 
static constexpr double m_MaximalReducedChiSquared = 10.
 Maximal value of reduced chi-squared (for transverse scattering).
 

Detailed Description

Muid element numbers.

Definition at line 28 of file MuidElementNumbers.h.

Member Enumeration Documentation

◆ DetectorsCrossed

Labels for detectors crossed.

Definition at line 56 of file MuidElementNumbers.h.

56 {
57 c_Both = 0,
58 c_OnlyBarrel = KLMElementNumbers::c_BKLM,
59 c_OnlyEndcap = KLMElementNumbers::c_EKLM,
60 };

◆ Hypothesis

enum Hypothesis

Hypothesis number.

Definition at line 65 of file MuidElementNumbers.h.

65 {
66 c_NotValid = -1,
67 c_Positron = 0,
68 c_Electron = 1,
69 c_Deuteron = 2,
70 c_AntiDeuteron = 3,
71 c_Proton = 4,
72 c_AntiProton = 5,
73 c_PionPlus = 6,
74 c_PionMinus = 7,
75 c_KaonPlus = 8,
76 c_KaonMinus = 9,
77 c_MuonPlus = 10,
78 c_MuonMinus = 11,
79 };

◆ IdentifierBits

Bits used for unique identifiers in getLongitudinalID() and in getTransverseID().

Enumerator
c_OutcomeBit 

Number of bits occupied by outcome in getLongitudinalID().

c_LastLayerBit 

Number of bits occupied by lastLayer in getLongitudinalID().

c_DetectorBit 

Number of bits occupied by detector in getTransverseID().

c_DegreesOfFreedomBit 

Number of bits occupied by degreesOfFreedom in getTransverseID().

Definition at line 84 of file MuidElementNumbers.h.

84 {
86 c_OutcomeBit = 7,
90 c_DetectorBit = 2,
93 };
@ c_OutcomeBit
Number of bits occupied by outcome in getLongitudinalID().
@ c_DetectorBit
Number of bits occupied by detector in getTransverseID().
@ c_DegreesOfFreedomBit
Number of bits occupied by degreesOfFreedom in getTransverseID().
@ c_LastLayerBit
Number of bits occupied by lastLayer in getLongitudinalID().

◆ Outcome

enum Outcome

Outcome of the track extrapolation.

Definition at line 35 of file MuidElementNumbers.h.

35 {
36 c_NotReached = 0,
37 c_StopInBarrel = 1,
38 c_StopInForwardEndcap = 2,
39 c_ExitBarrel = 3,
40 c_ExitForwardEndcap = 4,
41 c_StopInBackwardEndcap = 5,
42 c_ExitBackwardEndcap = 6,
43 c_CrossBarrelStopInForwardMin = 7,
44 c_CrossBarrelStopInForwardMax = 21,
45 c_CrossBarrelStopInBackwardMin = 22,
46 c_CrossBarrelStopInBackwardMax = 36,
47 c_CrossBarrelExitForwardMin = 37,
48 c_CrossBarrelExitForwardMax = 51,
49 c_CrossBarrelExitBackwardMin = 52,
50 c_CrossBarrelExitBackwardMax = 66
51 };

Constructor & Destructor Documentation

◆ MuidElementNumbers()

Constructor.

Definition at line 17 of file MuidElementNumbers.cc.

18{
19}

◆ ~MuidElementNumbers()

Destructor.

Definition at line 21 of file MuidElementNumbers.cc.

22{
23}

Member Function Documentation

◆ calculateExtrapolationOutcome()

unsigned int calculateExtrapolationOutcome ( bool  isForward,
bool  escaped,
int  lastBarrelLayer,
int  lastEndcapLayer 
)
static

Calculate the track extrapolation outcome.

Parameters
[in]isForwardForward or backward.
[in]escapedEscaped or not from KLM volumes.
[in]lastBarrelLayerLast barrel layer crossed during the extrapolation.
[in]lastEndcapLayerLast endcap layer crossed during the extrapolation.

Definition at line 77 of file MuidElementNumbers.cc.

79{
80 unsigned int outcome = MuidElementNumbers::c_NotReached;
81 if ((lastBarrelLayer >= 0) || (lastEndcapLayer >= 0)) {
82 /* Stop or exit in barrel. */
83 if (lastEndcapLayer < 0) {
84 if (escaped)
85 outcome = MuidElementNumbers::c_ExitBarrel;
86 else
87 outcome = MuidElementNumbers::c_StopInBarrel;
88 }
89 /* Stop or exit in endcap. */
90 else {
91 if (escaped) {
92 if (lastBarrelLayer < 0) { /* Exit in endcap with no barrel hits. */
93 if (isForward)
94 outcome = MuidElementNumbers::c_ExitForwardEndcap;
95 else
96 outcome = MuidElementNumbers::c_ExitBackwardEndcap;
97 } else { /* Exit in endcap with barrel hits. */
98 if (isForward)
99 outcome = MuidElementNumbers::c_CrossBarrelExitForwardMin + lastBarrelLayer;
100 else
101 outcome = MuidElementNumbers::c_CrossBarrelExitBackwardMin + lastBarrelLayer;
102 }
103 } else {
104 if (lastBarrelLayer < 0) { /* Stop in endcap with no barrel hits. */
105 if (isForward)
106 outcome = MuidElementNumbers::c_StopInForwardEndcap;
107 else
108 outcome = MuidElementNumbers::c_StopInBackwardEndcap;
109 } else { /* Stop in endcap with barrel hits. */
110 if (isForward)
111 outcome = MuidElementNumbers::c_CrossBarrelStopInForwardMin + lastBarrelLayer;
112 else
113 outcome = MuidElementNumbers::c_CrossBarrelStopInBackwardMin + lastBarrelLayer;
114 }
115 }
116 }
117 }
118 return outcome;
119}

◆ calculateHypothesisFromPDG()

MuidElementNumbers::Hypothesis calculateHypothesisFromPDG ( int  pdg)
static

Calculate hypothesis number from PDG code.

Parameters
[in]pdgPDG code.

Definition at line 121 of file MuidElementNumbers.cc.

122{
123 /* For leptons, the sign of the PDG code is opposite to the charge. */
124 if (pdg == Const::electron.getPDGCode())
125 return MuidElementNumbers::c_Electron;
126 if (pdg == -Const::electron.getPDGCode())
127 return MuidElementNumbers::c_Positron;
128 if (pdg == Const::muon.getPDGCode())
129 return MuidElementNumbers::c_MuonMinus;
130 if (pdg == -Const::muon.getPDGCode())
131 return MuidElementNumbers::c_MuonPlus;
132 /* For hadrons, the sign of the PDG code is equal to the charge. */
133 if (pdg == Const::deuteron.getPDGCode())
134 return MuidElementNumbers::c_Deuteron;
135 if (pdg == -Const::deuteron.getPDGCode())
136 return MuidElementNumbers::c_AntiDeuteron;
137 if (pdg == Const::proton.getPDGCode())
138 return MuidElementNumbers::c_Proton;
139 if (pdg == -Const::proton.getPDGCode())
140 return MuidElementNumbers::c_AntiProton;
141 if (pdg == Const::pion.getPDGCode())
142 return MuidElementNumbers::c_PionPlus;
143 if (pdg == -Const::pion.getPDGCode())
144 return MuidElementNumbers::c_PionMinus;
145 if (pdg == Const::kaon.getPDGCode())
146 return MuidElementNumbers::c_KaonPlus;
147 if (pdg == -Const::kaon.getPDGCode())
148 return MuidElementNumbers::c_KaonMinus;
149 /* Only charged final state particles are supported. */
150 return MuidElementNumbers::c_NotValid;
151}
static const ChargedStable muon
muon particle
Definition: Const.h:660
static const ChargedStable pion
charged pion particle
Definition: Const.h:661
static const ChargedStable proton
proton particle
Definition: Const.h:663
static const ChargedStable kaon
charged kaon particle
Definition: Const.h:662
static const ChargedStable electron
electron particle
Definition: Const.h:659
static const ChargedStable deuteron
deuteron particle
Definition: Const.h:664

◆ checkExtrapolationOutcome()

bool checkExtrapolationOutcome ( unsigned int  outcome,
int  lastLayer 
)
static

Check the track extrapolation outcome.

Parameters
[in]outcomeTrack extrapolation outcome.
[in]lastLayerLast layer crossed during the extrapolation.

Definition at line 25 of file MuidElementNumbers.cc.

26{
27 /* KLM volume not reached during the extrapolation. */
28 if (outcome == MuidElementNumbers::c_NotReached)
29 return false;
30 /* Barrel stop: never in layer 14. */
31 if ((outcome == MuidElementNumbers::c_StopInBarrel)
32 && (lastLayer > MuidElementNumbers::getMaximalBarrelLayer() - 1))
33 return false;
34 /* Forward endcap stop: never in layer 13. */
35 if ((outcome == MuidElementNumbers::c_StopInForwardEndcap)
37 return false;
38 /* Barrel exit: no layers greater than 15. */
39 if ((outcome == MuidElementNumbers::c_ExitBarrel)
41 return false;
42 /* Forward endcap exit: no layers greater than 14. */
43 if ((outcome == MuidElementNumbers::c_ExitForwardEndcap)
45 return false;
46 /* Backward endcap stop: never in layer 11. */
47 if ((outcome == MuidElementNumbers::c_StopInBackwardEndcap)
49 return false;
50 /* Backward endcap exit: no layers greater than 12. */
51 if ((outcome == MuidElementNumbers::c_ExitBackwardEndcap)
53 return false;
54 /* Like outcome == c_StopInForwardEndcap. */
55 if ((outcome >= MuidElementNumbers::c_CrossBarrelStopInForwardMin)
56 && (outcome <= MuidElementNumbers::c_CrossBarrelStopInForwardMax)
58 return false;
59 /* Like outcome == c_StopInBackwardEndcap. */
60 if ((outcome >= MuidElementNumbers::c_CrossBarrelStopInBackwardMin)
61 && (outcome <= MuidElementNumbers::c_CrossBarrelStopInBackwardMax)
63 return false;
64 /* Like outcome == c_ExitForwardEndcap. */
65 if ((outcome >= MuidElementNumbers::c_CrossBarrelExitForwardMin)
66 && (outcome <= MuidElementNumbers::c_CrossBarrelExitForwardMax)
68 return false;
69 /* Like outcome == c_ExitBackwardEndcap. */
70 if ((outcome >= MuidElementNumbers::c_CrossBarrelExitBackwardMin)
71 && (outcome <= MuidElementNumbers::c_CrossBarrelExitBackwardMax)
73 return false;
74 return true;
75}
static constexpr int getMaximalEndcapForwardLayer()
Get maximal endcap-forward layer number (0-based).
static constexpr int getMaximalEndcapBackwardLayer()
Get maximal endcap-forward layer number (0-based).
static constexpr int getMaximalBarrelLayer()
Get maximal barrel layer number (0-based).

◆ getLongitudinalID()

int getLongitudinalID ( int  hypothesis,
int  outcome,
int  lastLayer 
)
static

Get the unique longitudinal identifier for given hypothesis, outcome and last layer crossed.

bits 0-3 for hypothesis; bits 4-10 for outcome; bits 11-14 for last layer crossed.

Parameters
[in]hypothesisHypothesis number.
[in]outcomeTrack extrapolation outcome.
[in]lastLayerLast layer crossed during the extrapolation..

Definition at line 174 of file MuidElementNumbers.cc.

175{
176 int id = lastLayer;
177 id += (outcome << MuidElementNumbers::c_LastLayerBit);
179 return id;
180}

◆ getMaximalBarrelLayer()

static constexpr int getMaximalBarrelLayer ( )
inlinestaticconstexpr

Get maximal barrel layer number (0-based).

Definition at line 130 of file MuidElementNumbers.h.

131 {
133 }
static constexpr int m_MaximalBarrelLayer
Maximal barrel layer number (0-based).

◆ getMaximalDetector()

static constexpr int getMaximalDetector ( )
inlinestaticconstexpr

Get maximal value of the detector selector (for transverse scattering).

Definition at line 162 of file MuidElementNumbers.h.

163 {
164 return m_MaximalDetector;
165 }
static constexpr int m_MaximalDetector
Maximal value of the detector selector (for transverse scattering).

◆ getMaximalEndcapBackwardLayer()

static constexpr int getMaximalEndcapBackwardLayer ( )
inlinestaticconstexpr

Get maximal endcap-forward layer number (0-based).

Definition at line 146 of file MuidElementNumbers.h.

147 {
149 }
static constexpr int m_MaximalEndcapBackwardLayer
Maximal endcap-backward layer number (0-based).

◆ getMaximalEndcapForwardLayer()

static constexpr int getMaximalEndcapForwardLayer ( )
inlinestaticconstexpr

Get maximal endcap-forward layer number (0-based).

Definition at line 138 of file MuidElementNumbers.h.

139 {
141 }
static constexpr int m_MaximalEndcapForwardLayer
Maximal endcap-forward layer number (0-based).

◆ getMaximalHalfNdof()

static constexpr int getMaximalHalfNdof ( )
inlinestaticconstexpr

Get maximal value of NDof/2 (for transverse scattering).

Definition at line 170 of file MuidElementNumbers.h.

171 {
172 return m_MaximalHalfNDof;
173 }
static constexpr int m_MaximalHalfNDof
Maximal value of NDof/2 (for transverse scattering).

◆ getMaximalOutcome()

static constexpr int getMaximalOutcome ( )
inlinestaticconstexpr

Get maximal value of the track extrapolation outcome.

Definition at line 154 of file MuidElementNumbers.h.

155 {
156 return m_MaximalOutcome;
157 }
static constexpr int m_MaximalOutcome
Maximal value of the outcome extrapolation.

◆ getMaximalReducedChiSquared()

static constexpr double getMaximalReducedChiSquared ( )
inlinestaticconstexpr

Get maximal value of reduced chi-squared (for transverse scattering).

Definition at line 186 of file MuidElementNumbers.h.

187 {
189 }
static constexpr double m_MaximalReducedChiSquared
Maximal value of reduced chi-squared (for transverse scattering).

◆ getPDGVector() [1/2]

std::vector< int > getPDGVector ( )
static

Get a vector with all the hypothesis PDG codes used for Muid.

Both positive and negative charges are returned.

Definition at line 165 of file MuidElementNumbers.cc.

166{
167 std::vector<int> pdgVector = getPDGVector(1);
168 std::vector<int> temp = getPDGVector(-1);
169 pdgVector.insert(pdgVector.end(), temp.begin(), temp.end());
170 std::sort(pdgVector.begin(), pdgVector.end());
171 return pdgVector;
172}
static std::vector< int > getPDGVector()
Get a vector with all the hypothesis PDG codes used for Muid.

◆ getPDGVector() [2/2]

std::vector< int > getPDGVector ( int  charge)
static

Get a vector with all the hypothesis PDG codes used for Muid.

Only the codes of the selected charge are returned.

Parameters
[in]chargeOnly codes of the selected charge are returned.

Definition at line 153 of file MuidElementNumbers.cc.

154{
155 std::vector<int> pdgVector;
156 for (const Const::ChargedStable particle : Const::chargedStableSet) {
157 if ((particle == Const::electron) || (particle == Const::muon))
158 pdgVector.push_back(-charge * particle.getPDGCode());
159 else
160 pdgVector.push_back(charge * particle.getPDGCode());
161 }
162 return pdgVector;
163}
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:589
static const ParticleSet chargedStableSet
set of charged stable particles
Definition: Const.h:618

◆ getSizeReducedChiSquared()

static constexpr int getSizeReducedChiSquared ( )
inlinestaticconstexpr

Get size of array with reduced chi-squared values (for transverse scattering).

Definition at line 178 of file MuidElementNumbers.h.

179 {
181 }
static constexpr int m_SizeReducedChiSquared
Size of array with reduced chi-squared values (for transverse scattering).

◆ getTransverseID()

int getTransverseID ( int  hypothesis,
int  detector,
int  degreesOfFreedom 
)
static

Get the unique transverse identifier for given hypothesis, detector and degrees of freedom.

bit 0-3 for hypothesis; bit 4-5 for detector; bit 6-11 for degrees of freedom.

Parameters
[in]hypothesisHypothesis number.
[in]detectorDetector number.
[in]degreesOfFreedomNumber of degrees of freedom.

Definition at line 182 of file MuidElementNumbers.cc.

183{
184 int id = degreesOfFreedom;
187 return id;
188}

Member Data Documentation

◆ m_MaximalBarrelLayer

constexpr int m_MaximalBarrelLayer = BKLMElementNumbers::getMaximalLayerNumber() - 1
staticconstexprprotected

Maximal barrel layer number (0-based).

Definition at line 229 of file MuidElementNumbers.h.

◆ m_MaximalDetector

constexpr int m_MaximalDetector = c_OnlyEndcap
staticconstexprprotected

Maximal value of the detector selector (for transverse scattering).

Definition at line 241 of file MuidElementNumbers.h.

◆ m_MaximalEndcapBackwardLayer

constexpr int m_MaximalEndcapBackwardLayer = m_MaximalEndcapForwardLayer - 2
staticconstexprprotected

Maximal endcap-backward layer number (0-based).

Definition at line 235 of file MuidElementNumbers.h.

◆ m_MaximalEndcapForwardLayer

constexpr int m_MaximalEndcapForwardLayer = EKLMElementNumbers::getMaximalLayerNumber() - 1
staticconstexprprotected

Maximal endcap-forward layer number (0-based).

Definition at line 232 of file MuidElementNumbers.h.

◆ m_MaximalHalfNDof

constexpr int m_MaximalHalfNDof = 18
staticconstexprprotected

Maximal value of NDof/2 (for transverse scattering).

Definition at line 244 of file MuidElementNumbers.h.

◆ m_MaximalOutcome

constexpr int m_MaximalOutcome = c_CrossBarrelExitBackwardMax
staticconstexprprotected

Maximal value of the outcome extrapolation.

Definition at line 238 of file MuidElementNumbers.h.

◆ m_MaximalReducedChiSquared

constexpr double m_MaximalReducedChiSquared = 10.
staticconstexprprotected

Maximal value of reduced chi-squared (for transverse scattering).

Definition at line 250 of file MuidElementNumbers.h.

◆ m_SizeReducedChiSquared

constexpr int m_SizeReducedChiSquared = 100
staticconstexprprotected

Size of array with reduced chi-squared values (for transverse scattering).

Definition at line 247 of file MuidElementNumbers.h.


The documentation for this class was generated from the following files: