LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
DisambigAlg.h
Go to the documentation of this file.
1 // \fileDisambigAlg.h
3 // tylerdalion@gmail.com
5 #ifndef DisambigAlg_H
6 #define DisambigAlg_H
7 
8 #include <map>
9 #include <utility> // std::pair<>
10 #include <vector>
11 
15 #include "fhiclcpp/fwd.h"
16 
18 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
23 namespace detinfo {
24  class DetectorClocksData;
25  class DetectorPropertiesData;
26 }
27 
28 namespace apa {
29 
30  //---------------------------------------------------------------
31  class DisambigAlg {
32  public:
33  explicit DisambigAlg(fhicl::ParameterSet const& pset);
34 
35  void RunDisambig(detinfo::DetectorClocksData const& clockData,
36  detinfo::DetectorPropertiesData const& detProp,
37  art::Handle<std::vector<recob::Hit>> GausHits);
38 
39  void TrivialDisambig(detinfo::DetectorClocksData const& clockData,
40  detinfo::DetectorPropertiesData const& detProp,
41  unsigned int apa);
42  void Crawl(unsigned int apa);
43  unsigned int FindChanTimeEndPts(detinfo::DetectorPropertiesData const& detProp,
44  unsigned int apa);
45  void UseEndPts(detinfo::DetectorPropertiesData const& detProp,
46  unsigned int apa);
47  unsigned int CompareViews(
49  detinfo::DetectorPropertiesData const& detProp,
50  unsigned int apa);
51  void AssessDisambigSoFar(
52  unsigned int apa);
53 
54  std::map<unsigned int, double> fUeffSoFar;
55  std::map<unsigned int, double> fVeffSoFar;
56  std::map<unsigned int, unsigned int> fnUSoFar;
57  std::map<unsigned int, unsigned int> fnVSoFar;
58  std::map<unsigned int, unsigned int> fnDUSoFar;
59  std::map<unsigned int, unsigned int> fnDVSoFar;
60 
61  std::vector<std::pair<art::Ptr<recob::Hit>, geo::WireID>> fDisambigHits;
63 
64  private:
65  // other classes we will use
68  // **temporarily** here to look at performance without noise hits
71 
72  // Hits organization
73  std::map<raw::ChannelID_t, std::vector<art::Ptr<recob::Hit>>> fChannelToHits;
74  std::map<unsigned int, std::vector<art::Ptr<recob::Hit>>> fAPAToUVHits, fAPAToZHits;
75  std::map<unsigned int, std::vector<art::Ptr<recob::Hit>>> fAPAToHits;
77  std::map<unsigned int, std::vector<art::Ptr<recob::Hit>>> fAPAToEndPHits;
78  std::map<unsigned int, std::vector<std::pair<art::Ptr<recob::Hit>, geo::WireID>>> fAPAToDHits;
80 
81  // data/function to keep track of disambiguation along the way
82  std::map<std::pair<double, double>, geo::WireID> fChanTimeToWid;
84  std::map<unsigned int, std::map<std::pair<double, double>, bool>> fHasBeenDisambiged;
86  void MakeDisambigHit(art::Ptr<recob::Hit> const& hit, geo::WireID, unsigned int apa);
88 
89  // Functions that support disambiguation methods
90  unsigned int MakeCloseHits(int ext, geo::WireID wid, double Dmin, double Dmax);
92  bool HitsOverlapInTime(detinfo::DetectorPropertiesData const& detProp,
93  recob::Hit const& hitA,
94  recob::Hit const& hitB);
95  bool HitsReasonablyMatch(art::Ptr<recob::Hit> hitA, art::Ptr<recob::Hit> hitB);
97 
98  // Configure the disambiguation
99  bool fCrawl;
100  bool fUseEndP;
102  unsigned int fNChanJumps;
104  double fMaxEndPDegRange;
106 
109  }; // class DisambigAlg
110 
111 } // namespace apa
112 
113 #endif // ifndef DisambigAlg_H
std::map< unsigned int, std::map< std::pair< double, double >, bool > > fHasBeenDisambiged
Convenient way to keep track of disambiguation so far.
Definition: DisambigAlg.h:84
std::map< raw::ChannelID_t, std::vector< art::Ptr< recob::Hit > > > fChannelToHits
Definition: DisambigAlg.h:73
double fCloseHitsRadius
Definition: DisambigAlg.h:103
std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > fAPAToZHits
Definition: DisambigAlg.h:74
std::map< unsigned int, unsigned int > fnDVSoFar
Definition: DisambigAlg.h:59
apa::APAGeometryAlg fAPAGeo
Definition: DisambigAlg.h:66
Declaration of signal hit object.
std::map< unsigned int, unsigned int > fnVSoFar
Definition: DisambigAlg.h:57
std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > fAPAToEndPHits
\ todo: Channel/APA to hits can be done in a unified way
Definition: DisambigAlg.h:77
art::ServiceHandle< geo::Geometry const > geom
Definition: DisambigAlg.h:67
Interface for a class providing readout channel mapping to geometry.
std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > fAPAToHits
Definition: DisambigAlg.h:75
std::map< unsigned int, double > fVeffSoFar
Definition: DisambigAlg.h:55
General LArSoft Utilities.
unsigned int fNChanJumps
Number of channels the crawl can jump over.
Definition: DisambigAlg.h:102
Definition of data types for geometry description.
Detector simulation of raw signals on wires.
Contains all timing reference information for the detector.
bool fCrawl
\ todo: Write function that compares hits more detailedly
Definition: DisambigAlg.h:99
art::ServiceHandle< cheat::BackTrackerService const > bt_serv
Definition: DisambigAlg.h:69
std::vector< std::pair< art::Ptr< recob::Hit >, geo::WireID > > fDisambigHits
The final list of hits to pass back to be made.
Definition: DisambigAlg.h:61
std::map< unsigned int, double > fUeffSoFar
Definition: DisambigAlg.h:54
geo::WireReadoutGeom const * fWireReadoutGeom
Definition: DisambigAlg.h:70
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
std::map< unsigned int, unsigned int > fnUSoFar
Definition: DisambigAlg.h:56
std::map< unsigned int, std::vector< std::pair< art::Ptr< recob::Hit >, geo::WireID > > > fAPAToDHits
Hold the disambiguations per APA.
Definition: DisambigAlg.h:78
art framework interface to geometry description
std::map< std::pair< double, double >, geo::WireID > fChanTimeToWid
If a hit is disambiguated, map its chan and peak time to the chosen wireID.
Definition: DisambigAlg.h:82
std::map< unsigned int, unsigned int > fnDUSoFar
Definition: DisambigAlg.h:58