All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
33 #include "canvas/Persistency/Common/PtrVector.h"
34 namespace fhicl {
35  class ParameterSet;
36 }
37 
46 namespace detinfo {
47  class DetectorClocksData;
48  class DetectorPropertiesData;
49 }
50 
51 namespace trkf {
52  class KHitContainer;
53  class Propagator;
54 }
55 
56 #include <memory>
57 #include <vector>
58 
59 namespace trkf {
61  public:
62  explicit Track3DKalmanHitAlg(const fhicl::ParameterSet& pset);
63 
64  std::vector<trkf::KalmanOutput> makeTracks(detinfo::DetectorClocksData const& clockData,
66  KalmanInputs& kalman_inputs);
67  void fetchPFParticleSeeds(const art::PtrVector<recob::Seed>& pfseeds,
68  const std::vector<Hits>& pfseedhits,
69  std::vector<recob::Seed>& seeds,
70  std::vector<Hits>& hitsperseed) const;
71  recob::Seed makeSeed(detinfo::DetectorPropertiesData const& detProp, const Hits& hits) const;
73  const bool pfseed,
74  const std::vector<recob::Seed>& seeds,
75  const std::vector<Hits>& hitsperseed,
76  Hits& unusedhits,
77  Hits& hits,
78  std::deque<KGTrack>& kalman_tracks);
80  const bool pfseed,
81  const recob::Seed& seed,
82  const Hits& hpsit,
83  Hits& unusedhits,
84  Hits& hits,
85  std::deque<KGTrack>& kgtracks);
86  void chopHitsOffSeeds(Hits const& hpsit, bool pfseed, Hits& seedhits) const;
87  bool testSeedSlope(const double* dir) const;
88  std::shared_ptr<Surface> makeSurface(const recob::Seed& seed, double* dir) const;
90  const std::shared_ptr<trkf::Surface> psurf,
91  const Surface::TrackDirection trkdir,
92  Hits& seedhits,
93  Hits& hits,
94  std::deque<KGTrack>& kalman_tracks);
96  Propagator const& propagator,
97  KGTrack& trg0,
98  const Hits hits,
99  unsigned int prefplane,
100  std::deque<KGTrack>& kalman_tracks);
102  Propagator const& propagator,
103  KGTrack& trg1,
104  unsigned int prefplane,
105  Hits& trackhits) const;
106  void filterHitsOnKalmanTrack(const KGTrack& trg, Hits& hits, Hits& seederhits) const;
107  std::unique_ptr<KHitContainer> fillHitContainer(detinfo::DetectorPropertiesData const& detProp,
108  const Hits& hits) const;
109 
110  bool qualityCutsOnSeedTrack(const KGTrack& trg0) const;
111 
112  void fitnupdateMomentum(Propagator const& propagator, KGTrack& trg1, KGTrack& trg2) const;
113 
114  private:
115  // Fcl parameters.
116  bool fDoDedx; ///< Global dE/dx enable flag.
117  bool fSelfSeed; ///< Self seed flag.
118  double fMaxTcut; ///< Maximum delta ray energy in MeV for restricted dE/dx.
119  bool fLineSurface; ///< Line surface flag.
120  size_t fMinSeedHits; ///< Minimum number of hits per track seed.
121  int fMinSeedChopHits; ///< Potentially chop seeds that exceed this length.
122  int fMaxChopHits; ///< Maximum number of hits to chop from each end of seed.
123  double fMaxSeedChiDF; ///< Maximum seed track chisquare/dof.
124  double fMinSeedSlope; ///< Minimum seed slope (dx/dz).
125  double fInitialMomentum; ///< Initial (or constant) momentum.
126 
127  // Algorithm objects.
128 
129  KalmanFilterAlg fKFAlg; ///< Kalman filter algorithm.
131 
132  // Statistics.
133  int fNumTrack; ///< Number of tracks produced.
134  };
135 }
136 
137 #endif
void growSeedIntoTracks(detinfo::DetectorPropertiesData const &detProp, const bool pfseed, const recob::Seed &seed, const Hits &hpsit, Hits &unusedhits, Hits &hits, std::deque< KGTrack > &kgtracks)
TrackDirection
Track direction enum.
size_t fMinSeedHits
Minimum number of hits per track seed.
void filterHitsOnKalmanTrack(const KGTrack &trg, Hits &hits, Hits &seederhits) const
Filter hits that are on kalman tracks.
A collection of KHitGroups.
std::vector< trkf::KalmanOutput > makeTracks(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, KalmanInputs &kalman_inputs)
bool fDoDedx
Global dE/dx enable flag.
double fMaxSeedChiDF
Maximum seed track chisquare/dof.
Track3DKalmanHitAlg(const fhicl::ParameterSet &pset)
Constructor.
int fMinSeedChopHits
Potentially chop seeds that exceed this length.
void chopHitsOffSeeds(Hits const &hpsit, bool pfseed, Hits &seedhits) const
Chop hits off of the end of seeds.
double fInitialMomentum
Initial (or constant) momentum.
recob::Seed makeSeed(detinfo::DetectorPropertiesData const &detProp, const Hits &hits) const
Make seed method.
bool makeKalmanTracks(detinfo::DetectorPropertiesData const &detProp, const std::shared_ptr< trkf::Surface > psurf, const Surface::TrackDirection trkdir, Hits &seedhits, Hits &hits, std::deque< KGTrack > &kalman_tracks)
void growSeedsIntoTracks(detinfo::DetectorPropertiesData const &detProp, const bool pfseed, const std::vector< recob::Seed > &seeds, const std::vector< Hits > &hitsperseed, Hits &unusedhits, Hits &hits, std::deque< KGTrack > &kalman_tracks)
Grow Seeds method.
std::unique_ptr< KHitContainer > fillHitContainer(detinfo::DetectorPropertiesData const &detProp, const Hits &hits) const
Fill hit container with either seedhits or filtered hits i.e. recob::Hit.
Propagate between any two surfaces.
unsigned int seed
void fetchPFParticleSeeds(const art::PtrVector< recob::Seed > &pfseeds, const std::vector< Hits > &pfseedhits, std::vector< recob::Seed > &seeds, std::vector< Hits > &hitsperseed) const
Fetch Seeds method.
KalmanFilterAlg fKFAlg
Kalman filter algorithm.
Kalman Filter.
bool smoothandextendTrack(detinfo::DetectorPropertiesData const &detProp, Propagator const &propagator, KGTrack &trg0, const Hits hits, unsigned int prefplane, std::deque< KGTrack > &kalman_tracks)
SMooth and extend track.
tuple dir
Definition: dropbox.py:28
std::vector< TrajPoint > seeds
Definition: DataStructs.cxx:14
art::PtrVector< recob::Hit > Hits
void fitnupdateMomentum(Propagator const &propagator, KGTrack &trg1, KGTrack &trg2) const
fit and update method, used twice.
Contains all timing reference information for the detector.
int fNumTrack
Number of tracks produced.
bool testSeedSlope(const double *dir) const
bool fLineSurface
Line surface flag.
SeedFinderAlgorithm fSeedFinderAlg
Seed finder.
A collection of KHitTracks.
bool qualityCutsOnSeedTrack(const KGTrack &trg0) const
Quality cuts on seed track.
int fMaxChopHits
Maximum number of hits to chop from each end of seed.
std::vector< KalmanInput > KalmanInputs
bool fSelfSeed
Self seed flag.
auto const detProp
double fMinSeedSlope
Minimum seed slope (dx/dz).
bool extendandsmoothLoop(detinfo::DetectorPropertiesData const &detProp, Propagator const &propagator, KGTrack &trg1, unsigned int prefplane, Hits &trackhits) const
SMooth and extend a track in a loop.
double fMaxTcut
Maximum delta ray energy in MeV for restricted dE/dx.
std::shared_ptr< Surface > makeSurface(const recob::Seed &seed, double *dir) const
method to return a seed to surface.