CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
EnergyLossUpdator.cc File Reference
#include "TrackingTools/MaterialEffects/interface/EnergyLossUpdator.h"
#include "DataFormats/GeometrySurface/interface/MediumProperties.h"
#include "DataFormats/Math/interface/approx_exp.h"
#include "DataFormats/Math/interface/approx_log.h"

Go to the source code of this file.

Functions

void oldComputeBetheBloch (const LocalVector &localP, const MediumProperties &materialConstants, double mass)
 
void oldComputeElectrons (const LocalVector &localP, const MediumProperties &materialConstants, const PropagationDirection propDir)
 

Function Documentation

void oldComputeBetheBloch ( const LocalVector localP,
const MediumProperties materialConstants,
double  mass 
)

Definition at line 161 of file EnergyLossUpdator.cc.

References beta, gather_cfg::cout, alignCSCRings::e, create_public_lumi_plots::log, m, PV3DBase< T, PVType, FrameType >::mag(), MaterialEffectsUpdator::mass(), AlCaHLTBitMon_ParallelJobs::p, mathSSE::sqrt(), MediumProperties::xi(), and PV3DBase< T, PVType, FrameType >::z().

162  {
163 
164  double theDeltaP=0., theDeltaCov=0;
165 
166  //
167  // calculate absolute momentum and correction to path length from angle
168  // of incidence
169  //
170  double p = localP.mag();
171  double xf = fabs(p/localP.z());
172  // constants
173  const double m = mass; // use mass hypothesis from constructor
174 
175  const double emass = 0.511e-3;
176  const double poti = 16.e-9 * 10.75; // = 16 eV * Z**0.9, for Si Z=14
177  const double eplasma = 28.816e-9 * sqrt(2.33*0.498); // 28.816 eV * sqrt(rho*(Z/A)) for Si
178  const double delta0 = 2*log(eplasma/poti) - 1.;
179 
180  // calculate general physics things
181  double e = sqrt(p*p + m*m);
182  double beta = p/e;
183  double gamma = e/m;
184  double eta2 = beta*gamma; eta2 *= eta2;
185  // double lnEta2 = log(eta2);
186  double ratio = emass/m;
187  double emax = 2.*emass*eta2/(1. + 2.*ratio*gamma + ratio*ratio);
188  // double delta = delta0 + lnEta2;
189 
190  // calculate the mean and sigma of energy loss
191  // xi = d[g/cm2] * 0.307075MeV/(g/cm2) * Z/A * 1/2
192  double xi = materialConstants.xi()*xf; xi /= (beta*beta);
193 
194 // double dEdx = xi*(log(2.*emass*eta2*emax/(poti*poti)) - 2.*(beta*beta));
195  //double dEdx = xi*(log(2.*emass*emax/(poti*poti))+lnEta2 - 2.*(beta*beta) - delta);
196 
197  double dEdx = xi*(log(2.*emass*emax/(poti*poti)) - 2.*(beta*beta) - delta0);
198  double dEdx2 = xi*emax*(1.-0.5*(beta*beta));
199  double dP = dEdx/beta;
200  double sigp2 = dEdx2*e*e/(p*p*p*p*p*p);
201  theDeltaP += -dP;
202  theDeltaCov += sigp2;
203 
204  std::cout << "pion old " << theDeltaP << " " << theDeltaCov << std::endl;
205 
206 }
const double beta
T mag() const
Definition: PV3DBase.h:67
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
float xi() const
tuple cout
Definition: gather_cfg.py:121
void oldComputeElectrons ( const LocalVector localP,
const MediumProperties materialConstants,
const PropagationDirection  propDir 
)

Definition at line 210 of file EnergyLossUpdator.cc.

References gather_cfg::cout, create_public_lumi_plots::exp, f, create_public_lumi_plots::log, PV3DBase< T, PVType, FrameType >::mag(), oppositeToMomentum, AlCaHLTBitMon_ParallelJobs::p, MediumProperties::radLen(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

212  {
213 
214  double theDeltaP=0., theDeltaCov=0;
215 
216  //
217  // calculate absolute momentum and correction to path length from angle
218  // of incidence
219  //
220  double p = localP.mag();
221  double normalisedPath = fabs(p/localP.z())*materialConstants.radLen();
222  //
223  // Energy loss and variance according to Bethe and Heitler, see also
224  // Comp. Phys. Comm. 79 (1994) 157.
225  //
226  double z = exp(-normalisedPath);
227  double varz = exp(-normalisedPath*log(3.)/log(2.))-
228  z*z;
229  // exp(-2*normalisedPath);
230 
231  if ( propDir==oppositeToMomentum ) {
232  //
233  // for backward propagation: delta(1/p) is linear in z=p_outside/p_inside
234  // convert to obtain equivalent delta(p). Sign of deltaP is corrected
235  // in method compute -> deltaP<0 at this place!!!
236  //
237  theDeltaP += -p*(1/z-1);
238  theDeltaCov += varz/(p*p);
239  }
240  else {
241  //
242  // for forward propagation: calculate in p (linear in 1/z=p_inside/p_outside),
243  // then convert sig(p) to sig(1/p).
244  //
245  theDeltaP += p*(z-1);
246  // double f = 1/p/z/z;
247  // patch to ensure consistency between for- and backward propagation
248  double f = 1./(p*z);
249  theDeltaCov += f*f*varz;
250  }
251 
252  std::cout << "electron old " << theDeltaP << " " << theDeltaCov << std::endl;
253 
254 
255 }
float radLen() const
float float float z
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
double f[11][100]
tuple cout
Definition: gather_cfg.py:121