All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CRTEventDisplay.h
Go to the documentation of this file.
1 #ifndef CRTEVENTDISPLAY_H_SEEN
2 #define CRTEVENTDISPLAY_H_SEEN
3 
4 
5 ///////////////////////////////////////////////
6 // CRTEventDisplay.h
7 //
8 // Quick and dirty event display for SBND CRT
9 // T Brooks (tbrooks@fnal.gov), November 2018
10 ///////////////////////////////////////////////
11 
12 // framework
13 #include "art/Framework/Principal/Event.h"
14 #include "art/Framework/Core/ModuleMacros.h"
15 #include "fhiclcpp/ParameterSet.h"
16 #include "art/Framework/Principal/Handle.h"
17 #include "canvas/Persistency/Common/Ptr.h"
18 #include "art/Framework/Services/Registry/ServiceHandle.h"
19 #include "messagefacility/MessageLogger/MessageLogger.h"
20 #include "canvas/Persistency/Common/FindManyP.h"
21 
22 // LArSoft
25 #include "larcore/CoreUtils/ServiceUtil.h" // lar::providerFrom()
26 namespace detinfo { class DetectorClocksData; }
27 
28 // Utility libraries
29 #include "messagefacility/MessageLogger/MessageLogger.h"
30 #include "fhiclcpp/ParameterSet.h"
31 #include "fhiclcpp/types/Table.h"
32 #include "fhiclcpp/types/Atom.h"
33 
41 
42 // c++
43 #include <vector>
44 
45 // ROOT
46 #include "TVector3.h"
47 #include "TPolyMarker3D.h"
48 #include "TPolyLine3D.h"
49 #include "TCanvas.h"
50 #include "TF1.h"
51 #include "TLine.h"
52 #include "TMarker.h"
53 #include "TBox.h"
54 #include "TPad.h"
55 
56 
57 namespace sbnd{
58 
60  public:
61 
62  struct Config {
63  using Name = fhicl::Name;
64  using Comment = fhicl::Comment;
65 
66  fhicl::Atom<art::InputTag> SimLabel {
67  Name("SimLabel")
68  };
69  fhicl::Atom<art::InputTag> CRTDataLabel {
70  Name("CRTDataLabel")
71  };
72  fhicl::Atom<art::InputTag> CRTHitLabel {
73  Name("CRTHitLabel")
74  };
75  fhicl::Atom<art::InputTag> CRTTrackLabel {
76  Name("CRTTrackLabel")
77  };
78  fhicl::Atom<art::InputTag> TPCTrackLabel {
79  Name("TPCTrackLabel")
80  };
81  fhicl::Atom<double> ClockSpeedCRT {
82  Name("ClockSpeedCRT")
83  };
84 
85  fhicl::Atom<bool> DrawTaggers {
86  Name("DrawTaggers")
87  };
88  fhicl::Atom<bool> DrawModules {
89  Name("DrawModules")
90  };
91  fhicl::Atom<bool> DrawTpc {
92  Name("DrawTpc")
93  };
94  fhicl::Atom<bool> DrawCrtData {
95  Name("DrawCrtData")
96  };
97  fhicl::Atom<bool> DrawCrtHits {
98  Name("DrawCrtHits")
99  };
100  fhicl::Atom<bool> DrawCrtTracks {
101  Name("DrawCrtTracks")
102  };
103  fhicl::Atom<bool> DrawIncompleteTracks {
104  Name("DrawIncompleteTracks")
105  };
106  fhicl::Atom<bool> DrawTpcTracks {
107  Name("DrawTpcTracks")
108  };
109  fhicl::Atom<bool> DrawTrueTracks {
110  Name("DrawTrueTracks")
111  };
112 
113  fhicl::Atom<int> TaggerColour {
114  Name("TaggerColour")
115  };
116  fhicl::Atom<int> TpcColour {
117  Name("TpcColour")
118  };
119  fhicl::Atom<int> CrtDataColour {
120  Name("CrtDataColour")
121  };
122  fhicl::Atom<int> CrtHitColour {
123  Name("CrtHitColour")
124  };
125  fhicl::Atom<int> CrtTrackColour {
126  Name("CrtTrackColour")
127  };
128  fhicl::Atom<int> TpcTrackColour {
129  Name("TpcTrackColour")
130  };
131  fhicl::Atom<int> TrueTrackColour {
132  Name("TrueTrackColour")
133  };
134 
135  fhicl::Atom<bool> UseTrueID {
136  Name("UseTrueID")
137  };
138  fhicl::Atom<int> TrueID {
139  Name("TrueID")
140  };
141 
142  fhicl::Atom<bool> Print {
143  Name("Print")
144  };
145 
146  fhicl::Atom<double> LineWidth {
147  Name("LineWidth")
148  };
149  fhicl::Atom<double> IncompleteTrackLength {
150  Name("IncompleteTrackLength")
151  };
152  fhicl::Atom<double> MinTime {
153  Name("MinTime")
154  };
155  fhicl::Atom<double> MaxTime {
156  Name("MaxTime")
157  };
158 
159  fhicl::Table<CRTBackTracker::Config> CrtBackTrack {
160  Name("CrtBackTrack"),
161  };
162 
163  };
164 
165  CRTEventDisplay(const Config& config);
166 
167  CRTEventDisplay(const fhicl::ParameterSet& pset) :
168  CRTEventDisplay(fhicl::Table<Config>(pset, {})()) {}
169 
170  CRTEventDisplay();
171 
173 
174  void reconfigure(const Config& config);
175 
176  void SetDrawTaggers(bool tf);
177  void SetDrawTpc(bool tf);
178  void SetDrawCrtData(bool tf);
179  void SetDrawCrtHits(bool tf);
180  void SetDrawCrtTracks(bool tf);
181  void SetDrawTpcTracks(bool tf);
182  void SetDrawTrueTracks(bool tf);
183  void SetPrint(bool tf);
184 
185  void SetTrueId(int id);
186 
187  bool IsVisible(const simb::MCParticle& particle);
188 
189  void DrawCube(TCanvas *c1, double *rmin, double *rmax, int colour);
190 
191  void Draw(detinfo::DetectorClocksData const& clockData, const art::Event& event);
192 
193  private:
194 
197 
199 
200  art::InputTag fSimLabel;
201  art::InputTag fCRTDataLabel;
202  art::InputTag fCRTHitLabel;
203  art::InputTag fCRTTrackLabel;
204  art::InputTag fTPCTrackLabel;
205 
207 
210  bool fDrawTpc;
217 
225 
227  int fTrueID;
228 
229  bool fPrint;
230 
231  double fLineWidth;
233  double fMinTime;
234  double fMaxTime;
235 
236  };
237 
238 }
239 
240 #endif
art::InputTag fTPCTrackLabel
void Draw(detinfo::DetectorClocksData const &clockData, const art::Event &event)
bool IsVisible(const simb::MCParticle &particle)
fhicl::Atom< bool > DrawTpcTracks
Utilities related to art service access.
fhicl::Atom< double > IncompleteTrackLength
fhicl::Atom< int > TpcTrackColour
CRTEventDisplay(const Config &config)
Declaration of signal hit object.
fhicl::Atom< double > MinTime
fhicl::Atom< bool > DrawTaggers
fhicl::Atom< int > CrtDataColour
fhicl::Atom< int > TaggerColour
fhicl::Atom< int > CrtHitColour
fhicl::Atom< bool > DrawCrtTracks
void reconfigure(const Config &config)
fhicl::Atom< int > TrueTrackColour
void DrawCube(TCanvas *c1, double *rmin, double *rmax, int colour)
CRTBackTracker fCrtBackTrack
fhicl::Atom< bool > DrawTpc
CRTEventDisplay(const fhicl::ParameterSet &pset)
fhicl::Atom< art::InputTag > TPCTrackLabel
BEGIN_PROLOG vertical distance to the surface Name
fhicl::Atom< art::InputTag > CRTDataLabel
fhicl::Atom< bool > DrawTrueTracks
fhicl::Atom< double > MaxTime
fhicl::Atom< double > LineWidth
fhicl::Atom< art::InputTag > SimLabel
fhicl::Atom< double > ClockSpeedCRT
Provides recob::Track data product.
art::InputTag fCRTTrackLabel
void SetDrawCrtTracks(bool tf)
fhicl::Table< CRTBackTracker::Config > CrtBackTrack
void SetDrawTpcTracks(bool tf)
void SetDrawTaggers(bool tf)
art::InputTag fCRTDataLabel
fhicl::Atom< bool > UseTrueID
Contains all timing reference information for the detector.
void SetDrawTrueTracks(bool tf)
fhicl::Atom< bool > DrawModules
fhicl::Atom< int > CrtTrackColour
art::InputTag fCRTHitLabel
fhicl::Atom< bool > DrawCrtData
stream1 can override from command line with o or output services user sbnd
void SetDrawTpc(bool tf)
void SetDrawCrtHits(bool tf)
fhicl::Atom< bool > DrawIncompleteTracks
fhicl::Atom< art::InputTag > CRTHitLabel
fhicl::Atom< bool > DrawCrtHits
void SetDrawCrtData(bool tf)
fhicl::Atom< art::InputTag > CRTTrackLabel