59 fMatrix(0), fCurrent(-1), fNextIndex(-1)
83 std::lock_guard<std::mutex> guard(
fMutex);
84 std::vector<ThreadData_t*>::iterator i =
fThreadData.begin();
99 std::lock_guard<std::mutex> guard(
fMutex);
102 for (
Int_t tid=0; tid<nthreads; tid++) {
252 fStep = 2*dx/ndivisions;
277 fStep = (end - start)/ndivisions;
353 if (diff>0.5) diff = 1.-diff;
354 if (diff<1
e-8)
return kTRUE;
389 Error(
"FindNextBoundary",
"Must call FindNode first");
392 Int_t inc = (dir[0]>0)?1:0;
394 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
406 if (!reflect)
return finder;
442 fStep = 2*dy/ndivisions;
467 fStep = (end - start)/ndivisions;
543 if (diff>0.5) diff = 1.-diff;
544 if (diff<1
e-8)
return kTRUE;
579 Error(
"FindNextBoundary",
"Must call FindNode first");
582 Int_t inc = (dir[1]>0)?1:0;
584 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
596 if (!reflect)
return finder;
631 fStep = 2*dz/ndivisions;
654 fStep = (end - start)/ndivisions;
729 if (diff>0.5) diff = 1.-diff;
730 if (diff<1
e-8)
return kTRUE;
765 Error(
"FindNextBoundary",
"Must call FindNode first");
768 Int_t inc = (dir[2]>0)?1:0;
770 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
782 if (!reflect)
return finder;
816 fStep = 2*dx/ndivisions;
839 fStep = (end - start)/ndivisions;
888 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
891 if (diff>0.5) diff = 1.-diff;
892 if (diff<1
e-8)
return kTRUE;
906 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
909 Double_t ttsq = txy*txy + (txz-txy*tyz)*(txz-txy*tyz);
912 Double_t divdirz = -(txz-txy*tyz)*divdirx;
913 Double_t dot = dir[0]*divdirx + dir[1]*divdiry + dir[2]*divdirz;
931 if (!reflect)
return finder;
994 fStep = 2*dy/ndivisions;
1019 fStep = (end - start)/ndivisions;
1067 Double_t yt = point[1]-tyz*point[2];
1070 if (diff>0.5) diff = 1.-diff;
1071 if (diff<1
e-8)
return kTRUE;
1083 Double_t yt = point[1]-tyz*point[2];
1088 Double_t dot = dir[1]*divdiry + dir[2]*divdirz;
1106 if (!reflect)
return finder;
1173 fStep = 2*dz/ndivisions;
1201 fStep = (end - start)/ndivisions;
1253 if (diff>0.5) diff = 1.-diff;
1254 if (diff<1
e-8)
return kTRUE;
1285 if (!reflect)
return finder;
1355 fStep = 2*dz/ndivisions;
1386 fStep = (end - start)/ndivisions;
1441 if (diff>0.5) diff = 1.-diff;
1442 if (diff<1
e-8)
return kTRUE;
1473 if (!reflect)
return finder;
1554 fStep = (end - start)/ndivisions;
1593 if (diff>0.5) diff = 1.-diff;
1594 if (diff<1
e-8)
return kTRUE;
1619 Double_t dot = point[0]*dir[0] + point[1]*dir[1];
1636 if (!reflect)
return finder;
1722 fStep = (end-start+360)/ndivisions;
1724 fStep = (end-start)/ndivisions;
1726 for (
Int_t idiv = 0; idiv<ndivisions; idiv++) {
1755 if (phi<0) phi += 360;
1757 if (ddp<0) ddp+=360;
1760 if (diff>0.5) diff = 1.-diff;
1761 if (diff<1
e-8)
return kTRUE;
1773 if (phi<0) phi += 360;
1776 if (ddp<0) ddp+=360;
1781 Double_t dot = point[0]*dir[1]-point[1]*dir[0];
1798 if (!reflect)
return finder;
1896 fStep = (end - start)/ndivisions;
2015 fStep = (end - start)/ndivisions;
2115 fStep = 360./ndivisions;
2142 fStep = (end-start+360)/ndivisions;
2144 fStep = (end-start)/ndivisions;
2187 if (phi<0) phi += 360;
2189 if (ddp<0) ddp+=360;
2192 if (diff>0.5) diff = 1.-diff;
2193 if (diff<1
e-8)
return kTRUE;
2204 if (phi<0) phi += 360;
2207 if (ddp<0) ddp+=360;
2212 Double_t dot = point[0]*dir[1]-point[1]*dir[0];
2228 if (!reflect)
return finder;
2302 fAxisOnRows(pfh.fAxisOnRows),
2303 fNdivisions(pfh.fNdivisions),
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
R__EXTERN TGeoIdentity * gGeoIdentity
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=0
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
An arbitrary trapezoid with less than 8 vertices standing on two parallel planes perpendicular to Z a...
Class describing rotation + translation.
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Matrix class used for computing global transformations Should NOT be used for node definition.
virtual void SetDz(Double_t dz)
void Clear(Option_t *option="")
clear the data for this matrix
void FastRotZ(const Double_t *sincos)
Perform a rotation about Z having the sine/cosine of the rotation angle.
virtual void SetDx(Double_t dx)
virtual void SetDy(Double_t dy)
static Int_t ThreadId()
Translates the current thread id to an ordinal number.
Geometrical transformation package.
virtual void SetDz(Double_t)
virtual void SetDy(Double_t)
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
virtual void SetDx(Double_t)
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
TGeoPatternCylPhi()
Default constructor.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
virtual void Streamer(TBuffer &)
Stream an object of class TGeoVolume.
virtual ~TGeoPatternCylPhi()
Destructor.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
find the node containing the query point
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
TGeoPatternCylR()
Default constructor.
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual ~TGeoPatternCylR()
Destructor.
TGeoPatternCylR & operator=(const TGeoPatternCylR &)
assignment operator
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
find the node containing the query point
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Base finder class for patterns.
ThreadData_t & GetThreadData() const
void Reflect(Bool_t flag=kTRUE)
virtual TGeoNode * CdNext()
Make next node (if any) current.
virtual TGeoMatrix * GetMatrix()
Return current matrix.
void SetRange(Double_t start, Double_t step, Int_t ndivisions)
Set division range. Use this method only when dividing an assembly.
Int_t fThreadSize
Vector of thread private transient data.
TGeoPatternFinder & operator=(const TGeoPatternFinder &)
assignment operator
void SetNext(Int_t index)
Set index of next division.
Bool_t IsReflected() const
std::vector< ThreadData_t * > fThreadData
Int_t GetCurrent()
Return current index.
void ClearThreadData() const
TGeoPatternFinder()
Default constructor.
Int_t GetNext() const
Get index of next division.
virtual ~TGeoPatternFinder()
Destructor.
std::mutex fMutex
Size of the thread vector.
TGeoNode * GetNodeOffset(Int_t idiv)
void CreateThreadData(Int_t nthreads)
Create thread data for n threads max.
virtual TGeoMatrix * CreateMatrix() const =0
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual ~TGeoPatternHoneycomb()
destructor
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
TGeoPatternHoneycomb()
Default constructor.
TGeoPatternHoneycomb & operator=(const TGeoPatternHoneycomb &)
assignment operator
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
find the node containing the query point
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
get the node division containing the query point
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
TGeoPatternParaX()
Default constructor.
virtual ~TGeoPatternParaX()
Destructor.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
TGeoPatternParaX & operator=(const TGeoPatternParaX &)
assignment operator
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
get the node division containing the query point
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual ~TGeoPatternParaY()
Destructor.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
TGeoPatternParaY()
Default constructor.
TGeoPatternParaY & operator=(const TGeoPatternParaY &)
assignment operator
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
get the node division containing the query point
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
TGeoPatternParaZ & operator=(const TGeoPatternParaZ &)
assignment operator
virtual ~TGeoPatternParaZ()
Destructor.
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
TGeoPatternParaZ()
Default constructor.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
TGeoPatternSphPhi()
Default constructor.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual ~TGeoPatternSphPhi()
Destructor.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Double_t * CreateSinCos()
Create the sincos table if it does not exist.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
find the node containing the query point
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
TGeoPatternSphR()
Default constructor.
virtual ~TGeoPatternSphR()
Destructor.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
TGeoPatternSphR & operator=(const TGeoPatternSphR &)
assignment operator
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
find the node containing the query point
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
TGeoPatternSphTheta()
Default constructor.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
find the node containing the query point
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual ~TGeoPatternSphTheta()
Destructor.
TGeoPatternSphTheta & operator=(const TGeoPatternSphTheta &)
assignment operator
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
TGeoPatternTrapZ()
Default constructor.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual ~TGeoPatternTrapZ()
Destructor.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
TGeoPatternTrapZ & operator=(const TGeoPatternTrapZ &)
assignment operator
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
get the node division containing the query point
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
TGeoPatternX & operator=(const TGeoPatternX &)
assignment operator
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
virtual Double_t FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext)
Compute distance to next division layer returning the index of next section.
TGeoPatternX()
Default constructor.
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
Find the cell corresponding to point and next cell along dir (if asked)
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual ~TGeoPatternX()
Destructor.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
TGeoPatternY & operator=(const TGeoPatternY &)
assignment operator
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
Find the cell corresponding to point and next cell along dir (if asked)
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual ~TGeoPatternY()
Destructor.
TGeoPatternY()
Default constructor.
virtual Double_t FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext)
Compute distance to next division layer returning the index of next section.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr)
Find the cell corresponding to point and next cell along dir (if asked)
virtual Double_t FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext)
Compute distance to next division layer returning the index of next section.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
TGeoPatternZ()
Default constructor.
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual ~TGeoPatternZ()
Destructor.
TGeoPatternZ & operator=(const TGeoPatternZ &)
assignment operator
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Class describing rotations.
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
static Double_t Tolerance()
Class describing translations.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
TGeoShape * GetShape() const
Mother of all ROOT objects.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Int_t fCurrent
generic matrix
~ThreadData_t()
Destructor.
Int_t fNextIndex
current division element
ThreadData_t()
index of next node