11 static const std::string preFixStr{
"MuSim_"};
12 static const SG::AuxElement::Accessor<Identifier::value_type> acc_Identifier{preFixStr+
"identifier"};
16 static const SG::AuxElement::Accessor<unsigned short> acc_mcEventIndex{preFixStr+
"mcEventIndex"};
17 static const SG::AuxElement::Accessor<unsigned int> acc_uniqueID{preFixStr+
"uniqueID"};
20#define IMPLEMENT_SETTER_GETTER( DTYPE, GETTER, SETTER) \
21 DTYPE MuonSimHit_v1::GETTER() const { \
22 static const SG::AuxElement::Accessor<DTYPE> acc{preFixStr + #GETTER}; \
26 void MuonSimHit_v1::SETTER(DTYPE value) { \
27 static const SG::AuxElement::Accessor<DTYPE> acc{preFixStr + #GETTER}; \
54 return std::sqrt(1. - std::min(std::pow(
mass() / (
e > std::numeric_limits<float>::epsilon() ?
e : 1.f), 2),1.));
58 lPos = std::move(
vec);
64 lPos = std::move(
vec);
70 auto link = std::make_unique<HepMcParticleLink>(acc_uniqueID(*
this),
71 acc_mcEventIndex(*
this),
80 acc_mcEventIndex(*
this) = link.getEventPositionInCollection(SG::CurrentEventStore::store());
81 acc_uniqueID(*
this) = link.id();
89#undef IMPLEMENT_SETTER_GETTER
std::vector< size_t > vec
#define IMPLEMENT_SETTER_GETTER(DTYPE, GETTER, SETTER)
a link optimized in size for a GenParticle in a McEventCollection
void setGenParticleLink(const HepMcParticleLink &link)
Sets the link to the HepMC particle producing this hit.
CxxUtils::CachedUniquePtr< HepMcParticleLink > m_hepMCLink
void setLocalDirection(MeasVector< 3 > vec)
Sets the local direction of the traversing particle.
ConstVectorMap< 3 > localDirection() const
Returns the local direction of the traversing particle.
float beta() const
returns beta (fraction of speed of light)
void setIdentifier(const Identifier &id)
Sets the global ATLAS identifier.
float mass() const
Returns the rest-mass of the traversing particle.
Identifier identify() const
Returns the global ATLAS identifier of the SimHit.
ConstVectorMap< 3 > localPosition() const
Returns the local postion of the traversing particle.
const HepMcParticleLink & genParticleLink() const
Returns the link to the HepMC particle producing this hit.
MuonSimHit_v1 & operator=(const MuonSimHit_v1 &other)
void setLocalPosition(MeasVector< 3 > vec)
Sets the local position of the traversing particle.
std::unique_ptr< const HepMcParticleLink > releaseParticleLink()
Return the pointer to the HepMC particle link and resets the cache.
float kineticEnergy() const
Returns the kinetic energy of the traversing particle.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
SG::AuxElement::Accessor< std::array< float, N > > PosAccessor
xAOD Accessor to the position
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
Eigen::Map< MeasVector< N > > VectorMap
Eigen::Map< const MeasVector< N > > ConstVectorMap