23 unsigned int maxPlaneGap,
bool useGeV):
26 fMaxPlaneGap(maxPlaneGap),
47 for(
size_t iHit = 0; iHit < cluster.
NCell(); ++iHit)
63 gev = cluster.
Cell(iHit)->
PE() / 15123.7;
78 pm.
Add(plane, cell, value, label, purity);
88 for(
size_t iHit = 0; iHit < shower.
NCell(); ++iHit)
109 gev = shower.
Cell(iHit)->
PE() / 15123.7;
113 const float value = gev;
120 pm.
Add(plane, cell, cellView, value, label, purity);
133 for(
size_t iHit = 0; iHit < cluster.
NCell(); ++iHit)
155 gev = cluster.
Cell(iHit)->
PE() / 15123.7;
172 pm.
Add(plane, cell, cellView, value, label, purity);
187 for(
unsigned int iProng = 0; iProng < showers3D.size(); ++iProng ){
188 for(
size_t iHit = 0; iHit < showers3D[iProng]->NCell(); ++iHit)
190 const unsigned int plane = showers3D[iProng]->Cell(iHit)->Plane();
191 const unsigned int cell = showers3D[iProng]->Cell(iHit)->Cell();
208 gev = showers3D[iProng]->Cell(iHit)->PE() / 15123.7;
211 const float value = gev;
216 pm.
Add(plane, cell, cellView, value, label, purity);
228 os <<
"RegPixelMapProducer: " 229 << p.
NCell() <<
" cells X " << p.
NPlane() <<
" planes";
235 std::set<unsigned int> planes;
236 for(
size_t iHit = 0; iHit < cluster.
NCell(); ++iHit)
237 planes.insert(cluster.
Cell(iHit)->
Plane());
239 unsigned int firstPlane = cluster.
MinPlane();
240 unsigned int previousPlane = cluster.
MinPlane();
241 for(
const auto&
plane:planes){
242 unsigned int gap =
plane - previousPlane;
247 previousPlane =
plane;
259 std::map<unsigned int, unsigned int> planeMap;
262 for(
size_t iHit = 0; iHit < cluster.
NCell(); ++iHit)
268 for(
unsigned int iPlane = cluster.
MinPlane();
272 if(not planeMap.count(iPlane))
continue;
275 unsigned int windowCount = 0;
276 for(
unsigned int iWindow = iPlane; iWindow - iPlane <
window; ++iWindow)
279 if(planeMap.count(iWindow))
280 windowCount += planeMap[iWindow];
284 if(windowCount >= threshold)
296 unsigned int firstPlane)
299 std::vector<unsigned int> cells[2];
300 for(
unsigned int iHit = 0; iHit < cluster.
NCell(); ++iHit)
303 unsigned int view = plane%2;
309 std::array<unsigned int, 2>
median;
335 centerCell[0], centerCell[1]);
344 unsigned int firstPlane)
346 return plane >= firstPlane && plane < firstPlane +
fNPlane;
unsigned int NCell() const
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Boundary DefineBoundary(const rb::Cluster &cluster)
Get boundaries for pixel map representation of cluster.
fvar< T > fabs(const fvar< T > &x)
Producer algorithm for RegPixelMap, input to CVN neural net.
void Add(const unsigned int &plane, const unsigned int &cell, const float &pe, const HitType label, const double purity)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
unsigned short Plane() const
Vertical planes which measure X.
std::ostream & operator<<(std::ostream &os, const PixelMapProducer &p)
A collection of associated CellHits.
Defines an enumeration for prong classification.
unsigned int fMaxPlaneGap
Horizontal planes which measure Y.
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
unsigned short Cell() const
RegPixelMap CreateMapGivenBoundary(const rb::Cluster &cluster, const Boundary &bound)
RegPixelMap CreateMapGivenShowerVertex(const rb::Shower &shower, const Boundary &bound, unsigned int vtxPlane, unsigned int vtxXCell, unsigned int vtxYCell)
unsigned int fNCell
Number of cells, width of pixel map.
const XML_Char int const XML_Char * value
bool InCellRcvne(unsigned int cell, float meanCell)
Determine whether cell is within cell rcvne based on meanCell.
RegPixelMapProducer for CVN.
unsigned int FindVertexWindowThreshold(const rb::Cluster &cluster)
Find vertex plane by requiring gaps are not wider than maxGap.
rb::RecoHit RecoHit(const art::Ptr< rb::CellHit > &chit) const
Return calibrated hit based on assumed W coordinate.
bool IsCalibrated() const
You MUST check here before accessing PECorr, MIP or GeV.
std::array< unsigned int, 2 > FindCenterMedian(const rb::Cluster &cluster, unsigned int firstPlane)
Find center cell based on mean of hits in each view (2 views)
RegPixelMap, basic input to CVN neural net.
unsigned int MinPlane(geo::View_t view=geo::kXorY) const
RegPixelMap CreateMapGivenVertex(const rb::Cluster &cluster, const Boundary &bound, unsigned int vtxPlane, unsigned int vtxXCell, unsigned int vtxYCell)
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
RegPixelMapProducer(unsigned int nPlane, unsigned int nCell, unsigned int maxPlaneGap, bool useGeV)
A rb::Prong with a length.
unsigned int fNPlane
Number of planes, length for pixel maps.
unsigned int MaxPlane(geo::View_t view=geo::kXorY) const
RegPixelMap CreateMap(const rb::Cluster &slice)
HitType HitClassify(art::Ptr< rb::CellHit > Hit, HitType *hType, double *hPurity)
bool InPlaneRcvne(unsigned int plane, unsigned int firstPlane)
Determine plane is within plane rcvne of a PixelMap.
unsigned int NPlane() const
unsigned int FindVertexMaxGap(const rb::Cluster &cluster)
Find vertex plane by requiring gaps are not wider than maxGap.