ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonTesterTree
MuonTesterTree
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
7
#include <
MuonTesterTree/VectorBranch.h
>
8
#include <
MuonTesterTree/IParticleFourMomBranch.h
>
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
34
LinkerBranch
(
IParticleFourMomBranch
&
parent
,
35
ParticleBranch_ptr
linkColl,
36
Linker_t
linker,
37
const
std::string& altName =
""
);
39
using
VectorBranch
<
unsigned
short
>
::push_back
;
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
IParticleFourMomBranch
*
m_linkColl
{
nullptr
};
48
Linker_t
m_linkerFunc
;
49
};
50
51
class
BilateralLinkerBranch
:
public
VectorBranch
<unsigned short>,
52
virtual
public
IParticleDecorationBranch
{
53
public
:
54
using
Linker_t
=
LinkerBranch::Linker_t
;
55
using
ParticleBranch_ptr
=
LinkerBranch::ParticleBranch_ptr
;
57
using
VectorBranch
<
unsigned
short
>
::push_back
;
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
:
72
BilateralLinkerBranch
(
IParticleFourMomBranch
& bilatColl,
73
ParticleBranch_ptr
primColl,
74
Linker_t
linker,
75
const
std::string& altName);
76
const
IParticleFourMomBranch
&
m_parent
;
77
IParticleFourMomBranch
*
m_linkColl
{
nullptr
};
78
Linker_t
m_linkerFunc
;
79
80
81
};
82
}
83
#endif
IParticleFourMomBranch.h
VectorBranch.h
MuonVal::BilateralLinkerBranch::BilateralLinkerBranch
BilateralLinkerBranch(IParticleFourMomBranch &bilatColl, ParticleBranch_ptr primColl, Linker_t linker, const std::string &altName)
Definition
LinkerBranch.cxx:43
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:67
MuonVal::BilateralLinkerBranch::Linker_t
LinkerBranch::Linker_t Linker_t
Definition
LinkerBranch.h:54
MuonVal::BilateralLinkerBranch::ParticleBranch_ptr
LinkerBranch::ParticleBranch_ptr ParticleBranch_ptr
Definition
LinkerBranch.h:55
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:34
MuonVal::BilateralLinkerBranch::m_parent
const IParticleFourMomBranch & m_parent
Definition
LinkerBranch.h:76
MuonVal::BilateralLinkerBranch::m_linkerFunc
Linker_t m_linkerFunc
Definition
LinkerBranch.h:78
MuonVal::BilateralLinkerBranch::m_linkColl
IParticleFourMomBranch * m_linkColl
Definition
LinkerBranch.h:77
MuonVal::BilateralLinkerBranch::operator+=
void operator+=(const xAOD::IParticle *p) override
Definition
LinkerBranch.cxx:61
MuonVal::BilateralLinkerBranch::push_back
void push_back(const xAOD::IParticle *p) override
Interface methods to handle the particle.
Definition
LinkerBranch.cxx:56
MuonVal::IParticleDecorationBranch
Definition
IMuonTesterBranch.h:65
MuonVal::IParticleFourMomBranch
Helper class to easily to add xAOD::IParticles and associated decorator variables to the MuonTesterTr...
Definition
IParticleFourMomBranch.h:32
MuonVal::LinkerBranch::m_linkerFunc
Linker_t m_linkerFunc
Definition
LinkerBranch.h:48
MuonVal::LinkerBranch::m_linkColl
IParticleFourMomBranch * m_linkColl
Definition
LinkerBranch.h:47
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::operator+=
void operator+=(const xAOD::IParticle *p) override
Definition
LinkerBranch.cxx:18
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
MuonVal::LinkerBranch::ParticleBranch_ptr
std::shared_ptr< IParticleFourMomBranch > ParticleBranch_ptr
Abreviation of the pointer to the particle branch.
Definition
LinkerBranch.h:21
MuonVal::LinkerBranch::push_back
void push_back(const xAOD::IParticle *p) override
Interface methods to handle the particle.
Definition
LinkerBranch.cxx:27
MuonVal::VectorBranch< unsigned short >::parent
MuonTesterTree & parent()
Definition
MuonTesterBranch.cxx:38
MuonVal::VectorBranch< unsigned short >::VectorBranch
VectorBranch(TTree *tree, const std::string &name)
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
MuonVal
Class to store array like branches into the n-tuples.
Definition
HitValAlg.cxx:19
Generated on
for ATLAS Offline Software by
1.17.0