BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/TrkBase/include/TrkBase/NeutTraj.h
Go to the documentation of this file.
1//
2// Trajectory subclass that implements a neutral simple
3// Author : Justin Albert and Valery Miftahov, from HelixTraj
4//
5#ifndef NEUTTRAJ_H
6#define NEUTTRAJ_H
7#include "CLHEP/Geometry/Point3D.h"
8#include "TrkBase/NeutParams.h"
9#include "TrkBase/TrkSimpTraj.h"
10#ifndef ENABLE_BACKWARDS_COMPATIBILITY
11typedef HepGeom::Point3D<double> HepPoint3D;
12#endif
13
14#include "CLHEP/Matrix/Matrix.h"
15#include "CLHEP/Matrix/SymMatrix.h"
16#include "CLHEP/Matrix/Vector.h"
17
18using CLHEP::Hep3Vector;
19using CLHEP::HepMatrix;
20using CLHEP::HepSymMatrix;
21
22class TrkVisitor;
23class NeutParams;
24
25class NeutTraj : public TrkSimpTraj {
26public:
27 NeutTraj( const NeutParams&, double lowlim = -99999., double hilim = 99999.,
28 const HepPoint3D& refpoint = _theOrigin );
29 NeutTraj( const NeutTraj& ); // copy ctor
30 NeutTraj* clone() const;
31
32 // destructor
33 virtual ~NeutTraj();
34
35 // operators
37 // needed implementations for intersection with a Surface
38 virtual HepPoint3D position( double fltLen ) const;
39 virtual Hep3Vector direction( double fltLen ) const;
40 virtual Hep3Vector delDirect( double ) const;
41 void getInfo( double fltLen, HepPoint3D& pos, Hep3Vector& dir ) const;
42 void getInfo( double fltLen, HepPoint3D&, Hep3Vector& dir, Hep3Vector& delDir ) const;
43 void getDFInfo( double fltLen, DifPoint&, DifVector& dir, DifVector& delDir ) const;
44
45 // How far can you go using given approximation before error > tolerance,
46 // in direction pathDir?
47 virtual double distTo1stError( double s, double tol, int pathDir ) const;
48 virtual double distTo2ndError( double s, double tol, int pathDir ) const;
49
50 // Expose the parameters for user manipulation
51 NeutParams& params() { return *_np(); }
52 const NeutParams& params() const { return *_np(); }
53 // yzhang
54 int nPar() const { return params().nPar(); }
55 // zhangy
56 //
57 // Real versions of the base class derivative functions
58 //
59 double curvature( double fltLen ) const { return 0.; }
60 HepMatrix derivDeflect( double fltlen, deflectDirection ) const;
61 HepMatrix derivDisplace( double fltlen, deflectDirection idir ) const;
62 HepMatrix derivPFract( double fltlen ) const;
63 // PointTraj functions
64 TranslateParams paramFunction() const { return NeutTraj::paramFunc; }
65 // Invert the parameter. Returns true in flags if the inversion
66 // requires a change of sign in the covariance matrix.
67 void invertParams( TrkParams* newparams, std::vector<bool>& flags ) const;
68
70
71 //--------------------------------------------------
72 // Visitor access
73 //--------------------------------------------------
74
75 virtual void visitAccept( TrkVisitor* vis ) const;
76
77private:
78 //
79 // Private functions (data members are part of the base class)
80 //
81 double x( const double& ) const;
82 double y( const double& ) const;
83 double z( const double& ) const;
84 inline NeutParams* _np() const { return (NeutParams*)&_dtparams; }
85 inline double d0() const { return _np()->d0(); }
86 double phi0() const;
87 inline double p() const { return _np()->p(); }
88 inline double z0() const { return _np()->z0(); }
89 inline double s0() const { return _np()->s0(); }
90 inline double tanDip() const { return _np()->tanDip(); }
91 inline double dip() const { return atan( tanDip() ); }
92 inline double cosDip() const { return 1. / sqrt( 1. + tanDip() * tanDip() ); }
93 inline double sinDip() const { return tanDip() * cosDip(); }
94 inline double translen( const double& f ) const { return cosDip() * f; }
95 // the real point translation function
96 static void paramFunc( const HepPoint3D& oldpoint, const HepPoint3D& newpoint,
97 const HepVector& oldpar, const HepSymMatrix& oldcov,
98 HepVector& newpar, HepSymMatrix& newcov, double fltlen );
99};
100#endif
HepGeom::Point3D< double > HepPoint3D
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
Double_t x[10]
XmlRpcServer s
void(* TranslateParams)(const HepPoint3D &oldpoint, const HepPoint3D &newpoint, const HepVector &oldpar, const HepSymMatrix &oldcov, HepVector &newpar, HepSymMatrix &newcov, double fltlen)
HepGeom::Point3D< double > HepPoint3D
NeutTraj(const NeutTraj &)
virtual ~NeutTraj()
virtual Hep3Vector direction(double fltLen) const
virtual double distTo2ndError(double s, double tol, int pathDir) const
HepMatrix derivDeflect(double fltlen, deflectDirection) const
virtual Hep3Vector delDirect(double) const
virtual HepPoint3D position(double fltLen) const
HepMatrix derivDisplace(double fltlen, deflectDirection idir) const
void getDFInfo(double fltLen, DifPoint &, DifVector &dir, DifVector &delDir) const
HepMatrix derivPFract(double fltlen) const
NeutTraj & operator=(const NeutTraj &)
void getInfo(double fltLen, HepPoint3D &, Hep3Vector &dir, Hep3Vector &delDir) const
NeutTraj * clone() const
virtual void visitAccept(TrkVisitor *vis) const
void invertParams(TrkParams *newparams, std::vector< bool > &flags) const
virtual double distTo1stError(double s, double tol, int pathDir) const
NeutTraj(const NeutParams &, double lowlim=-99999., double hilim=99999., const HepPoint3D &refpoint=_theOrigin)
void getInfo(double fltLen, HepPoint3D &pos, Hep3Vector &dir) const
TrkSimpTraj & invert()
TrkSimpTraj(const HepVector &params, const HepSymMatrix &cov, const double startRange=-99999., const double endRange=99999., const HepPoint3D &refpoint=_theOrigin)