PixelMapProducer.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file PixelMapProducer.h
3 /// \brief PixelMapProducer for CVN
4 /// \author Alexander Radovic - a.radovic@gmail.com
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef CVN_PIXELMAPPRODUCER_H
8 #define CVN_PIXELMAPPRODUCER_H
9 
10 
11 #include <array>
12 #include <vector>
13 
14 // Framework includes
16 
22 
26 
27 namespace cvn
28 {
29  /// Producer algorithm for PixelMap, input to CVN neural net
31  {
32  public:
33  PixelMapProducer(unsigned int nWire, unsigned int nTdc, double tRes);
35 
36  void SetUnwrapped(unsigned short unwrap){fUnwrapped = unwrap;};
37  void SetProtoDUNE(){fProtoDUNE = true;};
38 
39  /// Get boundaries for pixel map representation of cluster
41  const std::vector< const recob::Hit* >& cluster);
42 
43  /// Function to convert to a global unwrapped wire number
44  void GetDUNEGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int& globalWire, unsigned int& globalPlane) const;
46  unsigned int localWire, double localTDC, unsigned int plane, unsigned int tpc,
47  unsigned int& globalWire, unsigned int& globalPlane, double& globalTDC) const;
48 
50  unsigned int localWire, double localTDC, unsigned int plane, unsigned int tpc,
51  unsigned int& globalWire, unsigned int& globalPlane, double& globalTDC) const;
52  void GetProtoDUNEGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int& globalWire, unsigned int& globalPlane) const;
53  void GetProtoDUNEGlobalWireTDC(unsigned int localWire, double localTDC, unsigned int plane, unsigned int tpc,
54  unsigned int& globalWire, double& globalTDC, unsigned int& globalPlane) const;
55  // preliminary vert drift 3 view studies
56  void GetDUNEVertDrift3ViewGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int& globalWire, unsigned int& globalPlane) const;
57 
58 
59  unsigned int NWire() const {return fNWire;};
60  unsigned int NTdc() const {return fNTdc;};
61  double TRes() const {return fTRes;};
62 
64  const std::vector< art::Ptr< recob::Hit > >& slice);
66  const std::vector< const recob::Hit* >& slice);
67 
69  const std::vector< const recob::Hit* >& cluster,
70  const Boundary& bound);
71 
72  /// Create sparse pixel map for SCN applications
73  void GetHitTruth(detinfo::DetectorClocksData const& clockData,
74  art::Ptr<recob::Hit>& hit, std::vector<int>& pdgs, std::vector<int>& tracks,
75  std::vector<float>& energies, std::vector<std::string>& processes);
77  detinfo::DetectorPropertiesData const& detProp,
78  std::vector< art::Ptr< recob::Hit> >& cluster, bool usePixelTruth=false);
81 
82  private:
83  unsigned int fNWire; ///< Number of wires, length for pixel maps
84  unsigned int fNTdc; ///< Number of tdcs, width of pixel map
85  double fTRes; ///< Timing resolution for pixel map
86  unsigned short fUnwrapped; ///< Use unwrapped pixel maps?
87  bool fProtoDUNE; ///< Do we want to use this for particle extraction from protoDUNE?
88 
90  std::vector<double> fVDPlane0;
91  std::vector<double> fVDPlane1;
92  // std::vector<int> fPlane0GapWires;
93  // std::vector<int> fPlane1GapWires;
94 
95  double _getIntercept(geo::WireID wireid) const;
96  void _cacheIntercepts();
97  };
98 
99 }
100 
101 #endif // CVN_PIXELMAPPRODUCER_H
double fTRes
Timing resolution for pixel map.
unsigned short fUnwrapped
Use unwrapped pixel maps?
unsigned int NTdc() const
struct vector vector
Cluster finding and building.
PixelMap for CVN.
Utility class for truth labels.
unsigned int fNTdc
Number of tdcs, width of pixel map.
void GetDUNE10ktGlobalWireTDC(detinfo::DetectorPropertiesData const &detProp, unsigned int localWire, double localTDC, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane, double &globalTDC) const
PixelMap CreateMapGivenBoundary(detinfo::DetectorPropertiesData const &detProp, const std::vector< const recob::Hit * > &cluster, const Boundary &bound)
void GetProtoDUNEGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane) const
double _getIntercept(geo::WireID wireid) const
void SetUnwrapped(unsigned short unwrap)
bool fProtoDUNE
Do we want to use this for particle extraction from protoDUNE?
Description of geometry of one entire detector.
void GetProtoDUNEGlobalWireTDC(unsigned int localWire, double localTDC, unsigned int plane, unsigned int tpc, unsigned int &globalWire, double &globalTDC, unsigned int &globalPlane) const
Detector simulation of raw signals on wires.
std::vector< double > fVDPlane1
Definition: tracks.py:1
unsigned int fNWire
Number of wires, length for pixel maps.
Declaration of signal hit object.
void GetDUNEGlobalWireTDC(detinfo::DetectorPropertiesData const &detProp, unsigned int localWire, double localTDC, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane, double &globalTDC) const
Contains all timing reference information for the detector.
unsigned int NWire() const
SparsePixelMap CreateSparseMap2D(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< art::Ptr< recob::Hit > > &cluster, bool usePixelTruth=false)
PixelMap, basic input to CVN neural net.
Definition: PixelMap.h:22
void GetDUNEGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane) const
Function to convert to a global unwrapped wire number.
Sparse pixel map for CVN.
Access the description of detector geometry.
void GetDUNEVertDrift3ViewGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane) const
geo::GeometryCore const * fGeometry
SparsePixelMap CreateSparseMap3D(detinfo::DetectorClocksData const &clockData, std::vector< art::Ptr< recob::SpacePoint > > &sp, std::vector< std::vector< art::Ptr< recob::Hit >>> &hit)
Producer algorithm for PixelMap, input to CVN neural net.
Boundary DefineBoundary(detinfo::DetectorPropertiesData const &detProp, const std::vector< const recob::Hit * > &cluster)
Get boundaries for pixel map representation of cluster.
void GetHitTruth(detinfo::DetectorClocksData const &clockData, art::Ptr< recob::Hit > &hit, std::vector< int > &pdgs, std::vector< int > &tracks, std::vector< float > &energies, std::vector< std::string > &processes)
Create sparse pixel map for SCN applications.
Boundary for CVN PixelMap.
double TRes() const
std::vector< double > fVDPlane0
PixelMap CreateMap(detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit > > &slice)