34 const double& radiationLength,
37 TMatrixT<Double_t>* noise,
38 const TMatrixT<Double_t>* jacobian,
39 const TVector3* directionBefore,
40 const TVector3* directionAfter){
45 const double beta = mom/sqrt(mass*mass+mom*mom);
55 double sigma2 = 225.E-6/(beta*beta*mom*mom) * step/radiationLength * matZ/(matZ+1) * log(159.*
pow(matZ,-1./3.))/log(287./sqrt(matZ));
59 TMatrixT<Double_t> noiseBefore(7,7);
63 if (fabs((*directionBefore)[1]) < 1
E-14) {
64 if ((*directionBefore)[0] >= 0.) psi =
M_PI/2.;
65 else psi = 3.*
M_PI/2.;
68 if ((*directionBefore)[1] > 0.) psi =
M_PI - atan((*directionBefore)[0]/(*directionBefore)[1]);
69 else psi = -atan((*directionBefore)[0]/(*directionBefore)[1]);
72 double sintheta = sqrt(1-(*directionBefore)[2]*(*directionBefore)[2]);
73 double costheta = (*directionBefore)[2];
74 double sinpsi = sin(psi);
75 double cospsi = cos(psi);
78 double noiseBefore34 = sigma2 * cospsi * sinpsi * sintheta*sintheta;
79 double noiseBefore35 = -sigma2 * costheta * sinpsi * sintheta;
80 double noiseBefore45 = sigma2 * costheta * cospsi * sintheta;
82 noiseBefore[3][3] = sigma2 * (cospsi*cospsi + costheta*costheta - costheta*costheta * cospsi*cospsi);
83 noiseBefore[4][3] = noiseBefore34;
84 noiseBefore[5][3] = noiseBefore35;
86 noiseBefore[3][4] = noiseBefore34;
87 noiseBefore[4][4] = sigma2 * (sinpsi*sinpsi + costheta*costheta * cospsi*cospsi);
88 noiseBefore[5][4] = noiseBefore45;
90 noiseBefore[3][5] = noiseBefore35;
91 noiseBefore[4][5] = noiseBefore45;
92 noiseBefore[5][5] = sigma2 * sintheta*sintheta;
94 TMatrixT<Double_t> jacobianT(7,7);
95 jacobianT = (*jacobian);
98 noiseBefore = jacobianT*noiseBefore*(*jacobian);
101 TMatrixT<Double_t> noiseAfter(7,7);
105 if (fabs((*directionAfter)[1]) < 1
E-14) {
106 if ((*directionAfter)[0] >= 0.) psi =
M_PI/2.;
107 else psi = 3.*
M_PI/2.;
110 if ((*directionAfter)[1] > 0.) psi =
M_PI - atan((*directionAfter)[0]/(*directionAfter)[1]);
111 else psi = -atan((*directionAfter)[0]/(*directionAfter)[1]);
114 sintheta = sqrt(1-(*directionAfter)[2]*(*directionAfter)[2]);
115 costheta = (*directionAfter)[2];
120 double noiseAfter34 = sigma2 * cospsi * sinpsi * sintheta*sintheta;
121 double noiseAfter35 = -sigma2 * costheta * sinpsi * sintheta;
122 double noiseAfter45 = sigma2 * costheta * cospsi * sintheta;
124 noiseAfter[3][3] = sigma2 * (cospsi*cospsi + costheta*costheta - costheta*costheta * cospsi*cospsi);
125 noiseAfter[4][3] = noiseAfter34;
126 noiseAfter[5][3] = noiseAfter35;
128 noiseAfter[3][4] = noiseAfter34;
129 noiseAfter[4][4] = sigma2 * (sinpsi*sinpsi + costheta*costheta * cospsi*cospsi);
130 noiseAfter[5][4] = noiseAfter45;
132 noiseAfter[3][5] = noiseAfter35;
133 noiseAfter[4][5] = noiseAfter45;
134 noiseAfter[5][5] = sigma2 * sintheta*sintheta;
137 (*noise) += 0.5*noiseBefore + 0.5*noiseAfter;
double beta(double KE, const simb::MCParticle *part)
double energyLoss(const double &step, const double &mom, const int &pdg, const double &matDensity, const double &matZ, const double &matA, const double &radiationLength, const double &meanExcitationEnergy, const bool &doNoise=false, TMatrixT< Double_t > *noise=NULL, const TMatrixT< Double_t > *jacobian=NULL, const TVector3 *directionBefore=NULL, const TVector3 *directionAfter=NULL)
Optional calculation of multiple scattering.
virtual ~GFEnergyLossCoulomb()
void getParticleParameters(const int &pdg, double &charge, double &mass)
Gets particle charge and mass (in GeV)
Exception class for error handling in GENFIT (provides storage for diagnostic information) ...
GFException & setFatal(bool b=true)
set fatal flag. if this is true, the fit stops for this current track repr.