38 for(
const auto& pe:
fPE){
46 void PixelMap::Add(
const unsigned int& wire,
const double& tdc,
const unsigned int& view,
const double& pe)
49 const double purity=0.0;
74 const unsigned int& view)
81 double timestep=(upperTL-lowerTL)/
double(
fNTdc);
82 double roundChannel=round((tdc-lowerTL)/timestep);
84 unsigned int internalTdc = roundChannel;
88 assert(index <
fPE.size());
94 const unsigned int& tdc)
const 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;
119 assert(index <
fPEX.size());
128 for(
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc)
130 for(
unsigned int iWire = 0; iWire <
fNWire; iWire += 2)
146 for(
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc)
148 for(
unsigned int iWire = 1; iWire <
fNWire; iWire += 2)
173 for(
unsigned int iWire = 0; iWire <
fNWire; ++iWire)
175 for(
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc)
178 hist->SetBinContent(iWire+1, iTdc + fNTdc*(iWire%3) + 1,
193 for(
unsigned int iWire = 0; iWire <
fNWire; ++iWire)
195 for(
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc)
198 hist->SetBinContent(iWire+1, iTdc + fNTdc*(iWire%3) + 1,
210 TH2F*
hist =
new TH2F(
"PixelMap",
";Wire;Tdc",
fNWire, 0,
214 for(
unsigned int iWire = 0; iWire <
fNWire; ++iWire)
216 for(
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc)
220 hist->SetBinContent(iWire+1, iTdc + 1,
224 hist->SetBinContent(iWire+1, iTdc + 1,
228 hist->SetBinContent(iWire+1, iTdc + 1,
238 os <<
"PixelMap with " << m.
NPixel() <<
" pixels, " 239 << m.
NWire() <<
" wires" 240 <<
" by " << m.
NTdc() <<
" tdcs" ;
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
unsigned int NPixel() const
Total number of pixels in map.
TH2F * SingleViewToTH2(const unsigned int &view) const
unsigned int fNWire
Number of wires, length of pixel map.
std::ostream & operator<<(std::ostream &os, const PixelMapProducer &p)
void FillInputVector(float *input) const
Utility class for truth labels.
TH2F * ToTH2() const
Return the pixel map as a 2D histogram for visualization.
std::vector< float > fPE
Vector of PE measurements for pixels.
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 > fPEZ
Vector of Y PE measurements for pixels.
std::vector< HitType > fLabY
Vector of Y Truth labels for pixels.
void Add(const unsigned int &wire, const double &tdc, const unsigned int &view, const double &pe)
std::vector< float > fPEX
Vector of X PE measurements for pixels.
double FirstTDC(const unsigned int &view) const
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.
int FirstWire(const unsigned int &view) const
unsigned int NTdc() const
Width in tdcs.
PixelMap, basic input to CVN neural net.
std::vector< double > fPurY
Vector of Y purity for pixels.
std::vector< HitType > fLabX
Vector of X Truth labels for pixels.
std::vector< double > fPurZ
Vector of Y purity for pixels.
std::vector< HitType > fLab
Vector of Truth labels for pixels.
unsigned int fTotHits
Number of hits that make up the pixel map.
unsigned int fNTdc
Number of tdcs, width of pixel map.
std::vector< HitType > fLabZ
Vector of Y Truth labels for pixels.
unsigned int NWire() const
Length in wires.
double LastTDC(const unsigned int &view) const
unsigned int LocalToIndex(const unsigned int &wire, const unsigned int &tdc) const
Take local wire, tdc (within map) and return index in fPE vector.
QTextStream & endl(QTextStream &s)
std::vector< double > fPur
Vector of purity for pixels.
std::vector< double > fPurX
Vector of X purity for pixels.
bool IsWithin(const unsigned int &wire, const double &cell, const unsigned int &view)