RegPixelMapProducer.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file RegPixelMapProducer.h
3 /// \brief RegPixelMapProducer for Regression CVN modified from PixelMapProducer
4 /// \author Jianming Bian - bianjm@uci.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef CVN_REGPIXELMAPPRODUCER_H
8 #define CVN_REGPIXELMAPPRODUCER_H
9 
10 
11 #include <array>
12 #include <vector>
13 
14 #include "CVN/func/RegPixelMap.h"
15 #include "CVN/func/Boundary.h"
16 #include "RecoBase/Cluster.h"
17 #include "RecoBase/Shower.h"
18 //#include "art/Framework/Services/Registry/ServiceHandle.h"
19 //#include "Geometry/Geometry.h"
20 
21 namespace cvn
22 {
23  /// Producer algorithm for RegPixelMap, input to CVN neural net
25  {
26  public:
27  RegPixelMapProducer(unsigned int nPlane, unsigned int nCell,
28  unsigned int maxPlaneGap, bool useGeV);
29 
30 
31  /// Find vertex plane by requiring gaps are not wider than maxGap
32  unsigned int FindVertexMaxGap(const rb::Cluster& cluster);
33 
34  /// Find vertex plane by requiring gaps are not wider than maxGap
35  unsigned int FindVertexWindowThreshold(const rb::Cluster& cluster);
36 
37  /// Find center cell based on mean of hits in each view (2 views)
38  std::array<unsigned int, 2> FindCenterMedian(
39  const rb::Cluster& cluster,
40  unsigned int firstPlane);
41 
42 
43  /// Get boundaries for pixel map representation of cluster
44  Boundary DefineBoundary(const rb::Cluster& cluster);
45 
46  /// Check the boundaries for consistency with NPlane and NCell,
47  /// assert if inconsistent.
48  void CheckBoundary(const Boundary& bound);
49 
50 
51  /// Determine plane is within plane rcvne of a PixelMap
52  bool InPlaneRcvne(unsigned int plane, unsigned int firstPlane);
53 
54  /// Determine whether cell is within cell rcvne based on meanCell
55  bool InCellRcvne(unsigned int cell, float meanCell);
56 
57  unsigned int NPlane() const {return fNPlane;};
58  unsigned int NCell() const {return fNCell;};
59 
60  RegPixelMap CreateMap(const rb::Cluster& slice);
61 
63  const Boundary& bound);
64 
65  RegPixelMap CreateMapGivenVertex(const rb::Cluster& cluster, const Boundary& bound, unsigned int vtxPlane, unsigned int vtxXCell, unsigned int vtxYCell);// my
66  RegPixelMap CreateMapGivenVertex(const std::vector<art::Ptr<rb::Shower>> showers3D, const Boundary& bound, unsigned int vtxPlane, unsigned int vtxXCell, unsigned int vtxYCell);// my
67  RegPixelMap CreateMapGivenShowerVertex(const rb::Shower& shower, const Boundary& bound, unsigned int vtxPlane, unsigned int vtxXCell, unsigned int vtxYCell);// my
68 
69 
70 
71  private:
72  unsigned int fNPlane; ///< Number of planes, length for pixel maps
73  unsigned int fNCell; ///< Number of cells, width of pixel map
74 
75  /// Maximum gap in planes at front of cluster to prevent pruning of upstream
76  /// hits
77  unsigned int fMaxPlaneGap;
78  bool fUseGeV;
79 
80  };
81 
82 }
83 
84 #endif // CVN_REGPIXELMAPPRODUCER_H
unsigned int NCell() const
Boundary DefineBoundary(const rb::Cluster &cluster)
Get boundaries for pixel map representation of cluster.
Producer algorithm for RegPixelMap, input to CVN neural net.
A collection of associated CellHits.
Definition: Cluster.h:47
Defines an enumeration for prong classification.
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.
bool InCellRcvne(unsigned int cell, float meanCell)
Determine whether cell is within cell rcvne based on meanCell.
unsigned int FindVertexWindowThreshold(const rb::Cluster &cluster)
Find vertex plane by requiring gaps are not wider than maxGap.
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.
Definition: RegPixelMap.h:22
RegPixelMap CreateMapGivenVertex(const rb::Cluster &cluster, const Boundary &bound, unsigned int vtxPlane, unsigned int vtxXCell, unsigned int vtxYCell)
RegPixelMapProducer(unsigned int nPlane, unsigned int nCell, unsigned int maxPlaneGap, bool useGeV)
A rb::Prong with a length.
Definition: Shower.h:18
void CheckBoundary(const Boundary &bound)
unsigned int fNPlane
Number of planes, length for pixel maps.
RegPixelMap CreateMap(const rb::Cluster &slice)
bool InPlaneRcvne(unsigned int plane, unsigned int firstPlane)
Determine plane is within plane rcvne of a PixelMap.
RegPixelMap for Regression modified from Dominick&#39;s PixelMap.
unsigned int NPlane() const
unsigned int FindVertexMaxGap(const rb::Cluster &cluster)
Find vertex plane by requiring gaps are not wider than maxGap.
Definition: fwd.h:28