49 Error(
"InitThreadSlot",
"Pattern finder has no owning geometry manager");
57 static std::mutex sInitMutex;
58 std::lock_guard<std::mutex> guard(sInitMutex);
84 if (!manager || !matrix)
131 fNdivisions(pf.fNdivisions),
132 fDivIndex(pf.fDivIndex),
237 fStep = 2 * dx / ndivisions;
261 fStep = (end - start) / ndivisions;
377 Error(
"FindNextBoundary",
"Must call FindNode first");
380 Int_t inc = (dir[0] > 0) ? 1 : 0;
383 Error(
"FindNextBoundary",
"Negative distance d=%g", dist);
431 fStep = 2 * dy / ndivisions;
455 fStep = (end - start) / ndivisions;
571 Error(
"FindNextBoundary",
"Must call FindNode first");
574 Int_t inc = (dir[1] > 0) ? 1 : 0;
577 Error(
"FindNextBoundary",
"Negative distance d=%g", dist);
624 fStep = 2 * dz / ndivisions;
646 fStep = (end - start) / ndivisions;
761 Error(
"FindNextBoundary",
"Must call FindNode first");
764 Int_t inc = (dir[2] > 0) ? 1 : 0;
767 Error(
"FindNextBoundary",
"Negative distance d=%g", dist);
814 fStep = 2 * dx / ndivisions;
837 fStep = (end - start) / ndivisions;
883 Double_t xt = point[0] - txz * point[2] - txy * (point[1] - tyz * point[2]);
903 Double_t xt = point[0] - txz * point[2] - txy * (point[1] - tyz * point[2]);
906 Double_t ttsq = txy * txy + (txz - txy * tyz) * (txz - txy * tyz);
909 Double_t divdirz = -(txz - txy * tyz) * divdirx;
910 Double_t dot = dir[0] * divdirx + dir[1] * divdiry + dir[2] * divdirz;
995 fStep = 2 * dy / ndivisions;
1020 fStep = (end - start) / ndivisions;
1065 Double_t yt = point[1] - tyz * point[2];
1083 Double_t yt = point[1] - tyz * point[2];
1088 Double_t dot = dir[1] * divdiry + dir[2] * divdirz;
1177 fStep = 2 * dz / ndivisions;
1205 fStep = (end - start) / ndivisions;
1362 fStep = 2 * dz / ndivisions;
1393 fStep = (end - start) / ndivisions;
1561 fStep = (end - start) / ndivisions;
1626 Double_t dot = point[0] * dir[0] + point[1] * dir[1];
1734 if ((end - start) < 0)
1735 fStep = (end - start + 360) / ndivisions;
1737 fStep = (end - start) / ndivisions;
1739 for (
Int_t idiv = 0; idiv < ndivisions; idiv++) {
1801 Double_t dot = point[0] * dir[1] - point[1] * dir[0];
1919 fStep = (end - start) / ndivisions;
2034 fStep = (end - start) / ndivisions;
2130 fStep = 360. / ndivisions;
2158 if ((end - start) < 0)
2159 fStep = (end - start + 360) / ndivisions;
2161 fStep = (end - start) / ndivisions;
2236 Double_t dot = point[0] * dir[1] - point[1] * dir[0];
2331 fAxisOnRows(pfh.fAxisOnRows),
2332 fNdivisions(pfh.fNdivisions),
int Int_t
Signed integer 4 bytes (int)
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
R__EXTERN TGeoIdentity * gGeoIdentity
Buffer base class used for serializing objects.
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=nullptr)=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.
void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE) override
Multiply by a reflection respect to XY.
Matrix class used for computing global transformations Should NOT be used for node definition.
void SetDz(Double_t dz) override
void FastRotZ(const Double_t *sincos)
Perform a rotation about Z having the sine/cosine of the rotation angle.
void SetDy(Double_t dy) override
void Clear(Option_t *option="") override
clear the data for this matrix
void SetDx(Double_t dx) override
The manager class for any TGeo geometry.
TObjArray * GetListOfMatrices() const
void RegisterMatrix(const TGeoMatrix *matrix)
Register a matrix to the list of matrices.
Geometrical transformation package.
virtual void SetDz(Double_t)
virtual void SetDy(Double_t)
Bool_t IsRotation() const
virtual void SetDx(Double_t)
Bool_t IsRegistered() const
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
a cylindrical phi divison pattern
TGeoPatternCylPhi()
Default constructor.
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
find the node containing the query point
Bool_t IsOnBoundary(const Double_t *point) const override
Checks if the current point is on division boundary.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
~TGeoPatternCylPhi() override
Destructor.
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
Double_t * fSinCos
![2*fNdivisions] table of sines/cosines
void Streamer(TBuffer &) override
Stream an object of class TGeoVolume.
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
a cylindrical R divison pattern
Bool_t IsOnBoundary(const Double_t *point) const override
Checks if the current point is on division boundary.
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
TGeoPatternCylR()
Default constructor.
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
find the node containing the query point
TGeoPatternCylR & operator=(const TGeoPatternCylR &)
assignment operator
~TGeoPatternCylR() override
Destructor.
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
base finder class for patterns. A pattern is specifying a division type
static std::atomic< UInt_t > fgInstanceCount
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.
void InitThreadSlot(ThreadData_t &td) const
(Re)build the per-thread scratch state for this finder into the given slot.
ThreadData_t & GetThreadData() const
Per-thread scratch state, owned by the calling thread and indexed by this finder.
TGeoPatternFinder & operator=(const TGeoPatternFinder &)
assignment operator
TGeoMatrix * GetOwnerIdentity() const
Return the identity matrix owned by this finder's geometry manager.
void SetNext(Int_t index)
Set index of next division.
~TGeoPatternFinder() override
Destructor.
TGeoManager * GetOwnerManager() const
void RegisterMatrix(TGeoMatrix *matrix) const
Register a lazily-created pattern matrix with the manager owning this finder's volume.
Bool_t IsReflected() const
void CreateThreadData(Int_t)
No-op: this finder allocates its scratch state lazily for every calling thread.
Int_t GetCurrent()
Return current index.
std::atomic< Int_t > fGeneration
non-reused index of this finder into the per-thread vector
void ClearThreadData() const
Invalidate the per-thread data.
TGeoPatternFinder()
Default constructor.
Int_t GetNext() const
Get index of next division.
TGeoNode * GetNodeOffset(Int_t idiv)
virtual TGeoMatrix * CreateMatrix() const =0
a divison pattern specialized for honeycombs
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
TGeoPatternHoneycomb()
Default constructor.
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
~TGeoPatternHoneycomb() override
destructor
TGeoPatternHoneycomb & operator=(const TGeoPatternHoneycomb &)
assignment operator
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
find the node containing the query point
a X axis divison pattern for PARA shapes
~TGeoPatternParaX() override
Destructor.
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
Bool_t IsOnBoundary(const Double_t *point) const override
Checks if the current point is on division boundary.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
get the node division containing the query point
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
TGeoPatternParaX()
Default constructor.
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
TGeoPatternParaX & operator=(const TGeoPatternParaX &)
assignment operator
a Y axis divison pattern for PARA shapes
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
~TGeoPatternParaY() override
Destructor.
Bool_t IsOnBoundary(const Double_t *point) const override
Checks if the current point is on division boundary.
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
get the node division containing the query point
TGeoPatternParaY()
Default constructor.
TGeoPatternParaY & operator=(const TGeoPatternParaY &)
assignment operator
a Z axis divison pattern for PARA shapes
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
Bool_t IsOnBoundary(const Double_t *point) const override
Checks if the current point is on division boundary.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
~TGeoPatternParaZ() override
Destructor.
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
TGeoPatternParaZ & operator=(const TGeoPatternParaZ &)
assignment operator
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
get the node division containing the query point
TGeoPatternParaZ()
Default constructor.
a spherical phi divison pattern
TGeoPatternSphPhi()
Default constructor.
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
find the node containing the query point
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
~TGeoPatternSphPhi() override
Destructor.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
Double_t * fSinCos
! Sincos table
Double_t * CreateSinCos()
Create the sincos table if it does not exist.
Bool_t IsOnBoundary(const Double_t *point) const override
Checks if the current point is on division boundary.
a spherical R divison pattern
~TGeoPatternSphR() override
Destructor.
TGeoPatternSphR()
Default constructor.
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
find the node containing the query point
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
TGeoPatternSphR & operator=(const TGeoPatternSphR &)
assignment operator
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
a spherical theta divison pattern
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
find the node containing the query point
~TGeoPatternSphTheta() override
Destructor.
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
TGeoPatternSphTheta()
Default constructor.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
TGeoPatternSphTheta & operator=(const TGeoPatternSphTheta &)
assignment operator
a Z axis divison pattern for TRAP or GTRA shapes
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
TGeoPatternTrapZ()
Default constructor.
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
get the node division containing the query point
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
Bool_t IsOnBoundary(const Double_t *point) const override
Checks if the current point is on division boundary.
TGeoPatternTrapZ & operator=(const TGeoPatternTrapZ &)
assignment operator
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
~TGeoPatternTrapZ() override
Destructor.
TGeoPatternX & operator=(const TGeoPatternX &)
assignment operator
~TGeoPatternX() override
Destructor.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
void cd(Int_t idiv) override
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.
TGeoPatternX()
Default constructor.
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
Bool_t IsOnBoundary(const Double_t *point) const override
Checks if the current point is on division boundary.
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
Find the cell corresponding to point and next cell along dir (if asked)
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
Find the cell corresponding to point and next cell along dir (if asked)
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
TGeoPatternY & operator=(const TGeoPatternY &)
assignment operator
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
Bool_t IsOnBoundary(const Double_t *point) const override
Checks if the current point is on division boundary.
~TGeoPatternY() override
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.
void cd(Int_t idiv) override
Update current division index and global matrix to point to a given slice.
TGeoMatrix * CreateMatrix() const override
Return new matrix of type used by this finder.
TGeoNode * FindNode(Double_t *point, const Double_t *dir=nullptr) override
Find the cell corresponding to point and next cell along dir (if asked)
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.
TGeoPatternZ()
Default constructor.
~TGeoPatternZ() override
Destructor.
TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE) override
Make a copy of this finder. Reflect by Z if required.
TGeoPatternZ & operator=(const TGeoPatternZ &)
assignment operator
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a primitive as a C++ statement(s) on output stream "out".
Bool_t IsOnBoundary(const Double_t *point) const override
Checks if the current point is on division boundary.
void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
Class describing rotations.
void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE) override
Multiply by a reflection respect to XY.
static Double_t Tolerance()
Class describing translations.
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
TGeoShape * GetShape() const
TObject * At(Int_t idx) const override
Mother of all ROOT objects.
TObject & operator=(const TObject &rhs) noexcept
TObject assignment operator.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Double_t Sqrt(Double_t x)
Returns the square root of x.
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
bumped whenever the per-thread state must be rebuilt
Int_t fCurrent
generic matrix (owned by TGeoManager)
Int_t fInitGen
index of next node
Int_t fNextIndex
current division element