33 const double& radiationLength,
36 TMatrixT<Double_t>*
noise,
37 const TMatrixT<Double_t>* jacobian,
38 const TVector3* directionBefore,
39 const TVector3* directionAfter)
45 const double beta = mom / sqrt(mass * mass + mom * mom);
49 throw GFException(std::string(__func__) +
": no noise given!", __LINE__, __FILE__).
setFatal();
51 throw GFException(std::string(__func__) +
": no jacobian given!", __LINE__, __FILE__)
54 throw GFException(std::string(__func__) +
": no directionBefore given!", __LINE__, __FILE__)
57 throw GFException(std::string(__func__) +
": no directionAfter given!", __LINE__, __FILE__)
63 225.E-6 / (beta * beta * mom * mom) * step / radiationLength * matZ / (matZ + 1) *
64 log(159. * pow(matZ, -1. / 3.)) /
71 TMatrixT<Double_t> noiseBefore(7, 7);
75 if (fabs((*directionBefore)[1]) < 1
E-14) {
76 if ((*directionBefore)[0] >= 0.)
82 if ((*directionBefore)[1] > 0.)
83 psi = M_PI - atan((*directionBefore)[0] / (*directionBefore)[1]);
85 psi = -atan((*directionBefore)[0] / (*directionBefore)[1]);
89 sqrt(1 - (*directionBefore)[2] * (*directionBefore)[2]);
90 double costheta = (*directionBefore)[2];
91 double sinpsi = sin(psi);
92 double cospsi = cos(psi);
95 double noiseBefore34 =
96 sigma2 * cospsi * sinpsi * sintheta * sintheta;
97 double noiseBefore35 = -sigma2 * costheta * sinpsi * sintheta;
98 double noiseBefore45 = sigma2 * costheta * cospsi * sintheta;
101 sigma2 * (cospsi * cospsi + costheta * costheta - costheta * costheta * cospsi * cospsi);
102 noiseBefore[4][3] = noiseBefore34;
103 noiseBefore[5][3] = noiseBefore35;
105 noiseBefore[3][4] = noiseBefore34;
106 noiseBefore[4][4] = sigma2 * (sinpsi * sinpsi + costheta * costheta * cospsi * cospsi);
107 noiseBefore[5][4] = noiseBefore45;
109 noiseBefore[3][5] = noiseBefore35;
110 noiseBefore[4][5] = noiseBefore45;
111 noiseBefore[5][5] = sigma2 * sintheta * sintheta;
113 TMatrixT<Double_t> jacobianT(7, 7);
114 jacobianT = (*jacobian);
117 noiseBefore = jacobianT * noiseBefore * (*jacobian);
120 TMatrixT<Double_t> noiseAfter(7, 7);
124 if (fabs((*directionAfter)[1]) < 1
E-14) {
125 if ((*directionAfter)[0] >= 0.)
128 psi = 3. * M_PI / 2.;
131 if ((*directionAfter)[1] > 0.)
132 psi = M_PI - atan((*directionAfter)[0] / (*directionAfter)[1]);
134 psi = -atan((*directionAfter)[0] / (*directionAfter)[1]);
138 sqrt(1 - (*directionAfter)[2] * (*directionAfter)[2]);
139 costheta = (*directionAfter)[2];
144 double noiseAfter34 =
145 sigma2 * cospsi * sinpsi * sintheta * sintheta;
146 double noiseAfter35 = -sigma2 * costheta * sinpsi * sintheta;
147 double noiseAfter45 = sigma2 * costheta * cospsi * sintheta;
150 sigma2 * (cospsi * cospsi + costheta * costheta - costheta * costheta * cospsi * cospsi);
151 noiseAfter[4][3] = noiseAfter34;
152 noiseAfter[5][3] = noiseAfter35;
154 noiseAfter[3][4] = noiseAfter34;
155 noiseAfter[4][4] = sigma2 * (sinpsi * sinpsi + costheta * costheta * cospsi * cospsi);
156 noiseAfter[5][4] = noiseAfter45;
158 noiseAfter[3][5] = noiseAfter35;
159 noiseAfter[4][5] = noiseAfter45;
160 noiseAfter[5][5] = sigma2 * sintheta * sintheta;
163 (*noise) += 0.5 * noiseBefore + 0.5 * noiseAfter;
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.