Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
DuneCommon
Tool
FclFloatArray_tool.cc
Go to the documentation of this file.
1
// FclFloatArray_tool.cc
2
3
#include "
FclFloatArray.h
"
4
#include <iostream>
5
#include <iomanip>
6
7
using
std::cout;
8
using
std::endl
;
9
using
std::string
;
10
using
std::setw
;
11
12
using
Name
=
std::string
;
13
14
//**********************************************************************
15
16
FclFloatArray::FclFloatArray
(
fhicl::ParameterSet
const
&
ps
)
17
: m_LogLevel(ps.
get
<
Index
>(
"LogLevel"
)),
18
m_DefaultValue(ps.
get
<
float
>(
"DefaultValue"
)),
19
m_Offset(ps.
get
<
Index
>(
"Offset"
)),
20
m_Label(ps.
get
<
Name
>(
"Label"
)),
21
m_Unit(ps.
get
<
Name
>(
"Unit"
)),
22
m_Values(ps.
get
<
FloatVector
>(
"Values"
)) {
23
const
Name
myname =
"FclFloatArray::ctor: "
;
24
if
(
m_LogLevel
) {
25
cout << myname <<
"Configuration:"
<<
endl
;
26
cout << myname <<
" LogLevel: "
<<
m_LogLevel
<<
endl
;
27
cout << myname <<
" Offset: "
<<
m_Offset
<<
endl
;
28
cout << myname <<
" DefaultValue: "
<<
m_DefaultValue
<<
endl
;
29
cout << myname <<
" Label: "
<<
m_Label
<<
endl
;
30
cout << myname <<
" Unit: "
<<
m_Unit
<<
endl
;
31
cout << myname <<
" Size: "
<<
size
() <<
endl
;
32
cout << myname <<
" Values: ["
;
33
if
(
m_LogLevel
== 1 ||
size
() <= 10 ) {
34
Index
nshow =
size
() <= 10 ?
size
() : 5;
35
for
(
Index
ival=0; ival<nshow; ++ival ) {
36
if
( ival ) cout <<
", "
;
37
cout <<
values
()[ival];
38
}
39
if
( nshow <
size
() ) cout <<
", ..."
;
40
cout <<
"]"
<<
endl
;
41
}
else
{
42
Index
iwrd = 0;
43
string
sgap =
" "
;
44
for
(
Index
ival=0; ival<
size
(); ++ival ) {
45
if
( ival ) cout <<
","
;
46
if
( ++iwrd == 10 ) {
47
cout <<
"\n"
<< myname << sgap <<
" "
;
48
iwrd = 0;
49
}
50
cout <<
" "
<<
setw
(8) <<
values
()[ival];
51
}
52
cout <<
"\n"
<< myname << sgap <<
"]"
<<
endl
;
53
}
54
}
55
}
56
57
//**********************************************************************
58
59
DEFINE_ART_CLASS_TOOL
(
FclFloatArray
)
FclFloatArray::m_DefaultValue
float m_DefaultValue
Definition:
FclFloatArray.h:57
DEFINE_ART_CLASS_TOOL
#define DEFINE_ART_CLASS_TOOL(tool)
Definition:
ToolMacros.h:42
reco_momentum_tuples.float
float
Definition:
reco_momentum_tuples.py:12
string
std::string string
Definition:
nybbler.cc:12
Name
ChannelGroupService::Name Name
Definition:
FixedChannelGroupService_service.cc:19
FclFloatArray.h
FclFloatArray::Name
std::string Name
Definition:
FclFloatArray.h:30
FloatArrayTool::FloatVector
std::vector< float > FloatVector
Definition:
FloatArrayTool.h:20
genie::units::ps
static constexpr double ps
Definition:
Units.h:99
setw
Q_EXPORT QTSManip setw(int w)
Definition:
qtextstream.h:331
FclFloatArray::values
const FloatVector & values() const override
Definition:
FclFloatArray.h:48
FloatArrayTool::size
virtual Index size() const
Definition:
FloatArrayTool.h:37
FclFloatArray::m_Unit
Name m_Unit
Definition:
FclFloatArray.h:60
FclFloatArray
Definition:
FclFloatArray.h:26
FclFloatArray::FclFloatArray
FclFloatArray(fhicl::ParameterSet const &ps)
Definition:
FclFloatArray_tool.cc:16
art::get
auto const & get(AssnsNode< L, R, D > const &r)
Definition:
AssnsNode.h:115
FclFloatArray::m_Offset
Index m_Offset
Definition:
FclFloatArray.h:58
FloatArrayTool::Index
unsigned int Index
Definition:
FloatArrayTool.h:19
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
FclFloatArray::m_LogLevel
Index m_LogLevel
Definition:
FclFloatArray.h:56
FclFloatArray::m_Label
Name m_Label
Definition:
FclFloatArray.h:59
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11