Track3DKalmanHitAlg.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 ///
3 /// \file Track3DKalmanHitAlg.h
4 ///
5 /// \brief Track3DKalmanHit Algorithm
6 ///
7 /// \author
8 ///
9 ////////////////////////////////////////////////////////////////////////
10 // Configuration parameters:
11 // MaxTcut - Maximum delta ray energy in Mev for dE/dx.
12 // DoDedx - Global dE/dx enable flag.
13 // SelfSeed - Self seed flag.
14 // LineSurface - Hits on line surfaces (true) or plane surfaces (false).
15 // MinSeedHits - Minimum number of hits per track seed.
16 // MinSeedChopHits: - Potentially chop seeds that exceed this length.
17 // MaxChopHits - Maximum number of hits to chop from each end of seed.
18 // MaxSeedChiDF - Maximum seed track chisquare/dof.
19 // MinSeedSlope - Minimum seed slope (dx/dz).
20 // InitialMomentum - Initial momentum guess.
21 // KalmanFilterAlg - Parameter set for KalmanFilterAlg.
22 // SeedFinderAlg - Parameter set for seed finder algorithm object.
23 ////////////////////////////////////////////////////////////////////////
24 
25 #ifndef TRACK3DKALMANHITALG_H
26 #define TRACK3DKALMANHITALG_H
27 
28 #include <deque>
29 #include <memory>
30 #include <stddef.h>
31 #include <vector>
32 
34 #include "fhiclcpp/fwd.h"
35 
44 namespace detinfo {
45  class DetectorClocksData;
46  class DetectorPropertiesData;
47 }
48 
49 namespace trkf {
50  class KHitContainer;
51  class Propagator;
52 }
53 
54 namespace trkf {
56  public:
57  explicit Track3DKalmanHitAlg(const fhicl::ParameterSet& pset);
58 
59  std::vector<trkf::KalmanOutput> makeTracks(detinfo::DetectorClocksData const& clockData,
60  detinfo::DetectorPropertiesData const& detProp,
61  KalmanInputs& kalman_inputs);
62  void fetchPFParticleSeeds(const art::PtrVector<recob::Seed>& pfseeds,
63  const std::vector<Hits>& pfseedhits,
64  std::vector<recob::Seed>& seeds,
65  std::vector<Hits>& hitsperseed) const;
66  recob::Seed makeSeed(detinfo::DetectorPropertiesData const& detProp, const Hits& hits) const;
67  void growSeedsIntoTracks(detinfo::DetectorPropertiesData const& detProp,
68  const bool pfseed,
69  const std::vector<recob::Seed>& seeds,
70  const std::vector<Hits>& hitsperseed,
71  Hits& unusedhits,
72  Hits& hits,
73  std::deque<KGTrack>& kalman_tracks);
74  void growSeedIntoTracks(detinfo::DetectorPropertiesData const& detProp,
75  const bool pfseed,
76  const recob::Seed& seed,
77  const Hits& hpsit,
78  Hits& unusedhits,
79  Hits& hits,
80  std::deque<KGTrack>& kgtracks);
81  void chopHitsOffSeeds(Hits const& hpsit, bool pfseed, Hits& seedhits) const;
82  bool testSeedSlope(const double* dir) const;
83  std::shared_ptr<Surface> makeSurface(const recob::Seed& seed, double* dir) const;
84  bool makeKalmanTracks(detinfo::DetectorPropertiesData const& detProp,
85  const std::shared_ptr<trkf::Surface> psurf,
86  const Surface::TrackDirection trkdir,
87  Hits& seedhits,
88  Hits& hits,
89  std::deque<KGTrack>& kalman_tracks);
90  bool smoothandextendTrack(detinfo::DetectorPropertiesData const& detProp,
91  Propagator const& propagator,
92  KGTrack& trg0,
93  const Hits hits,
94  unsigned int prefplane,
95  std::deque<KGTrack>& kalman_tracks);
96  bool extendandsmoothLoop(detinfo::DetectorPropertiesData const& detProp,
97  Propagator const& propagator,
98  KGTrack& trg1,
99  unsigned int prefplane,
100  Hits& trackhits) const;
101  void filterHitsOnKalmanTrack(const KGTrack& trg, Hits& hits, Hits& seederhits) const;
102  std::unique_ptr<KHitContainer> fillHitContainer(detinfo::DetectorPropertiesData const& detProp,
103  const Hits& hits) const;
104 
105  bool qualityCutsOnSeedTrack(const KGTrack& trg0) const;
106 
107  void fitnupdateMomentum(Propagator const& propagator, KGTrack& trg1, KGTrack& trg2) const;
108 
109  private:
110  // Fcl parameters.
111  bool fDoDedx; ///< Global dE/dx enable flag.
112  bool fSelfSeed; ///< Self seed flag.
113  double fMaxTcut; ///< Maximum delta ray energy in MeV for restricted dE/dx.
114  bool fLineSurface; ///< Line surface flag.
115  size_t fMinSeedHits; ///< Minimum number of hits per track seed.
116  int fMinSeedChopHits; ///< Potentially chop seeds that exceed this length.
117  int fMaxChopHits; ///< Maximum number of hits to chop from each end of seed.
118  double fMaxSeedChiDF; ///< Maximum seed track chisquare/dof.
119  double fMinSeedSlope; ///< Minimum seed slope (dx/dz).
120  double fInitialMomentum; ///< Initial (or constant) momentum.
121 
122  // Algorithm objects.
123 
124  KalmanFilterAlg fKFAlg; ///< Kalman filter algorithm.
126 
127  // Statistics.
128  int fNumTrack; ///< Number of tracks produced.
129  };
130 }
131 
132 #endif
TrackDirection
Track direction enum.
Definition: Surface.h:56
size_t fMinSeedHits
Minimum number of hits per track seed.
A collection of KHitGroups.
bool fDoDedx
Global dE/dx enable flag.
double fMaxSeedChiDF
Maximum seed track chisquare/dof.
string dir
int fMinSeedChopHits
Potentially chop seeds that exceed this length.
double fInitialMomentum
Initial (or constant) momentum.
Base class for Kalman filter surface.
Propagate between any two surfaces.
General LArSoft Utilities.
KalmanFilterAlg fKFAlg
Kalman filter algorithm.
Kalman Filter.
std::vector< TrajPoint > seeds
Definition: DataStructs.cxx:13
Contains all timing reference information for the detector.
int fNumTrack
Number of tracks produced.
bool fLineSurface
Line surface flag.
SeedFinderAlgorithm fSeedFinderAlg
Seed finder.
A collection of KHitTracks.
int fMaxChopHits
Maximum number of hits to chop from each end of seed.
std::vector< KalmanInput > KalmanInputs
bool fSelfSeed
Self seed flag.
double fMinSeedSlope
Minimum seed slope (dx/dz).
double fMaxTcut
Maximum delta ray energy in MeV for restricted dE/dx.