38 for (
const auto& pe :
fPE) {
46 const unsigned int& view,
50 const double purity = 0.0;
75 const unsigned int& view)
82 double timestep = (upperTL - lowerTL) /
double(
fNTdc);
83 double roundChannel = round((tdc - lowerTL) / timestep);
85 unsigned int internalTdc = roundChannel;
87 unsigned int index = internalWire *
fNTdc + internalTdc %
fNTdc;
89 assert(index <
fPE.size());
96 unsigned int index = wire *
fNTdc + tdc %
fNTdc;
98 assert(index <
fPE.size());
104 const unsigned int& view)
112 double timestep = (upperTL - lowerTL) /
double(
fNTdc);
113 double roundChannel = round((tdc - lowerTL) / timestep);
115 unsigned int internalTdc = roundChannel;
117 unsigned int index = internalWire *
fNTdc + internalTdc %
fNTdc;
119 assert(index <
fPEX.size());
128 for (
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc) {
129 for (
unsigned int iWire = 0; iWire <
fNWire; iWire += 2) {
131 if (
fPE[index] > 0) { std::cout <<
"*"; }
136 std::cout << std::endl;
139 for (
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc) {
140 for (
unsigned int iWire = 1; iWire <
fNWire; iWire += 2) {
142 if (
fPE[index] > 0) { std::cout <<
"*"; }
147 std::cout << std::endl;
157 for (
unsigned int iWire = 0; iWire <
fNWire; ++iWire) {
158 for (
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc) {
161 iWire + 1, iTdc + fNTdc * (iWire % 3) + 1,
fPE[
LocalToIndex(iWire, iTdc)]);
173 for (
unsigned int iWire = 0; iWire <
fNWire; ++iWire) {
174 for (
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc) {
177 iWire + 1, iTdc + fNTdc * (iWire % 3) + 1, (
double)
fLab[
LocalToIndex(iWire, iTdc)]);
189 for (
unsigned int iWire = 0; iWire <
fNWire; ++iWire) {
190 for (
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc) {
208 os <<
"PixelMap with " << m.
NPixel() <<
" pixels, " << m.
NWire() <<
" wires" 209 <<
" by " << m.
NTdc() <<
" tdcs";
unsigned int GlobalToIndex(const unsigned int &wire, const double &tdc, const unsigned int &view)
Take global wire, tdc (detector) and return index in fPE vector.
void FillInputVector(float *input) const
std::vector< float > fPE
Vector of PE measurements for pixels.
std::vector< HitType > fLab
Vector of Truth labels for pixels.
std::vector< double > fPurY
Vector of Y purity for pixels.
PixelMap, basic input to CVN neural net.
Utility class for truth labels.
std::vector< double > fPurX
Vector of X purity for pixels.
TH2F * ToTH2() const
Return the pixel map as a 2D histogram for visualization.
int FirstWire(const unsigned int view) const
std::vector< double > fPur
Vector of purity for pixels.
unsigned int LocalToIndex(const unsigned int &wire, const unsigned int &tdc) const
Take local wire, tdc (within map) and return index in fPE vector.
double FirstTDC(const unsigned int view) const
std::vector< float > fPEX
Vector of X PE measurements for pixels.
unsigned int NWire() const
Length in wires.
std::vector< HitType > fLabX
Vector of X Truth labels for pixels.
double LastTDC(const unsigned int view) const
std::vector< float > fPEZ
Vector of Y PE measurements for pixels.
std::ostream & operator<<(std::ostream &os, const Boundary &b)
std::vector< HitType > fLabZ
Vector of Y Truth labels for pixels.
std::vector< double > fPurZ
Vector of Y purity for pixels.
unsigned int fTotHits
Number of hits that make up the pixel map.
TH2F * SingleViewToTH2(const unsigned int &view) const
void Add(const unsigned int &wire, const double &tdc, const unsigned int &view, const double &pe)
unsigned int NTdc() const
Width in tdcs.
unsigned int fNWire
Number of wires, length of pixel map.
bool IsWithin(const unsigned int wire, const double cell, const unsigned int view)
unsigned int GlobalToIndexSingle(const unsigned int &wire, const double &tdc, const unsigned int &view)
Take global wire, tdc (detector) and return index in fPE vector.
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
unsigned int fNTdc
Number of tdcs, width of pixel map.
unsigned int NPixel() const
Total number of pixels in map.
std::vector< HitType > fLabY
Vector of Y Truth labels for pixels.