ATLAS Offline Software
Loading...
Searching...
No Matches
ThreeVectorBranch.cxx
Go to the documentation of this file.
1/*
2Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5
6#include "GaudiKernel/SystemOfUnits.h"
7
8constexpr float inDeg(const float rad) {
9 return rad / Gaudi::Units::deg;
10}
11namespace MuonVal {
12
13bool ThreeVectorBranch::fill(const EventContext&) { return true; }
14bool ThreeVectorBranch::init() { return true; }
15
17size_t ThreeVectorBranch::size() const { return m_x.size(); }
18
19void 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}
24void 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}
30void ThreeVectorBranch::set(const Amg::Vector3D& vec, size_t pos) { set(vec[0], vec[1], vec[2], pos); }
32void ThreeVectorBranch::push_back(const TVector3& vec) { push_back(vec.X(), vec.Y(), vec.Z()); }
34void ThreeVectorBranch::set(const TVector3& vec, size_t pos) { set(vec.X(), vec.Y(), vec.Z(), pos); }
35
38size_t UnitThreeVectorBranch::size() const { return m_theta.size(); }
41
43 m_theta[pos] = inDeg(vec.theta());
44 m_phi[pos] = inDeg(vec.phi());
45}
46
47void UnitThreeVectorBranch::push_back(const float x, const float y, const float z) {
49}
50void UnitThreeVectorBranch::set(const float x, const float y, const float z, size_t pos) {
51 set(Amg::Vector3D{x,y,z}, pos);
52}
53
54bool UnitThreeVectorBranch::fill(const EventContext&) { return true; }
55bool UnitThreeVectorBranch::init() { return true; }
56
57}
std::vector< size_t > vec
constexpr float inDeg(const float rad)
#define y
#define x
#define z
MuonTesterBranch(MuonTesterTree &tree, const std::string &br_name)
TTree * tree() override final
Returns the underlying TTree object.
void operator+=(const Amg::Vector3D &vec)
VectorBranch< float > & m_x
bool fill(const EventContext &) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
void set(const Amg::Vector3D &vec, size_t pos)
VectorBranch< float > & m_y
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
ThreeVectorBranch(MuonTesterTree &tree, const std::string &vec_name)
VectorBranch< float > & m_z
void set(const Amg::Vector3D &vec, size_t pos)
UnitThreeVectorBranch(MuonTesterTree &tree, const std::string &vec_name)
VectorBranch< float > & m_theta
bool fill(const EventContext &) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
void set(const float x, const float y, const float z, size_t pos)
VectorBranch< float > & m_phi
void operator+=(const Amg::Vector3D &vec)
void push_back(const Amg::Vector3D &vec)
interface using the Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Class to store array like branches into the n-tuples.
Definition HitValAlg.cxx:19