|
ATLAS Offline Software
|
Go to the documentation of this file.
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 =
"");
94 const std::string& accName =
"");
101 template <
typename T>
103 const std::string& accName =
"");
110 template <
typename T>
113 const std::string& accName =
"");
119 template <
typename T>
120 std::shared_ptr<ParticleVariableBranch<T>>
getBranch(
const std::string&
var)
const;
135 std::vector<std::shared_ptr<IParticleDecorationBranch>>
m_variables{};
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.
bool addVariable(T defaultValue, const std::string &variable, const std::string &accName="")
Write a variable of type <T> to the TTree.
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.
const std::vector< const xAOD::IParticle * > & getCached() const
Returns the list of currently cached particles.
Class providing the definition of the 4-vector interface.
VectorBranch< float > m_e
bool init() override
Initialize the branches and all children.
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.
VectorBranch< float > m_phi
Class to provide easy MsgStream access and capabilities.
size_t size() const
How many particles have been pushed back already.
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.
VectorBranch< float > m_eta
void operator+=(const xAOD::IParticle *p) override
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.
VectorBranch< float > m_pt
std::string name() const override
Name of the four momentum branch.
std::shared_ptr< ParticleVariableBranch< T > > getBranch(const std::string &var) const
Returns the point to the underlying ParticleVariableBranch translating the IParticle Accessors into T...
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
MuonTesterTree & m_parent
Helper class to easily to add xAOD::IParticles and associated decorator variables to the MuonTesterTr...
TTree * tree()
TTree object.
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 ...