58 fMatrix(0), fCurrent(-1), fNextIndex(-1)
102 std::vector<ThreadData_t*>::iterator i =
fThreadData.begin();
121 for (
Int_t tid=0; tid<nthreads; tid++) {
166 fNdivisions(pf.fNdivisions),
248 fNdivisions = ndivisions;
272 fStep = 2*dx/ndivisions;
297 fStep = (end - start)/ndivisions;
373 if (diff>0.5) diff = 1.-diff;
374 if (diff<1e-8)
return kTRUE;
409 Error(
"FindNextBoundary",
"Must call FindNode first");
412 Int_t inc = (dir[0]>0)?1:0;
414 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
426 if (!reflect)
return finder;
437 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
462 fStep = 2*dy/ndivisions;
487 fStep = (end - start)/ndivisions;
563 if (diff>0.5) diff = 1.-diff;
564 if (diff<1e-8)
return kTRUE;
599 Error(
"FindNextBoundary",
"Must call FindNode first");
602 Int_t inc = (dir[1]>0)?1:0;
604 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
616 if (!reflect)
return finder;
627 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
651 fStep = 2*dz/ndivisions;
674 fStep = (end - start)/ndivisions;
749 if (diff>0.5) diff = 1.-diff;
750 if (diff<1e-8)
return kTRUE;
785 Error(
"FindNextBoundary",
"Must call FindNode first");
788 Int_t inc = (dir[2]>0)?1:0;
790 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
802 if (!reflect)
return finder;
813 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
836 fStep = 2*dx/ndivisions;
859 fStep = (end - start)/ndivisions;
908 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
911 if (diff>0.5) diff = 1.-diff;
912 if (diff<1e-8)
return kTRUE;
926 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
929 Double_t ttsq = txy*txy + (txz-txy*tyz)*(txz-txy*tyz);
932 Double_t divdirz = -(txz-txy*tyz)*divdirx;
933 Double_t dot = dir[0]*divdirx + dir[1]*divdiry + dir[2]*divdirz;
951 if (!reflect)
return finder;
962 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1014 fStep = 2*dy/ndivisions;
1039 fStep = (end - start)/ndivisions;
1087 Double_t yt = point[1]-tyz*point[2];
1090 if (diff>0.5) diff = 1.-diff;
1091 if (diff<1e-8)
return kTRUE;
1103 Double_t yt = point[1]-tyz*point[2];
1114 if ((ind<0) || (ind>=fNdivisions))
return node;
1126 if (!reflect)
return finder;
1137 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1193 fStep = 2*dz/ndivisions;
1221 fStep = (end - start)/ndivisions;
1273 if (diff>0.5) diff = 1.-diff;
1274 if (diff<1e-8)
return kTRUE;
1305 if (!reflect)
return finder;
1316 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1375 fStep = 2*dz/ndivisions;
1406 fStep = (end - start)/ndivisions;
1461 if (diff>0.5) diff = 1.-diff;
1462 if (diff<1e-8)
return kTRUE;
1493 if (!reflect)
return finder;
1504 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1574 fStep = (end - start)/ndivisions;
1613 if (diff>0.5) diff = 1.-diff;
1614 if (diff<1e-8)
return kTRUE;
1656 if (!reflect)
return finder;
1667 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1742 fStep = (end-start+360)/ndivisions;
1744 fStep = (end-start)/ndivisions;
1746 for (
Int_t idiv = 0; idiv<ndivisions; idiv++) {
1775 if (phi<0) phi += 360;
1777 if (ddp<0) ddp+=360;
1780 if (diff>0.5) diff = 1.-diff;
1781 if (diff<1e-8)
return kTRUE;
1793 if (phi<0) phi += 360;
1796 if (ddp<0) ddp+=360;
1818 if (!reflect)
return finder;
1829 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1835 void TGeoPatternCylPhi::Streamer(
TBuffer &R__b)
1916 fStep = (end - start)/ndivisions;
1977 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
2035 fStep = (end - start)/ndivisions;
2094 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
2135 fStep = 360./ndivisions;
2162 fStep = (end-start+360)/ndivisions;
2164 fStep = (end-start)/ndivisions;
2207 if (phi<0) phi += 360;
2209 if (ddp<0) ddp+=360;
2212 if (diff>0.5) diff = 1.-diff;
2213 if (diff<1e-8)
return kTRUE;
2224 if (phi<0) phi += 360;
2227 if (ddp<0) ddp+=360;
2248 if (!reflect)
return finder;
2259 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
2322 fAxisOnRows(pfh.fAxisOnRows),
2323 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.
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)
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.
~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".
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)
Double_t dot(const TVector2 &v1, const TVector2 &v2)
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.
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.
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.
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.
virtual TGeoMatrix * CreateMatrix() const =0
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.
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".
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.
ClassImp(TGeoPatternFinder) ClassImp(TGeoPatternX) ClassImp(TGeoPatternY) ClassImp(TGeoPatternZ) ClassImp(TGeoPatternParaX) ClassImp(TGeoPatternParaY) ClassImp(TGeoPatternParaZ) ClassImp(TGeoPatternTrapZ) ClassImp(TGeoPatternCylR) ClassImp(TGeoPatternCylPhi) ClassImp(TGeoPatternSphR) ClassImp(TGeoPatternSphTheta) ClassImp(TGeoPatternSphPhi) ClassImp(TGeoPatternHoneycomb) TGeoPatternFinder
Constructor.
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.