LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "DisambigAlg.h"
Public Member Functions | |
DisambigAlg (fhicl::ParameterSet const &pset) | |
void | RunDisambig (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, art::Handle< std::vector< recob::Hit >> GausHits) |
void | TrivialDisambig (detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, unsigned int apa) |
Make the easiest and safest disambiguations in apa. More... | |
void | Crawl (unsigned int apa) |
Extend what we disambiguation we do have in apa. More... | |
unsigned int | FindChanTimeEndPts (detinfo::DetectorPropertiesData const &detProp, unsigned int apa) |
Basic endpoint-hit finder per apa. More... | |
void | UseEndPts (detinfo::DetectorPropertiesData const &detProp, unsigned int apa) |
unsigned int | CompareViews (detinfo::DetectorPropertiesData const &detProp, unsigned int apa) |
Compare U and V to see if one says something about the other. More... | |
void | AssessDisambigSoFar (unsigned int apa) |
See how much disambiguation has been done in this apa so far. More... | |
Public Attributes | |
std::map< unsigned int, double > | fUeffSoFar |
std::map< unsigned int, double > | fVeffSoFar |
std::map< unsigned int, unsigned int > | fnUSoFar |
std::map< unsigned int, unsigned int > | fnVSoFar |
std::map< unsigned int, unsigned int > | fnDUSoFar |
std::map< unsigned int, unsigned int > | fnDVSoFar |
std::vector< std::pair< art::Ptr< recob::Hit >, geo::WireID > > | fDisambigHits |
The final list of hits to pass back to be made. More... | |
Private Member Functions | |
void | MakeDisambigHit (art::Ptr< recob::Hit > const &hit, geo::WireID, unsigned int apa) |
Makes a disambiguated hit while keeping track of what has already been disambiguated. More... | |
unsigned int | MakeCloseHits (int ext, geo::WireID wid, double Dmin, double Dmax) |
Having disambiguated a time range on a wireID, extend to neighboring channels. More... | |
bool | HitsOverlapInTime (detinfo::DetectorPropertiesData const &detProp, recob::Hit const &hitA, recob::Hit const &hitB) |
bool | HitsReasonablyMatch (art::Ptr< recob::Hit > hitA, art::Ptr< recob::Hit > hitB) |
Private Attributes | |
apa::APAGeometryAlg | fAPAGeo |
art::ServiceHandle< geo::Geometry const > | geom |
art::ServiceHandle< cheat::BackTrackerService const > | bt_serv |
std::map< raw::ChannelID_t, std::vector< art::Ptr< recob::Hit > > > | fChannelToHits |
std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > | fAPAToUVHits |
std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > | fAPAToZHits |
std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > | fAPAToHits |
std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > | fAPAToEndPHits |
\ todo: Channel/APA to hits can be done in a unified way More... | |
std::map< unsigned int, std::vector< std::pair< art::Ptr< recob::Hit >, geo::WireID > > > | fAPAToDHits |
Hold the disambiguations per APA. More... | |
std::map< std::pair< double, double >, geo::WireID > | fChanTimeToWid |
If a hit is disambiguated, map its chan and peak time to the chosen wireID. More... | |
std::map< unsigned int, std::map< std::pair< double, double >, bool > > | fHasBeenDisambiged |
Convenient way to keep track of disambiguation so far. More... | |
bool | fCrawl |
\ todo: Write function that compares hits more detailedly More... | |
bool | fUseEndP |
bool | fCompareViews |
unsigned int | fNChanJumps |
Number of channels the crawl can jump over. More... | |
double | fCloseHitsRadius |
double | fMaxEndPDegRange |
Definition at line 34 of file DisambigAlg.h.
|
explicit |
Definition at line 40 of file DisambigAlg.cxx.
References fCloseHitsRadius, fCompareViews, fCrawl, fMaxEndPDegRange, fNChanJumps, fUseEndP, and fhicl::ParameterSet::get().
void apa::DisambigAlg::AssessDisambigSoFar | ( | unsigned int | apa | ) |
See how much disambiguation has been done in this apa so far.
Definition at line 633 of file DisambigAlg.cxx.
References fAPAToDHits, fAPAToUVHits, fnDUSoFar, fnDVSoFar, fnUSoFar, fnVSoFar, fUeffSoFar, fVeffSoFar, geo::kU, geo::kV, and recob::Hit::View().
Referenced by RunDisambig().
unsigned int apa::DisambigAlg::CompareViews | ( | detinfo::DetectorPropertiesData const & | detProp, |
unsigned int | apa | ||
) |
Compare U and V to see if one says something about the other.
Definition at line 663 of file DisambigAlg.cxx.
References geo::GeometryCore::ChannelToWire(), d, fAPAToUVHits, fChanTimeToWid, fHasBeenDisambiged, geom, HitsOverlapInTime(), MakeDisambigHit(), lar::to_element, w, and geo::GeometryCore::WireIDsIntersect().
Referenced by RunDisambig().
void apa::DisambigAlg::Crawl | ( | unsigned int | apa | ) |
Extend what we disambiguation we do have in apa.
\ todo: Evaluate how aggressive we can be here. How far should we jump? In what cases should we quit out?
Definition at line 370 of file DisambigAlg.cxx.
References fAPAToUVHits, fChanTimeToWid, fHasBeenDisambiged, fNChanJumps, hits(), and MakeCloseHits().
Referenced by RunDisambig(), and UseEndPts().
unsigned int apa::DisambigAlg::FindChanTimeEndPts | ( | detinfo::DetectorPropertiesData const & | detProp, |
unsigned int | apa | ||
) |
Basic endpoint-hit finder per apa.
\ todo: Clean up and break down into two functions. \ todo: Make the conditions more robust to some spotty hits around a potential endpoint.
Definition at line 411 of file DisambigAlg.cxx.
References recob::Hit::Channel(), apa::APAGeometryAlg::ChannelsInView(), detinfo::DetectorPropertiesData::ConvertTicksToX(), geo::CryostatID::Cryostat, fAPAGeo, fAPAToEndPHits, fAPAToHits, fCloseHitsRadius, apa::APAGeometryAlg::FirstChannelInView(), fMaxEndPDegRange, geom, geo::kV, geo::kZ, recob::Hit::PeakTime(), util::pi(), util::size(), geo::TPCID::TPC, recob::Hit::View(), recob::Hit::WireID(), and geo::GeometryCore::WirePitch().
Referenced by RunDisambig().
|
private |
Definition at line 193 of file DisambigAlg.cxx.
References geo::kU, geo::kV, geo::kZ, recob::Hit::PeakTimeMinusRMS(), recob::Hit::PeakTimePlusRMS(), detinfo::DetectorPropertiesData::TimeOffsetU(), detinfo::DetectorPropertiesData::TimeOffsetV(), detinfo::DetectorPropertiesData::TimeOffsetZ(), and recob::Hit::View().
Referenced by CompareViews(), TrivialDisambig(), and UseEndPts().
|
private |
|
private |
Having disambiguated a time range on a wireID, extend to neighboring channels.
Definition at line 308 of file DisambigAlg.cxx.
References recob::Hit::Channel(), apa::APAGeometryAlg::ChannelsInView(), apa::APAGeometryAlg::ChannelToAPA(), geo::GeometryCore::ChannelToWire(), fAPAGeo, fChannelToHits, fHasBeenDisambiged, apa::APAGeometryAlg::FirstChannelInView(), geom, geo::kZ, MakeDisambigHit(), recob::Hit::PeakTime(), recob::Hit::PeakTimeMinusRMS(), recob::Hit::PeakTimePlusRMS(), geo::GeometryCore::PlaneWireToChannel(), geo::TPCID::TPC, geo::GeometryCore::View(), w, and geo::WireID::Wire.
Referenced by Crawl().
|
private |
Makes a disambiguated hit while keeping track of what has already been disambiguated.
Definition at line 174 of file DisambigAlg.cxx.
References recob::Hit::Channel(), fAPAToDHits, fChanTimeToWid, fHasBeenDisambiged, geo::CryostatID::isValid, and recob::Hit::PeakTime().
Referenced by CompareViews(), MakeCloseHits(), TrivialDisambig(), and UseEndPts().
void apa::DisambigAlg::RunDisambig | ( | detinfo::DetectorClocksData const & | clockData, |
detinfo::DetectorPropertiesData const & | detProp, | ||
art::Handle< std::vector< recob::Hit >> | GausHits | ||
) |
Definition at line 53 of file DisambigAlg.cxx.
References AssessDisambigSoFar(), bt_serv, recob::Hit::Channel(), apa::APAGeometryAlg::ChannelToAPA(), CompareViews(), Crawl(), fAPAGeo, fAPAToDHits, fAPAToEndPHits, fAPAToHits, fAPAToUVHits, fAPAToZHits, fChannelToHits, fChanTimeToWid, fCompareViews, fCrawl, fDisambigHits, fHasBeenDisambiged, art::fill_ptr_vector(), FindChanTimeEndPts(), fnDUSoFar, fnDVSoFar, fnUSoFar, fnVSoFar, fUeffSoFar, fUseEndP, fVeffSoFar, cheat::BackTrackerService::HitToXYZ(), geo::kU, geo::kV, geo::kZ, recob::Hit::PeakTime(), TrivialDisambig(), UseEndPts(), and recob::Hit::View().
Referenced by apa::APAHitFinder::produce().
void apa::DisambigAlg::TrivialDisambig | ( | detinfo::DetectorClocksData const & | clockData, |
detinfo::DetectorPropertiesData const & | detProp, | ||
unsigned int | apa | ||
) |
Make the easiest and safest disambiguations in apa.
\ todo: Figure out why sometimes non-noise hits dont match any Z hits at all.
\ todo: Add mechanism to at least eliminate the wids that aren't even possible, for the benefit of future methods
Definition at line 234 of file DisambigAlg.cxx.
References bt_serv, geo::GeometryCore::ChannelToWire(), geo::CryostatID::Cryostat, d, fAPAToUVHits, fAPAToZHits, geom, geo::TPCGeo::GetCenter(), HitsOverlapInTime(), cheat::BackTrackerService::HitToXYZ(), MakeDisambigHit(), geo::GeometryCore::NearestChannel(), geo::GeometryCore::NTPC(), lar::to_element, geo::TPCID::TPC, geo::GeometryCore::TPC(), w, and geo::GeometryCore::WireEndPoints().
Referenced by RunDisambig().
void apa::DisambigAlg::UseEndPts | ( | detinfo::DetectorPropertiesData const & | detProp, |
unsigned int | apa | ||
) |
Try to associate endpoint hits and crawl from there
\ todo: This function could be made much cleaner and more compact
Definition at line 524 of file DisambigAlg.cxx.
References apa::APAGeometryAlg::APAChannelsIntersect(), recob::Hit::Channel(), Crawl(), fAPAGeo, fAPAToEndPHits, geom, geo::TPCGeo::GetCenter(), HitsOverlapInTime(), geo::kU, geo::kV, geo::kZ, MakeDisambigHit(), apa::APAGeometryAlg::NearestWireIDOnChan(), util::size(), apa::APAGeometryAlg::ThreeChanPos(), and geo::GeometryCore::TPC().
Referenced by RunDisambig().
|
private |
Definition at line 72 of file DisambigAlg.h.
Referenced by RunDisambig(), and TrivialDisambig().
|
private |
Definition at line 69 of file DisambigAlg.h.
Referenced by FindChanTimeEndPts(), MakeCloseHits(), RunDisambig(), and UseEndPts().
|
private |
Hold the disambiguations per APA.
Definition at line 80 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), MakeDisambigHit(), and RunDisambig().
|
private |
\ todo: Channel/APA to hits can be done in a unified way
Definition at line 79 of file DisambigAlg.h.
Referenced by FindChanTimeEndPts(), RunDisambig(), and UseEndPts().
|
private |
Definition at line 77 of file DisambigAlg.h.
Referenced by FindChanTimeEndPts(), and RunDisambig().
|
private |
Definition at line 76 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), CompareViews(), Crawl(), RunDisambig(), and TrivialDisambig().
|
private |
Definition at line 76 of file DisambigAlg.h.
Referenced by RunDisambig(), and TrivialDisambig().
|
private |
Definition at line 75 of file DisambigAlg.h.
Referenced by MakeCloseHits(), and RunDisambig().
|
private |
If a hit is disambiguated, map its chan and peak time to the chosen wireID.
Definition at line 84 of file DisambigAlg.h.
Referenced by CompareViews(), Crawl(), MakeDisambigHit(), and RunDisambig().
|
private |
Distance (cm) away from a hit to look when checking if it's an endpoint
Definition at line 105 of file DisambigAlg.h.
Referenced by DisambigAlg(), and FindChanTimeEndPts().
|
private |
Definition at line 103 of file DisambigAlg.h.
Referenced by DisambigAlg(), and RunDisambig().
|
private |
\ todo: Write function that compares hits more detailedly
Definition at line 101 of file DisambigAlg.h.
Referenced by DisambigAlg(), and RunDisambig().
std::vector<std::pair<art::Ptr<recob::Hit>, geo::WireID> > apa::DisambigAlg::fDisambigHits |
The final list of hits to pass back to be made.
Definition at line 64 of file DisambigAlg.h.
Referenced by apa::APAHitFinder::produce(), and RunDisambig().
|
private |
Convenient way to keep track of disambiguation so far.
Definition at line 86 of file DisambigAlg.h.
Referenced by CompareViews(), Crawl(), MakeCloseHits(), MakeDisambigHit(), and RunDisambig().
|
private |
Within the close hits radius, how spread can the majority of the activity be around a possible endpoint
Definition at line 107 of file DisambigAlg.h.
Referenced by DisambigAlg(), and FindChanTimeEndPts().
|
private |
Number of channels the crawl can jump over.
Definition at line 104 of file DisambigAlg.h.
Referenced by Crawl(), and DisambigAlg().
std::map<unsigned int, unsigned int> apa::DisambigAlg::fnDUSoFar |
Definition at line 61 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
std::map<unsigned int, unsigned int> apa::DisambigAlg::fnDVSoFar |
Definition at line 62 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
std::map<unsigned int, unsigned int> apa::DisambigAlg::fnUSoFar |
Definition at line 59 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
std::map<unsigned int, unsigned int> apa::DisambigAlg::fnVSoFar |
Definition at line 60 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
std::map<unsigned int, double> apa::DisambigAlg::fUeffSoFar |
Definition at line 57 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
|
private |
Definition at line 102 of file DisambigAlg.h.
Referenced by DisambigAlg(), and RunDisambig().
std::map<unsigned int, double> apa::DisambigAlg::fVeffSoFar |
Definition at line 58 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
|
private |
Definition at line 70 of file DisambigAlg.h.
Referenced by CompareViews(), FindChanTimeEndPts(), MakeCloseHits(), TrivialDisambig(), and UseEndPts().