Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
gen
src
ZSEndedTrace.cxx
Go to the documentation of this file.
1
#include "
WireCellGen/ZSEndedTrace.h
"
2
3
using namespace
std
;
4
using namespace
WireCell
;
5
6
ZSEndedTrace::ZSEndedTrace(
int
chid,
int
nbins
)
7
: m_chid(chid)
8
, m_nbins(nbins)
9
{
10
}
11
12
void
ZSEndedTrace::operator()
(
int
bin
,
float
charge
)
13
{
14
bin =
min
(bin,
m_nbins
-1);
15
m_chqmap
[
bin
] +=
charge
;
16
m_charge
.clear();
// invalidate;
17
}
18
19
int
ZSEndedTrace::channel
()
const
20
{
21
return
m_chid
;
22
}
23
24
int
ZSEndedTrace::tbin
()
const
25
{
26
return
m_chqmap
.begin()->first;
27
}
28
29
const
ZSEndedTrace::ChargeSequence
&
ZSEndedTrace::charge
()
const
30
{
31
if
(!
m_charge
.size()) {
32
int
first_bin =
m_chqmap
.begin()->first;
33
int
last_bin =
m_chqmap
.rbegin()->first;
34
m_charge
.resize(last_bin-first_bin+1, 0);
35
for
(
auto
mit :
m_chqmap
) {
36
m_charge
[mit.first - first_bin] = mit.second;
37
}
38
}
39
return
m_charge
;
40
}
WireCell::ZSEndedTrace::charge
virtual const ChargeSequence & charge() const
Definition:
ZSEndedTrace.cxx:29
WireCell::ZSEndedTrace::channel
virtual int channel() const
Definition:
ZSEndedTrace.cxx:19
std
STL namespace.
ValidateOpDetReco.nbins
int nbins
Definition:
ValidateOpDetReco.py:579
WireCell::ZSEndedTrace::tbin
virtual int tbin() const
Definition:
ZSEndedTrace.cxx:24
ZSEndedTrace.h
WireCell::ZSEndedTrace::m_nbins
int m_nbins
Definition:
ZSEndedTrace.h:18
WireCell::ZSEndedTrace::m_chid
int m_chid
Definition:
ZSEndedTrace.h:18
WireCell::ZSEndedTrace::operator()
void operator()(int tbin, float charge)
used to fill.
Definition:
ZSEndedTrace.cxx:12
WireCell
Definition:
Main.h:22
cet::sqlite::min
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition:
statistics.h:55
WireCell::ZSEndedTrace::m_charge
ChargeSequence m_charge
Definition:
ZSEndedTrace.h:20
bin
QTextStream & bin(QTextStream &s)
Definition:
qtextstream.cpp:2006
WireCell::ITrace::ChargeSequence
std::vector< float > ChargeSequence
Sequential collection of charge.
Definition:
ITrace.h:21
WireCell::ZSEndedTrace::m_chqmap
std::map< int, float > m_chqmap
Definition:
ZSEndedTrace.h:19
Generated by
1.8.11