21 #ifndef ProjectionMatchingAlg_h 22 #define ProjectionMatchingAlg_h 49 class ProjectionMatchingAlg;
61 Name(
"OptimizationEps"),
62 Comment(
"relative change of the obj.fn which stops optimization after adding a node")
66 Name(
"FineTuningEps"),
67 Comment(
"relative change of the obj.fn which stops fine-tuning of optimized track")
71 Name(
"TrkValidationDist2D"),
72 Comment(
"max. distance [cm] used in the track validation in the third plane")
76 Name(
"HitTestingDist2D"),
77 Comment(
"max. distance [cm] used in testing compatibility of hits with the track")
81 Name(
"MinTwoViewFraction"),
82 Comment(
"min. fraction of track length covered with hits from many 2D views intertwinted with each other")
87 Comment(
"margin in [cm] around TPC for allowed track node positions")
92 Comment(
"weights used for hits in U plane")
97 Comment(
"weights used for hits in V plane")
102 Comment(
"weights used for hits in Z plane")
124 TH1F * histoPassing, TH1F * histoRejected)
const;
135 double validate(
const TVector3& p0,
const TVector3& p1,
137 unsigned int testView,
unsigned int tpc,
unsigned int cryo)
const;
148 double eps = 1.0)
const 188 const TVector3& point)
const;
194 const TVector3& point)
const;
202 const TVector2& vtx2d)
const;
210 bool add_nodes)
const;
237 double thr = 0.0,
unsigned int n = 0)
const { trk.
AutoFlip(
dir, thr,
n); };
247 unsigned int tpc,
unsigned int cryo,
252 std::pair<int, int>
const * wires,
double const * xPos,
253 unsigned int tpc,
unsigned int cryo)
const;
259 std::vector<size_t>& used,
262 bool Has(
const std::vector<size_t>& v,
size_t idx)
const;
unsigned int testHits(const pma::Track3D &trk, const std::vector< art::Ptr< recob::Hit > > &hits, double eps=1.0) const
Count the number of hits that are closer than eps * fHitTestingDist2D to the track 2D projection...
unsigned int TestHits(const std::vector< art::Ptr< recob::Hit > > &hits, double dist=0.4) const
Count close 2D hits.
pma::Track3D * buildShowerSeg(const std::vector< art::Ptr< recob::Hit > > &hits, const pma::Vector3D &vtx) const
Build a shower segment from sets of hits and attached to the provided vertex.
double fTrkValidationDist2D
pma::Node3D * LastElement(void) const
void AutoFlip(pma::Track3D::EDirection dir, double thr=0.0, unsigned int n=0)
detinfo::DetectorProperties const * fDetProp
Implementation of the Projection Matching Algorithm.
ProjectionMatchingAlg(const fhicl::ParameterSet &pset)
void guideEndpoints(pma::Track3D &trk, const std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > &hits) const
Add 3D reference points to clean endpoints of a track (both need to be in the same TPC)...
bool addEndpointRef(pma::Track3D &trk, const std::map< unsigned int, std::vector< art::Ptr< recob::Hit > > > &hits, std::pair< int, int > const *wires, double const *xPos, unsigned int tpc, unsigned int cryo) const
geo::GeometryCore const * fGeom
Declaration of signal hit object.
double fMinTwoViewFraction
Geometry information for a single TPC.
fhicl::Atom< double > NodeMargin3D
Planes which measure Z direction.
bool GetCloseHits(double r2d, const std::vector< art::Ptr< recob::Hit > > &hits_in, std::vector< size_t > &used, std::vector< art::Ptr< recob::Hit > > &hits_out) const
fhicl::Atom< double > TrkValidationDist2D
fhicl::Atom< double > HitWeightU
recob::tracking::Vector_t Vector3D
pma::Track3D * buildMultiTPCTrack(const std::vector< art::Ptr< recob::Hit > > &hits) const
as far as hits origin from at least two wire planes.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
fhicl::Atom< double > HitWeightV
double selectInitialHits(pma::Track3D &trk, unsigned int view=geo::kZ, unsigned int *nused=0) const
bool alignTracks(pma::Track3D &first, pma::Track3D &second) const
fhicl::Atom< double > HitWeightZ
bool isContained(const pma::Track3D &trk, float margin=0.0F) const
void autoFlip(pma::Track3D &trk, pma::Track3D::EDirection dir=Track3D::kForward, double thr=0.0, unsigned int n=0) const
fhicl::Atom< double > HitTestingDist2D
pma::Track3D * buildSegment(const std::vector< art::Ptr< recob::Hit > > &hits_1, const std::vector< art::Ptr< recob::Hit > > &hits_2=std::vector< art::Ptr< recob::Hit > >()) const
bool chkEndpointHits(int wire, int wdir, double drift_x, int view, unsigned int tpc, unsigned int cryo, const pma::Track3D &trk, const std::vector< art::Ptr< recob::Hit > > &hits) const
pma::Track3D * buildTrack(const std::vector< art::Ptr< recob::Hit > > &hits_1, const std::vector< art::Ptr< recob::Hit > > &hits_2=std::vector< art::Ptr< recob::Hit > >()) const
wire planes; number of segments used to create the track depends on the number of hits...
bool SameTPC(const TVector3 &p3d, float margin=0.0F) const
Check if p3d is in the same TPC as the node.
Description of geometry of one entire detector.
fhicl::Atom< double > FineTuningEps
void ShortenSeg(pma::Track3D &trk, const geo::TPCGeo &tpcgeom) const
Encapsulate the geometry of a wire.
bool Has(const std::vector< size_t > &v, size_t idx) const
double validate_on_adc_test(const pma::Track3D &trk, const img::DataProviderAlg &adcImage, const std::vector< art::Ptr< recob::Hit > > &hits, TH1F *histoPassing, TH1F *histoRejected) const
TVector3 const & Point3D(void) const
double validate_on_adc(const pma::Track3D &trk, const img::DataProviderAlg &adcImage, float thr) const
Implementation of the Projection Matching Algorithm.
static size_t getSegCount(size_t trk_size)
Encapsulate the construction of a single detector plane.
void FilterOutSmallParts(double r2d, const std::vector< art::Ptr< recob::Hit > > &hits_in, std::vector< art::Ptr< recob::Hit > > &hits_out, const TVector2 &vtx2d) const
pma::Track3D * extendTrack(const pma::Track3D &trk, const std::vector< art::Ptr< recob::Hit > > &hits, bool add_nodes) const
Add more hits to an existing track, reoptimize, optionally add more nodes.
ProjectionMatchingAlg(const Config &config)
std::vector< pma::Hit3D * > trimTrackToVolume(pma::Track3D &trk, TVector3 p0, TVector3 p1) const
fhicl::Atom< double > OptimizationEps
fhicl::Atom< double > MinTwoViewFraction
void RemoveNotEnabledHits(pma::Track3D &trk) const
double twoViewFraction(pma::Track3D &trk) const
double validate(const pma::Track3D &trk, const std::vector< art::Ptr< recob::Hit > > &hits) const
pma::Node3D * FirstElement(void) const
bool TestTrk(pma::Track3D &trk, const geo::TPCGeo &tpcgeom) const
art framework interface to geometry description
Encapsulate the construction of a single detector plane.
void mergeTracks(pma::Track3D &dst, pma::Track3D &src, bool reopt) const