LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 #include <vector>
8 #include <map>
9 #include <cmath>
10 #include <iostream>
11 #include <stdint.h>
12 
13 #include "fhiclcpp/ParameterSet.h"
18 
22 #include "larcoreobj/SimpleTypesAndConstants/RawTypes.h" // raw::ChannelID_t
27 
29 
30 #include "TMatrixD.h"
31 #include "TVectorD.h"
32 
33 
34 
35 namespace apa{
36 
37 
38 
39  //---------------------------------------------------------------
40  class DisambigAlg {
41  public:
42 
43 
44  DisambigAlg(fhicl::ParameterSet const& pset);
45  virtual ~DisambigAlg();
46 
47  void reconfigure(fhicl::ParameterSet const& p);
48 
49  void RunDisambig( art::Handle< std::vector<recob::Hit> > GausHits );
51 
52  void TrivialDisambig ( unsigned int apa );
53  void Crawl ( unsigned int apa );
54  unsigned int FindChanTimeEndPts ( unsigned int apa );
55  void UseEndPts ( unsigned int apa );
56  unsigned int CompareViews ( unsigned int apa );
57  void AssessDisambigSoFar( unsigned int apa );
58 
59 
60  std::map<unsigned int, double> fUeffSoFar;
61  std::map<unsigned int, double> fVeffSoFar;
62  std::map<unsigned int, unsigned int> fnUSoFar;
63  std::map<unsigned int, unsigned int> fnVSoFar;
64  std::map<unsigned int, unsigned int> fnDUSoFar;
65  std::map<unsigned int, unsigned int> fnDVSoFar;
66 
67  std::vector< std::pair<art::Ptr<recob::Hit>, geo::WireID> > fDisambigHits;
69 
70  private:
71 
72  // other classes we will use
77 
78  // Hits organization
79  std::map< raw::ChannelID_t, std::vector< art::Ptr< recob::Hit > > > fChannelToHits;
80  std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > fAPAToUVHits, fAPAToZHits;
81  std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > fAPAToHits;
83  std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > fAPAToEndPHits;
84  std::map< unsigned int, std::vector< std::pair<art::Ptr<recob::Hit>, geo::WireID> > > fAPAToDHits;
86 
87 
88 
89  // data/function to keep track of disambiguation along the way
90  std::map<std::pair<double,double>, geo::WireID> fChanTimeToWid;
92  std::map< unsigned int, std::map<std::pair<double,double>, bool> > fHasBeenDisambiged;
95  geo::WireID,
96  unsigned int apa);
98 
99 
100 
101  // Functions that support disambiguation methods
102  unsigned int MakeCloseHits (int ext, geo::WireID wid, double Dmin, double Dmax);
107 
108 
109 
110  // Configure the disambiguation
111  bool fCrawl;
112  bool fUseEndP;
114  unsigned int fNChanJumps;
117 
119  }; // class DisambigAlg
120 
121 } // namespace apa
122 
123 #endif // ifndef DisambigAlg_H
bool HitsReasonablyMatch(art::Ptr< recob::Hit > hitA, art::Ptr< recob::Hit > hitB)
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:90
double fCloseHitsRadius
Distance (cm) away from a hit to look when checking if it&#39;s an endpoint.
Definition: DisambigAlg.h:115
virtual ~DisambigAlg()
Definition: DisambigAlg.cxx:52
std::map< unsigned int, unsigned int > fnDVSoFar
Definition: DisambigAlg.h:65
apa::APAGeometryAlg fAPAGeo
Definition: DisambigAlg.h:73
Declaration of signal hit object.
std::map< unsigned int, unsigned int > fnVSoFar
Definition: DisambigAlg.h:63
void Crawl(unsigned int apa)
Extend what we disambiguation we do have in apa.
bool HitsOverlapInTime(art::Ptr< recob::Hit > hitA, art::Ptr< recob::Hit > hitB)
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:67
art::ServiceHandle< cheat::BackTrackerService > bt_serv
For TEMPORARY monitering of potential problems.
Definition: DisambigAlg.h:76
void TrivialDisambig(unsigned int apa)
Make the easiest and safest disambiguations in apa.
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:83
void AssessDisambigSoFar(unsigned int apa)
See how much disambiguation has been done in this apa so far.
std::map< raw::ChannelID_t, std::vector< art::Ptr< recob::Hit > > > fChannelToHits
Definition: DisambigAlg.h:79
DisambigAlg(fhicl::ParameterSet const &pset)
Definition: DisambigAlg.cxx:45
std::map< unsigned int, double > fVeffSoFar
Definition: DisambigAlg.h:61
Declaration of cluster object.
unsigned int fNChanJumps
Number of channels the crawl can jump over.
Definition: DisambigAlg.h:114
Definition of data types for geometry description.
void reconfigure(fhicl::ParameterSet const &p)
Definition: DisambigAlg.cxx:57
unsigned int FindChanTimeEndPts(unsigned int apa)
Basic endpoint-hit finder per apa.
Detector simulation of raw signals on wires.
unsigned int CompareViews(unsigned int apa)
Compare U and V to see if one says something about the other.
void UseEndPts(unsigned int apa)
Try to associate endpoint hits and crawl from there.
std::map< unsigned int, std::map< std::pair< double, double >, bool > > fHasBeenDisambiged
Convenient way to keep track of disambiguation so far.
Definition: DisambigAlg.h:92
std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > fAPAToHits
Definition: DisambigAlg.h:81
std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > fAPAToUVHits
Definition: DisambigAlg.h:80
bool fCrawl
\ todo: Write function that compares hits more detailedly
Definition: DisambigAlg.h:111
std::map< unsigned int, std::vector< std::pair< art::Ptr< recob::Hit >, geo::WireID > > > fAPAToDHits
Hold the disambiguations per APA.
Definition: DisambigAlg.h:84
std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > fAPAToZHits
Definition: DisambigAlg.h:80
double fMaxEndPDegRange
Definition: DisambigAlg.h:116
Declaration of basic channel signal object.
std::map< unsigned int, double > fUeffSoFar
Definition: DisambigAlg.h:60
void MakeDisambigHit(art::Ptr< recob::Hit > hit, geo::WireID, unsigned int apa)
Makes a disambiguated hit while keeping track of what has already been disambiguated.
art::ServiceHandle< geo::Geometry > geom
Definition: DisambigAlg.h:74
std::map< unsigned int, unsigned int > fnUSoFar
Definition: DisambigAlg.h:62
unsigned int MakeCloseHits(int ext, geo::WireID wid, double Dmin, double Dmax)
Having disambiguated a time range on a wireID, extend to neighboring channels.
art framework interface to geometry description
const detinfo::DetectorProperties * detprop
Definition: DisambigAlg.h:75
void RunDisambig(art::Handle< std::vector< recob::Hit > > GausHits)
Run disambiguation as currently configured.
Definition: DisambigAlg.cxx:72
std::map< unsigned int, unsigned int > fnDUSoFar
Definition: DisambigAlg.h:64