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)
119 , fVolumeName(volume_name)
120 , fMotherVolumeName(mother_volume_name)
124 , fPosition(position)
125 , fRotation(rotation)
127 , fMotherSegment(mother_segment)
135 rot =
new FairGeoRotation();
139 std::string volume_name,
140 std::string mother_volume_name,
144 , fVolumeName(volume_name)
145 , fMotherVolumeName(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);
238 for (Int_t
i = 0;
i < 9;
i++) {
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)
Mpdshape(ofstream *file, std::string volume_name, std::string mother_volume_name, std::string shape, std::string media)
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 SetRotation(Double_t p1, Double_t p2, Double_t p3, Double_t p4, Double_t p5, Double_t p6, Double_t p7, Double_t p8, Double_t p9)
void SetPosition(Double_t x, Double_t y, Double_t z, Int_t precision=6)
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)
Mpdshape(ofstream *file, std::string volume_name, std::string mother_volume_name, std::string shape, std::string media, std::string points, std::string position="0. 0. 0.", std::string rotation="1. 0. 0. 0. 1. 0. 0. 0. 1.", Int_t segment=0, Int_t mother_segment=0)
void SetMotherVolumeName(std::string name)
void SetSegment(Int_t segment)
void SetMotherSegment(Int_t segment)
void SetRotation(std::string rotation)
std::string GetVolumeName() const
static std::string itoa(Double_t x)
void Fill_TUBS(Double_t zmin, Double_t zmax, Double_t rmin, Double_t rmax, Double_t dr_st, Double_t dr_end)
void SetRotation(Double_t z, Double_t y1, Double_t z1)
std::string fMotherVolumeName
void SetPosition(TVector3 vec)
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
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)
*brief create JSON pointer *sa reference_tokens end()