ATLAS Offline Software
Loading...
Searching...
No Matches
ThreeVectorBranch.cxx
Go to the documentation of this file.
1/*
2Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
5namespace MuonVal {
6
7bool ThreeVectorBranch::fill(const EventContext&) { return true; }
8bool ThreeVectorBranch::init() { return true; }
9
11size_t ThreeVectorBranch::size() const { return m_x.size(); }
12
13void ThreeVectorBranch::push_back(const float x, const float y, const float z) {
14 m_x += x;
15 m_y += y;
16 m_z += z;
17}
18void ThreeVectorBranch::set(const float x, const float y, const float z, size_t pos) {
19 m_x[pos] = x;
20 m_y[pos] = y;
21 m_z[pos] = z;
22}
24void ThreeVectorBranch::set(const Amg::Vector3D& vec, size_t pos) { set(vec[0], vec[1], vec[2], pos); }
26#ifndef HEPMC3
27#ifndef XAOD_ANALYSIS
28void ThreeVectorBranch::push_back(const HepMC::ThreeVector& vec) { push_back(vec.x(), vec.y(), vec.z()); }
29void ThreeVectorBranch::set(const HepMC::ThreeVector& vec, size_t pos) { set(vec.x(), vec.y(), vec.z(), pos); }
30void ThreeVectorBranch::operator+=(const HepMC::ThreeVector& vec) { push_back(vec); }
31#endif
32#endif
33void ThreeVectorBranch::push_back(const TVector3& vec) { push_back(vec.X(), vec.Y(), vec.Z()); }
35void ThreeVectorBranch::set(const TVector3& vec, size_t pos) { set(vec.X(), vec.Y(), vec.Z(), pos); }
36}
std::vector< size_t > vec
#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
Eigen::Matrix< double, 3, 1 > Vector3D
Class to store array like branches into the n-tuples.
Definition HitValAlg.cxx:19