ATLAS Offline Software
Loading...
Searching...
No Matches
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
9namespace 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
34 using VectorBranch<dType>::push_back;
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:
45 using GenericAuxEleBranch<PartType, dType>::GenericAuxEleBranch;
46
47 using GenericAuxEleBranch<PartType, dType>::push_back;
48 using GenericAuxEleBranch<PartType, dType>::operator+=;
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
void operator+=(const SG::AuxElement &p) override
GenericAuxEleBranch(MuonTesterTree &t, const std::string &var_name, Filler_t fillFunc)
Constructor taking the raw pointer to the underlying TTree object.
void push_back(const SG::AuxElement &p) override
void push_back(const SG::AuxElement *p) override
Reads out a generic auxillary element and add its information to the output vector.
void operator+=(const SG::AuxElement *p) override
std::function< dType(const AuxType &)> Filler_t
Defined the function signature to extract the information from the AuxElement.
GenericAuxEleBranch(TTree *t, const std::string &branchName, Filler_t fillFunc)
Constructor taking the raw pointer to the underlying TTree object.
virtual ~GenericAuxEleBranch()=default
void push_back(const xAOD::IParticle &p) override
void push_back(const xAOD::IParticle *p) override
Similar to the IAuxElementDecoration branch but only accepting IParticles.
void operator+=(const xAOD::IParticle *p) override
void operator+=(const xAOD::IParticle &p) override
VectorBranch(TTree *tree, const std::string &name)
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
Class providing the definition of the 4-vector interface.
Class to store array like branches into the n-tuples.
Definition HitValAlg.cxx:19