61 fMatrix(0), fCurrent(-1), fNextIndex(-1)
105 std::vector<ThreadData_t*>::iterator i =
fThreadData.begin();
124 for (
Int_t tid=0; tid<nthreads; tid++) {
275 fStep = 2*dx/ndivisions;
300 fStep = (end - start)/ndivisions;
376 if (diff>0.5) diff = 1.-diff;
377 if (diff<1
e-8)
return kTRUE;
412 Error(
"FindNextBoundary",
"Must call FindNode first");
415 Int_t inc = (dir[0]>0)?1:0;
417 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
429 if (!reflect)
return finder;
465 fStep = 2*dy/ndivisions;
490 fStep = (end - start)/ndivisions;
566 if (diff>0.5) diff = 1.-diff;
567 if (diff<1
e-8)
return kTRUE;
602 Error(
"FindNextBoundary",
"Must call FindNode first");
605 Int_t inc = (dir[1]>0)?1:0;
607 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
619 if (!reflect)
return finder;
654 fStep = 2*dz/ndivisions;
677 fStep = (end - start)/ndivisions;
752 if (diff>0.5) diff = 1.-diff;
753 if (diff<1
e-8)
return kTRUE;
788 Error(
"FindNextBoundary",
"Must call FindNode first");
791 Int_t inc = (dir[2]>0)?1:0;
793 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
805 if (!reflect)
return finder;
839 fStep = 2*dx/ndivisions;
862 fStep = (end - start)/ndivisions;
911 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
914 if (diff>0.5) diff = 1.-diff;
915 if (diff<1
e-8)
return kTRUE;
929 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
932 Double_t ttsq = txy*txy + (txz-txy*tyz)*(txz-txy*tyz);
935 Double_t divdirz = -(txz-txy*tyz)*divdirx;
936 Double_t dot = dir[0]*divdirx + dir[1]*divdiry + dir[2]*divdirz;
954 if (!reflect)
return finder;
1017 fStep = 2*dy/ndivisions;
1042 fStep = (end - start)/ndivisions;
1090 Double_t yt = point[1]-tyz*point[2];
1093 if (diff>0.5) diff = 1.-diff;
1094 if (diff<1
e-8)
return kTRUE;
1106 Double_t yt = point[1]-tyz*point[2];
1111 Double_t dot = dir[1]*divdiry + dir[2]*divdirz;
1129 if (!reflect)
return finder;
1196 fStep = 2*dz/ndivisions;
1224 fStep = (end - start)/ndivisions;
1276 if (diff>0.5) diff = 1.-diff;
1277 if (diff<1
e-8)
return kTRUE;
1308 if (!reflect)
return finder;
1378 fStep = 2*dz/ndivisions;
1409 fStep = (end - start)/ndivisions;
1464 if (diff>0.5) diff = 1.-diff;
1465 if (diff<1
e-8)
return kTRUE;
1496 if (!reflect)
return finder;
1577 fStep = (end - start)/ndivisions;
1616 if (diff>0.5) diff = 1.-diff;
1617 if (diff<1
e-8)
return kTRUE;
1642 Double_t dot = point[0]*dir[0] + point[1]*dir[1];
1659 if (!reflect)
return finder;
1745 fStep = (end-start+360)/ndivisions;
1747 fStep = (end-start)/ndivisions;
1749 for (
Int_t idiv = 0; idiv<ndivisions; idiv++) {
1778 if (phi<0) phi += 360;
1780 if (ddp<0) ddp+=360;
1783 if (diff>0.5) diff = 1.-diff;
1784 if (diff<1
e-8)
return kTRUE;
1796 if (phi<0) phi += 360;
1799 if (ddp<0) ddp+=360;
1804 Double_t dot = point[0]*dir[1]-point[1]*dir[0];
1821 if (!reflect)
return finder;
1838 void TGeoPatternCylPhi::Streamer(
TBuffer &R__b)
1919 fStep = (end - start)/ndivisions;
2038 fStep = (end - start)/ndivisions;
2138 fStep = 360./ndivisions;
2165 fStep = (end-start+360)/ndivisions;
2167 fStep = (end-start)/ndivisions;
2210 if (phi<0) phi += 360;
2212 if (ddp<0) ddp+=360;
2215 if (diff>0.5) diff = 1.-diff;
2216 if (diff<1
e-8)
return kTRUE;
2227 if (phi<0) phi += 360;
2230 if (ddp<0) ddp+=360;
2235 Double_t dot = point[0]*dir[1]-point[1]*dir[0];
2251 if (!reflect)
return finder;
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 TGeoMatrix * CreateMatrix() const =0
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.
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.
static Int_t Lock()
Static method to lock the main thread mutex.
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.
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
static Int_t UnLock()
Static method to unlock the main thread mutex.
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.
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".
ThreadData_t()
index of next node
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.