12 #ifndef PMAlgTracking_h
13 #define PMAlgTracking_h
16 #include "canvas/Persistency/Common/FindManyP.h"
17 #include "canvas/Persistency/Common/Ptr.h"
18 #include "fhiclcpp/types/Atom.h"
19 #include "fhiclcpp/types/Comment.h"
20 #include "fhiclcpp/types/Name.h"
21 #include "fhiclcpp/types/Sequence.h"
39 class DetectorProperties;
72 std::vector<std::pair<TVector3, std::vector<std::pair<size_t, bool>>>>
78 std::vector<std::pair<TVector3, size_t>>
108 Name(
"TrackingOnlyPdg"),
109 Comment(
"PDG list to select which PFParticles should be reconstructed; all PFP's are used if "
110 "the list is empty or starts with 0")};
113 Name(
"TrackingSkipPdg"),
114 Comment(
"PDG list to select which PFParticles should NOT be reconstructed, e.g. skip EM-like "
115 "if contains 11; no skipping if the list is empty or starts with 0")};
118 Name(
"RunVertexing"),
120 "find vertices from PFP hierarchy, join with tracks, reoptimize track-vertex structure")};
124 const std::vector<recob::Cluster>& clusters,
125 const std::vector<recob::PFParticle>& pfparticles,
126 const art::FindManyP<recob::Hit>& hitsFromClusters,
127 const art::FindManyP<recob::Cluster>& clusFromPfps,
128 const art::FindManyP<recob::Vertex>& vtxFromPfps,
140 has(
const std::vector<int>& v,
int i)
const
143 if (c == i)
return true;
148 std::vector<std::vector<art::Ptr<recob::Hit>>>
fCluHits;
170 Name(
"MinSeedSize1stPass"),
171 Comment(
"min. cluster size used to start building a track in the 1st pass")};
174 Name(
"MinSeedSize2ndPass"),
175 Comment(
"min. cluster size used to start building a track in the 2nd pass")};
178 Comment(
"Threshold for track-like recognition")};
181 Name(
"RunVertexing"),
183 "find vertices from PFP hierarchy, join with tracks, reoptimize track-vertex structure")};
186 Comment(
"set the track direction to increasing Z values")};
189 Name(
"FlipDownward"),
190 Comment(
"set the track direction to decreasing Y values (like cosmic rays)")};
194 Comment(
"set the track direction to decreasing X values (like cosmic rays in dual phase)")};
197 Name(
"AutoFlip_dQdx"),
198 Comment(
"set the track direction to increasing dQ/dx (overrides FlipToBeam, FlipDownward and "
199 "FlipToX if significant rise of dQ/dx at the track end)")};
202 Name(
"MergeWithinTPC"),
203 Comment(
"merge witnin single TPC; finds tracks best matching by angle and displacement")};
206 Name(
"MergeTransverseShift"),
207 Comment(
"max. transverse displacement [cm] between tracks")};
211 Comment(
"max. angle [degree] between tracks (nearest segments)")};
214 Name(
"StitchBetweenTPCs"),
215 Comment(
"stitch between TPCs; finds tracks best matching by angle and displacement")};
218 Name(
"StitchDistToWall"),
219 Comment(
"max. track endpoint distance [cm] to TPC boundary")};
222 Name(
"StitchTransverseShift"),
223 Comment(
"max. transverse displacement [cm] between tracks")};
227 Comment(
"max. angle [degree] between tracks (nearest segments)")};
230 Name(
"MatchT0inAPACrossing"),
231 Comment(
"match T0 of APA-crossing tracks using PMAlgStitcher")};
234 Name(
"MatchT0inCPACrossing"),
235 Comment(
"match T0 of CPA-crossing tracks using PMAlgStitcher")};
238 Comment(
"tracks validation mode: hits, adc, calib")};
241 Name(
"AdcValidationThr"),
242 Comment(
"thresholds for not-empty pixel in the ADC track validation")};
246 Comment(
"ADC based image used for the track validation")};
250 const std::vector<recob::Wire>& wires,
257 const std::vector<TH1F*>& hpassing,
258 const std::vector<TH1F*>& hrejected);
260 void init(
const art::FindManyP<recob::Hit>& hitsFromClusters);
262 void init(
const art::FindManyP<recob::Hit>& hitsFromClusters,
263 const std::vector<float>& trackLike);
265 void init(
const art::FindManyP<recob::Hit>& hitsFromClusters,
266 const art::FindManyP<recob::Hit>& hitsFromEmParts);
291 double cosThr)
const;
305 unsigned int testView);
315 const std::vector<art::Ptr<recob::Hit>>& hits)
const;
319 const std::vector<art::Ptr<recob::Hit>>& first_hits,
334 detProp, first_clu_idx,
fCluHits[first_clu_idx], minSizeCompl, tpc, cryo, first_view);
341 unsigned int preferedView,
342 unsigned int testView,
344 unsigned int cryo)
const;
349 unsigned int testView,
360 unsigned int cryo)
const;
367 has(
const std::vector<size_t>& v,
size_t idx)
const
370 if (c == idx)
return true;
375 std::vector<std::vector<art::Ptr<recob::Hit>>>
fCluHits;
std::vector< std::pair< TVector3, size_t > > getKinks() const
pma::TrkCandidate matchCluster(detinfo::DetectorPropertiesData const &detProp, int first_clu_idx, const std::vector< art::Ptr< recob::Hit >> &first_hits, size_t minSizeCompl, unsigned int tpc, unsigned int cryo, geo::View_t first_view)
fhicl::Atom< bool > MatchT0inAPACrossing
std::map< int, pma::Vector3D > fPfpVtx
void guideEndpoints(detinfo::DetectorPropertiesData const &detProp, pma::TrkCandidateColl &tracks)
bool areCoLinear(pma::Track3D *trk1, pma::Track3D *trk2, double &dist, double &cos3d, bool &reverseOrder, double distThr, double distThrMin, double distProjThr, double cosThr) const
fhicl::Atom< double > MergeAngle
fhicl::Atom< bool > StitchBetweenTPCs
ClusterModuleLabel join with tracks
fhicl::Atom< double > StitchDistToWall
recob::Track convertFrom(const pma::Track3D &src, unsigned int tidx, int pdg=0)
geo::GeometryCore const * fGeom
size_t matchTrack(detinfo::DetectorPropertiesData const &detProp, const pma::TrkCandidateColl &tracks, const std::vector< art::Ptr< recob::Hit >> &hits) const
std::vector< std::pair< TVector3, size_t > > getKinks(const pma::TrkCandidateColl &tracks) const
void buildTracks(detinfo::DetectorPropertiesData const &detProp)
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
size_t fMinSeedSize2ndPass
double validate(detinfo::DetectorPropertiesData const &detProp, pma::Track3D &trk, unsigned int testView)
Declaration of signal hit object.
bool reassignHits_1(detinfo::DetectorPropertiesData const &detProp, const std::vector< art::Ptr< recob::Hit >> &hits, pma::TrkCandidateColl &tracks, size_t trk_idx, double dist2)
bool fMatchT0inAPACrossing
fhicl::Atom< double > StitchTransverseShift
double fMinTwoViewFraction
bool reassignSingleViewEnds_1(detinfo::DetectorPropertiesData const &detProp, pma::TrkCandidateColl &tracks)
std::map< size_t, pma::TrkCandidateColl > tpc_track_map
fhicl::Atom< std::string > Validation
bool fMatchT0inCPACrossing
std::map< unsigned int, tpc_view_hitmap > cryo_tpc_view_hitmap
std::vector< size_t > fInitialClusters
PMAlgTracker(const std::vector< art::Ptr< recob::Hit >> &allhitlist, const std::vector< recob::Wire > &wires, const pma::ProjectionMatchingAlg::Config &pmalgConfig, const pma::PMAlgTracker::Config &pmalgTrackerConfig, const pma::PMAlgVertexing::Config &pmvtxConfig, const pma::PMAlgStitching::Config &pmstitchConfig, const pma::PMAlgCosmicTagger::Config &pmtaggerConfig, const std::vector< TH1F * > &hpassing, const std::vector< TH1F * > &hrejected)
std::vector< std::pair< TVector3, std::vector< std::pair< size_t, bool > > > > getVertices(const pma::TrkCandidateColl &tracks, bool onlyBranching=false) const
pma::PMAlgCosmicTagger fCosmicTagger
fhicl::Atom< bool > MatchT0inCPACrossing
fhicl::Atom< bool > RunVertexing
std::map< int, std::vector< art::Ptr< recob::Cluster > > > fPfpClusters
fhicl::Atom< bool > MergeWithinTPC
fhicl::Sequence< int > TrackingSkipPdg
fhicl::Atom< size_t > MinSeedSize1stPass
double fStitchTransverseShift
fhicl::Sequence< int > TrackingOnlyPdg
std::map< unsigned int, std::vector< size_t > > fTriedClusters
int maxCluster(detinfo::DetectorPropertiesData const &detProp, int first_idx_tag, const pma::TrkCandidateColl &candidates, float xmin, float xmax, size_t min_clu_size, geo::View_t view, unsigned int tpc, unsigned int cryo) const
bool mergeCoLinear(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, pma::TrkCandidateColl &tracks) const
process_name pandoraGausCryo1 vertexChargeCryo1 vertexStubCryo1 xmin
std::vector< double > fAdcValidationThr
std::vector< int > fTrackingOnlyPdg
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
int build(detinfo::DetectorPropertiesData const &detProp)
fhicl::Atom< double > StitchAngle
pma::PMAlgStitching fStitcher
fhicl::Sequence< double > AdcValidationThr
double collectSingleViewEnd(pma::Track3D &trk, std::vector< art::Ptr< recob::Hit >> &hits) const
std::map< int, int > fPfpPdgCodes
fhicl::Atom< size_t > MinSeedSize2ndPass
std::vector< std::pair< TVector3, std::vector< std::pair< size_t, bool > > > > getVertices(bool onlyBranching=false) const
fhicl::Atom< bool > RunVertexing
float fTrackLikeThreshold
fhicl::Atom< bool > AutoFlip_dQdx
std::vector< int > fTrackingSkipPdg
const std::vector< recob::Wire > & fWires
bool has(const std::vector< size_t > &v, size_t idx) const
fhicl::Atom< double > MergeTransverseShift
pma::ProjectionMatchingAlg fProjectionMatchingAlg
double fMergeTransverseShift
BEGIN_PROLOG vertical distance to the surface Name
PMAlgTrackingBase(const std::vector< art::Ptr< recob::Hit >> &allhitlist, const pma::ProjectionMatchingAlg::Config &pmalgConfig, const pma::PMAlgVertexing::Config &pmvtxConfig)
void fromMaxCluster_tpc(detinfo::DetectorPropertiesData const &detProp, pma::TrkCandidateColl &result, size_t minBuildSize, unsigned int tpc, unsigned int cryo)
Description of geometry of one entire detector.
Declaration of cluster object.
std::vector< size_t > fUsedClusters
const pma::TrkCandidateColl & result()
Definition of data types for geometry description.
PMAlgFitter(const std::vector< art::Ptr< recob::Hit >> &allhitlist, const std::vector< recob::Cluster > &clusters, const std::vector< recob::PFParticle > &pfparticles, const art::FindManyP< recob::Hit > &hitsFromClusters, const art::FindManyP< recob::Cluster > &clusFromPfps, const art::FindManyP< recob::Vertex > &vtxFromPfps, const pma::ProjectionMatchingAlg::Config &pmalgConfig, const pma::PMAlgFitter::Config &pmalgFitterConfig, const pma::PMAlgVertexing::Config &pmvtxConfig)
Provides recob::Track data product.
bool has(const std::vector< int > &v, int i) const
std::vector< std::vector< art::Ptr< recob::Hit > > > fCluHits
std::vector< std::vector< art::Ptr< recob::Hit > > > fCluHits
Track finding helper for the Projection Matching Algorithm.
std::vector< float > fCluWeights
fhicl::Table< img::DataProviderAlg::Config > AdcImageAlg
fhicl::Atom< float > TrackLikeThreshold
void freezeBranchingNodes(pma::TrkCandidateColl &tracks) const
Contains all timing reference information for the detector.
const std::vector< TH1F * > & fAdcInPassingPoints
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
void init(const art::FindManyP< recob::Hit > &hitsFromClusters)
fhicl::Atom< bool > FlipToBeam
double collectSingleViewFront(pma::Track3D &trk, std::vector< art::Ptr< recob::Hit >> &hits) const
const std::vector< TH1F * > & fAdcInRejectedPoints
void listUsedClusters(detinfo::DetectorPropertiesData const &detProp) const
int build(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp)
std::vector< geo::View_t > fAvailableViews
void releaseAllNodes(pma::TrkCandidateColl &tracks) const
size_t fMinSeedSize1stPass
pma::TrkCandidateColl fResult
bool extendTrack(detinfo::DetectorPropertiesData const &detProp, pma::TrkCandidate &candidate, const std::vector< art::Ptr< recob::Hit >> &hits, unsigned int testView, bool add_nodes)
fhicl::Atom< bool > FlipToX
EValidationMode fValidation
fhicl::Atom< bool > FlipDownward
pma::PMAlgVertexing fPMAlgVertexing
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
pma::TrkCandidate matchCluster(detinfo::DetectorPropertiesData const &detProp, int first_clu_idx, size_t minSizeCompl, unsigned int tpc, unsigned int cryo, geo::View_t first_view)
pma::cryo_tpc_view_hitmap fHitMap
std::vector< img::DataProviderAlg > fAdcImages
void buildShowers(detinfo::DetectorPropertiesData const &detProp)