ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonTesterTree
MuonTesterTree
ScalarBranch.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef MUONTESTER_MUONSCALARBRANCH_H
5
#define MUONTESTER_MUONSCALARBRANCH_H
6
7
#include <
MuonTesterTree/MuonTesterBranch.h
>
10
namespace
MuonVal
{
11
class
MuonTesterTree
;
12
template
<
class
T>
class
ScalarBranch
:
public
MuonTesterBranch
,
virtual
public
IMuonTesterBranch
{
13
public
:
17
ScalarBranch
(TTree*
tree
,
const
std::string&
name
);
18
ScalarBranch
(
MuonTesterTree
&
tree
,
const
std::string&
name
);
19
22
ScalarBranch
(TTree*
tree
,
const
std::string&
name
,
const
T& default_value);
23
ScalarBranch
(
MuonTesterTree
&
tree
,
const
std::string&
name
,
const
T& default_value);
24
25
virtual
~ScalarBranch
() =
default
;
26
27
bool
fill
(
const
EventContext& ctx)
override
;
28
bool
init
()
override
;
29
33
const
T&
operator=
(
const
T& value);
34
const
T&
setValue
(
const
T& value);
35
36
bool
isUpdated
()
const
;
37
void
setDefault
(
const
T& def);
38
void
disableFailing
();
39
40
const
T&
getDefault
()
const
;
41
const
T&
getVariable
()
const
;
42
bool
mustBeUpdated
()
const
;
43
44
inline
friend
std::ostream&
operator<<
(std::ostream& ostr,
const
ScalarBranch
& br) {
45
ostr<<br.name()<<
": "
<<(br.isUpdated() ? br.getDefault() : br.getVariable());
46
return
ostr;
47
};
48
49
private
:
50
T
m_variable
{};
51
T
m_default
{};
52
bool
m_failIfNotUpdated
{
true
};
53
bool
m_updated
{
false
};
54
};
55
56
template
<
typename
T> std::ostream&
operator<<
(std::ostream& out,
const
ScalarBranch<T>& B);
57
}
58
#include <
MuonTesterTree/ScalarBranch.icc
>
59
#endif
MuonTesterBranch.h
ScalarBranch.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::ScalarBranch::operator<<
friend std::ostream & operator<<(std::ostream &ostr, const ScalarBranch &br)
Definition
ScalarBranch.h:44
MuonVal::ScalarBranch::m_updated
bool m_updated
Definition
ScalarBranch.h:53
MuonVal::ScalarBranch::ScalarBranch
ScalarBranch(MuonTesterTree &tree, const std::string &name, const T &default_value)
MuonVal::ScalarBranch::isUpdated
bool isUpdated() const
MuonVal::ScalarBranch::mustBeUpdated
bool mustBeUpdated() const
MuonVal::ScalarBranch::getVariable
const T & getVariable() const
MuonVal::ScalarBranch::fill
bool fill(const EventContext &ctx) override
The fill method checks if enough information is provided such that the branch is cleared from the inf...
MuonVal::ScalarBranch::operator=
const T & operator=(const T &value)
Setter methods.
MuonVal::ScalarBranch::~ScalarBranch
virtual ~ScalarBranch()=default
MuonVal::ScalarBranch::setValue
const T & setValue(const T &value)
MuonVal::ScalarBranch::getDefault
const T & getDefault() const
MuonVal::ScalarBranch::init
bool init() override
The init method checks whether the branch name has already registered to the MuonTree and tries then ...
MuonVal::ScalarBranch::disableFailing
void disableFailing()
MuonVal::ScalarBranch::ScalarBranch
ScalarBranch(TTree *tree, const std::string &name, const T &default_value)
Constructor providing a default_value which is inserted when the information in the branch is not upd...
MuonVal::ScalarBranch::ScalarBranch
ScalarBranch(TTree *tree, const std::string &name)
Default constructor passing the TTree object and the name of the branch in the tree.
MuonVal::ScalarBranch::setDefault
void setDefault(const T &def)
MuonVal::ScalarBranch::m_failIfNotUpdated
bool m_failIfNotUpdated
Definition
ScalarBranch.h:52
MuonVal::ScalarBranch::m_default
T m_default
Definition
ScalarBranch.h:51
MuonVal::ScalarBranch::ScalarBranch
ScalarBranch(MuonTesterTree &tree, const std::string &name)
MuonVal::ScalarBranch::m_variable
T m_variable
Definition
ScalarBranch.h:50
MuonVal
Class to store array like branches into the n-tuples.
Definition
HitValAlg.cxx:19
Muon::MuonStationIndex::operator<<
std::ostream & operator<<(std::ostream &ostr, const StIndex stIdx)
Definition
MuonStationIndex.cxx:186
Generated on
for ATLAS Offline Software by
1.17.0