16 std::string volume_name,
17 std::string mother_volume_name,
21 std::string position =
"0. 0. 0.",
22 std::string rotation =
"1. 0. 0. 0. 1. 0. 0. 0. 1.",
24 Int_t mother_segment = 0);
26 std::string volume_name,
27 std::string mother_volume_name,
100 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/basiclibs.C");
105 rot =
new FairGeoRotation();
109 std::string volume_name,
110 std::string mother_volume_name,
114 std::string position,
115 std::string rotation,
117 Int_t mother_segment)
135 rot =
new FairGeoRotation();
139 std::string volume_name,
140 std::string mother_volume_name,
154 rot =
new FairGeoRotation();
163 *
fFile <<
"//*************************************************" << endl;
184 std::ostringstream o;
194 o.setf(ios::showpoint);
196 o <<
vec.x() <<
" " <<
vec.y() <<
" " <<
vec.z();
203 o.precision(precision);
204 o.setf(ios::showpoint);
206 o << x <<
" " << y <<
" " << z;
221 std::ostringstream o;
222 o.setf(ios::showpoint);
225 o << p1 <<
" " << p2 <<
" " << p3 <<
" " << p4 <<
" " << p5 <<
" " << p6 <<
" " << p7 <<
" " << p8 <<
" " << p9;
233 rot->setEulerAngles(z, y1, z1);
234 std::ostringstream o;
235 o.setf(ios::showpoint);
237 o << setprecision(10);
239 o <<
rot->operator()(
i) <<
" ";
246 std::ostringstream o;
270 std::ostringstream o;
271 o.setf(ios::showpoint);
275 o << 0.0 <<
" " << 0.0 <<
" " << -length_z << endl
276 << r_in <<
" " << r_out << endl
277 << 0.0 <<
" " << 0.0 <<
" " << length_z;
286 std::ostringstream o;
287 o.setf(ios::showpoint);
291 o << 0.0 <<
" " << 0.0 <<
" " << zmin << endl
292 << rmin <<
" " << rmax << endl
293 << 0.0 <<
" " << 0.0 <<
" " << zmax << endl
303 std::ostringstream o;
304 o.setf(ios::showpoint);
308 << phi1 <<
" 360 " << nEdges << endl
309 << zmin <<
" " << rmin <<
" " << rmax << endl
310 << zmax <<
" " << rmin <<
" " << rmax;
320 std::ostringstream o;
321 o.setf(ios::showpoint);
325 if (right_angled == 0) {
335 o << x_small <<
" " << -yWidth <<
" " << -zWidth << endl
336 << x_large <<
" " << yWidth <<
" " << -zWidth << endl
337 << -x_large <<
" " << yWidth <<
" " << -zWidth << endl
338 << -x_small <<
" " << -yWidth <<
" " << -zWidth << endl
340 << x_small <<
" " << -yWidth <<
" " << zWidth << endl
341 << x_large <<
" " << yWidth <<
" " << zWidth << endl
342 << -x_large <<
" " << yWidth <<
" " << zWidth << endl
343 << -x_small <<
" " << -yWidth <<
" " << zWidth;
354 o << x_small <<
" " << -yWidth <<
" " << -zWidth << endl
355 << x_large <<
" " << yWidth <<
" " << -zWidth << endl
356 << -x_small <<
" " << yWidth <<
" " << -zWidth << endl
357 << -x_small <<
" " << -yWidth <<
" " << -zWidth << endl
359 << x_small <<
" " << -yWidth <<
" " << zWidth << endl
360 << x_large <<
" " << yWidth <<
" " << zWidth << endl
361 << -x_small <<
" " << yWidth <<
" " << zWidth << endl
362 << -x_small <<
" " << -yWidth <<
" " << zWidth;
374 std::ostringstream o;
375 o.setf(ios::showpoint);
379 o << xWidth <<
" " << -yWidth <<
" " << -zWidth << endl
380 << xWidth <<
" " << yWidth <<
" " << -zWidth << endl
381 << -xWidth <<
" " << yWidth <<
" " << -zWidth << endl
382 << -xWidth <<
" " << -yWidth <<
" " << -zWidth << endl
383 << xWidth <<
" " << -yWidth <<
" " << zWidth << endl
384 << xWidth <<
" " << yWidth <<
" " << zWidth << endl
385 << -xWidth <<
" " << yWidth <<
" " << zWidth << endl
386 << -xWidth <<
" " << -yWidth <<
" " << zWidth;
397 TVector3 LineVec = LineEnd - LineStart;
398 TVector3 VecToLine = LineStart - CircleCenter;
401 a = LineVec.
X() * LineVec.
X() + LineVec.
Y() * LineVec.
Y();
402 b = 2 * (VecToLine.
X() * LineVec.
X() + VecToLine.
Y() * LineVec.
Y());
403 c = (VecToLine.
X() * VecToLine.
X() + VecToLine.
Y() * VecToLine.
Y()) - CircleRadius * CircleRadius;
404 sqrtterm = b * b - 4 * a * c;
408 res1 = (-b - sqrtterm) / (2 * a);
409 res2 = (-b + sqrtterm) / (2 * a);
410 if (res1 >= 0 && res1 <= 1) {
415 TVector3 result(LineStart.
X() + res * (LineEnd.
X() - LineStart.
X()),
416 LineStart.
Y() + res * (LineEnd.
Y() - LineStart.
Y()), 0);
427 if (rend != LineStart) {
441 if (rend != LineStart) {
R__EXTERN TSystem * gSystem
void Fill_TRAP(Double_t x, Double_t X, Double_t yW, Double_t zW, Int_t ra=0)
void Fill_PGON(Double_t zmin, Double_t zmax, Double_t rmin, Double_t rmax, Double_t phi1, Int_t nEdges=12)
void SetMedia(std::string media)
static std::string itoa(Double_t x)
void SetPositionRotation(std::string position, std::string rotation)
void SetFile(ofstream *file)
void SetPosition(std::string position)
void SetShape(std::string shape)
void SetVolumeName(std::string name)
void Fill_BOX(Double_t xWidth, Double_t yWidth, Double_t zWidth)
void Fill_TUBE(Double_t length_z, Double_t r_max, Double_t r_min)
void SetPoints(std::string points)
void SetMotherVolumeName(std::string name)
void SetSegment(Int_t segment)
void SetMotherSegment(Int_t segment)
void SetRotation(std::string rotation)
std::string GetVolumeName() const
void Fill_TUBS(Double_t zmin, Double_t zmax, Double_t rmin, Double_t rmax, Double_t dr_st, Double_t dr_end)
std::string fMotherVolumeName
TVector3 StereoPosition(Double_t alpha, TVector3 CircleCenter, Double_t CircleRadius, TVector3 LineStart)
Double_t LineLength(Double_t alpha, TVector3 CircleCenter, Double_t CircleRadius, TVector3 LineStart)
TVector3 LineCrossesCircle(TVector3 CircleCenter, Double_t CircleRadius, TVector3 LineStart, TVector3 LineEnd)
std::string itoa(Double_t x)
TVector3 StereoEnd(Double_t alpha, TVector3 CircleCenter, Double_t CircleRadius, TVector3 LineStart)
constexpr Double_t DegToRad()
Double_t Sqrt(Double_t x)