59 fMatrix(0), fCurrent(-1), fNextIndex(-1)
103 std::vector<ThreadData_t*>::iterator i =
fThreadData.begin();
122 for (
Int_t tid=0; tid<nthreads; tid++) {
167 fNdivisions(pf.fNdivisions),
249 fNdivisions = ndivisions;
273 fStep = 2*dx/ndivisions;
374 if (diff>0.5) diff = 1.-diff;
375 if (diff<1e-8)
return kTRUE;
410 Error(
"FindNextBoundary",
"Must call FindNode first");
413 Int_t inc = (dir[0]>0)?1:0;
415 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
427 if (!reflect)
return finder;
438 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
463 fStep = 2*dy/ndivisions;
564 if (diff>0.5) diff = 1.-diff;
565 if (diff<1e-8)
return kTRUE;
600 Error(
"FindNextBoundary",
"Must call FindNode first");
603 Int_t inc = (dir[1]>0)?1:0;
605 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
617 if (!reflect)
return finder;
628 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
652 fStep = 2*dz/ndivisions;
750 if (diff>0.5) diff = 1.-diff;
751 if (diff<1e-8)
return kTRUE;
786 Error(
"FindNextBoundary",
"Must call FindNode first");
789 Int_t inc = (dir[2]>0)?1:0;
791 if (dist<0.)
Error(
"FindNextBoundary",
"Negative distance d=%g",dist);
803 if (!reflect)
return finder;
814 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
837 fStep = 2*dx/ndivisions;
909 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
912 if (diff>0.5) diff = 1.-diff;
913 if (diff<1e-8)
return kTRUE;
927 Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
930 Double_t ttsq = txy*txy + (txz-txy*tyz)*(txz-txy*tyz);
933 Double_t divdirz = -(txz-txy*tyz)*divdirx;
934 Double_t dot = dir[0]*divdirx + dir[1]*divdiry + dir[2]*divdirz;
952 if (!reflect)
return finder;
963 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1015 fStep = 2*dy/ndivisions;
1088 Double_t yt = point[1]-tyz*point[2];
1091 if (diff>0.5) diff = 1.-diff;
1092 if (diff<1e-8)
return kTRUE;
1104 Double_t yt = point[1]-tyz*point[2];
1115 if ((ind<0) || (ind>=fNdivisions))
return node;
1127 if (!reflect)
return finder;
1138 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1194 fStep = 2*dz/ndivisions;
1274 if (diff>0.5) diff = 1.-diff;
1275 if (diff<1e-8)
return kTRUE;
1306 if (!reflect)
return finder;
1317 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1376 fStep = 2*dz/ndivisions;
1462 if (diff>0.5) diff = 1.-diff;
1463 if (diff<1e-8)
return kTRUE;
1494 if (!reflect)
return finder;
1505 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1614 if (diff>0.5) diff = 1.-diff;
1615 if (diff<1e-8)
return kTRUE;
1657 if (!reflect)
return finder;
1668 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1743 fStep = (end-start+360)/ndivisions;
1747 for (
Int_t idiv = 0; idiv<ndivisions; idiv++) {
1776 if (phi<0) phi += 360;
1778 if (ddp<0) ddp+=360;
1781 if (diff>0.5) diff = 1.-diff;
1782 if (diff<1e-8)
return kTRUE;
1794 if (phi<0) phi += 360;
1797 if (ddp<0) ddp+=360;
1819 if (!reflect)
return finder;
1830 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
1836 void TGeoPatternCylPhi::Streamer(
TBuffer &R__b)
1978 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
2095 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
2136 fStep = 360./ndivisions;
2163 fStep = (end-start+360)/ndivisions;
2208 if (phi<0) phi += 360;
2210 if (ddp<0) ddp+=360;
2213 if (diff>0.5) diff = 1.-diff;
2214 if (diff<1e-8)
return kTRUE;
2225 if (phi<0) phi += 360;
2228 if (ddp<0) ddp+=360;
2249 if (!reflect)
return finder;
2260 out << iaxis <<
", " << fNdivisions <<
", " <<
fStart <<
", " <<
fStep;
2323 fAxisOnRows(pfh.fAxisOnRows),
2324 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.