12#include "Acts/Propagator/detail/PointwiseMaterialInteraction.hpp"
24 trk =
static_cast<const xAOD::Muon*
>(p)->trackParticle(xAOD::Muon::TrackParticleType::Primary);
30 constexpr auto iterColumn = Acts::hashString(
"Gx2fnUpdateColumn");
31 if (!actsTrk || !actsTrk->hasColumn(iterColumn)) {
44 m_thickX0{std::make_unique<MuonVal::VectorBranch<float>>(parent.getTree(),
45 std::format(
"{:}_materialX0", parent.name()))},
46 m_nStates{std::make_unique<MuonVal::VectorBranch<std::uint8_t>>(parent.getTree(),
47 std::format(
"{:}_nMaterialStates", parent.name()))} {
48 parent.getTree().addBranch(m_thickX0);
49 parent.getTree().addBranch(m_nStates);
62 trk =
static_cast<const xAOD::Muon*
>(p)->trackParticle(xAOD::Muon::TrackParticleType::Primary);
67 float L0{0.f}, X0{0.f};
68 std::uint8_t nStates{0};
72 for (
auto state : actsTrk->trackStates()) {
73 if (!state.typeFlags().hasMaterial()) {
77 Acts::BoundTrackParameters trkPars = actsTrk->createParametersFromState(state);
79 auto res = Acts::detail::evaluateMaterialSlab(geoCtx->
context(),
80 trkPars.referenceSurface(),
81 Acts::Direction::Forward(),
82 trkPars.position(geoCtx->
context()),
84 Acts::MaterialUpdateMode::FullUpdate);
89 const Acts::MaterialSlab& slab{*
res};
91 if (slab.isVacuum()) {
96 L0 += slab.thicknessInL0();
97 X0 += slab.thicknessInX0();
116 trk =
static_cast<const xAOD::Muon*
>(p)->trackParticle(xAOD::Muon::TrackParticleType::Primary);
121 const Acts::BoundTrackParameters perigee = actsTrk->createParametersAtReference();
122 for (
const auto state : actsTrk->trackStatesReversed()) {
123 const Acts::BoundTrackParameters statePars = actsTrk->createParametersFromState(state);
124 push_back(statePars.absoluteMomentum() - perigee.absoluteMomentum());
std::pair< std::vector< unsigned int >, bool > res
Handle class for reading from StoreGate.
Acts::GeometryContext context() const
EnergyLossBranch(MuonVal::IParticleFourMomBranch &parent)
virtual void push_back(const xAOD::IParticle *p) override
Similar to the IAuxElementDecoration branch but only accepting IParticles.
virtual void operator+=(const xAOD::IParticle *p) override
virtual void operator+=(const xAOD::IParticle *p) override
ActsTrk::GeoContextReadKey_t m_geoCtxKey
std::shared_ptr< MuonVal::VectorBranch< float > > m_thickX0
virtual void push_back(const xAOD::IParticle *p) override
Similar to the IAuxElementDecoration branch but only accepting IParticles.
MaterialRecorderBranch(MuonVal::IParticleFourMomBranch &parent)
virtual bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
std::shared_ptr< MuonVal::VectorBranch< std::uint8_t > > m_nStates
virtual void push_back(const xAOD::IParticle *p) override
Similar to the IAuxElementDecoration branch but only accepting IParticles.
TrackFitIterBranch(IParticleFourMomBranch &parent)
virtual void operator+=(const xAOD::IParticle *p) override
Helper class to easily to add xAOD::IParticles and associated decorator variables to the MuonTesterTr...
MuonTesterTree & parent()
bool declare_dependency(Key &key)
std::string name() const override final
void push_back(const T &value)
Adds a new element at the end of the vector.
VectorBranch(TTree *tree, const std::string &name)
bool init() override
Initialized the Branch.
Class providing the definition of the 4-vector interface.
std::optional< ActsTrk::TrackContainer::ConstTrackProxy > getActsTrack(const xAOD::TrackParticle &trkPart)
Return the proxy to the Acts track from which the track particle was made frome.
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Class to store array like branches into the n-tuples.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
@ TrackParticle
The object is a charged track particle.
@ Muon
The object is a muon.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version:
#define THROW_EXCEPTION(MESSAGE)