19 unsigned int nTdc,
unsigned int nTRes,
const RegCNNBoundary& bound,
const bool& prongOnly):
40 fProngOnly(prongOnly),
41 fProngTagX(nWire*nTdc),
42 fProngTagY(nWire*nTdc),
43 fProngTagZ(nWire*nTdc)
52 for(
const auto& pe:
fPE){
60 void RegPixelMap::Add(
const int& wire,
const int& tdc,
const unsigned int& view,
const double& pe,
const unsigned int& tpc,
int hit_prong_tag)
64 const double purity=0.0;
67 GetTPC(wire, tdc, view, tpc);
112 std::cout<<
"Do Prong Only selection ......"<<
std::endl;
113 for (
unsigned int i_p= 0; i_p<
fPE.size(); ++i_p) {
126 const unsigned int& view)
134 unsigned int internalWire = (
unsigned int)(round((
float)((
unsigned int)(wire-meanWire)+
fNWire*fNWRes/2)/(
float)
fNWRes) );
136 unsigned int internalTdc = (
unsigned int)( round((
float)((
unsigned int)(tdc-meanTDC)+
fNTdc*
fNTRes/2)/(
float)
fNTRes) );
144 assert(index <
fPE.size());
149 const unsigned int& tdc)
const 153 assert(index <
fPE.size());
159 const unsigned int& view)
169 unsigned int internalWire = (
unsigned int)(round((
float)(wire - meanWire +
fNWire*
fNWRes/2)/(
float)
fNWRes));
173 unsigned int internalTdc = (
unsigned int)(round((
float)(tdc - meanTDC +
fNTdc*
fNTRes/2)/(
float)
fNTRes));
177 assert(index <
fPEX.size());
184 const unsigned int& view,
185 const unsigned int& tpc)
192 double dist =
pow((wire-meanWire)*0.5,2)+
pow((tdc-meanTDC)*0.08,2);
205 for(
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc)
207 for(
unsigned int iWire = 0; iWire <
fNWire; iWire += 2)
223 for(
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc)
225 for(
unsigned int iWire = 1; iWire <
fNWire; iWire += 2)
250 for(
unsigned int iWire = 0; iWire <
fNWire; ++iWire)
252 for(
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc)
255 hist->SetBinContent(iWire+1, iTdc + fNTdc*(iWire%3) + 1,
270 for(
unsigned int iWire = 0; iWire <
fNWire; ++iWire)
272 for(
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc)
275 hist->SetBinContent(iWire+1, iTdc + fNTdc*(iWire%3) + 1,
290 for(
unsigned int iWire = 0; iWire <
fNWire; ++iWire)
292 for(
unsigned int iTdc = 0; iTdc <
fNTdc; ++iTdc)
296 hist->SetBinContent(iWire+1, iTdc + 1,
304 hist->SetBinContent(iWire+1, iTdc + 1,
308 hist->SetBinContent(iWire+1, iTdc + 1,
318 os <<
"RegPixelMap with " << m.
NPixel() <<
" pixels, " 319 << m.
NWire() <<
" wires" 320 <<
" by " << m.
NTdc() <<
" tdcs" ;
int FirstWire(const unsigned int &view) const
unsigned int GlobalToIndex(const int &wire, const int &tdc, const unsigned int &view)
Take global wire, tdc (detector) and return index in fPE vector.
std::vector< HitType > fLab
Vector of Truth labels for pixels.
unsigned int GlobalToIndexSingle(const int &wire, const int &tdc, const unsigned int &view)
Take global wire, tdc (detector) and return index in fPE vector.
unsigned int fNTdc
Number of tdcs, width of pixel map.
RegPixelMap, basic input to CNN neural net.
std::vector< int > fProngTagY
std::vector< int > fProngTagZ
unsigned int fNWire
Number of wires, length of pixel map.
std::vector< float > fPEZ
Vector of Y PE measurements for pixels.
void Add(const int &wire, const int &tdc, const unsigned int &view, const double &pe, const unsigned int &tpc, int hit_prong_tag)
std::vector< HitType > fLabY
Vector of Y Truth labels for pixels.
bool IsWithin(const int &wire, const int &tdc, const unsigned int &view)
unsigned int NPixel() const
Total number of pixels in map.
std::vector< double > fPurY
Vector of Y purity for pixels.
TH2F * SingleViewToTH2(const unsigned int &view) const
std::vector< float > fPEX
Vector of X PE measurements for pixels.
std::vector< float > fPE
Vector of PE measurements for pixels.
std::vector< double > fPurX
Vector of X purity for pixels.
std::vector< float > fPEY
Vector of Y PE measurements for pixels.
unsigned int NTdc() const
Width in tdcs.
unsigned int NWire() const
Length in wires.
Defines an enumeration for cellhit classification.
std::vector< HitType > fLabX
Vector of X Truth labels for pixels.
int LastTDC(const unsigned int &view) const
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
std::vector< double > fPurZ
Vector of Y purity for pixels.
int LastWire(const unsigned int &view) const
std::ostream & operator<<(std::ostream &os, const RegPixelMap3DProducer &p)
std::vector< HitType > fLabZ
Vector of Y Truth labels for pixels.
void GetTPC(const int &wire, const int &tdc, const unsigned int &view, const unsigned int &tpc)
RegPixelMap for RegCNN modified from PixelMap.h.
TH2F * ToTH2() const
Return the pixel map as a 2D histogram for visualization.
int FirstTDC(const unsigned int &view) const
void FillInputVector(float *input) const
std::vector< int > fProngTagX
QTextStream & endl(QTextStream &s)
unsigned int LocalToIndex(const unsigned int &wire, const unsigned int &tdc) const
Take local wire, tdc (within map) and return index in fPE vector.
std::vector< double > fPur
Vector of purity for pixels.