9 #include "Utilities/func/MathUtil.h" 25 const double Me = 510.998910e3;
26 const double Mmu = 105.658367e6;
28 const double K = 0.307075;
29 const double j = 0.200;
35 TGraph*
ret =
new TGraph;
37 for(
double T = 1;
T < 1e5;
T *= 1.05){
38 ret->SetPoint(ret->GetN(),
T,
dEdx(
T)*localDensity);
47 TGraph*
ret =
new TGraph;
49 for(
double T = 1;
T < 1e5;
T *= 1.05){
50 ret->SetPoint(ret->GetN(),
T,
51 MPV(
T, dist, localDensity)*localDensity/
dist);
70 sp.
find_file(
"Calibration/func/muonloss_221.dat", fname);
73 assert(0 &&
"Unknown material");
75 FILE*
f = fopen(fname.c_str(),
"r");
80 int ret = fscanf(f,
"%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf",
81 &T, &junk, &junk, &junk, &junk, &junk, &junk,
82 &dEdx, &junk, &junk, &junk);
84 fT_pts.push_back(
T_pt(T, dEdx));
88 fgets(junkStr, 1024, f);
101 typedef std::vector<T_pt>::const_iterator it_t;
104 it_t itNext = std::lower_bound(fT_pts.begin(), fT_pts.end(),
T,
ltTPt);
105 if(itNext == fT_pts.end()) --itNext;
106 if(itNext == fT_pts.begin()) ++itNext;
108 it_t itPrev = itNext; --itPrev;
111 const double T0 = itPrev->T;
const double y0 = itPrev->dEdx;
112 const double T1 = itNext->T;
const double y1 = itNext->dEdx;
113 return ((T1-T)*y0+(T-
T0)*y1)/(T1-
T0);
120 for(
unsigned int n = 0;
n < fT_pts.size(); ++
n){
121 if(fT_pts[
n].
dEdx < mip) mip = fT_pts[
n].dEdx;
142 assert(0 &&
"Unkown material");
154 BetaGamma(T, beta, gamma);
156 const double f = 2*Me*
sqr(beta*gamma);
158 const double Tmax = f/(1+2*gamma*Me/Mmu+
sqr(Me/Mmu));
160 const double delta = Delta(beta*gamma);
162 const double dEdx = K*ZA/
sqr(beta)*(
log(f*Tmax/(
sqr(I)))/2-
sqr(beta)-delta/2);
169 double localDensity)
const 173 const double x = dist*localDensity;
178 BetaGamma(T, beta, gamma);
180 const double f = 2*Me*
sqr(beta*gamma);
182 const double delta = Delta(beta*gamma);
184 const double xi = K/2*ZA/
sqr(beta)*
x;
195 for(
double T = 1
e2;
T < 1e3;
T *= 1.001){
207 beta =
sqrt(1-1/(gamma*gamma));
214 const double x =
log10(betagamma);
216 delta += 2*
log(10)*x-Cbar;
BetheBlochTables(Material mat)
virtual double MIP() const
Float_t y1[n_points_granero]
virtual double dEdx(double T) const
virtual double MPV(double T, double dist, double localDensity) const
Float_t x1[n_points_granero]
virtual double dEdx(double T) const
virtual double dEdx(double T) const =0
std::string find_file(std::string const &filename) const
T sqr(T x)
More efficient square function than pow(x,2)
void BetaGamma(double T, double &beta, double &gamma) const
Relativity.
bool ltTPt(BetheBlochTables::T_pt pt, double T)
TGraph * GetMPVGraph(double localDensity, double dist) const
virtual double MPV(double T, double dist, double localDensity) const
TGraph * GetdEdxGraph(double localDensity) const
T sqr(T x)
Function to perform, and table to cache, timing fits to ADC values.
virtual double MIP() const
assert(nhit_max >=nhit_nbins)
double Delta(double betagamma) const
Density term.
BetheBlochAnalytic(Material mat)