RegPixelMapProducer.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file RegPixelMapProducer.h
3 /// \brief RegPixelMapProducer for RegCNN modified from PixelMapProducer.h
4 /// \author Ilsoo Seong - iseong@uci.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef REGCNN_PIXELMAPPRODUCER_H
8 #define REGCNN_PIXELMAPPRODUCER_H
9 
10 
11 #include <array>
12 #include <vector>
13 
14 // Framework includes
18 #include "art_root_io/TFileDirectory.h"
19 #include "art_root_io/TFileService.h"
21 #include "fhiclcpp/ParameterSet.h"
25 #include "canvas/Persistency/Common/FindManyP.h"
26 
34 
35 namespace detinfo {
36  class DetectorClocksData;
37  class DetectorPropertiesData;
38 }
39 
40 //#include "art/Framework/Services/Registry/ServiceHandle.h"
42 
43 namespace cnn
44 {
45  /// Producer algorithm for RegPixelMap, input to CVN neural net
47  {
48  public:
49  RegPixelMapProducer(unsigned int nWire, unsigned int wRes, unsigned int nTdc, double tRes, int Global,
50  bool ProngOnly, bool ByHit);
51 
52  /// Get boundaries for pixel map representation of cluster
53  RegCNNBoundary DefineBoundary(detinfo::DetectorPropertiesData const& detProp,
55  RegCNNBoundary DefineBoundary(detinfo::DetectorPropertiesData const& detProp,
57  const std::vector<float> &vtx);
58 
59  /// Function to convert to a global unwrapped wire number
60  double GetGlobalWire(const geo::WireID& wireID);
61  void GetDUNEGlobalWireTDC(detinfo::DetectorPropertiesData const& detProp,
62  const geo::WireID& wireID, double localTDC,
63  unsigned int& globalWire, unsigned int& globalPlane,
64  double& globalTDC);
65 
66 
67  unsigned int NWire() const {return fNWire;};
68  unsigned int NTdc() const {return fNTdc;};
69  double TRes() const {return fTRes;};
70  double WRes() const {return fWRes;};
71 
72  RegPixelMap CreateMap(detinfo::DetectorClocksData const& clockData,
73  detinfo::DetectorPropertiesData const& detProp,
75  art::FindManyP<recob::Wire> const& fmwire);
76 
77  RegPixelMap CreateMap(detinfo::DetectorClocksData const& clockData,
78  detinfo::DetectorPropertiesData const& detProp,
80  art::FindManyP<recob::Wire> const& fmwire,
81  const std::vector<float> &vtx);
82 
83  RegPixelMap CreateMapGivenBoundary(detinfo::DetectorClocksData const& clockData,
84  detinfo::DetectorPropertiesData const& detProp,
86  const RegCNNBoundary& bound,
87  art::FindManyP<recob::Wire> const& fmwire);
88 
89  // tag prong by track
90  RegPixelMap CreateMap(detinfo::DetectorClocksData const& clockData,
91  detinfo::DetectorPropertiesData const& detProp,
93  art::FindManyP<recob::Wire> const& fmwire,
94  art::FindManyP<recob::Track> const& fmtrkhit,
95  const std::vector<float> &vtx);
96  RegPixelMap CreateMapGivenBoundaryByHit(detinfo::DetectorClocksData const& clockData,
97  detinfo::DetectorPropertiesData const& detProp,
99  const RegCNNBoundary& bound,
100  art::FindManyP<recob::Wire> const& fmwire,
101  art::FindManyP<recob::Track> const& fmtrkhit,
102  const bool& ProngOnly);
103 
104  // tag prong by shower
105  RegPixelMap CreateMap(detinfo::DetectorClocksData const& clockData,
106  detinfo::DetectorPropertiesData const& detProp,
108  art::FindManyP<recob::Wire> const& fmwire,
109  art::FindManyP<recob::Shower> const& fmshwhit,
110  const std::vector<float> &vtx);
111  RegPixelMap CreateMapGivenBoundaryByHit(detinfo::DetectorClocksData const& clockData,
112  detinfo::DetectorPropertiesData const& detProp,
114  const RegCNNBoundary& bound,
115  art::FindManyP<recob::Wire> const& fmwire,
116  art::FindManyP<recob::Shower> const& fmshwhit,
117  const bool& ProngOnly);
118 
119  void ShiftGlobalWire(std::vector< art::Ptr< recob::Hit > > const& cluster);
120 
121  private:
122 
123  unsigned int fNWire; ///< Number of wires, length for pixel maps
124  unsigned int fWRes;
125  unsigned int fNTdc; ///< Number of tdcs, width of pixel map
126  unsigned int fTRes;
129  bool fByHit;
130  double fOffset[2];
131  std::vector<int> hitwireidx; // collect hit wire
132  std::vector<int> tmin_each_wire;
133  std::vector<int> tmax_each_wire;
134  std::vector<float> trms_max_each_wire;
135 
137  };
138 
139 }
140 
141 #endif // REGCNN_PIXELMAPPRODUCER_H
RegPixelMap, basic input to CNN neural net.
Definition: RegPixelMap.h:22
struct vector vector
unsigned int NWire() const
Producer algorithm for RegPixelMap, input to CVN neural net.
Cluster finding and building.
art::ServiceHandle< geo::Geometry > geom
art framework interface to geometry description
std::vector< int > tmin_each_wire
unsigned int fNWire
Number of wires, length for pixel maps.
General LArSoft Utilities.
unsigned int fNTdc
Number of tdcs, width of pixel map.
std::vector< float > trms_max_each_wire
unsigned int NTdc() const
std::vector< int > hitwireidx
Defines an enumeration for cellhit classification.
std::vector< int > tmax_each_wire
Declaration of signal hit object.
Contains all timing reference information for the detector.
RegCNNBoundary for RegCNN PixelMap modified from CVNBoundary.h.
Provides recob::Track data product.
Declaration of basic channel signal object.
RegPixelMap for RegCNN modified from PixelMap.h.