ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonTesterTree
MuonTesterTree
FourVectorBranch.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_MUONFOURVECTORBRANCH_H
5
#define MUONTESTER_MUONFOURVECTORBRANCH_H
6
#ifndef XAOD_ANALYSIS
7
#include <
AtlasHepMC/SimpleVector.h
>
8
#endif
9
#include <
MuonTesterTree/ThreeVectorBranch.h
>
10
#include <TLorentzVector.h>
11
12
namespace
MuonVal
{
15
class
PtEtaPhiEBranch
:
public
MuonTesterBranch
{
16
public
:
17
PtEtaPhiEBranch
(
MuonTesterTree
&
tree
,
const
std::string& vec_name);
18
19
void
push_back
(
const
TLorentzVector&
vec
);
20
void
operator+=
(
const
TLorentzVector&
vec
);
21
void
set
(
const
TLorentzVector&
vec
,
size_t
pos);
22
#ifndef XAOD_ANALYSIS
23
void
push_back
(
const
HepMC::FourVector
&
vec
);
24
void
operator+=
(
const
HepMC::FourVector
&
vec
);
25
void
set
(
const
HepMC::FourVector
&
vec
,
size_t
pos);
26
#endif
27
28
void
push_back
(
const
float
pt,
const
float
eta
,
const
float
phi
,
const
float
e);
29
void
set
(
const
float
pt,
const
float
eta
,
const
float
phi
,
const
float
e,
size_t
pos);
30
31
size_t
size
()
const
;
32
33
bool
fill
(
const
EventContext&)
override
final
;
34
bool
init
()
override
final
;
35
36
private
:
37
VectorBranch<float>
&
m_pt
{
parent
().
newVector
<
float
>(
name
() +
"Pt"
)};
38
VectorBranch<float>
&
m_eta
{
parent
().
newVector
<
float
>(
name
() +
"Eta"
)};
39
VectorBranch<float>
&
m_phi
{
parent
().
newVector
<
float
>(
name
() +
"Phi"
)};
40
VectorBranch<float>
&
m_e
{
parent
().
newVector
<
float
>(
name
() +
"E"
)};
41
};
42
45
class
CartesFourVecBranch
:
public
MuonTesterBranch
{
46
public
:
47
enum class
Type
{
Mom
,
Pos
};
48
CartesFourVecBranch
(
MuonTesterTree
&
tree
,
const
std::string& vec_name,
Type
t);
49
50
void
push_back
(
const
TLorentzVector&
vec
);
51
void
operator+=
(
const
TLorentzVector&
vec
);
52
void
set
(
const
TLorentzVector&
vec
,
size_t
pos);
53
#ifndef XAOD_ANALYSIS
54
void
push_back
(
const
HepMC::FourVector
&
vec
);
55
void
operator+=
(
const
HepMC::FourVector
&
vec
);
56
void
set
(
const
HepMC::FourVector
&
vec
,
size_t
pos);
57
#endif
58
void
push_back
(
const
float
x
,
const
float
y
,
const
float
z
,
const
float
t);
59
void
set
(
const
float
x
,
const
float
y
,
const
float
z
,
const
float
t,
size_t
pos);
60
61
size_t
size
()
const
;
62
63
bool
fill
(
const
EventContext&)
override
final
;
64
bool
init
() override final;
65
66
private
:
67
bool
m_mom
{
false
};
68
VectorBranch<float>
&
m_x
{
parent
().
newVector
<
float
>(
name
() + (
m_mom
?
"Px"
:
"X"
))};
69
VectorBranch<float>
&
m_y
{
parent
().
newVector
<
float
>(
name
() + (
m_mom
?
"Py"
:
"Y"
))};
70
VectorBranch<float>
&
m_z
{
parent
().
newVector
<
float
>(
name
() + (
m_mom
?
"Pz"
:
"Z"
))};
71
VectorBranch<float>
&
m_t
{
parent
().
newVector
<
float
>(
name
() + (
m_mom
?
"E"
:
"T"
))};
72
};
73
}
74
#endif
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
phi
Scalar phi() const
phi method
Definition
AmgMatrixBasePlugin.h:67
vec
std::vector< size_t > vec
Definition
CombinationsGeneratorTest.cxx:9
SimpleVector.h
ThreeVectorBranch.h
y
#define y
x
#define x
z
#define z
MuonVal::CartesFourVecBranch::m_x
VectorBranch< float > & m_x
Definition
FourVectorBranch.h:68
MuonVal::CartesFourVecBranch::CartesFourVecBranch
CartesFourVecBranch(MuonTesterTree &tree, const std::string &vec_name, Type t)
Definition
FourVectorBranch.cxx:45
MuonVal::CartesFourVecBranch::Type
Type
Definition
FourVectorBranch.h:47
MuonVal::CartesFourVecBranch::Type::Mom
@ Mom
Definition
FourVectorBranch.h:47
MuonVal::CartesFourVecBranch::Type::Pos
@ Pos
Definition
FourVectorBranch.h:47
MuonVal::CartesFourVecBranch::m_t
VectorBranch< float > & m_t
Definition
FourVectorBranch.h:71
MuonVal::CartesFourVecBranch::set
void set(const TLorentzVector &vec, size_t pos)
Definition
FourVectorBranch.cxx:49
MuonVal::CartesFourVecBranch::m_z
VectorBranch< float > & m_z
Definition
FourVectorBranch.h:70
MuonVal::CartesFourVecBranch::init
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
Definition
FourVectorBranch.cxx:57
MuonVal::CartesFourVecBranch::push_back
void push_back(const TLorentzVector &vec)
Definition
FourVectorBranch.cxx:47
MuonVal::CartesFourVecBranch::operator+=
void operator+=(const TLorentzVector &vec)
Definition
FourVectorBranch.cxx:48
MuonVal::CartesFourVecBranch::size
size_t size() const
Definition
FourVectorBranch.cxx:55
MuonVal::CartesFourVecBranch::m_mom
bool m_mom
Definition
FourVectorBranch.h:67
MuonVal::CartesFourVecBranch::fill
bool fill(const EventContext &) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
Definition
FourVectorBranch.cxx:56
MuonVal::CartesFourVecBranch::m_y
VectorBranch< float > & m_y
Definition
FourVectorBranch.h:69
MuonVal::MuonTesterBranch::MuonTesterBranch
MuonTesterBranch(MuonTesterTree &tree, const std::string &br_name)
Definition
MuonTesterBranch.cxx:33
MuonVal::MuonTesterBranch::parent
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
Definition
MuonTesterBranch.cxx:38
MuonVal::MuonTesterBranch::name
std::string name() const override final
Returns the name of the branch.
Definition
MuonTesterBranch.cxx:51
MuonVal::MuonTesterBranch::tree
TTree * tree() override final
Returns the underlying TTree object.
Definition
MuonTesterBranch.cxx:53
MuonVal::MuonTesterTree
Definition
MuonTesterTree.h:38
MuonVal::MuonTesterTree::newVector
VectorBranch< T > & newVector(const std::string &name)
Creates new branches and returns their reference.
MuonVal::PtEtaPhiEBranch::fill
bool fill(const EventContext &) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
Definition
FourVectorBranch.cxx:42
MuonVal::PtEtaPhiEBranch::m_phi
VectorBranch< float > & m_phi
Definition
FourVectorBranch.h:39
MuonVal::PtEtaPhiEBranch::m_eta
VectorBranch< float > & m_eta
Definition
FourVectorBranch.h:38
MuonVal::PtEtaPhiEBranch::push_back
void push_back(const TLorentzVector &vec)
Definition
FourVectorBranch.cxx:20
MuonVal::PtEtaPhiEBranch::PtEtaPhiEBranch
PtEtaPhiEBranch(MuonTesterTree &tree, const std::string &vec_name)
Definition
FourVectorBranch.cxx:7
MuonVal::PtEtaPhiEBranch::set
void set(const TLorentzVector &vec, size_t pos)
Definition
FourVectorBranch.cxx:22
MuonVal::PtEtaPhiEBranch::m_e
VectorBranch< float > & m_e
Definition
FourVectorBranch.h:40
MuonVal::PtEtaPhiEBranch::operator+=
void operator+=(const TLorentzVector &vec)
Definition
FourVectorBranch.cxx:21
MuonVal::PtEtaPhiEBranch::m_pt
VectorBranch< float > & m_pt
Definition
FourVectorBranch.h:37
MuonVal::PtEtaPhiEBranch::init
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
Definition
FourVectorBranch.cxx:43
MuonVal::PtEtaPhiEBranch::size
size_t size() const
Definition
FourVectorBranch.cxx:41
MuonVal::VectorBranch
Definition
VectorBranch.h:14
HepMC::FourVector
HepMC3::FourVector FourVector
Definition
SimpleVector.h:11
MuonVal
Class to store array like branches into the n-tuples.
Definition
HitValAlg.cxx:19
Type
private
#define private
Definition
testRead.cxx:27
tree
TChain * tree
Definition
tile_monitor.h:30
Generated on
for ATLAS Offline Software by
1.17.0