All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SEAviewer.h
Go to the documentation of this file.
1 #ifndef SBNCODE_SINGLEPHOTONANALYSIS_SEAVIEWER_H
2 #define SBNCODE_SINGLEPHOTONANALYSIS_SEAVIEWER_H
3 
4 #include <iostream>
5 
6 #include "art/Framework/Core/EDProducer.h"
7 #include "art/Framework/Core/ModuleMacros.h"
8 #include "art/Framework/Principal/Event.h"
9 #include "art/Framework/Principal/Handle.h"
10 #include "art/Framework/Principal/Run.h"
11 #include "art/Framework/Principal/SubRun.h"
12 #include "canvas/Utilities/InputTag.h"
13 #include "fhiclcpp/ParameterSet.h"
14 #include "messagefacility/MessageLogger/MessageLogger.h"
15 
26 #include <string>
27 
28 #include <memory>
29 
35 
36 #include "canvas/Utilities/ensurePointer.h"
37 #include "canvas/Persistency/Common/FindManyP.h"
38 #include "canvas/Persistency/Common/FindMany.h"
39 #include "canvas/Persistency/Common/FindOneP.h"
40 #include "canvas/Persistency/Common/FindOne.h"
41 
42 #include "TCanvas.h"
43 #include "TGraph.h"
44 #include "TFile.h"
45 #include "TAxis.h"
46 #include "TLine.h"
47 #include "TLatex.h"
48 #include "TLegend.h"
49 #include "TPrincipal.h"
50 #include "TFitResultPtr.h"
51 #include "TVectorD.h"
52 #include "TMatrixD.h"
53 #include "TF1.h"
54 #include "TH1D.h"
55 #include "TEllipse.h"
56 #include "TRandom3.h"
57 
58 #include <iostream>
59 #include <fstream>
60 #include <sstream>
61 #include <iomanip>
62 #include <string>
63 #include <numeric>
64 #include <algorithm>
65 #include <map>
66 #include <sys/stat.h>
67 
68 
69 #include "seaDBSCAN.h"
70 namespace seaview {
71 
72  class SEAviewer;
73 
74  template <typename T>
75  std::vector<size_t> seaview_sort_indexes(const std::vector<T> &v) {
76 
77  std::vector<size_t> idx(v.size());
78  std::iota(idx.begin(), idx.end(), 0); //fill the range with sequentially increasing values
79 
80  // sort indexes based on comparing values in v (descending order)
81  std::sort(idx.begin(), idx.end(), [&v](size_t i1, size_t i2) {return v[i1] > v[i2];});
82 
83  return idx;
84  }
85 
86 
87 
88  struct cluster_score{
89  int plane;
91  double point_score;
92  int n_hits;
93 
94  double mean_wire;
95  double max_wire;
96  double min_wire;
97  double mean_tick;
98  double max_tick;
99  double min_tick;
100 
101  double close_tick;
102  double close_wire;
103  double angle;//w.r.t shower primary
104 
106 
113 
114  double mean_dist;
115  double max_dist;
116  double min_dist;
117 
118  double pca_0;
119  double pca_1;
120  double pca_theta;
121 
122  int n_wires; /* number of wires spanned by the cluster */
123  int n_ticks; /* number of ticks spanned by the cluster */
124 
125  bool pass;
126 
127  cluster_score(int ip, int cl): plane(ip), cluster_label(cl){};
128  }; //end of cluster_score class
129 
130 
131 
132 
133  class cluster {
134  friend class SEAviewer;
135 
136  public:
137 
138  cluster(int ID, int plane, std::vector<std::vector<double>> &pts, std::vector<art::Ptr<recob::Hit>> &hits) :f_ID(ID), f_plane(plane), f_pts(pts), f_hits(hits), f_score(0,0), f_shower_remerge(-1){
139 
140  f_npts = f_pts.size();
141  if(pts.size() != hits.size()){
142  std::cerr<<"seaviewer::cluster, input hits and pts not alligned"<<std::endl;
143  }
144  std::vector<double> wires(f_npts);
145  std::vector<double> ticks(f_npts);
146  for(int p =0; p< f_npts; ++p){
147  wires[p]=f_pts[p][0];
148  ticks[p]=f_pts[p][1];
149  }
150  TGraph af_graph(f_npts, &wires[0], &ticks[0]);
151  f_graph = af_graph;
152 
153  };
154  int setScore(cluster_score &in_score){ f_score = in_score;return 0;}
155  void setLegend(const std::string &in_leg){
156  f_legend = in_leg;
157  }
158 
161  bool isTrackAnalyzed() const {return f_track_treated; }
163  int getID() const {return f_ID;}
164  int getPlane() const {return f_plane; }
165  std::vector<std::vector<double>> getPTS() const {return f_pts;}
166  TGraph * getGraph(){ return &f_graph;}
167  TH1D* getADCHist() {return &f_ADC_hist;}
168  const TGraph * getGraph() const { return &f_graph;}
169  const std::string &getLegend() const {return f_legend; }
170  const std::vector<art::Ptr<recob::Hit>>& getHits(){return f_hits;}
171  int getShowerRemerge() const {return f_shower_remerge;}
172  int setShowerRemerge(int remerge_in){
173  f_shower_remerge = remerge_in;
174  return f_shower_remerge;
175  }
176  double getMeanADC() const { return f_meanADC; }
177  double getADCrms() const {return f_ADC_RMS;}
178 
179  //----------------------- second-shower relatd function -----------------------
180  void setImpactParam(double d) {f_ImpactParameter = d; }
181 
182  /* brief: set the angle between direction of second shower candidate cluster and direction of the primary shower*/
183  void setAngleWRTShower(double d) {f_AngleWRTShower = d;}
184  void setFitSlope(double d) { f_FitSlope = d;}
185  void setFitCons(double d) { f_FitCons = d;}
186  double getAngleWRTShower() const {return f_AngleWRTShower;}
187  double getFitSlope() const {return f_FitSlope; }
188  double getFitCons() const {return f_FitCons;}
189  double getImpactParam() const {return f_ImpactParameter; }
190 
191 
192  // ----------------------- track search related function -----------------------
195  double getMinHitIOC() const {return f_min_ioc_to_shower_start;}
196  double getIOCbasedLength() const {return f_ioc_based_length; }
197  size_t getTrackStartIdx() const {return start_hit_idx; }
198  size_t getTrackEndIdx() const {return end_hit_idx;}
199  double getMeanADCFirstHalf() const { return f_mean_ADC_first_half; }
203  double getLinearChi() const {return f_fit_chi2; }
204 
205  /* brief: check if this cluster is fully in given slice or not
206  * return: 1 -> Fully in given Slice; -1 --> Fully not in given slice; 0: parts in given slices, parts not
207  */
208  int InNuSlice(const std::map<int, std::vector<art::Ptr<recob::Hit>> >& sliceIDToHitsMap, int nuSliceID);
209 
210  // determine if the cluster is within the plot range
211  // tick_max, tick_min, wire_max, and wire_min are the edges of the X axis(wire) and Y axis(tick)
212  bool InRange(double tick_max, double tick_min, double wire_max, double wire_min) const{
213  return f_score.min_wire < wire_max && f_score.max_wire > wire_min && f_score.max_tick > tick_min && f_score.min_tick < tick_max;
214  }
215 
216 
217  private:
218  int f_ID;
219  int f_npts;
220  int f_plane;
221  bool f_track_treated = false; //boolean indicating whether the hits have been analyzed as track candidate
222 
223  std::vector<std::vector<double>> f_pts; //vector of {wire, tick} pairs of all the hits
224  std::vector<art::Ptr<recob::Hit>> f_hits;
225  std::vector<int> f_hit_group; //group the hits in two groups: first half, second half (directionality-wise)
227  int f_shower_remerge = -1; //index of the reco shower if the cluseter is close enough to a reco shower, otherwise -1.
228  TGraph f_graph; //2D {wire, tick} graph
229  TH1D f_ADC_hist; // histograms of ADC of every hit
230  std::string f_legend; //legend of the f_graph
231 
232 
233  // -------- track-like properties -------------------------
234 
235  //add a few parameters that are useful to find tracks in no recob::track events
236  double f_min_impact_parameter_to_shower = 1e10; // mininum impact parameter of hits to the recob::shower direction
237  // will be default value if the cluster didn't pass cut on ssscore
238  double f_min_conversion_dist_to_shower_start = 1e10; //minimum distance of hits to the recob::shower start
239  double f_min_ioc_to_shower_start = 1e10; //minimum ioc of all hits to the recob::shower direction
240  double f_ioc_based_length = -1.0; // length of the cluster, calculated based on the IOC of hits
242 
243  size_t start_hit_idx = SIZE_MAX; //index of the start hit
244  size_t end_hit_idx = SIZE_MAX; //index of the end hit
245  double f_mean_ADC_first_half = 0.0;
248 
249  double f_angle_wrt_shower_direction = -1.0; // angle between the cluster direction and the shower direction, in radian
250  // for track search, for proton track veto
251  double f_fit_chi2 = 0.0; //chi2 of the linear fit to the cluster (2D)
252  double f_ADC_RMS = -1.0; //RMS of the summed ADC of hits
253  double f_meanADC = -1.0; // mean of hits ADC
254 
255 
256  //-------- shower-like properties -------------------------------
257 
258  double f_ImpactParameter = -1.0; //impact parameter of the vertex wrt to the cluster
259  double f_FitSlope = 0.0; //slope of the fitted shower/cluster direction
260  double f_FitCons = 0.0; //intercept of the fitted shower/cluster direction
261 
262  double f_AngleWRTShower = -1.0; //angle between cluster-vertex direction and primary_shower_start-vertex direction, assuming cluster and primary shower both point back to the vertex
263  // specific for second shower search for 1g1p analysis
264 
265  }; // end of class cluster
266 
267 
268  class SEAviewer {
269 
270  public:
271 
272  //constructor
273  //Keng, DetectorProperties--> DetectorPropertiesData
275 
276  void configure(const fhicl::ParameterSet& pset){};
277 
278  int loadVertex(double m_vertex_pos_x, double m_vertex_pos_y, double m_vertex_pos_z);
279  int addTrueVertex(double x, double y,double z);
280 
281  /* @brief: add all the given hits to be considered for clustering
282  * @note: these hits are subject to further selection by filterConsideredHits() before clustering
283  */
284  int addHitsToConsider(std::vector<art::Ptr<recob::Hit>>& hits);
285  int addAllHits(std::vector<art::Ptr<recob::Hit>>& hits);
286 
287  /* @brief: filter given hits before further clustering - only use hits near vertex for clustering
288  * @param: dist_to_vertex - distance to vertex in cm
289  */
290  int filterConsideredHits(double dist_to_vertex);
291 
292  /* @brief: add hits for PFParticles
293  * @param: leg - legend for this PFParticle, for plotting purposes
294  * @param: if leg is 'shower', arg1 expects shower energy; arg2 expects conversion distance; arg3 expects impact parameter
295  * @param: if leg is 'track', arg1 expects track length; arg2 expects PCA; arg3 currently not used
296  */
297  int addPFParticleHits(std::vector<art::Ptr<recob::Hit>>& hits, std::string leg , double arg1 = 0.0, double arg2 = 0.0, double arg3=0.0);
298  int setBadChannelList(std::vector<std::pair<int,int>> &in);
299  int addShower(art::Ptr<recob::Shower>&shr);
300  int addTrack(art::Ptr<recob::Track>&trk);
301  std::vector<int> calcUnassociatedHits();
302  int setHitThreshold(double);
303  int Print(double plot_distance);
304  int runseaDBSCAN(double min_pts, double eps);
305 
306  double calcWire(double Y, double Z, int plane, int fTPC, int fCryostat, geo::GeometryCore const& geo ){
307  //WireCoordinate returns the index of the nearest wire to the specified position.
308  double wire = geo.WireCoordinate(Y, Z, plane, fTPC, fCryostat);
309  return wire;
310  }
311 
312  double calcTime(double X,int plane,int fTPC,int fCryostat, detinfo::DetectorPropertiesData const& detprop){
313  double time = detprop.ConvertXToTicks(X, plane, fTPC,fCryostat);
314  return time;
315  }
316 
317  /* @brief: given a 3D space point, calculate the [wire, tick] of the point on 3 planes */
318  std::vector<std::vector<double>> to2D(std::vector<double> & threeD);
319 
320 
321  /* @brief: given two points on a line, and another point (in 2D space), calculate the impact parameter
322  * @param: 3 parameter of std::vector<double> are {wire, tick} vectors
323  */
324  double dist_line_point( const std::vector<double>&X1, const std::vector<double>& X2, const std::vector<double>& point);
325 
326 
327  //distance between two {wire, tick} points, in cm
328  double dist_point_point(double w1, double t1, double w2, double t2) const{
329  return sqrt(pow(w1*wire_con-w2*wire_con,2)+pow(t1*tick_con-t2*tick_con,2));
330  }
331 
332 
333  //@brief: given a cluster, loop through all its hits, calc and update info on mean ADC, ADC RMS.
335 
336  // @brief: given primary shower, analyze all the clusters in a track-like way with the assumtion that primary shower will point back to the cluster
337  // @param: vec_c: vector of clusters to be filled
338  std::vector<double> analyzeTrackLikeClusters(double eps, const std::map<art::Ptr<recob::Shower>, art::Ptr<recob::PFParticle>> & showerToPFParticleMap, const std::map<art::Ptr<recob::PFParticle>, std::vector<art::Ptr<recob::Hit>> > & pfParticleToHitsMap, std::vector<seaview::cluster> &vec_c );
339 
340 
341  // @brief: given primary shower, analyze all the clusters, draw them on the canvas, together with fitted direction of the cluseter (with the assumption that the cluster and primary shower both pointing back to the vertex)
342  // @param: vec_c: vector of clusters to be filled
343  std::vector<double> analyzeShowerLikeClusters(double eps, const std::map<art::Ptr<recob::Shower>, art::Ptr<recob::PFParticle>> & showerToPFParticleMap, const std::map<art::Ptr<recob::PFParticle>, std::vector<art::Ptr<recob::Hit>> > & pfParticleToHitsMap, std::vector<seaview::cluster> &vec_c );
344 
345 
346  // @brief: analyze cluster cl as a track candidate, and save track-related information in the cluster object
347  // @param: shower_start_pt_2D, shower_other_pt_2D: {wire, tick} coordinate of shower start, and another point on shower direction line, projected to the plane cl is on.
348  void TrackLikeClusterAnalyzer(cluster &cl, const std::vector<double> &shower_start_pt_2D, const std::vector<double> &shower_other_pt_2D);
349 
350 
351  // @brief: check if there is a hit in hitz close enought to one of the reco showers, if so return the index of that reco shower
352  // @param: hitz is usually a cluster of unassociated hits
353  int SeaviewCompareToShowers(int p ,int cl, std::vector<art::Ptr<recob::Hit>>& hitz,double vertex_wire,double vertex_tick, std::vector<art::Ptr<recob::Shower>>& showers, const std::map<art::Ptr<recob::Shower>, art::Ptr<recob::PFParticle>> & showerToPFParticleMap, const std::map<art::Ptr<recob::PFParticle>, std::vector<art::Ptr<recob::Hit>> > & pfParticleToHitsMap, double eps);
354 
355  // Guanqun: @brief: analyze a cluster of hits and summarize its property into an cluster_score
356  // argument shower is not used in the function body
357  cluster_score SeaviewScoreCluster(int p, int cl, std::vector<art::Ptr<recob::Hit>> &hits, double vertex_wire, double vertex_tick, const art::Ptr<recob::Shower> &shower);
358 
359  //@ brief: as name says, get Npts hits that're nearest from vertex
360  // return the {wire, tick} info of these hits as a TGraph
361  TGraph* SeaviewGetNearestNpts(int p, int cl, std::vector<art::Ptr<recob::Hit>> &hitz, double vertex_wire, double vertex_tick, int Npts);
362 
363  void SetClusterLegend(int cluster, double energy, int is_matched, int matched_pdg, double overlay_fraction);
364 
365 
366 
367  //conversion from wire, tick to cm
368  static constexpr double wire_con = 0.3;
369  static constexpr double tick_con = 1.0/25.0;
370 
371  protected:
372 
373  int n_pfps; // num of PFParticles (including shower & track)
374  int n_showers; //num of showers
375  int n_tracks; //num of tracks
376 
377  std::string tag;
380  // PFP, Plane: index
381  std::vector<std::vector<TGraph>> vec_graphs; //vector of graphs of [tick vs. wire] for hits of PFParticles.
382 
383  std::vector<std::string> vec_pfp_legend; //legend for each PFParticle, for plotting purpose
384  // PFP, Plane: index
385  std::vector<std::vector<std::vector<double>>> vec_ticks; //vector of ticks on each plane for all PFParticles
386  std::vector<std::vector<std::vector<double>>> vec_chans; //vector of wires on each plane for all PFParticle
387 
390 
391  double tick_shift;
392  double chan_shift;
393 
394  double tick_max; //min, max tick of all hits
395  double tick_min;
396  std::vector<double> chan_max; //min, max wire of all (including vertex)
397  std::vector<double> chan_min;
398 
399  std::vector<std::pair<int,int>> m_bad_channel_list;
400 
401  //Vertex, size of 3 (on 3 planes)
402  std::vector<double> vertex_tick;
403  std::vector<double> vertex_chan;
404  std::vector<TGraph> vertex_graph;
405 
407  //True vertex, size of 3
408  std::vector<double> true_vertex_tick;
409  std::vector<double> true_vertex_chan;
410  std::vector<TGraph> true_vertex_graph;
411 
412  //std::vector<art::Ptr<recob::Hit>> considered_hits; //all hits considered for clustering
413  //std::vector<art::Ptr<recob::Hit>> all_hits;
414  std::map<art::Ptr<recob::Hit>,bool> map_unassociated_hits;
415  std::map<art::Ptr<recob::Hit>, bool> map_considered_hits;
416 
417  //Plane: index
418  std::vector<TGraph> vec_unass_graphs; //graph of [tick vs wire] for unassociated hits that pass the hit threshold
419  std::vector<std::vector<double>> vec_unass_ticks; //tick of unassso hits that pass threshold
420  std::vector<std::vector<double>> vec_unass_chans;
421  std::vector<std::vector<std::vector<double>>> vec_unass_pts; // [wire, tick] pair for unassociatd hits that pass threshold on each plane
422  std::vector<std::vector<art::Ptr<recob::Hit>>> vec_unass_hits; //vector of unasso hits that pss hit threshold on each plane
423 
424 
425  //Plane: index
426  std::vector<TGraph> vec_all_graphs; //graph of [tick vs wire] for all hits that are not in the slice
427  std::vector<std::vector<double>> vec_all_ticks; //tick of all hits that are not in the slice (grouped by plane #)
428  std::vector<std::vector<double>> vec_all_chans; //wire of all hits that are not in the slice on each plane.
429 
430  std::vector<int> num_clusters; //number of clusters for unassociated hits on each plane
431  std::vector<std::vector<int>> cluster_labels; //one-to-one mapped cluster labels for unassociated hits in `vec_unass_pts`
432  TRandom3 *rangen;
433 
434  // all clusters on all 3 planes, each cluster includes points/hits identified for that cluster
435  std::vector<seaview::cluster> vec_clusters;
436  std::vector<art::Ptr<recob::Shower>> vec_showers; //vector of recob::Shower contained in this class
437  std::vector<art::Ptr<recob::Track>> vec_tracks;
438 
439  //-----helper function-----------
440 
441  // form legend for recob::shower and recob::track objects
442  void format_legend(std::string &leg, double arg1 = 0.0, double arg2 = 0.0, double arg3 = 0.0);
443 
444  };
445 
446  //define wire conversion, tick conversion factor
447  constexpr double SEAviewer::wire_con;
448  constexpr double SEAviewer::tick_con;
449 
450 }// namespace
451 
452 #endif // SBNCODE_SINGLEPHOTONANALYSIS_SEAVIEWER_H
453 
cluster_score * getScore()
Definition: SEAviewer.h:162
geo::Length_t WireCoordinate(double YPos, double ZPos, geo::PlaneID const &planeid) const
Returns the index of the nearest wire to the specified position.
double f_mean_ADC_second_half
Definition: SEAviewer.h:246
double getADCrms() const
Definition: SEAviewer.h:177
int loadVertex(double m_vertex_pos_x, double m_vertex_pos_y, double m_vertex_pos_z)
Definition: SEAviewer.cxx:350
process_name opflash particleana ie ie ie z
std::vector< TGraph > true_vertex_graph
Definition: SEAviewer.h:410
std::vector< std::vector< TGraph > > vec_graphs
Definition: SEAviewer.h:381
std::vector< std::vector< double > > vec_all_ticks
Definition: SEAviewer.h:427
int addPFParticleHits(std::vector< art::Ptr< recob::Hit >> &hits, std::string leg, double arg1=0.0, double arg2=0.0, double arg3=0.0)
Definition: SEAviewer.cxx:279
double f_wire_tick_based_length
Definition: SEAviewer.h:241
process_name opflash particleana ie x
BEGIN_PROLOG could also be cerr
std::string f_legend
Definition: SEAviewer.h:230
TRandom3 * rangen
Definition: SEAviewer.h:432
std::vector< TGraph > vertex_graph
Definition: SEAviewer.h:404
TH1D * getADCHist()
Definition: SEAviewer.h:167
std::vector< seaview::cluster > vec_clusters
Definition: SEAviewer.h:435
std::vector< std::vector< std::vector< double > > > vec_unass_pts
Definition: SEAviewer.h:421
int InNuSlice(const std::map< int, std::vector< art::Ptr< recob::Hit >> > &sliceIDToHitsMap, int nuSliceID)
Definition: SEAviewer.cxx:7
std::vector< double > analyzeShowerLikeClusters(double eps, const std::map< art::Ptr< recob::Shower >, art::Ptr< recob::PFParticle >> &showerToPFParticleMap, const std::map< art::Ptr< recob::PFParticle >, std::vector< art::Ptr< recob::Hit >> > &pfParticleToHitsMap, std::vector< seaview::cluster > &vec_c)
Definition: SEAviewer.cxx:783
std::map< art::Ptr< recob::Hit >, bool > map_unassociated_hits
Definition: SEAviewer.h:414
Declaration of signal hit object.
pdgs p
Definition: selectors.fcl:22
std::vector< art::Ptr< recob::Shower > > vec_showers
Definition: SEAviewer.h:436
double calcTime(double X, int plane, int fTPC, int fCryostat, detinfo::DetectorPropertiesData const &detprop)
Definition: SEAviewer.h:312
int setHitThreshold(double)
Definition: SEAviewer.cxx:195
double f_AngleWRTShower
Definition: SEAviewer.h:262
std::vector< std::vector< art::Ptr< recob::Hit > > > vec_unass_hits
Definition: SEAviewer.h:422
double getWireTickBasedLength() const
Definition: SEAviewer.h:160
double f_ImpactParameter
Definition: SEAviewer.h:258
int addTrack(art::Ptr< recob::Track > &trk)
Definition: SEAviewer.cxx:320
int setScore(cluster_score &in_score)
Definition: SEAviewer.h:154
std::vector< int > num_clusters
Definition: SEAviewer.h:430
const TGraph * getGraph() const
Definition: SEAviewer.h:168
std::vector< std::vector< double > > vec_all_chans
Definition: SEAviewer.h:428
std::vector< std::vector< double > > getPTS() const
Definition: SEAviewer.h:165
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common see the discussion of warn common echo in *Note Linker see the discussion of warn common echo in *Note Linker such as a global int variable echo as opposed to a large global array echo echo I echo The symbol is an indirect reference to another symbol This echo is a GNU extension to the a out object file format which is echo rarely used echo echo N echo The symbol is a debugging symbol echo echo R echo The symbol is in a read only data section echo echo S echo The symbol is in an uninitialized data section for small echo objects echo echo T echo The symbol is in the the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo W echo The symbol is a weak symbol that has not been specifically echo tagged as a weak object symbol When a weak defined symbol echo is linked with a normal defined the normal defined echo symbol is used with no error When a weak undefined symbol echo is linked and the symbol is not the value of the echo weak symbol becomes zero with no error echo echo echo The symbol is a stabs symbol in an a out object file In echo this the next values printed are the stabs other echo the stabs desc and the stab type Stabs symbols are echo used to hold debugging information For more echo see *Note or object file format specific echo echo For Mac OS X
bool InRange(double tick_max, double tick_min, double wire_max, double wire_min) const
Definition: SEAviewer.h:212
std::vector< art::Ptr< recob::Hit > > f_hits
Definition: SEAviewer.h:224
cluster_score(int ip, int cl)
Definition: SEAviewer.h:127
tick ticks
Alias for common language habits.
Definition: electronics.h:78
process_name shower
Definition: cheaterreco.fcl:51
double f_fit_chi2
Definition: SEAviewer.h:251
Class def header for a class seaDBSCAN.
double f_mean_ADC_first_to_second_ratio
Definition: SEAviewer.h:247
size_t start_hit_idx
Definition: SEAviewer.h:243
std::vector< std::vector< std::vector< double > > > vec_ticks
Definition: SEAviewer.h:385
geo::GeometryCore const * geom
Definition: SEAviewer.h:388
size_t getTrackEndIdx() const
Definition: SEAviewer.h:198
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
int getShowerRemerge() const
Definition: SEAviewer.h:171
process_name opflash particleana ie ie y
size_t end_hit_idx
Definition: SEAviewer.h:244
cluster_score SeaviewScoreCluster(int p, int cl, std::vector< art::Ptr< recob::Hit >> &hits, double vertex_wire, double vertex_tick, const art::Ptr< recob::Shower > &shower)
Definition: SEAviewer.cxx:1014
double f_ioc_based_length
Definition: SEAviewer.h:240
double hit_threshold
Definition: SEAviewer.h:378
void setImpactParam(double d)
Definition: SEAviewer.h:180
double f_meanADC
Definition: SEAviewer.h:253
bool f_track_treated
Definition: SEAviewer.h:221
void setFitCons(double d)
Definition: SEAviewer.h:185
std::string tag
Definition: SEAviewer.h:377
cluster_score f_score
Definition: SEAviewer.h:226
double f_min_ioc_to_shower_start
Definition: SEAviewer.h:239
static constexpr double wire_con
Definition: SEAviewer.h:368
double ConvertXToTicks(double X, int p, int t, int c) const
double getFitCons() const
Definition: SEAviewer.h:188
std::vector< double > vertex_chan
Definition: SEAviewer.h:403
std::vector< TGraph > vec_all_graphs
Definition: SEAviewer.h:426
std::vector< std::pair< int, int > > m_bad_channel_list
Definition: SEAviewer.h:399
double f_angle_wrt_shower_direction
Definition: SEAviewer.h:249
double getMinHitConvDist() const
Definition: SEAviewer.h:194
detinfo::DetectorPropertiesData const & theDetector
Definition: SEAviewer.h:389
double getMinHitImpactParam() const
Definition: SEAviewer.h:193
std::vector< double > analyzeTrackLikeClusters(double eps, const std::map< art::Ptr< recob::Shower >, art::Ptr< recob::PFParticle >> &showerToPFParticleMap, const std::map< art::Ptr< recob::PFParticle >, std::vector< art::Ptr< recob::Hit >> > &pfParticleToHitsMap, std::vector< seaview::cluster > &vec_c)
Definition: SEAviewer.cxx:737
std::vector< std::vector< double > > to2D(std::vector< double > &threeD)
Definition: SEAviewer.cxx:329
const std::string & getLegend() const
Definition: SEAviewer.h:169
Description of geometry of one entire detector.
Declaration of cluster object.
double f_ADC_RMS
Definition: SEAviewer.h:252
int Print(double plot_distance)
Definition: SEAviewer.cxx:405
int setBadChannelList(std::vector< std::pair< int, int >> &in)
Definition: SEAviewer.cxx:159
std::vector< double > chan_max
Definition: SEAviewer.h:396
TGraph * SeaviewGetNearestNpts(int p, int cl, std::vector< art::Ptr< recob::Hit >> &hitz, double vertex_wire, double vertex_tick, int Npts)
Definition: SEAviewer.cxx:1210
Provides recob::Track data product.
double f_mean_ADC_first_half
Definition: SEAviewer.h:245
void setWireTickBasedLength(double d)
Definition: SEAviewer.h:159
int addShower(art::Ptr< recob::Shower > &shr)
Definition: SEAviewer.cxx:312
void TrackLikeClusterAnalyzer(cluster &cl, const std::vector< double > &shower_start_pt_2D, const std::vector< double > &shower_other_pt_2D)
Definition: SEAviewer.cxx:26
bool isTrackAnalyzed() const
Definition: SEAviewer.h:161
int getPlane() const
Definition: SEAviewer.h:164
double getAngleWRTShower() const
Definition: SEAviewer.h:186
std::vector< std::string > vec_pfp_legend
Definition: SEAviewer.h:383
int addAllHits(std::vector< art::Ptr< recob::Hit >> &hits)
Definition: SEAviewer.cxx:200
void setAngleWRTShower(double d)
Definition: SEAviewer.h:183
void setFitSlope(double d)
Definition: SEAviewer.h:184
std::vector< std::vector< double > > vec_unass_ticks
Definition: SEAviewer.h:419
double getTrackAngleToShowerDirection() const
Definition: SEAviewer.h:202
double f_FitCons
Definition: SEAviewer.h:260
int setShowerRemerge(int remerge_in)
Definition: SEAviewer.h:172
std::vector< double > true_vertex_tick
Definition: SEAviewer.h:408
std::map< art::Ptr< recob::Hit >, bool > map_considered_hits
Definition: SEAviewer.h:415
cluster(int ID, int plane, std::vector< std::vector< double >> &pts, std::vector< art::Ptr< recob::Hit >> &hits)
Definition: SEAviewer.h:138
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
std::vector< std::vector< int > > cluster_labels
Definition: SEAviewer.h:431
void format_legend(std::string &leg, double arg1=0.0, double arg2=0.0, double arg3=0.0)
Definition: SEAviewer.cxx:1288
double dist_point_point(double w1, double t1, double w2, double t2) const
Definition: SEAviewer.h:328
double getMeanADC() const
Definition: SEAviewer.h:176
std::vector< std::vector< double > > f_pts
Definition: SEAviewer.h:223
std::vector< double > true_vertex_chan
Definition: SEAviewer.h:409
int SeaviewCompareToShowers(int p, int cl, std::vector< art::Ptr< recob::Hit >> &hitz, double vertex_wire, double vertex_tick, std::vector< art::Ptr< recob::Shower >> &showers, const std::map< art::Ptr< recob::Shower >, art::Ptr< recob::PFParticle >> &showerToPFParticleMap, const std::map< art::Ptr< recob::PFParticle >, std::vector< art::Ptr< recob::Hit >> > &pfParticleToHitsMap, double eps)
Definition: SEAviewer.cxx:1166
double dist_line_point(const std::vector< double > &X1, const std::vector< double > &X2, const std::vector< double > &point)
Definition: SEAviewer.cxx:988
std::vector< int > f_hit_group
Definition: SEAviewer.h:225
std::vector< double > chan_min
Definition: SEAviewer.h:397
double calcWire(double Y, double Z, int plane, int fTPC, int fCryostat, geo::GeometryCore const &geo)
Definition: SEAviewer.h:306
void SetClusterLegend(int cluster, double energy, int is_matched, int matched_pdg, double overlay_fraction)
Definition: SEAviewer.cxx:1262
std::vector< size_t > seaview_sort_indexes(const std::vector< T > &v)
Definition: SEAviewer.h:75
std::vector< art::Ptr< recob::Track > > vec_tracks
Definition: SEAviewer.h:437
void configure(const fhicl::ParameterSet &pset)
Definition: SEAviewer.h:276
int runseaDBSCAN(double min_pts, double eps)
Definition: SEAviewer.cxx:687
static constexpr double tick_con
Definition: SEAviewer.h:369
void setLegend(const std::string &in_leg)
Definition: SEAviewer.h:155
std::vector< std::vector< double > > vec_unass_chans
Definition: SEAviewer.h:420
double getLinearChi() const
Definition: SEAviewer.h:203
double getMinHitIOC() const
Definition: SEAviewer.h:195
double getImpactParam() const
Definition: SEAviewer.h:189
int addTrueVertex(double x, double y, double z)
Definition: SEAviewer.cxx:377
then echo ***************************************echo Variable FHICL_FILE_PATH not found echo You porbably haven t set up larsoft echo Try setup uboonecode vXX_XX_XX q e10
Definition: find_fhicl.sh:6
std::vector< TGraph > vec_unass_graphs
Definition: SEAviewer.h:418
const std::vector< art::Ptr< recob::Hit > > & getHits()
Definition: SEAviewer.h:170
int addHitsToConsider(std::vector< art::Ptr< recob::Hit >> &hits)
Definition: SEAviewer.cxx:164
double f_FitSlope
Definition: SEAviewer.h:259
size_t getTrackStartIdx() const
Definition: SEAviewer.h:197
SEAviewer(std::string tag, geo::GeometryCore const *geom, detinfo::DetectorPropertiesData const &theDetector)
Definition: SEAviewer.cxx:129
double getMeanADCRatio() const
Definition: SEAviewer.h:201
std::vector< int > calcUnassociatedHits()
Definition: SEAviewer.cxx:227
double getMeanADCSecondHalf() const
Definition: SEAviewer.h:200
TGraph * getGraph()
Definition: SEAviewer.h:166
double f_min_conversion_dist_to_shower_start
Definition: SEAviewer.h:238
art framework interface to geometry description
double getMeanADCFirstHalf() const
Definition: SEAviewer.h:199
double getFitSlope() const
Definition: SEAviewer.h:187
void BasicClusterCalorimetry(cluster &cl)
Definition: SEAviewer.cxx:1245
std::vector< std::vector< std::vector< double > > > vec_chans
Definition: SEAviewer.h:386
double f_min_impact_parameter_to_shower
Definition: SEAviewer.h:236
int getID() const
Definition: SEAviewer.h:163
std::vector< double > vertex_tick
Definition: SEAviewer.h:402
int filterConsideredHits(double dist_to_vertex)
Definition: SEAviewer.cxx:172
double getIOCbasedLength() const
Definition: SEAviewer.h:196