ATLAS Offline Software
AuxElementBranch.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONTESTER_AUXELEMENTBRANCH_H
5 #define MUONTESTER_AUXELEMENTBRANCH_H
6 
8 namespace MuonVal {
9 template <class T> class AuxElementBranch : public VectorBranch<T>, virtual public IAuxElementDecorationBranch {
10 public:
11  void setAccessor(const std::string& name);
12  void push_back(const SG::AuxElement* p) override;
13  void push_back(const SG::AuxElement& p) override;
14  void operator+=(const SG::AuxElement* p) override;
15  void operator+=(const SG::AuxElement& p) override;
16 
21 
22  AuxElementBranch(TTree* t, const std::string& var_name, const std::string& acc = "");
23  AuxElementBranch(MuonTesterTree& t, const std::string& var_name, const std::string& acc = "");
24 
25  virtual ~AuxElementBranch() = default;
26 
27 private:
29 };
30 template <class T> class ParticleVariableBranch : public AuxElementBranch<T>, virtual public IParticleDecorationBranch {
31 public:
32  ParticleVariableBranch(TTree* t, const std::string& var_name, const std::string& acc = "");
33  ParticleVariableBranch(MuonTesterTree& t, const std::string& var_name, const std::string& acc = "");
34  virtual ~ParticleVariableBranch() = default;
35 
36  void push_back(const xAOD::IParticle* p) override;
37  void push_back(const xAOD::IParticle& p) override;
40  void operator+=(const xAOD::IParticle* p) override;
41  void operator+=(const xAOD::IParticle& p) override;
42 };
43 
44 template <class T> class ParticleVariableBranchGeV : public ParticleVariableBranch<T> {
45 public:
46  ParticleVariableBranchGeV(TTree* t, const std::string& var_name, const std::string& acc = "");
47  ParticleVariableBranchGeV(MuonTesterTree& t, const std::string& var_name, const std::string& acc = "");
48 
52  void push_back(const xAOD::IParticle* p) override;
53  void push_back(const xAOD::IParticle& p) override;
54 };
55 }
57 #endif
MuonVal::AuxElementBranch::setAccessor
void setAccessor(const std::string &name)
MuonVal::ParticleVariableBranch::ParticleVariableBranch
ParticleVariableBranch(TTree *t, const std::string &var_name, const std::string &acc="")
MuonVal::AuxElementBranch::push_back
void push_back(const SG::AuxElement &p) override
MuonVal::AuxElementBranch::m_acc
SG::AuxElement::ConstAccessor< T > m_acc
Definition: AuxElementBranch.h:28
CheckAppliedSFs.var_name
var_name
Definition: CheckAppliedSFs.py:241
AuxElementBranch.icc
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:472
MuonVal::ParticleVariableBranch::push_back
void push_back(const xAOD::IParticle &p) override
MuonVal::IParticleDecorationBranch
Definition: IMuonTesterBranch.h:65
MuonVal::IAuxElementDecorationBranch
Definition: IMuonTesterBranch.h:52
MuonVal::AuxElementBranch::AuxElementBranch
AuxElementBranch(TTree *t, const std::string &var_name, const std::string &acc="")
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
MuonVal::VectorBranch
Definition: VectorBranch.h:14
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
MuonVal::ParticleVariableBranch::operator+=
void operator+=(const xAOD::IParticle &p) override
VectorBranch.h
MuonVal::AuxElementBranch
Definition: AuxElementBranch.h:9
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonVal::ParticleVariableBranchGeV
Definition: AuxElementBranch.h:44
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
MuonVal::AuxElementBranch::AuxElementBranch
AuxElementBranch(MuonTesterTree &t, const std::string &var_name, const std::string &acc="")
MuonVal::ParticleVariableBranchGeV::ParticleVariableBranchGeV
ParticleVariableBranchGeV(MuonTesterTree &t, const std::string &var_name, const std::string &acc="")
MuonVal::ParticleVariableBranch::ParticleVariableBranch
ParticleVariableBranch(MuonTesterTree &t, const std::string &var_name, const std::string &acc="")
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
MuonVal::AuxElementBranch::~AuxElementBranch
virtual ~AuxElementBranch()=default
MuonVal::ParticleVariableBranch::operator+=
void operator+=(const xAOD::IParticle *p) override
MuonVal::ParticleVariableBranch::push_back
void push_back(const xAOD::IParticle *p) override
Similar to the IAuxElementDecoration branch but only accepting IParticles.
MuonVal
Class to store array like branches into the n-tuples.
Definition: MuonTPMetaDataAlg.cxx:25
MuonVal::AuxElementBranch::operator+=
void operator+=(const SG::AuxElement &p) override
MuonVal::ParticleVariableBranch
Definition: AuxElementBranch.h:30
MuonVal::AuxElementBranch::push_back
void push_back(const SG::AuxElement *p) override
Reads out a generic auxillary element and add its information to the output vector.
MuonVal::ParticleVariableBranch::~ParticleVariableBranch
virtual ~ParticleVariableBranch()=default
MuonVal::IMuonTesterBranch::name
virtual std::string name() const =0
Returns the name of the branch.
MuonVal::ParticleVariableBranchGeV::push_back
void push_back(const xAOD::IParticle *p) override
Similar to the IAuxElementDecoration branch but only accepting IParticles.
MuonVal::ParticleVariableBranchGeV::push_back
void push_back(const xAOD::IParticle &p) override
MuonVal::ParticleVariableBranchGeV::ParticleVariableBranchGeV
ParticleVariableBranchGeV(TTree *t, const std::string &var_name, const std::string &acc="")
MuonVal::AuxElementBranch::operator+=
void operator+=(const SG::AuxElement *p) override