All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RecoBaseDrawer.h
Go to the documentation of this file.
1 /// \file RecoBaseDrawer.h
2 /// \brief Class to aid in the rendering of RecoBase objects
3 /// \author messier@indiana.edu
4 #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 namespace art { class Event; }
51 #include "art/Framework/Principal/DataViewImpl.h" // Missing from View.h
52 #include "art/Framework/Principal/View.h"
53 #include "canvas/Persistency/Common/FindMany.h"
54 #include "canvas/Persistency/Common/FindManyP.h"
55 #include "canvas/Persistency/Common/PtrVector.h"
56 namespace fhicl { class ParameterSet; }
57 
58 class TVector3;
59 class TH1F;
60 
61 namespace evd {
62 
63  /// Aid in the rendering of RecoBase objects
65  public:
68 
69  public:
70  void Wire2D(const art::Event& evt, evdb::View2D* view, unsigned int plane);
71  int Hit2D(const art::Event& evt,
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,
180  evd::OrthoProj_t proj,
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); ///< 0: track, 1: shower
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,
268  art::PtrVector<recob::Wire>& wires);
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,
275  art::PtrVector<recob::Slice>& slices);
276  int GetClusters(const art::Event& evt,
277  const art::InputTag& which,
278  art::PtrVector<recob::Cluster>& clust);
279  int GetPFParticles(const art::Event& evt,
280  const art::InputTag& which,
281  art::PtrVector<recob::PFParticle>& pfpart);
282  int GetEndPoint2D(const art::Event& evt,
283  const art::InputTag& which,
284  art::PtrVector<recob::EndPoint2D>& ep2d);
285  int GetSpacePoints(const art::Event& evt,
286  const art::InputTag& which,
287  std::vector<art::Ptr<recob::SpacePoint>>& spts);
288  int GetEdges(const art::Event& evt,
289  const art::InputTag& which,
290  std::vector<art::Ptr<recob::Edge>>& edges);
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,
302  art::PtrVector<recob::Vertex>& vertex);
303 
304  int GetSeeds(const art::Event& evt,
305  const art::InputTag& which,
306  art::PtrVector<recob::Seed>& seed);
307 
308  int GetOpFlashes(const art::Event& evt,
309  const art::InputTag& which,
310  art::PtrVector<recob::OpFlash>& opflash);
311 
312  int GetEvents(const art::Event& evt,
313  const art::InputTag& which,
314  art::PtrVector<recob::Event>& event);
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; ///< lowest wire in interesting region for each plane
335  std::vector<int> fWireMax; ///< highest wire in interesting region for each plane
336  std::vector<int> fTimeMin; ///< lowest time in interesting region for each plane
337  std::vector<int> fTimeMax; ///< highest time in interesting region for each plane
338 
339  std::vector<double> fRawCharge; ///< Sum of Raw Charge
340  std::vector<double> fConvertedCharge; ///< Sum of Charge Converted using Birks' formula
341  };
342 }
343 
344 #endif
345 ////////////////////////////////////////////////////////////////////////
ISpacePointDrawerPtr fSpacePointDrawer
void SpacePointOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
process_name vertex
Definition: cheaterreco.fcl:51
void DrawShowerOrtho(const recob::Shower &shower, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
void SpacePoint3D(const art::Event &evt, evdb::View3D *view)
int GetTracks(const art::Event &evt, const art::InputTag &which, art::View< recob::Track > &track)
std::vector< double > fRawCharge
Sum of Raw Charge.
void FillTQHisto(const art::Event &evt, unsigned int plane, unsigned int wire, TH1F *histo)
void PFParticleOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
void DrawProng2D(detinfo::DetectorPropertiesData const &detProp, std::vector< const recob::Hit * > &hits, evdb::View2D *view, unsigned int plane, TVector3 const &startPos, TVector3 const &startDir, int id, float cscore=-5)
ISpacePointDrawerPtr fAllSpacePointDrawer
Define OrthoProj_t enum for selecting orthographic view.
Aid in the rendering of RecoBase objects.
process_name opflash particleana ie x
void Prong3D(const art::Event &evt, evdb::View3D *view)
float SpacePointChiSq(const std::vector< art::Ptr< recob::Hit >> &) const
void DrawPFParticle3D(const art::Ptr< recob::PFParticle > &pfPart, const art::PtrVector< recob::PFParticle > &pfParticleVec, const std::vector< art::Ptr< recob::SpacePoint >> &spacePointVec, const art::FindManyP< recob::Edge > &edgeAssnsVec, const art::FindManyP< recob::SpacePoint > &spacePointAssnsVec, const art::FindManyP< recob::SpacePoint > &edgeSPAssnVec, const art::FindManyP< recob::Hit > &spHitAssnVec, const art::FindMany< recob::Track > &trackAssnVec, const art::FindMany< recob::PCAxis > &pcAxisAssnVec, const art::FindMany< anab::CosmicTag > &cosmicTagAssnVec, int depth, evdb::View3D *view)
int GetSpacePoints(const art::Event &evt, const art::InputTag &which, std::vector< art::Ptr< recob::SpacePoint >> &spts)
void SeedOrtho(const art::Event &evt, evd::OrthoProj_t proj, evdb::View2D *view)
void Vertex3D(const art::Event &evt, evdb::View3D *view)
void Event3D(const art::Event &evt, evdb::View3D *view)
void ProngOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
int GetClusters(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Cluster > &clust)
std::size_t size(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:561
void DrawShower3D(const recob::Shower &shower, int color, evdb::View3D *view)
process_name use argoneut_mc_hitfinder track
Definition: Data.h:14
void DrawSpacePointOrtho(std::vector< art::Ptr< recob::SpacePoint >> &spts, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view, int mode=0)
0: track, 1: shower
void Edge3D(const art::Event &evt, evdb::View3D *view)
OrthoProj_t
Definition: OrthoProj.h:12
int GetEvents(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Event > &event)
void Prong2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
process_name shower
Definition: cheaterreco.fcl:51
Definition: Data.h:7
std::vector< double > fConvertedCharge
Sum of Charge Converted using Birks&#39; formula.
void Slice2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
void Cluster2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
void DrawTrackVertexAssns2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
void Seed3D(const art::Event &evt, evdb::View3D *view)
int CountHits(const art::Event &evt, const art::InputTag &which, unsigned int cryostat, unsigned int tpc, unsigned int plane)
std::unique_ptr< evdb_tool::ISpacePoints3D > ISpacePointDrawerPtr
void Seed2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
process_name opflash particleana ie ie y
int GetEndPoint2D(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::EndPoint2D > &ep2d)
void DrawProngOrtho(const recob::Prong &prong, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
void FillTQHistoDP(const art::Event &evt, unsigned int plane, unsigned int wire, TH1F *histo, std::vector< double > &htau1, std::vector< double > &htau2, std::vector< double > &hitamplitudes, std::vector< double > &hpeaktimes, std::vector< int > &hstartT, std::vector< int > &hendT, std::vector< int > &hNMultiHit, std::vector< int > &hLocalHitIndex)
void PFParticle3D(const art::Event &evt, evdb::View3D *view)
const char mode
Definition: noise_ana.cxx:20
void Draw2DSlopeEndPoints(double xStart, double yStart, double xEnd, double yEnd, double slope, int color, evdb::View2D *view)
int Hit2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
int GetSlices(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Slice > &slices)
void Slice3D(const art::Event &evt, evdb::View3D *view)
unsigned int seed
void DrawTrack2D(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, std::vector< const recob::Hit * > &hits, evdb::View2D *view, unsigned int plane, const recob::Track *track, int color, int lineWidth)
std::vector< int > fWireMax
highest wire in interesting region for each plane
int GetHits(const art::Event &evt, const art::InputTag &which, std::vector< const recob::Hit * > &hits, unsigned int plane)
std::vector< std::array< double, 3 > > Circle3D(const TVector3 &pos, const TVector3 &axisDir, const double &radius)
int GetWires(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Wire > &wires)
int GetOpFlashes(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::OpFlash > &opflash)
int GetSeeds(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Seed > &seed)
int GetShowers(const art::Event &evt, const art::InputTag &which, art::View< recob::Shower > &shower)
std::vector< int > fWireMin
lowest wire in interesting region for each plane
void GetChargeSum(int plane, double &charge, double &convcharge)
std::vector< TCSlice > slices
Definition: DataStructs.cxx:13
void DrawTrack3D(const recob::Track &track, evdb::View3D *view, int color, int marker=1, float size=2.)
Contains all timing reference information for the detector.
void FillQHisto(const art::Event &evt, unsigned int plane, TH1F *histo)
int GetPFParticles(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::PFParticle > &pfpart)
void EndPoint2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
void Wire2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
void DrawPFParticleOrtho(const art::Ptr< recob::PFParticle > &pfPart, const art::PtrVector< recob::PFParticle > &pfParticleVec, const art::FindMany< recob::SpacePoint > &spacePointAssnsVec, const art::FindMany< recob::PCAxis > &pcAxisAssnVec, int depth, evd::OrthoProj_t proj, evdb::View2D *view)
void OpFlash2D(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
int GetRegionOfInterest(int plane, int &minw, int &maxw, int &mint, int &maxt)
void Event2D(const art::Event &evt, evdb::View2D *view, unsigned int plane)
void GetClusterOutlines(std::vector< const recob::Hit * > &hits, std::vector< double > &tpts, std::vector< double > &wpts, unsigned int plane)
void OpFlashOrtho(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evd::OrthoProj_t proj, evdb::View2D *view)
TCEvent evt
Definition: DataStructs.cxx:8
void Vertex2D(const art::Event &evt, detinfo::DetectorPropertiesData const &detProp, evdb::View2D *view, unsigned int plane)
void DrawTrackOrtho(const recob::Track &track, int color, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
std::vector< int > fTimeMax
highest time in interesting region for each plane
int GetVertices(const art::Event &evt, const art::InputTag &which, art::PtrVector< recob::Vertex > &vertex)
auto const detProp
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track:
void VertexOrtho(const art::PtrVector< recob::Vertex > &vertex, evd::OrthoProj_t proj, evdb::View2D *view, int marker)
int GetEdges(const art::Event &evt, const art::InputTag &which, std::vector< art::Ptr< recob::Edge >> &edges)
std::vector< int > fTimeMin
lowest time in interesting region for each plane