34 printf(
"Input fields not found. A B O R T I N G\n");
37 if(
fDebug>0)
printf(
"Langevin solutions are being computed... \n");
39 const float prec=1
e-8;
40 const float kE0 = 400;
51 const float kT1 = 1.0;
52 const float kT2 = 1.0;
53 const float kV0 = 4.0;
54 float wt = -10*kB0*kV0/kE0;
55 float c0 = 1.0/(1.0+kT2*kT2*wt*wt);
56 float c1 = kT1*wt/(1.0+kT1*kT1*wt*wt);
57 float c2 = kT2*kT2*wt*wt*c0;
62 float dz =
fEz->GetZaxis()->GetBinWidth(1);
66 float intDR = 0, intRDPHI = 0;
70 if(
fEz->GetZaxis()->GetBinCenter(
z+1)>0 ) {
74 for(
int zprime=minZ; zprime!=
maxZ; ++zprime) {
76 float dEz =
fEz->GetBinContent(
r+1,
p+1,
z+1 ) + kE0;
77 dR = c0*
fEr->GetBinContent(
r+1,
p+1, zprime+1 )/dEz;
78 dR += c1*
fEp->GetBinContent(
r+1,
p+1, zprime+1 )/dEz;
79 RdPHI = -c1*
fEr->GetBinContent(
r+1,
p+1, zprime+1 )/dEz;
80 RdPHI += c0*
fEp->GetBinContent(
r+1,
p+1, zprime+1 )/dEz;
81 if(!TMath::AreEqualAbs( dR, 0, prec )) intDR += dR*
dz;
82 if(!TMath::AreEqualAbs( RdPHI, 0, prec )) intRDPHI += RdPHI*
dz;
84 fDeltaR->SetBinContent(
r+1,
p+1,
z+1, intDR );
87 if(
fDebug>2)
printf(
"@{Ir,Ip,Iz}={%d,%d,%d}, RdeltaPHI=%f\n",
r,
p,
z,intRDPHI);
97 if(
fDebug>0)
printf(
"Langevin is reading the input file %s... ",inputfile);
98 TFile *ifile =
new TFile(inputfile);
99 fEr = (TH3F*) ifile->Get(
"Er");
100 fEp = (TH3F*) ifile->Get(
"Ep");
101 fEz = (TH3F*) ifile->Get(
"Ez");
107 if(
fDebug>0)
printf(
"Langevin is initializing distortion maps... ");
108 fDeltaR =
new TH3F(
"mapDeltaR",
"#delta_{R} [cm];Radial [cm];Azimuthal [rad];Longitudinal [cm]",
112 fRDeltaPHI =
new TH3F(
"mapRDeltaPHI",
"R#delta_{#varphi} [cm];Radial [cm];Azimuthal [rad];Longitudinal [cm]",
120 const char *outputfile= Form(
"%s_2.root",
fFileNameRoot.data());
121 if(
fDebug>0)
printf(
"Langevin saving distortion maps... ");
122 TFile *
ofile =
new TFile(outputfile,
"RECREATE");
123 ofile->WriteObject(
fDeltaR,
"mapDeltaR");
124 ofile->WriteObject(
fRDeltaPHI,
"mapRDeltaPHI");