Belle II Software  release-08-01-10
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.
 
enum  DetectorsCrossed {
  c_Both = 0 ,
  c_OnlyBarrel = KLMElementNumbers::c_BKLM ,
  c_OnlyEndcap = KLMElementNumbers::c_EKLM
}
 Labels for detectors crossed.
 
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.
 
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. More...
 
static unsigned int calculateExtrapolationOutcome (bool isForward, bool escaped, int lastBarrelLayer, int lastEndcapLayer)
 Calculate the track extrapolation outcome. More...
 
static Hypothesis calculateHypothesisFromPDG (int pdg)
 Calculate hypothesis number from PDG code. More...
 
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. More...
 
static std::vector< int > getPDGVector ()
 Get a vector with all the hypothesis PDG codes used for Muid. More...
 
static int getLongitudinalID (int hypothesis, int outcome, int lastLayer)
 Get the unique longitudinal identifier for given hypothesis, outcome and last layer crossed. More...
 
static int getTransverseID (int hypothesis, int detector, int degreesOfFreedom)
 Get the unique transverse identifier for given hypothesis, detector and degrees of freedom. More...
 

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

◆ 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,
88  c_LastLayerBit = 4,
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().

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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.


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