LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
RecoBaseDrawer.h
Go to the documentation of this file.
1 #ifndef EVD_RECOBASEDRAWER_H
5 #define EVD_RECOBASEDRAWER_H
6 
7 #include <array>
8 #include <memory> // std::unique_ptr<>
9 #include <vector>
10 
11 namespace evdb {
12  class View2D;
13  class View3D;
14 }
15 
16 namespace evdb_tool {
17  class ISpacePoints3D;
18 }
19 
21 
22 namespace detinfo {
23  class DetectorClocksData;
24  class DetectorPropertiesData;
25 }
26 
29 namespace recob {
30  class Edge;
31  class Hit;
32  class Cluster;
33  class PCAxis;
34  class PFParticle;
35  class EndPoint2D;
36  class Prong;
37  class Track;
38  class Shower;
39  class Wire;
40  class Vertex;
41  class Seed;
42  class Event;
43  class OpFlash;
44 }
45 
46 namespace anab {
47  class CosmicTag;
48 }
49 
50 #include "art/Framework/Principal/ProductRetriever.h" // Missing from View.h
56 #include "fhiclcpp/fwd.h"
57 
58 class TVector3;
59 class TH1F;
60 
61 namespace evd {
62 
65  public:
67  ~RecoBaseDrawer();
68 
69  void Wire2D(const art::Event& evt, evdb::View2D* view, unsigned int plane);
70  int Hit2D(const art::Event& evt,
71  detinfo::DetectorPropertiesData const& detProp,
72  evdb::View2D* view,
73  unsigned int plane);
74  int Hit2D(std::vector<const recob::Hit*> hits,
75  int color,
76  evdb::View2D* view,
77  bool allWireIds,
78  bool drawConnectingLines = false,
79  int lineWidth = 1);
80  int Hit2D(std::vector<const recob::Hit*> hits, evdb::View2D* view, float cosmicscore);
81 
82  void EndPoint2D(const art::Event& evt, evdb::View2D* view, unsigned int plane);
83  void OpFlash2D(const art::Event& evt,
84  detinfo::DetectorClocksData const& clockData,
85  detinfo::DetectorPropertiesData const& detProp,
86  evdb::View2D* view,
87  unsigned int plane);
88 
89  void Seed2D(const art::Event& evt,
90  detinfo::DetectorPropertiesData const& detProp,
91  evdb::View2D* view,
92  unsigned int plane);
93 
94  void Draw2DSlopeEndPoints(double xStart,
95  double yStart,
96  double xEnd,
97  double yEnd,
98  double slope,
99  int color,
100  evdb::View2D* view);
101  void Draw2DSlopeEndPoints(double x, double y, double slope, int color, evdb::View2D* view);
102  void Draw2DSlopeEndPoints(double x,
103  double y,
104  double cosx,
105  double cosy,
106  int color,
107  evdb::View2D* view);
108  void Slice2D(const art::Event& evt,
109  detinfo::DetectorPropertiesData const& detProp,
110  evdb::View2D* view,
111  unsigned int plane);
112  void Cluster2D(const art::Event& evt,
113  detinfo::DetectorClocksData const& clockData,
114  detinfo::DetectorPropertiesData const& detProp,
115  evdb::View2D* view,
116  unsigned int plane);
117  void Prong2D(const art::Event& evt,
118  detinfo::DetectorClocksData const& clockData,
119  detinfo::DetectorPropertiesData const& detProp,
120  evdb::View2D* view,
121  unsigned int plane);
122  void DrawTrackVertexAssns2D(const art::Event& evt,
123  detinfo::DetectorClocksData const& clockData,
124  detinfo::DetectorPropertiesData const& detProp,
125  evdb::View2D* view,
126  unsigned int plane);
127  void DrawProng2D(detinfo::DetectorPropertiesData const& detProp,
128  std::vector<const recob::Hit*>& hits,
129  evdb::View2D* view,
130  unsigned int plane,
131  TVector3 const& startPos,
132  TVector3 const& startDir,
133  int id,
134  float cscore = -5);
135  void DrawTrack2D(detinfo::DetectorClocksData const& clockData,
136  detinfo::DetectorPropertiesData const& detProp,
137  std::vector<const recob::Hit*>& hits,
138  evdb::View2D* view,
139  unsigned int plane,
140  const recob::Track* track,
141  int color,
142  int lineWidth);
143  void Vertex2D(const art::Event& evt,
144  detinfo::DetectorPropertiesData const& detProp,
145  evdb::View2D* view,
146  unsigned int plane);
147 
148  void Event2D(const art::Event& evt, evdb::View2D* view, unsigned int plane);
149 
150  void SpacePoint3D(const art::Event& evt, evdb::View3D* view);
151  void PFParticle3D(const art::Event& evt, evdb::View3D* view);
152  void DrawPFParticle3D(const art::Ptr<recob::PFParticle>& pfPart,
153  const art::PtrVector<recob::PFParticle>& pfParticleVec,
154  const std::vector<art::Ptr<recob::SpacePoint>>& spacePointVec,
155  const art::FindManyP<recob::Edge>& edgeAssnsVec,
156  const art::FindManyP<recob::SpacePoint>& spacePointAssnsVec,
157  const art::FindManyP<recob::SpacePoint>& edgeSPAssnVec,
158  const art::FindManyP<recob::Hit>& spHitAssnVec,
159  const art::FindMany<recob::Track>& trackAssnVec,
160  const art::FindMany<recob::PCAxis>& pcAxisAssnVec,
161  const art::FindMany<anab::CosmicTag>& cosmicTagAssnVec,
162  int depth,
163  evdb::View3D* view);
164  void Edge3D(const art::Event& evt, evdb::View3D* view);
165  void Prong3D(const art::Event& evt, evdb::View3D* view);
166  void DrawTrack3D(const recob::Track& track,
167  evdb::View3D* view,
168  int color,
169  int marker = 1,
170  float size = 2.);
171  void DrawShower3D(const recob::Shower& shower, int color, evdb::View3D* view);
172  void Seed3D(const art::Event& evt, evdb::View3D* view);
173  void Vertex3D(const art::Event& evt, evdb::View3D* view);
174  void Event3D(const art::Event& evt, evdb::View3D* view);
175  void Slice3D(const art::Event& evt, evdb::View3D* view);
176  void OpFlashOrtho(const art::Event& evt,
177  detinfo::DetectorClocksData const& clockData,
178  detinfo::DetectorPropertiesData const& detProp,
180  evdb::View2D* view);
181  void VertexOrtho(const art::PtrVector<recob::Vertex>& vertex,
182  evd::OrthoProj_t proj,
183  evdb::View2D* view,
184  int marker);
185  void VertexOrtho(const art::Event& evt, evd::OrthoProj_t proj, evdb::View2D* view);
186  void SpacePointOrtho(const art::Event& evt,
187  evd::OrthoProj_t proj,
188  double msize,
189  evdb::View2D* view);
190  void PFParticleOrtho(const art::Event& evt,
191  evd::OrthoProj_t proj,
192  double msize,
193  evdb::View2D* view);
194  void DrawPFParticleOrtho(const art::Ptr<recob::PFParticle>& pfPart,
195  const art::PtrVector<recob::PFParticle>& pfParticleVec,
196  const art::FindMany<recob::SpacePoint>& spacePointAssnsVec,
197  const art::FindMany<recob::PCAxis>& pcAxisAssnVec,
198  int depth,
199  evd::OrthoProj_t proj,
200  evdb::View2D* view);
201  void ProngOrtho(const art::Event& evt, evd::OrthoProj_t proj, double msize, evdb::View2D* view);
202  void DrawSpacePointOrtho(std::vector<art::Ptr<recob::SpacePoint>>& spts,
203  int color,
204  evd::OrthoProj_t proj,
205  double msize,
206  evdb::View2D* view,
207  int mode = 0);
208  void DrawProngOrtho(const recob::Prong& prong,
209  int color,
210  evd::OrthoProj_t proj,
211  double msize,
212  evdb::View2D* view);
213  void DrawTrackOrtho(const recob::Track& track,
214  int color,
215  evd::OrthoProj_t proj,
216  double msize,
217  evdb::View2D* view);
218  void DrawShowerOrtho(const recob::Shower& shower,
219  int color,
220  evd::OrthoProj_t proj,
221  double msize,
222  evdb::View2D* view);
223  void SeedOrtho(const art::Event& evt, evd::OrthoProj_t proj, evdb::View2D* view);
224 
225  void FillTQHisto(const art::Event& evt, unsigned int plane, unsigned int wire, TH1F* histo);
226 
227  void FillQHisto(const art::Event& evt, unsigned int plane, TH1F* histo);
228 
229  void FillTQHistoDP(const art::Event& evt,
230  unsigned int plane,
231  unsigned int wire,
232  TH1F* histo,
233  std::vector<double>& htau1,
234  std::vector<double>& htau2,
235  std::vector<double>& hitamplitudes,
236  std::vector<double>& hpeaktimes,
237  std::vector<int>& hstartT,
238  std::vector<int>& hendT,
239  std::vector<int>& hNMultiHit,
240  std::vector<int>& hLocalHitIndex);
241 
242  int GetRegionOfInterest(int plane, int& minw, int& maxw, int& mint, int& maxt);
243 
244  void GetChargeSum(int plane, double& charge, double& convcharge);
245 
246  //double EvalExpoFit(double x,
247  // double tau1,
248  // double tau2,
249  // double amplitude,
250  // double peaktime);
251 
252  //double EvalMultiExpoFit(double x,
253  // int HitNumber,
254  // int NHits,
255  // std::vector<double> tau1,
256  // std::vector<double> tau2,
257  // std::vector<double> amplitude,
258  // std::vector<double> peaktime);
259 
260  private:
261  void GetClusterOutlines(std::vector<const recob::Hit*>& hits,
262  std::vector<double>& tpts,
263  std::vector<double>& wpts,
264  unsigned int plane);
265  int GetWires(const art::Event& evt,
266  const art::InputTag& which,
268  int GetHits(const art::Event& evt,
269  const art::InputTag& which,
270  std::vector<const recob::Hit*>& hits,
271  unsigned int plane);
272  int GetSlices(const art::Event& evt,
273  const art::InputTag& which,
275  int GetClusters(const art::Event& evt,
276  const art::InputTag& which,
278  int GetPFParticles(const art::Event& evt,
279  const art::InputTag& which,
281  int GetEndPoint2D(const art::Event& evt,
282  const art::InputTag& which,
284  int GetSpacePoints(const art::Event& evt,
285  const art::InputTag& which,
287  int GetEdges(const art::Event& evt,
288  const art::InputTag& which,
290 
291  int GetTracks(const art::Event& evt,
292  const art::InputTag& which,
293  art::View<recob::Track>& track);
294 
295  int GetShowers(const art::Event& evt,
296  const art::InputTag& which,
297  art::View<recob::Shower>& shower);
298 
299  int GetVertices(const art::Event& evt,
300  const art::InputTag& which,
302 
303  int GetSeeds(const art::Event& evt,
304  const art::InputTag& which,
306 
307  int GetOpFlashes(const art::Event& evt,
308  const art::InputTag& which,
310 
311  int GetEvents(const art::Event& evt,
312  const art::InputTag& which,
314 
315  float SpacePointChiSq(const std::vector<art::Ptr<recob::Hit>>&) const;
316 
317  std::vector<std::array<double, 3>> Circle3D(const TVector3& pos,
318  const TVector3& axisDir,
319  const double& radius);
320 
321  int CountHits(const art::Event& evt,
322  const art::InputTag& which,
323  unsigned int cryostat,
324  unsigned int tpc,
325  unsigned int plane);
326 
327  private:
328  using ISpacePointDrawerPtr = std::unique_ptr<evdb_tool::ISpacePoints3D>;
329 
332 
333  std::vector<int> fWireMin;
334  std::vector<int> fWireMax;
335  std::vector<int> fTimeMin;
336  std::vector<int> fTimeMax;
337 
338  std::vector<double> fRawCharge;
339  std::vector<double> fConvertedCharge;
340  };
341 }
342 
343 #endif
344 
Float_t x
Definition: compare.C:6
ISpacePointDrawerPtr fSpacePointDrawer
std::vector< double > fRawCharge
Sum of Raw Charge.
Reconstruction base classes.
ISpacePointDrawerPtr fAllSpacePointDrawer
Define OrthoProj_t enum for selecting orthographic view.
Aid in the rendering of RecoBase objects.
Float_t y
Definition: compare.C:6
boost::graph_traits< ModuleGraph >::edge_descriptor Edge
Definition: ModuleGraph.h:24
OrthoProj_t
Definition: OrthoProj.h:12
Manage all things related to colors for the event display.
std::vector< double > fConvertedCharge
Sum of Charge Converted using Birks&#39; formula.
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:101
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
std::unique_ptr< evdb_tool::ISpacePoints3D > ISpacePointDrawerPtr
void hits()
Definition: readHits.C:15
LArSoft includes.
long seed
Definition: chem4.cc:67
Float_t radius
Definition: plot.C:23
std::vector< int > fWireMax
highest wire in interesting region for each plane
Definition: fwd.h:46
General LArSoft Utilities.
std::vector< int > fWireMin
lowest wire in interesting region for each plane
std::vector< TCSlice > slices
Definition: DataStructs.cxx:13
std::size_t color(std::string const &procname)
Contains all timing reference information for the detector.
Float_t proj
Definition: plot.C:35
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
TCEvent evt
Definition: DataStructs.cxx:8
Float_t track
Definition: plot.C:35
Definition: Track.hh:42
std::vector< int > fTimeMax
highest time in interesting region for each plane
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49
Event finding and building.
std::vector< int > fTimeMin
lowest time in interesting region for each plane
vertex reconstruction