30 m_tree.addBranch(std::make_unique<EventInfoBranch>(
m_tree, evOpts));
32 auto initSegBranch = [
this](
const std::string& sgKey,
const std::string& outCollName) {
36 auto newColl = std::make_unique<SegmentVariables>(
m_tree, sgKey, outCollName, msgLevel());
46 std::format(
"{:}_truthSegLink", outCollName),[
this](
const SG::AuxElement*
aux) ->
unsigned short{
47 if (acc_truthSegLink.isAvailable(*
aux) && acc_truthSegLink(*aux).isValid()) {
54 m_tree.addBranch(std::move(newColl));
111 return StatusCode::SUCCESS;
116 outBranch = std::count_if(spContainer.
begin(), spContainer.
end(),
118 return Muon::MuonStationIndex::toStationIndex(bucket->msSector()->chamberIndex()) == station;
124 const EventContext& ctx{Gaudi::Hive::currentContext()};
143 if (trksFromHoughR4) {
177 return StatusCode::FAILURE;
179 return StatusCode::SUCCESS;
183 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
DataVector adapter that acts like it holds const pointers.
Handle class for reading from StoreGate.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink implementation for ROOT usage.
: The muon space point bucket represents a collection of points that will bre processed together in t...
Gaudi::Property< std::string > m_segmentKeyR4
Segments made from the R4 segment maker.
ParticleBranchPtr_t m_truthTrks
MuonVal::ScalarBranch< uint16_t > & m_nBucketEE
number of buckets in the EE
SG::ReadHandleKey< MuonR4::SpacePointContainer > m_spacePointKey
Key to the space point container.
Gaudi::Property< bool > m_isMC
MuonVal::ScalarBranch< uint16_t > & m_nBucketBM
number of buckets in the BM
SegmentKey_t m_truthSegmentKey
Segment from the truth hits.
TrackKey_t m_legacyTrackKey
virtual StatusCode execute() override
void fillBucketsPerStation(const MuonR4::SpacePointContainer &spContainer, const StIdx station, MuonVal::ScalarBranch< uint16_t > &outBranch) const
Counts how many buckets are in a particular station.
TrackKey_t m_TrackKeyHoughR4
MuonVal::ScalarBranch< uint16_t > & m_nBucket
number of buckets in the entire MS
MuonVal::ScalarBranch< uint16_t > & m_nBucketBO
number of buckets in the BO
Gaudi::Property< std::string > m_legacySegmentKey
Keys to the segment collections.
SG::ReadDecorHandleKeyArray< SG::AuxVectorBase > m_trkTruthLinks
Decoration dependency to the MS truth track links.
MuonVal::ScalarBranch< uint16_t > & m_nBucketBI
number of buckets in the BI
SegmentBranchPtr_t m_truthSegs
Muon::MuonStationIndex::StIndex StIdx
virtual StatusCode initialize() override
MuonVal::ScalarBranch< uint16_t > & m_nBucketEO
number of buckets in the BO
virtual StatusCode finalize() override
Gaudi::Property< std::string > m_r4PatternSegmentKey
Segments seeded from the R4 pattern but made with the legacy segment maker.
MuonVal::MuonTesterTree m_tree
ParticleBranchPtr_t m_TrksSegmentR4
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthKey
Key to the truth particle collection.
MuonVal::ScalarBranch< uint16_t > & m_nBucketEI
number of buckets in the BI
MuonVal::ScalarBranch< uint16_t > & m_nBucketEM
number of buckets in the BM
ParticleBranchPtr_t m_legacyTrks
ParticleBranchPtr_t m_TrksHoughR4
MuonVal::ScalarBranch< uint16_t > & m_nBucketBE
number of buckets in the BE
static bool connectCollections(ParticleBranch_ptr primColl, ParticleBranch_ptr secondColl, Linker_t fromPrimToSec, const std::string &altPrimName="", const std::string &altSecName="")
@ isMC
Flag determining whether the branch is simulation.
Generic branch object where the information is evaluated by a std::function instead reading it from t...
Base class for elements of a container that can have aux data.
Helper class to provide constant type-safe access to aux data.
Class providing the definition of the 4-vector interface.
const xAOD::TruthParticle * getTruthMatchedParticle(const xAOD::MuonSegment &segment)
Returns the particle truth-matched to the segment.
ElementLink< MuonR4::SegmentContainer > SegLink_t
Abrivation of the link to the reco segment container.
DataVector< SpacePointBucket > SpacePointContainer
Abrivation of the space point container type.
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.
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
MuonSegment_v1 MuonSegment
Reference the current persistent version:
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.