ATLAS Offline Software
TwoVectorBranch.cxx
Go to the documentation of this file.
1 /*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
5 namespace MuonVal {
6 
7 bool TwoVectorBranch::fill(const EventContext&) { return true; }
8 bool TwoVectorBranch::init() { return true; }
9 
10 TwoVectorBranch::TwoVectorBranch(MuonTesterTree& tree, const std::string& vec_name) : MuonTesterBranch(tree, vec_name) {}
11 size_t TwoVectorBranch::size() const { return m_x.size(); }
12 
13 void TwoVectorBranch::push_back(const float x, const float y) {
14  m_x += x;
15  m_y += y;
16 }
17 void TwoVectorBranch::set(const float x, const float y, size_t pos) {
18  m_x[pos] = x;
19  m_y[pos] = y;
20 }
22 void TwoVectorBranch::set(const Amg::Vector2D& vec, size_t pos) { set(vec[0], vec[1], pos); }
24 void TwoVectorBranch::push_back(const TVector2& vec) { push_back(vec.X(), vec.Y()); }
25 void TwoVectorBranch::operator+=(const TVector2& vec) { push_back(vec); }
26 void TwoVectorBranch::set(const TVector2& vec, size_t pos) { set(vec.X(), vec.Y(), pos); }
27 }
MuonVal::TwoVectorBranch::init
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
Definition: TwoVectorBranch.cxx:8
MuonVal::TwoVectorBranch::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: TwoVectorBranch.cxx:7
MuonVal::TwoVectorBranch::size
size_t size() const
Definition: TwoVectorBranch.cxx:11
MuonVal::TwoVectorBranch::m_y
VectorBranch< float > & m_y
Definition: TwoVectorBranch.h:38
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
MuonVal::MuonTesterBranch
Definition: MuonTesterBranch.h:21
tree
TChain * tree
Definition: tile_monitor.h:30
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
x
#define x
MuonVal::TwoVectorBranch::operator+=
void operator+=(const Amg::Vector2D &vec)
Definition: TwoVectorBranch.cxx:23
MuonVal::TwoVectorBranch::set
void set(const TVector2 &vec, size_t pos)
Definition: TwoVectorBranch.cxx:26
MuonVal::MuonTesterTree
Definition: MuonTesterTree.h:30
MuonVal::TwoVectorBranch::push_back
void push_back(const Amg::Vector2D &vec)
interface using the Amg::Vector3D
Definition: TwoVectorBranch.cxx:21
MuonVal::TwoVectorBranch::m_x
VectorBranch< float > & m_x
Definition: TwoVectorBranch.h:37
MuonVal
Class to store array like branches into the n-tuples.
Definition: MuonTPMetaDataAlg.cxx:25
MuonVal::TwoVectorBranch::set
void set(const Amg::Vector2D &vec, size_t pos)
Definition: TwoVectorBranch.cxx:22
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
y
#define y
MuonVal::TwoVectorBranch::push_back
void push_back(const TVector2 &vec)
Definition: TwoVectorBranch.cxx:24
MuonVal::TwoVectorBranch::TwoVectorBranch
TwoVectorBranch(MuonTesterTree &tree, const std::string &vec_name)
Definition: TwoVectorBranch.cxx:10
TwoVectorBranch.h
MuonVal::VectorBranch::size
size_t size() const
Returns the number of actual saved elements.