Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGeoPatternFinder.h
Go to the documentation of this file.
1// @(#)root/geom:$Id$
2// Author: Andrei Gheata 30/10/01
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGeoPatternFinder
13#define ROOT_TGeoPatternFinder
14
15#include "TObject.h"
16
17#include <algorithm>
18#include <atomic>
19#include <vector>
20
21#include "TGeoVolume.h"
22
23class TGeoMatrix;
24
25/// base finder class for patterns. A pattern is specifying a division type
26class TGeoPatternFinder : public TObject {
27 static std::atomic<UInt_t> fgInstanceCount; //! source of monotonic per-object indices
28 UInt_t fIndex{fgInstanceCount++}; //! non-reused index of this finder into the per-thread vector
29 mutable std::atomic<Int_t> fGeneration{0}; //! bumped whenever the per-thread state must be rebuilt
30
31public:
32 struct ThreadData_t {
33 // fMatrix is produced by the virtual CreateMatrix() and registered with (owned by) the
34 // geometry manager, so this struct does not own it. All members are trivially movable,
35 // which lets the slot live in a resizable thread_local vector.
36 TGeoMatrix *fMatrix{nullptr}; //! generic matrix (owned by TGeoManager)
37 Int_t fCurrent{-1}; //! current division element
38 Int_t fNextIndex{-1}; //! index of next node
39 Int_t fInitGen{-1}; //! generation this slot was last initialized for
40 };
41
42 /// Per-thread scratch state, owned by the calling thread and indexed by this finder.
43 /// Hot path: a TLS read plus an indexed load; the cold rebuild lives in InitThreadSlot().
44 /// The vector retains its high-water size until the owning thread exits.
46 {
47 thread_local std::vector<ThreadData_t> tdata;
48 if (tdata.size() <= fIndex)
49 tdata.resize(std::max<size_t>(fgInstanceCount.load(std::memory_order_relaxed), fIndex + 1));
51 if (td.fInitGen != fGeneration.load(std::memory_order_acquire))
53 return td;
54 }
55 /// Invalidate the per-thread data. Each thread rebuilds its own slot lazily on next access,
56 /// so no cross-thread reach-in is needed.
57 void ClearThreadData() const { fGeneration.fetch_add(1, std::memory_order_release); }
58 /// No-op: this finder allocates its scratch state lazily for every calling thread.
60
61protected:
62 void InitThreadSlot(ThreadData_t &td) const;
63 TGeoManager *GetOwnerManager() const { return fVolume ? fVolume->GetGeoManager() : nullptr; }
65 void RegisterMatrix(TGeoMatrix *matrix) const;
66
71 Double_t fStep; // division step length
72 Double_t fStart; // starting point on divided axis
73 Double_t fEnd; // ending point
74 Int_t fNdivisions; // number of divisions
75 Int_t fDivIndex; // index of first div. node
76 TGeoVolume *fVolume; // volume to which applies
77
78protected:
81
82public:
83 // constructors
86 // destructor
87 ~TGeoPatternFinder() override;
88 // methods
89 virtual TGeoMatrix *CreateMatrix() const = 0;
90 virtual void cd(Int_t /*idiv*/) {}
91 virtual TGeoNode *CdNext();
92 virtual TGeoNode *FindNode(Double_t * /*point*/, const Double_t * /*dir*/ = nullptr) { return nullptr; }
93 virtual Int_t GetByteCount() const { return 36; }
94 Int_t GetCurrent(); // {return fCurrent;}
96 virtual Int_t GetDivAxis() { return 1; }
97 virtual TGeoMatrix *GetMatrix(); // {return fMatrix;}
98 Int_t GetNdiv() const { return fNdivisions; }
99 Int_t GetNext() const; // {return fNextIndex;}
101 Double_t GetStart() const { return fStart; }
102 Double_t GetStep() const { return fStep; }
103 Double_t GetEnd() const { return fEnd; }
104 TGeoVolume *GetVolume() const { return fVolume; }
105 virtual Bool_t IsOnBoundary(const Double_t * /*point*/) const { return kFALSE; }
111 void SetNext(Int_t index); // {fNextIndex = index;}
112 void SetRange(Double_t start, Double_t step, Int_t ndivisions);
114 void SetVolume(TGeoVolume *vol) { fVolume = vol; }
115 virtual void UpdateMatrix(Int_t, TGeoHMatrix &) const {}
116
117 ClassDefOverride(TGeoPatternFinder, 4) // patterns to divide volumes
118};
119
120/// a X axis divison pattern
121class TGeoTranslation;
122
124public:
125 // constructors
126 TGeoPatternX();
132
133 // destructor
134 ~TGeoPatternX() override;
135 // methods
136 TGeoMatrix *CreateMatrix() const override;
137 void cd(Int_t idiv) override;
138 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
139 virtual Double_t FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext);
140 Int_t GetDivAxis() override { return 1; }
141 Bool_t IsOnBoundary(const Double_t *point) const override;
142
144 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
145 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
146
147 ClassDefOverride(TGeoPatternX, 1) // X division pattern
148};
149
150/// a Y axis divison pattern
152public:
153 // constructors
154 TGeoPatternY();
160 // destructor
161 ~TGeoPatternY() override;
162 // methods
163 TGeoMatrix *CreateMatrix() const override;
164 void cd(Int_t idiv) override;
165 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
166 virtual Double_t FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext);
167 Int_t GetDivAxis() override { return 2; }
168 Bool_t IsOnBoundary(const Double_t *point) const override;
169
171 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
172 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
173
174 ClassDefOverride(TGeoPatternY, 1) // Y division pattern
175};
176
177/// a Z axis divison pattern
179public:
180 // constructors
181 TGeoPatternZ();
187 // destructor
188 ~TGeoPatternZ() override;
189 // methods
190 TGeoMatrix *CreateMatrix() const override;
191 void cd(Int_t idiv) override;
192 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
193 virtual Double_t FindNextBoundary(Double_t *point, Double_t *dir, Int_t &indnext);
194 Int_t GetDivAxis() override { return 3; }
195 Bool_t IsOnBoundary(const Double_t *point) const override;
196
198 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
199 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
200
201 ClassDefOverride(TGeoPatternZ, 1) // Z division pattern
202};
203
204/// a X axis divison pattern for PARA shapes
206public:
207 // constructors
214
215 // destructor
216 ~TGeoPatternParaX() override;
217 // methods
218 TGeoMatrix *CreateMatrix() const override;
219 void cd(Int_t idiv) override;
220 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
221 Int_t GetDivAxis() override { return 1; }
222 Bool_t IsOnBoundary(const Double_t *point) const override;
223
225 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
226 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
227
228 ClassDefOverride(TGeoPatternParaX, 1) // Para X division pattern
229};
230
231/// a Y axis divison pattern for PARA shapes
233private:
234 // data members
235 Double_t fTxy = 0.; // tangent of alpha
236public:
237 // constructors
244
245 // destructor
246 ~TGeoPatternParaY() override;
247 // methods
248 TGeoMatrix *CreateMatrix() const override;
249 void cd(Int_t idiv) override;
250 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
251 Int_t GetDivAxis() override { return 2; }
252 Bool_t IsOnBoundary(const Double_t *point) const override;
253
255 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
256 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
257
258 ClassDefOverride(TGeoPatternParaY, 1) // Para Y division pattern
259};
260
261/// a Z axis divison pattern for PARA shapes
263private:
264 // data members
265 Double_t fTxz = 0.; // tangent of alpha xz
266 Double_t fTyz = 0.; // tangent of alpha yz
267public:
268 // constructors
275
276 // destructor
277 ~TGeoPatternParaZ() override;
278 // methods
279 TGeoMatrix *CreateMatrix() const override;
280 void cd(Int_t idiv) override;
281 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
282 Int_t GetDivAxis() override { return 3; }
283 Bool_t IsOnBoundary(const Double_t *point) const override;
284
286 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
287 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
288
289 ClassDefOverride(TGeoPatternParaZ, 1) // Para Z division pattern
290};
291
292/// a Z axis divison pattern for TRAP or GTRA shapes
294private:
295 // data members
296 Double_t fTxz = 0.; // tangent of alpha xz
297 Double_t fTyz = 0.; // tangent of alpha yz
298public:
299 // constructors
306
307 // destructor
308 ~TGeoPatternTrapZ() override;
309 // methods
310 TGeoMatrix *CreateMatrix() const override;
311 Double_t GetTxz() const { return fTxz; }
312 Double_t GetTyz() const { return fTyz; }
313 void cd(Int_t idiv) override;
314 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
315 Int_t GetDivAxis() override { return 3; }
316 Bool_t IsOnBoundary(const Double_t *point) const override;
317
319 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
320 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
321
322 ClassDefOverride(TGeoPatternTrapZ, 1) // Trap od Gtra Z division pattern
323};
324
325/// a cylindrical R divison pattern
327public:
328 // constructors
335 // destructor
336 ~TGeoPatternCylR() override;
337 // methods
338 TGeoMatrix *CreateMatrix() const override;
339 void cd(Int_t idiv) override;
340 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
341 Int_t GetDivAxis() override { return 1; }
342 Bool_t IsOnBoundary(const Double_t *point) const override;
343
345 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
346 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
347
348 ClassDefOverride(TGeoPatternCylR, 1) // Cylindrical R division pattern
349};
350
351/// a cylindrical phi divison pattern
353private:
354 // data members
355 Double_t *fSinCos = nullptr; ///<![2*fNdivisions] table of sines/cosines
356
357protected:
363 {
364 if (this != &pfc) {
366 fSinCos = pfc.fSinCos;
368 }
369 return *this;
370 }
371
372public:
373 // constructors
378 // destructor
379 ~TGeoPatternCylPhi() override;
380 // methods
381 TGeoMatrix *CreateMatrix() const override;
382 void cd(Int_t idiv) override;
383 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
384 Int_t GetDivAxis() override { return 2; }
385 Bool_t IsOnBoundary(const Double_t *point) const override;
386
388 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
389 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
390
391 ClassDefOverride(TGeoPatternCylPhi, 1) // Cylindrical phi division pattern
392};
393
394/// a spherical R divison pattern
396public:
397 // constructors
404 // destructor
405 ~TGeoPatternSphR() override;
406 // methods
407 TGeoMatrix *CreateMatrix() const override;
408 void cd(Int_t idiv) override;
409 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
410 Int_t GetDivAxis() override { return 1; }
411
413 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
414 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
415
416 ClassDefOverride(TGeoPatternSphR, 1) // spherical R division pattern
417};
418
419/// a spherical theta divison pattern
421public:
422 // constructors
429 // destructor
430 ~TGeoPatternSphTheta() override;
431 // methods
432 TGeoMatrix *CreateMatrix() const override;
433 void cd(Int_t idiv) override;
434 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
435 Int_t GetDivAxis() override { return 3; }
436
438 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
439 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
440
441 ClassDefOverride(TGeoPatternSphTheta, 1) // spherical theta division pattern
442};
443
444/// a spherical phi divison pattern
446private:
447 Double_t *fSinCos = nullptr; ///<! Sincos table
448
449protected:
453
454public:
455 // constructors
460 // destructor
461 ~TGeoPatternSphPhi() override;
462 // methods
463 TGeoMatrix *CreateMatrix() const override;
464 void cd(Int_t idiv) override;
465 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
466 Int_t GetDivAxis() override { return 2; }
467 Bool_t IsOnBoundary(const Double_t *point) const override;
468
470 void SavePrimitive(std::ostream &out, Option_t *option = "") override;
471 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
472
473 ClassDefOverride(TGeoPatternSphPhi, 1) // Spherical phi division pattern
474};
475
476/// a divison pattern specialized for honeycombs
478private:
479 // data members
480 Int_t fNrows; // number of rows
481 Int_t fAxisOnRows; // axis along each row
482 Int_t *fNdivisions; // [fNrows] number of divisions for each row
483 Double_t *fStart; // [fNrows] starting points for each row
484
485protected:
488
489public:
490 // constructors
493 // destructor
494 ~TGeoPatternHoneycomb() override;
495 // methods
496 TGeoPatternFinder *MakeCopy(Bool_t) override { return nullptr; }
497 TGeoMatrix *CreateMatrix() const override;
498 void cd(Int_t idiv) override;
499 TGeoNode *FindNode(Double_t *point, const Double_t *dir = nullptr) override;
500 void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override;
501
502 ClassDefOverride(TGeoPatternHoneycomb, 1) // pattern for honeycomb divisions
503};
504
505#endif
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:78
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:60
constexpr Bool_t kFALSE
Definition RtypesCore.h:109
double Double_t
Double 8 bytes.
Definition RtypesCore.h:74
constexpr Bool_t kTRUE
Definition RtypesCore.h:108
const char Option_t
Option string (const char)
Definition RtypesCore.h:81
#define BIT(n)
Definition Rtypes.h:90
#define ClassDefOverride(name, id)
Definition Rtypes.h:347
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t option
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
Matrix class used for computing global transformations Should NOT be used for node definition.
Definition TGeoMatrix.h:459
The manager class for any TGeo geometry.
Definition TGeoManager.h:46
Geometrical transformation package.
Definition TGeoMatrix.h:39
A node represent a volume positioned inside another.They store links to both volumes and to the TGeoM...
Definition TGeoNode.h:39
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.
TGeoPatternCylPhi(const TGeoPatternCylPhi &pfc)
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 UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const override
Fills external matrix with the local one corresponding to the given division index.
Int_t GetDivAxis() override
TGeoPatternCylPhi & operator=(const TGeoPatternCylPhi &pfc)
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
Int_t GetDivAxis() override
~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
virtual void cd(Int_t)
void Reflect(Bool_t flag=kTRUE)
virtual TGeoNode * CdNext()
Make next node (if any) current.
void SetSpacedOut(Bool_t flag)
void SetDivIndex(Int_t index)
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.
virtual TGeoNode * FindNode(Double_t *, const Double_t *=nullptr)
virtual void UpdateMatrix(Int_t, TGeoHMatrix &) const
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.
UInt_t fIndex
source of monotonic per-object indices
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.
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)=0
virtual Int_t GetDivAxis()
~TGeoPatternFinder() override
Destructor.
TGeoManager * GetOwnerManager() const
virtual Bool_t IsOnBoundary(const Double_t *) const
Int_t GetNdiv() const
TGeoVolume * GetVolume() 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 SetVolume(TGeoVolume *vol)
Double_t GetStep() 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.
Bool_t IsSpacedOut() const
Double_t GetStart() const
TGeoPatternFinder()
Default constructor.
Int_t GetNext() const
Get index of next division.
virtual Int_t GetByteCount() const
Double_t GetEnd() const
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.
TGeoPatternFinder * MakeCopy(Bool_t) override
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.
Int_t GetDivAxis() override
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.
Int_t GetDivAxis() override
~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
Int_t GetDivAxis() override
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.
Int_t GetDivAxis() override
TGeoPatternSphPhi & operator=(const TGeoPatternSphPhi &pfc)=delete
~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
TGeoPatternSphPhi(const TGeoPatternSphPhi &pfc)=delete
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
Int_t GetDivAxis() override
~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
Int_t GetDivAxis() override
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.
Double_t GetTxz() const
Double_t GetTyz() const
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.
Int_t GetDivAxis() override
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.
Int_t GetDivAxis() override
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)
a Y axis divison pattern
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
Int_t GetDivAxis() override
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.
a Z axis divison pattern
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.
Int_t GetDivAxis() override
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 translations.
Definition TGeoMatrix.h:117
TGeoVolume, TGeoVolumeMulti, TGeoVolumeAssembly are the volume classes.
Definition TGeoVolume.h:45
TGeoManager * GetGeoManager() const
Definition TGeoVolume.h:176
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
Mother of all ROOT objects.
Definition TObject.h:42
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:204
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:886
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