4#ifndef MUONTESTERTREE_IPARTICLEFOURMOMBRANCH_H
5#define MUONTESTERTREE_IPARTICLEFOURMOMBRANCH_H
39 bool fill(
const EventContext& ctx)
override;
43 std::string
name()
const override;
45 const TTree*
tree()
const override;
46 TTree*
tree()
override;
74 const std::vector<const xAOD::IParticle*>&
getCached()
const;
84 const std::string& accName =
"");
93 const std::string& variable,
94 const std::string& accName =
"");
101 template <
typename T>
103 const std::string& accName =
"");
110 template <
typename T>
112 const std::string& variable,
113 const std::string& accName =
"");
119 template <
typename T>
120 std::shared_ptr<ParticleVariableBranch<T>>
getBranch(
const std::string& var)
const;
122 bool addVariable(std::shared_ptr<IParticleDecorationBranch> branch);
136 std::vector<std::shared_ptr<IParticleDecorationBranch>>
m_variables{};
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
const std::vector< const xAOD::IParticle * > & getCached() const
Returns the list of currently cached particles.
void operator+=(const xAOD::IParticle *p) override
bool addVariable(T defaultValue, const std::string &variable, const std::string &accName="")
Write a variable of type <T> to the TTree.
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....
VectorBranch< float > m_eta
std::vector< DataDependency > data_dependencies() override
Returns a list of all Read(Coond)HandleKeys needed by the branch.
VectorBranch< float > m_pt
size_t size() const
How many particles have been pushed back already.
std::shared_ptr< ParticleVariableBranch< T > > getBranch(const std::string &var) const
Returns the point to the underlying ParticleVariableBranch translating the IParticle Accessors into T...
VectorBranch< float > m_phi
IParticleFourMomBranch(MuonTesterTree &tree, const std::string &particle)
Construct an IParticleFourMomBranch.
bool fill(const EventContext &ctx) override
Fill the branch.
MuonTesterTree & m_parent
MuonTesterTree & getTree()
Access to the MuonTrestTree parent.
bool addVariableGeV(T defaultValue, const std::string &variable, const std::string &accName="")
Write a variable of type <T> to the TTree, but divide it by 1k before dumping.
bool addVariableGeV(const std::string &variable, const std::string &accName="")
Write a variable of type <T> to the TTree, but divide it by 1k before dumping.
std::vector< const xAOD::IParticle * > m_cached_particles
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 ...
bool initialized() const
Has the init method been called.
void push_back(const xAOD::IParticle *p) override
Similar to the IAuxElementDecoration branch but only accepting IParticles.
std::vector< std::shared_ptr< IParticleDecorationBranch > > m_variables
std::string name() const override
Name of the four momentum branch.
VectorBranch< float > m_e
const TTree * tree() const override
Return the underyling TTree pointer.
bool init() override
Initialize the branches and all children.
Class providing the definition of the 4-vector interface.
Class to store array like branches into the n-tuples.