65 const std::string& stripKey,
66 const std::string& wireKey,
67 const std::string& padKey,
68 bool writeStripNumbers,
69 bool writeStripCharges,
78 if (writeStripNumbers) {
81 if (writeStripCharges) {
84 if (writeStripTimes) {
120 for (
const auto* prd : *strips) {
126 for (
const auto* prd : *wires) {
132 for (
const auto* prd : *pads) {
144 const auto*
strip = &prd;
146 const auto*
re =
strip->readoutElement();
164 const auto* wire = &prd;
166 const auto*
re = wire->readoutElement();
167 const Amg::Vector3D global{
re->localToGlobalTransform(gctx, wire->layerHash()) * wire->localMeasurementPos()};
172 m_wireLocal.push_back(wire->localPosition<1>()[0]);
173 m_wireCov.push_back(wire->localCovariance<1>()(0, 0));
176 m_wireAuthor.push_back(
static_cast<uint8_t
>(wire->author()));
180 const auto* pad = &prd;
182 const auto*
re = pad->readoutElement();
183 const Amg::Vector3D global{
re->localToGlobalTransform(gctx, pad->layerHash()) * pad->localMeasurementPos()};
185 const auto pos = pad->localPosition<2>();
186 const auto cov = pad->localCovariance<2>();
197 m_padAuthor.push_back(
static_cast<uint8_t
>(pad->author()));
#define ATH_MSG_ERROR(x,...)
Handle class for reading from StoreGate.
bool msgLvl(const MSG::Level lvl) const
Test the output level.
MuonVal::VectorBranch< float > & m_stripLocal
Measured local position of each sTGC strip cluster.
MuonVal::VectorBranch< short > & m_stripTime
Time recorded for each sTGC strip cluster.
MuonVal::MatrixBranch< short > * m_stripTimes
Optional per-cluster lists of constituent strip times; null when not booked.
std::vector< const xAOD::sTgcStripCluster * > m_seedStrips
Strip clusters explicitly selected for output in the current event.
void dumpWire(const ActsTrk::GeometryContext &gctx, const xAOD::sTgcWireHit &prd)
Append a wire hit's identifier and measurement data to the tree.
bool fill(const EventContext &ctx) override final
Read the sTGC containers and append selected measurements to the tree.
unsigned int push_back(const xAOD::sTgcStripCluster &prd)
Select a strip cluster for output.
std::unordered_map< Identifier, unsigned int > m_padIdx
Map from pad-hit identifier to its output index.
MuonVal::VectorBranch< int > & m_padCharge
Charge recorded for each sTGC pad hit.
SG::ReadHandleKey< xAOD::sTgcStripContainer > m_stripKey
StoreGate key for the sTGC strip-cluster container.
MuonVal::VectorBranch< float > & m_padCovYY
Local YY covariance component of each sTGC pad hit.
void dumpAllHitsInChamber(const Identifier &chamberId)
Include all sTGC measurements from the specified chamber in the output.
MuonVal::VectorBranch< float > & m_padCovXY
Local XY covariance component of each sTGC pad hit.
SG::ReadHandleKey< xAOD::sTgcPadContainer > m_padKey
StoreGate key for the sTGC pad-hit container.
MuonVal::ThreeVectorBranch m_stripGlobal
Global-frame position of each sTGC strip cluster.
MuonVal::VectorBranch< short > & m_wireTime
Time recorded for each sTGC wire hit.
std::vector< const xAOD::sTgcWireHit * > m_seedWires
Wire hits explicitly selected for output in the current event.
MuonVal::MatrixBranch< uint16_t > * m_stripNumbers
Optional per-cluster lists of constituent strip numbers; null when not booked.
MuonVal::VectorBranch< float > & m_padLocalY
Local Y coordinate of each sTGC pad hit.
StgcPrdVariables(MuonVal::MuonTesterTree &tree, const std::string &stripKey, const std::string &wireKey, const std::string &padKey, bool writeStripNumbers=true, bool writeStripCharges=true, bool writeStripTimes=true, MSG::Level msgLvl=MSG::INFO)
MuonVal::VectorBranch< int > & m_stripCharge
Charge recorded for each sTGC strip cluster.
MuonVal::VectorBranch< short > & m_padTime
Time recorded for each sTGC pad hit.
void dumpPad(const ActsTrk::GeometryContext &gctx, const xAOD::sTgcPadHit &prd)
Append a pad hit's identifier and measurement data to the tree.
std::unordered_map< Identifier, unsigned int > m_stripIdx
Map from strip-cluster identifier to its output index.
void enableSeededDump()
Enable selection-based output.
MuonVal::VectorBranch< int > & m_wireCharge
Charge recorded for each sTGC wire hit.
std::unordered_map< Identifier, unsigned int > m_wireIdx
Map from wire-hit identifier to its output index.
MuonVal::sTgcIdentifierBranch m_stripId
Identifier branch for sTGC strip clusters.
void clearEventSelection()
Clear the per-event measurement and chamber selections.
std::vector< const xAOD::sTgcPadHit * > m_seedPads
Pad hits explicitly selected for output in the current event.
MuonVal::ThreeVectorBranch m_wireGlobal
Global-frame position of each sTGC wire hit.
MuonVal::VectorBranch< float > & m_wireCov
Local measurement variance of each sTGC wire hit.
SG::ReadHandleKey< xAOD::sTgcWireContainer > m_wireKey
StoreGate key for the sTGC wire-hit container.
std::unordered_set< Identifier > m_filteredChamb
Chamber identifiers whose measurements are included by the chamber filter.
MuonVal::VectorBranch< uint8_t > & m_wireAuthor
Reconstruction author code for each sTGC wire hit.
MuonVal::MatrixBranch< int > * m_stripCharges
Optional per-cluster lists of constituent strip charges; null when not booked.
MuonVal::ThreeVectorBranch m_padGlobal
Global-frame position of each sTGC pad hit.
MuonVal::VectorBranch< uint8_t > & m_padAuthor
Reconstruction author code for each sTGC pad hit.
MuonVal::VectorBranch< float > & m_padCovXX
Local XX covariance component of each sTGC pad hit.
MuonVal::VectorBranch< float > & m_stripCov
Local measurement variance of each sTGC strip cluster.
MuonVal::VectorBranch< uint8_t > & m_stripAuthor
Reconstruction author code for each sTGC strip cluster.
MuonVal::sTgcIdentifierBranch m_wireId
Identifier branch for sTGC wire hits.
MuonVal::sTgcIdentifierBranch m_padId
Identifier branch for sTGC pad hits.
bool m_applyFilter
Whether output is restricted to selected measurements and chambers.
bool declare_keys() override final
Declare dependencies on the configured strip, wire, and pad containers.
MuonVal::VectorBranch< float > & m_wireLocal
Measured local position of each wire hit, along local Y.
void dumpStrip(const ActsTrk::GeometryContext &gctx, const xAOD::sTgcStripCluster &prd)
Append a strip cluster's identifier and measurement data to the tree.
MuonVal::VectorBranch< float > & m_padLocalX
Local X coordinate of each sTGC pad hit.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
TesterModuleBase(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl=MSG::Level::INFO)
const ActsTrk::GeometryContext & getGeoCtx(const EventContext &ctx) const
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
TTree * tree() override final
Returns the underlying TTree object.
MatrixBranch< T > & newMatrix(const std::string &name)
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const Identifier & identify() const
Returns the Athena identifier of the measurement.
Eigen::Matrix< double, 3, 1 > Vector3D
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
sTgcStripCluster_v1 sTgcStripCluster
sTgcWireHit_v1 sTgcWireHit