|
ATLAS Offline Software
|
Go to the documentation of this file.
8 constexpr
size_t dummyIdx = -1;
45 if (acc_charge.isAvailable(*
p)) {
80 if (!
var->fill(ctx)) {
99 std::vector<IMuonTesterBranch*> branchesToInit{};
101 branchesToInit.push_back(
v.get());
103 std::sort(branchesToInit.begin(), branchesToInit.end(),
105 return a->name() < b->name();
107 for (
auto&
br : branchesToInit) {
118 ATH_MSG_ERROR(
"The branch is already initialized. Cannot add more branches");
126 [&
branch](
const std::shared_ptr<IParticleDecorationBranch>&
known) {
127 return known == branch || known->name() == branch->name();
130 if (
typeid((*itr).get()) !=
typeid(
branch.get())) {
140 std::vector<DataDependency> to_ret{};
141 for (
const std::shared_ptr<IParticleDecorationBranch>&
br :
m_variables) {
142 std::vector<DataDependency> childDep{
br->data_dependencies()};
143 to_ret.insert(to_ret.end(),childDep.begin(), childDep.end());
const TTree * tree() const override
Return the underyling TTree pointer.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
bool fill(const EventContext &ctx) override
Fill the branch.
const std::vector< const xAOD::IParticle * > & getCached() const
Returns the list of currently cached particles.
bool registerBranch(std::shared_ptr< IMuonTesterBranch > branch)
This method adds the branch to the tree and hands over the ownership to the MuonAnalysisTree instance...
Helper class to provide constant type-safe access to aux data.
Class providing the definition of the 4-vector interface.
TTree * tree() override final
Returns the underlying TTree object.
VectorBranch< float > m_e
bool init() override
Initialize the branches and all children.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
MuonTesterTree & getTree()
Access to the MuonTrestTree parent.
std::vector< const xAOD::IParticle * > m_cached_particles
IParticleFourMomBranch(MuonTesterTree &tree, const std::string &particle)
Construct an IParticleFourMomBranch.
bool addVariable(const std::string &variable, const std::string &accName="")
Writes a variable of type <T> which can be directly accessed via an SG::AuxElement e....
bool initialized() const
Has the init method been called.
bool fill(const EventContext &ctx) override
Clears vector in cases that it has not been updated in this event Retursn falls if the vector has not...
VectorBranch< float > m_phi
Class to provide easy MsgStream access and capabilities.
size_t size() const
How many particles have been pushed back already.
void push_back(const T &value)
Adds a new element at the end of the vector.
Class to store array like branches into the n-tuples.
void push_back(const xAOD::IParticle *p) override
Similar to the IAuxElementDecoration branch but only accepting IParticles.
double charge(const T &p)
def cached(func)
Decorator to cache function return value.
VectorBranch< float > m_eta
void operator+=(const xAOD::IParticle *p) override
VectorBranch< float > m_pt
std::string name() const override
Name of the four momentum branch.
bool init() override
Initialized the Branch.
std::vector< DataDependency > data_dependencies() override
Returns a list of all Read(Coond)HandleKeys needed by the branch.
std::vector< std::shared_ptr< IParticleDecorationBranch > > m_variables
size_t size() const
Returns the number of actual saved elements.
Class describing a TrackParticle.
MuonTesterTree & m_parent
Most basic interface class used by the MuonTester tree.
size_t find(const xAOD::IParticle &p) const
Returns the position at which the particle has already be inserted in the chain – If the particle is ...