LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
TripletFinder.h
Go to the documentation of this file.
1 // Christopher Backhouse - bckhouse@fnal.gov
2 
3 #ifndef RECO3D_TRIPLETFINDER_H
4 #define RECO3D_TRIPLETFINDER_H
5 
7 
8 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
9 
11 
13 
14 #include <map>
15 #include <vector>
16 
17 namespace recob{class Hit;}
18 
19 namespace reco3d
20 {
21  struct HitOrChan
22  {
23  HitOrChan(raw::ChannelID_t c) : chan(c), hit(0), xpos(0) {}
24  HitOrChan(const recob::Hit* h, double x) : chan(h->Channel()), hit(h), xpos(x) {}
25 
27  const recob::Hit* hit; // null for bad channel
28  double xpos; // Only set if hit is set
29  };
30 
32  {
34  : a(a_), b(b_), pt(p)
35  {
36  }
37 
40  };
41 
42  struct XYZ
43  {
44  double x, y, z;
45  };
46 
47  struct HitTriplet
48  {
49  const recob::Hit *x, *u, *v;
51  };
52 
54  {
55  public:
57  const std::vector<art::Ptr<recob::Hit>>& uhits,
58  const std::vector<art::Ptr<recob::Hit>>& vhits,
59  const std::vector<raw::ChannelID_t>& xbad,
60  const std::vector<raw::ChannelID_t>& ubad,
61  const std::vector<raw::ChannelID_t>& vbad,
62  double distThresh, double distThreshDrift,
63  double xhitOffset);
64 
65  std::vector<HitTriplet> Triplets();
67  std::vector<HitTriplet> TripletsTwoView();
68 
69  protected:
72 
74  void FillHitMap(const std::vector<art::Ptr<recob::Hit>>& hits,
75  std::map<geo::TPCID, std::vector<HitOrChan>>& out);
77  void FillBadMap(const std::vector<raw::ChannelID_t>& bads,
78  std::map<geo::TPCID, std::vector<raw::ChannelID_t>>& out);
79 
80  bool CloseDrift(double xa, double xb) const;
81  bool CloseSpace(geo::WireIDIntersection ra,
82  geo::WireIDIntersection rb) const;
83 
84  std::vector<ChannelDoublet> DoubletsXU(geo::TPCID tpc);
85  std::vector<ChannelDoublet> DoubletsXV(geo::TPCID tpc);
86 
87  std::vector<ChannelDoublet>
88  DoubletHelper(geo::TPCID tpc,
89  const std::vector<HitOrChan>& ahits,
90  const std::vector<HitOrChan>& bhits,
91  const std::vector<raw::ChannelID_t>& bbads) const;
92 
93  double fDistThresh;
95  double fXHitOffset;
96 
97  std::map<geo::TPCID, std::vector<HitOrChan>> fX_by_tpc;
98  std::map<geo::TPCID, std::vector<HitOrChan>> fU_by_tpc;
99  std::map<geo::TPCID, std::vector<HitOrChan>> fV_by_tpc;
100 
101  // TODO initialize
102  std::map<geo::TPCID, std::vector<raw::ChannelID_t>> fXbad_by_tpc;
103  std::map<geo::TPCID, std::vector<raw::ChannelID_t>> fUbad_by_tpc;
104  std::map<geo::TPCID, std::vector<raw::ChannelID_t>> fVbad_by_tpc;
105  };
106 }
107 
108 #endif
Float_t x
Definition: compare.C:6
raw::ChannelID_t chan
Definition: TripletFinder.h:26
geo::WireIDIntersection pt
Definition: TripletFinder.h:39
Reconstruction base classes.
Declaration of signal hit object.
Float_t y
Definition: compare.C:6
ChannelDoublet(HitOrChan a_, HitOrChan b_, geo::WireIDIntersection p)
Definition: TripletFinder.h:33
std::map< geo::TPCID, std::vector< HitOrChan > > fX_by_tpc
Definition: TripletFinder.h:97
const detinfo::DetectorProperties * detprop
Definition: TripletFinder.h:71
HitOrChan(const recob::Hit *h, double x)
Definition: TripletFinder.h:24
std::map< geo::TPCID, std::vector< HitOrChan > > fV_by_tpc
Definition: TripletFinder.h:99
std::map< geo::TPCID, std::vector< raw::ChannelID_t > > fXbad_by_tpc
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
HitOrChan(raw::ChannelID_t c)
Definition: TripletFinder.h:23
void hits()
Definition: readHits.C:15
std::map< geo::TPCID, std::vector< HitOrChan > > fU_by_tpc
Definition: TripletFinder.h:98
const geo::GeometryCore * geom
Definition: TripletFinder.h:70
const recob::Hit * x
Definition: TripletFinder.h:49
TMarker * pt
Definition: egs.C:25
The data type to uniquely identify a TPC.
Definition: geo_types.h:195
Description of geometry of one entire detector.
Detector simulation of raw signals on wires.
const recob::Hit * hit
Definition: TripletFinder.h:27
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
std::map< geo::TPCID, std::vector< raw::ChannelID_t > > fUbad_by_tpc
art framework interface to geometry description
std::map< geo::TPCID, std::vector< raw::ChannelID_t > > fVbad_by_tpc