16#include <unordered_map>
30 m_muonP4 = std::make_unique<MuonValR4::IParticleFourMomBranch>(
m_tree,
"truthMuon");
33 return StatusCode::SUCCESS;
36 const EventContext& ctx{Gaudi::Hive::currentContext()};
40 std::unordered_map<const xAOD::MuonSimHit*, const xAOD::TruthParticle*> hitPartMap{};
46 hitPartMap[hit] = truthPart;
55 for (
const auto&
sp : *bucket) {
57 m_muonP4->push_back(hitPartMap[simHit]);
64 return StatusCode::SUCCESS;
73 case MdtDriftCircleType:{
75 const auto*
re = prd->readoutElement();
84 const auto*
re = prd->readoutElement();
92 const auto* prd =
static_cast<const xAOD::TgcStrip*
>(
sp.primaryMeasurement());
93 const auto*
re = prd->readoutElement();
95 const double halfLength = design.
stripLength(prd->channelNumber());
97 m_spGlobEdgeLow.set( lToGlob*(
sp.localPosition() -halfLength *
sp.sensorDirection()) , idx);
102 case MMClusterType: {
104 const auto*
re = prd->readoutElement();
111 case sTgcStripType: {
113 const auto*
re = prd->readoutElement();
116 switch (prd->channelType()) {
119 double xLow{std::numeric_limits<double>::max()},
120 xHigh{-std::numeric_limits<double>::max()},
121 yLow{std::numeric_limits<double>::max()},
122 yHigh{-std::numeric_limits<double>::max()};
123 for (
const Amg::Vector2D& corner :
re->localPadCorners(prd->measurementHash())) {
124 xLow = std::min(xLow, corner.x());
125 yLow = std::min(yLow, corner.y());
126 xHigh = std::max(xHigh, corner.x());
127 yHigh = std::max(yHigh, corner.y());
136 const double halfLength = 0.5*
re->stripLength(prd->measurementHash());
137 m_spGlobEdgeLow.set( lToGlob*(
sp.localPosition() -halfLength *
sp.sensorDirection()) , idx);
150 return StatusCode::SUCCESS;
const boost::regex re(r_e)
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual double stripLength(int stripNumb) const
Returns length of the strip.
MuonVal::VectorBranch< char > & m_spReadoutSide
MuonVal::MuonTesterTree m_tree
virtual StatusCode execute() override final
SG::ReadHandleKey< xAOD::MuonSegmentContainer > m_truthSegKey
std::size_t fillSpacePoint(const ActsTrk::GeometryContext &gctx, const SpacePoint &sp)
std::shared_ptr< MuonValR4::SpacePointTesterModule > m_spCollection
SG::ReadDecorHandleKey< xAOD::MuonSegmentContainer > m_truthLinkKey
MuonVal::VectorBranch< char > & m_truthLink
std::shared_ptr< MuonVal::IParticleFourMomBranch > m_muonP4
SG::ReadHandleKeyArray< SpacePointContainer > m_spacePointKeys
virtual StatusCode finalize() override final
virtual StatusCode initialize() override final
MuonVal::ThreeVectorBranch m_spGlobPos
MuonVal::ThreeVectorBranch m_spGlobEdgeHigh
SG::ReadHandleKey< ActsTrk::GeometryContext > m_geoCtxKey
MuonVal::ThreeVectorBranch m_spGlobEdgeLow
MuonVal::VectorBranch< float > & m_spTime
: The muon space point bucket represents a collection of points that will bre processed together in t...
The muon space point is the combination of two uncalibrated measurements one of them measures the eta...
@ isMC
Flag determining whether the branch is simulation.
Property holding a SG store/key/clid from which a ReadHandle is made.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
This header ties the generic definitions in this package.
const xAOD::TruthParticle * getTruthMatchedParticle(const xAOD::MuonSegment &segment)
Returns the particle truth-matched to the segment.
const xAOD::MuonSimHit * getTruthMatchedHit(const xAOD::UncalibratedMeasurement &prdHit)
Returns the MuonSimHit, if there's any, matched to the uncalibrated muon measurement.
std::unordered_set< const xAOD::MuonSimHit * > getMatchingSimHits(const xAOD::MuonSegment &segment)
: Returns all sim hits matched to a xAOD::MuonSegment
DataVector< SpacePointBucket > SpacePointContainer
Abrivation of the space point container type.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
MdtDriftCircle_v1 MdtDriftCircle
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
TruthParticle_v1 TruthParticle
Typedef to implementation.
UncalibMeasType
Define the type of the uncalibrated measurement.
RpcMeasurement_v1 RpcMeasurement
sTgcMeasurement_v1 sTgcMeasurement
MuonSegment_v1 MuonSegment
Reference the current persistent version: