#include <EventImageData.h>
|
| EventImageData (size_t w, size_t d, bool saveDep) |
|
void | addTpc (const TrainingDataAlg &dataAlg, size_t gw, bool flipw, size_t gd, bool flipd) |
|
bool | findCrop (size_t max_area_cut, unsigned int &w0, unsigned int &w1, unsigned int &d0, unsigned int &d1) const |
|
const std::vector< std::vector< float > > & | adcData (void) const |
|
const std::vector< float > & | wireAdc (size_t widx) const |
|
const std::vector< std::vector< float > > & | depData (void) const |
|
const std::vector< float > & | wireDep (size_t widx) const |
|
const std::vector< std::vector< int > > & | pdgData (void) const |
|
const std::vector< int > & | wirePdg (size_t widx) const |
|
void | setProjXY (const TrainingDataAlg &dataAlg, float x, float y, size_t gw, bool flipw, size_t gd, bool flipd) |
|
float | getProjX (void) const |
|
float | getProjY (void) const |
|
int | getVtxX (void) const |
|
int | getVtxY (void) const |
|
Definition at line 28 of file EventImageData.h.
nnet::EventImageData::EventImageData |
( |
size_t |
w, |
|
|
size_t |
d, |
|
|
bool |
saveDep |
|
) |
| |
Definition at line 51 of file EventImageData.cxx.
56 fAdc.resize(
w, std::vector<float>(
d, 0));
57 if (saveDep) {
fDeposit.resize(
w, std::vector<float>(
d, 0)); }
58 fPdg.resize(
w, std::vector<int>(
d, 0));
std::vector< std::vector< float > > fAdc
std::vector< std::vector< float > > fDeposit
std::vector< std::vector< int > > fPdg
void nnet::EventImageData::addTpc |
( |
const TrainingDataAlg & |
dataAlg, |
|
|
size_t |
gw, |
|
|
bool |
flipw, |
|
|
size_t |
gd, |
|
|
bool |
flipd |
|
) |
| |
Definition at line 71 of file EventImageData.cxx.
73 float zero = dataAlg.ZeroLevel();
74 for (
size_t w = 0;
w < dataAlg.NWires(); ++
w)
76 size_t drift_size = dataAlg.NScaledDrifts();
77 std::vector<float> & dstAdc =
fAdc[gw +
w];
78 std::vector<float> & dstDep =
fDeposit[gw +
w];
79 std::vector<int> & dstPdg =
fPdg[gw +
w];
80 const float* srcAdc = 0;
81 const float* srcDep = 0;
82 const int* srcPdg = 0;
85 srcAdc = dataAlg.wireData(dataAlg.NWires() -
w - 1).
data();
86 srcDep = dataAlg.wireEdep(dataAlg.NWires() -
w - 1).
data();
87 srcPdg = dataAlg.wirePdg(dataAlg.NWires() -
w - 1).
data();
91 srcAdc = dataAlg.wireData(
w).data();
92 srcDep = dataAlg.wireEdep(
w).data();
93 srcPdg = dataAlg.wirePdg(
w).data();
97 for (
size_t d = 0;
d < drift_size; ++
d) { dstAdc[gd +
d] += srcAdc[drift_size -
d - 1] - zero; }
98 if (
fSaveDep) {
for (
size_t d = 0;
d < drift_size; ++
d) { dstDep[gd +
d] += srcDep[drift_size -
d - 1]; } }
99 for (
size_t d = 0;
d < drift_size; ++
d)
101 int code = srcPdg[drift_size -
d - 1];
104 dstPdg[gd +
d] = vtx_flags | best_pdg;
111 for (
size_t d = 0;
d < drift_size; ++
d) { dstAdc[gd +
d] += srcAdc[
d] - zero; }
112 if (
fSaveDep) {
for (
size_t d = 0;
d < drift_size; ++
d) { dstDep[gd +
d] += srcDep[
d]; } }
113 for (
size_t d = 0;
d < drift_size; ++
d)
115 int code = srcPdg[
d];
118 dstPdg[gd +
d] = vtx_flags | best_pdg;
std::vector< std::vector< float > > fAdc
std::vector< std::vector< float > > fDeposit
std::vector< std::vector< int > > fPdg
CodeOutputInterface * code
Definition at line 39 of file EventImageData.h.
std::vector< std::vector< float > > fDeposit
bool nnet::EventImageData::findCrop |
( |
size_t |
max_area_cut, |
|
|
unsigned int & |
w0, |
|
|
unsigned int & |
w1, |
|
|
unsigned int & |
d0, |
|
|
unsigned int & |
d1 |
|
) |
| const |
Definition at line 126 of file EventImageData.cxx.
128 size_t max_cut = max_area_cut / 4;
133 while (w0 <
fAdc.size())
135 for (
auto const d :
fAdc[w0]) {
if (
d > adcThr) cut++; }
136 if (cut < max_cut) w0++;
139 w1 =
fAdc.size() - 1;
143 for (
auto const d :
fAdc[w1]) {
if (
d > adcThr) cut++; }
144 if (cut < max_cut) w1--;
151 while (d0 <
fAdc.front().size())
153 for (
size_t i = w0; i < w1; ++i) {
if (
fAdc[i][d0] > adcThr) cut++; }
154 if (cut < max_cut) d0++;
157 d1 =
fAdc.front().size() - 1;
161 for (
size_t i = w0; i < w1; ++i) {
if (
fAdc[i][d1] > adcThr) cut++; }
162 if (cut < max_cut) d1--;
167 unsigned int margin = 32;
168 if ((w1 - w0 > 8) && (d1 - d0 > 8))
170 if (w0 < margin) w0 = 0;
173 if (w1 >
fAdc.size() - margin) w1 =
fAdc.size();
176 if (d0 < margin) d0 = 0;
179 if (d1 >
fAdc.front().size() - margin) d1 =
fAdc.front().size();
std::vector< std::vector< float > > fAdc
float nnet::EventImageData::getProjX |
( |
void |
| ) |
const |
|
inline |
float nnet::EventImageData::getProjY |
( |
void |
| ) |
const |
|
inline |
int nnet::EventImageData::getVtxX |
( |
void |
| ) |
const |
|
inline |
int nnet::EventImageData::getVtxY |
( |
void |
| ) |
const |
|
inline |
void nnet::EventImageData::setProjXY |
( |
const TrainingDataAlg & |
dataAlg, |
|
|
float |
x, |
|
|
float |
y, |
|
|
size_t |
gw, |
|
|
bool |
flipw, |
|
|
size_t |
gd, |
|
|
bool |
flipd |
|
) |
| |
Definition at line 62 of file EventImageData.cxx.
64 if (flipw) {
fProjX = gw + dataAlg.NWires() -
x - 1; }
67 if (flipd) {
fProjY = gd + dataAlg.NScaledDrifts() -
y/dataAlg.DriftWindow() - 1; }
68 else {
fProjY = gd +
y/dataAlg.DriftWindow(); }
const std::vector<float>& nnet::EventImageData::wireAdc |
( |
size_t |
widx | ) |
const |
|
inline |
Definition at line 37 of file EventImageData.h.
37 {
return fAdc[widx]; }
std::vector< std::vector< float > > fAdc
const std::vector<float>& nnet::EventImageData::wireDep |
( |
size_t |
widx | ) |
const |
|
inline |
Definition at line 40 of file EventImageData.h.
std::vector< std::vector< float > > fDeposit
const std::vector<int>& nnet::EventImageData::wirePdg |
( |
size_t |
widx | ) |
const |
|
inline |
Definition at line 43 of file EventImageData.h.
43 {
return fPdg[widx]; }
std::vector< std::vector< int > > fPdg
float nnet::EventImageData::fProjX |
|
private |
float nnet::EventImageData::fProjY |
|
private |
bool nnet::EventImageData::fSaveDep |
|
private |
int nnet::EventImageData::fVtxX |
|
private |
int nnet::EventImageData::fVtxY |
|
private |
The documentation for this class was generated from the following files: