13 const float prec=1
e-8;
17 if(
fDebug>0)
printf(
"FieldMaps is being computed from Laplace solutions... \n");
34 float dV = dr*dphi*
dz;
36 float e0 = 8.854187817e+1;
39 float r =
fEr->GetXaxis()->GetBinCenter( br+1 );
42 float phi =
fEr->GetYaxis()->GetBinCenter( bp+1 );
44 float z =
fEr->GetZaxis()->GetBinCenter( bz+1 );
46 if(
fDebug>1)
printf(
"FieldMaps: Integral( dvprime Q(rprime) G_E(rprime,[%f,%f,%f]) )",r,phi,z);
47 float intEr = 0, intEp = 0, intEz = 0;
52 float zprime =
fEr->GetZaxis()->GetBinCenter( bzprime+1 );
54 if(z*zprime < 0)
continue;
56 for(
int brprime=brprimeINI; brprime!=brprimeEND; ++brprime) {
57 float rprime =
fEr->GetXaxis()->GetBinCenter( brprime+1 );
59 float phiprime =
fEr->GetYaxis()->GetBinCenter( bphiprime+1 );
62 if(TMath::AreEqualAbs( charge, 0, prec ))
continue;
63 float GR = laplace_green_solution->
Er(r/100,phi,TMath::Abs(z)/100, rprime/100, phiprime, TMath::Abs(zprime)/100);
65 float GZ = laplace_green_solution->
Ez(r/100,phi,TMath::Abs(z)/100, rprime/100, phiprime, TMath::Abs(zprime)/100);
66 if(!TMath::AreEqualAbs( GR, 0, prec )) intEr += GR*
charge;
68 if(!TMath::AreEqualAbs( GP, 0, prec )) intEp += GP*
charge;
69 if(!TMath::AreEqualAbs( GZ, 0, prec )) intEz += GZ*
charge;
73 if(
fDebug>1)
printf(
" => Er=%f ( similar for Ep=%f, Ez=%f )\n",intEr,intEp,intEz);
74 float toVperCM = 0.155*1
e-4/e0;
75 fEr->Fill(r,phi,z,intEr*toVperCM);
76 fEp->Fill(r,phi,z,intEp*toVperCM);
77 fEz->Fill(r,phi,z,intEz*toVperCM);