00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef TRKMOMCALCULATOR_HH
00022 #define TRKMOMCALCULATOR_HH
00023 #include "CLHEP/Vector/ThreeVector.h"
00024 #include "CLHEP/Matrix/Matrix.h"
00025 #include "CLHEP/Matrix/SymMatrix.h"
00026
00027 class TrkSimpTraj;
00028 class BField;
00029
00030 using CLHEP::Hep3Vector;
00031 using CLHEP::HepMatrix;
00032 using CLHEP::HepSymMatrix;
00033 class BesVectorErr;
00034
00035
00036 class TrkMomCalculator {
00037
00038 public:
00039
00040 TrkMomCalculator();
00041 virtual ~TrkMomCalculator();
00042
00043
00044
00045
00046
00047 static double ptMom( const TrkSimpTraj&, const BField&, double fltlen);
00048 static Hep3Vector vecMom(const TrkSimpTraj&, const BField&, double fltlen);
00049 static BesVectorErr errMom(const TrkSimpTraj&, const BField&, double fltlen);
00050 static int charge(const TrkSimpTraj&, const BField&, double fltlen);
00051
00052
00053
00054 static HepMatrix posmomCov(const TrkSimpTraj&,const BField&,
00055 double fltlen);
00056 static void getAllCovs(const TrkSimpTraj&,const BField&,
00057 double fltlen,
00058 HepSymMatrix& xxCov,
00059 HepSymMatrix& ppCov,
00060 HepMatrix& xpCov);
00061
00062 static bool weightToCov(const HepSymMatrix& inXX,const HepSymMatrix& inPP,const HepMatrix& inXP,
00063 HepSymMatrix& outXX, HepSymMatrix& outPP, HepMatrix& outXP);
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 static void getAllWeights(const TrkSimpTraj&, const BField&,
00086 double fltlen,
00087 HepVector& pos,
00088 HepVector& mom,
00089 HepSymMatrix& xxWeight,
00090 HepSymMatrix& ppWeight,
00091 HepMatrix& xpWeight);
00092
00093 private:
00094
00095 static double calcCurvPtMom(const Hep3Vector&,
00096 double curvature,
00097 const BField&);
00098 static Hep3Vector calcCurvVecMom(const Hep3Vector&,
00099 double curvature,
00100 const BField&);
00101 static BesVectorErr calcCurvErrMom(const TrkSimpTraj&,
00102 const BField&,
00103 double flt);
00104 static BesVectorErr calcNeutErrMom(const TrkSimpTraj&, const BField&,
00105 double flt);
00106 static int calcCurvCharge(const Hep3Vector&,
00107 double curvature,
00108 const BField&);
00109
00110 static HepMatrix calcCurvPosmomCov(const TrkSimpTraj&,const BField&,
00111 double fltlen);
00112 static HepMatrix calcNeutPosmomCov(const TrkSimpTraj&,const BField&,
00113 double fltlen);
00114
00115 static void calcCurvAllCovs(const TrkSimpTraj&,const BField&,
00116 double fltlen,
00117 HepSymMatrix& xxCov,
00118 HepSymMatrix& ppCov,
00119 HepMatrix& xpCov);
00120
00121 static void calcCurvAllCovsOLD(const TrkSimpTraj&,const BField&,
00122 double fltlen,
00123 HepSymMatrix& xxCov,
00124 HepSymMatrix& ppCov,
00125 HepMatrix& xpCov);
00126
00127 static void calcNeutAllCovs(const TrkSimpTraj&,const BField&,
00128 double fltlen,
00129 HepSymMatrix& xxCov,
00130 HepSymMatrix& ppCov,
00131 HepMatrix& xpCov);
00132
00133 static void calcNeutAllCovs(const TrkSimpTraj&,const BField&,
00134 double fltlen,
00135 HepVector& x0,HepVector& p0,
00136 HepSymMatrix& xxCov,
00137 HepSymMatrix& ppCov,
00138 HepMatrix& xpCov);
00139
00140 static void calcCurvAllWeights(const TrkSimpTraj&,const BField&,
00141 double fltlen,
00142 HepVector& pos,
00143 HepVector& mom,
00144 HepSymMatrix& xxWeight,
00145 HepSymMatrix& ppWeight,
00146 HepMatrix& xpWeight);
00147
00148 static void calcCurvAllWeightsOLD(const TrkSimpTraj&,const BField&,
00149 double fltlen,
00150 HepVector& pos,
00151 HepVector& mom,
00152 HepSymMatrix& xxWeight,
00153 HepSymMatrix& ppWeight,
00154 HepMatrix& xpWeight);
00155
00156 static void calcNeutAllWeights(const TrkSimpTraj&,const BField&,
00157 double fltlen,
00158 HepVector& pos,
00159 HepVector& mom,
00160 HepSymMatrix& xxWeight,
00161 HepSymMatrix& ppWeight,
00162 HepMatrix& xpWeight);
00163
00164 static int nearestInt(double);
00165
00166 };
00167
00168 #endif