ATLAS Offline Software
Loading...
Searching...
No Matches
TrackContainerModule.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
5
8
9using namespace Acts;
10namespace MuonValR4{
12 const std::string& inContainer,
13 MSG::Level msgLvl,
14 const std::string& collName):
15 TesterModuleBase{tree, inContainer, msgLvl},
16 m_key{inContainer},
17 m_collName{collName} {}
18
22 bool TrackContainerModule::fill(const EventContext& ctx){
23 const ActsTrk::TrackContainer* tracks{nullptr};
24 if (!SG::get(tracks, m_key, ctx)) {
25 return false;
26 }
27 for (const auto track : *tracks) {
28 const Amg::Vector3D trkP4 = ActsTrk::convertMomFromActs(track.fourMomentum()).first;
29 const double chi2 = track.chi2();
30 const int q = track.charge();
31 const unsigned nDoF = track.nDoF();
32
33 m_trackPt += trkP4.perp();
34 m_trackEta += trkP4.eta();
35 m_trackPhi += trkP4.phi();
36 m_trackQ += q;
37 m_trackNdoF += nDoF;
39 m_parentSeed += track.component<std::size_t, Acts::hashString("parentSeed")>();
40 }
41 return true;
42 }
43}
Handle class for reading from StoreGate.
bool msgLvl(const MSG::Level lvl) const
Test the output level.
TesterModuleBase(MuonTesterTree &tree, const std::string &grp_name, MSG::Level msglvl=MSG::Level::INFO)
MuonVal::VectorBranch< int > & m_trackQ
SG::ReadHandleKey< ActsTrk::TrackContainer > m_key
MuonVal::VectorBranch< float > & m_trackEta
MuonVal::VectorBranch< float > & m_trackPt
MuonVal::VectorBranch< float > & m_trackPhi
TrackContainerModule(MuonTesterTree &tree, const std::string &inContainer, MSG::Level msgLvl=MSG::Level::INFO, const std::string &collName="ActsMsTracks")
MuonVal::VectorBranch< unsigned > & m_trackNdoF
MuonVal::VectorBranch< unsigned > & m_parentSeed
MuonVal::VectorBranch< float > & m_trackChi2
bool fill(const EventContext &ctx) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
bool declare_dependency(Key &key)
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
TTree * tree() override final
Returns the underlying TTree object.
double chi2(TH1 *h0, TH1 *h1)
std::pair< Amg::Vector3D, double > convertMomFromActs(const Acts::Vector4 &actsMom)
Converts an Acts four-momentum vector into an pair of an Athena three-momentum and the paritcle's ene...
Eigen::Matrix< double, 3, 1 > Vector3D
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.