ATLAS Offline Software
Loading...
Searching...
No Matches
FourVectorBranch.h
Go to the documentation of this file.
1/*
2Copyright (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
8#endif
10#include <TLorentzVector.h>
11
12namespace MuonVal {
16public:
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
36private:
41};
42
46public:
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
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
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
std::vector< size_t > vec
#define y
#define x
#define z
VectorBranch< float > & m_x
CartesFourVecBranch(MuonTesterTree &tree, const std::string &vec_name, Type t)
VectorBranch< float > & m_t
void set(const TLorentzVector &vec, size_t pos)
VectorBranch< float > & m_z
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
void push_back(const TLorentzVector &vec)
void operator+=(const TLorentzVector &vec)
bool fill(const EventContext &) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
VectorBranch< float > & m_y
MuonTesterBranch(MuonTesterTree &tree, const std::string &br_name)
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
std::string name() const override final
Returns the name of the branch.
TTree * tree() override final
Returns the underlying TTree object.
VectorBranch< T > & newVector(const std::string &name)
Creates new branches and returns their reference.
bool fill(const EventContext &) override final
The fill method checks if enough information is provided such that the branch is cleared from the inf...
VectorBranch< float > & m_phi
VectorBranch< float > & m_eta
void push_back(const TLorentzVector &vec)
PtEtaPhiEBranch(MuonTesterTree &tree, const std::string &vec_name)
void set(const TLorentzVector &vec, size_t pos)
VectorBranch< float > & m_e
void operator+=(const TLorentzVector &vec)
VectorBranch< float > & m_pt
bool init() override final
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
Class to store array like branches into the n-tuples.
Definition HitValAlg.cxx:19
TChain * tree
#define private