ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonValidation
MuonTesterTree
Root
MuonTesterBranch.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include <
AthenaKernel/getMessageSvc.h
>
5
#include <GaudiKernel/MsgStream.h>
6
#include <
MuonTesterTree/ArrayBranch.h
>
7
#include <
MuonTesterTree/MuonTesterBranch.h
>
8
#include <
MuonTesterTree/MuonTesterTree.h
>
9
#include <
MuonTesterTree/ScalarBranch.h
>
10
#include <
MuonTesterTree/VectorBranch.h
>
11
#include <
MuonTesterTree/throwExcept.h
>
12
13
#include <functional>
14
15
#define SET_BRANCHSTRING(theType, thestring) \
16
template <> std::string ArrayBranch<theType>::tree_data_type() const { return thestring; }
17
namespace
MuonVal
{
18
SET_BRANCHSTRING
(Char_t,
"/B"
)
19
SET_BRANCHSTRING
(std::string,
"/C"
)
20
SET_BRANCHSTRING
(UChar_t,
"/b"
)
21
SET_BRANCHSTRING
(Short_t,
"/S"
)
22
SET_BRANCHSTRING
(Int_t,
"/I"
)
23
SET_BRANCHSTRING
(Long64_t,
"/L"
)
24
SET_BRANCHSTRING
(
long
,
"/I"
)
25
SET_BRANCHSTRING
(
unsigned
long
,
"/i"
)
26
SET_BRANCHSTRING
(UShort_t,
"/s"
)
27
SET_BRANCHSTRING
(UInt_t,
"/i"
)
28
SET_BRANCHSTRING
(ULong64_t,
"/l"
)
29
SET_BRANCHSTRING
(Float_t,
"/F"
)
30
SET_BRANCHSTRING
(Double_t,
"/D"
)
31
SET_BRANCHSTRING
(Bool_t,
"/o"
)
32
33
MuonTesterBranch
::
MuonTesterBranch
(
MuonTesterTree
&
tree
,
const
std
::
string
& br_name) :
34
MuonTesterBranch
(
tree
.
tree
(), br_name) {
35
m_parent
= &
tree
;
36
m_parent
->addBranch(
this
);
37
}
38
MuonTesterTree
&
MuonTesterBranch::parent
() {
39
if
(!
m_parent
) {
40
ATH_MSG_WARNING
(
"The parent of "
<<
name
() <<
" is null."
);
41
}
42
return
*
m_parent
;
43
}
44
MuonTesterBranch::~MuonTesterBranch
() {
45
if
(
m_parent
) {
46
m_parent
->removeBranch(
this
);
47
}
48
}
49
MuonTesterBranch::MuonTesterBranch
(TTree*
tree
,
const
std::string& br_name) :
50
AthMessaging
{
"MuonTesterBranch"
},
m_tree
(
tree
),
m_name
(br_name) {}
51
std::string
MuonTesterBranch::name
()
const
{
return
m_name
; }
52
bool
MuonTesterBranch::initialized
()
const
{
return
m_init
; }
53
TTree*
MuonTesterBranch::tree
() {
return
m_tree
; }
54
const
TTree*
MuonTesterBranch::tree
()
const
{
return
m_tree
; }
55
56
std::string
MuonTesterBranch::eraseWhiteSpaces
(
const
std::string& In) {
57
std::string out = In;
58
out.erase(
std::remove_if
(out.begin(), out.end(), isspace), out.end());
59
return
out;
60
}
61
std::vector<MuonTesterBranch::DataDependency>
MuonTesterBranch::data_dependencies
() {
return
m_dependencies
;}
62
63
template
<>
64
bool
&
VectorBranch<bool>::get
(
size_t
) {
65
THROW_EXCEPTION
(
"For boolean branches the get() operator is cumbersome"
);
66
}
67
}
68
#undef SET_BRANCHSTRING
ArrayBranch.h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
SET_BRANCHSTRING
#define SET_BRANCHSTRING(theType, thestring)
Definition
MuonTesterBranch.cxx:15
MuonTesterBranch.h
MuonTesterTree.h
ScalarBranch.h
VectorBranch.h
AthMessaging::AthMessaging
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Definition
AthMessaging.cxx:13
MuonVal::MuonTesterBranch::m_init
bool m_init
Definition
MuonTesterBranch.h:61
MuonVal::MuonTesterBranch::m_name
std::string m_name
Definition
MuonTesterBranch.h:60
MuonVal::MuonTesterBranch::initialized
bool initialized() const
Returns whether the object has been initialized or not The outcome of the variable is bound to a succ...
Definition
MuonTesterBranch.cxx:52
MuonVal::VectorBranch< unsigned short >::m_parent
MuonTesterTree * m_parent
Definition
MuonTesterBranch.h:59
MuonVal::MuonTesterBranch::~MuonTesterBranch
virtual ~MuonTesterBranch()
Definition
MuonTesterBranch.cxx:44
MuonVal::MuonTesterBranch::MuonTesterBranch
MuonTesterBranch(MuonTesterTree &tree, const std::string &br_name)
Definition
MuonTesterBranch.cxx:33
MuonVal::MuonTesterBranch::m_tree
TTree * m_tree
Definition
MuonTesterBranch.h:58
MuonVal::MuonTesterBranch::eraseWhiteSpaces
static std::string eraseWhiteSpaces(const std::string &In)
Definition
MuonTesterBranch.cxx:56
MuonVal::MuonTesterBranch::parent
MuonTesterTree & parent()
Returns the reference to the MuonTesterTree parent.
Definition
MuonTesterBranch.cxx:38
MuonVal::MuonTesterBranch::m_dependencies
std::vector< DataDependency > m_dependencies
Definition
MuonTesterBranch.h:62
MuonVal::MuonTesterBranch::name
std::string name() const override final
Returns the name of the branch.
Definition
MuonTesterBranch.cxx:51
MuonVal::MuonTesterBranch::data_dependencies
std::vector< DataDependency > data_dependencies() override final
Returns the data dependencies needed by the MuonTesterBranch.
Definition
MuonTesterBranch.cxx:61
MuonVal::MuonTesterBranch::tree
TTree * tree() override final
Returns the underlying TTree object.
Definition
MuonTesterBranch.cxx:53
MuonVal::MuonTesterTree
Definition
MuonTesterTree.h:38
MuonVal::VectorBranch::get
T & get(size_t idx)
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
const
MuonVal
Class to store array like branches into the n-tuples.
Definition
HitValAlg.cxx:19
std
STL namespace.
std::remove_if
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.
Definition
DVL_algorithms.h:70
throwExcept.h
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition
throwExcept.h:10
Generated on
for ATLAS Offline Software by
1.17.0