ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonTesterTree
MuonTesterTree
SetBranch.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef MUONTESTER_MUONSetBranch_H
5
#define MUONTESTER_MUONSetBranch_H
6
7
#include <
MuonTesterTree/MuonTesterBranch.h
>
8
9
// Implementation to store vector like variables
10
namespace
MuonVal
{
11
class
MuonTesterTree
;
12
template
<
class
T>
class
SetBranch
:
public
MuonTesterBranch
,
virtual
public
IMuonTesterBranch
{
13
public
:
15
SetBranch
(TTree*
tree
,
const
std::string&
name
);
16
SetBranch
(
MuonTesterTree
&
tree
,
const
std::string&
name
);
17
18
virtual
~SetBranch
() =
default
;
21
bool
fill
(
const
EventContext& ctx)
override
;
23
bool
init
()
override
;
24
26
inline
size_t
size
()
const
;
27
29
inline
void
insert
(
const
T& value);
30
inline
void
operator+=
(
const
T& value);
31
33
std::set<T>&
operator->
();
34
std::set<T>&
get
();
35
const
std::set<T>&
operator->
()
const
;
36
const
std::set<T>&
get
()
const
;
38
void
operator=
(
const
std::set<T>& other);
39
40
inline
friend
std::ostream&
operator<<
(std::ostream& ostr,
const
SetBranch
& br) {
41
ostr<<br.name()<<
": "
;
42
if
(br.isUpdated()){
43
ostr<<br.m_variable;
44
}
else
ostr<<
"{}"
;
45
return
ostr;
46
};
47
48
inline
bool
isUpdated
()
const
;
49
50
private
:
51
std::set<T>
m_variable
{};
52
bool
m_updated
{
false
};
53
};
54
}
55
#include <
MuonTesterTree/SetBranch.icc
>
56
#endif
MuonTesterBranch.h
SetBranch.icc
MuonVal::IMuonTesterBranch
Most basic interface class used by the MuonTester tree.
Definition
IMuonTesterBranch.h:20
MuonVal::IMuonTesterBranch::name
virtual std::string name() const =0
Returns the name of the branch.
MuonVal::IMuonTesterBranch::tree
virtual TTree * tree()=0
Returns the pointer to the underlying TTree object.
MuonVal::MuonTesterBranch::MuonTesterBranch
MuonTesterBranch(MuonTesterTree &tree, const std::string &br_name)
Definition
MuonTesterBranch.cxx:33
MuonVal::MuonTesterTree
Definition
MuonTesterTree.h:38
MuonVal::SetBranch::operator<<
friend std::ostream & operator<<(std::ostream &ostr, const SetBranch &br)
Definition
SetBranch.h:40
MuonVal::SetBranch::get
const std::set< T > & get() const
MuonVal::SetBranch::isUpdated
bool isUpdated() const
MuonVal::SetBranch::get
std::set< T > & get()
MuonVal::SetBranch::operator+=
void operator+=(const T &value)
MuonVal::SetBranch::m_variable
std::set< T > m_variable
Definition
SetBranch.h:51
MuonVal::SetBranch::operator->
std::set< T > & operator->()
Getter methods.
MuonVal::SetBranch::size
size_t size() const
Returns the number of actual saved elements.
MuonVal::SetBranch::insert
void insert(const T &value)
Adds a new element at the end of the vector.
MuonVal::SetBranch::~SetBranch
virtual ~SetBranch()=default
MuonVal::SetBranch::operator->
const std::set< T > & operator->() const
MuonVal::SetBranch::operator=
void operator=(const std::set< T > &other)
Assignment operator.
MuonVal::SetBranch::SetBranch
SetBranch(MuonTesterTree &tree, const std::string &name)
MuonVal::SetBranch::fill
bool fill(const EventContext &ctx) override
Clears vector in cases that it has not been updated in this event Retursn falls if the vector has not...
MuonVal::SetBranch::SetBranch
SetBranch(TTree *tree, const std::string &name)
Standard constructor.
MuonVal::SetBranch::init
bool init() override
Initialized the Branch.
MuonVal::SetBranch::m_updated
bool m_updated
Definition
SetBranch.h:52
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