BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
RkFitMaterial.cxx
Go to the documentation of this file.
1//-----------------------------------------------------------------------
2// File from KalFit module
3//
4// Filename : RkFitMaterial.cc
5//------------------------------------------------------------------------
6// Description :
7// Material is a class which describes the properties of a given material,
8// for instance atomic number, atomic weight and so on.
9//------------------------------------------------------------------------
10// Modif :
11//------------------------------------------------------------------------
12#include "TrkReco/RkFitMaterial.h"
13#include <iostream>
14#include <math.h>
15
16using namespace std;
17
18RkFitMaterial::RkFitMaterial( double z, double a, double i, double rho, double x0 )
19 : x0_( x0 )
20 , z_( z ) // rho is the density, z is the atomic number, a is the weight
21 // i is mean excitation potention, x0 is the radiation length
22{
23 rza_ = rho * z / a;
24 isq_ = i * i * 1e-18;
25}
26
28 : rza_( mat.rza_ ), isq_( mat.isq_ ), x0_( mat.x0_ ), z_( mat.z_ ) {}
29
30// calculate dE
31double RkFitMaterial::dE( double mass, double path, double p ) const {
32 if ( !( p > 0 ) ) return 0;
33
34 // cout<<"this material:x0 "<< x0_ << " Z " << z_ << endl
35 // <<" rho*Z/A "<< rza_ << " I^2 "<< isq_ << endl;
36
37 const double Me = 0.000510999;
38 double psq = p * p;
39 double bsq = psq / ( psq + mass * mass );
40 double esq = psq / ( mass * mass );
41
42 double s = Me / mass;
43 double w = ( 4 * Me * esq / ( 1 + 2 * s * sqrt( 1 + esq ) + s * s ) );
44 // Density correction :
45 double cc, x0;
46 cc = 1 + 2 * log( sqrt( isq_ ) / ( 28.8E-09 * sqrt( rza_ ) ) );
47 if ( cc < 5.215 ) x0 = 0.2;
48 else x0 = 0.326 * cc - 1.5;
49 double x1( 3 ), xa( cc / 4.606 ), aa;
50 aa = 4.606 * ( xa - x0 ) / ( ( x1 - x0 ) * ( x1 - x0 ) * ( x1 - x0 ) );
51 double delta( 0 );
52 double x( log10( sqrt( esq ) ) );
53 if ( x > x0 )
54 {
55 delta = 4.606 * x - cc;
56 if ( x < x1 ) delta = delta + aa * ( x1 - x ) * ( x1 - x ) * ( x1 - x );
57 }
58 // Shell correction :
59 float f1, f2, f3, f4, f5, ce;
60 f1 = 1 / esq;
61 f2 = f1 * f1;
62 f3 = f1 * f2;
63 f4 = ( f1 * 0.42237 + f2 * 0.0304 - f3 * 0.00038 ) * 1E12;
64 f5 = ( f1 * 3.858 - f2 * 0.1668 + f3 * 0.00158 ) * 1E18;
65 ce = f4 * isq_ + f5 * isq_ * sqrt( isq_ );
66 return ( 0.0001535 * rza_ / bsq *
67 ( log( Me * esq * w / isq_ ) - 2 * bsq - delta - 2.0 * ce / z_ ) ) *
68 path;
69}
70
71// calculate Multiple Scattering angle
72double RkFitMaterial::mcs_angle( double mass, double path, double p ) const {
73 // cout<<"this material:x0 "<< x0_ << " Z " << z_ << endl
74 // <<" rho*Z/A "<< rza_ << " I^2 "<< isq_ << endl;
75 double t = path / x0_;
76 double psq = p * p;
77 return 0.0136 * sqrt( t * ( mass * mass + psq ) ) / psq * ( 1 + 0.038 * log( t ) );
78}
79
80// calculate the RMS of straggling for the energy loss (del_E) :
81double RkFitMaterial::del_E( double mass, double path, double p ) const {
82 double sigma0_2 = 0.1569 * rza_ * path;
83
84 if ( sigma0_2 < 0 ) return 0;
85
86 double psq = p * p;
87 double bsq = psq / ( psq + mass * mass );
88
89 // Correction for relativistic particles :
90 double sigma_2 = sigma0_2 * ( 1 - 0.5 * bsq ) / ( 1 - bsq );
91
92 if ( sigma_2 < 0 ) return 0;
93
94 // Return sigma in GeV !!
95 return sqrt( sigma_2 ) * 0.001;
96}
double mass
TFile * f1
Double_t x[10]
double w
XmlRpcServer s
double dE(double mass, double path, double p) const
Calculate energy loss.
double mcs_angle(double mass, double path, double p) const
Calculate Multiple Scattering angle.
double del_E(double mass, double path, double p) const
Calculate the straggling of energy loss.
int t()
Definition t.c:1