ROOT  6.06/09
Reference Guide
TGeoMCGeometry.cxx
Go to the documentation of this file.
1 // @(#)root/vmc:$Id$
2 // Authors: Alice collaboration 25/06/2002
3 
4 /*************************************************************************
5  * Copyright (C) 2006, Rene Brun and Fons Rademakers. *
6  * Copyright (C) 2002, ALICE Experiment at CERN. *
7  * All rights reserved. *
8  * *
9  * For the licensing terms see $ROOTSYS/LICENSE. *
10  * For the list of contributors see $ROOTSYS/README/CREDITS. *
11  *************************************************************************/
12 
13 
14 //______________________________________________________________________________
15 //
16 // Implementation of the TVirtualMCGeometry interface
17 // for building TGeo geometry.
18 //______________________________________________________________________________
19 
20 #include <ctype.h>
21 #include "TError.h"
22 #include "TArrayD.h"
23 
24 #include "TGeoMCGeometry.h"
25 #include "TGeoManager.h"
26 #include "TGeoMatrix.h"
27 #include "TGeoVolume.h"
28 #include "TGeoArb8.h"
29 #include "TGeoTrd1.h"
30 #include "TGeoTrd2.h"
31 #include "TGeoTube.h"
32 #include "TGeoCone.h"
33 #include "TGeoPgon.h"
34 #include "TGeoSphere.h"
35 #include "TGeoPara.h"
36 #include "TGeoEltu.h"
37 #include "TGeoHype.h"
38 #include "TMath.h"
39 
41 
42 TGeoMCGeometry* TGeoMCGeometry::fgInstance=0;
43 
44 ////////////////////////////////////////////////////////////////////////////////
45 ///
46 /// Standard constructor
47 ///
48 
49 TGeoMCGeometry::TGeoMCGeometry(const char *name, const char *title,
50  Bool_t g3CompatibleVolumeNames)
51  : TVirtualMCGeometry(name, title),
52  fG3CompatibleVolumeNames(g3CompatibleVolumeNames)
53 {
54 }
55 
56 ////////////////////////////////////////////////////////////////////////////////
57 ///
58 /// Default constructor
59 ///
60 
63  fG3CompatibleVolumeNames(kFALSE)
64 {
65 }
66 
67 ////////////////////////////////////////////////////////////////////////////////
68 ///
69 /// Destructor
70 ///
71 
73 {
74  fgInstance=0;
75 }
76 
77 //
78 // private methods
79 //
80 
81 
82 ////////////////////////////////////////////////////////////////////////////////
83 /// Return TGeoManager global pointer.
84 /// Create a new TGeoManager object if it does not yet exist.
85 
87 {
88  if ( ! gGeoManager ) new TGeoManager("TGeo", "Root geometry manager");
89 
90  return gGeoManager;
91 }
92 
93 ////////////////////////////////////////////////////////////////////////////////
94 /// Converts Float_t* array to Double_t*,
95 /// !! The new array has to be deleted by user.
96 /// ---
97 
99 {
100  Double_t* doubleArray;
101  if (size>0) {
102  doubleArray = new Double_t[size];
103  for (Int_t i=0; i<size; i++) doubleArray[i] = array[i];
104  } else {
105  //doubleArray = 0;
106  doubleArray = new Double_t[1];
107  }
108  return doubleArray;
109 }
110 
111 ////////////////////////////////////////////////////////////////////////////////
112 ///
113 /// convert name to upper case. Make vname at least 4 chars
114 ///
115 
116 void TGeoMCGeometry::Vname(const char *name, char *vname) const
117 {
119  Int_t l = strlen(name);
120  Int_t i;
121  l = l < 4 ? l : 4;
122  for (i=0;i<l;i++) vname[i] = toupper(name[i]);
123  for (i=l;i<4;i++) vname[i] = ' ';
124  vname[4] = 0;
125  } else {
126  Int_t l = strlen(name);
127  if ( l>=79 ) l = 79;
128  for (Int_t i=0;i<l;i++) vname[i] = name[i];
129  vname[l] = 0;
130  }
131 }
132 
133 //
134 // public methods
135 //
136 
137 ////////////////////////////////////////////////////////////////////////////////
138 ///
139 /// Defines a Material
140 ///
141 /// kmat number assigned to the material
142 /// name material name
143 /// a atomic mass in au
144 /// z atomic number
145 /// dens density in g/cm3
146 /// absl absorbtion length in cm
147 /// if >=0 it is ignored and the program
148 /// calculates it, if <0. -absl is taken
149 /// radl radiation length in cm
150 /// if >=0 it is ignored and the program
151 /// calculates it, if <0. -radl is taken
152 /// buf pointer to an array of user words
153 /// nbuf number of user words
154 ///
155 
156 void TGeoMCGeometry::Material(Int_t& kmat, const char* name, Double_t a, Double_t z,
157  Double_t dens, Double_t radl, Double_t absl, Float_t* buf,
158  Int_t nwbuf)
159 {
160  Double_t* dbuf = CreateDoubleArray(buf, nwbuf);
161  Material(kmat, name, a, z, dens, radl, absl, dbuf, nwbuf);
162  delete [] dbuf;
163 }
164 
165 ////////////////////////////////////////////////////////////////////////////////
166 ///
167 /// Defines a Material
168 ///
169 /// kmat number assigned to the material
170 /// name material name
171 /// a atomic mass in au
172 /// z atomic number
173 /// dens density in g/cm3
174 /// absl absorbtion length in cm
175 /// if >=0 it is ignored and the program
176 /// calculates it, if <0. -absl is taken
177 /// radl radiation length in cm
178 /// if >=0 it is ignored and the program
179 /// calculates it, if <0. -radl is taken
180 /// buf pointer to an array of user words
181 /// nbuf number of user words
182 ///
183 
184 void TGeoMCGeometry::Material(Int_t& kmat, const char* name, Double_t a, Double_t z,
185  Double_t dens, Double_t radl, Double_t absl, Double_t* /*buf*/,
186  Int_t /*nwbuf*/)
187 {
188  GetTGeoManager()->Material(name, a, z, dens, kmat, radl, absl);
189 }
190 
191 ////////////////////////////////////////////////////////////////////////////////
192 ///
193 /// Defines mixture OR COMPOUND IMAT as composed by
194 /// THE BASIC NLMAT materials defined by arrays A,Z and WMAT
195 ///
196 /// If NLMAT > 0 then wmat contains the proportion by
197 /// weights of each basic material in the mixture.
198 ///
199 /// If nlmat < 0 then WMAT contains the number of atoms
200 /// of a given kind into the molecule of the COMPOUND
201 /// In this case, WMAT in output is changed to relative
202 /// weigths.
203 ///
204 
205 void TGeoMCGeometry::Mixture(Int_t& kmat, const char* name, Float_t* a, Float_t* z,
206  Double_t dens, Int_t nlmat, Float_t* wmat)
207 {
208  Double_t* da = CreateDoubleArray(a, TMath::Abs(nlmat));
209  Double_t* dz = CreateDoubleArray(z, TMath::Abs(nlmat));
210  Double_t* dwmat = CreateDoubleArray(wmat, TMath::Abs(nlmat));
211 
212  Mixture(kmat, name, da, dz, dens, nlmat, dwmat);
213  for (Int_t i=0; i<nlmat; i++) {
214  a[i] = da[i]; z[i] = dz[i]; wmat[i] = dwmat[i];
215  }
216 
217  delete [] da;
218  delete [] dz;
219  delete [] dwmat;
220 }
221 
222 ////////////////////////////////////////////////////////////////////////////////
223 ///
224 /// Defines mixture OR COMPOUND IMAT as composed by
225 /// THE BASIC NLMAT materials defined by arrays A,Z and WMAT
226 ///
227 /// If NLMAT > 0 then wmat contains the proportion by
228 /// weights of each basic material in the mixture.
229 ///
230 /// If nlmat < 0 then WMAT contains the number of atoms
231 /// of a given kind into the molecule of the COMPOUND
232 /// In this case, WMAT in output is changed to relative
233 /// weigths.
234 ///
235 
236 void TGeoMCGeometry::Mixture(Int_t& kmat, const char* name, Double_t* a, Double_t* z,
237  Double_t dens, Int_t nlmat, Double_t* wmat)
238 {
239  if (nlmat < 0) {
240  nlmat = - nlmat;
241  Double_t amol = 0;
242  Int_t i;
243  for (i=0;i<nlmat;i++) {
244  amol += a[i]*wmat[i];
245  }
246  for (i=0;i<nlmat;i++) {
247  wmat[i] *= a[i]/amol;
248  }
249  }
250  GetTGeoManager()->Mixture(name, a, z, dens, nlmat, wmat, kmat);
251 }
252 
253 ////////////////////////////////////////////////////////////////////////////////
254 ///
255 /// kmed tracking medium number assigned
256 /// name tracking medium name
257 /// nmat material number
258 /// isvol sensitive volume flag
259 /// ifield magnetic field
260 /// fieldm max. field value (kilogauss)
261 /// tmaxfd max. angle due to field (deg/step)
262 /// stemax max. step allowed
263 /// deemax max. fraction of energy lost in a step
264 /// epsil tracking precision (cm)
265 /// stmin min. step due to continuous processes (cm)
266 ///
267 /// ifield = 0 if no magnetic field; ifield = -1 if user decision in guswim;
268 /// ifield = 1 if tracking performed with g3rkuta; ifield = 2 if tracking
269 /// performed with g3helix; ifield = 3 if tracking performed with g3helx3.
270 ///
271 
272 void TGeoMCGeometry::Medium(Int_t& kmed, const char* name, Int_t nmat, Int_t isvol,
273  Int_t ifield, Double_t fieldm, Double_t tmaxfd,
274  Double_t stemax, Double_t deemax, Double_t epsil,
275  Double_t stmin, Float_t* ubuf, Int_t nbuf)
276 {
277  //printf("Creating mediuma: %s, numed=%d, nmat=%d\n",name,kmed,nmat);
278  Double_t* dubuf = CreateDoubleArray(ubuf, nbuf);
279  Medium(kmed, name, nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil,
280  stmin, dubuf, nbuf);
281  delete [] dubuf;
282 }
283 
284 ////////////////////////////////////////////////////////////////////////////////
285 ///
286 /// kmed tracking medium number assigned
287 /// name tracking medium name
288 /// nmat material number
289 /// isvol sensitive volume flag
290 /// ifield magnetic field
291 /// fieldm max. field value (kilogauss)
292 /// tmaxfd max. angle due to field (deg/step)
293 /// stemax max. step allowed
294 /// deemax max. fraction of energy lost in a step
295 /// epsil tracking precision (cm)
296 /// stmin min. step due to continuos processes (cm)
297 ///
298 /// ifield = 0 if no magnetic field; ifield = -1 if user decision in guswim;
299 /// ifield = 1 if tracking performed with g3rkuta; ifield = 2 if tracking
300 /// performed with g3helix; ifield = 3 if tracking performed with g3helx3.
301 ///
302 
303 void TGeoMCGeometry::Medium(Int_t& kmed, const char* name, Int_t nmat, Int_t isvol,
304  Int_t ifield, Double_t fieldm, Double_t tmaxfd,
305  Double_t stemax, Double_t deemax, Double_t epsil,
306  Double_t stmin, Double_t* /*ubuf*/, Int_t /*nbuf*/)
307 {
308  GetTGeoManager()->Medium(name,kmed,nmat, isvol, ifield, fieldm, tmaxfd, stemax,deemax, epsil, stmin);
309 }
310 
311 ////////////////////////////////////////////////////////////////////////////////
312 ///
313 /// krot rotation matrix number assigned
314 /// theta1 polar angle for axis i
315 /// phi1 azimuthal angle for axis i
316 /// theta2 polar angle for axis ii
317 /// phi2 azimuthal angle for axis ii
318 /// theta3 polar angle for axis iii
319 /// phi3 azimuthal angle for axis iii
320 ///
321 /// it defines the rotation matrix number irot.
322 ///
323 
325  Double_t phiy, Double_t thez, Double_t phiz)
326 {
328  GetTGeoManager()->Matrix(krot, thex, phix, they, phiy, thez, phiz);
329 }
330 
331 ////////////////////////////////////////////////////////////////////////////////
332 ///
333 /// NAME Volume name
334 /// SHAPE Volume type
335 /// NUMED Tracking medium number
336 /// NPAR Number of shape parameters
337 /// UPAR Vector containing shape parameters
338 ///
339 /// It creates a new volume in the JVOLUM data structure.
340 ///
341 
342 Int_t TGeoMCGeometry::Gsvolu(const char *name, const char *shape, Int_t nmed,
343  Float_t *upar, Int_t npar)
344 {
345  Double_t* dupar = CreateDoubleArray(upar, npar);
346  Int_t id = Gsvolu(name, shape, nmed, dupar, npar);
347  delete [] dupar;
348  return id;
349 }
350 
351 ////////////////////////////////////////////////////////////////////////////////
352 ///
353 /// NAME Volume name
354 /// SHAPE Volume type
355 /// NUMED Tracking medium number
356 /// NPAR Number of shape parameters
357 /// UPAR Vector containing shape parameters
358 ///
359 /// It creates a new volume in the JVOLUM data structure.
360 ///
361 
362 Int_t TGeoMCGeometry::Gsvolu(const char *name, const char *shape, Int_t nmed,
363  Double_t *upar, Int_t npar)
364 {
365  char vname[80];
366  Vname(name,vname);
367  char vshape[5];
368  Vname(shape,vshape);
369 
370  TGeoVolume* vol = GetTGeoManager()->Volume(vname, vshape, nmed, upar, npar);
371  if (!vol) {
372  Fatal("Gsvolu", "Could not create volume %s", name);
373  return -1;
374  }
375  return vol->GetNumber();
376 }
377 
378 ////////////////////////////////////////////////////////////////////////////////
379 ///
380 /// Create a new volume by dividing an existing one
381 ///
382 /// NAME Volume name
383 /// MOTHER Mother volume name
384 /// NDIV Number of divisions
385 /// IAXIS Axis value
386 ///
387 /// X,Y,Z of CAXIS will be translated to 1,2,3 for IAXIS.
388 /// It divides a previously defined volume.
389 ///
390 
391 void TGeoMCGeometry::Gsdvn(const char *name, const char *mother, Int_t ndiv,
392  Int_t iaxis)
393 {
394  char vname[80];
395  Vname(name,vname);
396  char vmother[80];
397  Vname(mother,vmother);
398 
399  GetTGeoManager()->Division(vname, vmother, iaxis, ndiv, 0, 0, 0, "n");
400 }
401 
402 ////////////////////////////////////////////////////////////////////////////////
403 ///
404 /// Create a new volume by dividing an existing one
405 ///
406 /// Divides mother into ndiv divisions called name
407 /// along axis iaxis starting at coordinate value c0.
408 /// the new volume created will be medium number numed.
409 ///
410 
411 void TGeoMCGeometry::Gsdvn2(const char *name, const char *mother, Int_t ndiv,
412  Int_t iaxis, Double_t c0i, Int_t numed)
413 {
414  char vname[80];
415  Vname(name,vname);
416  char vmother[80];
417  Vname(mother,vmother);
418 
419  GetTGeoManager()->Division(vname, vmother, iaxis, ndiv, c0i, 0, numed, "nx");
420 }
421 ////////////////////////////////////////////////////////////////////////////////
422 ///
423 /// Create a new volume by dividing an existing one
424 ///
425 /// Divides MOTHER into divisions called NAME along
426 /// axis IAXIS in steps of STEP. If not exactly divisible
427 /// will make as many as possible and will centre them
428 /// with respect to the mother. Divisions will have medium
429 /// number NUMED. If NUMED is 0, NUMED of MOTHER is taken.
430 /// NDVMX is the expected maximum number of divisions
431 /// (If 0, no protection tests are performed)
432 ///
433 
434 void TGeoMCGeometry::Gsdvt(const char *name, const char *mother, Double_t step,
435  Int_t iaxis, Int_t numed, Int_t /*ndvmx*/)
436 {
437  char vname[80];
438  Vname(name,vname);
439  char vmother[80];
440  Vname(mother,vmother);
441 
442  GetTGeoManager()->Division(vname, vmother, iaxis, 0, 0, step, numed, "s");
443 }
444 
445 ////////////////////////////////////////////////////////////////////////////////
446 ///
447 /// Create a new volume by dividing an existing one
448 ///
449 /// Divides MOTHER into divisions called NAME along
450 /// axis IAXIS starting at coordinate value C0 with step
451 /// size STEP.
452 /// The new volume created will have medium number NUMED.
453 /// If NUMED is 0, NUMED of mother is taken.
454 /// NDVMX is the expected maximum number of divisions
455 /// (If 0, no protection tests are performed)
456 ///
457 
458 void TGeoMCGeometry::Gsdvt2(const char *name, const char *mother, Double_t step,
459  Int_t iaxis, Double_t c0, Int_t numed, Int_t /*ndvmx*/)
460 {
461  char vname[80];
462  Vname(name,vname);
463  char vmother[80];
464  Vname(mother,vmother);
465 
466  GetTGeoManager()->Division(vname, vmother, iaxis, 0, c0, step, numed, "sx");
467 }
468 
469 ////////////////////////////////////////////////////////////////////////////////
470 ///
471 /// Flags volume CHNAME whose contents will have to be ordered
472 /// along axis IAX, by setting the search flag to -IAX
473 /// IAX = 1 X axis
474 /// IAX = 2 Y axis
475 /// IAX = 3 Z axis
476 /// IAX = 4 Rxy (static ordering only -> GTMEDI)
477 /// IAX = 14 Rxy (also dynamic ordering -> GTNEXT)
478 /// IAX = 5 Rxyz (static ordering only -> GTMEDI)
479 /// IAX = 15 Rxyz (also dynamic ordering -> GTNEXT)
480 /// IAX = 6 PHI (PHI=0 => X axis)
481 /// IAX = 7 THETA (THETA=0 => Z axis)
482 ///
483 
484 void TGeoMCGeometry::Gsord(const char * /*name*/, Int_t /*iax*/)
485 {
486  // TBC - keep this function
487  // nothing to be done for TGeo //xx
488 }
489 
490 ////////////////////////////////////////////////////////////////////////////////
491 ///
492 /// Position a volume into an existing one
493 ///
494 /// NAME Volume name
495 /// NUMBER Copy number of the volume
496 /// MOTHER Mother volume name
497 /// X X coord. of the volume in mother ref. sys.
498 /// Y Y coord. of the volume in mother ref. sys.
499 /// Z Z coord. of the volume in mother ref. sys.
500 /// IROT Rotation matrix number w.r.t. mother ref. sys.
501 /// ONLY ONLY/MANY flag
502 ///
503 /// It positions a previously defined volume in the mother.
504 ///
505 
506 void TGeoMCGeometry::Gspos(const char *name, Int_t nr, const char *mother, Double_t x,
507  Double_t y, Double_t z, Int_t irot, const char *konly)
508 {
509  TString only = konly;
510  only.ToLower();
511  Bool_t isOnly = kFALSE;
512  if (only.Contains("only")) isOnly = kTRUE;
513  char vname[80];
514  Vname(name,vname);
515  char vmother[80];
516  Vname(mother,vmother);
517 
518  Double_t *upar=0;
519  GetTGeoManager()->Node(vname, nr, vmother, x, y, z, irot, isOnly, upar);
520 }
521 
522 ////////////////////////////////////////////////////////////////////////////////
523 ///
524 /// Place a copy of generic volume NAME with user number
525 /// NR inside MOTHER, with its parameters UPAR(1..NP)
526 ///
527 
528 void TGeoMCGeometry::Gsposp(const char *name, Int_t nr, const char *mother,
529  Double_t x, Double_t y, Double_t z, Int_t irot,
530  const char *konly, Float_t *upar, Int_t np )
531 {
532  Double_t* dupar = CreateDoubleArray(upar, np);
533  Gsposp(name, nr, mother, x, y, z, irot, konly, dupar, np);
534  delete [] dupar;
535 }
536 
537 ////////////////////////////////////////////////////////////////////////////////
538 ///
539 /// Place a copy of generic volume NAME with user number
540 /// NR inside MOTHER, with its parameters UPAR(1..NP)
541 ///
542 
543 void TGeoMCGeometry::Gsposp(const char *name, Int_t nr, const char *mother,
544  Double_t x, Double_t y, Double_t z, Int_t irot,
545  const char *konly, Double_t *upar, Int_t np )
546 {
547  TString only = konly;
548  only.ToLower();
549  Bool_t isOnly = kFALSE;
550  if (only.Contains("only")) isOnly = kTRUE;
551  char vname[80];
552  Vname(name,vname);
553  char vmother[80];
554  Vname(mother,vmother);
555 
556  GetTGeoManager()->Node(vname,nr,vmother, x,y,z,irot,isOnly,upar,np);
557 }
558 
559 ////////////////////////////////////////////////////////////////////////////////
560 ///
561 /// Return the unique numeric identifier for volume name
562 ///
563 
564 Int_t TGeoMCGeometry::VolId(const char *name) const
565 {
566  Int_t uid = GetTGeoManager()->GetUID(name);
567  if (uid<0) {
568  printf("VolId: Volume %s not found\n",name);
569  return 0;
570  }
571  return uid;
572 }
573 
574 ////////////////////////////////////////////////////////////////////////////////
575 ///
576 /// Return the unique numeric identifier for medium name
577 ///
578 
580 {
581  TGeoMedium* medium = GetTGeoManager()->GetMedium(name);
582  if (medium) return medium->GetId();
583 
584  printf("MediumId: Medium %s not found\n",name);
585  return 0;
586 }
587 
588 ////////////////////////////////////////////////////////////////////////////////
589 ///
590 /// Return the volume name given the volume identifier
591 ///
592 
593 const char* TGeoMCGeometry::VolName(Int_t id) const
594 {
595  TGeoVolume *volume = GetTGeoManager()->GetVolume(id);
596  if (!volume) {
597  Error("VolName","volume with id=%d does not exist",id);
598  return "NULL";
599  }
600  return volume->GetName();
601 }
602 
603 ////////////////////////////////////////////////////////////////////////////////
604 ///
605 /// Return total number of volumes in the geometry
606 ///
607 
609 {
611 }
612 
613 ////////////////////////////////////////////////////////////////////////////////
614 /// Return number of daughters of the volume specified by volName
615 /// According to A. Morsch' G3toRoot class (by A. Morsch)
616 /// ---
617 
618 Int_t TGeoMCGeometry::NofVolDaughters(const char* volName) const
619 {
620  TGeoVolume* volume = GetTGeoManager()->GetVolume(volName);
621 
622  if (!volume) {
623  Error("NofVolDaughters", "Volume %s not found.", volName);
624  return 0;
625  }
626 
627  return volume->GetNdaughters();
628 }
629 
630 ////////////////////////////////////////////////////////////////////////////////
631 /// Return the name of i-th daughters of the volume specified by volName
632 /// According to A. Morsch' G3toRoot class.
633 /// ---
634 
635 const char* TGeoMCGeometry::VolDaughterName(const char* volName, Int_t i) const
636 {
637  // Get volume
638  TGeoVolume* volume = GetTGeoManager()->GetVolume(volName);
639  if (!volume) {
640  Error("VolDaughterName", "Volume %s not found.", volName);
641  return "";
642  }
643 
644  // Check index
645  if (i<0 || i>=volume->GetNdaughters()) {
646  Error("VolDaughterName", "Volume %s Index out of limits", volName);
647  return "";
648  }
649 
650  // Return node's volume name
651  return volume->GetNode(i)->GetVolume()->GetName();
652 }
653 
654 ////////////////////////////////////////////////////////////////////////////////
655 /// Return the copyNo of i-th daughters of the volume specified by volName
656 /// According to A. Morsch' G3toRoot class.
657 /// ---
658 
659 Int_t TGeoMCGeometry::VolDaughterCopyNo(const char* volName, Int_t i) const
660 {
661 
662  // Get volume
663  TGeoVolume* volume = GetTGeoManager()->GetVolume(volName);
664  if (!volume) {
665  Error("VolDaughterName", "Volume %s not found.", volName);
666  return 0;
667  }
668 
669  // Check index
670  if (i<0 || i>=volume->GetNdaughters()) {
671  Error("VolDaughterName", "Volume %s Index out of limits", volName);
672  return 0;
673  }
674 
675  // Return node's copyNo
676  return volume->GetNode(i)->GetNumber();
677 }
678 
679 ////////////////////////////////////////////////////////////////////////////////
680 ///
681 /// Return material number for a given volume id
682 ///
683 
685 {
686  TGeoVolume *volume = GetTGeoManager()->GetVolume(id);
687  if (!volume) {
688  Error("VolId2Mate","volume with id=%d does not exist",id);
689  return 0;
690  }
691  TGeoMedium *med = volume->GetMedium();
692  if (!med) return 0;
693  return med->GetId();
694 }
695 
696 ////////////////////////////////////////////////////////////////////////////////
697 /// Returns the Transformation matrix between the volume specified
698 /// by the path volumePath and the Top or mater volume. The format
699 /// of the path volumePath is as follows (assuming ALIC is the Top volume)
700 /// "/ALIC_1/DDIP_1/S05I_2/S05H_1/S05G_3". Here ALIC is the top most
701 /// or master volume which has only 1 instance of. Of all of the daughter
702 /// volumes of ALICE, DDIP volume copy #1 is indicated. Similarly for
703 /// the daughter volume of DDIP is S05I copy #2 and so on.
704 /// Inputs:
705 /// TString& volumePath The volume path to the specific volume
706 /// for which you want the matrix. Volume name
707 /// hierarchy is separated by "/" while the
708 /// copy number is appended using a "_".
709 /// Outputs:
710 /// TGeoHMatrix &mat A matrix with its values set to those
711 /// appropriate to the Local to Master transformation
712 /// Return:
713 /// A logical value if kFALSE then an error occurred and no change to
714 /// mat was made.
715 
717 {
718  // We have to preserve the modeler state
720  if (!GetTGeoManager()->cd(volumePath.Data())) {
721  GetTGeoManager()->PopPath();
722  return kFALSE;
723  }
724  mat = *GetTGeoManager()->GetCurrentMatrix();
725  GetTGeoManager()->PopPath();
726  return kTRUE;
727 }
728 ////////////////////////////////////////////////////////////////////////////////
729 /// Returns the shape and its parameters for the volume specified
730 /// by volumeName.
731 /// Inputs:
732 /// TString& volumeName The volume name
733 /// Outputs:
734 /// TString &shapeType Shape type
735 /// TArrayD &par A TArrayD of parameters with all of the
736 /// parameters of the specified shape.
737 /// Return:
738 /// A logical indicating whether there was an error in getting this
739 /// information
740 
741 Bool_t TGeoMCGeometry::GetShape(const TString &volumePath,TString &shapeType,
742  TArrayD &par)
743 {
744  Int_t npar;
746  if (!GetTGeoManager()->cd(volumePath.Data())) {
747  GetTGeoManager()->PopPath();
748  return kFALSE;
749  }
751  GetTGeoManager()->PopPath();
752  if (!vol) return kFALSE;
753  TGeoShape *shape = vol->GetShape();
754  TClass *class_type = shape->IsA();
755  if (class_type==TGeoBBox::Class()) {
756  shapeType = "BOX";
757  npar = 3;
758  par.Set(npar);
759  TGeoBBox *box = (TGeoBBox*)shape;
760  par.AddAt(box->GetDX(),0);
761  par.AddAt(box->GetDY(),1);
762  par.AddAt(box->GetDZ(),2);
763  return kTRUE;
764  }
765  if (class_type==TGeoTrd1::Class()) {
766  shapeType = "TRD1";
767  npar = 4;
768  par.Set(npar);
769  TGeoTrd1 *trd1 = (TGeoTrd1*)shape;
770  par.AddAt(trd1->GetDx1(),0);
771  par.AddAt(trd1->GetDx2(),1);
772  par.AddAt(trd1->GetDy(), 2);
773  par.AddAt(trd1->GetDz(), 3);
774  return kTRUE;
775  }
776  if (class_type==TGeoTrd2::Class()) {
777  shapeType = "TRD2";
778  npar = 5;
779  par.Set(npar);
780  TGeoTrd2 *trd2 = (TGeoTrd2*)shape;
781  par.AddAt(trd2->GetDx1(),0);
782  par.AddAt(trd2->GetDx2(),1);
783  par.AddAt(trd2->GetDy1(),2);
784  par.AddAt(trd2->GetDy2(),3);
785  par.AddAt(trd2->GetDz(), 4);
786  return kTRUE;
787  }
788  if (class_type==TGeoTrap::Class()) {
789  shapeType = "TRAP";
790  npar = 11;
791  par.Set(npar);
792  TGeoTrap *trap = (TGeoTrap*)shape;
793  Double_t tth = TMath::Tan(trap->GetTheta()*TMath::DegToRad());
794  par.AddAt(trap->GetDz(),0);
795  par.AddAt(tth*TMath::Cos(trap->GetPhi()*TMath::DegToRad()),1);
796  par.AddAt(tth*TMath::Sin(trap->GetPhi()*TMath::DegToRad()),2);
797  par.AddAt(trap->GetH1(),3);
798  par.AddAt(trap->GetBl1(),4);
799  par.AddAt(trap->GetTl1(),5);
800  par.AddAt(TMath::Tan(trap->GetAlpha1()*TMath::DegToRad()),6);
801  par.AddAt(trap->GetH2(),7);
802  par.AddAt(trap->GetBl2(),8);
803  par.AddAt(trap->GetTl2(),9);
804  par.AddAt(TMath::Tan(trap->GetAlpha2()*TMath::DegToRad()),10);
805  return kTRUE;
806  }
807  if (class_type==TGeoTube::Class()) {
808  shapeType = "TUBE";
809  npar = 3;
810  par.Set(npar);
811  TGeoTube *tube = (TGeoTube*)shape;
812  par.AddAt(tube->GetRmin(),0);
813  par.AddAt(tube->GetRmax(),1);
814  par.AddAt(tube->GetDz(),2);
815  return kTRUE;
816  }
817  if (class_type==TGeoTubeSeg::Class()) {
818  shapeType = "TUBS";
819  npar = 5;
820  par.Set(npar);
821  TGeoTubeSeg *tubs = (TGeoTubeSeg*)shape;
822  par.AddAt(tubs->GetRmin(),0);
823  par.AddAt(tubs->GetRmax(),1);
824  par.AddAt(tubs->GetDz(),2);
825  par.AddAt(tubs->GetPhi1(),3);
826  par.AddAt(tubs->GetPhi2(),4);
827  return kTRUE;
828  }
829  if (class_type==TGeoCone::Class()) {
830  shapeType = "CONE";
831  npar = 5;
832  par.Set(npar);
833  TGeoCone *cone = (TGeoCone*)shape;
834  par.AddAt(cone->GetDz(),0);
835  par.AddAt(cone->GetRmin1(),1);
836  par.AddAt(cone->GetRmax1(),2);
837  par.AddAt(cone->GetRmin2(),3);
838  par.AddAt(cone->GetRmax2(),4);
839  return kTRUE;
840  }
841  if (class_type==TGeoConeSeg::Class()) {
842  shapeType = "CONS";
843  npar = 7;
844  par.Set(npar);
845  TGeoConeSeg *cons = (TGeoConeSeg*)shape;
846  par.AddAt(cons->GetDz(),0);
847  par.AddAt(cons->GetRmin1(),1);
848  par.AddAt(cons->GetRmax1(),2);
849  par.AddAt(cons->GetRmin2(),3);
850  par.AddAt(cons->GetRmax2(),4);
851  par.AddAt(cons->GetPhi1(),5);
852  par.AddAt(cons->GetPhi2(),6);
853  return kTRUE;
854  }
855  if (class_type==TGeoSphere::Class()) {
856  shapeType = "SPHE";
857  npar = 6;
858  par.Set(npar);
859  TGeoSphere *sphe = (TGeoSphere*)shape;
860  par.AddAt(sphe->GetRmin(),0);
861  par.AddAt(sphe->GetRmax(),1);
862  par.AddAt(sphe->GetTheta1(),2);
863  par.AddAt(sphe->GetTheta2(),3);
864  par.AddAt(sphe->GetPhi1(),4);
865  par.AddAt(sphe->GetPhi2(),5);
866  return kTRUE;
867  }
868  if (class_type==TGeoPara::Class()) {
869  shapeType = "PARA";
870  npar = 6;
871  par.Set(npar);
872  TGeoPara *para = (TGeoPara*)shape;
873  par.AddAt(para->GetX(),0);
874  par.AddAt(para->GetY(),1);
875  par.AddAt(para->GetZ(),2);
876  par.AddAt(para->GetTxy(),3);
877  par.AddAt(para->GetTxz(),4);
878  par.AddAt(para->GetTyz(),5);
879  return kTRUE;
880  }
881  if (class_type==TGeoPgon::Class()) {
882  shapeType = "PGON";
883  TGeoPgon *pgon = (TGeoPgon*)shape;
884  Int_t nz = pgon->GetNz();
885  const Double_t *rmin = pgon->GetRmin();
886  const Double_t *rmax = pgon->GetRmax();
887  const Double_t *z = pgon->GetZ();
888  npar = 4 + 3*nz;
889  par.Set(npar);
890  par.AddAt(pgon->GetPhi1(),0);
891  par.AddAt(pgon->GetDphi(),1);
892  par.AddAt(pgon->GetNedges(),2);
893  par.AddAt(pgon->GetNz(),3);
894  for (Int_t i=0; i<nz; i++) {
895  par.AddAt(z[i], 4+3*i);
896  par.AddAt(rmin[i], 4+3*i+1);
897  par.AddAt(rmax[i], 4+3*i+2);
898  }
899  return kTRUE;
900  }
901  if (class_type==TGeoPcon::Class()) {
902  shapeType = "PCON";
903  TGeoPcon *pcon = (TGeoPcon*)shape;
904  Int_t nz = pcon->GetNz();
905  const Double_t *rmin = pcon->GetRmin();
906  const Double_t *rmax = pcon->GetRmax();
907  const Double_t *z = pcon->GetZ();
908  npar = 3 + 3*nz;
909  par.Set(npar);
910  par.AddAt(pcon->GetPhi1(),0);
911  par.AddAt(pcon->GetDphi(),1);
912  par.AddAt(pcon->GetNz(),2);
913  for (Int_t i=0; i<nz; i++) {
914  par.AddAt(z[i], 3+3*i);
915  par.AddAt(rmin[i], 3+3*i+1);
916  par.AddAt(rmax[i], 3+3*i+2);
917  }
918  return kTRUE;
919  }
920  if (class_type==TGeoEltu::Class()) {
921  shapeType = "ELTU";
922  npar = 3;
923  par.Set(npar);
924  TGeoEltu *eltu = (TGeoEltu*)shape;
925  par.AddAt(eltu->GetA(),0);
926  par.AddAt(eltu->GetB(),1);
927  par.AddAt(eltu->GetDz(),2);
928  return kTRUE;
929  }
930  if (class_type==TGeoHype::Class()) {
931  shapeType = "HYPE";
932  npar = 5;
933  par.Set(npar);
934  TGeoHype *hype = (TGeoHype*)shape;
935  par.AddAt(TMath::Sqrt(hype->RadiusHypeSq(0.,kTRUE)),0);
936  par.AddAt(TMath::Sqrt(hype->RadiusHypeSq(0.,kFALSE)),1);
937  par.AddAt(hype->GetDZ(),2);
938  par.AddAt(hype->GetStIn(),3);
939  par.AddAt(hype->GetStOut(),4);
940  return kTRUE;
941  }
942  if (class_type==TGeoGtra::Class()) {
943  shapeType = "GTRA";
944  npar = 12;
945  par.Set(npar);
946  TGeoGtra *trap = (TGeoGtra*)shape;
947  Double_t tth = TMath::Tan(trap->GetTheta()*TMath::DegToRad());
948  par.AddAt(trap->GetDz(),0);
949  par.AddAt(tth*TMath::Cos(trap->GetPhi()*TMath::DegToRad()),1);
950  par.AddAt(tth*TMath::Sin(trap->GetPhi()*TMath::DegToRad()),2);
951  par.AddAt(trap->GetH1(),3);
952  par.AddAt(trap->GetBl1(),4);
953  par.AddAt(trap->GetTl1(),5);
954  par.AddAt(TMath::Tan(trap->GetAlpha1()*TMath::DegToRad()),6);
955  par.AddAt(trap->GetH2(),7);
956  par.AddAt(trap->GetBl2(),8);
957  par.AddAt(trap->GetTl2(),9);
958  par.AddAt(TMath::Tan(trap->GetAlpha2()*TMath::DegToRad()),10);
959  par.AddAt(trap->GetTwistAngle(),11);
960  return kTRUE;
961  }
962  if (class_type==TGeoCtub::Class()) {
963  shapeType = "CTUB";
964  npar = 11;
965  par.Set(npar);
966  TGeoCtub *ctub = (TGeoCtub*)shape;
967  const Double_t *lx = ctub->GetNlow();
968  const Double_t *tx = ctub->GetNhigh();
969  par.AddAt(ctub->GetRmin(),0);
970  par.AddAt(ctub->GetRmax(),1);
971  par.AddAt(ctub->GetDz(),2);
972  par.AddAt(ctub->GetPhi1(),3);
973  par.AddAt(ctub->GetPhi2(),4);
974  par.AddAt(lx[0],5);
975  par.AddAt(lx[1],6);
976  par.AddAt(lx[2],7);
977  par.AddAt(tx[0],8);
978  par.AddAt(tx[1],9);
979  par.AddAt(tx[2],10);
980  return kTRUE;
981 
982  }
983  Error("GetShape","Getting shape parameters for shape %s not implemented", shape->ClassName());
984  return kFALSE;
985 }
986 
987 ////////////////////////////////////////////////////////////////////////////////
988 /// Returns the Material and its parameters for the volume specified
989 /// by volumeName.
990 /// Note, Geant3 stores and uses mixtures as an element with an effective
991 /// Z and A. Consequently, if the parameter Z is not integer, then
992 /// this material represents some sort of mixture.
993 /// Inputs:
994 /// TString& volumeName The volume name
995 /// Outputs:
996 /// TSrting &name Material name
997 /// Int_t &imat Material index number
998 /// Double_t &a Average Atomic mass of material
999 /// Double_t &z Average Atomic number of material
1000 /// Double_t &dens Density of material [g/cm^3]
1001 /// Double_t &radl Average radiation length of material [cm]
1002 /// Double_t &inter Average interaction length of material [cm]
1003 /// TArrayD &par A TArrayD of user defined parameters.
1004 /// Return:
1005 /// kTRUE if no errors
1006 
1008  TString &name,Int_t &imat,
1009  Double_t &a,Double_t &z,Double_t &dens,
1010  Double_t &radl,Double_t &inter,TArrayD &par)
1011 {
1012  TGeoVolume *vol = GetTGeoManager()->GetVolume(volumeName.Data());
1013  if (!vol) return kFALSE;
1014  TGeoMedium *med = vol->GetMedium();
1015  if (!med) return kFALSE;
1016  TGeoMaterial *mat = med->GetMaterial();
1017  imat = mat->GetUniqueID();
1018  name = mat->GetName();
1019  name = name.Strip(TString::kTrailing, '$');
1020  a = mat->GetA();
1021  z = mat->GetZ();
1022  dens = mat->GetDensity();
1023  radl = mat->GetRadLen();
1024  inter = mat->GetIntLen(); // WARNING: THIS IS NOT COMPUTED NATIVELY BY TGEO
1025  par.Set(0); // NO USER PARAMETERS STORED IN TGEO
1026  return kTRUE;
1027 }
1028 
1029 ////////////////////////////////////////////////////////////////////////////////
1030 /// Returns the Medium and its parameters for the volume specified
1031 /// by volumeName.
1032 /// Inputs:
1033 /// TString& volumeName The volume name.
1034 /// Outputs:
1035 /// TString &name Medium name
1036 /// Int_t &nmat Material number defined for this medium
1037 /// Int_t &imed The medium index number
1038 /// Int_t &isvol volume number defined for this medium
1039 /// Int_t &iflield Magnetic field flag
1040 /// Double_t &fieldm Magnetic field strength
1041 /// Double_t &tmaxfd Maximum angle of deflection per step
1042 /// Double_t &stemax Maximum step size
1043 /// Double_t &deemax Maximum fraction of energy allowed to be lost
1044 /// to continuous process.
1045 /// Double_t &epsil Boundary crossing precision
1046 /// Double_t &stmin Minimum step size allowed
1047 /// TArrayD &par A TArrayD of user parameters with all of the
1048 /// parameters of the specified medium.
1049 /// Return:
1050 /// kTRUE if there where no errors
1051 
1053  Int_t &imed,Int_t &nmat,Int_t &isvol,Int_t &ifield,
1054  Double_t &fieldm,Double_t &tmaxfd,Double_t &stemax,
1055  Double_t &deemax,Double_t &epsil, Double_t &stmin,
1056  TArrayD &par)
1057 {
1058  TGeoVolume *vol = GetTGeoManager()->GetVolume(volumeName.Data());
1059  if (!vol) return kFALSE;
1060  TGeoMedium *med = vol->GetMedium();
1061  if (!med) return kFALSE;
1062  TGeoMaterial *mat = med->GetMaterial();
1063  nmat = mat->GetUniqueID();
1064  imed = med->GetId();
1065  name = med->GetName();
1066  name = name.Strip(TString::kTrailing, '$');
1067  par.Set(0); // NO USER PARAMETERS IN TGEO
1068  isvol = (Int_t)med->GetParam(0);
1069  ifield = (Int_t)med->GetParam(1);
1070  fieldm = med->GetParam(2);
1071  tmaxfd = med->GetParam(3);
1072  stemax = med->GetParam(4);
1073  deemax = med->GetParam(5);
1074  epsil = med->GetParam(6);
1075  stmin = med->GetParam(7);
1076  return kTRUE;
1077 }
1078 
Double_t GetStOut() const
Definition: TGeoHype.h:99
virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv, Int_t iaxis, Double_t c0i, Int_t numed)
Create a new volume by dividing an existing one.
double par[1]
Definition: unuranDistr.cxx:38
Double_t GetTxy() const
Definition: TGeoPara.h:80
virtual ~TGeoMCGeometry()
Destructor.
virtual Int_t MediumId(const char *mediumName) const
Return the unique numeric identifier for medium name.
virtual void Gsdvt2(const char *name, const char *mother, Double_t step, Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx)
Create a new volume by dividing an existing one.
virtual Double_t GetRmin1() const
Definition: TGeoCone.h:87
virtual Bool_t GetShape(const TString &volumePath, TString &shapeType, TArrayD &par)
Returns the shape and its parameters for the volume specified by volumeName.
TGeoVolume * GetVolume() const
Definition: TGeoNode.h:106
float Float_t
Definition: RtypesCore.h:53
Double_t GetBl2() const
Definition: TGeoArb8.h:173
virtual Double_t GetRmax2() const
Definition: TGeoCone.h:90
TGeoMaterial * Mixture(const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nelem, Float_t *wmat, Int_t uid)
Create mixture OR COMPOUND IMAT as composed by THE BASIC nelem materials defined by arrays A...
void Vname(const char *name, char *vname) const
convert name to upper case.
Double_t GetDy() const
Definition: TGeoTrd1.h:68
Double_t DegToRad()
Definition: TMath.h:50
Double_t GetTyz() const
Definition: TGeoPara.h:82
virtual void Medium(Int_t &kmed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin, Float_t *ubuf, Int_t nbuf)
kmed tracking medium number assigned name tracking medium name nmat material number isvol sensitive v...
Double_t GetPhi2() const
Definition: TGeoCone.h:184
virtual void Gspos(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly)
Position a volume into an existing one.
TGeoHMatrix * GetCurrentMatrix() const
Definition: TGeoManager.h:483
TGeoVolume * Volume(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t npar=0)
Create a volume in GEANT3 style.
Basic string class.
Definition: TString.h:137
Double_t GetPhi1() const
Definition: TGeoPcon.h:85
void ToLower()
Change string to lower-case.
Definition: TString.cxx:1088
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TArc * a
Definition: textangle.C:12
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual Double_t GetDY() const
Definition: TGeoBBox.h:83
Int_t GetEntriesFast() const
Definition: TObjArray.h:66
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Definition: fillpatterns.C:1
virtual Bool_t GetMedium(const TString &volumeName, TString &name, Int_t &imed, Int_t &nmat, Int_t &isvol, Int_t &ifield, Double_t &fieldm, Double_t &tmaxfd, Double_t &stemax, Double_t &deemax, Double_t &epsil, Double_t &stmin, TArrayD &par)
Returns the Medium and its parameters for the volume specified by volumeName.
virtual Bool_t GetMaterial(const TString &volumeName, TString &name, Int_t &imat, Double_t &a, Double_t &z, Double_t &density, Double_t &radl, Double_t &inter, TArrayD &par)
Returns the Material and its parameters for the volume specified by volumeName.
Double_t GetBl1() const
Definition: TGeoArb8.h:169
virtual Double_t GetDZ() const
Definition: TGeoBBox.h:84
Short_t Abs(Short_t d)
Definition: TMathBase.h:110
Int_t GetNdaughters() const
Definition: TGeoVolume.h:362
virtual Int_t NofVolDaughters(const char *volName) const
Return number of daughters of the volume specified by volName According to A.
Double_t GetDy1() const
Definition: TGeoTrd2.h:69
Double_t GetY() const
Definition: TGeoPara.h:75
Double_t GetH2() const
Definition: TGeoArb8.h:172
virtual Double_t GetRmax1() const
Definition: TGeoCone.h:88
Int_t PushPath(Int_t startlevel=0)
Definition: TGeoManager.h:539
const char * Data() const
Definition: TString.h:349
virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv, Int_t iaxis)
Create a new volume by dividing an existing one.
Double_t GetDx1() const
Definition: TGeoTrd2.h:67
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition: TObject.cxx:946
virtual Int_t NofVolumes() const
Return total number of volumes in the geometry.
Double_t GetPhi2() const
Definition: TGeoTube.h:169
Double_t x[n]
Definition: legend1.C:17
Double_t GetTl1() const
Definition: TGeoArb8.h:170
void Class()
Definition: Class.C:29
virtual void Material(Int_t &kmat, const char *name, Double_t a, Double_t z, Double_t dens, Double_t radl, Double_t absl, Float_t *buf, Int_t nwbuf)
Defines a Material.
Double_t GetTxz() const
Definition: TGeoPara.h:81
Int_t GetNedges() const
Definition: TGeoPgon.h:93
virtual Double_t GetA() const
Definition: TGeoEltu.h:54
virtual Double_t GetRmax() const
Definition: TGeoSphere.h:82
virtual Int_t VolId2Mate(Int_t id) const
Return material number for a given volume id.
Double_t GetTwistAngle() const
Definition: TGeoArb8.h:223
virtual const char * VolName(Int_t id) const
Return the volume name given the volume identifier.
virtual Int_t VolDaughterCopyNo(const char *volName, Int_t i) const
Return the copyNo of i-th daughters of the volume specified by volName According to A...
XFontStruct * id
Definition: TGX11.cxx:108
virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t np)
NAME Volume name SHAPE Volume type NUMED Tracking medium number NPAR Number of shape parameters UPAR ...
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
Double_t GetParam(Int_t i) const
Definition: TGeoMedium.h:51
Double_t GetH1() const
Definition: TGeoArb8.h:168
const Double_t * GetNlow() const
Definition: TGeoTube.h:238
Int_t GetNumber() const
Definition: TGeoNode.h:104
Int_t GetUID(const char *volname) const
Retreive unique id for a volume name. Return -1 if name not found.
virtual Double_t GetA() const
Definition: TGeoMaterial.h:103
TGeoManager * GetTGeoManager() const
Return TGeoManager global pointer.
Double_t GetAlpha2() const
Definition: TGeoArb8.h:175
Double_t GetDy2() const
Definition: TGeoTrd2.h:70
Double_t GetZ() const
Definition: TGeoPara.h:76
virtual Double_t GetIntLen() const
Definition: TGeoMaterial.h:113
virtual void Gsord(const char *name, Int_t iax)
Flags volume CHNAME whose contents will have to be ordered along axis IAX, by setting the search flag...
virtual Double_t GetDX() const
Definition: TGeoBBox.h:82
Double_t GetDphi() const
Definition: TGeoPcon.h:86
void Matrix(Int_t index, Double_t theta1, Double_t phi1, Double_t theta2, Double_t phi2, Double_t theta3, Double_t phi3)
Create rotation matrix named 'mat'.
Double_t GetDz() const
Definition: TGeoTrd2.h:71
virtual Double_t GetRmin2() const
Definition: TGeoCone.h:89
TGeoMedium * Medium(const char *name, Int_t numed, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin)
Create tracking medium.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition: TObject.cxx:187
Int_t GetId() const
Definition: TGeoMedium.h:50
virtual Double_t GetRmin() const
Definition: TGeoTube.h:77
Double_t GetTheta2() const
Definition: TGeoSphere.h:84
Double_t * GetZ() const
Definition: TGeoPcon.h:93
TLine * l
Definition: textangle.C:4
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
virtual void Gsposp(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly, Float_t *upar, Int_t np)
Place a copy of generic volume NAME with user number NR inside MOTHER, with its parameters UPAR(1...
TSubString Strip(EStripType s=kTrailing, char c= ' ') const
Return a substring of self stripped at beginning and/or end.
Definition: TString.cxx:1069
TGeoMedium * GetMedium(const char *medium) const
Search for a named tracking medium. All trailing blanks stripped.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
Double_t GetPhi1() const
Definition: TGeoCone.h:183
virtual Double_t GetDz() const
Definition: TGeoCone.h:82
Bool_t PopPath()
Definition: TGeoManager.h:540
Double_t GetStIn() const
Definition: TGeoHype.h:98
TGeoVolume * Division(const char *name, const char *mother, Int_t iaxis, Int_t ndiv, Double_t start, Double_t step, Int_t numed=0, Option_t *option="")
Create a new volume by dividing an existing one (GEANT3 like)
TGeoNode * GetNode(const char *name) const
get the pointer to a daughter node
const Double_t * GetNhigh() const
Definition: TGeoTube.h:239
TObjArray * GetListOfMatrices() const
Definition: TGeoManager.h:462
virtual Double_t GetRmin() const
Definition: TGeoSphere.h:81
Double_t Cos(Double_t)
Definition: TMath.h:424
Double_t GetDz() const
Definition: TGeoTrd1.h:69
TGeoMaterial * GetMaterial() const
Definition: TGeoMedium.h:54
virtual void Gsdvt(const char *name, const char *mother, Double_t step, Int_t iaxis, Int_t numed, Int_t ndvmx)
Create a new volume by dividing an existing one.
TGeoMaterial * Material(const char *name, Double_t a, Double_t z, Double_t dens, Int_t uid, Double_t radlen=0, Double_t intlen=0)
Create material with given A, Z and density, having an unique id.
virtual Bool_t GetTransformation(const TString &volumePath, TGeoHMatrix &matrix)
Returns the Transformation matrix between the volume specified by the path volumePath and the Top or ...
Double_t GetPhi1() const
Definition: TGeoTube.h:168
Double_t * GetRmin() const
Definition: TGeoPcon.h:89
TGeoShape * GetShape() const
Definition: TGeoVolume.h:204
Int_t GetNumber() const
Definition: TGeoVolume.h:198
#define ClassImp(name)
Definition: Rtypes.h:279
R__EXTERN TGeoManager * gGeoManager
Definition: TGeoManager.h:556
double Double_t
Definition: RtypesCore.h:55
TGeoVolume * GetVolume(const char *name) const
Search for a named volume. All trailing blanks stripped.
Double_t GetPhi1() const
Definition: TGeoSphere.h:85
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
Double_t GetDx2() const
Definition: TGeoTrd2.h:68
Double_t GetTheta1() const
Definition: TGeoSphere.h:83
Double_t y[n]
Definition: legend1.C:17
TGeoVolume * GetCurrentVolume() const
Definition: TGeoManager.h:490
Double_t * CreateDoubleArray(Float_t *array, Int_t size) const
Converts Float_t* array to Double_t*, !! The new array has to be deleted by user. ...
Double_t GetTl2() const
Definition: TGeoArb8.h:174
static TGeoMCGeometry * fgInstance
Array of doubles (64 bits per element).
Definition: TArrayD.h:29
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition: TObject.cxx:433
Double_t GetTheta() const
Definition: TGeoArb8.h:166
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual Double_t GetZ() const
Definition: TGeoMaterial.h:104
virtual Double_t GetRadLen() const
Definition: TGeoMaterial.h:112
void Node(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, Bool_t isOnly, Float_t *upar, Int_t npar=0)
Create a node called pointing to the volume called as daughter of the volume called ...
Double_t * GetRmax() const
Definition: TGeoPcon.h:91
void AddAt(Double_t c, Int_t i)
Add double c at position i. Check for out of bounds.
Definition: TArrayD.cxx:92
Double_t GetPhi2() const
Definition: TGeoSphere.h:86
virtual Double_t GetDensity() const
Definition: TGeoMaterial.h:106
TGeoMedium * GetMedium() const
Definition: TGeoVolume.h:189
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:567
TGeoMCGeometry()
Default constructor.
Double_t Sin(Double_t)
Definition: TMath.h:421
Double_t GetAlpha1() const
Definition: TGeoArb8.h:171
virtual void Mixture(Int_t &kmat, const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat)
Defines mixture OR COMPOUND IMAT as composed by THE BASIC NLMAT materials defined by arrays A...
virtual Double_t GetDz() const
Definition: TGeoTube.h:79
Double_t GetDx1() const
Definition: TGeoTrd1.h:66
TObjArray * GetListOfUVolumes() const
Definition: TGeoManager.h:469
virtual const char * VolDaughterName(const char *volName, Int_t i) const
Return the name of i-th daughters of the volume specified by volName According to A...
Double_t Sqrt(Double_t x)
Definition: TMath.h:464
Bool_t fG3CompatibleVolumeNames
Double_t GetPhi() const
Definition: TGeoArb8.h:167
const Bool_t kTRUE
Definition: Rtypes.h:91
void Set(Int_t n)
Set size of this array to n doubles.
Definition: TArrayD.cxx:104
virtual void Matrix(Int_t &krot, Double_t thetaX, Double_t phiX, Double_t thetaY, Double_t phiY, Double_t thetaZ, Double_t phiZ)
krot rotation matrix number assigned theta1 polar angle for axis i phi1 azimuthal angle for axis i th...
Double_t GetDx2() const
Definition: TGeoTrd1.h:67
Double_t GetX() const
Definition: TGeoPara.h:74
Double_t Tan(Double_t)
Definition: TMath.h:427
Double_t RadiusHypeSq(Double_t z, Bool_t inner) const
Compute r^2 = x^2 + y^2 at a given z coordinate, for either inner or outer hyperbolas.
Definition: TGeoHype.cxx:677
Double_t GetDz() const
Definition: TGeoArb8.h:90
Int_t GetNz() const
Definition: TGeoPcon.h:87
virtual Double_t GetRmax() const
Definition: TGeoTube.h:78
virtual Int_t VolId(const char *volName) const
Return the unique numeric identifier for volume name.
virtual Double_t GetB() const
Definition: TGeoEltu.h:55