LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
Track3DKalmanHitAlg.cxx
Go to the documentation of this file.
1 
12 
13 // Local functions.
14 
15 namespace {
16  inline double calcMagnitude(const double *x){
17  return std::sqrt(x[0]*x[0] + x[1]*x[1] + x[2]*x[2]);
18  }
19 
20 
21  //----------------------------------------------------------------------------
22  // Filter a collection of hits (set difference).
23  //
24  // Arguments:
25  //
26  // hits - Hit collection from which hits should be removed.
27  // used_hits - Hits to remove.
28  //
29  void filterHits(trkf::Hits& hits,
30  trkf::Hits& used_hits)
31  {
32  if(used_hits.size() > 0) {
33  // Make sure both hit collections are sorted.
34  std::stable_sort(hits.begin(), hits.end());
35  std::stable_sort(used_hits.begin(), used_hits.end());
36 
37  // Do set difference operation.
39  std::set_difference(hits.begin(), hits.end(),
40  used_hits.begin(), used_hits.end(),
41  hits.begin());
42 
43  // Truncate hit collection.
44  hits.erase(it, hits.end());
45  }
46  }
47 
48 }
49 //----------------------------------------------------------------------------
51 
53 fDoDedx(false),
54 fSelfSeed(false),
55 fMaxTcut(0.),
56 fLineSurface(false),
57 fMinSeedHits(0),
58 fMinSeedChopHits(0),
59 fMaxChopHits(0),
60 fMaxSeedChiDF(0.),
61 fMinSeedSlope(0.),
62 fInitialMomentum(0.),
63 fKFAlg(pset.get<fhicl::ParameterSet>("KalmanFilterAlg")),
64 fSeedFinderAlg(pset.get<fhicl::ParameterSet>("SeedFinderAlg")),
65 fProp(nullptr),
66 fNumTrack(0)
67 {
68  mf::LogInfo("Track3DKalmanHitAlg") << "Track3DKalmanHitAlg instantiated.";
69 
70  // Load fcl parameters.
71 
72  reconfigure(pset);
73 }
74 
75 //----------------------------------------------------------------------------
76 
79 {
80  fDoDedx = pset.get<bool>("DoDedx");
81  fSelfSeed = pset.get<bool>("SelfSeed");
82  fMaxTcut = pset.get<double>("MaxTcut");
83  fLineSurface = pset.get<bool>("LineSurface");
84  fMinSeedHits = pset.get<size_t>("MinSeedHits");
85  fMinSeedChopHits = pset.get<int>("MinSeedChopHits");
86  fMaxChopHits = pset.get<int>("MaxChopHits");
87  fMaxSeedChiDF = pset.get<double>("MaxSeedChiDF");
88  fMinSeedSlope = pset.get<double>("MinSeedSlope");
89  fInitialMomentum = pset.get<double>("InitialMomentum");
90  fKFAlg.reconfigure(pset.get<fhicl::ParameterSet>("KalmanFilterAlg"));
91  fSeedFinderAlg.reconfigure(pset.get<fhicl::ParameterSet>("SeedFinderAlg"));
92  fProp.reset(new PropAny(fMaxTcut, fDoDedx));
93 }
94 
95 //----------------------------------------------------------------------------
96 //makeTracks
97 std::vector<trkf::KalmanOutput> trkf::Track3DKalmanHitAlg::makeTracks(KalmanInputs &inputs){
98  std::vector<KalmanOutput> outputs(inputs.size());
99  // Loop over input vectors.
100  for (size_t i = 0; i<inputs.size(); ++i) {
101  Hits& hits = inputs[i].hits;
102  // The hit collection "hits" (just filled), initially containing all
103  // hits, represents hits available for making tracks. Now we will
104  // fill a second hit collection called "unusedhits", also initially
105  // containing all hits, which will represent hits available for
106  // making track seeds. These collections are not necessarily the
107  // same, since hits that are not suitable for seeds may still be
108  // suitable for tracks.
109  Hits unusedhits = hits;
110  // Start of loop.
111  bool first = true;
112  while(true) {
113  std::vector<Hits> hitsperseed;
114  std::vector<recob::Seed> seeds;
115  // On the first trip through this loop, try to use pfparticle-associated seeds.
116  // Do this, provided the list of pfparticle-associated seeds and associated
117  // hits are not empty.
118  bool pfseed = false;
119  auto const seedsize = inputs[i].seeds.size();
120  if(first && seedsize > 0 && inputs[i].seedhits.size() > 0) {
121  seeds.reserve(seedsize);
122  pfseed = fetchPFParticleSeeds(inputs[i].seeds,
123  inputs[i].seedhits,
124  seeds,
125  hitsperseed);
126  }
127  else {
128  // On subsequent trips, or if there were no usable pfparticle-associated seeds,
129  // attempt to generate our own seeds.
130  if(unusedhits.size()>0) {
131  if(fSelfSeed) {
132  // Self seed - convert all hits into one big seed.
133  seeds.emplace_back(makeSeed(unusedhits));
134  hitsperseed.emplace_back();
135  hitsperseed.back().insert(hitsperseed.back().end(),
136  unusedhits.begin(),
137  unusedhits.end());
138  }
139  else seeds = fSeedFinderAlg.GetSeedsFromUnSortedHits(unusedhits, hitsperseed);
140  }
141  }
142 
143  assert(seeds.size() == hitsperseed.size());
144  first = false;
145 
146  if(seeds.size() == 0) break;
147  else growSeedsIntoTracks(pfseed, seeds, hitsperseed, unusedhits, hits, outputs[i].tracks);
148  }
149  }
150  return outputs;
151 }
152 
153 //----------------------------------------------------------------------------
155 
157  const std::vector<Hits> &pfseedhits,
158  std::vector<recob::Seed>& seeds,
159  std::vector<Hits>& hitsperseed){
160  for(const auto& pseed : pfseeds) {
161  seeds.push_back(*pseed);
162  }
163  hitsperseed.insert(hitsperseed.end(),
164  pfseedhits.begin(),
165  pfseedhits.end());
166  return true;
167 }
168 
169 //----------------------------------------------------------------------------
171 
173  const std::vector<recob::Seed>& seeds,
174  const std::vector<Hits >& hitsperseed,
175  Hits& unusedhits,
176  Hits& hits,
177  std::deque<KGTrack>& kgtracks){
178  //check for size of both containers
179  if (seeds.size() != hitsperseed.size()){
180  throw cet::exception("Track3DKalmanHitAlg")
181  << "Different size containers for Seeds and Hits/Seed.\n";
182  }
183  for(size_t i = 0; i < seeds.size(); ++i){
184  growSeedIntoTracks(pfseed, seeds[i], hitsperseed[i], unusedhits, hits, kgtracks);
185  }
186 }
187 
188 //----------------------------------------------------------------------------
190  const recob::Seed& seed,
191  const Hits& hpsit,
192  Hits& unusedhits,
193  Hits& hits,
194  std::deque<KGTrack>& kgtracks){
195 
196  Hits trimmedhits;
197  // Chop a couple of hits off each end of the seed.
198  chopHitsOffSeeds(hpsit, pfseed, trimmedhits);
199 
200  // Filter hits used by (chopped) seed from hits available to make future seeds.
201  // No matter what, we will never use these hits for another seed.
202  // This eliminates the possibility of an infinite loop.
203 
204  size_t initial_unusedhits = unusedhits.size();
205  filterHits(unusedhits, trimmedhits);
206 
207  // Require that this seed be fully disjoint from existing tracks.
208  //SS: replace this test with a method with appropriate name
209  if(!(trimmedhits.size() + unusedhits.size() == initial_unusedhits)) return;
210 
211  // Convert seed into initial KTracks on surface located at seed point,
212  // and normal to seed direction.
213  double dir[3];
214  std::shared_ptr<Surface> psurf = makeSurface(seed, dir);
215 
216  // Cut on the seed slope dx/ds.
217  //SS: replace test name with a reasonable name
218  if (!testSeedSlope(dir)) return;
219 
220  // Make one or two initial KTracks for forward and backward directions.
221  // The build_both flag specifies whether we should attempt to make
222  // tracks from all both FORWARD and BACKWARD initial tracks,
223  // or alternatively, whether we
224  // should declare victory and quit after getting a successful
225  // track from one initial track.
226  const bool build_both = fDoDedx;
227  const int ninit = 2;
228 
229  auto ntracks = kgtracks.size(); // Remember original track count.
230  bool ok = makeKalmanTracks(psurf, Surface::FORWARD, trimmedhits, hits, kgtracks);
231  if ((!ok || build_both) && ninit == 2) {
232  makeKalmanTracks(psurf, Surface::BACKWARD, trimmedhits, hits, kgtracks);
233  }
234 
235  // Loop over newly added tracks and remove hits contained on
236  // these tracks from hits available for making additional
237  // tracks or track seeds.
238  for(unsigned int itrk = ntracks; itrk < kgtracks.size(); ++itrk) {
239  const KGTrack& trg = kgtracks[itrk];
240  filterHitsOnKalmanTrack(trg, hits, unusedhits);
241  }
242 
243 }
244 
245 
246 //----------------------------------------------------------------------------
248 
249 std::shared_ptr<trkf::Surface> trkf::Track3DKalmanHitAlg::makeSurface(const recob::Seed &seed,
250  double *dir) const {
251  double xyz[3];
252  double err[3]; // Dummy.
253  seed.GetPoint(xyz, err);
254  seed.GetDirection(dir, err);
255  if (mf::isDebugEnabled()) {
256  mf::LogDebug("Track3DKalmanHit")
257  //<< "Seed found with " << seedhits.size() <<" hits.\n"
258  << "(x,y,z) = " << xyz[0] << ", " << xyz[1] << ", " << xyz[2] << "\n"
259  << "(dx,dy,dz) = " << dir[0] << ", " << dir[1] << ", " << dir[2] << "\n";
260  } // if debug
261 
262  return std::shared_ptr<Surface>(new SurfXYZPlane(xyz[0], xyz[1], xyz[2],
263  dir[0], dir[1], dir[2]));
264 }
265 
266 
267 
268 //----------------------------------------------------------------------------
269 
270 bool trkf::Track3DKalmanHitAlg::makeKalmanTracks(const std::shared_ptr<trkf::Surface> psurf,
271  const Surface::TrackDirection trkdir,
272  Hits& seedhits,
273  Hits& hits,
274  std::deque<KGTrack>& kgtracks) {
275  const int pdg = 13; //SS: FIXME another constant?
276  // SS: FIXME
277  // It is a contant value inside a loop so I took it out
278  // revisit the linear algebra stuff used here (use of ublas)
279  // make a lambda here ... const TrackVector
280  //
281  TrackVector vec(5);
282  vec(0) = 0.;
283  vec(1) = 0.;
284  vec(2) = 0.;
285  vec(3) = 0.;
286  vec(4) = (fInitialMomentum != 0. ? 1./fInitialMomentum : 2.);
287 
288  KTrack initial_track(KTrack(psurf, vec, trkdir, pdg));
289 
290  // Fill hit container with current seed hits.
291  //KHitContainer may not be cheaply movabale thats why unique_ptr
292  std::unique_ptr<KHitContainer> pseedcont = fillHitContainer(seedhits);
293 
294  // Set the preferred plane to be the one with the most hits.
295  unsigned int prefplane = pseedcont->getPreferredPlane();
296  fKFAlg.setPlane(prefplane);
297  if (mf::isDebugEnabled())
298  mf::LogDebug("Track3DKalmanHit") << "Preferred plane = " << prefplane << "\n";
299 
300  // Build and smooth seed track.
301  KGTrack trg0(prefplane);
302  bool ok = fKFAlg.buildTrack(initial_track, trg0, fProp.get(), Propagator::FORWARD, *pseedcont, fSelfSeed);
303  if(ok) ok = smoothandextendTrack(trg0, hits, prefplane, kgtracks);
304 
305  if (mf::isDebugEnabled())
306  mf::LogDebug("Track3DKalmanHit")
307  << (ok? "Find track succeeded.": "Find track failed.") << "\n";
308  return ok;
309 }
310 
311 //----------------------------------------------------------------------------
312 
314  return std::abs(dir[0]) >= fMinSeedSlope * calcMagnitude(dir);
315 }
316 
317 
318 //----------------------------------------------------------------------------
321  Hits& hits,
322  Hits& seederhits) const{
323  Hits track_used_hits;
324  std::vector<unsigned int> hittpindex;
325  trg.fillHits(track_used_hits, hittpindex);
326  filterHits(hits, track_used_hits);
327  filterHits(seederhits, track_used_hits);
328 }
329 
330 //----------------------------------------------------------------------------
332 std::unique_ptr<trkf::KHitContainer> trkf::Track3DKalmanHitAlg::fillHitContainer(const Hits &hits) const{
333  std::unique_ptr<KHitContainer> hitcont(fLineSurface ?
334  static_cast<KHitContainer *>(new KHitContainerWireLine) :
335  static_cast<KHitContainer *>(new KHitContainerWireX));
336  hitcont->fill(hits, -1);
337  return hitcont;
338 }
339 
340 //----------------------------------------------------------------------------
342 // not sure if this function will be a candidate for generic interface
343 
345  double mom0[3];
346  double mom1[3];
347  trg0.startTrack().getMomentum(mom0);
348  trg0.endTrack().getMomentum(mom1);
349 
350  double dxds0 = mom0[0] / calcMagnitude(mom0);
351  double dxds1 = mom1[0] / calcMagnitude(mom1);
352 
353  return (std::abs(dxds0) > fMinSeedSlope &&
354  std::abs(dxds1) > fMinSeedSlope);
355 }
356 
357 //----------------------------------------------------------------------------
359 // Seems like seeds often end at delta rays, Michel electrons,
360 // or other pathologies.
361 
362 // Don't chop pfparticle seeds or self seeds.
363 
365  bool pfseed,
366  Hits &seedhits) const{
367  const int nchopmax = (pfseed || fSelfSeed) ?
368  0:
369  std::max(0, int((hpsit.size() - fMinSeedChopHits)/2));
370  //SS: FIXME
371 
372  const int nchop = std::min(nchopmax, fMaxChopHits);
373  Hits::const_iterator itb = hpsit.begin();
374  Hits::const_iterator ite = hpsit.end();
375  itb += nchop;
376  ite -= nchop;
377  seedhits.reserve(hpsit.size());
378  for(Hits::const_iterator it = itb; it != ite; ++it)
379  seedhits.push_back(*it);
380 }
381 
382 //----------------------------------------------------------------------------
385  const Hits hits,
386  unsigned int prefplane,
387  std::deque<KGTrack>& kalman_tracks){
388  KGTrack trg1(prefplane);
389  bool ok = fKFAlg.smoothTrack(trg0, &trg1, fProp.get());
390  if (!ok) return ok;
391 
392  // Now we have the seed track in the form of a KGTrack.
393  // Do additional quality cuts.
394 
395  auto const n = trg1.numHits();
396  auto const chisq = n * fMaxSeedChiDF;
397 
398  ok = n >= fMinSeedHits &&
399  trg1.startTrack().getChisq() <= chisq &&
400  trg1.endTrack().getChisq() <= chisq &&
401  trg0.startTrack().getChisq() <= chisq &&
402  trg0.endTrack().getChisq() <= chisq &&
404 
405  if(!ok) return ok;
406 
407  // Make a copy of the original hit collection of all
408  // available track hits.
409  Hits trackhits = hits;
410 
411  // Do an extend + smooth loop here.
412  // Exit after two consecutive failures to extend (i.e. from each end),
413  // or if the iteration count reaches the maximum.
414  if (ok)
415  ok = extendandsmoothLoop(trg1, prefplane, trackhits);
416 
417  // Do a final smooth.
418  if(!ok) return ok;
419 
420  ok = fKFAlg.smoothTrack(trg1, 0, fProp.get());
421  if(!ok) return ok;
422 
423  // Skip momentum estimate for constant-momentum tracks.
424 
425  if(fDoDedx) {
426  fitnupdateMomentum(trg1, trg1);
427  }
428  // Save this track.
429  ++fNumTrack;
430  kalman_tracks.push_back(trg1);
431  return ok;
432 }
433 
434 //----------------------------------------------------------------------------
436 
438  unsigned int prefplane,
439  Hits &trackhits){
440  bool ok = true;
441  const int niter = 6;
442  int nfail = 0; // Number of consecutive extend fails.
443  for(int ix = 0; ok && ix < niter && nfail < 2; ++ix) {
444 
445  // Fill a collection of hits from the last good track
446  // (initially the seed track).
447  Hits goodhits;
448  std::vector<unsigned int> hittpindex;
449  trg1.fillHits(goodhits, hittpindex);
450 
451  // Filter hits already on the track out of the available hits.
452  filterHits(trackhits, goodhits);
453 
454  // Fill hit container using filtered hits.
455  std::unique_ptr<KHitContainer> ptrackcont = fillHitContainer(trackhits);
456 
457  // Extend the track. It is not an error for the
458  // extend operation to fail, meaning that no new hits
459  // were added.
460  if(fKFAlg.extendTrack(trg1, fProp.get(), *ptrackcont)) nfail = 0;
461  else ++nfail;
462 
463  // Smooth the extended track, and make a new
464  // unidirectionally fit track in the opposite
465  // direction.
466 
467  KGTrack trg2(prefplane);
468  ok = fKFAlg.smoothTrack(trg1, &trg2, fProp.get());
469  if(ok) {
470  // Skip momentum estimate for constant-momentum tracks.
471  if(fDoDedx) {
472  fitnupdateMomentum(trg1, trg2);
473  }
474  trg1 = trg2;
475  }
476  }
477  return ok;
478 }
479 //----------------------------------------------------------------------------
482  KETrack tremom;
483  if(fKFAlg.fitMomentum(trg1, fProp.get(), tremom)) {
484  fKFAlg.updateMomentum(tremom, fProp.get(), trg2);
485  }
486 }
487 
488 //----------------------------------------------------------------------------
491 {
492 
493  // Get Services.
494 
496  const detinfo::DetectorProperties* detprop = lar::providerFrom<detinfo::DetectorPropertiesService>();
497 
498  // Do a linear 3D least squares for of y and z vs. x.
499  // y = y0 + ay*(x-x0)
500  // z = z0 + az*(x-x0)
501  // Here x0 is the global average x coordinate of all hits in all planes.
502  // Parameters y0, z0, ay, and az are determined by a simultaneous least squares
503  // fit in all planes.
504 
505  // First, determine x0 by looping over every hit.
506 
507  double x0 = 0.;
508  int n = 0;
509  for(auto const& phit : hits) {
510  const recob::Hit& hit = *phit;
511  geo::WireID wire_id = hit.WireID();
512  double time = hit.PeakTime();
513  double x = detprop->ConvertTicksToX(time, wire_id);
514  x0 += x;
515  ++n;
516  }
517 
518  // If there are no hits, return invalid seed.
519 
520  if(n == 0)
521  return recob::Seed();
522 
523  // Find the average x.
524 
525  x0 /= n;
526 
527  // Now do the least squares fit proper.
528 
529  KSymMatrix<4>::type sm(4);
530  KVector<4>::type sv(4);
531  sm.clear();
532  sv.clear();
533 
534  // Loop over hits (again).
535 
536  for(auto const& phit : hits) {
537  const recob::Hit& hit = *phit;
538 
539  // Extract the angle, w and x coordinates from hit.
540 
541  geo::WireID wire_id = hit.WireID();
542  const geo::WireGeo& wgeom = geom->Wire(wire_id);
543  double xyz[3];
544  wgeom.GetCenter(xyz);
545 
546  // Phi convention is the one documented in SurfYZPlane.h.
547 
548  double phi = TMath::PiOver2() - wgeom.ThetaZ();
549  double sphi = std::sin(phi);
550  double cphi = std::cos(phi);
551  double w = -xyz[1]*sphi + xyz[2]*cphi;
552 
553  double time = hit.PeakTime();
554  double x = detprop->ConvertTicksToX(time, wire_id);
555 
556  // Accumulate data for least squares fit.
557 
558  double dx = x-x0;
559 
560  sm(0, 0) += sphi*sphi;
561  sm(1, 0) -= sphi*cphi;
562  sm(1, 1) += cphi*cphi;
563  sm(2, 0) += sphi*sphi * dx;
564  sm(2, 1) -= sphi*cphi * dx;
565  sm(2, 2) += sphi*sphi * dx*dx;
566  sm(3, 0) -= sphi*cphi * dx;
567  sm(3, 1) += cphi*cphi * dx;
568  sm(3, 2) -= sphi*cphi * dx*dx;
569  sm(3, 3) += cphi*cphi * dx*dx;
570 
571  sv(0) -= sphi * w;
572  sv(1) += cphi * w;
573  sv(2) -= sphi * w*dx;
574  sv(3) += cphi * w*dx;
575  }
576 
577  // Solve.
578 
579  bool ok = syminvert(sm);
580  if(!ok)
581  return recob::Seed();
582  KVector<4>::type par(4);
583  par = prod(sm, sv);
584 
585  double y0 = par(0);
586  double z0 = par(1);
587  double dydx = par(2);
588  double dzdx = par(3);
589 
590  // Make seed.
591 
592  double dsdx = std::hypot(1., std::hypot(dydx, dzdx));
593 
594  double pos[3] = {x0, y0, z0};
595  double dir[3] = {1./dsdx, dydx/dsdx, dzdx/dsdx};
596  double poserr[3] = {0., 0., 0.};
597  double direrr[3] = {0., 0., 0.};
598 
599  recob::Seed result(pos, dir, poserr, direrr);
600 
601  return result;
602 
603 }
604 
Float_t x
Definition: compare.C:6
ublas::symmetric_matrix< double, ublas::lower, ublas::row_major, ublas::bounded_array< double, N *(N+1)/2 > > type
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:61
void reserve(size_type n)
Definition: PtrVector.h:343
TrackDirection
Track direction enum.
Definition: Surface.h:56
void fillHits(art::PtrVector< recob::Hit > &hits, std::vector< unsigned int > &hittpindex) const
Fill a PtrVector of Hits.
Definition: KGTrack.cxx:219
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.
const KHitTrack & endTrack() const
Track at end point.
Definition: KGTrack.cxx:46
size_t fMinSeedHits
Minimum number of hits per track seed.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
geo::WireID WireID() const
Initial tdc tick for hit.
Definition: Hit.h:234
iterator begin()
Definition: PtrVector.h:223
void filterHitsOnKalmanTrack(const KGTrack &trg, Hits &hits, Hits &seederhits) const
Filter hits that are on kalman tracks.
bool smoothTrack(KGTrack &trg, KGTrack *trg1, const Propagator *prop) const
Smooth track.
void GetPoint(double *Pt, double *Err) const
Definition: Seed.cxx:112
std::vector< trkf::KalmanOutput > makeTracks(KalmanInputs &kalman_inputs)
iterator erase(iterator position)
Definition: PtrVector.h:508
bool extendTrack(KGTrack &trg, const Propagator *prop, KHitContainer &hits) const
Add hits to existing track.
bool fDoDedx
Global dE/dx enable flag.
std::unique_ptr< const Propagator > fProp
Propagator.
void reconfigure(fhicl::ParameterSet const &pset)
bool fitMomentum(const KGTrack &trg, const Propagator *prop, KETrack &tremom) const
Estimate track momentum using either range or multiple scattering.
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.
Track3DKalmanHit Algorithm.
double ThetaZ() const
Returns angle of wire with respect to z axis in the Y-Z plane in radians.
Definition: WireGeo.h:192
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.
Int_t max
Definition: plot.C:27
void hits()
Definition: readHits.C:15
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:441
long seed
Definition: chem4.cc:68
ublas::vector< double, ublas::bounded_array< double, N > > type
bool syminvert(ublas::symmetric_matrix< T, TRI, L, A > &m)
parameter set interface
T get(std::string const &key) const
Definition: ParameterSet.h:231
void reconfigure(const fhicl::ParameterSet &pset)
Reconfigure method.
iterator end()
Definition: PtrVector.h:237
bool updateMomentum(const KETrack &tremom, const Propagator *prop, KGTrack &trg) const
Set track momentum at each track surface.
bool isDebugEnabled()
bool smoothandextendTrack(KGTrack &trg0, const Hits hits, unsigned int prefplane, std::deque< KGTrack > &kalman_tracks)
SMooth and extend track.
KVector< 5 >::type TrackVector
Track state vector, dimension 5.
void reconfigure(const fhicl::ParameterSet &pset)
Reconfigure method.
data_t::iterator iterator
Definition: PtrVector.h:60
KalmanFilterAlg fKFAlg
Kalman filter algorithm.
size_type size() const
Definition: PtrVector.h:308
Detector simulation of raw signals on wires.
data_t::const_iterator const_iterator
Definition: PtrVector.h:61
virtual double ConvertTicksToX(double ticks, int p, int t, int c) const =0
std::vector< TrajPoint > seeds
Definition: DataStructs.cxx:11
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:219
int fNumTrack
Number of tracks produced.
TDirectory * dir
Definition: macro.C:5
Int_t min
Definition: plot.C:26
std::vector< recob::Seed > GetSeedsFromUnSortedHits(art::PtrVector< recob::Hit > const &, std::vector< art::PtrVector< recob::Hit > > &, unsigned int StopAfter=0)
bool testSeedSlope(const double *dir) const
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
void getMomentum(double mom[3]) const
Get momentum vector of track.
Definition: KTrack.cxx:217
void setPlane(int plane)
Set preferred view plane.
bool fLineSurface
Line surface flag.
size_t numHits() const
Number of measurements in track.
Definition: KGTrack.h:57
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 buildTrack(const KTrack &trk, KGTrack &trg, const Propagator *prop, const Propagator::PropDirection dir, KHitContainer &hits, bool linear) const
Make a new track.
Char_t n[5]
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
bool qualityCutsOnSeedTrack(const KGTrack &trg0) const
Quality cuts on seed track.
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Definition: WireGeo.cxx:68
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.
Float_t w
Definition: plot.C:23
std::vector< KalmanInput > KalmanInputs
void GetDirection(double *Dir, double *Err) const
Definition: Seed.cxx:102
double getChisq() const
Fit chisquare.
Definition: KFitTrack.h:67
bool fSelfSeed
Self seed flag.
const KHitTrack & startTrack() const
Track at start point.
Definition: KGTrack.cxx:33
double fMinSeedSlope
Minimum seed slope (dx/dz).
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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)