LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
Track3DKalmanHitAlg.h
Go to the documentation of this file.
1 // 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.
24 
25 
26 #ifndef TRACK3DKALMANHITALG_H
27 #define TRACK3DKALMANHITALG_H
28 
29 #include <cmath>
30 #include <algorithm>
31 #include <vector>
32 #include <deque>
33 
39 
40 #include "TMath.h"
41 
59 
60 #include "TH1F.h"
61 
62 namespace trkf {
63  class Propagator;
65  public:
66 
68  explicit Track3DKalmanHitAlg(const fhicl::ParameterSet& pset);
69 
71  void reconfigure(const fhicl::ParameterSet& pset);
72 
73  // Private member functions that do not use art::event or Assns
74  // but use art::PtrVector and art::Ptr.
75  std::vector<trkf::KalmanOutput> makeTracks(KalmanInputs &kalman_inputs);
77  const std::vector<Hits> &pfseedhits,
78  std::vector<recob::Seed>& seeds,
79  std::vector<Hits>& hitsperseed);
80  recob::Seed makeSeed(const Hits& hits) const;
81  void growSeedsIntoTracks(const bool pfseed,
82  const std::vector<recob::Seed>& seeds,
83  const std::vector<Hits >& hitsperseed,
84  Hits& unusedhits,
85  Hits& hits,
86  std::deque<KGTrack>& kalman_tracks);
87  void growSeedIntoTracks(const bool pfseed,
88  const recob::Seed& seed,
89  const Hits& hpsit,
90  Hits& unusedhits,
91  Hits& hits,
92  std::deque<KGTrack>& kgtracks);
93  void chopHitsOffSeeds(Hits const & hpsit,
94  bool pfseed,
95  Hits &seedhits) const;
96  bool testSeedSlope(const double *dir) const;
97  std::shared_ptr<Surface> makeSurface(const recob::Seed &seed, double *dir) const;
98  bool makeKalmanTracks(const std::shared_ptr<trkf::Surface> psurf,
99  const Surface::TrackDirection trkdir,
100  Hits& seedhits,
101  Hits& hits,
102  std::deque<KGTrack>& kalman_tracks);
103  bool smoothandextendTrack(KGTrack &trg0,
104  const Hits hits,
105  unsigned int prefplane,
106  std::deque<KGTrack>& kalman_tracks);
107  bool extendandsmoothLoop(
108  KGTrack &trg1,
109  unsigned int prefplane,
110  Hits &trackhits);
111  void filterHitsOnKalmanTrack(const KGTrack& trg,
112  Hits& hits,
113  Hits& seederhits) const;
114  std::unique_ptr<KHitContainer> fillHitContainer(const Hits &hits) const;
115 
116  bool qualityCutsOnSeedTrack(const KGTrack &trg0) const;
117 
118  void fitnupdateMomentum(KGTrack& trg1,
119  KGTrack& trg2);
120 
121  private:
122 
123  // Fcl parameters.
124  bool fDoDedx;
125  bool fSelfSeed;
126  double fMaxTcut;
128  size_t fMinSeedHits;
131  double fMaxSeedChiDF;
132  double fMinSeedSlope;
134 
135  // Algorithm objects.
136 
139 
141  std::unique_ptr<const Propagator> fProp;
142 
143  // Statistics.
144  int fNumTrack;
145 
146  };
147 }
148 
149 #endif
TrackDirection
Track direction enum.
Definition: Surface.h:56
General planar surface.
A KHitContainer for KHitWireLine type measurements.
bool fetchPFParticleSeeds(const art::PtrVector< recob::Seed > &pfseeds, const std::vector< Hits > &pfseedhits, std::vector< recob::Seed > &seeds, std::vector< Hits > &hitsperseed)
Fetch Seeds method.
A KHitContainer for KHitWireX type measurements.
size_t fMinSeedHits
Minimum number of hits per track seed.
Declaration of signal hit object.
void filterHitsOnKalmanTrack(const KGTrack &trg, Hits &hits, Hits &seederhits) const
Filter hits that are on kalman tracks.
std::vector< trkf::KalmanOutput > makeTracks(KalmanInputs &kalman_inputs)
bool fDoDedx
Global dE/dx enable flag.
std::unique_ptr< const Propagator > fProp
Propagator.
void growSeedsIntoTracks(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.
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.
bool extendandsmoothLoop(KGTrack &trg1, unsigned int prefplane, Hits &trackhits)
SMooth and extend a track in a loop.
void hits()
Definition: readHits.C:15
Provides recob::Track data product.
long seed
Definition: chem4.cc:68
Kalman filter measurement class template.
Propagate between any two surfaces.
bool smoothandextendTrack(KGTrack &trg0, const Hits hits, unsigned int prefplane, std::deque< KGTrack > &kalman_tracks)
SMooth and extend track.
Declaration of cluster object.
void reconfigure(const fhicl::ParameterSet &pset)
Reconfigure method.
KalmanFilterAlg fKFAlg
Kalman filter algorithm.
Kalman Filter.
std::vector< TrajPoint > seeds
Definition: DataStructs.cxx:11
Utility object to perform functions of association.
int fNumTrack
Number of tracks produced.
TDirectory * dir
Definition: macro.C:5
bool testSeedSlope(const double *dir) const
bool fLineSurface
Line surface flag.
void growSeedIntoTracks(const bool pfseed, const recob::Seed &seed, const Hits &hpsit, Hits &unusedhits, Hits &hits, std::deque< KGTrack > &kgtracks)
recob::Seed makeSeed(const Hits &hits) const
Make seed method.
std::unique_ptr< KHitContainer > fillHitContainer(const Hits &hits) const
Fill hit container with either seedhits or filtered hits i.e. recob::Hit.
SeedFinderAlgorithm fSeedFinderAlg
Seed finder.
bool qualityCutsOnSeedTrack(const KGTrack &trg0) const
Quality cuts on seed track.
int fMaxChopHits
Maximum number of hits to chop from each end of seed.
void fitnupdateMomentum(KGTrack &trg1, KGTrack &trg2)
fit and update method, used twice.
std::vector< KalmanInput > KalmanInputs
bool fSelfSeed
Self seed flag.
art framework interface to geometry description
double fMinSeedSlope
Minimum seed slope (dx/dz).
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.
bool makeKalmanTracks(const std::shared_ptr< trkf::Surface > psurf, const Surface::TrackDirection trkdir, Hits &seedhits, Hits &hits, std::deque< KGTrack > &kalman_tracks)