LArSoft  v09_90_00
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  public:
70  void Wire2D(const art::Event& evt, evdb::View2D* view, unsigned int plane);
71  int Hit2D(const art::Event& evt,
72  detinfo::DetectorPropertiesData const& detProp,
73  evdb::View2D* view,
74  unsigned int plane);
75  int Hit2D(std::vector<const recob::Hit*> hits,
76  int color,
77  evdb::View2D* view,
78  bool allWireIds,
79  bool drawConnectingLines = false,
80  int lineWidth = 1);
81  int Hit2D(std::vector<const recob::Hit*> hits, evdb::View2D* view, float cosmicscore);
82 
83  void EndPoint2D(const art::Event& evt, evdb::View2D* view, unsigned int plane);
84  void OpFlash2D(const art::Event& evt,
85  detinfo::DetectorClocksData const& clockData,
86  detinfo::DetectorPropertiesData const& detProp,
87  evdb::View2D* view,
88  unsigned int plane);
89 
90  void Seed2D(const art::Event& evt,
91  detinfo::DetectorPropertiesData const& detProp,
92  evdb::View2D* view,
93  unsigned int plane);
94 
95  void Draw2DSlopeEndPoints(double xStart,
96  double yStart,
97  double xEnd,
98  double yEnd,
99  double slope,
100  int color,
101  evdb::View2D* view);
102  void Draw2DSlopeEndPoints(double x, double y, double slope, int color, evdb::View2D* view);
103  void Draw2DSlopeEndPoints(double x,
104  double y,
105  double cosx,
106  double cosy,
107  int color,
108  evdb::View2D* view);
109  void Slice2D(const art::Event& evt,
110  detinfo::DetectorPropertiesData const& detProp,
111  evdb::View2D* view,
112  unsigned int plane);
113  void Cluster2D(const art::Event& evt,
114  detinfo::DetectorClocksData const& clockData,
115  detinfo::DetectorPropertiesData const& detProp,
116  evdb::View2D* view,
117  unsigned int plane);
118  void Prong2D(const art::Event& evt,
119  detinfo::DetectorClocksData const& clockData,
120  detinfo::DetectorPropertiesData const& detProp,
121  evdb::View2D* view,
122  unsigned int plane);
123  void DrawTrackVertexAssns2D(const art::Event& evt,
124  detinfo::DetectorClocksData const& clockData,
125  detinfo::DetectorPropertiesData const& detProp,
126  evdb::View2D* view,
127  unsigned int plane);
128  void DrawProng2D(detinfo::DetectorPropertiesData const& detProp,
129  std::vector<const recob::Hit*>& hits,
130  evdb::View2D* view,
131  unsigned int plane,
132  TVector3 const& startPos,
133  TVector3 const& startDir,
134  int id,
135  float cscore = -5);
136  void DrawTrack2D(detinfo::DetectorClocksData const& clockData,
137  detinfo::DetectorPropertiesData const& detProp,
138  std::vector<const recob::Hit*>& hits,
139  evdb::View2D* view,
140  unsigned int plane,
141  const recob::Track* track,
142  int color,
143  int lineWidth);
144  void Vertex2D(const art::Event& evt,
145  detinfo::DetectorPropertiesData const& detProp,
146  evdb::View2D* view,
147  unsigned int plane);
148 
149  void Event2D(const art::Event& evt, evdb::View2D* view, unsigned int plane);
150 
151  void SpacePoint3D(const art::Event& evt, evdb::View3D* view);
152  void PFParticle3D(const art::Event& evt, evdb::View3D* view);
153  void DrawPFParticle3D(const art::Ptr<recob::PFParticle>& pfPart,
154  const art::PtrVector<recob::PFParticle>& pfParticleVec,
155  const std::vector<art::Ptr<recob::SpacePoint>>& spacePointVec,
156  const art::FindManyP<recob::Edge>& edgeAssnsVec,
157  const art::FindManyP<recob::SpacePoint>& spacePointAssnsVec,
158  const art::FindManyP<recob::SpacePoint>& edgeSPAssnVec,
159  const art::FindManyP<recob::Hit>& spHitAssnVec,
160  const art::FindMany<recob::Track>& trackAssnVec,
161  const art::FindMany<recob::PCAxis>& pcAxisAssnVec,
162  const art::FindMany<anab::CosmicTag>& cosmicTagAssnVec,
163  int depth,
164  evdb::View3D* view);
165  void Edge3D(const art::Event& evt, evdb::View3D* view);
166  void Prong3D(const art::Event& evt, evdb::View3D* view);
167  void DrawTrack3D(const recob::Track& track,
168  evdb::View3D* view,
169  int color,
170  int marker = 1,
171  float size = 2.);
172  void DrawShower3D(const recob::Shower& shower, int color, evdb::View3D* view);
173  void Seed3D(const art::Event& evt, evdb::View3D* view);
174  void Vertex3D(const art::Event& evt, evdb::View3D* view);
175  void Event3D(const art::Event& evt, evdb::View3D* view);
176  void Slice3D(const art::Event& evt, evdb::View3D* view);
177  void OpFlashOrtho(const art::Event& evt,
178  detinfo::DetectorClocksData const& clockData,
179  detinfo::DetectorPropertiesData const& detProp,
181  evdb::View2D* view);
182  void VertexOrtho(const art::PtrVector<recob::Vertex>& vertex,
183  evd::OrthoProj_t proj,
184  evdb::View2D* view,
185  int marker);
186  void VertexOrtho(const art::Event& evt, evd::OrthoProj_t proj, evdb::View2D* view);
187  void SpacePointOrtho(const art::Event& evt,
188  evd::OrthoProj_t proj,
189  double msize,
190  evdb::View2D* view);
191  void PFParticleOrtho(const art::Event& evt,
192  evd::OrthoProj_t proj,
193  double msize,
194  evdb::View2D* view);
195  void DrawPFParticleOrtho(const art::Ptr<recob::PFParticle>& pfPart,
196  const art::PtrVector<recob::PFParticle>& pfParticleVec,
197  const art::FindMany<recob::SpacePoint>& spacePointAssnsVec,
198  const art::FindMany<recob::PCAxis>& pcAxisAssnVec,
199  int depth,
200  evd::OrthoProj_t proj,
201  evdb::View2D* view);
202  void ProngOrtho(const art::Event& evt, evd::OrthoProj_t proj, double msize, evdb::View2D* view);
203  void DrawSpacePointOrtho(std::vector<art::Ptr<recob::SpacePoint>>& spts,
204  int color,
205  evd::OrthoProj_t proj,
206  double msize,
207  evdb::View2D* view,
208  int mode = 0);
209  void DrawProngOrtho(const recob::Prong& prong,
210  int color,
211  evd::OrthoProj_t proj,
212  double msize,
213  evdb::View2D* view);
214  void DrawTrackOrtho(const recob::Track& track,
215  int color,
216  evd::OrthoProj_t proj,
217  double msize,
218  evdb::View2D* view);
219  void DrawShowerOrtho(const recob::Shower& shower,
220  int color,
221  evd::OrthoProj_t proj,
222  double msize,
223  evdb::View2D* view);
224  void SeedOrtho(const art::Event& evt, evd::OrthoProj_t proj, evdb::View2D* view);
225 
226  void FillTQHisto(const art::Event& evt, unsigned int plane, unsigned int wire, TH1F* histo);
227 
228  void FillQHisto(const art::Event& evt, unsigned int plane, TH1F* histo);
229 
230  void FillTQHistoDP(const art::Event& evt,
231  unsigned int plane,
232  unsigned int wire,
233  TH1F* histo,
234  std::vector<double>& htau1,
235  std::vector<double>& htau2,
236  std::vector<double>& hitamplitudes,
237  std::vector<double>& hpeaktimes,
238  std::vector<int>& hstartT,
239  std::vector<int>& hendT,
240  std::vector<int>& hNMultiHit,
241  std::vector<int>& hLocalHitIndex);
242 
243  int GetRegionOfInterest(int plane, int& minw, int& maxw, int& mint, int& maxt);
244 
245  void GetChargeSum(int plane, double& charge, double& convcharge);
246 
247  //double EvalExpoFit(double x,
248  // double tau1,
249  // double tau2,
250  // double amplitude,
251  // double peaktime);
252 
253  //double EvalMultiExpoFit(double x,
254  // int HitNumber,
255  // int NHits,
256  // std::vector<double> tau1,
257  // std::vector<double> tau2,
258  // std::vector<double> amplitude,
259  // std::vector<double> peaktime);
260 
261  private:
262  void GetClusterOutlines(std::vector<const recob::Hit*>& hits,
263  std::vector<double>& tpts,
264  std::vector<double>& wpts,
265  unsigned int plane);
266  int GetWires(const art::Event& evt,
267  const art::InputTag& which,
269  int GetHits(const art::Event& evt,
270  const art::InputTag& which,
271  std::vector<const recob::Hit*>& hits,
272  unsigned int plane);
273  int GetSlices(const art::Event& evt,
274  const art::InputTag& which,
276  int GetClusters(const art::Event& evt,
277  const art::InputTag& which,
279  int GetPFParticles(const art::Event& evt,
280  const art::InputTag& which,
282  int GetEndPoint2D(const art::Event& evt,
283  const art::InputTag& which,
285  int GetSpacePoints(const art::Event& evt,
286  const art::InputTag& which,
288  int GetEdges(const art::Event& evt,
289  const art::InputTag& which,
291 
292  int GetTracks(const art::Event& evt,
293  const art::InputTag& which,
294  art::View<recob::Track>& track);
295 
296  int GetShowers(const art::Event& evt,
297  const art::InputTag& which,
298  art::View<recob::Shower>& shower);
299 
300  int GetVertices(const art::Event& evt,
301  const art::InputTag& which,
303 
304  int GetSeeds(const art::Event& evt,
305  const art::InputTag& which,
307 
308  int GetOpFlashes(const art::Event& evt,
309  const art::InputTag& which,
311 
312  int GetEvents(const art::Event& evt,
313  const art::InputTag& which,
315 
316  float SpacePointChiSq(const std::vector<art::Ptr<recob::Hit>>&) const;
317 
318  std::vector<std::array<double, 3>> Circle3D(const TVector3& pos,
319  const TVector3& axisDir,
320  const double& radius);
321 
322  int CountHits(const art::Event& evt,
323  const art::InputTag& which,
324  unsigned int cryostat,
325  unsigned int tpc,
326  unsigned int plane);
327 
328  private:
329  using ISpacePointDrawerPtr = std::unique_ptr<evdb_tool::ISpacePoints3D>;
330 
333 
334  std::vector<int> fWireMin;
335  std::vector<int> fWireMax;
336  std::vector<int> fTimeMin;
337  std::vector<int> fTimeMax;
338 
339  std::vector<double> fRawCharge;
340  std::vector<double> fConvertedCharge;
341  };
342 }
343 
344 #endif
345 
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