Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
LinkerBranch.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_LINKERBRANCH_H
5 #define MUONTESTER_LINKERBRANCH_H
6 
9 
10 namespace MuonVal{
17  class LinkerBranch : public VectorBranch<unsigned short>,
18  virtual public IParticleDecorationBranch {
19  public:
21  using ParticleBranch_ptr = std::shared_ptr<IParticleFourMomBranch>;
22 
25  using Linker_t = std::function<const xAOD::IParticle*(const xAOD::IParticle*)>;
26 
35  ParticleBranch_ptr linkColl,
36  Linker_t linker,
37  const std::string& altName = "");
41  void push_back(const xAOD::IParticle* p) override;
42  void push_back(const xAOD::IParticle& p) override;
43  void operator+=(const xAOD::IParticle* p) override;
44  void operator+=(const xAOD::IParticle& p) override;
45 
46  private:
47  std::weak_ptr<IParticleFourMomBranch> m_linkColl;
49  };
50 
51  class BilateralLinkerBranch: public VectorBranch<unsigned short>,
52  virtual public IParticleDecorationBranch {
53  public:
59  void push_back(const xAOD::IParticle* p) override;
60  void push_back(const xAOD::IParticle& p) override;
61  void operator+=(const xAOD::IParticle* p) override;
62  void operator+=(const xAOD::IParticle& p) override;
63 
64  bool fill(const EventContext& ctx) override;
65 
66  static bool connectCollections(ParticleBranch_ptr primColl,
67  ParticleBranch_ptr secondColl,
68  Linker_t fromPrimToSec,
69  const std::string& altPrimName ="",
70  const std::string& altSecName = "");
71  private:
73  ParticleBranch_ptr primColl,
74  Linker_t linker,
75  const std::string& altName);
77  std::weak_ptr<IParticleFourMomBranch> m_linkColl;
79 
80 
81  };
82 }
83 #endif
MuonVal::BilateralLinkerBranch::m_parent
const IParticleFourMomBranch & m_parent
Definition: LinkerBranch.h:76
MuonVal::BilateralLinkerBranch::Linker_t
LinkerBranch::Linker_t Linker_t
Definition: LinkerBranch.h:54
IParticleFourMomBranch.h
MuonVal::BilateralLinkerBranch::push_back
void push_back(const xAOD::IParticle *p) override
Interface methods to handle the particle.
Definition: LinkerBranch.cxx:58
MuonVal::IParticleDecorationBranch
Definition: IMuonTesterBranch.h:65
MuonVal::VectorBranch
Definition: VectorBranch.h:14
MuonVal::LinkerBranch::Linker_t
std::function< const xAOD::IParticle *(const xAOD::IParticle *)> Linker_t
Typedef of the linker function.
Definition: LinkerBranch.h:25
MuonVal::LinkerBranch::LinkerBranch
LinkerBranch(IParticleFourMomBranch &parent, ParticleBranch_ptr linkColl, Linker_t linker, const std::string &altName="")
Standard constructor fo the LinkerBranch.
Definition: LinkerBranch.cxx:7
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
MuonVal::BilateralLinkerBranch::ParticleBranch_ptr
LinkerBranch::ParticleBranch_ptr ParticleBranch_ptr
Definition: LinkerBranch.h:55
VectorBranch.h
MuonVal::LinkerBranch::m_linkColl
std::weak_ptr< IParticleFourMomBranch > m_linkColl
Definition: LinkerBranch.h:47
MuonVal::BilateralLinkerBranch::fill
bool fill(const EventContext &ctx) override
The fill method checks if enough information is provided such that the branch is cleared from the inf...
Definition: LinkerBranch.cxx:69
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonVal::BilateralLinkerBranch::m_linkerFunc
Linker_t m_linkerFunc
Definition: LinkerBranch.h:78
MuonVal::BilateralLinkerBranch::connectCollections
static bool connectCollections(ParticleBranch_ptr primColl, ParticleBranch_ptr secondColl, Linker_t fromPrimToSec, const std::string &altPrimName="", const std::string &altSecName="")
Definition: LinkerBranch.cxx:37
MuonVal::LinkerBranch::operator+=
void operator+=(const xAOD::IParticle *p) override
Definition: LinkerBranch.cxx:16
MuonVal::BilateralLinkerBranch::operator+=
void operator+=(const xAOD::IParticle *p) override
Definition: LinkerBranch.cxx:63
MuonVal
Class to store array like branches into the n-tuples.
Definition: HitValAlg.cxx:19
MuonVal::LinkerBranch::m_linkerFunc
Linker_t m_linkerFunc
Definition: LinkerBranch.h:48
MuonVal::BilateralLinkerBranch::m_linkColl
std::weak_ptr< IParticleFourMomBranch > m_linkColl
Definition: LinkerBranch.h:77
MuonVal::MuonTesterBranch::parent
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
Definition: MuonTesterBranch.cxx:38
MuonVal::BilateralLinkerBranch::BilateralLinkerBranch
BilateralLinkerBranch(IParticleFourMomBranch &bilatColl, ParticleBranch_ptr primColl, Linker_t linker, const std::string &altName)
Definition: LinkerBranch.cxx:46
MuonVal::LinkerBranch
The linker branch is a helper class to establish linking indices between dumped particle collections.
Definition: LinkerBranch.h:18
MuonVal::IParticleFourMomBranch
Helper class to easily to add xAOD::IParticles and associated decorator variables to the MuonTesterTr...
Definition: IParticleFourMomBranch.h:31
MuonVal::LinkerBranch::ParticleBranch_ptr
std::shared_ptr< IParticleFourMomBranch > ParticleBranch_ptr
Abreviation of the pointer to the particle branch.
Definition: LinkerBranch.h:21
MuonVal::BilateralLinkerBranch
Definition: LinkerBranch.h:52
MuonVal::LinkerBranch::push_back
void push_back(const xAOD::IParticle *p) override
Interface methods to handle the particle.
Definition: LinkerBranch.cxx:25