Logo ROOT  
Reference Guide
TGeoPatternFinder.cxx
Go to the documentation of this file.
1 // @(#)root/geom:$Id$
2 // Author: Andrei Gheata 30/10/01
3 
4 /** \class TGeoPatternFinder
5 \ingroup Geometry_classes
6 
7 Base finder class for patterns.
8 
9  A pattern is specifying a division type which applies only to a given
10 shape type. The implemented patterns are for the moment equidistant slices
11 on different axis. Implemented patterns are:
12 
13  - TGeoPatternX - a X axis divison pattern
14  - TGeoPatternY - a Y axis divison pattern
15  - TGeoPatternZ - a Z axis divison pattern
16  - TGeoPatternParaX - a X axis divison pattern for PARA shape
17  - TGeoPatternParaY - a Y axis divison pattern for PARA shape
18  - TGeoPatternParaZ - a Z axis divison pattern for PARA shape
19  - TGeoPatternTrapZ - a Z axis divison pattern for TRAP or GTRA shapes
20  - TGeoPatternCylR - a cylindrical R divison pattern
21  - TGeoPatternCylPhi - a cylindrical phi divison pattern
22  - TGeoPatternSphR - a spherical R divison pattern
23  - TGeoPatternSphTheta - a spherical theta divison pattern
24  - TGeoPatternSphPhi - a spherical phi divison pattern
25  - TGeoPatternHoneycomb - a divison pattern specialized for honeycombs
26 */
27 
28 #include "TGeoPatternFinder.h"
29 
30 #include "TBuffer.h"
31 #include "TObject.h"
32 #include "TGeoMatrix.h"
33 #include "TGeoPara.h"
34 #include "TGeoArb8.h"
35 #include "TGeoNode.h"
36 #include "TGeoManager.h"
37 #include "TMath.h"
38 
53 
54 
55 ////////////////////////////////////////////////////////////////////////////////
56 /// Constructor.
57 
59  fMatrix(0), fCurrent(-1), fNextIndex(-1)
60 {
61 }
62 
63 ////////////////////////////////////////////////////////////////////////////////
64 /// Destructor.
65 
67 {
68 // if (fMatrix != gGeoIdentity) delete fMatrix;
69 }
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 
74 {
76  return *fThreadData[tid];
77 }
78 
79 ////////////////////////////////////////////////////////////////////////////////
80 
82 {
83  std::lock_guard<std::mutex> guard(fMutex);
84  std::vector<ThreadData_t*>::iterator i = fThreadData.begin();
85  while (i != fThreadData.end())
86  {
87  delete *i;
88  ++i;
89  }
90  fThreadData.clear();
91  fThreadSize = 0;
92 }
93 
94 ////////////////////////////////////////////////////////////////////////////////
95 /// Create thread data for n threads max.
96 
98 {
99  std::lock_guard<std::mutex> guard(fMutex);
100  fThreadData.resize(nthreads);
101  fThreadSize = nthreads;
102  for (Int_t tid=0; tid<nthreads; tid++) {
103  if (fThreadData[tid] == 0) {
104  fThreadData[tid] = new ThreadData_t;
105  fThreadData[tid]->fMatrix = CreateMatrix();
106  }
107  }
108 }
109 
110 ////////////////////////////////////////////////////////////////////////////////
111 /// Default constructor
112 
114 {
115  fNdivisions = 0;
116  fDivIndex = 0;
117  fStep = 0;
118  fStart = 0;
119  fEnd = 0;
120  fVolume = 0;
121  fThreadSize = 0;
122 }
123 
124 ////////////////////////////////////////////////////////////////////////////////
125 /// Default constructor
126 
128 {
129  fVolume = vol;
130  fNdivisions = ndiv;
131  fDivIndex = 0;
132  fStep = 0;
133  fStart = 0;
134  fEnd = 0;
135  fThreadSize = 0;
136 }
137 
138 ////////////////////////////////////////////////////////////////////////////////
139 ///copy constructor
140 
142  TObject(pf),
143  fStep(pf.fStep),
144  fStart(pf.fStart),
145  fEnd(pf.fEnd),
147  fDivIndex(pf.fDivIndex),
148  fVolume(pf.fVolume)
149 {
150 }
151 
152 ////////////////////////////////////////////////////////////////////////////////
153 ///assignment operator
154 
156 {
157  if(this!=&pf) {
158  TObject::operator=(pf);
159  fStep=pf.fStep;
160  fStart=pf.fStart;
161  fEnd=pf.fEnd;
163  fDivIndex=pf.fDivIndex;
164  fVolume=pf.fVolume;
165  }
166  return *this;
167 }
168 
169 ////////////////////////////////////////////////////////////////////////////////
170 /// Destructor
171 
173 {
174  ClearThreadData();
175 }
176 
177 ////////////////////////////////////////////////////////////////////////////////
178 /// Return current index.
179 
181 {
182  return GetThreadData().fCurrent;
183 }
184 
185 ////////////////////////////////////////////////////////////////////////////////
186 /// Return current matrix.
187 
189 {
190  return GetThreadData().fMatrix;
191 }
192 
193 ////////////////////////////////////////////////////////////////////////////////
194 /// Get index of next division.
195 
197 {
198  return GetThreadData().fNextIndex;
199 }
200 
201 ////////////////////////////////////////////////////////////////////////////////
202 /// Set index of next division.
203 
205 {
206  GetThreadData().fNextIndex = index;
207 }
208 
209 ////////////////////////////////////////////////////////////////////////////////
210 /// Make next node (if any) current.
211 
213 {
214  ThreadData_t& td = GetThreadData();
215  if (td.fNextIndex < 0) return NULL;
216  cd(td.fNextIndex);
217  return GetNodeOffset(td.fCurrent);
218 }
219 
220 ////////////////////////////////////////////////////////////////////////////////
221 /// Set division range. Use this method only when dividing an assembly.
222 
223 void TGeoPatternFinder::SetRange(Double_t start, Double_t step, Int_t ndivisions)
224 {
225  fStart = start;
226  fEnd = fStart + ndivisions*step;
227  fStep = step;
228  fNdivisions = ndivisions;
229 }
230 
231 //______________________________________________________________________________
232 // TGeoPatternX - a X axis divison pattern
233 //______________________________________________________________________________
234 
235 ////////////////////////////////////////////////////////////////////////////////
236 /// Default constructor
237 
239 {
240  CreateThreadData(1);
241 }
242 
243 ////////////////////////////////////////////////////////////////////////////////
244 /// constructor
245 
247  :TGeoPatternFinder(vol, ndivisions)
248 {
249  Double_t dx = ((TGeoBBox*)vol->GetShape())->GetDX();
250  fStart = -dx;
251  fEnd = dx;
252  fStep = 2*dx/ndivisions;
253  CreateThreadData(1);
254 }
255 
256 ////////////////////////////////////////////////////////////////////////////////
257 /// constructor
258 
260  :TGeoPatternFinder(vol, ndivisions)
261 {
262  Double_t dx = ((TGeoBBox*)vol->GetShape())->GetDX();
263  fStart = -dx;
264  fEnd = fStart + ndivisions*step;
265  fStep = step;
266  CreateThreadData(1);
267 }
268 
269 ////////////////////////////////////////////////////////////////////////////////
270 /// constructor
271 
273  :TGeoPatternFinder(vol, ndivisions)
274 {
275  fStart = start;
276  fEnd = end;
277  fStep = (end - start)/ndivisions;
278  CreateThreadData(1);
279 }
280 
281 ////////////////////////////////////////////////////////////////////////////////
282 ///copy constructor
283 
286 {
287  CreateThreadData(1);
288 }
289 
290 ////////////////////////////////////////////////////////////////////////////////
291 ///assignment operator
292 
294 {
295  if(this!=&pf) {
297  CreateThreadData(1);
298  }
299  return *this;
300 }
301 
302 ////////////////////////////////////////////////////////////////////////////////
303 /// Destructor
304 
306 {
307 }
308 
309 ////////////////////////////////////////////////////////////////////////////////
310 /// Update current division index and global matrix to point to a given slice.
311 
313 {
314  ThreadData_t& td = GetThreadData();
315  td.fCurrent=idiv;
316  td.fMatrix->SetDx(fStart+idiv*fStep+0.5*fStep);
317 }
318 
319 ////////////////////////////////////////////////////////////////////////////////
320 /// Return new matrix of type used by this finder.
321 
323 {
324  if (!IsReflected()) {
325  TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
326  matrix->RegisterYourself();
327  return matrix;
328  }
329  TGeoCombiTrans *combi = new TGeoCombiTrans();
330  combi->RegisterYourself();
331  combi->ReflectZ(kTRUE);
332  combi->ReflectZ(kFALSE);
333  return combi;
334 }
335 
336 ////////////////////////////////////////////////////////////////////////////////
337 /// Fills external matrix with the local one corresponding to the given division
338 /// index.
339 
341 {
342  matrix.Clear();
343  matrix.SetDx(fStart+idiv*fStep+0.5*fStep);
344 }
345 
346 ////////////////////////////////////////////////////////////////////////////////
347 /// Checks if the current point is on division boundary
348 
350 {
351  Double_t seg = (point[0]-fStart)/fStep;
352  Double_t diff = seg - Long64_t(seg);
353  if (diff>0.5) diff = 1.-diff;
354  if (diff<1e-8) return kTRUE;
355  return kFALSE;
356 }
357 
358 ////////////////////////////////////////////////////////////////////////////////
359 /// Find the cell corresponding to point and next cell along dir (if asked)
360 
362 {
363  ThreadData_t& td = GetThreadData();
364  TGeoNode *node = 0;
365  Int_t ind = (Int_t)(1.+(point[0]-fStart)/fStep) - 1;
366  if (dir) {
367  td.fNextIndex = ind;
368  if (dir[0]>0) td.fNextIndex++;
369  else td.fNextIndex--;
370  if ((td.fNextIndex<0) || (td.fNextIndex>=fNdivisions)) td.fNextIndex = -1;
371  }
372  if ((ind<0) || (ind>=fNdivisions)) return node;
373  node = GetNodeOffset(ind);
374  cd(ind);
375  return node;
376 }
377 
378 ////////////////////////////////////////////////////////////////////////////////
379 /// Compute distance to next division layer returning the index of next section.
380 /// Point is in the frame of the divided volume.
381 
383 {
384  ThreadData_t& td = GetThreadData();
385  indnext = -1;
387  if (TMath::Abs(dir[0])<TGeoShape::Tolerance()) return dist;
388  if (td.fCurrent<0) {
389  Error("FindNextBoundary", "Must call FindNode first");
390  return dist;
391  }
392  Int_t inc = (dir[0]>0)?1:0;
393  dist = (fStep*(td.fCurrent+inc)-point[0])/dir[0];
394  if (dist<0.) Error("FindNextBoundary", "Negative distance d=%g",dist);
395  if (!inc) inc = -1;
396  indnext = td.fCurrent+inc;
397  return dist;
398 }
399 
400 ////////////////////////////////////////////////////////////////////////////////
401 /// Make a copy of this finder. Reflect by Z if required.
402 
404 {
405  TGeoPatternX *finder = new TGeoPatternX(*this);
406  if (!reflect) return finder;
407  finder->Reflect();
408  return finder;
409 }
410 
411 ////////////////////////////////////////////////////////////////////////////////
412 /// Save a primitive as a C++ statement(s) on output stream "out".
413 
414 void TGeoPatternX::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
415 {
416  Int_t iaxis = 1;
417  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
418 }
419 
420 //______________________________________________________________________________
421 // TGeoPatternY - a Y axis divison pattern
422 //______________________________________________________________________________
423 
424 
425 ////////////////////////////////////////////////////////////////////////////////
426 /// Default constructor
427 
429 {
430  CreateThreadData(1);
431 }
432 
433 ////////////////////////////////////////////////////////////////////////////////
434 /// constructor
435 
437  :TGeoPatternFinder(vol, ndivisions)
438 {
439  Double_t dy = ((TGeoBBox*)vol->GetShape())->GetDY();
440  fStart = -dy;
441  fEnd = dy;
442  fStep = 2*dy/ndivisions;
443  CreateThreadData(1);
444 }
445 
446 ////////////////////////////////////////////////////////////////////////////////
447 /// constructor
448 
450  :TGeoPatternFinder(vol, ndivisions)
451 {
452  Double_t dy = ((TGeoBBox*)vol->GetShape())->GetDY();
453  fStart = -dy;
454  fEnd = fStart + ndivisions*step;
455  fStep = step;
456  CreateThreadData(1);
457 }
458 
459 ////////////////////////////////////////////////////////////////////////////////
460 /// constructor
461 
463  :TGeoPatternFinder(vol, ndivisions)
464 {
465  fStart = start;
466  fEnd = end;
467  fStep = (end - start)/ndivisions;
468  CreateThreadData(1);
469 }
470 
471 ////////////////////////////////////////////////////////////////////////////////
472 ///copy constructor
473 
476 {
477  CreateThreadData(1);
478 }
479 
480 ////////////////////////////////////////////////////////////////////////////////
481 ///assignment operator
482 
484 {
485  if(this!=&pf) {
487  CreateThreadData(1);
488  }
489  return *this;
490 }
491 
492 ////////////////////////////////////////////////////////////////////////////////
493 /// Destructor
494 
496 {
497 }
498 
499 ////////////////////////////////////////////////////////////////////////////////
500 /// Update current division index and global matrix to point to a given slice.
501 
503 {
504  ThreadData_t& td = GetThreadData();
505  td.fCurrent=idiv;
506  td.fMatrix->SetDy(fStart+idiv*fStep+0.5*fStep);
507 }
508 
509 ////////////////////////////////////////////////////////////////////////////////
510 /// Return new matrix of type used by this finder.
511 
513 {
514  if (!IsReflected()) {
515  TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
516  matrix->RegisterYourself();
517  return matrix;
518  }
519  TGeoCombiTrans *combi = new TGeoCombiTrans();
520  combi->RegisterYourself();
521  combi->ReflectZ(kTRUE);
522  combi->ReflectZ(kFALSE);
523  return combi;
524 }
525 
526 ////////////////////////////////////////////////////////////////////////////////
527 /// Fills external matrix with the local one corresponding to the given division
528 /// index.
529 
531 {
532  matrix.Clear();
533  matrix.SetDy(fStart+idiv*fStep+0.5*fStep);
534 }
535 
536 ////////////////////////////////////////////////////////////////////////////////
537 /// Checks if the current point is on division boundary
538 
540 {
541  Double_t seg = (point[1]-fStart)/fStep;
542  Double_t diff = seg - Int_t(seg);
543  if (diff>0.5) diff = 1.-diff;
544  if (diff<1e-8) return kTRUE;
545  return kFALSE;
546 }
547 
548 ////////////////////////////////////////////////////////////////////////////////
549 /// Find the cell corresponding to point and next cell along dir (if asked)
550 
552 {
553  ThreadData_t& td = GetThreadData();
554  TGeoNode *node = 0;
555  Int_t ind = (Int_t)(1.+(point[1]-fStart)/fStep) - 1;
556  if (dir) {
557  td.fNextIndex = ind;
558  if (dir[1]>0) td.fNextIndex++;
559  else td.fNextIndex--;
560  if ((td.fNextIndex<0) || (td.fNextIndex>=fNdivisions)) td.fNextIndex = -1;
561  }
562  if ((ind<0) || (ind>=fNdivisions)) return node;
563  node = GetNodeOffset(ind);
564  cd(ind);
565  return node;
566 }
567 
568 ////////////////////////////////////////////////////////////////////////////////
569 /// Compute distance to next division layer returning the index of next section.
570 /// Point is in the frame of the divided volume.
571 
573 {
574  ThreadData_t& td = GetThreadData();
575  indnext = -1;
577  if (TMath::Abs(dir[1])<TGeoShape::Tolerance()) return dist;
578  if (td.fCurrent<0) {
579  Error("FindNextBoundary", "Must call FindNode first");
580  return dist;
581  }
582  Int_t inc = (dir[1]>0)?1:0;
583  dist = (fStep*(td.fCurrent+inc)-point[1])/dir[1];
584  if (dist<0.) Error("FindNextBoundary", "Negative distance d=%g",dist);
585  if (!inc) inc = -1;
586  indnext = td.fCurrent+inc;
587  return dist;
588 }
589 
590 ////////////////////////////////////////////////////////////////////////////////
591 /// Make a copy of this finder. Reflect by Z if required.
592 
594 {
595  TGeoPatternY *finder = new TGeoPatternY(*this);
596  if (!reflect) return finder;
597  finder->Reflect();
598  return finder;
599 }
600 
601 ////////////////////////////////////////////////////////////////////////////////
602 /// Save a primitive as a C++ statement(s) on output stream "out".
603 
604 void TGeoPatternY::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
605 {
606  Int_t iaxis = 2;
607  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
608 }
609 
610 //______________________________________________________________________________
611 // TGeoPatternZ - a Z axis divison pattern
612 //______________________________________________________________________________
613 
614 
615 ////////////////////////////////////////////////////////////////////////////////
616 /// Default constructor
617 
619 {
620  CreateThreadData(1);
621 }
622 ////////////////////////////////////////////////////////////////////////////////
623 /// constructor
624 
626  :TGeoPatternFinder(vol, ndivisions)
627 {
628  Double_t dz = ((TGeoBBox*)vol->GetShape())->GetDZ();
629  fStart = -dz;
630  fEnd = dz;
631  fStep = 2*dz/ndivisions;
632  CreateThreadData(1);
633 }
634 ////////////////////////////////////////////////////////////////////////////////
635 /// constructor
636 
638  :TGeoPatternFinder(vol, ndivisions)
639 {
640  Double_t dz = ((TGeoBBox*)vol->GetShape())->GetDZ();
641  fStart = -dz;
642  fEnd = fStart + ndivisions*step;
643  fStep = step;
644  CreateThreadData(1);
645 }
646 ////////////////////////////////////////////////////////////////////////////////
647 /// constructor
648 
650  :TGeoPatternFinder(vol, ndivisions)
651 {
652  fStart = start;
653  fEnd = end;
654  fStep = (end - start)/ndivisions;
655  CreateThreadData(1);
656 }
657 
658 ////////////////////////////////////////////////////////////////////////////////
659 ///copy constructor
660 
663 {
664  CreateThreadData(1);
665 }
666 
667 ////////////////////////////////////////////////////////////////////////////////
668 ///assignment operator
669 
671 {
672  if(this!=&pf) {
674  CreateThreadData(1);
675  }
676  return *this;
677 }
678 
679 ////////////////////////////////////////////////////////////////////////////////
680 /// Destructor
681 
683 {
684 }
685 ////////////////////////////////////////////////////////////////////////////////
686 /// Update current division index and global matrix to point to a given slice.
687 
689 {
690  ThreadData_t& td = GetThreadData();
691  td.fCurrent=idiv;
692  td.fMatrix->SetDz(((IsReflected())?-1.:1.)*(fStart+idiv*fStep+0.5*fStep));
693 }
694 
695 ////////////////////////////////////////////////////////////////////////////////
696 /// Return new matrix of type used by this finder.
697 
699 {
700  if (!IsReflected()) {
701  TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
702  matrix->RegisterYourself();
703  return matrix;
704  }
705  TGeoCombiTrans *combi = new TGeoCombiTrans();
706  combi->RegisterYourself();
707  combi->ReflectZ(kTRUE);
708  combi->ReflectZ(kFALSE);
709  return combi;
710 }
711 
712 ////////////////////////////////////////////////////////////////////////////////
713 /// Fills external matrix with the local one corresponding to the given division
714 /// index.
715 
717 {
718  matrix.Clear();
719  matrix.SetDz(((IsReflected())?-1.:1.)*(fStart+idiv*fStep+0.5*fStep));
720 }
721 
722 ////////////////////////////////////////////////////////////////////////////////
723 /// Checks if the current point is on division boundary
724 
726 {
727  Double_t seg = (point[2]-fStart)/fStep;
728  Double_t diff = seg - Int_t(seg);
729  if (diff>0.5) diff = 1.-diff;
730  if (diff<1e-8) return kTRUE;
731  return kFALSE;
732 }
733 
734 ////////////////////////////////////////////////////////////////////////////////
735 /// Find the cell corresponding to point and next cell along dir (if asked)
736 
738 {
739  ThreadData_t& td = GetThreadData();
740  TGeoNode *node = 0;
741  Int_t ind = (Int_t)(1.+(point[2]-fStart)/fStep) - 1;
742  if (dir) {
743  td.fNextIndex = ind;
744  if (dir[2]>0) td.fNextIndex++;
745  else td.fNextIndex--;
746  if ((td.fNextIndex<0) || (td.fNextIndex>=fNdivisions)) td.fNextIndex = -1;
747  }
748  if ((ind<0) || (ind>=fNdivisions)) return node;
749  node = GetNodeOffset(ind);
750  cd(ind);
751  return node;
752 }
753 
754 ////////////////////////////////////////////////////////////////////////////////
755 /// Compute distance to next division layer returning the index of next section.
756 /// Point is in the frame of the divided volume.
757 
759 {
760  indnext = -1;
761  ThreadData_t& td = GetThreadData();
763  if (TMath::Abs(dir[2])<TGeoShape::Tolerance()) return dist;
764  if (td.fCurrent<0) {
765  Error("FindNextBoundary", "Must call FindNode first");
766  return dist;
767  }
768  Int_t inc = (dir[2]>0)?1:0;
769  dist = (fStep*(td.fCurrent+inc)-point[2])/dir[2];
770  if (dist<0.) Error("FindNextBoundary", "Negative distance d=%g",dist);
771  if (!inc) inc = -1;
772  indnext = td.fCurrent+inc;
773  return dist;
774 }
775 
776 ////////////////////////////////////////////////////////////////////////////////
777 /// Make a copy of this finder. Reflect by Z if required.
778 
780 {
781  TGeoPatternZ *finder = new TGeoPatternZ(*this);
782  if (!reflect) return finder;
783  finder->Reflect();
784  return finder;
785 }
786 
787 ////////////////////////////////////////////////////////////////////////////////
788 /// Save a primitive as a C++ statement(s) on output stream "out".
789 
790 void TGeoPatternZ::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
791 {
792  Int_t iaxis = 3;
793  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
794 }
795 
796 //______________________________________________________________________________
797 // TGeoPatternParaX - a X axis divison pattern for PARA shape
798 //______________________________________________________________________________
799 
800 ////////////////////////////////////////////////////////////////////////////////
801 /// Default constructor
802 
804 {
805  CreateThreadData(1);
806 }
807 ////////////////////////////////////////////////////////////////////////////////
808 /// constructor
809 
811  :TGeoPatternFinder(vol, ndivisions)
812 {
813  Double_t dx = ((TGeoPara*)vol->GetShape())->GetX();
814  fStart = -dx;
815  fEnd = dx;
816  fStep = 2*dx/ndivisions;
817  CreateThreadData(1);
818 }
819 ////////////////////////////////////////////////////////////////////////////////
820 /// constructor
821 
823  :TGeoPatternFinder(vol, ndivisions)
824 {
825  Double_t dx = ((TGeoPara*)vol->GetShape())->GetX();
826  fStart = -dx;
827  fEnd = fStart + ndivisions*step;
828  fStep = step;
829  CreateThreadData(1);
830 }
831 ////////////////////////////////////////////////////////////////////////////////
832 /// constructor
833 
835  :TGeoPatternFinder(vol, ndivisions)
836 {
837  fStart = start;
838  fEnd = end;
839  fStep = (end - start)/ndivisions;
840  CreateThreadData(1);
841 }
842 
843 ////////////////////////////////////////////////////////////////////////////////
844 ///copy constructor
845 
848 {
849  CreateThreadData(1);
850 }
851 
852 ////////////////////////////////////////////////////////////////////////////////
853 ///assignment operator
854 
856 {
857  if(this!=&pf) {
859  CreateThreadData(1);
860  }
861  return *this;
862 }
863 
864 ////////////////////////////////////////////////////////////////////////////////
865 /// Destructor
866 
868 {
869 }
870 ////////////////////////////////////////////////////////////////////////////////
871 /// Update current division index and global matrix to point to a given slice.
872 
874 {
875  ThreadData_t& td = GetThreadData();
876  td.fCurrent=idiv;
877  td.fMatrix->SetDx(fStart+idiv*fStep+0.5*fStep);
878 }
879 
880 ////////////////////////////////////////////////////////////////////////////////
881 /// Checks if the current point is on division boundary
882 
884 {
885  Double_t txy = ((TGeoPara*)fVolume->GetShape())->GetTxy();
886  Double_t txz = ((TGeoPara*)fVolume->GetShape())->GetTxz();
887  Double_t tyz = ((TGeoPara*)fVolume->GetShape())->GetTyz();
888  Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
889  Double_t seg = (xt-fStart)/fStep;
890  Double_t diff = seg - Int_t(seg);
891  if (diff>0.5) diff = 1.-diff;
892  if (diff<1e-8) return kTRUE;
893  return kFALSE;
894 }
895 
896 ////////////////////////////////////////////////////////////////////////////////
897 /// get the node division containing the query point
898 
900 {
901  ThreadData_t& td = GetThreadData();
902  TGeoNode *node = 0;
903  Double_t txy = ((TGeoPara*)fVolume->GetShape())->GetTxy();
904  Double_t txz = ((TGeoPara*)fVolume->GetShape())->GetTxz();
905  Double_t tyz = ((TGeoPara*)fVolume->GetShape())->GetTyz();
906  Double_t xt = point[0]-txz*point[2]-txy*(point[1]-tyz*point[2]);
907  Int_t ind = (Int_t)(1.+(xt-fStart)/fStep)-1;
908  if (dir) {
909  Double_t ttsq = txy*txy + (txz-txy*tyz)*(txz-txy*tyz);
910  Double_t divdirx = 1./TMath::Sqrt(1.+ttsq);
911  Double_t divdiry = -txy*divdirx;
912  Double_t divdirz = -(txz-txy*tyz)*divdirx;
913  Double_t dot = dir[0]*divdirx + dir[1]*divdiry + dir[2]*divdirz;
914  td.fNextIndex = ind;
915  if (dot>0) td.fNextIndex++;
916  else td.fNextIndex--;
917  if ((td.fNextIndex<0) || (td.fNextIndex>=fNdivisions)) td.fNextIndex = -1;
918  }
919  if ((ind<0) || (ind>=fNdivisions)) return node;
920  node = GetNodeOffset(ind);
921  cd(ind);
922  return node;
923 }
924 
925 ////////////////////////////////////////////////////////////////////////////////
926 /// Make a copy of this finder. Reflect by Z if required.
927 
929 {
930  TGeoPatternParaX *finder = new TGeoPatternParaX(*this);
931  if (!reflect) return finder;
932  finder->Reflect();
933  return finder;
934 }
935 
936 ////////////////////////////////////////////////////////////////////////////////
937 /// Save a primitive as a C++ statement(s) on output stream "out".
938 
939 void TGeoPatternParaX::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
940 {
941  Int_t iaxis = 1;
942  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
943 }
944 
945 ////////////////////////////////////////////////////////////////////////////////
946 /// Return new matrix of type used by this finder.
947 
949 {
950  if (!IsReflected()) {
951  TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
952  matrix->RegisterYourself();
953  return matrix;
954  }
955  TGeoCombiTrans *combi = new TGeoCombiTrans();
956  combi->RegisterYourself();
957  combi->ReflectZ(kTRUE);
958  combi->ReflectZ(kFALSE);
959  return combi;
960 }
961 
962 ////////////////////////////////////////////////////////////////////////////////
963 /// Fills external matrix with the local one corresponding to the given division
964 /// index.
965 
967 {
968  matrix.Clear();
969  matrix.SetDx(fStart+idiv*fStep+0.5*fStep);
970 }
971 
972 //______________________________________________________________________________
973 // TGeoPatternParaY - a Y axis divison pattern for PARA shape
974 //______________________________________________________________________________
975 
976 ////////////////////////////////////////////////////////////////////////////////
977 /// Default constructor
978 
980 {
981  fTxy = 0;
982  CreateThreadData(1);
983 }
984 ////////////////////////////////////////////////////////////////////////////////
985 /// constructor
986 
988  :TGeoPatternFinder(vol, ndivisions)
989 {
990  fTxy = ((TGeoPara*)vol->GetShape())->GetTxy();
991  Double_t dy = ((TGeoPara*)vol->GetShape())->GetY();
992  fStart = -dy;
993  fEnd = dy;
994  fStep = 2*dy/ndivisions;
995  CreateThreadData(1);
996 }
997 ////////////////////////////////////////////////////////////////////////////////
998 /// constructor
999 
1001  :TGeoPatternFinder(vol, ndivisions)
1002 {
1003  fTxy = ((TGeoPara*)vol->GetShape())->GetTxy();
1004  Double_t dy = ((TGeoPara*)vol->GetShape())->GetY();
1005  fStart = -dy;
1006  fEnd = fStart + ndivisions*step;
1007  fStep = step;
1008  CreateThreadData(1);
1009 }
1010 ////////////////////////////////////////////////////////////////////////////////
1011 /// constructor
1012 
1014  :TGeoPatternFinder(vol, ndivisions)
1015 {
1016  fTxy = ((TGeoPara*)vol->GetShape())->GetTxy();
1017  fStart = start;
1018  fEnd = end;
1019  fStep = (end - start)/ndivisions;
1020  CreateThreadData(1);
1021 }
1022 ////////////////////////////////////////////////////////////////////////////////
1023 ///copy constructor
1024 
1026  TGeoPatternFinder(pf)
1027 {
1028  CreateThreadData(1);
1029 }
1030 
1031 ////////////////////////////////////////////////////////////////////////////////
1032 ///assignment operator
1033 
1035 {
1036  if(this!=&pf) {
1038  CreateThreadData(1);
1039  }
1040  return *this;
1041 }
1042 
1043 ////////////////////////////////////////////////////////////////////////////////
1044 /// Destructor
1045 
1047 {
1048 }
1049 ////////////////////////////////////////////////////////////////////////////////
1050 /// Update current division index and global matrix to point to a given slice.
1051 
1053 {
1054  ThreadData_t& td = GetThreadData();
1055  td.fCurrent = idiv;
1056  Double_t dy = fStart+idiv*fStep+0.5*fStep;
1057  td.fMatrix->SetDx(fTxy*dy);
1058  td.fMatrix->SetDy(dy);
1059 }
1060 
1061 ////////////////////////////////////////////////////////////////////////////////
1062 /// Checks if the current point is on division boundary
1063 
1065 {
1066  Double_t tyz = ((TGeoPara*)fVolume->GetShape())->GetTyz();
1067  Double_t yt = point[1]-tyz*point[2];
1068  Double_t seg = (yt-fStart)/fStep;
1069  Double_t diff = seg - Int_t(seg);
1070  if (diff>0.5) diff = 1.-diff;
1071  if (diff<1e-8) return kTRUE;
1072  return kFALSE;
1073 }
1074 
1075 ////////////////////////////////////////////////////////////////////////////////
1076 /// get the node division containing the query point
1077 
1079 {
1080  ThreadData_t& td = GetThreadData();
1081  TGeoNode *node = 0;
1082  Double_t tyz = ((TGeoPara*)fVolume->GetShape())->GetTyz();
1083  Double_t yt = point[1]-tyz*point[2];
1084  Int_t ind = (Int_t)(1.+(yt-fStart)/fStep) - 1;
1085  if (dir) {
1086  Double_t divdiry = 1./TMath::Sqrt(1.+tyz*tyz);
1087  Double_t divdirz = -tyz*divdiry;
1088  Double_t dot = dir[1]*divdiry + dir[2]*divdirz;
1089  td.fNextIndex = ind;
1090  if (dot>0) td.fNextIndex++;
1091  else td.fNextIndex--;
1092  if ((td.fNextIndex<0) || (td.fNextIndex>=fNdivisions)) td.fNextIndex = -1;
1093  }
1094  if ((ind<0) || (ind>=fNdivisions)) return node;
1095  node = GetNodeOffset(ind);
1096  cd(ind);
1097  return node;
1098 }
1099 
1100 ////////////////////////////////////////////////////////////////////////////////
1101 /// Make a copy of this finder. Reflect by Z if required.
1102 
1104 {
1105  TGeoPatternParaY *finder = new TGeoPatternParaY(*this);
1106  if (!reflect) return finder;
1107  finder->Reflect();
1108  return finder;
1109 }
1110 
1111 ////////////////////////////////////////////////////////////////////////////////
1112 /// Save a primitive as a C++ statement(s) on output stream "out".
1113 
1114 void TGeoPatternParaY::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
1115 {
1116  Int_t iaxis = 2;
1117  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
1118 }
1119 
1120 ////////////////////////////////////////////////////////////////////////////////
1121 /// Return new matrix of type used by this finder.
1122 
1124 {
1125  if (!IsReflected()) {
1126  TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
1127  matrix->RegisterYourself();
1128  return matrix;
1129  }
1130  TGeoCombiTrans *combi = new TGeoCombiTrans();
1131  combi->RegisterYourself();
1132  combi->ReflectZ(kTRUE);
1133  combi->ReflectZ(kFALSE);
1134  return combi;
1135 }
1136 
1137 ////////////////////////////////////////////////////////////////////////////////
1138 /// Fills external matrix with the local one corresponding to the given division
1139 /// index.
1140 
1142 {
1143  matrix.Clear();
1144  Double_t dy = fStart+idiv*fStep+0.5*fStep;
1145  matrix.SetDx(fTxy*dy);
1146  matrix.SetDy(dy);
1147 }
1148 
1149 //______________________________________________________________________________
1150 // TGeoPatternParaZ - a Z axis divison pattern for PARA shape
1151 //______________________________________________________________________________
1152 
1153 ////////////////////////////////////////////////////////////////////////////////
1154 /// Default constructor
1155 
1157 {
1158  fTxz = 0;
1159  fTyz = 0;
1160  CreateThreadData(1);
1161 }
1162 ////////////////////////////////////////////////////////////////////////////////
1163 /// constructor
1164 
1166  :TGeoPatternFinder(vol, ndivisions)
1167 {
1168  fTxz = ((TGeoPara*)vol->GetShape())->GetTxz();
1169  fTyz = ((TGeoPara*)vol->GetShape())->GetTyz();
1170  Double_t dz = ((TGeoPara*)vol->GetShape())->GetZ();
1171  fStart = -dz;
1172  fEnd = dz;
1173  fStep = 2*dz/ndivisions;
1174  CreateThreadData(1);
1175 }
1176 ////////////////////////////////////////////////////////////////////////////////
1177 /// constructor
1178 
1180  :TGeoPatternFinder(vol, ndivisions)
1181 {
1182  fTxz = ((TGeoPara*)vol->GetShape())->GetTxz();
1183  fTyz = ((TGeoPara*)vol->GetShape())->GetTyz();
1184  Double_t dz = ((TGeoPara*)vol->GetShape())->GetZ();
1185  fStart = -dz;
1186  fEnd = fStart + ndivisions*step;
1187  fStep = step;
1188  CreateThreadData(1);
1189 }
1190 
1191 ////////////////////////////////////////////////////////////////////////////////
1192 /// constructor
1193 
1195  :TGeoPatternFinder(vol, ndivisions)
1196 {
1197  fTxz = ((TGeoPara*)vol->GetShape())->GetTxz();
1198  fTyz = ((TGeoPara*)vol->GetShape())->GetTyz();
1199  fStart = start;
1200  fEnd = end;
1201  fStep = (end - start)/ndivisions;
1202  CreateThreadData(1);
1203 }
1204 
1205 ////////////////////////////////////////////////////////////////////////////////
1206 ///copy constructor
1207 
1209  TGeoPatternFinder(pf)
1210 {
1211  CreateThreadData(1);
1212 }
1213 
1214 ////////////////////////////////////////////////////////////////////////////////
1215 ///assignment operator
1216 
1218 {
1219  if(this!=&pf) {
1221  CreateThreadData(1);
1222  }
1223  return *this;
1224 }
1225 
1226 ////////////////////////////////////////////////////////////////////////////////
1227 /// Destructor
1228 
1230 {
1231 }
1232 
1233 ////////////////////////////////////////////////////////////////////////////////
1234 /// Update current division index and global matrix to point to a given slice.
1235 
1237 {
1238  ThreadData_t& td = GetThreadData();
1239  td.fCurrent = idiv;
1240  Double_t dz = fStart+idiv*fStep+0.5*fStep;
1241  td.fMatrix->SetDx(fTxz*dz);
1242  td.fMatrix->SetDy(fTyz*dz);
1243  td.fMatrix->SetDz((IsReflected())?-dz:dz);
1244 }
1245 
1246 ////////////////////////////////////////////////////////////////////////////////
1247 /// Checks if the current point is on division boundary
1248 
1250 {
1251  Double_t seg = (point[2]-fStart)/fStep;
1252  Double_t diff = seg - Int_t(seg);
1253  if (diff>0.5) diff = 1.-diff;
1254  if (diff<1e-8) return kTRUE;
1255  return kFALSE;
1256 }
1257 
1258 ////////////////////////////////////////////////////////////////////////////////
1259 /// get the node division containing the query point
1260 
1262 {
1263  ThreadData_t& td = GetThreadData();
1264  TGeoNode *node = 0;
1265  Double_t zt = point[2];
1266  Int_t ind = (Int_t)(1.+(zt-fStart)/fStep) - 1;
1267  if (dir) {
1268  td.fNextIndex = ind;
1269  if (dir[2]>0) td.fNextIndex++;
1270  else td.fNextIndex--;
1271  if ((td.fNextIndex<0) || (td.fNextIndex>=fNdivisions)) td.fNextIndex = -1;
1272  }
1273  if ((ind<0) || (ind>=fNdivisions)) return node;
1274  node = GetNodeOffset(ind);
1275  cd(ind);
1276  return node;
1277 }
1278 
1279 ////////////////////////////////////////////////////////////////////////////////
1280 /// Make a copy of this finder. Reflect by Z if required.
1281 
1283 {
1284  TGeoPatternParaZ *finder = new TGeoPatternParaZ(*this);
1285  if (!reflect) return finder;
1286  finder->Reflect();
1287  return finder;
1288 }
1289 
1290 ////////////////////////////////////////////////////////////////////////////////
1291 /// Save a primitive as a C++ statement(s) on output stream "out".
1292 
1293 void TGeoPatternParaZ::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
1294 {
1295  Int_t iaxis = 3;
1296  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
1297 }
1298 
1299 ////////////////////////////////////////////////////////////////////////////////
1300 /// Return new matrix of type used by this finder.
1301 
1303 {
1304  if (!IsReflected()) {
1305  TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
1306  matrix->RegisterYourself();
1307  return matrix;
1308  }
1309  TGeoCombiTrans *combi = new TGeoCombiTrans();
1310  combi->RegisterYourself();
1311  combi->ReflectZ(kTRUE);
1312  combi->ReflectZ(kFALSE);
1313  return combi;
1314 }
1315 
1316 ////////////////////////////////////////////////////////////////////////////////
1317 /// Fills external matrix with the local one corresponding to the given division
1318 /// index.
1319 
1321 {
1322  matrix.Clear();
1323  Double_t dz = fStart+idiv*fStep+0.5*fStep;
1324  matrix.SetDx(fTxz*dz);
1325  matrix.SetDy(fTyz*dz);
1326  matrix.SetDz((IsReflected())?-dz:dz);
1327 }
1328 
1329 //______________________________________________________________________________
1330 // TGeoPatternTrapZ - a Z axis divison pattern for TRAP or GTRA shapes
1331 //______________________________________________________________________________
1332 
1333 ////////////////////////////////////////////////////////////////////////////////
1334 /// Default constructor
1335 
1337 {
1338  fTxz = 0;
1339  fTyz = 0;
1340  CreateThreadData(1);
1341 }
1342 ////////////////////////////////////////////////////////////////////////////////
1343 /// constructor
1344 
1346  :TGeoPatternFinder(vol, ndivisions)
1347 {
1348  Double_t theta = ((TGeoTrap*)vol->GetShape())->GetTheta();
1349  Double_t phi = ((TGeoTrap*)vol->GetShape())->GetPhi();
1352  Double_t dz = ((TGeoArb8*)vol->GetShape())->GetDz();
1353  fStart = -dz;
1354  fEnd = dz;
1355  fStep = 2*dz/ndivisions;
1356  CreateThreadData(1);
1357 }
1358 ////////////////////////////////////////////////////////////////////////////////
1359 /// constructor
1360 
1362  :TGeoPatternFinder(vol, ndivisions)
1363 {
1364  Double_t theta = ((TGeoTrap*)vol->GetShape())->GetTheta();
1365  Double_t phi = ((TGeoTrap*)vol->GetShape())->GetPhi();
1368  Double_t dz = ((TGeoArb8*)vol->GetShape())->GetDz();
1369  fStart = -dz;
1370  fEnd = fStart + ndivisions*step;
1371  fStep = step;
1372  CreateThreadData(1);
1373 }
1374 ////////////////////////////////////////////////////////////////////////////////
1375 /// constructor
1376 
1378  :TGeoPatternFinder(vol, ndivisions)
1379 {
1380  Double_t theta = ((TGeoTrap*)vol->GetShape())->GetTheta();
1381  Double_t phi = ((TGeoTrap*)vol->GetShape())->GetPhi();
1384  fStart = start;
1385  fEnd = end;
1386  fStep = (end - start)/ndivisions;
1387  CreateThreadData(1);
1388 }
1389 
1390 ////////////////////////////////////////////////////////////////////////////////
1391 ///copy constructor
1392 
1394  TGeoPatternFinder(pf),
1395  fTxz(pf.fTxz),
1396  fTyz(pf.fTyz)
1397 {
1398  CreateThreadData(1);
1399 }
1400 
1401 ////////////////////////////////////////////////////////////////////////////////
1402 ///assignment operator
1403 
1405 {
1406  if(this!=&pf) {
1408  fTxz = pf.fTxz;
1409  fTyz = pf.fTyz;
1410  CreateThreadData(1);
1411  }
1412  return *this;
1413 }
1414 
1415 ////////////////////////////////////////////////////////////////////////////////
1416 /// Destructor
1417 
1419 {
1420 }
1421 ////////////////////////////////////////////////////////////////////////////////
1422 /// Update current division index and global matrix to point to a given slice.
1423 
1425 {
1426  ThreadData_t& td = GetThreadData();
1427  td.fCurrent = idiv;
1428  Double_t dz = fStart+idiv*fStep+0.5*fStep;
1429  td.fMatrix->SetDx(fTxz*dz);
1430  td.fMatrix->SetDy(fTyz*dz);
1431  td.fMatrix->SetDz((IsReflected())?-dz:dz);
1432 }
1433 
1434 ////////////////////////////////////////////////////////////////////////////////
1435 /// Checks if the current point is on division boundary
1436 
1438 {
1439  Double_t seg = (point[2]-fStart)/fStep;
1440  Double_t diff = seg - Int_t(seg);
1441  if (diff>0.5) diff = 1.-diff;
1442  if (diff<1e-8) return kTRUE;
1443  return kFALSE;
1444 }
1445 
1446 ////////////////////////////////////////////////////////////////////////////////
1447 /// get the node division containing the query point
1448 
1450 {
1451  ThreadData_t& td = GetThreadData();
1452  TGeoNode *node = 0;
1453  Double_t zt = point[2];
1454  Int_t ind = (Int_t)(1. + (zt-fStart)/fStep) - 1;
1455  if (dir) {
1456  td.fNextIndex = ind;
1457  if (dir[2]>0) td.fNextIndex++;
1458  else td.fNextIndex--;
1459  if ((td.fNextIndex<0) || (td.fNextIndex>=fNdivisions)) td.fNextIndex = -1;
1460  }
1461  if ((ind<0) || (ind>=fNdivisions)) return node;
1462  node = GetNodeOffset(ind);
1463  cd(ind);
1464  return node;
1465 }
1466 
1467 ////////////////////////////////////////////////////////////////////////////////
1468 /// Make a copy of this finder. Reflect by Z if required.
1469 
1471 {
1472  TGeoPatternTrapZ *finder = new TGeoPatternTrapZ(*this);
1473  if (!reflect) return finder;
1474  finder->Reflect();
1475  return finder;
1476 }
1477 
1478 ////////////////////////////////////////////////////////////////////////////////
1479 /// Save a primitive as a C++ statement(s) on output stream "out".
1480 
1481 void TGeoPatternTrapZ::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
1482 {
1483  Int_t iaxis = 3;
1484  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
1485 }
1486 
1487 ////////////////////////////////////////////////////////////////////////////////
1488 /// Return new matrix of type used by this finder.
1489 
1491 {
1492  if (!IsReflected()) {
1493  TGeoMatrix *matrix = new TGeoTranslation(0.,0.,0.);
1494  matrix->RegisterYourself();
1495  return matrix;
1496  }
1497  TGeoCombiTrans *combi = new TGeoCombiTrans();
1498  combi->RegisterYourself();
1499  combi->ReflectZ(kTRUE);
1500  combi->ReflectZ(kFALSE);
1501  return combi;
1502 }
1503 
1504 ////////////////////////////////////////////////////////////////////////////////
1505 /// Fills external matrix with the local one corresponding to the given division
1506 /// index.
1507 
1509 {
1510  matrix.Clear();
1511  Double_t dz = fStart+idiv*fStep+0.5*fStep;
1512  matrix.SetDx(fTxz*dz);
1513  matrix.SetDy(fTyz*dz);
1514  matrix.SetDz((IsReflected())?-dz:dz);
1515 }
1516 
1517 //______________________________________________________________________________
1518 // TGeoPatternCylR - a cylindrical R divison pattern
1519 //______________________________________________________________________________
1520 
1521 ////////////////////////////////////////////////////////////////////////////////
1522 /// Default constructor
1523 
1525 {
1526  CreateThreadData(1);
1527 }
1528 ////////////////////////////////////////////////////////////////////////////////
1529 /// constructor
1530 
1532  :TGeoPatternFinder(vol, ndivisions)
1533 {
1534  CreateThreadData(1);
1535 }
1536 ////////////////////////////////////////////////////////////////////////////////
1537 /// constructor
1538 
1540  :TGeoPatternFinder(vol, ndivisions)
1541 {
1542  fStep = step;
1543  CreateThreadData(1);
1544 // compute start, end
1545 }
1546 ////////////////////////////////////////////////////////////////////////////////
1547 /// constructor
1548 
1550  :TGeoPatternFinder(vol, ndivisions)
1551 {
1552  fStart = start;
1553  fEnd = end;
1554  fStep = (end - start)/ndivisions;
1555  CreateThreadData(1);
1556 }
1557 ////////////////////////////////////////////////////////////////////////////////
1558 ///copy constructor
1559 
1561  TGeoPatternFinder(pf)
1562 {
1563  CreateThreadData(1);
1564 }
1565 
1566 ////////////////////////////////////////////////////////////////////////////////
1567 ///assignment operator
1568 
1570 {
1571  if(this!=&pf) {
1573  CreateThreadData(1);
1574  }
1575  return *this;
1576 }
1577 
1578 ////////////////////////////////////////////////////////////////////////////////
1579 /// Destructor
1580 
1582 {
1583 }
1584 
1585 ////////////////////////////////////////////////////////////////////////////////
1586 /// Checks if the current point is on division boundary
1587 
1589 {
1590  Double_t r = TMath::Sqrt(point[0]*point[0]+point[1]*point[1]);
1591  Double_t seg = (r-fStart)/fStep;
1592  Double_t diff = seg - Int_t(seg);
1593  if (diff>0.5) diff = 1.-diff;
1594  if (diff<1e-8) return kTRUE;
1595  return kFALSE;
1596 }
1597 
1598 ////////////////////////////////////////////////////////////////////////////////
1599 /// Update current division index and global matrix to point to a given slice.
1600 
1602 {
1603  ThreadData_t& td = GetThreadData();
1604  td.fCurrent=idiv;
1605 }
1606 
1607 ////////////////////////////////////////////////////////////////////////////////
1608 /// find the node containing the query point
1609 
1611 {
1612  ThreadData_t& td = GetThreadData();
1613  if (!td.fMatrix) td.fMatrix = gGeoIdentity;
1614  TGeoNode *node = 0;
1615  Double_t r = TMath::Sqrt(point[0]*point[0]+point[1]*point[1]);
1616  Int_t ind = (Int_t)(1. + (r-fStart)/fStep) - 1;
1617  if (dir) {
1618  td.fNextIndex = ind;
1619  Double_t dot = point[0]*dir[0] + point[1]*dir[1];
1620  if (dot>0) td.fNextIndex++;
1621  else td.fNextIndex--;
1622  if ((td.fNextIndex<0) || (td.fNextIndex>=fNdivisions)) td.fNextIndex = -1;
1623  }
1624  if ((ind<0) || (ind>=fNdivisions)) return node;
1625  node = GetNodeOffset(ind);
1626  cd(ind);
1627  return node;
1628 }
1629 
1630 ////////////////////////////////////////////////////////////////////////////////
1631 /// Make a copy of this finder. Reflect by Z if required.
1632 
1634 {
1635  TGeoPatternCylR *finder = new TGeoPatternCylR(*this);
1636  if (!reflect) return finder;
1637  finder->Reflect();
1638  return finder;
1639 }
1640 
1641 ////////////////////////////////////////////////////////////////////////////////
1642 /// Save a primitive as a C++ statement(s) on output stream "out".
1643 
1644 void TGeoPatternCylR::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
1645 {
1646  Int_t iaxis = 1;
1647  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
1648 }
1649 
1650 ////////////////////////////////////////////////////////////////////////////////
1651 /// Return new matrix of type used by this finder.
1652 
1654 {
1655  return gGeoIdentity;
1656 }
1657 
1658 ////////////////////////////////////////////////////////////////////////////////
1659 /// Fills external matrix with the local one corresponding to the given division
1660 /// index.
1661 
1663 {
1664  matrix.Clear();
1665 }
1666 
1667 //______________________________________________________________________________
1668 // TGeoPatternCylPhi - a cylindrical phi divison pattern
1669 //______________________________________________________________________________
1670 
1671 ////////////////////////////////////////////////////////////////////////////////
1672 /// Default constructor
1673 
1675 {
1676  fSinCos = 0;
1677  CreateThreadData(1);
1678 }
1679 ////////////////////////////////////////////////////////////////////////////////
1680 /// constructor
1681 /// compute step, start, end
1682 
1684  :TGeoPatternFinder(vol, ndivisions)
1685 {
1686  fStart = 0;
1687  fEnd = 0;
1688  fStep = 0;
1689  fSinCos = new Double_t[2*fNdivisions];
1690  for (Int_t i = 0; i<fNdivisions; i++) {
1691  fSinCos[2*i] = TMath::Sin(TMath::DegToRad()*(fStart+0.5*fStep+i*fStep));
1692  fSinCos[2*i+1] = TMath::Cos(TMath::DegToRad()*(fStart+0.5*fStep+i*fStep));
1693  }
1694  CreateThreadData(1);
1695 }
1696 ////////////////////////////////////////////////////////////////////////////////
1697 /// constructor
1698 
1700  :TGeoPatternFinder(vol, ndivisions)
1701 {
1702  fStep = step;
1703  fSinCos = new Double_t[2*ndivisions];
1704  for (Int_t i = 0; i<fNdivisions; i++) {
1705  fSinCos[2*i] = TMath::Sin(TMath::DegToRad()*(fStart+0.5*fStep+i*fStep));
1706  fSinCos[2*i+1] = TMath::Cos(TMath::DegToRad()*(fStart+0.5*fStep+i*fStep));
1707  }
1708  CreateThreadData(1);
1709 // compute start, end
1710 }
1711 ////////////////////////////////////////////////////////////////////////////////
1712 /// constructor
1713 
1715  :TGeoPatternFinder(vol, ndivisions)
1716 {
1717  fStart = start;
1718  if (fStart<0) fStart+=360;
1719  fEnd = end;
1720  if (fEnd<0) fEnd+=360;
1721  if ((end-start)<0)
1722  fStep = (end-start+360)/ndivisions;
1723  else
1724  fStep = (end-start)/ndivisions;
1725  fSinCos = new Double_t[2*ndivisions];
1726  for (Int_t idiv = 0; idiv<ndivisions; idiv++) {
1727  fSinCos[2*idiv] = TMath::Sin(TMath::DegToRad()*(start+0.5*fStep+idiv*fStep));
1728  fSinCos[2*idiv+1] = TMath::Cos(TMath::DegToRad()*(start+0.5*fStep+idiv*fStep));
1729  }
1730  CreateThreadData(1);
1731 }
1732 ////////////////////////////////////////////////////////////////////////////////
1733 /// Destructor
1734 
1736 {
1737  if (fSinCos) delete [] fSinCos;
1738 }
1739 ////////////////////////////////////////////////////////////////////////////////
1740 /// Update current division index and global matrix to point to a given slice.
1741 
1743 {
1744  ThreadData_t& td = GetThreadData();
1745  td.fCurrent = idiv;
1746  ((TGeoRotation*)td.fMatrix)->FastRotZ(&fSinCos[2*idiv]);
1747 }
1748 
1749 ////////////////////////////////////////////////////////////////////////////////
1750 /// Checks if the current point is on division boundary
1751 
1753 {
1754  Double_t phi = TMath::ATan2(point[1], point[0])*TMath::RadToDeg();
1755  if (phi<0) phi += 360;
1756  Double_t ddp = phi - fStart;
1757  if (ddp<0) ddp+=360;
1758  Double_t seg = ddp/fStep;
1759  Double_t diff = seg - Int_t(seg);
1760  if (diff>0.5) diff = 1.-diff;
1761  if (diff<1e-8) return kTRUE;
1762  return kFALSE;
1763 }
1764 
1765 ////////////////////////////////////////////////////////////////////////////////
1766 /// find the node containing the query point
1767 
1769 {
1770  ThreadData_t& td = GetThreadData();
1771  TGeoNode *node = 0;
1772  Double_t phi = TMath::ATan2(point[1], point[0])*TMath::RadToDeg();
1773  if (phi<0) phi += 360;
1774 // Double_t dphi = fStep*fNdivisions;
1775  Double_t ddp = phi - fStart;
1776  if (ddp<0) ddp+=360;
1777 // if (ddp>360) ddp-=360;
1778  Int_t ind = (Int_t)(1. + ddp/fStep) - 1;
1779  if (dir) {
1780  td.fNextIndex = ind;
1781  Double_t dot = point[0]*dir[1]-point[1]*dir[0];
1782  if (dot>0) td.fNextIndex++;
1783  else td.fNextIndex--;
1784  if ((td.fNextIndex<0) || (td.fNextIndex>=fNdivisions)) td.fNextIndex = -1;
1785  }
1786  if ((ind<0) || (ind>=fNdivisions)) return node;
1787  node = GetNodeOffset(ind);
1788  cd(ind);
1789  return node;
1790 }
1791 
1792 ////////////////////////////////////////////////////////////////////////////////
1793 /// Make a copy of this finder. Reflect by Z if required.
1794 
1796 {
1797  TGeoPatternCylPhi *finder = new TGeoPatternCylPhi(*this);
1798  if (!reflect) return finder;
1799  finder->Reflect();
1800  return finder;
1801 }
1802 
1803 ////////////////////////////////////////////////////////////////////////////////
1804 /// Save a primitive as a C++ statement(s) on output stream "out".
1805 
1806 void TGeoPatternCylPhi::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
1807 {
1808  Int_t iaxis = 2;
1809  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
1810 }
1811 
1812 ////////////////////////////////////////////////////////////////////////////////
1813 /// Stream an object of class TGeoVolume.
1814 
1815 void TGeoPatternCylPhi::Streamer(TBuffer &R__b)
1816 {
1817  if (R__b.IsReading()) {
1819  if (fNdivisions) {
1820  fSinCos = new Double_t[2*fNdivisions];
1821  for (Int_t idiv = 0; idiv<fNdivisions; idiv++) {
1822  fSinCos[2*idiv] = TMath::Sin(TMath::DegToRad()*(fStart+0.5*fStep+idiv*fStep));
1823  fSinCos[2*idiv+1] = TMath::Cos(TMath::DegToRad()*(fStart+0.5*fStep+idiv*fStep));
1824  }
1825  }
1826  } else {
1828  }
1829 }
1830 
1831 ////////////////////////////////////////////////////////////////////////////////
1832 /// Return new matrix of type used by this finder.
1833 
1835 {
1836  if (!IsReflected()) {
1837  TGeoRotation *matrix = new TGeoRotation();
1838  matrix->RegisterYourself();
1839  return matrix;
1840  }
1841  TGeoRotation *rot = new TGeoRotation();
1842  rot->RegisterYourself();
1843  rot->ReflectZ(kTRUE);
1844  rot->ReflectZ(kFALSE);
1845  return rot;
1846 }
1847 
1848 ////////////////////////////////////////////////////////////////////////////////
1849 /// Fills external matrix with the local one corresponding to the given division
1850 /// index.
1851 
1853 {
1854  matrix.Clear();
1855  matrix.FastRotZ(&fSinCos[2*idiv]);
1856 }
1857 
1858 //______________________________________________________________________________
1859 // TGeoPatternSphR - a spherical R divison pattern
1860 //______________________________________________________________________________
1861 
1862 ////////////////////////////////////////////////////////////////////////////////
1863 /// Default constructor
1864 
1866 {
1867  CreateThreadData(1);
1868 }
1869 ////////////////////////////////////////////////////////////////////////////////
1870 /// constructor
1871 /// compute step, start, end
1872 
1874  :TGeoPatternFinder(vol, ndivisions)
1875 {
1876  CreateThreadData(1);
1877 }
1878 ////////////////////////////////////////////////////////////////////////////////
1879 /// constructor
1880 
1882  :TGeoPatternFinder(vol, ndivisions)
1883 {
1884  fStep = step;
1885  CreateThreadData(1);
1886 // compute start, end
1887 }
1888 ////////////////////////////////////////////////////////////////////////////////
1889 /// constructor
1890 
1892  :TGeoPatternFinder(vol, ndivisions)
1893 {
1894  fStart = start;
1895  fEnd = end;
1896  fStep = (end - start)/ndivisions;
1897  CreateThreadData(1);
1898 }
1899 ////////////////////////////////////////////////////////////////////////////////
1900 ///copy constructor
1901 
1903  TGeoPatternFinder(pf)
1904 {
1905  CreateThreadData(1);
1906 }
1907 
1908 ////////////////////////////////////////////////////////////////////////////////
1909 ///assignment operator
1910 
1912 {
1913  if(this!=&pf) {
1915  CreateThreadData(1);
1916  }
1917  return *this;
1918 }
1919 
1920 ////////////////////////////////////////////////////////////////////////////////
1921 /// Destructor
1922 
1924 {
1925 }
1926 ////////////////////////////////////////////////////////////////////////////////
1927 /// Update current division index and global matrix to point to a given slice.
1928 
1930 {
1931  ThreadData_t& td = GetThreadData();
1932  td.fCurrent = idiv;
1933 }
1934 ////////////////////////////////////////////////////////////////////////////////
1935 /// find the node containing the query point
1936 
1937 TGeoNode *TGeoPatternSphR::FindNode(Double_t * /*point*/, const Double_t * /*dir*/)
1938 {
1939  return 0;
1940 }
1941 
1942 ////////////////////////////////////////////////////////////////////////////////
1943 /// Make a copy of this finder. Reflect by Z if required.
1944 
1946 {
1947  TGeoPatternSphR *finder = new TGeoPatternSphR(*this);
1948  return finder;
1949 }
1950 
1951 ////////////////////////////////////////////////////////////////////////////////
1952 /// Save a primitive as a C++ statement(s) on output stream "out".
1953 
1954 void TGeoPatternSphR::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
1955 {
1956  Int_t iaxis = 1;
1957  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
1958 }
1959 
1960 ////////////////////////////////////////////////////////////////////////////////
1961 /// Return new matrix of type used by this finder.
1962 
1964 {
1965  return gGeoIdentity;
1966 }
1967 
1968 ////////////////////////////////////////////////////////////////////////////////
1969 /// Fills external matrix with the local one corresponding to the given division
1970 /// index.
1971 
1973 {
1974  matrix.Clear();
1975 }
1976 
1977 //______________________________________________________________________________
1978 // TGeoPatternSphTheta - a spherical theta divison pattern
1979 //______________________________________________________________________________
1980 
1981 ////////////////////////////////////////////////////////////////////////////////
1982 /// Default constructor
1983 
1985 {
1986  CreateThreadData(1);
1987 }
1988 ////////////////////////////////////////////////////////////////////////////////
1989 /// constructor
1990 /// compute step, start, end
1991 
1993  :TGeoPatternFinder(vol, ndivisions)
1994 {
1995  CreateThreadData(1);
1996 }
1997 ////////////////////////////////////////////////////////////////////////////////
1998 /// constructor
1999 
2001  :TGeoPatternFinder(vol, ndivisions)
2002 {
2003  fStep = step;
2004  CreateThreadData(1);
2005 // compute start, end
2006 }
2007 ////////////////////////////////////////////////////////////////////////////////
2008 /// constructor
2009 
2011  :TGeoPatternFinder(vol, ndivisions)
2012 {
2013  fStart = start;
2014  fEnd = end;
2015  fStep = (end - start)/ndivisions;
2016  CreateThreadData(1);
2017 }
2018 ////////////////////////////////////////////////////////////////////////////////
2019 ///copy constructor
2020 
2022  TGeoPatternFinder(pf)
2023 {
2024  CreateThreadData(1);
2025 }
2026 ////////////////////////////////////////////////////////////////////////////////
2027 ///assignment operator
2028 
2030 {
2031  if(this!=&pf) {
2033  CreateThreadData(1);
2034  }
2035  return *this;
2036 }
2037 ////////////////////////////////////////////////////////////////////////////////
2038 /// Destructor
2039 
2041 {
2042 }
2043 ////////////////////////////////////////////////////////////////////////////////
2044 /// Update current division index and global matrix to point to a given slice.
2045 
2047 {
2048  ThreadData_t& td = GetThreadData();
2049  td.fCurrent=idiv;
2050 }
2051 ////////////////////////////////////////////////////////////////////////////////
2052 /// find the node containing the query point
2053 
2055 {
2056  return 0;
2057 }
2058 
2059 ////////////////////////////////////////////////////////////////////////////////
2060 /// Make a copy of this finder. Reflect by Z if required.
2061 
2063 {
2064  TGeoPatternSphTheta *finder = new TGeoPatternSphTheta(*this);
2065  return finder;
2066 }
2067 
2068 ////////////////////////////////////////////////////////////////////////////////
2069 /// Save a primitive as a C++ statement(s) on output stream "out".
2070 
2071 void TGeoPatternSphTheta::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
2072 {
2073  Int_t iaxis = 2;
2074  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
2075 }
2076 
2077 ////////////////////////////////////////////////////////////////////////////////
2078 /// Return new matrix of type used by this finder.
2079 
2081 {
2082  return gGeoIdentity;
2083 }
2084 
2085 ////////////////////////////////////////////////////////////////////////////////
2086 /// Fills external matrix with the local one corresponding to the given division
2087 /// index.
2088 
2090 {
2091  matrix.Clear();
2092 }
2093 
2094 //______________________________________________________________________________
2095 // TGeoPatternSphPhi - a spherical phi divison pattern
2096 //______________________________________________________________________________
2097 
2098 ////////////////////////////////////////////////////////////////////////////////
2099 /// Default constructor
2100 
2102 {
2103  fSinCos = 0;
2104  CreateThreadData(1);
2105 }
2106 ////////////////////////////////////////////////////////////////////////////////
2107 /// constructor
2108 /// compute step, start, end
2109 
2111  :TGeoPatternFinder(vol, ndivisions)
2112 {
2113  fStart = 0;
2114  fEnd = 360.;
2115  fStep = 360./ndivisions;
2116  CreateSinCos();
2117  CreateThreadData(1);
2118 }
2119 ////////////////////////////////////////////////////////////////////////////////
2120 /// constructor
2121 /// compute start, end
2122 
2124  :TGeoPatternFinder(vol, ndivisions)
2125 {
2126  fStep = step;
2127  CreateSinCos();
2128  CreateThreadData(1);
2129 }
2130 ////////////////////////////////////////////////////////////////////////////////
2131 /// constructor
2132 /// compute step
2133 
2135  :TGeoPatternFinder(vol, ndivisions)
2136 {
2137  fStart = start;
2138  if (fStart<0) fStart+=360;
2139  fEnd = end;
2140  if (fEnd<0) fEnd+=360;
2141  if ((end-start)<0)
2142  fStep = (end-start+360)/ndivisions;
2143  else
2144  fStep = (end-start)/ndivisions;
2145  CreateSinCos();
2146  CreateThreadData(1);
2147 }
2148 
2149 ////////////////////////////////////////////////////////////////////////////////
2150 /// Destructor
2151 
2153 {
2154  delete [] fSinCos;
2155 }
2156 
2157 ////////////////////////////////////////////////////////////////////////////////
2158 /// Create the sincos table if it does not exist
2159 
2161 {
2162  fSinCos = new Double_t[2*fNdivisions];
2163  for (Int_t idiv = 0; idiv<fNdivisions; idiv++) {
2164  fSinCos[2*idiv] = TMath::Sin(TMath::DegToRad()*(fStart+0.5*fStep+idiv*fStep));
2165  fSinCos[2*idiv+1] = TMath::Cos(TMath::DegToRad()*(fStart+0.5*fStep+idiv*fStep));
2166  }
2167  return fSinCos;
2168 }
2169 
2170 ////////////////////////////////////////////////////////////////////////////////
2171 /// Update current division index and global matrix to point to a given slice.
2172 
2174 {
2175  ThreadData_t& td = GetThreadData();
2176  td.fCurrent = idiv;
2177  if (!fSinCos) CreateSinCos();
2178  ((TGeoRotation*)td.fMatrix)->FastRotZ(&fSinCos[2*idiv]);
2179 }
2180 
2181 ////////////////////////////////////////////////////////////////////////////////
2182 /// Checks if the current point is on division boundary
2183 
2185 {
2186  Double_t phi = TMath::ATan2(point[1], point[0])*TMath::RadToDeg();
2187  if (phi<0) phi += 360;
2188  Double_t ddp = phi - fStart;
2189  if (ddp<0) ddp+=360;
2190  Double_t seg = ddp/fStep;
2191  Double_t diff = seg - Int_t(seg);
2192  if (diff>0.5) diff = 1.-diff;
2193  if (diff<1e-8) return kTRUE;
2194  return kFALSE;
2195 }
2196 ////////////////////////////////////////////////////////////////////////////////
2197 /// find the node containing the query point
2198 
2200 {
2201  ThreadData_t& td = GetThreadData();
2202  TGeoNode *node = 0;
2203  Double_t phi = TMath::ATan2(point[1], point[0])*TMath::RadToDeg();
2204  if (phi<0) phi += 360;
2205 // Double_t dphi = fStep*fNdivisions;
2206  Double_t ddp = phi - fStart;
2207  if (ddp<0) ddp+=360;
2208 // if (ddp>360) ddp-=360;
2209  Int_t ind = (Int_t)(1. + ddp/fStep) - 1;
2210  if (dir) {
2211  td.fNextIndex = ind;
2212  Double_t dot = point[0]*dir[1]-point[1]*dir[0];
2213  if (dot>0) td.fNextIndex++;
2214  else td.fNextIndex--;
2215  if ((td.fNextIndex<0) || (td.fNextIndex>=fNdivisions)) td.fNextIndex = -1;
2216  }
2217  if ((ind<0) || (ind>=fNdivisions)) return node;
2218  node = GetNodeOffset(ind);
2219  cd(ind);
2220  return node;
2221 }
2222 ////////////////////////////////////////////////////////////////////////////////
2223 /// Make a copy of this finder. Reflect by Z if required.
2224 
2226 {
2228  if (!reflect) return finder;
2229  finder->Reflect();
2230  return finder;
2231 }
2232 
2233 ////////////////////////////////////////////////////////////////////////////////
2234 /// Save a primitive as a C++ statement(s) on output stream "out".
2235 
2236 void TGeoPatternSphPhi::SavePrimitive(std::ostream &out, Option_t * /*option*/ /*= ""*/)
2237 {
2238  Int_t iaxis = 2;
2239  out << iaxis << ", " << fNdivisions << ", " << fStart << ", " << fStep;
2240 }
2241 ////////////////////////////////////////////////////////////////////////////////
2242 /// Return new matrix of type used by this finder.
2243 
2245 {
2246  if (!IsReflected()) {
2247  TGeoRotation *matrix = new TGeoRotation();
2248  matrix->RegisterYourself();
2249  return matrix;
2250  }
2251  TGeoRotation *rot = new TGeoRotation();
2252  rot->RegisterYourself();
2253  rot->ReflectZ(kTRUE);
2254  rot->ReflectZ(kFALSE);
2255  return rot;
2256 }
2257 ////////////////////////////////////////////////////////////////////////////////
2258 /// Fills external matrix with the local one corresponding to the given division
2259 /// index.
2260 
2262 {
2263  if (!fSinCos) ((TGeoPatternSphPhi*)this)->CreateSinCos();
2264  matrix.Clear();
2265  matrix.FastRotZ(&fSinCos[2*idiv]);
2266 }
2267 
2268 //______________________________________________________________________________
2269 // TGeoPatternHoneycomb - a divison pattern specialized for honeycombs
2270 //______________________________________________________________________________
2271 
2272 ////////////////////////////////////////////////////////////////////////////////
2273 /// Default constructor
2274 
2276 {
2277  fNrows = 0;
2278  fAxisOnRows = 0;
2279  fNdivisions = 0;
2280  fStart = 0;
2281  CreateThreadData(1);
2282 }
2283 ////////////////////////////////////////////////////////////////////////////////
2284 /// Default constructor
2285 
2287  :TGeoPatternFinder(vol, nrows)
2288 {
2289  fNrows = nrows;
2290  fAxisOnRows = 0;
2291  fNdivisions = 0;
2292  fStart = 0;
2293  CreateThreadData(1);
2294 // compute everything else
2295 }
2296 ////////////////////////////////////////////////////////////////////////////////
2297 ///copy constructor
2298 
2300  TGeoPatternFinder(pfh),
2301  fNrows(pfh.fNrows),
2302  fAxisOnRows(pfh.fAxisOnRows),
2303  fNdivisions(pfh.fNdivisions),
2304  fStart(pfh.fStart)
2305 {
2306  CreateThreadData(1);
2307 }
2308 
2309 ////////////////////////////////////////////////////////////////////////////////
2310 ///assignment operator
2311 
2313 {
2314  if(this!=&pfh) {
2316  fNrows=pfh.fNrows;
2319  fStart=pfh.fStart;
2320  CreateThreadData(1);
2321  }
2322  return *this;
2323 }
2324 ////////////////////////////////////////////////////////////////////////////////
2325 /// destructor
2326 
2328 {
2329 }
2330 ////////////////////////////////////////////////////////////////////////////////
2331 /// Update current division index and global matrix to point to a given slice.
2332 
2334 {
2335  ThreadData_t& td = GetThreadData();
2336  td.fCurrent=idiv;
2337 }
2338 ////////////////////////////////////////////////////////////////////////////////
2339 /// find the node containing the query point
2340 
2342 {
2343  return 0;
2344 }
2345 
2346 ////////////////////////////////////////////////////////////////////////////////
2347 /// Return new matrix of type used by this finder.
2348 
2350 {
2351  return gGeoIdentity;
2352 }
2353 
2354 ////////////////////////////////////////////////////////////////////////////////
2355 /// Fills external matrix with the local one corresponding to the given division
2356 /// index.
2357 
2359 {
2360  matrix.Clear();
2361 }
TGeoPatternParaX::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
get the node division containing the query point
Definition: TGeoPatternFinder.cxx:899
TGeoPatternSphPhi::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:2236
TGeoPatternCylPhi::fSinCos
Double_t * fSinCos
Definition: TGeoPatternFinder.h:399
TGeoPatternParaZ::fTxz
Double_t fTxz
Definition: TGeoPatternFinder.h:290
TGeoPatternFinder::CdNext
virtual TGeoNode * CdNext()
Make next node (if any) current.
Definition: TGeoPatternFinder.cxx:212
TGeoPatternTrapZ::operator=
TGeoPatternTrapZ & operator=(const TGeoPatternTrapZ &)
assignment operator
Definition: TGeoPatternFinder.cxx:1404
TGeoPatternHoneycomb::operator=
TGeoPatternHoneycomb & operator=(const TGeoPatternHoneycomb &)
assignment operator
Definition: TGeoPatternFinder.cxx:2312
TGeoPara
Definition: TGeoPara.h:17
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TGeoPatternFinder::ClearThreadData
void ClearThreadData() const
Definition: TGeoPatternFinder.cxx:81
TGeoPatternSphR::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:1945
e
#define e(i)
Definition: RSha256.hxx:121
TGeoPatternCylPhi::~TGeoPatternCylPhi
virtual ~TGeoPatternCylPhi()
Destructor.
Definition: TGeoPatternFinder.cxx:1735
TGeoCombiTrans::ReflectZ
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
Definition: TGeoMatrix.cxx:2020
TGeoPatternFinder::CreateThreadData
void CreateThreadData(Int_t nthreads)
Create thread data for n threads max.
Definition: TGeoPatternFinder.cxx:97
TMath::ATan2
Double_t ATan2(Double_t y, Double_t x)
Definition: TMath.h:679
gGeoIdentity
R__EXTERN TGeoIdentity * gGeoIdentity
Definition: TGeoMatrix.h:478
TGeoVolume::GetShape
TGeoShape * GetShape() const
Definition: TGeoVolume.h:188
TGeoManager::ThreadId
static Int_t ThreadId()
Translates the current thread id to an ordinal number.
Definition: TGeoManager.cxx:904
TGeoPatternFinder::fThreadData
std::vector< ThreadData_t * > fThreadData
Definition: TGeoPatternFinder.h:62
TMath::RadToDeg
constexpr Double_t RadToDeg()
Conversion from radian to degree:
Definition: TMath.h:79
TGeoCombiTrans
Definition: TGeoMatrix.h:291
TGeoPatternFinder::GetNodeOffset
TGeoNode * GetNodeOffset(Int_t idiv)
Definition: TGeoPatternFinder.h:88
TGeoPatternCylPhi::IsOnBoundary
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Definition: TGeoPatternFinder.cxx:1752
TGeoPatternFinder::operator=
TGeoPatternFinder & operator=(const TGeoPatternFinder &)
assignment operator
Definition: TGeoPatternFinder.cxx:155
TGeoPatternParaZ::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:1282
TMath::Cos
Double_t Cos(Double_t)
Definition: TMath.h:643
TGeoPatternCylPhi::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:1742
TGeoPatternParaY::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:1103
TGeoMatrix::SetDz
virtual void SetDz(Double_t)
Definition: TGeoMatrix.h:106
TGeoPatternSphPhi
Definition: TGeoPatternFinder.h:498
TGeoPatternSphPhi::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:2261
TGeoPatternParaX::operator=
TGeoPatternParaX & operator=(const TGeoPatternParaX &)
assignment operator
Definition: TGeoPatternFinder.cxx:855
TGeoHMatrix::FastRotZ
void FastRotZ(const Double_t *sincos)
Perform a rotation about Z having the sine/cosine of the rotation angle.
Definition: TGeoMatrix.cxx:2445
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGeoPatternCylR::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:1601
TGeoPatternCylPhi
Definition: TGeoPatternFinder.h:395
TBuffer::ReadClassBuffer
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
TGeoPatternTrapZ::TGeoPatternTrapZ
TGeoPatternTrapZ()
Default constructor.
Definition: TGeoPatternFinder.cxx:1336
r
ROOT::R::TRInterface & r
Definition: Object.C:4
TGeoPatternZ::TGeoPatternZ
TGeoPatternZ()
Default constructor.
Definition: TGeoPatternFinder.cxx:618
TGeoPatternTrapZ::~TGeoPatternTrapZ
virtual ~TGeoPatternTrapZ()
Destructor.
Definition: TGeoPatternFinder.cxx:1418
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TGeoPatternParaZ::IsOnBoundary
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Definition: TGeoPatternFinder.cxx:1249
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TGeoPatternFinder::fStart
Double_t fStart
Definition: TGeoPatternFinder.h:56
TGeoPatternSphTheta::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
Definition: TGeoPatternFinder.cxx:2054
TMath::Sqrt
Double_t Sqrt(Double_t x)
Definition: TMath.h:691
TGeoPatternParaX::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:948
TGeoPatternParaX::IsOnBoundary
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Definition: TGeoPatternFinder.cxx:883
TGeoPatternX::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:322
TMath::DegToRad
constexpr Double_t DegToRad()
Conversion from degree to radian:
Definition: TMath.h:87
TMath::Tan
Double_t Tan(Double_t)
Definition: TMath.h:647
TGeoArb8
Definition: TGeoArb8.h:17
TGeoPatternParaZ::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:1293
TGeoPatternParaY
Definition: TGeoPatternFinder.h:250
TGeoPatternSphTheta::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:2071
TGeoPatternSphTheta
Definition: TGeoPatternFinder.h:467
TGeoPatternParaX::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:873
Int_t
int Int_t
Definition: RtypesCore.h:45
TGeoPatternParaX::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:939
TGeoPatternParaY::IsOnBoundary
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Definition: TGeoPatternFinder.cxx:1064
TGeoPatternZ::operator=
TGeoPatternZ & operator=(const TGeoPatternZ &)
assignment operator
Definition: TGeoPatternFinder.cxx:670
TGeoPatternFinder::fThreadSize
Int_t fThreadSize
Vector of thread private transient data.
Definition: TGeoPatternFinder.h:63
TGeoPatternFinder::fVolume
TGeoVolume * fVolume
Definition: TGeoPatternFinder.h:60
TMath::Abs
Short_t Abs(Short_t d)
Definition: TMathBase.h:120
TBuffer
Definition: TBuffer.h:43
TGeoPatternParaX::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:966
TGeoPatternZ::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:716
TGeoPatternFinder::fEnd
Double_t fEnd
Definition: TGeoPatternFinder.h:57
TGeoPatternY::FindNextBoundary
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.
Definition: TGeoPatternFinder.cxx:572
TGeoPatternFinder::GetThreadData
ThreadData_t & GetThreadData() const
Definition: TGeoPatternFinder.cxx:73
TGeoPatternTrapZ::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:1424
TGeoTranslation
Definition: TGeoMatrix.h:121
TGeoPatternSphPhi::~TGeoPatternSphPhi
virtual ~TGeoPatternSphPhi()
Destructor.
Definition: TGeoPatternFinder.cxx:2152
TGeoPatternX
Definition: TGeoPatternFinder.h:117
TGeoNode
Definition: TGeoNode.h:39
TGeoPatternFinder
Definition: TGeoPatternFinder.h:31
bool
TGeoPatternSphTheta::~TGeoPatternSphTheta
virtual ~TGeoPatternSphTheta()
Destructor.
Definition: TGeoPatternFinder.cxx:2040
TGeoPatternTrapZ::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:1508
TGeoPatternX::TGeoPatternX
TGeoPatternX()
Default constructor.
Definition: TGeoPatternFinder.cxx:238
TGeoHMatrix::SetDx
virtual void SetDx(Double_t dx)
Definition: TGeoMatrix.h:459
TGeoPatternCylR::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:1633
TGeoPatternParaY::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:1123
TGeoPatternParaY::operator=
TGeoPatternParaY & operator=(const TGeoPatternParaY &)
assignment operator
Definition: TGeoPatternFinder.cxx:1034
TGeoHMatrix::Clear
void Clear(Option_t *option="")
clear the data for this matrix
Definition: TGeoMatrix.cxx:2421
TGeoPatternFinder::ThreadData_t
Definition: TGeoPatternFinder.h:34
TGeoPatternFinder::GetCurrent
Int_t GetCurrent()
Return current index.
Definition: TGeoPatternFinder.cxx:180
TGeoPatternZ::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:698
TGeoPatternFinder::SetRange
void SetRange(Double_t start, Double_t step, Int_t ndivisions)
Set division range. Use this method only when dividing an assembly.
Definition: TGeoPatternFinder.cxx:223
TGeoPatternParaZ::fTyz
Double_t fTyz
Definition: TGeoPatternFinder.h:291
ROOT::Math::gv_detail::dist
double dist(Rotation3D const &r1, Rotation3D const &r2)
Definition: 3DDistances.cxx:63
TGeoPatternHoneycomb::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
Definition: TGeoPatternFinder.cxx:2341
TGeoPatternX::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:403
TGeoPatternX::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:312
TGeoPatternY::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:593
TGeoPatternParaZ
Definition: TGeoPatternFinder.h:286
TGeoPatternY::~TGeoPatternY
virtual ~TGeoPatternY()
Destructor.
Definition: TGeoPatternFinder.cxx:495
TGeoPatternTrapZ::IsOnBoundary
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Definition: TGeoPatternFinder.cxx:1437
TGeoArb8.h
TGeoPatternZ::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:790
TGeoPatternHoneycomb::TGeoPatternHoneycomb
TGeoPatternHoneycomb()
Default constructor.
Definition: TGeoPatternFinder.cxx:2275
TGeoPatternSphPhi::IsOnBoundary
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Definition: TGeoPatternFinder.cxx:2184
TGeoPatternSphPhi::fSinCos
Double_t * fSinCos
Definition: TGeoPatternFinder.h:501
TGeoPatternSphR::~TGeoPatternSphR
virtual ~TGeoPatternSphR()
Destructor.
Definition: TGeoPatternFinder.cxx:1923
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TBuffer.h
TGeoPatternSphTheta::TGeoPatternSphTheta
TGeoPatternSphTheta()
Default constructor.
Definition: TGeoPatternFinder.cxx:1984
TGeoHMatrix
Definition: TGeoMatrix.h:420
TGeoPatternParaZ::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:1236
TGeoPatternX::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:414
TGeoCombiTrans::RegisterYourself
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Definition: TGeoMatrix.cxx:1877
TGeoPatternY::TGeoPatternY
TGeoPatternY()
Default constructor.
Definition: TGeoPatternFinder.cxx:428
TGeoPatternY::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:512
TGeoPatternParaY::~TGeoPatternParaY
virtual ~TGeoPatternParaY()
Destructor.
Definition: TGeoPatternFinder.cxx:1046
TGeoPatternParaZ::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:1320
TGeoRotation::ReflectZ
virtual void ReflectZ(Bool_t leftside, Bool_t rotonly=kFALSE)
Multiply by a reflection respect to XY.
Definition: TGeoMatrix.cxx:1192
TGeoPatternSphTheta::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:2089
TGeoPatternY::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:530
TGeoPatternSphPhi::TGeoPatternSphPhi
TGeoPatternSphPhi()
Default constructor.
Definition: TGeoPatternFinder.cxx:2101
TGeoPatternCylR::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:1653
TGeoPatternParaX::~TGeoPatternParaX
virtual ~TGeoPatternParaX()
Destructor.
Definition: TGeoPatternFinder.cxx:867
TGeoRotation
Definition: TGeoMatrix.h:174
TBuffer::WriteClassBuffer
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
TGeoPatternFinder::ThreadData_t::fNextIndex
Int_t fNextIndex
current division element
Definition: TGeoPatternFinder.h:38
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TGeoPatternCylR::~TGeoPatternCylR
virtual ~TGeoPatternCylR()
Destructor.
Definition: TGeoPatternFinder.cxx:1581
TGeoPatternFinder::fMutex
std::mutex fMutex
Size of the thread vector.
Definition: TGeoPatternFinder.h:64
TGeoPatternParaX::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:928
TGeoPatternX::IsOnBoundary
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Definition: TGeoPatternFinder.cxx:349
TGeoPatternFinder::TGeoPatternFinder
TGeoPatternFinder()
Default constructor.
Definition: TGeoPatternFinder.cxx:113
TGeoPatternX::~TGeoPatternX
virtual ~TGeoPatternX()
Destructor.
Definition: TGeoPatternFinder.cxx:305
TGeoPatternCylPhi::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:1806
TGeoPatternSphPhi::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:2173
TGeoPatternZ::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:688
TMath::Sin
Double_t Sin(Double_t)
Definition: TMath.h:639
TGeoPatternCylPhi::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:1834
TGeoPatternHoneycomb::fNrows
Int_t fNrows
Definition: TGeoPatternFinder.h:539
TGeoPatternZ::~TGeoPatternZ
virtual ~TGeoPatternZ()
Destructor.
Definition: TGeoPatternFinder.cxx:682
TGeoPatternHoneycomb::fStart
Double_t * fStart
Definition: TGeoPatternFinder.h:542
TGeoPatternFinder::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const =0
TGeoPatternFinder::fDivIndex
Int_t fDivIndex
Definition: TGeoPatternFinder.h:59
TGeoPatternTrapZ::fTyz
Double_t fTyz
Definition: TGeoPatternFinder.h:328
TGeoPatternSphTheta::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:2080
TGeoBBox
Definition: TGeoBBox.h:17
TGeoPatternParaZ::operator=
TGeoPatternParaZ & operator=(const TGeoPatternParaZ &)
assignment operator
Definition: TGeoPatternFinder.cxx:1217
TGeoPatternFinder::fNdivisions
Int_t fNdivisions
Definition: TGeoPatternFinder.h:58
TGeoPatternCylPhi::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:1795
TGeoPatternFinder::IsReflected
Bool_t IsReflected() const
Definition: TGeoPatternFinder.h:94
TGeoPatternY::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
Find the cell corresponding to point and next cell along dir (if asked)
Definition: TGeoPatternFinder.cxx:551
TGeoMatrix.h
TGeoPatternParaZ::~TGeoPatternParaZ
virtual ~TGeoPatternParaZ()
Destructor.
Definition: TGeoPatternFinder.cxx:1229
TGeoPatternFinder::~TGeoPatternFinder
virtual ~TGeoPatternFinder()
Destructor.
Definition: TGeoPatternFinder.cxx:172
TGeoPatternTrapZ::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
get the node division containing the query point
Definition: TGeoPatternFinder.cxx:1449
TGeoManager.h
TGeoPatternHoneycomb
Definition: TGeoPatternFinder.h:535
TGeoPatternSphPhi::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:2244
TGeoPatternHoneycomb::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:2349
TGeoPatternCylPhi::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:1852
TGeoPatternSphR::TGeoPatternSphR
TGeoPatternSphR()
Default constructor.
Definition: TGeoPatternFinder.cxx:1865
TBuffer::IsReading
Bool_t IsReading() const
Definition: TBuffer.h:86
TGeoPatternFinder.h
TGeoPatternFinder::ThreadData_t::~ThreadData_t
~ThreadData_t()
Destructor.
Definition: TGeoPatternFinder.cxx:66
TGeoPatternTrapZ::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:1481
TGeoPatternFinder::cd
virtual void cd(Int_t)
Definition: TGeoPatternFinder.h:78
TGeoPatternParaX::TGeoPatternParaX
TGeoPatternParaX()
Default constructor.
Definition: TGeoPatternFinder.cxx:803
Double_t
double Double_t
Definition: RtypesCore.h:59
TGeoMatrix
Definition: TGeoMatrix.h:40
TGeoPatternTrapZ::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:1470
TObject::operator=
TObject & operator=(const TObject &rhs)
TObject assignment operator.
Definition: TObject.h:268
TGeoPatternParaY::TGeoPatternParaY
TGeoPatternParaY()
Default constructor.
Definition: TGeoPatternFinder.cxx:979
TGeoPatternParaY::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:1114
TObject.h
TGeoPatternSphR
Definition: TGeoPatternFinder.h:436
TGeoPatternParaZ::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:1302
TGeoPatternCylR
Definition: TGeoPatternFinder.h:363
TGeoPatternY::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:502
TGeoPatternTrapZ
Definition: TGeoPatternFinder.h:323
TGeoPatternCylPhi::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
Definition: TGeoPatternFinder.cxx:1768
TGeoPatternSphPhi::CreateSinCos
Double_t * CreateSinCos()
Create the sincos table if it does not exist.
Definition: TGeoPatternFinder.cxx:2160
TGeoPatternY::operator=
TGeoPatternY & operator=(const TGeoPatternY &)
assignment operator
Definition: TGeoPatternFinder.cxx:483
TGeoPatternZ
Definition: TGeoPatternFinder.h:184
TGeoPatternSphR::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:1929
TGeoPatternFinder::GetMatrix
virtual TGeoMatrix * GetMatrix()
Return current matrix.
Definition: TGeoPatternFinder.cxx:188
TGeoPatternZ::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:779
TObject
Definition: TObject.h:37
TGeoPatternSphR::operator=
TGeoPatternSphR & operator=(const TGeoPatternSphR &)
assignment operator
Definition: TGeoPatternFinder.cxx:1911
TGeoPatternSphR::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:1963
TGeoPatternHoneycomb::fAxisOnRows
Int_t fAxisOnRows
Definition: TGeoPatternFinder.h:540
TGeoPatternZ::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
Find the cell corresponding to point and next cell along dir (if asked)
Definition: TGeoPatternFinder.cxx:737
TGeoPatternZ::FindNextBoundary
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.
Definition: TGeoPatternFinder.cxx:758
TGeoPatternCylR::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
Definition: TGeoPatternFinder.cxx:1610
TGeoPatternSphR::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
Definition: TGeoPatternFinder.cxx:1937
TGeoHMatrix::SetDy
virtual void SetDy(Double_t dy)
Definition: TGeoMatrix.h:460
TGeoPatternSphR::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:1972
TGeoPatternFinder::ThreadData_t::fMatrix
TGeoMatrix * fMatrix
Definition: TGeoPatternFinder.h:36
TGeoPatternX::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
Find the cell corresponding to point and next cell along dir (if asked)
Definition: TGeoPatternFinder.cxx:361
TGeoPatternSphTheta::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:2046
TGeoPara.h
TGeoPatternCylR::operator=
TGeoPatternCylR & operator=(const TGeoPatternCylR &)
assignment operator
Definition: TGeoPatternFinder.cxx:1569
TGeoPatternCylR::IsOnBoundary
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Definition: TGeoPatternFinder.cxx:1588
TGeoMatrix::SetDy
virtual void SetDy(Double_t)
Definition: TGeoMatrix.h:105
TGeoMatrix::SetDx
virtual void SetDx(Double_t)
Definition: TGeoMatrix.h:104
TGeoShape::Tolerance
static Double_t Tolerance()
Definition: TGeoShape.h:91
TGeoMatrix::RegisterYourself
virtual void RegisterYourself()
Register the matrix in the current manager, which will become the owner.
Definition: TGeoMatrix.cxx:526
TGeoPatternCylR::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:1644
TGeoPatternTrapZ::fTxz
Double_t fTxz
Definition: TGeoPatternFinder.h:327
TGeoPatternParaX
Definition: TGeoPatternFinder.h:217
TGeoPatternParaZ::TGeoPatternParaZ
TGeoPatternParaZ()
Default constructor.
Definition: TGeoPatternFinder.cxx:1156
TGeoPatternZ::IsOnBoundary
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Definition: TGeoPatternFinder.cxx:725
TGeoPatternSphPhi::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
find the node containing the query point
Definition: TGeoPatternFinder.cxx:2199
TGeoPatternParaY::fTxy
Double_t fTxy
Definition: TGeoPatternFinder.h:254
TGeoPatternCylR::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:1662
TGeoPatternFinder::SetNext
void SetNext(Int_t index)
Set index of next division.
Definition: TGeoPatternFinder.cxx:204
TGeoPatternSphTheta::operator=
TGeoPatternSphTheta & operator=(const TGeoPatternSphTheta &)
assignment operator
Definition: TGeoPatternFinder.cxx:2029
TGeoShape::Big
static Double_t Big()
Definition: TGeoShape.h:88
TGeoPatternTrapZ::CreateMatrix
virtual TGeoMatrix * CreateMatrix() const
Return new matrix of type used by this finder.
Definition: TGeoPatternFinder.cxx:1490
Class
void Class()
Definition: Class.C:29
TGeoPatternHoneycomb::~TGeoPatternHoneycomb
virtual ~TGeoPatternHoneycomb()
destructor
Definition: TGeoPatternFinder.cxx:2327
TGeoPatternSphTheta::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:2062
TGeoPatternFinder::Reflect
void Reflect(Bool_t flag=kTRUE)
Definition: TGeoPatternFinder.h:98
TGeoPatternParaY::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:1052
TGeoPatternParaZ::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
get the node division containing the query point
Definition: TGeoPatternFinder.cxx:1261
TGeoPatternFinder::ThreadData_t::ThreadData_t
ThreadData_t()
index of next node
Definition: TGeoPatternFinder.cxx:58
TGeoPatternFinder::fStep
Double_t fStep
Definition: TGeoPatternFinder.h:55
TGeoPatternCylPhi::TGeoPatternCylPhi
TGeoPatternCylPhi()
Default constructor.
Definition: TGeoPatternFinder.cxx:1674
TGeoPatternHoneycomb::fNdivisions
Int_t * fNdivisions
Definition: TGeoPatternFinder.h:541
TGeoPatternParaY::FindNode
virtual TGeoNode * FindNode(Double_t *point, const Double_t *dir=0)
get the node division containing the query point
Definition: TGeoPatternFinder.cxx:1078
TGeoPatternParaY::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:1141
TGeoPatternFinder::ThreadData_t::fCurrent
Int_t fCurrent
generic matrix
Definition: TGeoPatternFinder.h:37
TGeoPatternX::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:340
TGeoPatternFinder::GetNext
Int_t GetNext() const
Get index of next division.
Definition: TGeoPatternFinder.cxx:196
TGeoVolume
Definition: TGeoVolume.h:44
TGeoPatternHoneycomb::cd
virtual void cd(Int_t idiv)
Update current division index and global matrix to point to a given slice.
Definition: TGeoPatternFinder.cxx:2333
TGeoPatternX::FindNextBoundary
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.
Definition: TGeoPatternFinder.cxx:382
TGeoPatternCylR::TGeoPatternCylR
TGeoPatternCylR()
Default constructor.
Definition: TGeoPatternFinder.cxx:1524
TGeoPatternY::IsOnBoundary
virtual Bool_t IsOnBoundary(const Double_t *point) const
Checks if the current point is on division boundary.
Definition: TGeoPatternFinder.cxx:539
TGeoNode.h
TGeoPatternSphR::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:1954
TGeoTrap
Definition: TGeoArb8.h:91
TGeoPatternX::operator=
TGeoPatternX & operator=(const TGeoPatternX &)
assignment operator
Definition: TGeoPatternFinder.cxx:293
TMath.h
TGeoPatternY::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition: TGeoPatternFinder.cxx:604
int
TGeoPatternY
Definition: TGeoPatternFinder.h:151
TGeoPatternHoneycomb::UpdateMatrix
virtual void UpdateMatrix(Int_t idiv, TGeoHMatrix &matrix) const
Fills external matrix with the local one corresponding to the given division index.
Definition: TGeoPatternFinder.cxx:2358
TGeoHMatrix::SetDz
virtual void SetDz(Double_t dz)
Definition: TGeoMatrix.h:461
TGeoPatternSphPhi::MakeCopy
virtual TGeoPatternFinder * MakeCopy(Bool_t reflect=kFALSE)
Make a copy of this finder. Reflect by Z if required.
Definition: TGeoPatternFinder.cxx:2225