ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonTesterTree
Root
ThreeVectorBranch.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include <
MuonTesterTree/ThreeVectorBranch.h
>
5
6
#include "GaudiKernel/SystemOfUnits.h"
7
8
constexpr
float
inDeg
(
const
float
rad) {
9
return
rad / Gaudi::Units::deg;
10
}
11
namespace
MuonVal
{
12
13
bool
ThreeVectorBranch::fill
(
const
EventContext&) {
return
true
; }
14
bool
ThreeVectorBranch::init
() {
return
true
; }
15
16
ThreeVectorBranch::ThreeVectorBranch
(
MuonTesterTree
&
tree
,
const
std::string& vec_name) :
MuonTesterBranch
(
tree
, vec_name) {}
17
size_t
ThreeVectorBranch::size
()
const
{
return
m_x
.size(); }
18
19
void
ThreeVectorBranch::push_back
(
const
float
x
,
const
float
y
,
const
float
z
) {
20
m_x
+=
x
;
21
m_y
+=
y
;
22
m_z
+=
z
;
23
}
24
void
ThreeVectorBranch::set
(
const
float
x
,
const
float
y
,
const
float
z
,
size_t
pos) {
25
m_x
[pos] =
x
;
26
m_y
[pos] =
y
;
27
m_z
[pos] =
z
;
28
}
29
void
ThreeVectorBranch::push_back
(
const
Amg::Vector3D
&
vec
) {
push_back
(
vec
[0],
vec
[1],
vec
[2]); }
30
void
ThreeVectorBranch::set
(
const
Amg::Vector3D
&
vec
,
size_t
pos) {
set
(
vec
[0],
vec
[1],
vec
[2], pos); }
31
void
ThreeVectorBranch::operator+=
(
const
Amg::Vector3D
&
vec
) {
push_back
(
vec
); }
32
void
ThreeVectorBranch::push_back
(
const
TVector3&
vec
) {
push_back
(
vec
.X(),
vec
.Y(),
vec
.Z()); }
33
void
ThreeVectorBranch::operator+=
(
const
TVector3&
vec
) {
push_back
(
vec
); }
34
void
ThreeVectorBranch::set
(
const
TVector3&
vec
,
size_t
pos) {
set
(
vec
.X(),
vec
.Y(),
vec
.Z(), pos); }
35
36
UnitThreeVectorBranch::UnitThreeVectorBranch
(
MuonTesterTree
&
tree
,
const
std::string& vec_name):
37
MuonTesterBranch
{
tree
, vec_name} {}
38
size_t
UnitThreeVectorBranch::size
()
const
{
return
m_theta
.size(); }
39
void
UnitThreeVectorBranch::push_back
(
const
Amg::Vector3D
&
vec
) {
set
(
vec
,
size
()); }
40
void
UnitThreeVectorBranch::operator+=
(
const
Amg::Vector3D
&
vec
) {
push_back
(
vec
); }
41
42
void
UnitThreeVectorBranch::set
(
const
Amg::Vector3D
&
vec
,
size_t
pos) {
43
m_theta
[pos] =
inDeg
(
vec
.theta());
44
m_phi
[pos] =
inDeg
(
vec
.phi());
45
}
46
47
void
UnitThreeVectorBranch::push_back
(
const
float
x
,
const
float
y
,
const
float
z
) {
48
push_back
(
Amg::Vector3D
{
x
,
y
,
z
});
49
}
50
void
UnitThreeVectorBranch::set
(
const
float
x
,
const
float
y
,
const
float
z
,
size_t
pos) {
51
set
(
Amg::Vector3D
{
x
,
y
,
z
}, pos);
52
}
53
54
bool
UnitThreeVectorBranch::fill
(
const
EventContext&) {
return
true
; }
55
bool
UnitThreeVectorBranch::init
() {
return
true
; }
56
57
}
vec
std::vector< size_t > vec
Definition
CombinationsGeneratorTest.cxx:9
inDeg
constexpr float inDeg(const float rad)
Definition
ThreeVectorBranch.cxx:8
ThreeVectorBranch.h
y
#define y
x
#define x
z
#define z
MuonVal::MuonTesterBranch::MuonTesterBranch
MuonTesterBranch(MuonTesterTree &tree, const std::string &br_name)
Definition
MuonTesterBranch.cxx:33
MuonVal::MuonTesterBranch::tree
TTree * tree() override final
Returns the underlying TTree object.
Definition
MuonTesterBranch.cxx:53
MuonVal::MuonTesterTree
Definition
MuonTesterTree.h:38
MuonVal::ThreeVectorBranch::operator+=
void operator+=(const Amg::Vector3D &vec)
Definition
ThreeVectorBranch.cxx:31
MuonVal::ThreeVectorBranch::m_x
VectorBranch< float > & m_x
Definition
ThreeVectorBranch.h:36
MuonVal::ThreeVectorBranch::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
ThreeVectorBranch.cxx:13
MuonVal::ThreeVectorBranch::init
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
Definition
ThreeVectorBranch.cxx:14
MuonVal::ThreeVectorBranch::set
void set(const Amg::Vector3D &vec, size_t pos)
Definition
ThreeVectorBranch.cxx:30
MuonVal::ThreeVectorBranch::m_y
VectorBranch< float > & m_y
Definition
ThreeVectorBranch.h:37
MuonVal::ThreeVectorBranch::size
size_t size() const
Definition
ThreeVectorBranch.cxx:17
MuonVal::ThreeVectorBranch::push_back
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
Definition
ThreeVectorBranch.cxx:29
MuonVal::ThreeVectorBranch::ThreeVectorBranch
ThreeVectorBranch(MuonTesterTree &tree, const std::string &vec_name)
Definition
ThreeVectorBranch.cxx:16
MuonVal::ThreeVectorBranch::m_z
VectorBranch< float > & m_z
Definition
ThreeVectorBranch.h:38
MuonVal::UnitThreeVectorBranch::set
void set(const Amg::Vector3D &vec, size_t pos)
Definition
ThreeVectorBranch.cxx:42
MuonVal::UnitThreeVectorBranch::size
size_t size() const
Definition
ThreeVectorBranch.cxx:38
MuonVal::UnitThreeVectorBranch::UnitThreeVectorBranch
UnitThreeVectorBranch(MuonTesterTree &tree, const std::string &vec_name)
Definition
ThreeVectorBranch.cxx:36
MuonVal::UnitThreeVectorBranch::m_theta
VectorBranch< float > & m_theta
Definition
ThreeVectorBranch.h:57
MuonVal::UnitThreeVectorBranch::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
ThreeVectorBranch.cxx:54
MuonVal::UnitThreeVectorBranch::init
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
Definition
ThreeVectorBranch.cxx:55
MuonVal::UnitThreeVectorBranch::set
void set(const float x, const float y, const float z, size_t pos)
Definition
ThreeVectorBranch.cxx:50
MuonVal::UnitThreeVectorBranch::m_phi
VectorBranch< float > & m_phi
Definition
ThreeVectorBranch.h:58
MuonVal::UnitThreeVectorBranch::operator+=
void operator+=(const Amg::Vector3D &vec)
Definition
ThreeVectorBranch.cxx:40
MuonVal::UnitThreeVectorBranch::push_back
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
Definition
ThreeVectorBranch.cxx:39
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
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