LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
PixelMapProducer.h
Go to the documentation of this file.
1 
7 #ifndef LCVN_PIXELMAPPRODUCER_H
8 #define LCVN_PIXELMAPPRODUCER_H
9 
10 #include <array>
11 #include <vector>
12 
13 // Framework includes
15 #include "fhiclcpp/ParameterSet.h"
16 
23 
29 
30 namespace lcvn {
31  typedef std::vector<std::map<double, double>> Waveform;
32 
33  class HitHelper {
34  public:
35  HitHelper(recob::Hit hit, double thresh = 0.) : fHit(hit), fThreshold(thresh)
36  {
38  }
39 
40  virtual Waveform GetWaveform();
41  virtual geo::WireID GetID();
42 
43  protected:
45  double fThreshold;
47  };
48 
49  class WireHelper {
50  public:
51  WireHelper(recob::Wire wire, double thresh = 0.) : fWire(wire), fThreshold(thresh) {}
52 
53  virtual Waveform GetWaveform();
54  virtual geo::WireID GetID();
55 
56  protected:
58  double fThreshold;
59  geo::WireReadoutGeom const* fWireReadoutGeom{
61  };
62 
64  public:
65  SimChannelHelper(sim::SimChannel simchan, double thresh = 0.)
66  : fSimchan(simchan), fThreshold(thresh)
67  {}
68 
69  virtual Waveform GetWaveform();
70  virtual geo::WireID GetID();
71 
72  protected:
74  double fThreshold;
75  geo::WireReadoutGeom const* fWireReadoutGeom{
77  };
78 
80  template <class T, class U>
82  public:
83  PixelMapProducer(unsigned int nWire, unsigned int nTdc, double tRes, double threshold = 0.);
84  PixelMapProducer() = default;
85 
86  // overload constructor for inputs from fcl
88 
89  unsigned int NWire() const { return fNWire; }
90  unsigned int NTdc() const { return fNTdc; }
91  double TRes() const { return fTRes; }
92  unsigned int TotHits() const { return fTotHits; }
93  double Threshold() const { return fThreshold; }
94  bool MultipleDrifts() const { return fMultipleDrifts; }
95 
96  void SetTotHits(unsigned int tothits) { fTotHits = tothits; }
97  void SetMultipleDrifts(bool multipledrifts = true) { fMultipleDrifts = multipledrifts; }
98 
100  virtual Boundary DefineBoundary(detinfo::DetectorPropertiesData const& detProp,
101  const std::vector<const T*>& cluster);
102 
103  virtual void ConvertLocaltoGlobal(geo::WireID wireid,
104  unsigned int& globalWire,
105  unsigned int& globalPlane) const;
106 
107  virtual void ConvertLocaltoGlobalTDC(geo::WireID wireid,
108  double localTDC,
109  unsigned int& globalWire,
110  unsigned int& globalPlane,
111  double& globalTDC) const;
112 
113  virtual PixelMap CreateMap(detinfo::DetectorPropertiesData const& detProp,
114  const std::vector<art::Ptr<T>>& cluster);
115  virtual PixelMap CreateMap(detinfo::DetectorPropertiesData const& detProp,
116  const std::vector<const T*>& cluster);
117 
118  virtual PixelMap CreateMapGivenBoundary(detinfo::DetectorPropertiesData const& detProp,
119  const std::vector<const T*>& cluster,
120  const Boundary& bound);
121 
122  private:
123  unsigned int fNWire;
124  unsigned int fNTdc;
125  double fTRes;
126  unsigned int fTotHits;
127  double fThreshold;
128  bool
130  };
131 
132  extern template class PixelMapProducer<recob::Hit, lcvn::HitHelper>;
135 
139 
140 }
141 
142 #endif // CVN_PIXELMAPPRODUCER_H
bool MultipleDrifts() const
PixelMapProducer< sim::SimChannel, lcvn::SimChannelHelper > PixelMapSimProducer
Energy deposited on a readout channel by simulated tracks.
Definition: SimChannel.h:136
virtual Waveform GetWaveform()
Declaration of signal hit object.
PixelMap, basic input to CVN neural net.
Definition: PixelMap.h:20
Utility class for truth labels.
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
Cluster finding and building.
double Threshold() const
PixelMap for CVN.
Producer algorithm for PixelMap, input to CVN neural net.
HitHelper(recob::Hit hit, double thresh=0.)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
Access the description of the physical detector geometry.
unsigned int NWire() const
WireHelper(recob::Wire wire, double thresh=0.)
SimChannelHelper(sim::SimChannel simchan, double thresh=0.)
PixelMapProducer< recob::Hit, lcvn::HitHelper > PixelMapHitProducer
Interface for a class providing readout channel mapping to geometry.
sim::SimChannel fSimchan
Description of the physical geometry of one entire detector.
Definition: GeometryCore.h:91
PixelMapProducer< recob::Wire, lcvn::WireHelper > PixelMapWireProducer
virtual geo::WireID GetID()
Detector simulation of raw signals on wires.
geo::GeometryCore const * fGeometry
double fThreshold
Charge threshold to consider for hits/waveforms etc.
unsigned int NTdc() const
unsigned int fNTdc
Number of tdcs, width of pixel map.
void SetMultipleDrifts(bool multipledrifts=true)
unsigned int fNWire
Number of wires, length for pixel maps.
void SetTotHits(unsigned int tothits)
object containing MC truth information necessary for making RawDigits and doing back tracking ...
unsigned int fTotHits
Total hits in the pixel map.
Class holding the regions of interest of signal from a channel.
Definition: Wire.h:116
Declaration of basic channel signal object.
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
double fTRes
Timing resolution for pixel map.
unsigned int TotHits() const
std::vector< std::map< double, double > > Waveform
Definition: fwd.h:26
art framework interface to geometry description
Boundary for CVN PixelMap.
bool fMultipleDrifts
True if making the pixel map requires handling for multiple drift regions.