60 fMatrix(0), fCurrent(-1), fNextIndex(-1)
84 std::lock_guard<std::mutex> guard(
fMutex);
85 std::vector<ThreadData_t*>::iterator i =
fThreadData.begin();
100 std::lock_guard<std::mutex> guard(
fMutex);
103 for (
Int_t tid=0; tid<nthreads; tid++) {
253 fStep = 2*dx/ndivisions;
278 fStep = (end - start)/ndivisions;
354 if (diff>0.5) diff = 1.-diff;
355 if (diff<1
e-8)
return kTRUE;
390 Error(
"FindNextBoundary",
"Must call FindNode first");
393 Int_t inc = (dir[0]>0)?1:0;
395 if (
dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",
dist);
407 if (!reflect)
return finder;
443 fStep = 2*dy/ndivisions;
468 fStep = (end - start)/ndivisions;
544 if (diff>0.5) diff = 1.-diff;
545 if (diff<1
e-8)
return kTRUE;
580 Error(
"FindNextBoundary",
"Must call FindNode first");
583 Int_t inc = (dir[1]>0)?1:0;
585 if (
dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",
dist);
597 if (!reflect)
return finder;
632 fStep = 2*dz/ndivisions;
655 fStep = (end - start)/ndivisions;
730 if (diff>0.5) diff = 1.-diff;
731 if (diff<1
e-8)
return kTRUE;
766 Error(
"FindNextBoundary",
"Must call FindNode first");
769 Int_t inc = (dir[2]>0)?1:0;
771 if (
dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",
dist);
783 if (!reflect)
return finder;
817 fStep = 2*dx/ndivisions;
840 fStep = (end - start)/ndivisions;
889 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
892 if (diff>0.5) diff = 1.-diff;
893 if (diff<1
e-8)
return kTRUE;
907 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
910 Double_t ttsq = txy*txy + (txz-txy*tyz)*(txz-txy*tyz);
913 Double_t divdirz = -(txz-txy*tyz)*divdirx;
914 Double_t dot = dir[0]*divdirx + dir[1]*divdiry + dir[2]*divdirz;
932 if (!reflect)
return finder;
995 fStep = 2*dy/ndivisions;
1020 fStep = (end - start)/ndivisions;
1068 Double_t yt = point[1]-tyz*point[2];
1071 if (diff>0.5) diff = 1.-diff;
1072 if (diff<1
e-8)
return kTRUE;
1084 Double_t yt = point[1]-tyz*point[2];
1089 Double_t dot = dir[1]*divdiry + dir[2]*divdirz;
1107 if (!reflect)
return finder;
1174 fStep = 2*dz/ndivisions;
1202 fStep = (end - start)/ndivisions;
1254 if (diff>0.5) diff = 1.-diff;
1255 if (diff<1
e-8)
return kTRUE;
1286 if (!reflect)
return finder;
1356 fStep = 2*dz/ndivisions;
1387 fStep = (end - start)/ndivisions;
1442 if (diff>0.5) diff = 1.-diff;
1443 if (diff<1
e-8)
return kTRUE;
1474 if (!reflect)
return finder;
1555 fStep = (end - start)/ndivisions;
1594 if (diff>0.5) diff = 1.-diff;
1595 if (diff<1
e-8)
return kTRUE;
1620 Double_t dot = point[0]*dir[0] + point[1]*dir[1];
1637 if (!reflect)
return finder;
1723 fStep = (end-start+360)/ndivisions;
1725 fStep = (end-start)/ndivisions;
1727 for (
Int_t idiv = 0; idiv<ndivisions; idiv++) {
1756 if (phi<0) phi += 360;
1758 if (ddp<0) ddp+=360;
1761 if (diff>0.5) diff = 1.-diff;
1762 if (diff<1
e-8)
return kTRUE;
1774 if (phi<0) phi += 360;
1777 if (ddp<0) ddp+=360;
1782 Double_t dot = point[0]*dir[1]-point[1]*dir[0];
1799 if (!reflect)
return finder;
1816void TGeoPatternCylPhi::Streamer(
TBuffer &R__b)
1897 fStep = (end - start)/ndivisions;
2016 fStep = (end - start)/ndivisions;
2116 fStep = 360./ndivisions;
2143 fStep = (end-start+360)/ndivisions;
2145 fStep = (end-start)/ndivisions;
2188 if (phi<0) phi += 360;
2190 if (ddp<0) ddp+=360;
2193 if (diff>0.5) diff = 1.-diff;
2194 if (diff<1
e-8)
return kTRUE;
2205 if (phi<0) phi += 360;
2208 if (ddp<0) ddp+=360;
2213 Double_t dot = point[0]*dir[1]-point[1]*dir[0];
2229 if (!reflect)
return finder;
2303 fAxisOnRows(pfh.fAxisOnRows),
2304 fNdivisions(pfh.fNdivisions),
R__EXTERN TGeoIdentity * gGeoIdentity
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=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 ~TGeoPatternCylPhi()
Destructor.
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=0)
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 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.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
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 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.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
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=0)
get the node division 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 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 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 TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
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 TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
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 TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
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.
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 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=0)
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 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.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
get the node division containing the query point
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 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 TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
Find the cell corresponding to point and next cell along dir (if asked)
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.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
Find the cell corresponding to point and next cell along dir (if asked)
TGeoPatternY & operator=(const TGeoPatternY &)
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 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 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 TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
Find the cell corresponding to point and next cell along dir (if asked)
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.
TRAP is a general trapezoid, i.e.
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 dist(Rotation3D const &r1, Rotation3D const &r2)
Double_t ATan2(Double_t, Double_t)
constexpr Double_t DegToRad()
Conversion from degree to radian:
Double_t Sqrt(Double_t x)
constexpr Double_t RadToDeg()
Conversion from radian to degree:
Int_t fCurrent
generic matrix
~ThreadData_t()
Destructor.
Int_t fNextIndex
current division element
ThreadData_t()
index of next node