ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GenericDecorBranch.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONTESTER_GENERICDECORBRANCH_H
5 #define MUONTESTER_GENERICDECORBRANCH_H
7 #include <functional>
8 
9 namespace MuonVal{
10  template<class AuxType, class dType>
11  class GenericAuxEleBranch : public VectorBranch<dType>, virtual public IAuxElementDecorationBranch {
12  public:
15  using Filler_t = std::function<dType(const AuxType& )>;
16 
21  GenericAuxEleBranch(TTree* t, const std::string& branchName, Filler_t fillFunc);
26  GenericAuxEleBranch(MuonTesterTree& t, const std::string& var_name, Filler_t fillFunc);
27 
28 
29  void push_back(const SG::AuxElement* p) override;
30  void push_back(const SG::AuxElement& p) override;
31  void operator+=(const SG::AuxElement* p) override;
32  void operator+=(const SG::AuxElement& p) override;
33 
35 
36  virtual ~GenericAuxEleBranch() = default;
37  private:
39  };
40 
41  template <class PartType, class dType>
42  class GenericPartDecorBranch: public GenericAuxEleBranch<PartType, dType>,
43  virtual public IParticleDecorationBranch {
44  public:
46 
49 
50  void push_back(const xAOD::IParticle* p) override;
51  void push_back(const xAOD::IParticle& p) override;
52  void operator+=(const xAOD::IParticle* p) override;
53  void operator+=(const xAOD::IParticle& p) override;
54  };
55 }
56 
58 #endif
MuonVal::GenericAuxEleBranch::~GenericAuxEleBranch
virtual ~GenericAuxEleBranch()=default
MuonVal::GenericPartDecorBranch::operator+=
void operator+=(const xAOD::IParticle *p) override
CheckAppliedSFs.var_name
var_name
Definition: CheckAppliedSFs.py:241
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:483
MuonVal::IParticleDecorationBranch
Definition: IMuonTesterBranch.h:65
MuonVal::GenericPartDecorBranch::push_back
void push_back(const xAOD::IParticle *p) override
Similar to the IAuxElementDecoration branch but only accepting IParticles.
MuonVal::GenericPartDecorBranch::push_back
void push_back(const xAOD::IParticle &p) override
MuonVal::IAuxElementDecorationBranch
Definition: IMuonTesterBranch.h:52
MuonVal::GenericPartDecorBranch
Definition: GenericDecorBranch.h:43
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::GenericAuxEleBranch
Definition: GenericDecorBranch.h:11
VectorBranch.h
MuonVal::GenericAuxEleBranch< PartType, dType >::Filler_t
std::function< dType(const PartType &)> Filler_t
Defined the function signature to extract the information from the AuxElement.
Definition: GenericDecorBranch.h:15
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
MuonVal::GenericPartDecorBranch::operator+=
void operator+=(const xAOD::IParticle &p) override
MuonVal::GenericAuxEleBranch::push_back
void push_back(const SG::AuxElement &p) override
MuonVal::GenericAuxEleBranch::m_fillFunc
Filler_t m_fillFunc
Definition: GenericDecorBranch.h:38
MuonVal::GenericAuxEleBranch::GenericAuxEleBranch
GenericAuxEleBranch(MuonTesterTree &t, const std::string &var_name, Filler_t fillFunc)
Constructor taking the raw pointer to the underlying TTree object.
MuonVal::GenericAuxEleBranch::operator+=
void operator+=(const SG::AuxElement *p) override
MuonVal
Class to store array like branches into the n-tuples.
Definition: HitValAlg.cxx:19
GenericDecorBranch.icc
MuonVal::GenericAuxEleBranch::GenericAuxEleBranch
GenericAuxEleBranch(TTree *t, const std::string &branchName, Filler_t fillFunc)
Constructor taking the raw pointer to the underlying TTree object.
MuonVal::GenericAuxEleBranch::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::GenericAuxEleBranch::operator+=
void operator+=(const SG::AuxElement &p) override