21 #ifndef ProjectionMatchingAlg_h
22 #define ProjectionMatchingAlg_h
25 #include "fhiclcpp/types/Atom.h"
26 #include "fhiclcpp/types/Comment.h"
27 #include "fhiclcpp/types/Name.h"
28 #include "fhiclcpp/types/Table.h"
39 class DetectorPropertiesData;
46 class DataProviderAlg;
49 class ChannelStatusProvider;
59 class ProjectionMatchingAlg;
69 Name(
"OptimizationEps"),
70 Comment(
"relative change of the obj.fn which stops optimization after adding a node")};
73 Name(
"FineTuningEps"),
74 Comment(
"relative change of the obj.fn which stops fine-tuning of optimized track")};
77 Name(
"TrkValidationDist2D"),
78 Comment(
"max. distance [cm] used in the track validation in the third plane")};
81 Name(
"HitTestingDist2D"),
82 Comment(
"max. distance [cm] used in testing compatibility of hits with the track")};
85 Name(
"MinTwoViewFraction"),
86 Comment(
"min. fraction of track length covered with hits from many 2D views intertwinted "
91 Comment(
"margin in [cm] around TPC for allowed track node positions")};
126 TH1F* histoRejected)
const;
135 const std::vector<art::Ptr<recob::Hit>>& hits)
const;
146 unsigned int testView,
148 unsigned int cryo)
const;
161 double eps = 1.0)
const
181 const std::vector<art::Ptr<recob::Hit>>& hits_2 = {})
const;
187 const std::vector<art::Ptr<recob::Hit>>& hits)
const;
201 const std::vector<art::Ptr<recob::Hit>>& hits_2 = {})
const;
211 const TVector3& point)
const;
217 const TVector3& point)
const;
225 const TVector2& vtx2d)
const;
233 bool add_nodes)
const;
239 const std::map<
unsigned int,
std::vector<art::Ptr<recob::Hit>>>& hits)
const;
245 const std::map<
unsigned int,
std::vector<art::Ptr<recob::Hit>>>& hits)
const;
270 unsigned int n = 0)
const
279 unsigned int* nused = 0)
const;
291 const std::vector<art::Ptr<recob::Hit>>& hits)
const;
294 const std::map<
unsigned int,
std::vector<art::Ptr<recob::Hit>>>& hits,
295 std::pair<int, int>
const* wires,
298 unsigned int cryo)
const;
304 std::vector<size_t>& used,
305 std::vector<art::Ptr<recob::Hit>>& hits_out)
const;
307 bool Has_(
const std::vector<size_t>& v,
size_t idx)
const;
pma::Track3D * buildTrack(const detinfo::DetectorPropertiesData &detProp, const std::vector< art::Ptr< recob::Hit >> &hits_1, const std::vector< art::Ptr< recob::Hit >> &hits_2={}) const
bool addEndpointRef_(const detinfo::DetectorPropertiesData &detProp, 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
void AutoFlip(pma::Track3D::EDirection dir, double thr=0.0, unsigned int n=0)
bool Has_(const std::vector< size_t > &v, size_t idx) const
Implementation of the Projection Matching Algorithm.
ProjectionMatchingAlg(const fhicl::ParameterSet &pset)
double const fMinTwoViewFraction
pma::Track3D * extendTrack(const detinfo::DetectorPropertiesData &clockData, 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.
geo::GeometryCore const * fGeom
Declaration of signal hit object.
pma::Hit3D const * front() const
unsigned int TestHits(detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit >> &hits, double dist=0.4) const
Count close 2D hits.
Geometry information for a single TPC.
fhicl::Atom< double > NodeMargin3D
TVector3 const & Point3D() const
Planes which measure Z direction.
static size_t getSegCount_(size_t trk_size)
fhicl::Atom< double > TrkValidationDist2D
fhicl::Atom< double > HitWeightU
recob::tracking::Vector_t Vector3D
double const fFineTuningEps
bool GetCloseHits_(const detinfo::DetectorPropertiesData &detProp, 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
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
pma::Node3D * FirstElement() const
unsigned int testHits(detinfo::DetectorPropertiesData const &detProp, 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...
pma::Node3D * LastElement() 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
double const fTrkValidationDist2D
void autoFlip(pma::Track3D &trk, pma::Track3D::EDirection dir=Track3D::kForward, double thr=0.0, unsigned int n=0) const
fhicl::Atom< double > HitTestingDist2D
double validate_on_adc_test(const detinfo::DetectorPropertiesData &detProp, const lariov::ChannelStatusProvider &channelStatus, const pma::Track3D &trk, const img::DataProviderAlg &adcImage, const std::vector< art::Ptr< recob::Hit >> &hits, TH1F *histoPassing, TH1F *histoRejected) const
void FilterOutSmallParts(const detinfo::DetectorPropertiesData &detProp, double r2d, const std::vector< art::Ptr< recob::Hit >> &hits_in, std::vector< art::Ptr< recob::Hit >> &hits_out, const TVector2 &vtx2d) const
double const fHitTestingDist2D
double const fOptimizationEps
BEGIN_PROLOG vertical distance to the surface Name
Class providing information about the quality of channels.
bool SameTPC(const TVector3 &p3d, float margin=0.0F) const
Check if p3d is in the same TPC as the node.
pma::Track3D * buildSegment(const detinfo::DetectorPropertiesData &clockData, const std::vector< art::Ptr< recob::Hit >> &hits_1, const std::vector< art::Ptr< recob::Hit >> &hits_2={}) const
Description of geometry of one entire detector.
fhicl::Atom< double > FineTuningEps
Definition of data types for geometry description.
double validate(const detinfo::DetectorPropertiesData &detProp, const lariov::ChannelStatusProvider &channelStatus, const pma::Track3D &trk, const std::vector< art::Ptr< recob::Hit >> &hits) const
void ShortenSeg_(const detinfo::DetectorPropertiesData &detProp, pma::Track3D &trk, const geo::TPCGeo &tpcgeom) const
bool chkEndpointHits_(const detinfo::DetectorPropertiesData &detProp, 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 * buildShowerSeg(const detinfo::DetectorPropertiesData &detProp, const std::vector< art::Ptr< recob::Hit >> &hits, const pma::Vector3D &vtx) const
void mergeTracks(const detinfo::DetectorPropertiesData &detProp, pma::Track3D &dst, pma::Track3D &src, bool reopt) const
ProjectionMatchingAlg(const Config &config)
void guideEndpoints(const detinfo::DetectorPropertiesData &clockData, pma::Track3D &trk, const std::map< unsigned int, std::vector< art::Ptr< recob::Hit >>> &hits) const
pma::Hit3D const * back() const
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
physics associatedGroupsWithLeft p1
bool TestTrk_(pma::Track3D &trk, const geo::TPCGeo &tpcgeom) const
pma::Track3D * buildMultiTPCTrack(const detinfo::DetectorPropertiesData &clockData, const std::vector< art::Ptr< recob::Hit >> &hits) const