11#include <framework/core/FrameworkExceptions.h>
43 invalidDetector = 0x0,
96 Iterator(
int index, uint16_t detectorSetBits, uint16_t setBit) :
200 Iterator
begin()
const;
205 Iterator
end()
const;
340 void checkSet()
const {
if (!ASetType::set().
contains(*
this))
throw InvalidDetectorTypeError();}
600 throw std::runtime_error(
"Given ParticleType is not a charged stable particle!");
612 throw std::runtime_error(
"Given PDG code is not a charged stable particle!");
637 throw std::runtime_error(
"Given ParticleType is not a cluster particle!");
649 throw std::runtime_error(
"Given PDG code is not a cluster particle!");
Provides a type-safe way to pass members of the chargedStableSet set.
ChargedStable(const ParticleType &p)
Constructor from the more general ParticleType.
ChargedStable(int pdg)
Constructor from PDG code.
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
A class that defines the valid set of Cluster detectors.
static DetectorSet set()
Accessor function for the set of valid detectors.
static const size_t c_size
Number of PID detectors, temporary workaround.
static const DetectorSet c_set
The set of valid tracking detectors.
Provides a type-safe way to pass members of the clusterSet set.
Cluster(const ParticleType &p)
Constructor from the more general ParticleType.
static const unsigned int c_SetSize
Number of elements (for use in array bounds etc.)
Cluster(int pdg)
Constructor from PDG code.
uint16_t getSetBit() const
Get set bit.
uint16_t m_DetectorSetBits
Bits in DetectorSet.
bool operator==(const Iterator &iterator)
Operator ==.
int getIndex() const
Get index.
bool operator!=(const Iterator &iterator)
Operator !=.
Iterator(int index, uint16_t detectorSetBits, uint16_t setBit)
Constructor.
uint16_t m_SetBit
Set bit.
Iterator & operator++()
Operator ++.
EDetector operator*() const
Operator *.
void increment()
Increment.
EDetector getDetector() const
Get detector.
The DetectorSet class for sets of detector IDs in the form of EDetector values.
bool operator==(const DetectorSet &set) const
Equality operator.
std::string __str__() const
String for printing in python.
size_t size() const
Getter for number of detector IDs in this set.
int getIndex(EDetector det) const
Getter for the index of a given detector in this set.
Iterator end() const
Ending iterator.
virtual ~DetectorSet()
Destructor.
uint16_t m_bits
The internal representation of the set as bit pattern.
DetectorSet & operator=(const DetectorSet &)=default
Assignment operator.
bool operator!=(const DetectorSet &set) const
Inequality operator.
DetectorSet & operator-=(const DetectorSet &set)
Subtraction of another set from this one.
static uint16_t getBit(EDetector det)
Conversion of detector ID to bit pattern.
DetectorSet(const DetectorSet &)=default
Copy constructor.
ClassDef(DetectorSet, 1)
Class version.
DetectorSet(uint16_t bits)
Constructor.
bool contains(const DetectorSet &set) const
Check whether this set contains another set.
DetectorSet(EDetector det)
Constructor for a set containig one detector ID.
bool contains(const Iterator &it) const
Check whether this set contains detector specified by iterator.
static EDetector getDetector(uint16_t bit)
Conversion of bit pattern to detector ID.
DetectorSet & operator+=(const DetectorSet &set)
Addition of another set to this one.
DetectorSet()
Default constructor.
Iterator begin() const
Beginning iterator.
A class that defines the valid set of PID detectors.
static DetectorSet set()
Accessor function for the set of valid detectors.
static const size_t c_size
Number of PID detectors, temporary workaround.
static const DetectorSet c_set
The set of valid PID detectors.
A set of ParticleType objects, with defined order.
ParticleType begin() const
Returns first particle.
bool contains(const ParticleType &p) const
Returns true if and only if the set contains 'p'.
unsigned int size() const
Returns number of particles in this set.
std::vector< ParticleType > m_particles
Actual particles.
ParticleType end() const
Returns an invalid particle to check if iteration should be stopped.
ParticleSet & operator=(const ParticleSet &other)
Assignment operator.
void add(const ParticleType &p)
Add a copy of the given ParticleType to this set.
const ParticleType & at(unsigned int index) const
Return particle at given index, or end() if out of range.
const ParticleType & find(int pdg) const
Returns particle in set with given PDG code, or invalidParticle if not found.
ParticleSet(const ParticleSet &other)
Copy constructor to make sure particles belong to correct set.
ParticleSet()=default
Emtpy constructor.
The ParticleType class for identifying different particle types.
int getPDGCode() const
PDG code.
int getIndex() const
This particle's index in the associated set.
bool operator!=(const ParticleType &o) const
Test inequality.
ParticleType & operator=(const ParticleType &)=default
Assignment Operator.
std::string __repr__() const
String for printing in python.
ParticleType(const ParticleType &)=default
Copy constructor
ParticleType & operator*()
dummy dereferencing for range-based for.
ParticleType(int pdgCode, const ParticleSet *set=nullptr, int index=-1)
Constructor.
bool operator<(const ParticleType &other) const
Comparison operator to be usable in sets.
bool operator==(const ParticleType &o) const
Test equality.
int m_index
index in the associated set, -1 if there's no set.
int m_pdgCode
PDG code of the particle.
const TParticlePDG * getParticlePDG() const
Accessor for ROOT TParticlePDG object.
ParticleType & operator++()
Prefix increment.
double getMass() const
Particle mass.
const ParticleSet * m_set
set this particle belongs to, or NULL if stand-alone.
A class for sets of detector IDs whose content is limited to restricted set of valid detector IDs.
RestrictedDetectorSet(const DetectorSet &set)
(Copy) constructor.
static DetectorSet set()
Accessor for the set of valid detector IDs.
RestrictedDetectorSet & operator+=(const DetectorSet &set)
Addition of another set to this one.
void checkSet() const
Check of set validity.
RestrictedDetectorSet(EDetector det)
Constructor for a set containg one detector ID.
A class that defines the valid set of tracking detectors.
static DetectorSet set()
Accessor function for the set of valid detectors.
static const DetectorSet c_set
The set of valid tracking detectors.
A class that defines the valid set of VXD detectors.
static DetectorSet set()
Accessor function for the set of valid detectors.
static const DetectorSet c_set
The set of valid tracking detectors.
This class provides a set of constants for the framework.
static const ParticleType neutron
neutron particle
static const ParticleType unspecifiedParticle
Unspecified particle, used when no other particle type fits.
static const ParticleType pi0
neutral pion particle
static const Cluster clustermuon
muon cluster
static const ParticleType Lambda
Lambda particle.
static const DetectorSet allDetectors
The set of all detectors.
static const double eMobilitySi
Electron mobility in intrinsic Silicon at room temperature.
static const ParticleSet clusterSet
set of cluster particles
static const ChargedStable muon
muon particle
ERunType
Enum for identifying run type (beam or cosmic)
RestrictedDetectorSet< PIDDetectors > PIDDetectorSet
Typedef for set of PID detectors.
static const ParticleSet chargedStableSet
set of charged stable particles
static const float floatNaN
quiet_NaN
static const double kBoltzmann
Boltzmann constant in GeV/K.
static const Cluster clusterelectron
electron cluster
static const double kaonMass
charged kaon mass
EDetector
Enum for identifying the detector components (detector and subdetector).
static const double K0Mass
neutral kaon mass
static const Cluster clusterpion
charged hadron cluster
RestrictedDetectorSet< VXDDetectors > VXDDetectorSet
Typedef for set of VXD detectors.
static const ChargedStable pion
charged pion particle
static std::string parseDetectors(EDetector det)
Converts Const::EDetector object to string.
static const double pionMass
charged pion mass
static const ParticleType Klong
K^0_L particle.
static const ParticleSet finalStateParticlesSet
set of final set particles that can be created by the ParticleLoader
RestrictedDetectorSet< ClusterDetectors > ClusterDetectorSet
Typedef for set of VXD detectors.
static const double permSi
Permittivity of Silicon.
static const double speedOfLight
[cm/ns]
static const double electronMass
electron mass
static const double neutronMass
neutron mass
static const Cluster clusterKlong
K^0_L cluster.
static const ParticleType antiLambda
Anti-Lambda particle.
static const double deuteronMass
deuteron mass
static const ChargedStable proton
proton particle
static const ParticleType invalidParticle
Invalid particle, used internally.
static const double ehEnergy
Energy needed to create an electron-hole pair in Si at std.
Const()=delete
no Const instances allowed.
RestrictedDetectorSet< TrackingDetectors > TrackingDetectorSet
Typedef for set of tracking detectors.
static const ParticleType Kshort
K^0_S particle.
static const double protonMass
proton mass
static const double doubleNaN
quiet_NaN
static const ParticleType antiNeutron
Anti-neutron particle.
static const double fineStrConst
The fine structure constant.
static const Cluster clusterjunk
junk cluster
static const double uTherm
Thermal Voltage at room temperature.
static const ChargedStable kaon
charged kaon particle
static const ParticleType photon
photon particle
static const double pi0Mass
neutral pion mass
static const Cluster clusterphoton
photon cluster
static const double muonMass
muon mass
static const ChargedStable electron
electron particle
static const ChargedStable deuteron
deuteron particle
#define BELLE2_DEFINE_EXCEPTION(ClassName, Message)
Macro that defines an exception with the given message template.
Abstract base class for different kinds of events.