KalmanGeoHelper.h
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////
2 // \file KalmanGeoHelper.h
3 // \brief A class of useful track geometry functions for the KalmanTrack algorithm
4 // \version $Id: KalmanGeoHelper.h,v 1.1 2012-11-16 16:57:10 raddatz Exp $
5 // \author Nick Raddatz
6 ////////////////////////////////////////////////////////////////////////////
7 #ifndef TRK_KALMANGEOHELPER_H
8 #define TRK_KALMANGEOHELPER_H
9 
10 #include "Geometry/Geometry.h"
13 
15 
16 #include "TF1.h"
17 
18 namespace trk
19 {
20  /// \brief A collection of geometry functions used by the KalmanTrack tracking algorithm
22  {
23  public:
24  KalmanGeoHelper(bool badChan);
25  virtual ~KalmanGeoHelper();
26 
27  /// \brief Estimate the position on a line within a box
28  ///
29  /// This method takes a line, defined by its start point z0,v0 and direction dz and dv, and 2d box, defined by its center z,v and half lengths halfz, halfv and fills the bestPos with the best estimation of the closest point in that box t the line.
30  /// For lines that do not intersect the box, this is defined as the corner of the box closest to the line.
31  /// For lines that do intersect the box, the best position is the the point on the line bisecting the intersection points of the box.
32  ///
33  /// \param bestPos A vector that is filled with the best position of the line in the box with the first entry corresponding to z and the second to v
34  /// \return Total intersection length of the line with the box
35  double BestTrackPoint(double z, double v, double halfz, double halfv, std::array<double, 2> & bestPos, double z0,double v0, double dz, double dv);
36 
37  /// \brief Variation of geo::CountCellsOnlineFast function specific to KalmanTrack algorithm
38  int CountMissedCellsOnLine(geo::View_t view, double vi, double zi, double vf, double zf, int maxCells);
39 
40  /// \brief Variation of geo::CountCellsOnlineFast function specific to KalmanTrack algorithm
41  int CountMissedCellsOnLine(geo::View_t view, double vi, double zi, double vf, double zf, std::vector<geo::OfflineChan> &hitsonline, std::vector<double> &distance);
42 
43  /// \brief Estimation of the mip missed hit fraction as a function of the dist through a cell and cell depth w
44  double CalcMissFrac(double dist, double w, geo::View_t view);
45 
46  /// \brief Finds the plane best matched to a trajectory point
47  /// This method takes a trajectory point and finds the plane that closest matches this position in either view between minplane and maxplane
48  /// \param traj Trajectory point to be matched to a plane
49  /// \param minplane Minimum plane to search for a match to the trajectory point
50  /// \param maxplane Maximum plane to search for a match to the trajectory point
51  /// \return Plane that matches the trajectory point between minplane and maxplane
52  int MatchTrajectoryToPlane(TVector3 traj, int minplane, int maxplane);
53 
54  /// \brief Variation of MatchTrajectoryToPlane that limits the matching plane to be in the input view
55  int MatchTrajectoryToPlaneInView(TVector3 traj, geo::View_t view, int minplane, int maxplane);
56 
57 
58  private:
62  bool ndos = false;
63  bool nd = false;
64  bool fd = false;
65  bool tb = false;
68  double fwlow;
69  double fwhigh;
70  double flengthmax;
71  TF1 effpar0; // parameter of the eff function that depends on cell depth
72  TF1 effpar1; // parameter of the eff function that depends on cell depth
73  TF1 effpar2; // parameter of the eff function that depends on cell depth
74  TF1 effpar3; // parameter of the eff function that depends on cell depth
75  void SetupHelper(); // function to setup efficiency calculations and other variables based on detector
76  double Efficiency(double w, double length); // returns efficiency as a function of w and length in cell
77 
78  void fillprivategeo();
79  };
80 }
81 #endif
This is the version 2, works for multi-track event.
int CountMissedCellsOnLine(geo::View_t view, double vi, double zi, double vf, double zf, int maxCells)
Variation of geo::CountCellsOnlineFast function specific to KalmanTrack algorithm.
KalmanGeoHelper(bool badChan)
double Efficiency(double w, double length)
A collection of geometry functions used by the KalmanTrack tracking algorithm.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
unsigned distance(const T &t1, const T &t2)
double dist
Definition: runWimpSim.h:113
Track finder for cosmic rays.
length
Definition: demo0.py:21
double CalcMissFrac(double dist, double w, geo::View_t view)
Estimation of the mip missed hit fraction as a function of the dist through a cell and cell depth w...
double dz[NP][NC]
int MatchTrajectoryToPlaneInView(TVector3 traj, geo::View_t view, int minplane, int maxplane)
Variation of MatchTrajectoryToPlane that limits the matching plane to be in the input view...
art::ServiceHandle< chaninfo::BadChanList > fbadc
z
Definition: test.py:28
art::ServiceHandle< geo::Geometry > fgeom
double BestTrackPoint(double z, double v, double halfz, double halfv, std::array< double, 2 > &bestPos, double z0, double v0, double dz, double dv)
Estimate the position on a line within a box.
Float_t w
Definition: plot.C:20
Simple object representing a (plane, cell) pair.
Encapsulate the geometry of one entire detector (near, far, ndos)
int MatchTrajectoryToPlane(TVector3 traj, int minplane, int maxplane)
Finds the plane best matched to a trajectory point This method takes a trajectory point and finds the...