LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "DisambigAlg.h"
Public Member Functions | |
DisambigAlg (fhicl::ParameterSet const &pset) | |
virtual | ~DisambigAlg () |
void | reconfigure (fhicl::ParameterSet const &p) |
void | RunDisambig (art::Handle< std::vector< recob::Hit > > GausHits) |
Run disambiguation as currently configured. More... | |
void | TrivialDisambig (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 (unsigned int apa) |
Basic endpoint-hit finder per apa. More... | |
void | UseEndPts (unsigned int apa) |
Try to associate endpoint hits and crawl from there. More... | |
unsigned int | CompareViews (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 > 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 (art::Ptr< recob::Hit > hitA, art::Ptr< recob::Hit > hitB) |
bool | HitsReasonablyMatch (art::Ptr< recob::Hit > hitA, art::Ptr< recob::Hit > hitB) |
Private Attributes | |
apa::APAGeometryAlg | fAPAGeo |
art::ServiceHandle< geo::Geometry > | geom |
const detinfo::DetectorProperties * | detprop |
art::ServiceHandle< cheat::BackTrackerService > | bt_serv |
For TEMPORARY monitering of potential problems. More... | |
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 |
Distance (cm) away from a hit to look when checking if it's an endpoint. More... | |
double | fMaxEndPDegRange |
Definition at line 40 of file DisambigAlg.h.
apa::DisambigAlg::DisambigAlg | ( | fhicl::ParameterSet const & | pset | ) |
Definition at line 45 of file DisambigAlg.cxx.
References reconfigure().
|
virtual |
Definition at line 52 of file DisambigAlg.cxx.
void apa::DisambigAlg::AssessDisambigSoFar | ( | unsigned int | apa | ) |
See how much disambiguation has been done in this apa so far.
Definition at line 676 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 | ( | unsigned int | apa | ) |
Compare U and V to see if one says something about the other.
Definition at line 706 of file DisambigAlg.cxx.
References recob::Hit::Channel(), geo::GeometryCore::ChannelToWire(), d, fAPAToUVHits, fChanTimeToWid, fHasBeenDisambiged, geom, HitsOverlapInTime(), MakeDisambigHit(), recob::Hit::PeakTime(), recob::Hit::View(), 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 399 of file DisambigAlg.cxx.
References fAPAToUVHits, fChanTimeToWid, fHasBeenDisambiged, fNChanJumps, hits(), and MakeCloseHits().
Referenced by RunDisambig(), and UseEndPts().
unsigned int apa::DisambigAlg::FindChanTimeEndPts | ( | 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 444 of file DisambigAlg.cxx.
References recob::Hit::Channel(), apa::APAGeometryAlg::ChannelsInView(), detinfo::DetectorProperties::ConvertTicksToX(), geo::CryostatID::Cryostat, detprop, fAPAGeo, fAPAToEndPHits, fAPAToHits, fCloseHitsRadius, apa::APAGeometryAlg::FirstChannelInView(), fMaxEndPDegRange, geom, geo::kV, geo::kZ, recob::Hit::PeakTime(), util::pi(), geo::TPCID::TPC, recob::Hit::View(), recob::Hit::WireID(), and geo::GeometryCore::WirePitch().
Referenced by RunDisambig().
|
private |
Definition at line 225 of file DisambigAlg.cxx.
References detprop, geo::kU, geo::kV, geo::kZ, recob::Hit::PeakTimeMinusRMS(), recob::Hit::PeakTimePlusRMS(), detinfo::DetectorProperties::TimeOffsetU(), detinfo::DetectorProperties::TimeOffsetV(), detinfo::DetectorProperties::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 326 of file DisambigAlg.cxx.
References recob::Hit::Channel(), apa::APAGeometryAlg::ChannelsInView(), apa::APAGeometryAlg::ChannelToAPA(), geo::GeometryCore::ChannelToWire(), geo::CryostatID::Cryostat, fAPAGeo, fChannelToHits, fHasBeenDisambiged, apa::APAGeometryAlg::FirstChannelInView(), geom, geo::kZ, MakeDisambigHit(), recob::Hit::PeakTime(), recob::Hit::PeakTimeMinusRMS(), recob::Hit::PeakTimePlusRMS(), geo::PlaneID::Plane, 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 201 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::reconfigure | ( | fhicl::ParameterSet const & | p | ) |
Definition at line 57 of file DisambigAlg.cxx.
References fCloseHitsRadius, fCompareViews, fCrawl, fMaxEndPDegRange, fNChanJumps, fUseEndP, and fhicl::ParameterSet::get().
Referenced by DisambigAlg().
void apa::DisambigAlg::RunDisambig | ( | art::Handle< std::vector< recob::Hit > > | GausHits | ) |
Run disambiguation as currently configured.
Definition at line 72 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 | ( | 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 250 of file DisambigAlg.cxx.
References bt_serv, recob::Hit::Channel(), geo::GeometryCore::ChannelToWire(), geo::CryostatID::Cryostat, geo::GeometryCore::Cryostat(), d, fAPAToUVHits, fAPAToZHits, geom, HitsOverlapInTime(), cheat::BackTrackerService::HitToXYZ(), geo::TPCGeo::LocalToWorld(), MakeDisambigHit(), geo::GeometryCore::NearestChannel(), geo::GeometryCore::NTPC(), recob::Hit::PeakTime(), geo::PlaneID::Plane, geo::CryostatGeo::TPC(), geo::TPCID::TPC, w, geo::WireID::Wire, geo::GeometryCore::WireEndPoints(), and z.
Referenced by RunDisambig().
void apa::DisambigAlg::UseEndPts | ( | 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 557 of file DisambigAlg.cxx.
References apa::APAGeometryAlg::APAChannelsIntersect(), recob::Hit::Channel(), Crawl(), geo::GeometryCore::Cryostat(), fAPAGeo, fAPAToEndPHits, geom, HitsOverlapInTime(), geo::kU, geo::kV, geo::kZ, geo::TPCGeo::LocalToWorld(), MakeDisambigHit(), apa::APAGeometryAlg::NearestWireIDOnChan(), apa::APAGeometryAlg::ThreeChanPos(), and geo::CryostatGeo::TPC().
Referenced by RunDisambig().
|
private |
For TEMPORARY monitering of potential problems.
Definition at line 76 of file DisambigAlg.h.
Referenced by RunDisambig(), and TrivialDisambig().
|
private |
Definition at line 75 of file DisambigAlg.h.
Referenced by FindChanTimeEndPts(), and HitsOverlapInTime().
|
private |
Definition at line 73 of file DisambigAlg.h.
Referenced by FindChanTimeEndPts(), MakeCloseHits(), RunDisambig(), and UseEndPts().
|
private |
Hold the disambiguations per APA.
Definition at line 84 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 83 of file DisambigAlg.h.
Referenced by FindChanTimeEndPts(), RunDisambig(), and UseEndPts().
|
private |
Definition at line 81 of file DisambigAlg.h.
Referenced by FindChanTimeEndPts(), and RunDisambig().
|
private |
Definition at line 80 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), CompareViews(), Crawl(), RunDisambig(), and TrivialDisambig().
|
private |
Definition at line 80 of file DisambigAlg.h.
Referenced by RunDisambig(), and TrivialDisambig().
|
private |
Definition at line 79 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 90 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 115 of file DisambigAlg.h.
Referenced by FindChanTimeEndPts(), and reconfigure().
|
private |
Definition at line 113 of file DisambigAlg.h.
Referenced by reconfigure(), and RunDisambig().
|
private |
\ todo: Write function that compares hits more detailedly
Definition at line 111 of file DisambigAlg.h.
Referenced by reconfigure(), 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 67 of file DisambigAlg.h.
Referenced by apa::APAHitFinder::produce(), and RunDisambig().
|
private |
Convenient way to keep track of disambiguation so far.
Definition at line 92 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 116 of file DisambigAlg.h.
Referenced by FindChanTimeEndPts(), and reconfigure().
|
private |
Number of channels the crawl can jump over.
Definition at line 114 of file DisambigAlg.h.
Referenced by Crawl(), and reconfigure().
std::map<unsigned int, unsigned int> apa::DisambigAlg::fnDUSoFar |
Definition at line 64 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
std::map<unsigned int, unsigned int> apa::DisambigAlg::fnDVSoFar |
Definition at line 65 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
std::map<unsigned int, unsigned int> apa::DisambigAlg::fnUSoFar |
Definition at line 62 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
std::map<unsigned int, unsigned int> apa::DisambigAlg::fnVSoFar |
Definition at line 63 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
std::map<unsigned int, double> apa::DisambigAlg::fUeffSoFar |
Definition at line 60 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
|
private |
Definition at line 112 of file DisambigAlg.h.
Referenced by reconfigure(), and RunDisambig().
std::map<unsigned int, double> apa::DisambigAlg::fVeffSoFar |
Definition at line 61 of file DisambigAlg.h.
Referenced by AssessDisambigSoFar(), and RunDisambig().
|
private |
Definition at line 74 of file DisambigAlg.h.
Referenced by CompareViews(), FindChanTimeEndPts(), MakeCloseHits(), TrivialDisambig(), and UseEndPts().