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;
1816 void TGeoPatternCylPhi::Streamer(
TBuffer &R__b)
1897 fStep = (end - start)/ndivisions;
1958 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
2016 fStep = (end - start)/ndivisions;
2075 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
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;
2240 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
2303 fAxisOnRows(pfh.fAxisOnRows),
2304 fNdivisions(pfh.fNdivisions),
void CreateThreadData(Int_t nthreads)
Create thread data for n threads max.
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 TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
get the node division containing the query point
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
Find the cell corresponding to point and next cell along dir (if asked)
double dist(Rotation3D const &r1, Rotation3D const &r2)
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
get the node division containing the query point
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
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.
Int_t GetNext() const
Get index of next division.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
void FastRotZ(const Double_t *sincos)
Perform a rotation about Z having the sine/cosine of the rotation angle.
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual ~TGeoPatternCylPhi()
Destructor.
virtual ~TGeoPatternTrapZ()
Destructor.
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 Double_t FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext)
Compute distance to next division layer returning the index of next section.
Geometrical transformation package.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
get the node division containing the query point
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
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.
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual ~TGeoPatternZ()
Destructor.
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
Find the cell corresponding to point and next cell along dir (if asked)
TGeoPatternParaY & operator=(const TGeoPatternParaY &)
assignment operator
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
TGeoNode * GetNodeOffset(Int_t idiv)
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
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 TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
TGeoPatternX & operator=(const TGeoPatternX &)
assignment operator
Buffer base class used for serializing objects.
TGeoPatternFinder & operator=(const TGeoPatternFinder &)
assignment operator
virtual void SetDz(Double_t)
TGeoPatternParaX()
Default constructor.
Class describing translations.
~ThreadData_t()
Destructor.
TGeoPatternZ()
Default constructor.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Matrix class used for computing global transformations Should NOT be used for node definition...
virtual void SetDx(Double_t)
virtual void SetDx(Double_t dx)
Int_t GetCurrent()
Return current index.
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 ~TGeoPatternSphPhi()
Destructor.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
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 ~TGeoPatternParaZ()
Destructor.
static Double_t Tolerance()
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)
TGeoPatternParaZ()
Default constructor.
TGeoPatternSphR()
Default constructor.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
TGeoPatternY()
Default constructor.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
TGeoPatternSphPhi()
Default constructor.
constexpr Double_t DegToRad()
TGeoPatternCylR()
Default constructor.
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 SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Int_t fThreadSize
Vector of thread private transient data.
TRAP is a general trapezoid, i.e.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
Double_t ATan2(Double_t, Double_t)
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
TGeoPatternFinder()
Default constructor.
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 TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
virtual ~TGeoPatternCylR()
Destructor.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Bool_t IsReflected() const
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.
void SetRange(Double_t start, Double_t step, Int_t ndivisions)
Set division range. Use this method only when dividing an assembly.
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Base finder class for patterns.
TGeoPatternParaY()
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".
Int_t fCurrent
generic matrix
TGeoPatternHoneycomb()
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 TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
TGeoPatternSphR & operator=(const TGeoPatternSphR &)
assignment operator
void Clear(Option_t *option="")
clear the data for this matrix
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Class describing rotation + translation.
TGeoPatternY & operator=(const TGeoPatternY &)
assignment operator
TGeoPatternX()
Default constructor.
Int_t fNextIndex
current division element
virtual ~TGeoPatternSphR()
Destructor.
TGeoPatternParaZ & operator=(const TGeoPatternParaZ &)
assignment operator
TGeoPatternHoneycomb & operator=(const TGeoPatternHoneycomb &)
assignment operator
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
TGeoPatternSphTheta & operator=(const TGeoPatternSphTheta &)
assignment operator
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
std::mutex fMutex
Size of the thread vector.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual ~TGeoPatternY()
Destructor.
virtual TGeoMatrix * CreateMatrix() const =0
Class describing rotations.
virtual void SetDy(Double_t dy)
ThreadData_t & GetThreadData() const
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
TGeoPatternTrapZ & operator=(const TGeoPatternTrapZ &)
assignment operator
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
TGeoShape * GetShape() const
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 ~TGeoPatternHoneycomb()
destructor
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual TGeoMatrix * GetMatrix()
Return current matrix.
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
virtual ~TGeoPatternX()
Destructor.
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
An arbitrary trapezoid with less than 8 vertices standing on.
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.
TGeoPatternCylPhi()
Default constructor.
virtual ~TGeoPatternParaY()
Destructor.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
TGeoPatternSphTheta()
Default constructor.
Mother of all ROOT objects.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
constexpr Double_t RadToDeg()
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
TGeoPatternZ & operator=(const TGeoPatternZ &)
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.
R__EXTERN TGeoIdentity * gGeoIdentity
Double_t * CreateSinCos()
Create the sincos table if it does not exist.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
static Int_t ThreadId()
Translates the current thread id to an ordinal number.
virtual void SetDy(Double_t)
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.
TGeoPatternCylR & operator=(const TGeoPatternCylR &)
assignment operator
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
virtual ~TGeoPatternFinder()
Destructor.
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 TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual ~TGeoPatternSphTheta()
Destructor.
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
virtual TGeoNode * CdNext()
Make next node (if any) current.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
void ClearThreadData() const
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Double_t Sqrt(Double_t x)
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
void SetNext(Int_t index)
Set index of next division.
std::vector< ThreadData_t * > fThreadData
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
virtual void SetDz(Double_t dz)
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
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".
void Reflect(Bool_t flag=kTRUE)
virtual ~TGeoPatternParaX()
Destructor.
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 UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
TGeoPatternTrapZ()
Default constructor.