10#include <klm/muid/MuidElementNumbers.h>
13#include <framework/gearbox/Const.h>
28 if (outcome == MuidElementNumbers::c_NotReached)
31 if ((outcome == MuidElementNumbers::c_StopInBarrel)
35 if ((outcome == MuidElementNumbers::c_StopInForwardEndcap)
39 if ((outcome == MuidElementNumbers::c_ExitBarrel)
43 if ((outcome == MuidElementNumbers::c_ExitForwardEndcap)
47 if ((outcome == MuidElementNumbers::c_StopInBackwardEndcap)
51 if ((outcome == MuidElementNumbers::c_ExitBackwardEndcap)
55 if ((outcome >= MuidElementNumbers::c_CrossBarrelStopInForwardMin)
56 && (outcome <= MuidElementNumbers::c_CrossBarrelStopInForwardMax)
60 if ((outcome >= MuidElementNumbers::c_CrossBarrelStopInBackwardMin)
61 && (outcome <= MuidElementNumbers::c_CrossBarrelStopInBackwardMax)
65 if ((outcome >= MuidElementNumbers::c_CrossBarrelExitForwardMin)
66 && (outcome <= MuidElementNumbers::c_CrossBarrelExitForwardMax)
70 if ((outcome >= MuidElementNumbers::c_CrossBarrelExitBackwardMin)
71 && (outcome <= MuidElementNumbers::c_CrossBarrelExitBackwardMax)
80 unsigned int outcome = MuidElementNumbers::c_NotReached;
81 if ((lastBarrelLayer >= 0) || (lastEndcapLayer >= 0)) {
83 if (lastEndcapLayer < 0) {
85 outcome = MuidElementNumbers::c_ExitBarrel;
87 outcome = MuidElementNumbers::c_StopInBarrel;
92 if (lastBarrelLayer < 0) {
94 outcome = MuidElementNumbers::c_ExitForwardEndcap;
96 outcome = MuidElementNumbers::c_ExitBackwardEndcap;
99 outcome = MuidElementNumbers::c_CrossBarrelExitForwardMin + lastBarrelLayer;
101 outcome = MuidElementNumbers::c_CrossBarrelExitBackwardMin + lastBarrelLayer;
104 if (lastBarrelLayer < 0) {
106 outcome = MuidElementNumbers::c_StopInForwardEndcap;
108 outcome = MuidElementNumbers::c_StopInBackwardEndcap;
111 outcome = MuidElementNumbers::c_CrossBarrelStopInForwardMin + lastBarrelLayer;
113 outcome = MuidElementNumbers::c_CrossBarrelStopInBackwardMin + lastBarrelLayer;
125 return MuidElementNumbers::c_Electron;
127 return MuidElementNumbers::c_Positron;
129 return MuidElementNumbers::c_MuonMinus;
131 return MuidElementNumbers::c_MuonPlus;
134 return MuidElementNumbers::c_Deuteron;
136 return MuidElementNumbers::c_AntiDeuteron;
138 return MuidElementNumbers::c_Proton;
140 return MuidElementNumbers::c_AntiProton;
142 return MuidElementNumbers::c_PionPlus;
144 return MuidElementNumbers::c_PionMinus;
146 return MuidElementNumbers::c_KaonPlus;
148 return MuidElementNumbers::c_KaonMinus;
150 return MuidElementNumbers::c_NotValid;
155 std::vector<int> pdgVector;
158 pdgVector.push_back(-charge * particle.getPDGCode());
160 pdgVector.push_back(charge * particle.getPDGCode());
169 pdgVector.insert(pdgVector.end(), temp.begin(), temp.end());
170 std::sort(pdgVector.begin(), pdgVector.end());
184 int id = degreesOfFreedom;
Provides a type-safe way to pass members of the chargedStableSet set.
static const ChargedStable muon
muon particle
static const ParticleSet chargedStableSet
set of charged stable particles
static const ChargedStable pion
charged pion particle
static const ChargedStable proton
proton particle
static const ChargedStable kaon
charged kaon particle
static const ChargedStable electron
electron particle
static const ChargedStable deuteron
deuteron particle
static int getLongitudinalID(int hypothesis, int outcome, int lastLayer)
Get the unique longitudinal identifier for given hypothesis, outcome and last layer crossed.
static constexpr int getMaximalEndcapForwardLayer()
Get maximal endcap-forward layer number (0-based).
static int getTransverseID(int hypothesis, int detector, int degreesOfFreedom)
Get the unique transverse identifier for given hypothesis, detector and degrees of freedom.
static unsigned int calculateExtrapolationOutcome(bool isForward, bool escaped, int lastBarrelLayer, int lastEndcapLayer)
Calculate the track extrapolation outcome.
static constexpr int getMaximalEndcapBackwardLayer()
Get maximal endcap-forward layer number (0-based).
MuidElementNumbers()
Constructor.
static constexpr int getMaximalBarrelLayer()
Get maximal barrel layer number (0-based).
@ 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().
static std::vector< int > getPDGVector()
Get a vector with all the hypothesis PDG codes used for Muid.
static bool checkExtrapolationOutcome(unsigned int outcome, int lastLayer)
Check the track extrapolation outcome.
Hypothesis
Hypothesis number.
static Hypothesis calculateHypothesisFromPDG(int pdg)
Calculate hypothesis number from PDG code.
~MuidElementNumbers()
Destructor.
Abstract base class for different kinds of events.