18 mEtaMin(etamin), mEtaMax(etamax), mVertexSigma(0.0), mBfield(0.0), mBfieldScanStep(1 * etm::
cm),
19 mThetaBinCount(ntheta), mPhiBinCount(nphi), mStat(100), mBeastMagneticField(0)
67 if (ok)
return TVector3(bx, by, bz);
69 return TVector3(0,0,0);
74 return TVector3(0.0, 0.0,
mBfield);
82 auto model =
eic->GetVacuumChamber()->GetWorld();
90 double sign = (eside ? -1 : 1);
92 double zmarker =
marker ? sign*
marker->GetActualDistance() +
eic->GetIpLocation().X() : 0.0;
94 double crossing = eside ? 0.0 :
eic->GetCrossingAngle();
109 double theta = thetamin + (itheta+0.5)*thetastep;
112 double phi = -
M_PI + (iphi+0.5)*phistep;
115 double nn[3] = {sin(theta)*
cos(phi), sin(theta)*sin(phi), sign*
cos(theta)};
119 double qnn[3] = {-sin(theta)*
cos(phi), sin(theta)*sin(phi), sign*
cos(theta)};
121 nn[0] = qnn[0]*
cos(crossing) + qnn[2]*sin(crossing);
123 nn[2] = -qnn[0]*sin(crossing) + qnn[2]*
cos(crossing);
126 double accu = 0.0, thicku = 0.0, zair = 0.0, bdl = 0.0;
128 for(
unsigned ev=0; ev<qstat; ev++) {
130 double xx[3] = {0.0, 0.0,
eic->GetIpLocation().X() + gRandom->Gaus(0.0,
mVertexSigma)};
132 model->SetCurrentPoint (xx);
133 model->SetCurrentDirection(nn);
135 for(
auto node = model->GetCurrentNode(); ; ) {
136 auto material = node->GetVolume()->GetMaterial();
138 model->FindNextBoundary();
140 double radlen =
material->GetRadLen();
145 accu += thickness / radlen;
148 node = model->Step();
153 if (
material == model->GetMaterial(
"Be") ||
154 material == model->GetMaterial(
"Al"))
155 curr = model->GetCurrentPoint();
160 if (model->IsOutside())
break;
168 TVector3 x0 = curr, n0(nn);
170 for(
unsigned ist=0; ; ist++) {
172 if (fabs(pt[2]) > fabs(zmarker))
break;
176 TVector3 Bt = B - scal*n0;
185 accu /= qstat; thicku /= qstat; zair /= qstat; bdl /= qstat;
188 double zbudget = sign*(zmarker - zair);
if (zbudget < 0.0) zbudget = 0.0;
190 mZL ->SetBinContent(iphi+1, itheta+1, zbudget);
191 mBdl->SetBinContent(iphi+1, itheta+1, bdl/100);
194 mRL->SetBinContent(iphi+1, itheta+1, accu*100);
199 TFile hfile(fout ? fout : (TString(
eic->GetName()) +
".scan.root").Data(),
"RECREATE");