46 return StatusCode::SUCCESS;
50 return StatusCode::SUCCESS;
64 static const TruthLinkDecor_t acc{
"truthParticleLink"};
73 return StatusCode::SUCCESS;
77 return StatusCode::SUCCESS;
80 auto testerBr = std::make_shared<SimHitTester>(
m_tree, key,
type, msgLevel());
85 const auto hitSet = MuonR4::getMatchingSimHits(seg);
86 std::vector<const xAOD::MuonSimHit*> sortedHits{};
87 std::ranges::copy_if(hitSet, std::back_inserter(sortedHits), [
this,
type] (
const xAOD::MuonSimHit* hit){
88 return m_detMgr->getReadoutElement(hit->identify())->detectorType() == type;
91 return a->identify() < b->identify();
93 std::vector<unsigned short> matchIds{};
94 std::ranges::transform(sortedHits, std::back_inserter(matchIds), [testerBr](
const xAOD::MuonSimHit* hit){
95 return testerBr->push_back(*hit);
100 m_tree.addBranch(std::move(testerBr));
111 if (m_writesTgcSim) {
117 return StatusCode::SUCCESS;
121 return StatusCode::SUCCESS;
138 return StatusCode::SUCCESS;
142 return StatusCode::SUCCESS;
157 return StatusCode::SUCCESS;
161 return StatusCode::SUCCESS;
164 const EventContext& ctx{Gaudi::Hive::currentContext()};
165 return m_tree.fill(ctx) ? StatusCode::SUCCESS : StatusCode::FAILURE;
#define ATH_CHECK
Evaluate an expression and check for errors.
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
ElementLink< xAOD::TruthParticleContainer > TruthLink_t
const ServiceHandle< StoreGateSvc > & detStore() const
ElementLink implementation for ROOT usage.
StatusCode setupDigits()
Toggle whether the digit collections shall be tested.
Gaudi::Property< bool > m_writeMmPrds
StatusCode execute() override final
Gaudi::Property< std::string > m_tgcDigitKey
Gaudi::Property< std::string > m_mmPrdKey
StatusCode initialize() override final
StatusCode setupSimHits()
Toggle whether the simHit collection of each sub detector shall be written to disk.
Gaudi::Property< bool > m_writeTgcPrds
Gaudi::Property< bool > m_writeMdtDigits
Gaudi::Property< std::string > m_mdtTwinPrdKey
Gaudi::Property< std::string > m_tgcPrdKey
Gaudi::Property< std::string > m_rpcPrdKey
Gaudi::Property< bool > m_writePrds
Gaudi::Property< bool > m_writeMmDigits
Gaudi::Property< std::string > m_truthSegCont
Name of the truth segment container.
Gaudi::Property< bool > m_writeDigits
Gaudi::Property< std::string > m_truthMuonCont
Name of the truth particle container.
Gaudi::Property< bool > m_isMC
Gaudi::Property< bool > m_writeSimHits
StatusCode finalize() override final
Gaudi::Property< bool > m_writeRpcDigits
const MuonGMR4::MuonDetectorManager * m_detMgr
StatusCode setupPrds()
Toggle whether the uncalibrated measurement collections shall be tested.
Gaudi::Property< bool > m_writeTruthSeg
Flag toggling whether the truth segment container shall be written.
std::shared_ptr< MuonPRDTest::ParticleVariables > m_truthParts
Gaudi::Property< std::string > m_sTgcDigitKey
std::shared_ptr< MuonPRDTest::SegmentVariables > m_truthSegs
Gaudi::Property< bool > m_writeTgcDigits
Gaudi::Property< std::string > m_mdtPrdKey
Prd collection names.
Gaudi::Property< std::string > m_mdtDigitKey
Container keys of the particular digit collections.
MuonVal::MuonTesterTree m_tree
Gaudi::Property< bool > m_writeMdtPrds
Gaudi::Property< std::string > m_mmDigitKey
Gaudi::Property< bool > m_writesTgcDigits
Gaudi::Property< bool > m_writePileUp
Gaudi::Property< bool > m_writeRpcPrds
Gaudi::Property< bool > m_writeTruthMuon
Flag toggling whether the truth particle container shall be written.
Gaudi::Property< std::string > m_rpcDigitKey
virtual ~MuonHitTesterAlg()
SG::ReadHandleKey< xAOD::EventInfo > m_evtKey
@ writePileUp
Write pile-up information.
@ isMC
Flag determining whether the branch is simulation.
Helper class to provide constant type-safe access to aux data.
std::string to_string(const DetectorType &type)
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
@ Mm
Maybe not needed in the migration.
@ Tgc
Resitive Plate Chambers.
@ Rpc
Monitored Drift Tubes.
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.
MuonSimHit_v1 MuonSimHit
Defined the version of the MuonSimHit.
MuonSegment_v1 MuonSegment
Reference the current persistent version: