LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Geometric3DVertexFitter.h
Go to the documentation of this file.
1 #ifndef GEOMETRIC3DVERTEXFITTER_H
2 #define GEOMETRIC3DVERTEXFITTER_H
3 
7 #include "fhiclcpp/types/Atom.h"
8 #include "fhiclcpp/types/Table.h"
9 
14 
15 namespace trkf {
16  //
21  //
47  //
49  //
50  public:
51  //
52  struct Config {
53  using Name = fhicl::Name;
56  Name("debugLevel"),
57  Comment("Debugging level: 0 for no printouts, 1 for minimal, 2 for full.")
58  };
60  Name("sipCut"),
61  Comment("Cut on maximum impact parameter significance to use the track in the vertex fit.")
62  };
63  };
64  //
66  TracksFromVertexSorter( const recob::tracking::Point_t& vtxPos) : vtxPos_(vtxPos) {}
67  bool operator()(std::reference_wrapper<const recob::Track> a, std::reference_wrapper<const recob::Track> b) const {
68  return ( (a.get().Trajectory().Start()-vtxPos_).Mag2()<(b.get().Trajectory().Start()-vtxPos_).Mag2() );
69  }
70  private:
72  };
73  //
74  struct ParsCovsOnPlane {
75  ParsCovsOnPlane(const SVector2& p1, const SVector2& p2, const SMatrixSym22& c1, const SMatrixSym22& c2, const recob::tracking::Plane& p)
76  : par1(p1), par2(p2), cov1(c1), cov2(c2), plane(p) {}
77  SVector2 par1, par2;
80  };
81 
82  // Constructor
84  : debugLevel(o().debugLevel()), sipCut(o().sipCut())
85  {
86  prop = std::make_unique<TrackStatePropagator>(p);
87  }
88 
89  VertexWrapper fitPFP(size_t iPF, const art::ValidHandle<std::vector<recob::PFParticle> >& inputPFParticle,
90  const std::unique_ptr<art::FindManyP<recob::Track> >& assocTracks) const;
91  VertexWrapper fitTracks(const std::vector< art::Ptr<recob::Track> >& arttracks) const;
92  VertexWrapper fitTracks(TrackRefVec& tracks) const;
96  VertexWrapper fitTwoTracks(const recob::Track& tk1, const recob::Track& tk2) const;
97  //
98  void addTrackToVertex(VertexWrapper& vtx, const recob::Track& tk) const;
99  //
100  std::vector<recob::VertexAssnMeta> computeMeta(const VertexWrapper& vtx);
101  std::vector<recob::VertexAssnMeta> computeMeta(const VertexWrapper& vtx, const std::vector< art::Ptr<recob::Track> >& arttracks);
102  std::vector<recob::VertexAssnMeta> computeMeta(const VertexWrapper& vtx, const TrackRefVec& trks);
103  //
104  double chi2 (const VertexWrapper& vtx, const recob::Track& tk) const;
105  double ip (const VertexWrapper& vtx, const recob::Track& tk) const;
106  double ipErr(const VertexWrapper& vtx, const recob::Track& tk) const;
107  double sip (const VertexWrapper& vtx, const recob::Track& tk) const;
108  double pDist(const VertexWrapper& vtx, const recob::Track& tk) const;
109  //
110  VertexWrapper unbiasedVertex(const VertexWrapper& vtx, const recob::Track& tk) const;
111  double chi2Unbiased (const VertexWrapper& vtx, const recob::Track& tk) const;
112  double ipUnbiased (const VertexWrapper& vtx, const recob::Track& tk) const;
113  double ipErrUnbiased(const VertexWrapper& vtx, const recob::Track& tk) const;
114  double sipUnbiased (const VertexWrapper& vtx, const recob::Track& tk) const;
115  double pDistUnbiased(const VertexWrapper& vtx, const recob::Track& tk) const;
116  private:
117  std::unique_ptr<TrackStatePropagator> prop;
119  double sipCut;
120  //
121  double chi2 (const ParsCovsOnPlane& pcp) const;
122  double ip (const ParsCovsOnPlane& pcp) const;
123  double ipErr(const ParsCovsOnPlane& pcp) const;
124  double sip (const ParsCovsOnPlane& pcp) const;
126  std::pair<TrackState, double> weightedAverageState(ParsCovsOnPlane& pcop) const { return weightedAverageState(pcop.par1,pcop.par2,pcop.cov1,pcop.cov2,pcop.plane); };
127  std::pair<TrackState, double> weightedAverageState(SVector2& par1, SVector2& par2, SMatrixSym22& cov1, SMatrixSym22& cov2, recob::tracking::Plane& target) const;
128  //
129  };
130  //
131 }
132 
133 #endif
ROOT::Math::SVector< double, 3 > SVector3
Definition: TrackingTypes.h:65
double sipUnbiased(const VertexWrapper &vtx, const recob::Track &tk) const
std::pair< TrackState, double > weightedAverageState(ParsCovsOnPlane &pcop) const
ROOT::Math::SVector< double, 2 > SVector2
Definition: TrackingTypes.h:66
VertexWrapper closestPointAlongTrack(const recob::Track &track, const recob::Track &other) const
TracksFromVertexSorter(const recob::tracking::Point_t &vtxPos)
VertexWrapper fitTracksWithVtx(const std::vector< art::Ptr< recob::Track > > &tracks, const recob::tracking::Point_t &vtxPos) const
ParsCovsOnPlane(const SVector2 &p1, const SVector2 &p2, const SMatrixSym22 &c1, const SMatrixSym22 &c2, const recob::tracking::Plane &p)
ParsCovsOnPlane getParsCovsOnPlane(const trkf::VertexWrapper &vtx, const recob::Track &tk) const
geo::Point_t Point_t
Type for representation of position in physical 3D space.
Definition: TrackingTypes.h:20
cout<< "-> Edep in the target
Definition: analysis.C:54
Wrapper class to facilitate vertex production.
Definition: VertexWrapper.h:28
recob::tracking::SVector2 SVector2
recob::tracking::SMatrixSym22 SMatrixSym22
double chi2(const VertexWrapper &vtx, const recob::Track &tk) const
VertexWrapper unbiasedVertex(const VertexWrapper &vtx, const recob::Track &tk) const
void addTrackToVertex(VertexWrapper &vtx, const recob::Track &tk) const
recob::tracking::SVector3 SVector3
std::vector< recob::VertexAssnMeta > computeMeta(const VertexWrapper &vtx)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
3D vertex fitter based on the geometric properties (start position, direction, covariance) of the tra...
VertexWrapper fitTracks(const std::vector< art::Ptr< recob::Track > > &arttracks) const
TCanvas * c1
Definition: plotHisto.C:7
TCanvas * c2
Definition: plot_hist.C:75
double pDistUnbiased(const VertexWrapper &vtx, const recob::Track &tk) const
std::unique_ptr< TrackStatePropagator > prop
VertexWrapper fitTwoTracks(const recob::Track &tk1, const recob::Track &tk2) const
Class defining a plane for tracking. It provides various functionalities to convert track parameters ...
Definition: TrackingPlane.h:37
bool operator()(std::reference_wrapper< const recob::Track > a, std::reference_wrapper< const recob::Track > b) const
Geometric3DVertexFitter(const fhicl::Table< Config > &o, const fhicl::Table< TrackStatePropagator::Config > &p)
double ipUnbiased(const VertexWrapper &vtx, const recob::Track &tk) const
double pDist(const VertexWrapper &vtx, const recob::Track &tk) const
double sip(const VertexWrapper &vtx, const recob::Track &tk) const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > SMatrixSym33
Definition: TrackingTypes.h:56
recob::tracking::SMatrixSym33 SMatrixSym33
double ipErr(const VertexWrapper &vtx, const recob::Track &tk) const
Float_t track
Definition: plot.C:34
double chi2Unbiased(const VertexWrapper &vtx, const recob::Track &tk) const
VertexWrapper fitPFP(size_t iPF, const art::ValidHandle< std::vector< recob::PFParticle > > &inputPFParticle, const std::unique_ptr< art::FindManyP< recob::Track > > &assocTracks) const
double ipErrUnbiased(const VertexWrapper &vtx, const recob::Track &tk) const
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:51
double ip(const VertexWrapper &vtx, const recob::Track &tk) const
ROOT::Math::SMatrix< double, 2, 2, ROOT::Math::MatRepSym< double, 2 > > SMatrixSym22
Definition: TrackingTypes.h:55
std::vector< std::reference_wrapper< const recob::Track > > TrackRefVec
Definition: VertexWrapper.h:26