49 return StatusCode::SUCCESS;
53 return StatusCode::SUCCESS;
67 static const TruthLinkDecor_t acc{
"truthParticleLink"};
76 return StatusCode::SUCCESS;
80 return StatusCode::SUCCESS;
83 auto testerBr = std::make_shared<SimHitTester>(
m_tree, key,
type, msgLevel());
88 const auto hitSet = MuonR4::getMatchingSimHits(seg);
89 std::vector<const xAOD::MuonSimHit*> sortedHits{};
90 std::ranges::copy_if(hitSet, std::back_inserter(sortedHits), [
this,
type] (
const xAOD::MuonSimHit* hit){
91 return m_detMgr->getReadoutElement(hit->identify())->detectorType() == type;
94 return a->identify() < b->identify();
96 std::vector<unsigned short> matchIds{};
97 std::ranges::transform(sortedHits, std::back_inserter(matchIds), [testerBr](
const xAOD::MuonSimHit* hit){
98 return testerBr->push_back(*hit);
103 m_tree.addBranch(std::move(testerBr));
114 if (m_writesTgcSim) {
120 return StatusCode::SUCCESS;
124 return StatusCode::SUCCESS;
141 return StatusCode::SUCCESS;
145 return StatusCode::SUCCESS;
160 return StatusCode::SUCCESS;
164 return StatusCode::SUCCESS;
172 return StatusCode::SUCCESS;
176 return StatusCode::SUCCESS;
179 const EventContext& ctx{Gaudi::Hive::currentContext()};
180 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.
Gaudi::Property< bool > m_writeSpacePoints
StatusCode setupDigits()
Toggle whether the digit collections shall be tested.
Gaudi::Property< bool > m_writeMmPrds
Gaudi::Property< bool > m_writeNswSp
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< bool > m_writeMuonSp
Gaudi::Property< std::string > m_nswSpKey
Gaudi::Property< std::string > m_tgcPrdKey
Gaudi::Property< std::string > m_rpcPrdKey
Gaudi::Property< bool > m_writePrds
StatusCode setupSpacePoints()
Toggle whether the spacepoint collections shall be tested.
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< std::string > m_generalSpKey
Prd collection names.
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: