Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
DuneCommon
Tool
BlockIndexMapTool.h
Go to the documentation of this file.
1
// BlockIndexMapTool.h
2
//
3
// David Adams
4
// November 2020
5
//
6
// Tool to map a block of indices (e.g. a channel) to an index (e.g. wire plane index).
7
//
8
// Parameters:
9
// LogLevel - Message logging level:
10
// 0: none
11
// 1: show config
12
// 2: check for duplicates
13
// Starts: Index for which each block starts
14
// Values: Value to which each blokc of indices is mapped
15
// Period: Mapping is repeated with this period
16
//
17
// The starts and values do not need to be ordered.
18
// If any starts are duplicated, the value for last one takes precedence.
19
// If there are fewer values than starts, value zer is used for the extra starts.
20
// If Period is nonzero the mapping is done with the remainder after dividing by that value.
21
22
#ifndef BlockIndexMapTool_H
23
#define BlockIndexMapTool_H
24
25
#include "
art/Utilities/ToolMacros.h
"
26
#include "
fhiclcpp/ParameterSet.h
"
27
#include "
dunecore/DuneInterface/Tool/IndexMapTool.h
"
28
#include <vector>
29
#include <map>
30
31
class
BlockIndexMapTool
:
public
IndexMapTool
{
32
33
public
:
34
35
using
Index
=
IndexMapTool::Index
;
36
37
// Ctor.
38
BlockIndexMapTool
(
fhicl::ParameterSet
const
&
ps
);
39
40
// Dtor.
41
~BlockIndexMapTool
()
override
=
default
;
42
43
// Return the channel status.
44
Index
get
(
Index
icha)
const
override
;
45
46
private
:
47
48
using
IndexVector
= std::vector<Index>;
49
using
IndexMap
= std::map<Index, Index>;
50
51
// Parameters.
52
Index
m_LogLevel
;
53
IndexVector
m_Starts
;
54
IndexVector
m_Values
;
55
Index
m_Period
;
56
57
// Derived data.
58
IndexMap
m_map
;
59
60
};
61
62
63
#endif
BlockIndexMapTool::IndexMap
std::map< Index, Index > IndexMap
Definition:
BlockIndexMapTool.h:49
IndexMapTool
Definition:
IndexMapTool.h:12
IndexMapTool.h
BlockIndexMapTool::m_Starts
IndexVector m_Starts
Definition:
BlockIndexMapTool.h:53
ParameterSet.h
BlockIndexMapTool::m_LogLevel
Index m_LogLevel
Definition:
BlockIndexMapTool.h:52
ToolMacros.h
BlockIndexMapTool
Definition:
BlockIndexMapTool.h:31
BlockIndexMapTool::m_Period
Index m_Period
Definition:
BlockIndexMapTool.h:55
genie::units::ps
static constexpr double ps
Definition:
Units.h:99
BlockIndexMapTool::~BlockIndexMapTool
~BlockIndexMapTool() override=default
BlockIndexMapTool::Index
IndexMapTool::Index Index
Definition:
BlockIndexMapTool.h:35
BlockIndexMapTool::m_map
IndexMap m_map
Definition:
BlockIndexMapTool.h:58
IndexMapTool::Index
unsigned int Index
Definition:
IndexMapTool.h:16
BlockIndexMapTool::IndexVector
std::vector< Index > IndexVector
Definition:
BlockIndexMapTool.h:48
BlockIndexMapTool::BlockIndexMapTool
BlockIndexMapTool(fhicl::ParameterSet const &ps)
Definition:
BlockIndexMapTool_tool.cc:17
BlockIndexMapTool::m_Values
IndexVector m_Values
Definition:
BlockIndexMapTool.h:54
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11