4#ifndef MUONTESTERTREE_IPARTICLEFOURMOMBRANCH_H
5#define MUONTESTERTREE_IPARTICLEFOURMOMBRANCH_H
40 bool fill(
const EventContext& ctx)
override;
44 std::string
name()
const override;
46 const TTree*
tree()
const override;
47 TTree*
tree()
override;
75 const std::vector<const xAOD::IParticle*>&
getCached()
const;
85 std::string_view accName =
"");
94 const std::string& variable,
95 std::string_view accName =
"");
102 template <
typename T>
104 const std::string& accName =
"");
111 template <
typename T>
113 const std::string& variable,
114 const std::string& accName =
"");
120 template <
typename T>
121 std::shared_ptr<ParticleVariableBranch<T>>
getBranch(
const std::string& var)
const;
123 bool addVariable(std::shared_ptr<IParticleDecorationBranch> branch);
137 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
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
bool addVariable(const std::string &variable, std::string_view accName="")
Writes a variable of type <T> which can be directly accessed via an SG::AuxElement e....
bool addVariable(T defaultValue, const std::string &variable, std::string_view accName="")
Write a variable of type <T> to the TTree.
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.