]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TGeant3/TGeant3.cxx
Last updates on the right version (1.44).
[u/mrichter/AliRoot.git] / TGeant3 / TGeant3.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
16/*
284796db 17$Log$
18Revision 1.45 2000/12/21 16:49:56 morsch
19Adding particles to the PDG database delegated to AliPDG.
20
4c039060 21$Log$
d89f641b 22Revision 1.44 2000/12/20 09:46:51 alibrary
23dlsym not supported on HP, reverting to gcomad
24
09298c03 25Revision 1.43 2000/12/20 08:39:39 fca
26Support for Cerenkov and process list in Virtual MC
27
27f3d82e 28Revision 1.42 2000/12/19 08:37:48 alibrary
29Using dlsym to retrieve address of commons
30
c4af8412 31Revision 1.41 2000/12/18 11:33:50 alibrary
32New call frequence histograms per module and volume
33
8409d8c9 34Revision 1.40 2000/12/06 10:06:58 morsch
35Add all D and B baryons produced by HIJING to PDG DataBase.
36
66d6a136 37Revision 1.39 2000/11/30 07:12:54 alibrary
38Introducing new Rndm and QA classes
39
65fb704d 40Revision 1.38 2000/10/30 15:19:06 morsch
41Xi(b) (pdg code 5232) added to Pdg data base.
42
1e7437fd 43Revision 1.37 2000/10/02 21:28:16 fca
44Removal of useless dependecies via forward declarations
45
94de3818 46Revision 1.36 2000/09/14 07:08:41 fca
47Introducing glvolu in the interface
48
57993b1f 49Revision 1.35 2000/09/12 14:27:10 morsch
50No instance of AliDecayer created to initialize fDecayer.
51
5de05501 52Revision 1.34 2000/09/07 12:12:01 morsch
53Comment inside comment removed.
54
3bf2f358 55Revision 1.33 2000/09/06 16:03:42 morsch
56Set ExternalDecayer, Decayer and SetForceDecay methods added.
57Gspart calls for charmed and bottom hadrons added.
58Decay mode definitions for charmed and beauty hadrons have been taken out.
59They will be handled by an external decayer.
60
5f73d6ac 61Revision 1.32 2000/08/24 16:28:53 hristov
62TGeant3::IsNewTrack corrected by F.Carminati
63
da559017 64Revision 1.31 2000/07/13 16:19:10 fca
65Mainly coding conventions + some small bug fixes
66
ef42d733 67Revision 1.30 2000/07/12 08:56:30 fca
68Coding convention correction and warning removal
69
8918e700 70Revision 1.29 2000/07/11 18:24:59 fca
71Coding convention corrections + few minor bug fixes
72
aee8290b 73Revision 1.28 2000/06/29 10:51:55 morsch
74Add some charmed and bottom baryons to the particle list (TDatabasePDG). This
75is needed by Hijing. Should be part of a future review of TDatabasePDG.
76
2f6413f8 77Revision 1.27 2000/06/21 17:40:15 fca
78Adding possibility to set ISTRA, PAI model
79
fd91b664 80Revision 1.26 2000/05/16 13:10:41 fca
81New method IsNewTrack and fix for a problem in Father-Daughter relations
82
a01a8b12 83Revision 1.25 2000/04/07 11:12:35 fca
84G4 compatibility changes
85
875c717b 86Revision 1.24 2000/02/28 21:03:57 fca
87Some additions to improve the compatibility with G4
88
229004c4 89Revision 1.23 2000/02/23 16:25:25 fca
90AliVMC and AliGeant3 classes introduced
91ReadEuclid moved from AliRun to AliModule
92
b13db077 93Revision 1.22 2000/01/18 15:40:13 morsch
94Interface to GEANT3 routines GFTMAT, GBRELM and GPRELM added
95Define geant particle type 51: Feedback Photon with Cherenkov photon properties.
96
db656dbe 97Revision 1.21 2000/01/17 19:41:17 fca
98Add SetERAN function
99
9e7a32d1 100Revision 1.20 2000/01/12 11:29:27 fca
101Close material file
102
345f4f8a 103Revision 1.19 1999/12/17 09:03:12 fca
104Introduce a names array
105
9006703b 106Revision 1.18 1999/11/26 16:55:39 fca
107Reimplement CurrentVolName() to avoid memory leaks
108
11c74eaf 109Revision 1.17 1999/11/03 16:58:28 fca
110Correct source of address violation in creating character string
111
176551d7 112Revision 1.16 1999/11/03 13:17:08 fca
113Have ProdProcess return const char*
114
6a935c13 115Revision 1.15 1999/10/26 06:04:50 fca
116Introduce TLorentzVector in AliMC::GetSecondary. Thanks to I.Hrivnacova
117
5d84196c 118Revision 1.14 1999/09/29 09:24:30 fca
119Introduction of the Copyright and cvs Log
120
4c039060 121*/
122
fe4da5cc 123///////////////////////////////////////////////////////////////////////////////
124// //
125// Interface Class to the Geant3.21 MonteCarlo //
126// //
127//Begin_Html
128/*
1439f98e 129<img src="picts/TGeant3Class.gif">
fe4da5cc 130*/
131//End_Html
132// //
133// //
134///////////////////////////////////////////////////////////////////////////////
135
c4af8412 136#include "ctype.h"
137
fe4da5cc 138#include "TROOT.h"
c4af8412 139#include "TDatabasePDG.h"
140#include "TLorentzVector.h"
27f3d82e 141#include "TArrayI.h"
c4af8412 142
fe4da5cc 143#include "THIGZ.h"
c4af8412 144#include "TGeant3.h"
145
fe4da5cc 146#include "AliCallf77.h"
5de05501 147#include "AliDecayer.h"
d89f641b 148#include "AliPDG.h"
65fb704d 149
fe4da5cc 150#ifndef WIN32
151# define gzebra gzebra_
152# define grfile grfile_
153# define gpcxyz gpcxyz_
154# define ggclos ggclos_
155# define glast glast_
156# define ginit ginit_
157# define gcinit gcinit_
158# define grun grun_
159# define gtrig gtrig_
160# define gtrigc gtrigc_
161# define gtrigi gtrigi_
162# define gwork gwork_
163# define gzinit gzinit_
164# define gfmate gfmate_
165# define gfpart gfpart_
166# define gftmed gftmed_
db656dbe 167# define gftmat gftmat_
fe4da5cc 168# define gmate gmate_
169# define gpart gpart_
170# define gsdk gsdk_
171# define gsmate gsmate_
172# define gsmixt gsmixt_
173# define gspart gspart_
174# define gstmed gstmed_
175# define gsckov gsckov_
176# define gstpar gstpar_
177# define gfkine gfkine_
178# define gfvert gfvert_
179# define gskine gskine_
180# define gsvert gsvert_
181# define gphysi gphysi_
182# define gdebug gdebug_
183# define gekbin gekbin_
184# define gfinds gfinds_
185# define gsking gsking_
186# define gskpho gskpho_
187# define gsstak gsstak_
188# define gsxyz gsxyz_
189# define gtrack gtrack_
190# define gtreve gtreve_
aee8290b 191# define gtreveroot gtreveroot_
fe4da5cc 192# define grndm grndm_
193# define grndmq grndmq_
194# define gdtom gdtom_
195# define glmoth glmoth_
196# define gmedia gmedia_
197# define gmtod gmtod_
198# define gsdvn gsdvn_
199# define gsdvn2 gsdvn2_
200# define gsdvs gsdvs_
201# define gsdvs2 gsdvs2_
202# define gsdvt gsdvt_
203# define gsdvt2 gsdvt2_
204# define gsord gsord_
205# define gspos gspos_
206# define gsposp gsposp_
207# define gsrotm gsrotm_
208# define gprotm gprotm_
209# define gsvolu gsvolu_
210# define gprint gprint_
211# define gdinit gdinit_
212# define gdopt gdopt_
213# define gdraw gdraw_
214# define gdrayt gdrayt_
215# define gdrawc gdrawc_
216# define gdrawx gdrawx_
217# define gdhead gdhead_
218# define gdwmn1 gdwmn1_
219# define gdwmn2 gdwmn2_
220# define gdwmn3 gdwmn3_
221# define gdxyz gdxyz_
222# define gdcxyz gdcxyz_
223# define gdman gdman_
224# define gdspec gdspec_
225# define gdtree gdtree_
226# define gdelet gdelet_
227# define gdclos gdclos_
228# define gdshow gdshow_
229# define gdopen gdopen_
230# define dzshow dzshow_
231# define gsatt gsatt_
232# define gfpara gfpara_
233# define gckpar gckpar_
234# define gckmat gckmat_
57993b1f 235# define glvolu glvolu_
fe4da5cc 236# define geditv geditv_
7ac3f11b 237# define mzdrop mzdrop_
6991054d 238
239# define ertrak ertrak_
240# define ertrgo ertrgo_
fe4da5cc 241
242# define setbomb setbomb_
243# define setclip setclip_
09298c03 244# define gcomad gcomad_
fe4da5cc 245
db656dbe 246# define gbrelm gbrelm_
247# define gprelm gprelm_
fe4da5cc 248#else
249# define gzebra GZEBRA
250# define grfile GRFILE
251# define gpcxyz GPCXYZ
252# define ggclos GGCLOS
253# define glast GLAST
254# define ginit GINIT
255# define gcinit GCINIT
256# define grun GRUN
257# define gtrig GTRIG
258# define gtrigc GTRIGC
259# define gtrigi GTRIGI
260# define gwork GWORK
261# define gzinit GZINIT
262# define gfmate GFMATE
263# define gfpart GFPART
264# define gftmed GFTMED
db656dbe 265# define gftmat GFTMAT
fe4da5cc 266# define gmate GMATE
267# define gpart GPART
268# define gsdk GSDK
269# define gsmate GSMATE
270# define gsmixt GSMIXT
271# define gspart GSPART
272# define gstmed GSTMED
273# define gsckov GSCKOV
274# define gstpar GSTPAR
275# define gfkine GFKINE
276# define gfvert GFVERT
277# define gskine GSKINE
278# define gsvert GSVERT
279# define gphysi GPHYSI
280# define gdebug GDEBUG
281# define gekbin GEKBIN
282# define gfinds GFINDS
283# define gsking GSKING
284# define gskpho GSKPHO
285# define gsstak GSSTAK
286# define gsxyz GSXYZ
287# define gtrack GTRACK
288# define gtreve GTREVE
aee8290b 289# define gtreveroot GTREVEROOT
fe4da5cc 290# define grndm GRNDM
291# define grndmq GRNDMQ
292# define gdtom GDTOM
293# define glmoth GLMOTH
294# define gmedia GMEDIA
295# define gmtod GMTOD
296# define gsdvn GSDVN
297# define gsdvn2 GSDVN2
298# define gsdvs GSDVS
299# define gsdvs2 GSDVS2
300# define gsdvt GSDVT
301# define gsdvt2 GSDVT2
302# define gsord GSORD
303# define gspos GSPOS
304# define gsposp GSPOSP
305# define gsrotm GSROTM
306# define gprotm GPROTM
307# define gsvolu GSVOLU
308# define gprint GPRINT
309# define gdinit GDINIT
310# define gdopt GDOPT
311# define gdraw GDRAW
312# define gdrayt GDRAYT
313# define gdrawc GDRAWC
314# define gdrawx GDRAWX
315# define gdhead GDHEAD
316# define gdwmn1 GDWMN1
317# define gdwmn2 GDWMN2
318# define gdwmn3 GDWMN3
319# define gdxyz GDXYZ
320# define gdcxyz GDCXYZ
321# define gdman GDMAN
322# define gdfspc GDFSPC
323# define gdspec GDSPEC
324# define gdtree GDTREE
325# define gdelet GDELET
326# define gdclos GDCLOS
327# define gdshow GDSHOW
328# define gdopen GDOPEN
329# define dzshow DZSHOW
330# define gsatt GSATT
331# define gfpara GFPARA
332# define gckpar GCKPAR
333# define gckmat GCKMAT
57993b1f 334# define glvolu GLVOLU
fe4da5cc 335# define geditv GEDITV
7ac3f11b 336# define mzdrop MZDROP
fe4da5cc 337
6991054d 338# define ertrak ERTRAK
339# define ertrgo ERTRGO
340
fe4da5cc 341# define setbomb SETBOMB
342# define setclip SETCLIP
09298c03 343# define gcomad GCOMAD
fe4da5cc 344
db656dbe 345# define gbrelm GBRELM
346# define gprelm GPRELM
347
fe4da5cc 348#endif
349
350//____________________________________________________________________________
351extern "C"
352{
353 //
354 // Prototypes for GEANT functions
355 //
356 void type_of_call gzebra(const int&);
357
358 void type_of_call gpcxyz();
359
360 void type_of_call ggclos();
361
362 void type_of_call glast();
363
364 void type_of_call ginit();
365
366 void type_of_call gcinit();
367
368 void type_of_call grun();
369
370 void type_of_call gtrig();
371
372 void type_of_call gtrigc();
373
374 void type_of_call gtrigi();
375
376 void type_of_call gwork(const int&);
377
378 void type_of_call gzinit();
379
380 void type_of_call gmate();
381
382 void type_of_call gpart();
383
384 void type_of_call gsdk(Int_t &, Float_t *, Int_t *);
385
386 void type_of_call gfkine(Int_t &, Float_t *, Float_t *, Int_t &,
387 Int_t &, Float_t *, Int_t &);
388
389 void type_of_call gfvert(Int_t &, Float_t *, Int_t &, Int_t &,
390 Float_t &, Float_t *, Int_t &);
391
392 void type_of_call gskine(Float_t *,Int_t &, Int_t &, Float_t *,
393 Int_t &, Int_t &);
394
395 void type_of_call gsvert(Float_t *,Int_t &, Int_t &, Float_t *,
396 Int_t &, Int_t &);
397
398 void type_of_call gphysi();
399
400 void type_of_call gdebug();
401
402 void type_of_call gekbin();
403
404 void type_of_call gfinds();
405
406 void type_of_call gsking(Int_t &);
407
408 void type_of_call gskpho(Int_t &);
409
410 void type_of_call gsstak(Int_t &);
411
412 void type_of_call gsxyz();
413
414 void type_of_call gtrack();
415
416 void type_of_call gtreve();
417
aee8290b 418 void type_of_call gtreveroot();
1578254f 419
65fb704d 420 void type_of_call grndm(Float_t *r, const Int_t &n)
421 {gMC->Rndm(r,n);}
fe4da5cc 422
423 void type_of_call grndmq(Int_t &, Int_t &, const Int_t &,
65fb704d 424 DEFCHARD DEFCHARL)
425 {/*printf("Dummy grndmq called\n");*/}
fe4da5cc 426
427 void type_of_call gdtom(Float_t *, Float_t *, Int_t &);
428
429 void type_of_call glmoth(DEFCHARD, Int_t &, Int_t &, Int_t *,
430 Int_t *, Int_t * DEFCHARL);
431
432 void type_of_call gmedia(Float_t *, Int_t &);
433
434 void type_of_call gmtod(Float_t *, Float_t *, Int_t &);
435
436 void type_of_call gsrotm(const Int_t &, const Float_t &, const Float_t &,
437 const Float_t &, const Float_t &, const Float_t &,
438 const Float_t &);
439
440 void type_of_call gprotm(const Int_t &);
441
442 void type_of_call grfile(const Int_t&, DEFCHARD,
443 DEFCHARD DEFCHARL DEFCHARL);
444
445 void type_of_call gfmate(const Int_t&, DEFCHARD, Float_t &, Float_t &,
446 Float_t &, Float_t &, Float_t &, Float_t *,
447 Int_t& DEFCHARL);
448
449 void type_of_call gfpart(const Int_t&, DEFCHARD, Int_t &, Float_t &,
450 Float_t &, Float_t &, Float_t *, Int_t & DEFCHARL);
451
452 void type_of_call gftmed(const Int_t&, DEFCHARD, Int_t &, Int_t &, Int_t &,
453 Float_t &, Float_t &, Float_t &, Float_t &,
454 Float_t &, Float_t &, Float_t *, Int_t * DEFCHARL);
455
db656dbe 456 void type_of_call gftmat(const Int_t&, const Int_t&, DEFCHARD, const Int_t&,
457 Float_t*, Float_t*
458 ,Float_t *, Int_t & DEFCHARL);
459
fe4da5cc 460 void type_of_call gsmate(const Int_t&, DEFCHARD, Float_t &, Float_t &,
461 Float_t &, Float_t &, Float_t &, Float_t *,
462 Int_t & DEFCHARL);
463
464 void type_of_call gsmixt(const Int_t&, DEFCHARD, Float_t *, Float_t *,
465 Float_t &, Int_t &, Float_t * DEFCHARL);
466
467 void type_of_call gspart(const Int_t&, DEFCHARD, Int_t &, Float_t &,
468 Float_t &, Float_t &, Float_t *, Int_t & DEFCHARL);
469
470
471 void type_of_call gstmed(const Int_t&, DEFCHARD, Int_t &, Int_t &, Int_t &,
472 Float_t &, Float_t &, Float_t &, Float_t &,
473 Float_t &, Float_t &, Float_t *, Int_t & DEFCHARL);
474
475 void type_of_call gsckov(Int_t &itmed, Int_t &npckov, Float_t *ppckov,
476 Float_t *absco, Float_t *effic, Float_t *rindex);
477 void type_of_call gstpar(const Int_t&, DEFCHARD, Float_t & DEFCHARL);
478
479 void type_of_call gsdvn(DEFCHARD,DEFCHARD, Int_t &, Int_t &
480 DEFCHARL DEFCHARL);
481
482 void type_of_call gsdvn2(DEFCHARD,DEFCHARD, Int_t &, Int_t &, Float_t &,
483 Int_t & DEFCHARL DEFCHARL);
484
485 void type_of_call gsdvs(DEFCHARD,DEFCHARD, Float_t &, Int_t &, Int_t &
486 DEFCHARL DEFCHARL);
487
488 void type_of_call gsdvs2(DEFCHARD,DEFCHARD, Float_t &, Int_t &, Float_t &,
489 Int_t & DEFCHARL DEFCHARL);
490
491 void type_of_call gsdvt(DEFCHARD,DEFCHARD, Float_t &, Int_t &, Int_t &,
492 Int_t & DEFCHARL DEFCHARL);
493
494 void type_of_call gsdvt2(DEFCHARD,DEFCHARD, Float_t &, Int_t &, Float_t&,
495 Int_t &, Int_t & DEFCHARL DEFCHARL);
496
497 void type_of_call gsord(DEFCHARD, Int_t & DEFCHARL);
498
499 void type_of_call gspos(DEFCHARD, Int_t &, DEFCHARD, Float_t &, Float_t &,
500 Float_t &, Int_t &, DEFCHARD DEFCHARL DEFCHARL
501 DEFCHARL);
502
503 void type_of_call gsposp(DEFCHARD, Int_t &, DEFCHARD, Float_t &, Float_t &,
504 Float_t &, Int_t &, DEFCHARD,
505 Float_t *, Int_t & DEFCHARL DEFCHARL DEFCHARL);
506
507 void type_of_call gsvolu(DEFCHARD, DEFCHARD, Int_t &, Float_t *, Int_t &,
508 Int_t & DEFCHARL DEFCHARL);
509
510 void type_of_call gsatt(DEFCHARD, DEFCHARD, Int_t & DEFCHARL DEFCHARL);
511
512 void type_of_call gfpara(DEFCHARD , Int_t&, Int_t&, Int_t&, Int_t&, Float_t*,
513 Float_t* DEFCHARL);
514
515 void type_of_call gckpar(Int_t&, Int_t&, Float_t*);
516
517 void type_of_call gckmat(Int_t&, DEFCHARD DEFCHARL);
518
57993b1f 519 void type_of_call glvolu(Int_t&, Int_t*, Int_t*, Int_t&);
520
fe4da5cc 521 void type_of_call gprint(DEFCHARD,const int& DEFCHARL);
522
523 void type_of_call gdinit();
524
525 void type_of_call gdopt(DEFCHARD,DEFCHARD DEFCHARL DEFCHARL);
526
527 void type_of_call gdraw(DEFCHARD,Float_t &,Float_t &, Float_t &,Float_t &,
528 Float_t &, Float_t &, Float_t & DEFCHARL);
529 void type_of_call gdrayt(DEFCHARD,Float_t &,Float_t &, Float_t &,Float_t &,
530 Float_t &, Float_t &, Float_t & DEFCHARL);
531 void type_of_call gdrawc(DEFCHARD,Int_t &, Float_t &, Float_t &, Float_t &,
532 Float_t &, Float_t & DEFCHARL);
533 void type_of_call gdrawx(DEFCHARD,Float_t &, Float_t &, Float_t &, Float_t &,
534 Float_t &, Float_t &, Float_t &, Float_t &,
535 Float_t & DEFCHARL);
536 void type_of_call gdhead(Int_t &,DEFCHARD, Float_t & DEFCHARL);
537 void type_of_call gdxyz(Int_t &);
538 void type_of_call gdcxyz();
539 void type_of_call gdman(Float_t &, Float_t &);
540 void type_of_call gdwmn1(Float_t &, Float_t &);
541 void type_of_call gdwmn2(Float_t &, Float_t &);
542 void type_of_call gdwmn3(Float_t &, Float_t &);
543 void type_of_call gdspec(DEFCHARD DEFCHARL);
544 void type_of_call gdfspc(DEFCHARD, Int_t &, Int_t & DEFCHARL) {;}
545 void type_of_call gdtree(DEFCHARD, Int_t &, Int_t & DEFCHARL);
546
547 void type_of_call gdopen(Int_t &);
548 void type_of_call gdclos();
549 void type_of_call gdelet(Int_t &);
550 void type_of_call gdshow(Int_t &);
551 void type_of_call geditv(Int_t &) {;}
552
553
554 void type_of_call dzshow(DEFCHARD,const int&,const int&,DEFCHARD,const int&,
555 const int&, const int&, const int& DEFCHARL
556 DEFCHARL);
557
7ac3f11b 558 void type_of_call mzdrop(Int_t&, Int_t&, DEFCHARD DEFCHARL);
559
fe4da5cc 560 void type_of_call setbomb(Float_t &);
561 void type_of_call setclip(DEFCHARD, Float_t &,Float_t &,Float_t &,Float_t &,
562 Float_t &, Float_t & DEFCHARL);
09298c03 563 void type_of_call gcomad(DEFCHARD, Int_t*& DEFCHARL);
6991054d 564
565 void type_of_call ertrak(const Float_t *const x1, const Float_t *const p1,
566 const Float_t *x2, const Float_t *p2,
567 const Int_t &ipa, DEFCHARD DEFCHARL);
568
569 void type_of_call ertrgo();
db656dbe 570
571 float type_of_call gbrelm(const Float_t &z, const Float_t& t, const Float_t& cut);
572 float type_of_call gprelm(const Float_t &z, const Float_t& t, const Float_t& cut);
fe4da5cc 573}
574
575//
576// Geant3 global pointer
577//
ef42d733 578static const Int_t kDefSize = 600;
fe4da5cc 579
580ClassImp(TGeant3)
581
582//____________________________________________________________________________
1578254f 583TGeant3::TGeant3()
fe4da5cc 584{
585 //
586 // Default constructor
587 //
588}
589
590//____________________________________________________________________________
591TGeant3::TGeant3(const char *title, Int_t nwgeant)
592 :AliMC("TGeant3",title)
593{
594 //
595 // Standard constructor for TGeant3 with ZEBRA initialisation
596 //
597
598 if(nwgeant) {
599 gzebra(nwgeant);
600 ginit();
601 gzinit();
602 } else {
603 gcinit();
604 }
605 //
606 // Load Address of Geant3 commons
607 LoadAddress();
1578254f 608 //
609 // Zero number of particles
610 fNPDGCodes=0;
5de05501 611 fDecayer=0;
fe4da5cc 612}
613
614//____________________________________________________________________________
615Int_t TGeant3::CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens,
616 Float_t &radl, Float_t &absl) const
617{
618 //
619 // Return the parameters of the current material during transport
620 //
621 z = fGcmate->z;
622 a = fGcmate->a;
623 dens = fGcmate->dens;
624 radl = fGcmate->radl;
625 absl = fGcmate->absl;
626 return 1; //this could be the number of elements in mixture
627}
628
629//____________________________________________________________________________
630void TGeant3::DefaultRange()
631{
632 //
633 // Set range of current drawing pad to 20x20 cm
634 //
8918e700 635 if (!gHigz) {
ef42d733 636 new THIGZ(kDefSize);
fe4da5cc 637 gdinit();
638 }
8918e700 639 gHigz->Range(0,0,20,20);
fe4da5cc 640}
641
642//____________________________________________________________________________
643void TGeant3::InitHIGZ()
644{
645 //
646 // Initialise HIGZ
647 //
8918e700 648 if (!gHigz) {
ef42d733 649 new THIGZ(kDefSize);
fe4da5cc 650 gdinit();
651 }
652}
653
654//____________________________________________________________________________
655void TGeant3::LoadAddress()
656{
657 //
658 // Assigns the address of the GEANT common blocks to the structures
659 // that allow their access from C++
660 //
09298c03 661 Int_t *addr;
662 gcomad(PASSCHARD("QUEST"), (int*&) fQuest PASSCHARL("QUEST"));
663 gcomad(PASSCHARD("GCBANK"),(int*&) fGcbank PASSCHARL("GCBANK"));
664 gcomad(PASSCHARD("GCLINK"),(int*&) fGclink PASSCHARL("GCLINK"));
665 gcomad(PASSCHARD("GCCUTS"),(int*&) fGccuts PASSCHARL("GCCUTS"));
666 gcomad(PASSCHARD("GCMULO"),(int*&) fGcmulo PASSCHARL("GCMULO"));
667 gcomad(PASSCHARD("GCFLAG"),(int*&) fGcflag PASSCHARL("GCFLAG"));
668 gcomad(PASSCHARD("GCKINE"),(int*&) fGckine PASSCHARL("GCKINE"));
669 gcomad(PASSCHARD("GCKING"),(int*&) fGcking PASSCHARL("GCKING"));
670 gcomad(PASSCHARD("GCKIN2"),(int*&) fGckin2 PASSCHARL("GCKIN2"));
671 gcomad(PASSCHARD("GCKIN3"),(int*&) fGckin3 PASSCHARL("GCKIN3"));
672 gcomad(PASSCHARD("GCMATE"),(int*&) fGcmate PASSCHARL("GCMATE"));
673 gcomad(PASSCHARD("GCTMED"),(int*&) fGctmed PASSCHARL("GCTMED"));
674 gcomad(PASSCHARD("GCTRAK"),(int*&) fGctrak PASSCHARL("GCTRAK"));
675 gcomad(PASSCHARD("GCTPOL"),(int*&) fGctpol PASSCHARL("GCTPOL"));
676 gcomad(PASSCHARD("GCVOLU"),(int*&) fGcvolu PASSCHARL("GCVOLU"));
677 gcomad(PASSCHARD("GCNUM"), (int*&) fGcnum PASSCHARL("GCNUM"));
678 gcomad(PASSCHARD("GCSETS"),(int*&) fGcsets PASSCHARL("GCSETS"));
679 gcomad(PASSCHARD("GCPHYS"),(int*&) fGcphys PASSCHARL("GCPHYS"));
680 gcomad(PASSCHARD("GCPHLT"),(int*&) fGcphlt PASSCHARL("GCPHLT"));
681 gcomad(PASSCHARD("GCOPTI"),(int*&) fGcopti PASSCHARL("GCOPTI"));
682 gcomad(PASSCHARD("GCTLIT"),(int*&) fGctlit PASSCHARL("GCTLIT"));
683 gcomad(PASSCHARD("GCVDMA"),(int*&) fGcvdma PASSCHARL("GCVDMA"));
684
685 // Commons for GEANE
686 gcomad(PASSCHARD("ERTRIO"),(int*&) fErtrio PASSCHARL("ERTRIO"));
687 gcomad(PASSCHARD("EROPTS"),(int*&) fEropts PASSCHARL("EROPTS"));
688 gcomad(PASSCHARD("EROPTC"),(int*&) fEroptc PASSCHARL("EROPTC"));
689 gcomad(PASSCHARD("ERWORK"),(int*&) fErwork PASSCHARL("ERWORK"));
690
691 // Variables for ZEBRA store
692 gcomad(PASSCHARD("IQ"), addr PASSCHARL("IQ"));
693 fZiq = addr;
694 gcomad(PASSCHARD("LQ"), addr PASSCHARL("LQ"));
695 fZlq = addr;
696 fZq = (float*)fZiq;
fe4da5cc 697}
698
699//_____________________________________________________________________________
700void TGeant3::GeomIter()
701{
702 //
703 // Geometry iterator for moving upward in the geometry tree
704 // Initialise the iterator
705 //
706 fNextVol=fGcvolu->nlevel;
707}
708
b13db077 709//____________________________________________________________________________
710void TGeant3::FinishGeometry()
711{
712 //Close the geometry structure
713 Ggclos();
714}
715
fe4da5cc 716//____________________________________________________________________________
717Int_t TGeant3::NextVolUp(Text_t *name, Int_t &copy)
718{
719 //
720 // Geometry iterator for moving upward in the geometry tree
721 // Return next volume up
722 //
723 Int_t i, gname;
724 fNextVol--;
725 if(fNextVol>=0) {
726 gname=fGcvolu->names[fNextVol];
fe4da5cc 727 copy=fGcvolu->number[fNextVol];
728 i=fGcvolu->lvolum[fNextVol];
9006703b 729 name = fVolNames[i-1];
fe4da5cc 730 if(gname == fZiq[fGclink->jvolum+i]) return i;
731 else printf("GeomTree: Volume %s not found in bank\n",name);
732 }
733 return 0;
734}
735
875c717b 736//_____________________________________________________________________________
737void TGeant3::BuildPhysics()
738{
739 Gphysi();
740}
741
fe4da5cc 742//_____________________________________________________________________________
0a6d8768 743Int_t TGeant3::CurrentVolID(Int_t &copy) const
fe4da5cc 744{
745 //
0a6d8768 746 // Returns the current volume ID and copy number
fe4da5cc 747 //
748 Int_t i, gname;
749 if( (i=fGcvolu->nlevel-1) < 0 ) {
0a6d8768 750 Warning("CurrentVolID","Stack depth only %d\n",fGcvolu->nlevel);
fe4da5cc 751 } else {
752 gname=fGcvolu->names[i];
fe4da5cc 753 copy=fGcvolu->number[i];
754 i=fGcvolu->lvolum[i];
755 if(gname == fZiq[fGclink->jvolum+i]) return i;
0a6d8768 756 else Warning("CurrentVolID","Volume %4s not found\n",(char*)&gname);
fe4da5cc 757 }
758 return 0;
759}
760
761//_____________________________________________________________________________
0a6d8768 762Int_t TGeant3::CurrentVolOffID(Int_t off, Int_t &copy) const
fe4da5cc 763{
764 //
765 // Return the current volume "off" upward in the geometrical tree
0a6d8768 766 // ID and copy number
fe4da5cc 767 //
768 Int_t i, gname;
769 if( (i=fGcvolu->nlevel-off-1) < 0 ) {
0a6d8768 770 Warning("CurrentVolOffID","Offset requested %d but stack depth %d\n",
771 off,fGcvolu->nlevel);
fe4da5cc 772 } else {
773 gname=fGcvolu->names[i];
fe4da5cc 774 copy=fGcvolu->number[i];
775 i=fGcvolu->lvolum[i];
776 if(gname == fZiq[fGclink->jvolum+i]) return i;
0a6d8768 777 else Warning("CurrentVolOffID","Volume %4s not found\n",(char*)&gname);
778 }
779 return 0;
780}
781
782//_____________________________________________________________________________
783const char* TGeant3::CurrentVolName() const
784{
785 //
786 // Returns the current volume name
787 //
788 Int_t i, gname;
0a6d8768 789 if( (i=fGcvolu->nlevel-1) < 0 ) {
790 Warning("CurrentVolName","Stack depth %d\n",fGcvolu->nlevel);
791 } else {
792 gname=fGcvolu->names[i];
0a6d8768 793 i=fGcvolu->lvolum[i];
9006703b 794 if(gname == fZiq[fGclink->jvolum+i]) return fVolNames[i-1];
795 else Warning("CurrentVolName","Volume %4s not found\n",(char*) &gname);
0a6d8768 796 }
797 return 0;
798}
799
800//_____________________________________________________________________________
801const char* TGeant3::CurrentVolOffName(Int_t off) const
802{
803 //
804 // Return the current volume "off" upward in the geometrical tree
805 // ID, name and copy number
806 // if name=0 no name is returned
807 //
808 Int_t i, gname;
0a6d8768 809 if( (i=fGcvolu->nlevel-off-1) < 0 ) {
810 Warning("CurrentVolOffName",
811 "Offset requested %d but stack depth %d\n",off,fGcvolu->nlevel);
812 } else {
813 gname=fGcvolu->names[i];
0a6d8768 814 i=fGcvolu->lvolum[i];
9006703b 815 if(gname == fZiq[fGclink->jvolum+i]) return fVolNames[i-1];
816 else Warning("CurrentVolOffName","Volume %4s not found\n",(char*)&gname);
fe4da5cc 817 }
818 return 0;
819}
820
1578254f 821//_____________________________________________________________________________
822Int_t TGeant3::IdFromPDG(Int_t pdg) const
823{
824 //
825 // Return Geant3 code from PDG and pseudo ENDF code
ef42d733 826 //
1578254f 827 for(Int_t i=0;i<fNPDGCodes;++i)
828 if(pdg==fPDGCode[i]) return i;
829 return -1;
830}
831
832//_____________________________________________________________________________
833Int_t TGeant3::PDGFromId(Int_t id) const
834{
ef42d733 835 //
836 // Return PDG code and pseudo ENDF code from Geant3 code
837 //
1578254f 838 if(id>0 && id<fNPDGCodes) return fPDGCode[id];
839 else return -1;
840}
841
842//_____________________________________________________________________________
843void TGeant3::DefineParticles()
844{
845 //
846 // Define standard Geant 3 particles
847 Gpart();
848 //
849 // Load standard numbers for GEANT particles and PDG conversion
850 fPDGCode[fNPDGCodes++]=-99; // 0 = unused location
851 fPDGCode[fNPDGCodes++]=22; // 1 = photon
852 fPDGCode[fNPDGCodes++]=-11; // 2 = positron
853 fPDGCode[fNPDGCodes++]=11; // 3 = electron
854 fPDGCode[fNPDGCodes++]=12; // 4 = neutrino e
855 fPDGCode[fNPDGCodes++]=-13; // 5 = muon +
856 fPDGCode[fNPDGCodes++]=13; // 6 = muon -
857 fPDGCode[fNPDGCodes++]=111; // 7 = pi0
858 fPDGCode[fNPDGCodes++]=211; // 8 = pi+
859 fPDGCode[fNPDGCodes++]=-211; // 9 = pi-
860 fPDGCode[fNPDGCodes++]=130; // 10 = Kaon Long
861 fPDGCode[fNPDGCodes++]=321; // 11 = Kaon +
862 fPDGCode[fNPDGCodes++]=-321; // 12 = Kaon -
863 fPDGCode[fNPDGCodes++]=2112; // 13 = Neutron
864 fPDGCode[fNPDGCodes++]=2212; // 14 = Proton
865 fPDGCode[fNPDGCodes++]=-2212; // 15 = Anti Proton
866 fPDGCode[fNPDGCodes++]=310; // 16 = Kaon Short
867 fPDGCode[fNPDGCodes++]=221; // 17 = Eta
868 fPDGCode[fNPDGCodes++]=3122; // 18 = Lambda
869 fPDGCode[fNPDGCodes++]=3222; // 19 = Sigma +
870 fPDGCode[fNPDGCodes++]=3212; // 20 = Sigma 0
871 fPDGCode[fNPDGCodes++]=3112; // 21 = Sigma -
872 fPDGCode[fNPDGCodes++]=3322; // 22 = Xi0
873 fPDGCode[fNPDGCodes++]=3312; // 23 = Xi-
874 fPDGCode[fNPDGCodes++]=3334; // 24 = Omega-
875 fPDGCode[fNPDGCodes++]=-2112; // 25 = Anti Proton
876 fPDGCode[fNPDGCodes++]=-3122; // 26 = Anti Proton
877 fPDGCode[fNPDGCodes++]=-3222; // 27 = Anti Sigma -
878 fPDGCode[fNPDGCodes++]=-3212; // 28 = Anti Sigma 0
879 fPDGCode[fNPDGCodes++]=-3112; // 29 = Anti Sigma 0
880 fPDGCode[fNPDGCodes++]=-3322; // 30 = Anti Xi 0
881 fPDGCode[fNPDGCodes++]=-3312; // 31 = Anti Xi +
882 fPDGCode[fNPDGCodes++]=-3334; // 32 = Anti Omega +
883
884
885 Int_t mode[6];
886 Int_t kz, ipa;
887 Float_t bratio[6];
888
889 /* --- Define additional particles */
890 Gspart(33, "OMEGA(782)", 3, 0.782, 0., 7.836e-23);
891 fPDGCode[fNPDGCodes++]=223; // 33 = Omega(782)
892
893 Gspart(34, "PHI(1020)", 3, 1.019, 0., 1.486e-22);
894 fPDGCode[fNPDGCodes++]=333; // 34 = PHI (1020)
895
896 Gspart(35, "D +", 4, 1.87, 1., 1.066e-12);
897 fPDGCode[fNPDGCodes++]=411; // 35 = D+
898
899 Gspart(36, "D -", 4, 1.87, -1., 1.066e-12);
900 fPDGCode[fNPDGCodes++]=-411; // 36 = D-
901
902 Gspart(37, "D 0", 3, 1.865, 0., 4.2e-13);
903 fPDGCode[fNPDGCodes++]=421; // 37 = D0
904
905 Gspart(38, "ANTI D 0", 3, 1.865, 0., 4.2e-13);
906 fPDGCode[fNPDGCodes++]=-421; // 38 = D0 bar
907
908 fPDGCode[fNPDGCodes++]=-99; // 39 = unassigned
909
910 fPDGCode[fNPDGCodes++]=-99; // 40 = unassigned
911
912 fPDGCode[fNPDGCodes++]=-99; // 41 = unassigned
913
914 Gspart(42, "RHO +", 4, 0.768, 1., 4.353e-24);
915 fPDGCode[fNPDGCodes++]=213; // 42 = RHO+
916
917 Gspart(43, "RHO -", 4, 0.768, -1., 4.353e-24);
5f73d6ac 918 fPDGCode[fNPDGCodes++]=-213; // 43 = RHO-
1578254f 919
920 Gspart(44, "RHO 0", 3, 0.768, 0., 4.353e-24);
5f73d6ac 921 fPDGCode[fNPDGCodes++]=113; // 44 = RHO0
1578254f 922
923 //
924 // Use ENDF-6 mapping for ions = 10000*z+10*a+iso
925 // and add 1 000 000
926 // and numbers above 5 000 000 for special applications
927 //
928
d89f641b 929 const Int_t kion=10000000;
66d6a136 930
d89f641b 931 const Int_t kspe=50000000;
284796db 932
2f6413f8 933//
284796db 934// Ions
935
1578254f 936 fPDGCode[fNPDGCodes++]=kion+10020; // 45 = Deuteron
937
1578254f 938 fPDGCode[fNPDGCodes++]=kion+10030; // 46 = Triton
939
1578254f 940 fPDGCode[fNPDGCodes++]=kion+20040; // 47 = Alpha
941
d89f641b 942 fPDGCode[fNPDGCodes++]=0; // 48 = geantino mapped to rootino
1578254f 943
1578254f 944 fPDGCode[fNPDGCodes++]=kion+20030; // 49 = HE3
945
d89f641b 946 fPDGCode[fNPDGCodes++]=kspe+50; // 50 = Cherenkov
284796db 947// special
db656dbe 948 Gspart(51, "FeedbackPhoton", 7, 0., 0.,1.e20 );
d89f641b 949 fPDGCode[fNPDGCodes++]=kspe+51; // 51 = FeedbackPhoton
284796db 950//
5f73d6ac 951 Gspart(52, "Lambda_c+", 4, 2.2849, +1., 2.06e-13);
d89f641b 952 fPDGCode[fNPDGCodes++]=4122; //52 = Lambda_c+
5f73d6ac 953
954 Gspart(53, "Lambda_c-", 4, 2.2849, -1., 2.06e-13);
d89f641b 955 fPDGCode[fNPDGCodes++]=-4122; //53 = Lambda_c-
5f73d6ac 956
957 Gspart(54, "D_s+", 4, 1.9685, +1., 4.67e-13);
d89f641b 958 fPDGCode[fNPDGCodes++]=431; //54 = D_s+
5f73d6ac 959
960 Gspart(55, "D_s-", 4, 1.9685, -1., 4.67e-13);
d89f641b 961 fPDGCode[fNPDGCodes++]=-431; //55 = D_s-
5f73d6ac 962
963 Gspart(56, "Tau+", 5, 1.77705, +1., 2.9e-13);
d89f641b 964 fPDGCode[fNPDGCodes++]=15; //56 = Tau+
5f73d6ac 965
966 Gspart(57, "Tau-", 5, 1.77705, -1., 2.9e-13);
d89f641b 967 fPDGCode[fNPDGCodes++]=-15; //57 = Tau-
5f73d6ac 968
969 Gspart(58, "B0", 3, 5.2792, +0., 1.56e-12);
d89f641b 970 fPDGCode[fNPDGCodes++]=511; //58 = B0
5f73d6ac 971
972 Gspart(59, "B0 bar", 3, 5.2792, -0., 1.56e-12);
d89f641b 973 fPDGCode[fNPDGCodes++]=-511; //58 = B0bar
5f73d6ac 974
975 Gspart(60, "B+", 4, 5.2789, +1., 1.65e-12);
d89f641b 976 fPDGCode[fNPDGCodes++]=521; //60 = B+
5f73d6ac 977
978 Gspart(61, "B-", 4, 5.2789, -1., 1.65e-12);
d89f641b 979 fPDGCode[fNPDGCodes++]=-521; //61 = B-
5f73d6ac 980
981 Gspart(62, "Bs", 3, 5.3693, +0., 1.54e-12);
d89f641b 982 fPDGCode[fNPDGCodes++]=521; //62 = B_s
5f73d6ac 983
984 Gspart(63, "Bs bar", 3, 5.3693, -0., 1.54e-12);
d89f641b 985 fPDGCode[fNPDGCodes++]=-521; //63 = B_s bar
5f73d6ac 986
987 Gspart(64, "Lambda_b", 3, 5.624, +0., 1.24e-12);
d89f641b 988 fPDGCode[fNPDGCodes++]=5122; //64 = Lambda_b
5f73d6ac 989
990 Gspart(65, "Lambda_b bar", 3, 5.624, -0., 1.24e-12);
d89f641b 991 fPDGCode[fNPDGCodes++]=-5122; //65 = Lambda_b bar
5f73d6ac 992
993 Gspart(66, "J/Psi", 3.09688, 3, 0., 0.);
d89f641b 994 fPDGCode[fNPDGCodes++]=443; // 66 = J/Psi
5f73d6ac 995
996 Gspart(67, "Psi Prime", 3, 3.686, 0., 0.);
d89f641b 997 fPDGCode[fNPDGCodes++]=20443; // 67 = Psi prime
5f73d6ac 998
999 Gspart(68, "Upsilon(1S)", 9.46037, 3, 0., 0.);
d89f641b 1000 fPDGCode[fNPDGCodes++]=553; // 68 = Upsilon(1S)
5f73d6ac 1001
1002 Gspart(69, "Upsilon(2S)", 10.0233, 3, 0., 0.);
284796db 1003 fPDGCode[fNPDGCodes++]=20553; // 69 = Upsilon(2S)
5f73d6ac 1004
1005 Gspart(70, "Upsilon(3S)", 10.3553, 3, 0., 0.);
284796db 1006 fPDGCode[fNPDGCodes++]=30553; // 70 = Upsilon(3S)
db656dbe 1007
1578254f 1008/* --- Define additional decay modes --- */
1009/* --- omega(783) --- */
1010 for (kz = 0; kz < 6; ++kz) {
1011 bratio[kz] = 0.;
1012 mode[kz] = 0;
1013 }
1014 ipa = 33;
1015 bratio[0] = 89.;
1016 bratio[1] = 8.5;
1017 bratio[2] = 2.5;
1018 mode[0] = 70809;
1019 mode[1] = 107;
1020 mode[2] = 908;
1021 Gsdk(ipa, bratio, mode);
1022/* --- phi(1020) --- */
1023 for (kz = 0; kz < 6; ++kz) {
1024 bratio[kz] = 0.;
1025 mode[kz] = 0;
1026 }
1027 ipa = 34;
1028 bratio[0] = 49.;
1029 bratio[1] = 34.4;
1030 bratio[2] = 12.9;
1031 bratio[3] = 2.4;
1032 bratio[4] = 1.3;
1033 mode[0] = 1112;
1034 mode[1] = 1610;
1035 mode[2] = 4407;
1036 mode[3] = 90807;
1037 mode[4] = 1701;
1038 Gsdk(ipa, bratio, mode);
1039/* --- D+ --- */
5f73d6ac 1040 /*
1578254f 1041 for (kz = 0; kz < 6; ++kz) {
1042 bratio[kz] = 0.;
1043 mode[kz] = 0;
1044 }
1045 ipa = 35;
1046 bratio[0] = 25.;
1047 bratio[1] = 25.;
1048 bratio[2] = 25.;
1049 bratio[3] = 25.;
1050 mode[0] = 80809;
1051 mode[1] = 120808;
1052 mode[2] = 111208;
1053 mode[3] = 110809;
1054 Gsdk(ipa, bratio, mode);
3bf2f358 1055 */
1578254f 1056/* --- D- --- */
5f73d6ac 1057 /*
1578254f 1058 for (kz = 0; kz < 6; ++kz) {
1059 bratio[kz] = 0.;
1060 mode[kz] = 0;
1061 }
1062 ipa = 36;
1063 bratio[0] = 25.;
1064 bratio[1] = 25.;
1065 bratio[2] = 25.;
1066 bratio[3] = 25.;
1067 mode[0] = 90908;
1068 mode[1] = 110909;
1069 mode[2] = 121109;
1070 mode[3] = 120908;
1071 Gsdk(ipa, bratio, mode);
5f73d6ac 1072 */
1578254f 1073/* --- D0 --- */
5f73d6ac 1074 /*
1578254f 1075 for (kz = 0; kz < 6; ++kz) {
1076 bratio[kz] = 0.;
1077 mode[kz] = 0;
1078 }
1079 ipa = 37;
1080 bratio[0] = 33.;
1081 bratio[1] = 33.;
1082 bratio[2] = 33.;
1083 mode[0] = 809;
1084 mode[1] = 1208;
1085 mode[2] = 1112;
1086 Gsdk(ipa, bratio, mode);
5f73d6ac 1087 */
1578254f 1088/* --- Anti D0 --- */
5f73d6ac 1089 /*
1578254f 1090 for (kz = 0; kz < 6; ++kz) {
1091 bratio[kz] = 0.;
1092 mode[kz] = 0;
1093 }
1094 ipa = 38;
1095 bratio[0] = 33.;
1096 bratio[1] = 33.;
1097 bratio[2] = 33.;
1098 mode[0] = 809;
1099 mode[1] = 1109;
1100 mode[2] = 1112;
1101 Gsdk(ipa, bratio, mode);
5f73d6ac 1102 */
1578254f 1103/* --- rho+ --- */
1104 for (kz = 0; kz < 6; ++kz) {
1105 bratio[kz] = 0.;
1106 mode[kz] = 0;
1107 }
1108 ipa = 42;
1109 bratio[0] = 100.;
1110 mode[0] = 807;
1111 Gsdk(ipa, bratio, mode);
1112/* --- rho- --- */
1113 for (kz = 0; kz < 6; ++kz) {
1114 bratio[kz] = 0.;
1115 mode[kz] = 0;
1116 }
1117 ipa = 43;
1118 bratio[0] = 100.;
1119 mode[0] = 907;
1120 Gsdk(ipa, bratio, mode);
1121/* --- rho0 --- */
1122 for (kz = 0; kz < 6; ++kz) {
1123 bratio[kz] = 0.;
1124 mode[kz] = 0;
1125 }
1126 ipa = 44;
1127 bratio[0] = 100.;
1128 mode[0] = 707;
1129 Gsdk(ipa, bratio, mode);
1130 /*
1131// --- jpsi ---
1132 for (kz = 0; kz < 6; ++kz) {
1133 bratio[kz] = 0.;
1134 mode[kz] = 0;
1135 }
1136 ipa = 113;
1137 bratio[0] = 50.;
1138 bratio[1] = 50.;
1139 mode[0] = 506;
1140 mode[1] = 605;
1141 Gsdk(ipa, bratio, mode);
1142// --- upsilon ---
1143 ipa = 114;
1144 Gsdk(ipa, bratio, mode);
1145// --- phi ---
1146 ipa = 115;
1147 Gsdk(ipa, bratio, mode);
1148 */
d89f641b 1149//
d89f641b 1150 AliPDG::AddParticlesToPdgDataBase();
1578254f 1151}
1152
fe4da5cc 1153//_____________________________________________________________________________
229004c4 1154Int_t TGeant3::VolId(const Text_t *name) const
fe4da5cc 1155{
1156 //
1157 // Return the unique numeric identifier for volume name
1158 //
1159 Int_t gname, i;
1160 strncpy((char *) &gname, name, 4);
1161 for(i=1; i<=fGcnum->nvolum; i++)
1162 if(gname == fZiq[fGclink->jvolum+i]) return i;
1163 printf("VolId: Volume %s not found\n",name);
1164 return 0;
1165}
1166
1167//_____________________________________________________________________________
1f97a957 1168Int_t TGeant3::NofVolumes() const
fe4da5cc 1169{
1170 //
1171 // Return total number of volumes in the geometry
1172 //
1173 return fGcnum->nvolum;
1174}
1175
8409d8c9 1176//_____________________________________________________________________________
1177Int_t TGeant3::VolId2Mate(Int_t id) const
1178{
1179 //
1180 // Return material number for a given volume id
1181 //
1182 if(id<1 || id > fGcnum->nvolum || fGclink->jvolum<=0)
1183 return 0;
1184 else {
1185 Int_t jvo = fZlq[fGclink->jvolum-id];
1186 return Int_t(fZq[jvo+4]);
1187 }
1188}
1189
fe4da5cc 1190//_____________________________________________________________________________
099385a4 1191const char* TGeant3::VolName(Int_t id) const
fe4da5cc 1192{
1193 //
1194 // Return the volume name given the volume identifier
1195 //
fe4da5cc 1196 if(id<1 || id > fGcnum->nvolum || fGclink->jvolum<=0)
8918e700 1197 return fVolNames[fGcnum->nvolum];
fe4da5cc 1198 else
9006703b 1199 return fVolNames[id-1];
fe4da5cc 1200}
1201
229004c4 1202//_____________________________________________________________________________
1203void TGeant3::SetCut(const char* cutName, Float_t cutValue)
1204{
ef42d733 1205 //
1206 // Set transport cuts for particles
1207 //
229004c4 1208 if(!strcmp(cutName,"CUTGAM"))
1209 fGccuts->cutgam=cutValue;
1210 else if(!strcmp(cutName,"CUTGAM"))
1211 fGccuts->cutele=cutValue;
1212 else if(!strcmp(cutName,"CUTELE"))
1213 fGccuts->cutneu=cutValue;
1214 else if(!strcmp(cutName,"CUTHAD"))
1215 fGccuts->cuthad=cutValue;
1216 else if(!strcmp(cutName,"CUTMUO"))
1217 fGccuts->cutmuo=cutValue;
1218 else if(!strcmp(cutName,"BCUTE"))
1219 fGccuts->bcute=cutValue;
1220 else if(!strcmp(cutName,"BCUTM"))
1221 fGccuts->bcutm=cutValue;
1222 else if(!strcmp(cutName,"DCUTE"))
1223 fGccuts->dcute=cutValue;
1224 else if(!strcmp(cutName,"DCUTM"))
1225 fGccuts->dcutm=cutValue;
1226 else if(!strcmp(cutName,"PPCUTM"))
1227 fGccuts->ppcutm=cutValue;
1228 else if(!strcmp(cutName,"TOFMAX"))
1229 fGccuts->tofmax=cutValue;
1230 else Warning("SetCut","Cut %s not implemented\n",cutName);
1231}
1232
1233//_____________________________________________________________________________
1234void TGeant3::SetProcess(const char* flagName, Int_t flagValue)
1235{
ef42d733 1236 //
1237 // Set thresholds for different processes
1238 //
229004c4 1239 if(!strcmp(flagName,"PAIR"))
1240 fGcphys->ipair=flagValue;
1241 else if(!strcmp(flagName,"COMP"))
1242 fGcphys->icomp=flagValue;
1243 else if(!strcmp(flagName,"PHOT"))
1244 fGcphys->iphot=flagValue;
1245 else if(!strcmp(flagName,"PFIS"))
1246 fGcphys->ipfis=flagValue;
1247 else if(!strcmp(flagName,"DRAY"))
1248 fGcphys->idray=flagValue;
1249 else if(!strcmp(flagName,"ANNI"))
1250 fGcphys->ianni=flagValue;
1251 else if(!strcmp(flagName,"BREM"))
1252 fGcphys->ibrem=flagValue;
1253 else if(!strcmp(flagName,"HADR"))
1254 fGcphys->ihadr=flagValue;
1255 else if(!strcmp(flagName,"MUNU"))
1256 fGcphys->imunu=flagValue;
1257 else if(!strcmp(flagName,"DCAY"))
1258 fGcphys->idcay=flagValue;
1259 else if(!strcmp(flagName,"LOSS"))
1260 fGcphys->iloss=flagValue;
1261 else if(!strcmp(flagName,"MULS"))
1262 fGcphys->imuls=flagValue;
1263 else if(!strcmp(flagName,"RAYL"))
1264 fGcphys->irayl=flagValue;
fd91b664 1265 else if(!strcmp(flagName,"STRA"))
1266 fGcphlt->istra=flagValue;
1267 else if(!strcmp(flagName,"SYNC"))
1268 fGcphlt->isync=flagValue;
229004c4 1269 else Warning("SetFlag","Flag %s not implemented\n",flagName);
1270}
1271
d5a6b28b 1272//_____________________________________________________________________________
8918e700 1273Float_t TGeant3::Xsec(char* reac, Float_t /* energy */,
1274 Int_t part, Int_t /* mate */)
d5a6b28b 1275{
ef42d733 1276 //
1277 // Calculate X-sections -- dummy for the moment
1278 //
d5a6b28b 1279 if(!strcmp(reac,"PHOT"))
1280 {
1281 if(part!=22) {
1282 Error("Xsec","Can calculate photoelectric only for photons\n");
1283 }
1284 }
1285 return 0;
1286}
1287
fe4da5cc 1288//_____________________________________________________________________________
0a6d8768 1289void TGeant3::TrackPosition(TLorentzVector &xyz) const
fe4da5cc 1290{
1291 //
1292 // Return the current position in the master reference frame of the
1293 // track being transported
1294 //
1295 xyz[0]=fGctrak->vect[0];
1296 xyz[1]=fGctrak->vect[1];
1297 xyz[2]=fGctrak->vect[2];
0a6d8768 1298 xyz[3]=fGctrak->tofg;
fe4da5cc 1299}
1300
1301//_____________________________________________________________________________
1302Float_t TGeant3::TrackTime() const
1303{
1304 //
1305 // Return the current time of flight of the track being transported
1306 //
1307 return fGctrak->tofg;
1308}
1309
1310//_____________________________________________________________________________
0a6d8768 1311void TGeant3::TrackMomentum(TLorentzVector &xyz) const
fe4da5cc 1312{
1313 //
1314 // Return the direction and the momentum (GeV/c) of the track
1315 // currently being transported
1316 //
0a6d8768 1317 Double_t ptot=fGctrak->vect[6];
1318 xyz[0]=fGctrak->vect[3]*ptot;
1319 xyz[1]=fGctrak->vect[4]*ptot;
1320 xyz[2]=fGctrak->vect[5]*ptot;
1321 xyz[3]=fGctrak->getot;
fe4da5cc 1322}
1323
1324//_____________________________________________________________________________
1325Float_t TGeant3::TrackCharge() const
1326{
1327 //
1328 // Return charge of the track currently transported
1329 //
1330 return fGckine->charge;
1331}
1332
1333//_____________________________________________________________________________
1334Float_t TGeant3::TrackMass() const
1335{
1336 //
1337 // Return the mass of the track currently transported
1338 //
1339 return fGckine->amass;
1340}
1341
1342//_____________________________________________________________________________
1343Int_t TGeant3::TrackPid() const
1344{
1345 //
1346 // Return the id of the particle transported
1347 //
85f1cd76 1348 return PDGFromId(fGckine->ipart);
fe4da5cc 1349}
1350
1351//_____________________________________________________________________________
1352Float_t TGeant3::TrackStep() const
1353{
1354 //
1355 // Return the length in centimeters of the current step
1356 //
1357 return fGctrak->step;
1358}
1359
1360//_____________________________________________________________________________
1361Float_t TGeant3::TrackLength() const
1362{
1363 //
1364 // Return the length of the current track from its origin
1365 //
1366 return fGctrak->sleng;
1367}
1368
a01a8b12 1369//_____________________________________________________________________________
1370Bool_t TGeant3::IsNewTrack() const
1371{
1372 //
1373 // True if the track is not at the boundary of the current volume
1374 //
da559017 1375 return (fGctrak->sleng==0);
a01a8b12 1376}
1377
fe4da5cc 1378//_____________________________________________________________________________
0a6d8768 1379Bool_t TGeant3::IsTrackInside() const
fe4da5cc 1380{
1381 //
1382 // True if the track is not at the boundary of the current volume
1383 //
1384 return (fGctrak->inwvol==0);
1385}
1386
1387//_____________________________________________________________________________
0a6d8768 1388Bool_t TGeant3::IsTrackEntering() const
fe4da5cc 1389{
1390 //
1391 // True if this is the first step of the track in the current volume
1392 //
1393 return (fGctrak->inwvol==1);
1394}
1395
1396//_____________________________________________________________________________
0a6d8768 1397Bool_t TGeant3::IsTrackExiting() const
fe4da5cc 1398{
1399 //
1400 // True if this is the last step of the track in the current volume
1401 //
1402 return (fGctrak->inwvol==2);
1403}
1404
1405//_____________________________________________________________________________
0a6d8768 1406Bool_t TGeant3::IsTrackOut() const
fe4da5cc 1407{
1408 //
1409 // True if the track is out of the setup
1410 //
1411 return (fGctrak->inwvol==3);
1412}
1413
1414//_____________________________________________________________________________
0a6d8768 1415Bool_t TGeant3::IsTrackStop() const
fe4da5cc 1416{
1417 //
1418 // True if the track energy has fallen below the threshold
1419 //
1420 return (fGctrak->istop==2);
1421}
1422
1423//_____________________________________________________________________________
1424Int_t TGeant3::NSecondaries() const
1425{
1426 //
1427 // Number of secondary particles generated in the current step
1428 //
1429 return fGcking->ngkine;
1430}
1431
1432//_____________________________________________________________________________
1433Int_t TGeant3::CurrentEvent() const
1434{
1435 //
1436 // Number of the current event
1437 //
1438 return fGcflag->idevt;
1439}
1440
1441//_____________________________________________________________________________
27f3d82e 1442AliMCProcess TGeant3::ProdProcess(Int_t ) const
fe4da5cc 1443{
1444 //
1445 // Name of the process that has produced the secondary particles
1446 // in the current step
1447 //
27f3d82e 1448 const AliMCProcess kIpProc[13] = { kPDecay, kPPair, kPCompton,
65fb704d 1449 kPPhotoelectric, kPBrem, kPDeltaRay,
1450 kPAnnihilation, kPHadronic,
1451 kPMuonNuclear, kPPhotoFission,
1452 kPRayleigh, kPCerenkov, kPSynchrotron};
1453 Int_t km, im;
1454 //
1455 if(fGcking->ngkine>0)
1456 for (km = 0; km < fGctrak->nmec; ++km)
1457 for (im = 0; im < 13; ++im)
27f3d82e 1458 if (G3toVMC(fGctrak->lmec[km]) == kIpProc[im])
1459 return kIpProc[im];
65fb704d 1460 //
27f3d82e 1461 return kPNoProcess;
1462}
1463
1464//_____________________________________________________________________________
1465Int_t TGeant3::StepProcesses(TArrayI &proc) const
1466{
1467 //
1468 // Return processes active in the current step
1469 //
1470 Int_t i;
1471 Int_t nproc=Gctrak()->nmec;
1472 //
1473 proc.Set(nproc);
1474 Int_t nvproc=0;
1475 //
1476 for (i=0; i<nproc; ++i)
1477 if((proc[nvproc]=G3toVMC(Gctrak()->lmec[i]))!=kPNoProcess) nvproc++;
1478 //
1479 proc.Set(nvproc);
1480 //
1481 return nvproc;
1482}
1483
1484//_____________________________________________________________________________
1485AliMCProcess TGeant3::G3toVMC(Int_t iproc) const
1486{
1487 //
1488 // Conversion between GEANT and AliMC processes
1489 //
1490
1491 const AliMCProcess kPG2MC1[30] = {kPNoProcess, kPMultipleScattering, kPEnergyLoss, kPMagneticFieldL, kPDecay,
1492 kPPair, kPCompton, kPPhotoelectric, kPBrem, kPDeltaRay,
1493 kPAnnihilation, kPHadronic, kPNoProcess, kPEvaporation, kPNuclearFission,
1494 kPNuclearAbsorption, kPPbarAnnihilation, kPNCapture, kPHElastic, kPHInhelastic,
1495 kPMuonNuclear, kPTOFlimit, kPPhotoFission, kPNoProcess, kPRayleigh,
1496 kPNoProcess, kPNoProcess, kPNoProcess, kPNull, kPStop};
1497
1498 const AliMCProcess kPG2MC2[9] = {kPLightAbsorption, kPLightScattering, kStepMax, kPNoProcess, kPCerenkov,
1499 kPLightReflection, kPLightRefraction, kPSynchrotron, kPNoProcess};
1500
1501 AliMCProcess proc=kPNoProcess;
1502 if(1<iproc && iproc<=30) proc= kPG2MC1[iproc-1];
1503 else if(101<=iproc && iproc<=109) proc= kPG2MC2[iproc-100-1];
1504 return proc;
fe4da5cc 1505}
1506
27f3d82e 1507
fe4da5cc 1508//_____________________________________________________________________________
5d84196c 1509void TGeant3::GetSecondary(Int_t isec, Int_t& ipart,
1510 TLorentzVector &x, TLorentzVector &p)
fe4da5cc 1511{
1512 //
1513 // Get the parameters of the secondary track number isec produced
1514 // in the current step
1515 //
1516 Int_t i;
1517 if(-1<isec && isec<fGcking->ngkine) {
1518 ipart=Int_t (fGcking->gkin[isec][4] +0.5);
1519 for(i=0;i<3;i++) {
1520 x[i]=fGckin3->gpos[isec][i];
1521 p[i]=fGcking->gkin[isec][i];
1522 }
1523 x[3]=fGcking->tofd[isec];
1524 p[3]=fGcking->gkin[isec][3];
1525 } else {
1526 printf(" * TGeant3::GetSecondary * Secondary %d does not exist\n",isec);
1527 x[0]=x[1]=x[2]=x[3]=p[0]=p[1]=p[2]=p[3]=0;
1528 ipart=0;
1529 }
1530}
1531
1532//_____________________________________________________________________________
1533void TGeant3::InitLego()
1534{
ef42d733 1535 //
1536 // Set switches for lego transport
1537 //
fe4da5cc 1538 SetSWIT(4,0);
1539 SetDEBU(0,0,0); //do not print a message
1540}
1541
1542//_____________________________________________________________________________
0a6d8768 1543Bool_t TGeant3::IsTrackDisappeared() const
fe4da5cc 1544{
1545 //
1546 // True if the current particle has disappered
1547 // either because it decayed or because it underwent
1548 // an inelastic collision
1549 //
1550 return (fGctrak->istop==1);
1551}
1552
1553//_____________________________________________________________________________
0a6d8768 1554Bool_t TGeant3::IsTrackAlive() const
fe4da5cc 1555{
1556 //
1557 // True if the current particle is alive and will continue to be
1558 // transported
1559 //
1560 return (fGctrak->istop==0);
1561}
1562
1563//_____________________________________________________________________________
1564void TGeant3::StopTrack()
1565{
1566 //
1567 // Stop the transport of the current particle and skip to the next
1568 //
1569 fGctrak->istop=1;
1570}
1571
1572//_____________________________________________________________________________
1573void TGeant3::StopEvent()
1574{
1575 //
1576 // Stop simulation of the current event and skip to the next
1577 //
1578 fGcflag->ieotri=1;
1579}
1580
1581//_____________________________________________________________________________
1582Float_t TGeant3::MaxStep() const
1583{
1584 //
1585 // Return the maximum step length in the current medium
1586 //
1587 return fGctmed->stemax;
1588}
1589
fe4da5cc 1590//_____________________________________________________________________________
1591void TGeant3::SetMaxStep(Float_t maxstep)
1592{
1593 //
1594 // Set the maximum step allowed till the particle is in the current medium
1595 //
1596 fGctmed->stemax=maxstep;
1597}
1598
1599//_____________________________________________________________________________
1600void TGeant3::SetMaxNStep(Int_t maxnstp)
1601{
1602 //
1603 // Set the maximum number of steps till the particle is in the current medium
1604 //
1605 fGctrak->maxnst=maxnstp;
1606}
1607
1608//_____________________________________________________________________________
1609Int_t TGeant3::GetMaxNStep() const
1610{
1611 //
1612 // Maximum number of steps allowed in current medium
1613 //
1614 return fGctrak->maxnst;
1615}
1616
1617//_____________________________________________________________________________
1618void TGeant3::Material(Int_t& kmat, const char* name, Float_t a, Float_t z,
1619 Float_t dens, Float_t radl, Float_t absl, Float_t* buf,
1620 Int_t nwbuf)
1621{
1622 //
1623 // Defines a Material
1624 //
1625 // kmat number assigned to the material
1626 // name material name
1627 // a atomic mass in au
1628 // z atomic number
1629 // dens density in g/cm3
1630 // absl absorbtion length in cm
1631 // if >=0 it is ignored and the program
1632 // calculates it, if <0. -absl is taken
1633 // radl radiation length in cm
1634 // if >=0 it is ignored and the program
1635 // calculates it, if <0. -radl is taken
1636 // buf pointer to an array of user words
1637 // nbuf number of user words
1638 //
1639 Int_t jmate=fGclink->jmate;
1640 kmat=1;
1641 Int_t ns, i;
1642 if(jmate>0) {
1643 ns=fZiq[jmate-2];
1644 kmat=ns+1;
1645 for(i=1; i<=ns; i++) {
1646 if(fZlq[jmate-i]==0) {
1647 kmat=i;
1648 break;
1649 }
1650 }
1651 }
1652 gsmate(kmat,PASSCHARD(name), a, z, dens, radl, absl, buf,
1653 nwbuf PASSCHARL(name));
1654}
1655
1656//_____________________________________________________________________________
1657void TGeant3::Mixture(Int_t& kmat, const char* name, Float_t* a, Float_t* z,
1658 Float_t dens, Int_t nlmat, Float_t* wmat)
1659{
1660 //
1661 // Defines mixture OR COMPOUND IMAT as composed by
1662 // THE BASIC NLMAT materials defined by arrays A,Z and WMAT
1663 //
1664 // If NLMAT > 0 then wmat contains the proportion by
1665 // weights of each basic material in the mixture.
1666 //
1667 // If nlmat < 0 then WMAT contains the number of atoms
1668 // of a given kind into the molecule of the COMPOUND
1669 // In this case, WMAT in output is changed to relative
1670 // weigths.
1671 //
1672 Int_t jmate=fGclink->jmate;
1673 kmat=1;
1674 Int_t ns, i;
1675 if(jmate>0) {
1676 ns=fZiq[jmate-2];
1677 kmat=ns+1;
1678 for(i=1; i<=ns; i++) {
1679 if(fZlq[jmate-i]==0) {
1680 kmat=i;
1681 break;
1682 }
1683 }
1684 }
1685 gsmixt(kmat,PASSCHARD(name), a, z,dens, nlmat,wmat PASSCHARL(name));
1686}
1687
1688//_____________________________________________________________________________
1689void TGeant3::Medium(Int_t& kmed, const char* name, Int_t nmat, Int_t isvol,
1690 Int_t ifield, Float_t fieldm, Float_t tmaxfd,
1691 Float_t stemax, Float_t deemax, Float_t epsil,
1692 Float_t stmin, Float_t* ubuf, Int_t nbuf)
1693{
1694 //
1695 // kmed tracking medium number assigned
1696 // name tracking medium name
1697 // nmat material number
1698 // isvol sensitive volume flag
1699 // ifield magnetic field
1700 // fieldm max. field value (kilogauss)
1701 // tmaxfd max. angle due to field (deg/step)
1702 // stemax max. step allowed
1703 // deemax max. fraction of energy lost in a step
1704 // epsil tracking precision (cm)
1705 // stmin min. step due to continuos processes (cm)
1706 //
1707 // ifield = 0 if no magnetic field; ifield = -1 if user decision in guswim;
1708 // ifield = 1 if tracking performed with grkuta; ifield = 2 if tracking
1709 // performed with ghelix; ifield = 3 if tracking performed with ghelx3.
1710 //
1711 Int_t jtmed=fGclink->jtmed;
1712 kmed=1;
1713 Int_t ns, i;
1714 if(jtmed>0) {
1715 ns=fZiq[jtmed-2];
1716 kmed=ns+1;
1717 for(i=1; i<=ns; i++) {
1718 if(fZlq[jtmed-i]==0) {
1719 kmed=i;
1720 break;
1721 }
1722 }
1723 }
1724 gstmed(kmed, PASSCHARD(name), nmat, isvol, ifield, fieldm, tmaxfd, stemax,
1725 deemax, epsil, stmin, ubuf, nbuf PASSCHARL(name));
1726}
1727
1728//_____________________________________________________________________________
1729void TGeant3::Matrix(Int_t& krot, Float_t thex, Float_t phix, Float_t they,
1730 Float_t phiy, Float_t thez, Float_t phiz)
1731{
1732 //
1733 // krot rotation matrix number assigned
1734 // theta1 polar angle for axis i
1735 // phi1 azimuthal angle for axis i
1736 // theta2 polar angle for axis ii
1737 // phi2 azimuthal angle for axis ii
1738 // theta3 polar angle for axis iii
1739 // phi3 azimuthal angle for axis iii
1740 //
1741 // it defines the rotation matrix number irot.
1742 //
1743 Int_t jrotm=fGclink->jrotm;
1744 krot=1;
1745 Int_t ns, i;
1746 if(jrotm>0) {
1747 ns=fZiq[jrotm-2];
1748 krot=ns+1;
1749 for(i=1; i<=ns; i++) {
1750 if(fZlq[jrotm-i]==0) {
1751 krot=i;
1752 break;
1753 }
1754 }
1755 }
1756 gsrotm(krot, thex, phix, they, phiy, thez, phiz);
1757}
1758
fe4da5cc 1759//_____________________________________________________________________________
1760Int_t TGeant3::GetMedium() const
1761{
1762 //
1763 // Return the number of the current medium
1764 //
1765 return fGctmed->numed;
1766}
1767
1768//_____________________________________________________________________________
1769Float_t TGeant3::Edep() const
1770{
1771 //
1772 // Return the energy lost in the current step
1773 //
1774 return fGctrak->destep;
1775}
1776
1777//_____________________________________________________________________________
1778Float_t TGeant3::Etot() const
1779{
1780 //
1781 // Return the total energy of the current track
1782 //
1783 return fGctrak->getot;
1784}
1785
fe4da5cc 1786//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1787//
1788// Functions from GBASE
1789//
1790//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1791
1792//____________________________________________________________________________
1793void TGeant3::Gfile(const char *filename, const char *option)
1794{
1795 //
1796 // Routine to open a GEANT/RZ data base.
1797 //
1798 // LUN logical unit number associated to the file
1799 //
1800 // CHFILE RZ file name
1801 //
1802 // CHOPT is a character string which may be
1803 // N To create a new file
1804 // U to open an existing file for update
1805 // " " to open an existing file for read only
1806 // Q The initial allocation (default 1000 records)
1807 // is given in IQUEST(10)
1808 // X Open the file in exchange format
1809 // I Read all data structures from file to memory
1810 // O Write all data structures from memory to file
1811 //
1812 // Note:
1813 // If options "I" or "O" all data structures are read or
1814 // written from/to file and the file is closed.
1815 // See routine GRMDIR to create subdirectories
1816 // See routines GROUT,GRIN to write,read objects
1817 //
1818 grfile(21, PASSCHARD(filename), PASSCHARD(option) PASSCHARL(filename)
1819 PASSCHARL(option));
1820}
1821
1822//____________________________________________________________________________
1823void TGeant3::Gpcxyz()
1824{
1825 //
1826 // Print track and volume parameters at current point
1827 //
2f6413f8 1828
1829 gpcxyz();
fe4da5cc 1830}
fe4da5cc 1831//_____________________________________________________________________________
1832void TGeant3::Ggclos()
1833{
1834 //
1835 // Closes off the geometry setting.
1836 // Initializes the search list for the contents of each
1837 // volume following the order they have been positioned, and
1838 // inserting the content '0' when a call to GSNEXT (-1) has
1839 // been required by the user.
1840 // Performs the development of the JVOLUM structure for all
1841 // volumes with variable parameters, by calling GGDVLP.
1842 // Interprets the user calls to GSORD, through GGORD.
1843 // Computes and stores in a bank (next to JVOLUM mother bank)
1844 // the number of levels in the geometrical tree and the
1845 // maximum number of contents per level, by calling GGNLEV.
1846 // Sets status bit for CONCAVE volumes, through GGCAVE.
1847 // Completes the JSET structure with the list of volume names
1848 // which identify uniquely a given physical detector, the
1849 // list of bit numbers to pack the corresponding volume copy
1850 // numbers, and the generic path(s) in the JVOLUM tree,
1851 // through the routine GHCLOS.
1852 //
1853 ggclos();
9006703b 1854 // Create internal list of volumes
8918e700 1855 fVolNames = new char[fGcnum->nvolum+1][5];
9006703b 1856 Int_t i;
1857 for(i=0; i<fGcnum->nvolum; ++i) {
1858 strncpy(fVolNames[i], (char *) &fZiq[fGclink->jvolum+i+1], 4);
1859 fVolNames[i][4]='\0';
1860 }
8918e700 1861 strcpy(fVolNames[fGcnum->nvolum],"NULL");
fe4da5cc 1862}
1863
1864//_____________________________________________________________________________
1865void TGeant3::Glast()
1866{
1867 //
1868 // Finish a Geant run
1869 //
1870 glast();
1871}
1872
1873//_____________________________________________________________________________
1874void TGeant3::Gprint(const char *name)
1875{
1876 //
1877 // Routine to print data structures
1878 // CHNAME name of a data structure
1879 //
1880 char vname[5];
1881 Vname(name,vname);
1882 gprint(PASSCHARD(vname),0 PASSCHARL(vname));
1883}
1884
1885//_____________________________________________________________________________
1886void TGeant3::Grun()
1887{
1888 //
1889 // Steering function to process one run
1890 //
1891 grun();
1892}
1893
1894//_____________________________________________________________________________
1895void TGeant3::Gtrig()
1896{
1897 //
1898 // Steering function to process one event
5f73d6ac 1899 //
fe4da5cc 1900 gtrig();
1901}
1902
1903//_____________________________________________________________________________
1904void TGeant3::Gtrigc()
1905{
1906 //
1907 // Clear event partition
1908 //
1909 gtrigc();
1910}
1911
1912//_____________________________________________________________________________
1913void TGeant3::Gtrigi()
1914{
1915 //
1916 // Initialises event partition
1917 //
1918 gtrigi();
1919}
1920
1921//_____________________________________________________________________________
1922void TGeant3::Gwork(Int_t nwork)
1923{
1924 //
1925 // Allocates workspace in ZEBRA memory
1926 //
1927 gwork(nwork);
1928}
1929
1930//_____________________________________________________________________________
1931void TGeant3::Gzinit()
1932{
1933 //
1934 // To initialise GEANT/ZEBRA data structures
1935 //
1936 gzinit();
1937}
1938
1939//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1940//
1941// Functions from GCONS
1942//
1943//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
1944
1945//_____________________________________________________________________________
1946void TGeant3::Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z,
1947 Float_t &dens, Float_t &radl, Float_t &absl,
1948 Float_t* ubuf, Int_t& nbuf)
1949{
1950 //
1951 // Return parameters for material IMAT
1952 //
1953 gfmate(imat, PASSCHARD(name), a, z, dens, radl, absl, ubuf, nbuf
1954 PASSCHARL(name));
1955}
1956
1957//_____________________________________________________________________________
1958void TGeant3::Gfpart(Int_t ipart, char *name, Int_t &itrtyp,
1959 Float_t &amass, Float_t &charge, Float_t &tlife)
1960{
1961 //
1962 // Return parameters for particle of type IPART
1963 //
1964 Float_t *ubuf=0;
1965 Int_t nbuf;
c880e780 1966 Int_t igpart = IdFromPDG(ipart);
1967 gfpart(igpart, PASSCHARD(name), itrtyp, amass, charge, tlife, ubuf, nbuf
fe4da5cc 1968 PASSCHARL(name));
1969}
1970
1971//_____________________________________________________________________________
1972void TGeant3::Gftmed(Int_t numed, char *name, Int_t &nmat, Int_t &isvol,
1973 Int_t &ifield, Float_t &fieldm, Float_t &tmaxfd,
1974 Float_t &stemax, Float_t &deemax, Float_t &epsil,
1975 Float_t &stmin, Float_t *ubuf, Int_t *nbuf)
1976{
1977 //
1978 // Return parameters for tracking medium NUMED
1979 //
1980 gftmed(numed, PASSCHARD(name), nmat, isvol, ifield, fieldm, tmaxfd, stemax,
1981 deemax, epsil, stmin, ubuf, nbuf PASSCHARL(name));
db656dbe 1982}
1983
1984
1985 void TGeant3::Gftmat(Int_t imate, Int_t ipart, char *chmeca, Int_t kdim,
1986 Float_t* tkin, Float_t* value, Float_t* pcut,
1987 Int_t &ixst)
1988{
1989 //
1990 // Return parameters for tracking medium NUMED
1991 //
1992 gftmat(imate, ipart, PASSCHARD(chmeca), kdim,
1993 tkin, value, pcut, ixst PASSCHARL(chmeca));
1994
fe4da5cc 1995}
db656dbe 1996
ef42d733 1997//_____________________________________________________________________________
db656dbe 1998Float_t TGeant3::Gbrelm(Float_t z, Float_t t, Float_t bcut)
1999{
ef42d733 2000 //
2001 // To calculate energy loss due to soft muon BREMSSTRAHLUNG
2002 //
2003 return gbrelm(z,t,bcut);
db656dbe 2004}
2005
ef42d733 2006//_____________________________________________________________________________
db656dbe 2007Float_t TGeant3::Gprelm(Float_t z, Float_t t, Float_t bcut)
2008{
ef42d733 2009 //
2010 // To calculate DE/DX in GeV*barn/atom for direct pair production by muons
2011 //
2012 return gprelm(z,t,bcut);
db656dbe 2013}
fe4da5cc 2014
2015//_____________________________________________________________________________
2016void TGeant3::Gmate()
2017{
2018 //
2019 // Define standard GEANT materials
2020 //
2021 gmate();
2022}
2023
2024//_____________________________________________________________________________
2025void TGeant3::Gpart()
2026{
2027 //
2028 // Define standard GEANT particles plus selected decay modes
2029 // and branching ratios.
2030 //
2031 gpart();
2032}
2033
2034//_____________________________________________________________________________
2035void TGeant3::Gsdk(Int_t ipart, Float_t *bratio, Int_t *mode)
2036{
2037// Defines branching ratios and decay modes for standard
2038// GEANT particles.
2039 gsdk(ipart,bratio,mode);
2040}
2041
2042//_____________________________________________________________________________
2043void TGeant3::Gsmate(Int_t imat, const char *name, Float_t a, Float_t z,
2044 Float_t dens, Float_t radl, Float_t absl)
2045{
2046 //
2047 // Defines a Material
2048 //
2049 // kmat number assigned to the material
2050 // name material name
2051 // a atomic mass in au
2052 // z atomic number
2053 // dens density in g/cm3
2054 // absl absorbtion length in cm
2055 // if >=0 it is ignored and the program
2056 // calculates it, if <0. -absl is taken
2057 // radl radiation length in cm
2058 // if >=0 it is ignored and the program
2059 // calculates it, if <0. -radl is taken
2060 // buf pointer to an array of user words
2061 // nbuf number of user words
2062 //
2063 Float_t *ubuf=0;
2064 Int_t nbuf=0;
2065 gsmate(imat,PASSCHARD(name), a, z, dens, radl, absl, ubuf, nbuf
2066 PASSCHARL(name));
2067}
2068
2069//_____________________________________________________________________________
2070void TGeant3::Gsmixt(Int_t imat, const char *name, Float_t *a, Float_t *z,
2071 Float_t dens, Int_t nlmat, Float_t *wmat)
2072{
2073 //
2074 // Defines mixture OR COMPOUND IMAT as composed by
2075 // THE BASIC NLMAT materials defined by arrays A,Z and WMAT
2076 //
2077 // If NLMAT.GT.0 then WMAT contains the PROPORTION BY
2078 // WEIGTHS OF EACH BASIC MATERIAL IN THE MIXTURE.
2079 //
2080 // If NLMAT.LT.0 then WMAT contains the number of atoms
2081 // of a given kind into the molecule of the COMPOUND
2082 // In this case, WMAT in output is changed to relative
2083 // weigths.
2084 //
2085 gsmixt(imat,PASSCHARD(name), a, z,dens, nlmat,wmat PASSCHARL(name));
2086}
2087
2088//_____________________________________________________________________________
2089void TGeant3::Gspart(Int_t ipart, const char *name, Int_t itrtyp,
2090 Float_t amass, Float_t charge, Float_t tlife)
2091{
2092 //
2093 // Store particle parameters
2094 //
2095 // ipart particle code
2096 // name particle name
2097 // itrtyp transport method (see GEANT manual)
2098 // amass mass in GeV/c2
2099 // charge charge in electron units
2100 // tlife lifetime in seconds
2101 //
2102 Float_t *ubuf=0;
2103 Int_t nbuf=0;
2104 gspart(ipart,PASSCHARD(name), itrtyp, amass, charge, tlife, ubuf, nbuf
2105 PASSCHARL(name));
2106}
2107
2108//_____________________________________________________________________________
2109void TGeant3::Gstmed(Int_t numed, const char *name, Int_t nmat, Int_t isvol,
2110 Int_t ifield, Float_t fieldm, Float_t tmaxfd,
2111 Float_t stemax, Float_t deemax, Float_t epsil,
2112 Float_t stmin)
2113{
2114 //
2115 // NTMED Tracking medium number
2116 // NAME Tracking medium name
2117 // NMAT Material number
2118 // ISVOL Sensitive volume flag
2119 // IFIELD Magnetic field
2120 // FIELDM Max. field value (Kilogauss)
2121 // TMAXFD Max. angle due to field (deg/step)
2122 // STEMAX Max. step allowed
2123 // DEEMAX Max. fraction of energy lost in a step
2124 // EPSIL Tracking precision (cm)
2125 // STMIN Min. step due to continuos processes (cm)
2126 //
2127 // IFIELD = 0 if no magnetic field; IFIELD = -1 if user decision in GUSWIM;
2128 // IFIELD = 1 if tracking performed with GRKUTA; IFIELD = 2 if tracking
2129 // performed with GHELIX; IFIELD = 3 if tracking performed with GHELX3.
2130 //
2131 Float_t *ubuf=0;
2132 Int_t nbuf=0;
2133 gstmed(numed,PASSCHARD(name), nmat, isvol, ifield, fieldm, tmaxfd, stemax,
2134 deemax, epsil, stmin, ubuf, nbuf PASSCHARL(name));
2135}
2136
2137//_____________________________________________________________________________
2138void TGeant3::Gsckov(Int_t itmed, Int_t npckov, Float_t *ppckov,
27f3d82e 2139 Float_t *absco, Float_t *effic, Float_t *rindex)
2140{
2141 //
2142 // Stores the tables for UV photon tracking in medium ITMED
2143 // Please note that it is the user's responsability to
2144 // provide all the coefficients:
2145 //
2146 //
2147 // ITMED Tracking medium number
2148 // NPCKOV Number of bins of each table
2149 // PPCKOV Value of photon momentum (in GeV)
2150 // ABSCO Absorbtion coefficients
2151 // dielectric: absorbtion length in cm
2152 // metals : absorbtion fraction (0<=x<=1)
2153 // EFFIC Detection efficiency for UV photons
2154 // RINDEX Refraction index (if=0 metal)
2155 //
2156 gsckov(itmed,npckov,ppckov,absco,effic,rindex);
2157}
2158
2159//_____________________________________________________________________________
2160void TGeant3::SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov,
2161 Float_t *absco, Float_t *effic, Float_t *rindex)
fe4da5cc 2162{
2163 //
2164 // Stores the tables for UV photon tracking in medium ITMED
2165 // Please note that it is the user's responsability to
2166 // provide all the coefficients:
2167 //
2168 //
2169 // ITMED Tracking medium number
2170 // NPCKOV Number of bins of each table
2171 // PPCKOV Value of photon momentum (in GeV)
2172 // ABSCO Absorbtion coefficients
2173 // dielectric: absorbtion length in cm
2174 // metals : absorbtion fraction (0<=x<=1)
2175 // EFFIC Detection efficiency for UV photons
2176 // RINDEX Refraction index (if=0 metal)
2177 //
2178 gsckov(itmed,npckov,ppckov,absco,effic,rindex);
2179}
2180
2181//_____________________________________________________________________________
2182void TGeant3::Gstpar(Int_t itmed, const char *param, Float_t parval)
2183{
2184 //
2185 // To change the value of cut or mechanism "CHPAR"
2186 // to a new value PARVAL for tracking medium ITMED
2187 // The data structure JTMED contains the standard tracking
2188 // parameters (CUTS and flags to control the physics processes) which
2189 // are used by default for all tracking media. It is possible to
2190 // redefine individually with GSTPAR any of these parameters for a
2191 // given tracking medium.
2192 // ITMED tracking medium number
2193 // CHPAR is a character string (variable name)
2194 // PARVAL must be given as a floating point.
2195 //
2196 gstpar(itmed,PASSCHARD(param), parval PASSCHARL(param));
2197}
2198
2199//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2200//
2201// Functions from GCONS
2202//
2203//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2204
2205//_____________________________________________________________________________
2206void TGeant3::Gfkine(Int_t itra, Float_t *vert, Float_t *pvert, Int_t &ipart,
2207 Int_t &nvert)
2208{
2209 // Storing/Retrieving Vertex and Track parameters
2210 // ----------------------------------------------
2211 //
2212 // Stores vertex parameters.
2213 // VERT array of (x,y,z) position of the vertex
2214 // NTBEAM beam track number origin of the vertex
2215 // =0 if none exists
2216 // NTTARG target track number origin of the vertex
2217 // UBUF user array of NUBUF floating point numbers
2218 // NUBUF
2219 // NVTX new vertex number (=0 in case of error).
2220 // Prints vertex parameters.
2221 // IVTX for vertex IVTX.
2222 // (For all vertices if IVTX=0)
2223 // Stores long life track parameters.
2224 // PLAB components of momentum
2225 // IPART type of particle (see GSPART)
2226 // NV vertex number origin of track
2227 // UBUF array of NUBUF floating point user parameters
2228 // NUBUF
2229 // NT track number (if=0 error).
2230 // Retrieves long life track parameters.
2231 // ITRA track number for which parameters are requested
2232 // VERT vector origin of the track
2233 // PVERT 4 momentum components at the track origin
2234 // IPART particle type (=0 if track ITRA does not exist)
2235 // NVERT vertex number origin of the track
2236 // UBUF user words stored in GSKINE.
2237 // Prints initial track parameters.
2238 // ITRA for track ITRA
2239 // (For all tracks if ITRA=0)
2240 //
2241 Float_t *ubuf=0;
2242 Int_t nbuf;
2243 gfkine(itra,vert,pvert,ipart,nvert,ubuf,nbuf);
2244}
2245
2246//_____________________________________________________________________________
2247void TGeant3::Gfvert(Int_t nvtx, Float_t *v, Int_t &ntbeam, Int_t &nttarg,
2248 Float_t &tofg)
2249{
2250 //
2251 // Retrieves the parameter of a vertex bank
2252 // Vertex is generated from tracks NTBEAM NTTARG
2253 // NVTX is the new vertex number
2254 //
2255 Float_t *ubuf=0;
2256 Int_t nbuf;
2257 gfvert(nvtx,v,ntbeam,nttarg,tofg,ubuf,nbuf);
2258}
2259
2260//_____________________________________________________________________________
2261Int_t TGeant3::Gskine(Float_t *plab, Int_t ipart, Int_t nv, Float_t *buf,
2262 Int_t nwbuf)
2263{
2264 //
2265 // Store kinematics of track NT into data structure
2266 // Track is coming from vertex NV
2267 //
2268 Int_t nt = 0;
2269 gskine(plab, ipart, nv, buf, nwbuf, nt);
2270 return nt;
2271}
2272
2273//_____________________________________________________________________________
2274Int_t TGeant3::Gsvert(Float_t *v, Int_t ntbeam, Int_t nttarg, Float_t *ubuf,
2275 Int_t nwbuf)
2276{
2277 //
2278 // Creates a new vertex bank
2279 // Vertex is generated from tracks NTBEAM NTTARG
2280 // NVTX is the new vertex number
2281 //
2282 Int_t nwtx = 0;
2283 gsvert(v, ntbeam, nttarg, ubuf, nwbuf, nwtx);
2284 return nwtx;
2285}
2286
2287//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2288//
2289// Functions from GPHYS
2290//
2291//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2292
2293//_____________________________________________________________________________
2294void TGeant3::Gphysi()
2295{
2296 //
2297 // Initialise material constants for all the physics
2298 // mechanisms used by GEANT
2299 //
2300 gphysi();
2301}
2302
2303//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2304//
2305// Functions from GTRAK
2306//
2307//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2308
2309//_____________________________________________________________________________
2310void TGeant3::Gdebug()
2311{
2312 //
2313 // Debug the current step
2314 //
2315 gdebug();
2316}
2317
2318//_____________________________________________________________________________
2319void TGeant3::Gekbin()
2320{
2321 //
2322 // To find bin number in kinetic energy table
2323 // stored in ELOW(NEKBIN)
2324 //
2325 gekbin();
2326}
2327
2328//_____________________________________________________________________________
2329void TGeant3::Gfinds()
2330{
2331 //
2332 // Returns the set/volume parameters corresponding to
2333 // the current space point in /GCTRAK/
2334 // and fill common /GCSETS/
2335 //
2336 // IHSET user set identifier
2337 // IHDET user detector identifier
2338 // ISET set number in JSET
2339 // IDET detector number in JS=LQ(JSET-ISET)
2340 // IDTYPE detector type (1,2)
2341 // NUMBV detector volume numbers (array of length NVNAME)
2342 // NVNAME number of volume levels
2343 //
2344 gfinds();
2345}
2346
2347//_____________________________________________________________________________
2348void TGeant3::Gsking(Int_t igk)
2349{
2350 //
2351 // Stores in stack JSTAK either the IGKth track of /GCKING/,
2352 // or the NGKINE tracks when IGK is 0.
2353 //
2354 gsking(igk);
2355}
2356
2357//_____________________________________________________________________________
2358void TGeant3::Gskpho(Int_t igk)
2359{
2360 //
2361 // Stores in stack JSTAK either the IGKth Cherenkov photon of
2362 // /GCKIN2/, or the NPHOT tracks when IGK is 0.
2363 //
2364 gskpho(igk);
2365}
2366
2367//_____________________________________________________________________________
2368void TGeant3::Gsstak(Int_t iflag)
2369{
2370 //
2371 // Stores in auxiliary stack JSTAK the particle currently
2372 // described in common /GCKINE/.
2373 //
2374 // On request, creates also an entry in structure JKINE :
2375 // IFLAG =
2376 // 0 : No entry in JKINE structure required (user)
2377 // 1 : New entry in JVERTX / JKINE structures required (user)
2378 // <0 : New entry in JKINE structure at vertex -IFLAG (user)
2379 // 2 : Entry in JKINE structure exists already (from GTREVE)
2380 //
2381 gsstak(iflag);
2382}
2383
2384//_____________________________________________________________________________
2385void TGeant3::Gsxyz()
2386{
2387 //
2388 // Store space point VECT in banks JXYZ
2389 //
2390 gsxyz();
2391}
2392
2393//_____________________________________________________________________________
2394void TGeant3::Gtrack()
2395{
2396 //
2397 // Controls tracking of current particle
2398 //
2399 gtrack();
2400}
2401
2402//_____________________________________________________________________________
2403void TGeant3::Gtreve()
2404{
2405 //
2406 // Controls tracking of all particles belonging to the current event
2407 //
2408 gtreve();
2409}
2410
1578254f 2411//_____________________________________________________________________________
aee8290b 2412void TGeant3::GtreveRoot()
1578254f 2413{
2414 //
2415 // Controls tracking of all particles belonging to the current event
2416 //
aee8290b 2417 gtreveroot();
1578254f 2418}
2419
fe4da5cc 2420//_____________________________________________________________________________
2421void TGeant3::Grndm(Float_t *rvec, const Int_t len) const
2422{
2423 //
2424 // To generate a vector RVECV of LEN random numbers
2425 // Copy of the CERN Library routine RANECU
65fb704d 2426 Rndm(rvec,len);
fe4da5cc 2427}
2428
2429//_____________________________________________________________________________
65fb704d 2430void TGeant3::Grndmq(Int_t &/*is1*/, Int_t &/*is2*/, const Int_t /*iseq*/,
2431 const Text_t */*chopt*/)
fe4da5cc 2432{
2433 //
2434 // To set/retrieve the seed of the random number generator
2435 //
65fb704d 2436 /*printf("Dummy grndmq called\n");*/
fe4da5cc 2437}
2438
2439//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2440//
2441// Functions from GDRAW
2442//
2443//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2444
2445//_____________________________________________________________________________
2446void TGeant3::Gdxyz(Int_t it)
2447{
2448 //
2449 // Draw the points stored with Gsxyz relative to track it
2450 //
2451 gdxyz(it);
2452}
2453
2454//_____________________________________________________________________________
2455void TGeant3::Gdcxyz()
2456{
2457 //
2458 // Draw the position of the current track
2459 //
2460 gdcxyz();
2461}
2462
2463//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2464//
2465// Functions from GGEOM
2466//
2467//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2468
2469//_____________________________________________________________________________
2470void TGeant3::Gdtom(Float_t *xd, Float_t *xm, Int_t iflag)
2471{
2472 //
2473 // Computes coordinates XM (Master Reference System
2474 // knowing the coordinates XD (Detector Ref System)
2475 // The local reference system can be initialized by
2476 // - the tracking routines and GDTOM used in GUSTEP
2477 // - a call to GSCMED(NLEVEL,NAMES,NUMBER)
2478 // (inverse routine is GMTOD)
2479 //
2480 // If IFLAG=1 convert coordinates
2481 // IFLAG=2 convert direction cosinus
2482 //
2483 gdtom(xd, xm, iflag);
2484}
2485
2486//_____________________________________________________________________________
2487void TGeant3::Glmoth(const char* iudet, Int_t iunum, Int_t &nlev, Int_t *lvols,
2488 Int_t *lindx)
2489{
2490 //
2491 // Loads the top part of the Volume tree in LVOLS (IVO's),
2492 // LINDX (IN indices) for a given volume defined through
2493 // its name IUDET and number IUNUM.
2494 //
2495 // The routine stores only upto the last level where JVOLUM
2496 // data structure is developed. If there is no development
2497 // above the current level, it returns NLEV zero.
2498 Int_t *idum=0;
2499 glmoth(PASSCHARD(iudet), iunum, nlev, lvols, lindx, idum PASSCHARL(iudet));
2500}
2501
2502//_____________________________________________________________________________
2503void TGeant3::Gmedia(Float_t *x, Int_t &numed)
2504{
2505 //
2506 // Finds in which volume/medium the point X is, and updates the
2507 // common /GCVOLU/ and the structure JGPAR accordingly.
2508 //
2509 // NUMED returns the tracking medium number, or 0 if point is
2510 // outside the experimental setup.
2511 //
2512 gmedia(x,numed);
2513}
2514
2515//_____________________________________________________________________________
2516void TGeant3::Gmtod(Float_t *xm, Float_t *xd, Int_t iflag)
2517{
2518 //
2519 // Computes coordinates XD (in DRS)
2520 // from known coordinates XM in MRS
2521 // The local reference system can be initialized by
2522 // - the tracking routines and GMTOD used in GUSTEP
2523 // - a call to GMEDIA(XM,NUMED)
2524 // - a call to GLVOLU(NLEVEL,NAMES,NUMBER,IER)
2525 // (inverse routine is GDTOM)
2526 //
2527 // If IFLAG=1 convert coordinates
2528 // IFLAG=2 convert direction cosinus
2529 //
2530 gmtod(xm, xd, iflag);
2531}
2532
2533//_____________________________________________________________________________
2534void TGeant3::Gsdvn(const char *name, const char *mother, Int_t ndiv,
2535 Int_t iaxis)
2536{
2537 //
2538 // Create a new volume by dividing an existing one
2539 //
2540 // NAME Volume name
2541 // MOTHER Mother volume name
2542 // NDIV Number of divisions
2543 // IAXIS Axis value
2544 //
2545 // X,Y,Z of CAXIS will be translated to 1,2,3 for IAXIS.
2546 // It divides a previously defined volume.
2547 //
2548 char vname[5];
2549 Vname(name,vname);
2550 char vmother[5];
2551 Vname(mother,vmother);
2552 gsdvn(PASSCHARD(vname), PASSCHARD(vmother), ndiv, iaxis PASSCHARL(vname)
2553 PASSCHARL(vmother));
2554}
2555
2556//_____________________________________________________________________________
2557void TGeant3::Gsdvn2(const char *name, const char *mother, Int_t ndiv,
2558 Int_t iaxis, Float_t c0i, Int_t numed)
2559{
2560 //
2561 // Create a new volume by dividing an existing one
2562 //
2563 // Divides mother into ndiv divisions called name
2564 // along axis iaxis starting at coordinate value c0.
2565 // the new volume created will be medium number numed.
2566 //
2567 char vname[5];
2568 Vname(name,vname);
2569 char vmother[5];
2570 Vname(mother,vmother);
2571 gsdvn2(PASSCHARD(vname), PASSCHARD(vmother), ndiv, iaxis, c0i, numed
2572 PASSCHARL(vname) PASSCHARL(vmother));
2573}
2574
2575//_____________________________________________________________________________
2576void TGeant3::Gsdvs(const char *name, const char *mother, Float_t step,
2577 Int_t iaxis, Int_t numed)
2578{
2579 //
2580 // Create a new volume by dividing an existing one
2581 //
2582 char vname[5];
2583 Vname(name,vname);
2584 char vmother[5];
2585 Vname(mother,vmother);
2586 gsdvs(PASSCHARD(vname), PASSCHARD(vmother), step, iaxis, numed
2587 PASSCHARL(vname) PASSCHARL(vmother));
2588}
2589
2590//_____________________________________________________________________________
2591void TGeant3::Gsdvs2(const char *name, const char *mother, Float_t step,
2592 Int_t iaxis, Float_t c0, Int_t numed)
2593{
2594 //
2595 // Create a new volume by dividing an existing one
2596 //
2597 char vname[5];
2598 Vname(name,vname);
2599 char vmother[5];
2600 Vname(mother,vmother);
2601 gsdvs2(PASSCHARD(vname), PASSCHARD(vmother), step, iaxis, c0, numed
2602 PASSCHARL(vname) PASSCHARL(vmother));
2603}
2604
2605//_____________________________________________________________________________
2606void TGeant3::Gsdvt(const char *name, const char *mother, Float_t step,
2607 Int_t iaxis, Int_t numed, Int_t ndvmx)
2608{
2609 //
2610 // Create a new volume by dividing an existing one
2611 //
2612 // Divides MOTHER into divisions called NAME along
2613 // axis IAXIS in steps of STEP. If not exactly divisible
2614 // will make as many as possible and will centre them
2615 // with respect to the mother. Divisions will have medium
2616 // number NUMED. If NUMED is 0, NUMED of MOTHER is taken.
2617 // NDVMX is the expected maximum number of divisions
2618 // (If 0, no protection tests are performed)
2619 //
2620 char vname[5];
2621 Vname(name,vname);
2622 char vmother[5];
2623 Vname(mother,vmother);
2624 gsdvt(PASSCHARD(vname), PASSCHARD(vmother), step, iaxis, numed, ndvmx
2625 PASSCHARL(vname) PASSCHARL(vmother));
2626}
2627
2628//_____________________________________________________________________________
2629void TGeant3::Gsdvt2(const char *name, const char *mother, Float_t step,
2630 Int_t iaxis, Float_t c0, Int_t numed, Int_t ndvmx)
2631{
2632 //
2633 // Create a new volume by dividing an existing one
2634 //
2635 // Divides MOTHER into divisions called NAME along
2636 // axis IAXIS starting at coordinate value C0 with step
2637 // size STEP.
2638 // The new volume created will have medium number NUMED.
2639 // If NUMED is 0, NUMED of mother is taken.
2640 // NDVMX is the expected maximum number of divisions
2641 // (If 0, no protection tests are performed)
2642 //
2643 char vname[5];
2644 Vname(name,vname);
2645 char vmother[5];
2646 Vname(mother,vmother);
2647 gsdvt2(PASSCHARD(vname), PASSCHARD(vmother), step, iaxis, c0,
2648 numed, ndvmx PASSCHARL(vname) PASSCHARL(vmother));
2649}
2650
2651//_____________________________________________________________________________
2652void TGeant3::Gsord(const char *name, Int_t iax)
2653{
2654 //
2655 // Flags volume CHNAME whose contents will have to be ordered
2656 // along axis IAX, by setting the search flag to -IAX
2657 // IAX = 1 X axis
2658 // IAX = 2 Y axis
2659 // IAX = 3 Z axis
2660 // IAX = 4 Rxy (static ordering only -> GTMEDI)
2661 // IAX = 14 Rxy (also dynamic ordering -> GTNEXT)
2662 // IAX = 5 Rxyz (static ordering only -> GTMEDI)
2663 // IAX = 15 Rxyz (also dynamic ordering -> GTNEXT)
2664 // IAX = 6 PHI (PHI=0 => X axis)
2665 // IAX = 7 THETA (THETA=0 => Z axis)
2666 //
2667 char vname[5];
2668 Vname(name,vname);
2669 gsord(PASSCHARD(vname), iax PASSCHARL(vname));
2670}
2671
2672//_____________________________________________________________________________
2673void TGeant3::Gspos(const char *name, Int_t nr, const char *mother, Float_t x,
2674 Float_t y, Float_t z, Int_t irot, const char *konly)
2675{
2676 //
2677 // Position a volume into an existing one
2678 //
2679 // NAME Volume name
2680 // NUMBER Copy number of the volume
2681 // MOTHER Mother volume name
2682 // X X coord. of the volume in mother ref. sys.
2683 // Y Y coord. of the volume in mother ref. sys.
2684 // Z Z coord. of the volume in mother ref. sys.
2685 // IROT Rotation matrix number w.r.t. mother ref. sys.
2686 // ONLY ONLY/MANY flag
2687 //
2688 // It positions a previously defined volume in the mother.
2689 //
66d6a136 2690
fe4da5cc 2691 char vname[5];
2692 Vname(name,vname);
2693 char vmother[5];
2694 Vname(mother,vmother);
2695 gspos(PASSCHARD(vname), nr, PASSCHARD(vmother), x, y, z, irot,
2696 PASSCHARD(konly) PASSCHARL(vname) PASSCHARL(vmother)
2697 PASSCHARL(konly));
2698}
2699
2700//_____________________________________________________________________________
2701void TGeant3::Gsposp(const char *name, Int_t nr, const char *mother,
2702 Float_t x, Float_t y, Float_t z, Int_t irot,
2703 const char *konly, Float_t *upar, Int_t np )
2704{
2705 //
2706 // Place a copy of generic volume NAME with user number
2707 // NR inside MOTHER, with its parameters UPAR(1..NP)
2708 //
2709 char vname[5];
2710 Vname(name,vname);
2711 char vmother[5];
2712 Vname(mother,vmother);
2713 gsposp(PASSCHARD(vname), nr, PASSCHARD(vmother), x, y, z, irot,
2714 PASSCHARD(konly), upar, np PASSCHARL(vname) PASSCHARL(vmother)
2715 PASSCHARL(konly));
2716}
2717
2718//_____________________________________________________________________________
2719void TGeant3::Gsrotm(Int_t nmat, Float_t theta1, Float_t phi1, Float_t theta2,
2720 Float_t phi2, Float_t theta3, Float_t phi3)
2721{
2722 //
2723 // nmat Rotation matrix number
2724 // THETA1 Polar angle for axis I
2725 // PHI1 Azimuthal angle for axis I
2726 // THETA2 Polar angle for axis II
2727 // PHI2 Azimuthal angle for axis II
2728 // THETA3 Polar angle for axis III
2729 // PHI3 Azimuthal angle for axis III
2730 //
2731 // It defines the rotation matrix number IROT.
2732 //
2733 gsrotm(nmat, theta1, phi1, theta2, phi2, theta3, phi3);
2734}
2735
2736//_____________________________________________________________________________
2737void TGeant3::Gprotm(Int_t nmat)
2738{
2739 //
2740 // To print rotation matrices structure JROTM
2741 // nmat Rotation matrix number
2742 //
2743 gprotm(nmat);
2744}
2745
2746//_____________________________________________________________________________
2747Int_t TGeant3::Gsvolu(const char *name, const char *shape, Int_t nmed,
2748 Float_t *upar, Int_t npar)
2749{
2750 //
2751 // NAME Volume name
2752 // SHAPE Volume type
2753 // NUMED Tracking medium number
2754 // NPAR Number of shape parameters
2755 // UPAR Vector containing shape parameters
2756 //
2757 // It creates a new volume in the JVOLUM data structure.
2758 //
2759 Int_t ivolu = 0;
2760 char vname[5];
2761 Vname(name,vname);
2762 char vshape[5];
2763 Vname(shape,vshape);
2764 gsvolu(PASSCHARD(vname), PASSCHARD(vshape), nmed, upar, npar, ivolu
2765 PASSCHARL(vname) PASSCHARL(vshape));
2766 return ivolu;
2767}
2768
2769//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2770//
2771// T H E D R A W I N G P A C K A G E
2772// ======================================
2773// Drawing functions. These functions allow the visualization in several ways
2774// of the volumes defined in the geometrical data structure. It is possible
2775// to draw the logical tree of volumes belonging to the detector (DTREE),
2776// to show their geometrical specification (DSPEC,DFSPC), to draw them
2777// and their cut views (DRAW, DCUT). Moreover, it is possible to execute
2778// these commands when the hidden line removal option is activated; in
2779// this case, the volumes can be also either translated in the space
2780// (SHIFT), or clipped by boolean operation (CVOL). In addition, it is
2781// possible to fill the surfaces of the volumes
2782// with solid colours when the shading option (SHAD) is activated.
2783// Several tools (ZOOM, LENS) have been developed to zoom detailed parts
2784// of the detectors or to scan physical events as well.
2785// Finally, the command MOVE will allow the rotation, translation and zooming
2786// on real time parts of the detectors or tracks and hits of a simulated event.
2787// Ray-tracing commands. In case the command (DOPT RAYT ON) is executed,
2788// the drawing is performed by the Geant ray-tracing;
2789// automatically, the color is assigned according to the tracking medium of each
2790// volume and the volumes with a density lower/equal than the air are considered
2791// transparent; if the option (USER) is set (ON) (again via the command (DOPT)),
2792// the user can set color and visibility for the desired volumes via the command
2793// (SATT), as usual, relatively to the attributes (COLO) and (SEEN).
2794// The resolution can be set via the command (SATT * FILL VALUE), where (VALUE)
2795// is the ratio between the number of pixels drawn and 20 (user coordinates).
2796// Parallel view and perspective view are possible (DOPT PROJ PARA/PERS); in the
2797// first case, we assume that the first mother volume of the tree is a box with
2798// dimensions 10000 X 10000 X 10000 cm and the view point (infinetely far) is
2799// 5000 cm far from the origin along the Z axis of the user coordinates; in the
2800// second case, the distance between the observer and the origin of the world
2801// reference system is set in cm by the command (PERSP NAME VALUE); grand-angle
2802// or telescopic effects can be achieved changing the scale factors in the command
2803// (DRAW). When the final picture does not occupy the full window,
2804// mapping the space before tracing can speed up the drawing, but can also
2805// produce less precise results; values from 1 to 4 are allowed in the command
2806// (DOPT MAPP VALUE), the mapping being more precise for increasing (VALUE); for
2807// (VALUE = 0) no mapping is performed (therefore max precision and lowest speed).
2808// The command (VALCUT) allows the cutting of the detector by three planes
2809// ortogonal to the x,y,z axis. The attribute (LSTY) can be set by the command
2810// SATT for any desired volume and can assume values from 0 to 7; it determines
2811// the different light processing to be performed for different materials:
2812// 0 = dark-matt, 1 = bright-matt, 2 = plastic, 3 = ceramic, 4 = rough-metals,
2813// 5 = shiny-metals, 6 = glass, 7 = mirror. The detector is assumed to be in the
2814// dark, the ambient light luminosity is 0.2 for each basic hue (the saturation
2815// is 0.9) and the observer is assumed to have a light source (therefore he will
2816// produce parallel light in the case of parallel view and point-like-source
2817// light in the case of perspective view).
2818//
2819//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
2820
2821//_____________________________________________________________________________
2822void TGeant3::Gsatt(const char *name, const char *att, Int_t val)
2823{
2824 //
2825 // NAME Volume name
2826 // IOPT Name of the attribute to be set
2827 // IVAL Value to which the attribute is to be set
2828 //
2829 // name= "*" stands for all the volumes.
2830 // iopt can be chosen among the following :
2831 //
2832 // WORK 0=volume name is inactive for the tracking
2833 // 1=volume name is active for the tracking (default)
2834 //
2835 // SEEN 0=volume name is invisible
2836 // 1=volume name is visible (default)
2837 // -1=volume invisible with all its descendants in the tree
2838 // -2=volume visible but not its descendants in the tree
2839 //
2840 // LSTY line style 1,2,3,... (default=1)
2841 // LSTY=7 will produce a very precise approximation for
2842 // revolution bodies.
2843 //
2844 // LWID line width -7,...,1,2,3,..7 (default=1)
2845 // LWID<0 will act as abs(LWID) was set for the volume
2846 // and for all the levels below it. When SHAD is 'ON', LWID
2847 // represent the linewidth of the scan lines filling the surfaces
2848 // (whereas the FILL value represent their number). Therefore
2849 // tuning this parameter will help to obtain the desired
2850 // quality/performance ratio.
2851 //
2852 // COLO colour code -166,...,1,2,..166 (default=1)
2853 // n=1=black
2854 // n=2=red; n=17+m, m=0,25, increasing luminosity according to 'm';
2855 // n=3=green; n=67+m, m=0,25, increasing luminosity according to 'm';
2856 // n=4=blue; n=117+m, m=0,25, increasing luminosity according to 'm';
2857 // n=5=yellow; n=42+m, m=0,25, increasing luminosity according to 'm';
2858 // n=6=violet; n=142+m, m=0,25, increasing luminosity according to 'm';
2859 // n=7=lightblue; n=92+m, m=0,25, increasing luminosity according to 'm';
2860 // colour=n*10+m, m=1,2,...9, will produce the same colour
2861 // as 'n', but with increasing luminosity according to 'm';
2862 // COLO<0 will act as if abs(COLO) was set for the volume
2863 // and for all the levels below it.
2864 // When for a volume the attribute FILL is > 1 (and the
2865 // option SHAD is on), the ABS of its colour code must be < 8
2866 // because an automatic shading of its faces will be
2867 // performed.
2868 //
2869 // FILL (1992) fill area -7,...,0,1,...7 (default=0)
2870 // when option SHAD is "on" the FILL attribute of any
2871 // volume can be set different from 0 (normal drawing);
2872 // if it is set to 1, the faces of such volume will be filled
2873 // with solid colours; if ABS(FILL) is > 1, then a light
2874 // source is placed along the observer line, and the faces of
2875 // such volumes will be painted by colours whose luminosity
2876 // will depend on the amount of light reflected;
2877 // if ABS(FILL) = 1, then it is possible to use all the 166
2878 // colours of the colour table, becouse the automatic shading
2879 // is not performed;
2880 // for increasing values of FILL the drawing will be performed
2881 // with higher and higher resolution improving the quality (the
2882 // number of scan lines used to fill the faces increases with FILL);
2883 // it is possible to set different values of FILL
2884 // for different volumes, in order to optimize at the same time
2885 // the performance and the quality of the picture;
2886 // FILL<0 will act as if abs(FILL) was set for the volume
2887 // and for all the levels below it.
2888 // This kind of drawing can be saved in 'picture files'
2889 // or in view banks.
2890 // 0=drawing without fill area
2891 // 1=faces filled with solid colours and resolution = 6
2892 // 2=lowest resolution (very fast)
2893 // 3=default resolution
2894 // 4=.................
2895 // 5=.................
2896 // 6=.................
2897 // 7=max resolution
2898 // Finally, if a coloured background is desired, the FILL
2899 // attribute for the first volume of the tree must be set
2900 // equal to -abs(colo), colo being >0 and <166.
2901 //
2902 // SET set number associated to volume name
2903 // DET detector number associated to volume name
2904 // DTYP detector type (1,2)
2905 //
2906 InitHIGZ();
2907 char vname[5];
2908 Vname(name,vname);
2909 char vatt[5];
2910 Vname(att,vatt);
2911 gsatt(PASSCHARD(vname), PASSCHARD(vatt), val PASSCHARL(vname)
2912 PASSCHARL(vatt));
2913}
2914
2915//_____________________________________________________________________________
2916void TGeant3::Gfpara(const char *name, Int_t number, Int_t intext, Int_t& npar,
2917 Int_t& natt, Float_t* par, Float_t* att)
2918{
2919 //
2920 // Find the parameters of a volume
2921 //
2922 gfpara(PASSCHARD(name), number, intext, npar, natt, par, att
2923 PASSCHARL(name));
2924}
2925
2926//_____________________________________________________________________________
2927void TGeant3::Gckpar(Int_t ish, Int_t npar, Float_t* par)
2928{
2929 //
2930 // Check the parameters of a shape
2931 //
2932 gckpar(ish,npar,par);
2933}
2934
2935//_____________________________________________________________________________
2936void TGeant3::Gckmat(Int_t itmed, char* natmed)
2937{
2938 //
2939 // Check the parameters of a tracking medium
2940 //
2941 gckmat(itmed, PASSCHARD(natmed) PASSCHARL(natmed));
2942}
2943
57993b1f 2944//_____________________________________________________________________________
2945Int_t TGeant3::Glvolu(Int_t nlev, Int_t *lnam,Int_t *lnum)
2946{
2947 //
2948 // nlev number of leveles deap into the volume tree
2949 // size of the arrays lnam and lnum
2950 // lnam an integer array whos 4 bytes contain the askii code for the
2951 // volume names
2952 // lnum an integer array containing the copy numbers for that specific
2953 // volume
2954 //
2955 // This routine fills the volulme paramters in common /gcvolu/ for a
2956 // physical tree, specified by the list lnam and lnum of volume names
2957 // and numbers, and for all its ascendants up to level 1. This routine
2958 // is optimsed and does not re-compute the part of the history already
2959 // available in GCVOLU. This means that if it is used in user programs
2960 // outside the usual framwork of the tracking, the user has to initilise
2961 // to zero NLEVEL in the common GCVOLU. It return 0 if there were no
2962 // problems in make the call.
2963 //
2964 Int_t ier;
2965 glvolu(nlev, lnam, lnum, ier);
2966 return ier;
2967}
2968
fe4da5cc 2969//_____________________________________________________________________________
2970void TGeant3::Gdelete(Int_t iview)
2971{
2972 //
2973 // IVIEW View number
2974 //
2975 // It deletes a view bank from memory.
2976 //
2977 gdelet(iview);
2978}
2979
2980//_____________________________________________________________________________
2981void TGeant3::Gdopen(Int_t iview)
2982{
2983 //
2984 // IVIEW View number
2985 //
2986 // When a drawing is very complex and requires a long time to be
2987 // executed, it can be useful to store it in a view bank: after a
2988 // call to DOPEN and the execution of the drawing (nothing will
2989 // appear on the screen), and after a necessary call to DCLOSE,
2990 // the contents of the bank can be displayed in a very fast way
2991 // through a call to DSHOW; therefore, the detector can be easily
2992 // zoomed many times in different ways. Please note that the pictures
2993 // with solid colours can now be stored in a view bank or in 'PICTURE FILES'
2994 //
2995 InitHIGZ();
8918e700 2996 gHigz->Clear();
fe4da5cc 2997 gdopen(iview);
2998}
2999
3000//_____________________________________________________________________________
3001void TGeant3::Gdclose()
3002{
3003 //
3004 // It closes the currently open view bank; it must be called after the
3005 // end of the drawing to be stored.
3006 //
3007 gdclos();
3008}
3009
3010//_____________________________________________________________________________
3011void TGeant3::Gdshow(Int_t iview)
3012{
3013 //
3014 // IVIEW View number
3015 //
3016 // It shows on the screen the contents of a view bank. It
3017 // can be called after a view bank has been closed.
3018 //
3019 gdshow(iview);
3020}
3021
3022//_____________________________________________________________________________
3023void TGeant3::Gdopt(const char *name,const char *value)
3024{
3025 //
3026 // NAME Option name
3027 // VALUE Option value
3028 //
3029 // To set/modify the drawing options.
3030 // IOPT IVAL Action
3031 //
3032 // THRZ ON Draw tracks in R vs Z
3033 // OFF (D) Draw tracks in X,Y,Z
3034 // 180
3035 // 360
3036 // PROJ PARA (D) Parallel projection
3037 // PERS Perspective
3038 // TRAK LINE (D) Trajectory drawn with lines
3039 // POIN " " with markers
3040 // HIDE ON Hidden line removal using the CG package
3041 // OFF (D) No hidden line removal
3042 // SHAD ON Fill area and shading of surfaces.
3043 // OFF (D) Normal hidden line removal.
3044 // RAYT ON Ray-tracing on.
3045 // OFF (D) Ray-tracing off.
3046 // EDGE OFF Does not draw contours when shad is on.
3047 // ON (D) Normal shading.
3048 // MAPP 1,2,3,4 Mapping before ray-tracing.
3049 // 0 (D) No mapping.
3050 // USER ON User graphics options in the raytracing.
3051 // OFF (D) Automatic graphics options.
3052 //
3053 InitHIGZ();
3054 char vname[5];
3055 Vname(name,vname);
3056 char vvalue[5];
3057 Vname(value,vvalue);
3058 gdopt(PASSCHARD(vname), PASSCHARD(vvalue) PASSCHARL(vname)
3059 PASSCHARL(vvalue));
3060}
3061
3062//_____________________________________________________________________________
3063void TGeant3::Gdraw(const char *name,Float_t theta, Float_t phi, Float_t psi,
3064 Float_t u0,Float_t v0,Float_t ul,Float_t vl)
3065{
3066 //
3067 // NAME Volume name
3068 // +
3069 // THETA Viewing angle theta (for 3D projection)
3070 // PHI Viewing angle phi (for 3D projection)
3071 // PSI Viewing angle psi (for 2D rotation)
3072 // U0 U-coord. (horizontal) of volume origin
3073 // V0 V-coord. (vertical) of volume origin
3074 // SU Scale factor for U-coord.
3075 // SV Scale factor for V-coord.
3076 //
3077 // This function will draw the volumes,
3078 // selected with their graphical attributes, set by the Gsatt
3079 // facility. The drawing may be performed with hidden line removal
3080 // and with shading effects according to the value of the options HIDE
3081 // and SHAD; if the option SHAD is ON, the contour's edges can be
3082 // drawn or not. If the option HIDE is ON, the detector can be
3083 // exploded (BOMB), clipped with different shapes (CVOL), and some
3084 // of its parts can be shifted from their original
3085 // position (SHIFT). When HIDE is ON, if
3086 // the drawing requires more than the available memory, the program
3087 // will evaluate and display the number of missing words
3088 // (so that the user can increase the
3089 // size of its ZEBRA store). Finally, at the end of each drawing (with HIDE on),
3090 // the program will print messages about the memory used and
3091 // statistics on the volumes' visibility.
3092 // The following commands will produce the drawing of a green
3093 // volume, specified by NAME, without using the hidden line removal
3094 // technique, using the hidden line removal technique,
3095 // with different linewidth and colour (red), with
3096 // solid colour, with shading of surfaces, and without edges.
3097 // Finally, some examples are given for the ray-tracing. (A possible
3098 // string for the NAME of the volume can be found using the command DTREE).
3099 //
3100 InitHIGZ();
8918e700 3101 gHigz->Clear();
fe4da5cc 3102 char vname[5];
3103 Vname(name,vname);
3104 if (fGcvdma->raytra != 1) {
3105 gdraw(PASSCHARD(vname), theta,phi,psi,u0,v0,ul,vl PASSCHARL(vname));
3106 } else {
3107 gdrayt(PASSCHARD(vname), theta,phi,psi,u0,v0,ul,vl PASSCHARL(vname));
3108 }
3109}
3110
3111//_____________________________________________________________________________
3112void TGeant3::Gdrawc(const char *name,Int_t axis, Float_t cut,Float_t u0,
3113 Float_t v0,Float_t ul,Float_t vl)
3114{
3115 //
3116 // NAME Volume name
3117 // CAXIS Axis value
3118 // CUTVAL Cut plane distance from the origin along the axis
3119 // +
3120 // U0 U-coord. (horizontal) of volume origin
3121 // V0 V-coord. (vertical) of volume origin
3122 // SU Scale factor for U-coord.
3123 // SV Scale factor for V-coord.
3124 //
3125 // The cut plane is normal to caxis (X,Y,Z), corresponding to iaxis (1,2,3),
3126 // and placed at the distance cutval from the origin.
3127 // The resulting picture is seen from the the same axis.
3128 // When HIDE Mode is ON, it is possible to get the same effect with
3129 // the CVOL/BOX function.
3130 //
3131 InitHIGZ();
8918e700 3132 gHigz->Clear();
fe4da5cc 3133 char vname[5];
3134 Vname(name,vname);
3135 gdrawc(PASSCHARD(vname), axis,cut,u0,v0,ul,vl PASSCHARL(vname));
3136}
3137
3138//_____________________________________________________________________________
3139void TGeant3::Gdrawx(const char *name,Float_t cutthe, Float_t cutphi,
3140 Float_t cutval, Float_t theta, Float_t phi, Float_t u0,
3141 Float_t v0,Float_t ul,Float_t vl)
3142{
3143 //
3144 // NAME Volume name
3145 // CUTTHE Theta angle of the line normal to cut plane
3146 // CUTPHI Phi angle of the line normal to cut plane
3147 // CUTVAL Cut plane distance from the origin along the axis
3148 // +
3149 // THETA Viewing angle theta (for 3D projection)
3150 // PHI Viewing angle phi (for 3D projection)
3151 // U0 U-coord. (horizontal) of volume origin
3152 // V0 V-coord. (vertical) of volume origin
3153 // SU Scale factor for U-coord.
3154 // SV Scale factor for V-coord.
3155 //
3156 // The cut plane is normal to the line given by the cut angles
3157 // cutthe and cutphi and placed at the distance cutval from the origin.
3158 // The resulting picture is seen from the viewing angles theta,phi.
3159 //
3160 InitHIGZ();
8918e700 3161 gHigz->Clear();
fe4da5cc 3162 char vname[5];
3163 Vname(name,vname);
3164 gdrawx(PASSCHARD(vname), cutthe,cutphi,cutval,theta,phi,u0,v0,ul,vl
3165 PASSCHARL(vname));
3166}
3167
3168//_____________________________________________________________________________
3169void TGeant3::Gdhead(Int_t isel, const char *name, Float_t chrsiz)
3170{
3171 //
3172 // Parameters
3173 // +
3174 // ISEL Option flag D=111110
3175 // NAME Title
3176 // CHRSIZ Character size (cm) of title NAME D=0.6
3177 //
3178 // ISEL =
3179 // 0 to have only the header lines
3180 // xxxxx1 to add the text name centered on top of header
3181 // xxxx1x to add global detector name (first volume) on left
3182 // xxx1xx to add date on right
3183 // xx1xxx to select thick characters for text on top of header
3184 // x1xxxx to add the text 'EVENT NR x' on top of header
3185 // 1xxxxx to add the text 'RUN NR x' on top of header
3186 // NOTE that ISEL=x1xxx1 or ISEL=1xxxx1 are illegal choices,
3187 // i.e. they generate overwritten text.
3188 //
3189 gdhead(isel,PASSCHARD(name),chrsiz PASSCHARL(name));
3190}
3191
3192//_____________________________________________________________________________
3193void TGeant3::Gdman(Float_t u, Float_t v, const char *type)
3194{
3195 //
3196 // Draw a 2D-man at position (U0,V0)
3197 // Parameters
3198 // U U-coord. (horizontal) of the centre of man' R
3199 // V V-coord. (vertical) of the centre of man' R
3200 // TYPE D='MAN' possible values: 'MAN,WM1,WM2,WM3'
3201 //
3202 // CALL GDMAN(u,v),CALL GDWMN1(u,v),CALL GDWMN2(u,v),CALL GDWMN2(u,v)
3203 // It superimposes the picure of a man or of a woman, chosen among
3204 // three different ones, with the same scale factors as the detector
3205 // in the current drawing.
3206 //
3207 TString opt = type;
3208 if (opt.Contains("WM1")) {
3209 gdwmn1(u,v);
3210 } else if (opt.Contains("WM3")) {
3211 gdwmn3(u,v);
3212 } else if (opt.Contains("WM2")) {
3213 gdwmn2(u,v);
3214 } else {
3215 gdman(u,v);
3216 }
3217}
3218
3219//_____________________________________________________________________________
3220void TGeant3::Gdspec(const char *name)
3221{
3222 //
3223 // NAME Volume name
3224 //
3225 // Shows 3 views of the volume (two cut-views and a 3D view), together with
3226 // its geometrical specifications. The 3D drawing will
3227 // be performed according the current values of the options HIDE and
3228 // SHAD and according the current SetClipBox clipping parameters for that
3229 // volume.
3230 //
3231 InitHIGZ();
8918e700 3232 gHigz->Clear();
fe4da5cc 3233 char vname[5];
3234 Vname(name,vname);
3235 gdspec(PASSCHARD(vname) PASSCHARL(vname));
3236}
3237
3238//_____________________________________________________________________________
3239void TGeant3::DrawOneSpec(const char *name)
3240{
3241 //
3242 // Function called when one double-clicks on a volume name
3243 // in a TPavelabel drawn by Gdtree.
3244 //
8918e700 3245 THIGZ *higzSave = gHigz;
fe4da5cc 3246 higzSave->SetName("higzSave");
3247 THIGZ *higzSpec = (THIGZ*)gROOT->FindObject("higzSpec");
8918e700 3248 //printf("DrawOneSpec, gHigz=%x, higzSpec=%x\n",gHigz,higzSpec);
3249 if (higzSpec) gHigz = higzSpec;
ef42d733 3250 else higzSpec = new THIGZ(kDefSize);
fe4da5cc 3251 higzSpec->SetName("higzSpec");
3252 higzSpec->cd();
3253 higzSpec->Clear();
3254 char vname[5];
3255 Vname(name,vname);
3256 gdspec(PASSCHARD(vname) PASSCHARL(vname));
3257 higzSpec->Update();
3258 higzSave->cd();
3259 higzSave->SetName("higz");
8918e700 3260 gHigz = higzSave;
fe4da5cc 3261}
3262
3263//_____________________________________________________________________________
3264void TGeant3::Gdtree(const char *name,Int_t levmax, Int_t isel)
3265{
3266 //
3267 // NAME Volume name
3268 // LEVMAX Depth level
3269 // ISELT Options
3270 //
3271 // This function draws the logical tree,
3272 // Each volume in the tree is represented by a TPaveTree object.
3273 // Double-clicking on a TPaveTree draws the specs of the corresponding volume.
3274 // Use TPaveTree pop-up menu to select:
3275 // - drawing specs
3276 // - drawing tree
3277 // - drawing tree of parent
3278 //
3279 InitHIGZ();
8918e700 3280 gHigz->Clear();
fe4da5cc 3281 char vname[5];
3282 Vname(name,vname);
3283 gdtree(PASSCHARD(vname), levmax, isel PASSCHARL(vname));
ef42d733 3284 gHigz->SetPname("");
fe4da5cc 3285}
3286
3287//_____________________________________________________________________________
3288void TGeant3::GdtreeParent(const char *name,Int_t levmax, Int_t isel)
3289{
3290 //
3291 // NAME Volume name
3292 // LEVMAX Depth level
3293 // ISELT Options
3294 //
3295 // This function draws the logical tree of the parent of name.
3296 //
3297 InitHIGZ();
8918e700 3298 gHigz->Clear();
fe4da5cc 3299 // Scan list of volumes in JVOLUM
3300 char vname[5];
3301 Int_t gname, i, jvo, in, nin, jin, num;
3302 strncpy((char *) &gname, name, 4);
3303 for(i=1; i<=fGcnum->nvolum; i++) {
3304 jvo = fZlq[fGclink->jvolum-i];
3305 nin = Int_t(fZq[jvo+3]);
3306 if (nin == -1) nin = 1;
3307 for (in=1;in<=nin;in++) {
3308 jin = fZlq[jvo-in];
3309 num = Int_t(fZq[jin+2]);
3310 if(gname == fZiq[fGclink->jvolum+num]) {
3311 strncpy(vname,(char*)&fZiq[fGclink->jvolum+i],4);
3312 vname[4] = 0;
3313 gdtree(PASSCHARD(vname), levmax, isel PASSCHARL(vname));
ef42d733 3314 gHigz->SetPname("");
fe4da5cc 3315 return;
3316 }
3317 }
3318 }
3319}
3320
3321//_____________________________________________________________________________
3322void TGeant3::SetABAN(Int_t par)
3323{
3324 //
3325 // par = 1 particles will be stopped according to their residual
3326 // range if they are not in a sensitive material and are
3327 // far enough from the boundary
3328 // 0 particles are transported normally
3329 //
3330 fGcphys->dphys1 = par;
3331}
3332
3333
3334//_____________________________________________________________________________
3335void TGeant3::SetANNI(Int_t par)
3336{
3337 //
3338 // To control positron annihilation.
3339 // par =0 no annihilation
3340 // =1 annihilation. Decays processed.
3341 // =2 annihilation. No decay products stored.
3342 //
3343 fGcphys->ianni = par;
3344}
3345
3346
3347//_____________________________________________________________________________
3348void TGeant3::SetAUTO(Int_t par)
3349{
3350 //
3351 // To control automatic calculation of tracking medium parameters:
3352 // par =0 no automatic calculation;
3353 // =1 automati calculation.
3354 //
3355 fGctrak->igauto = par;
3356}
3357
3358
3359//_____________________________________________________________________________
3360void TGeant3::SetBOMB(Float_t boom)
3361{
3362 //
3363 // BOOM : Exploding factor for volumes position
3364 //
3365 // To 'explode' the detector. If BOOM is positive (values smaller
3366 // than 1. are suggested, but any value is possible)
3367 // all the volumes are shifted by a distance
3368 // proportional to BOOM along the direction between their centre
3369 // and the origin of the MARS; the volumes which are symmetric
3370 // with respect to this origin are simply not shown.
3371 // BOOM equal to 0 resets the normal mode.
3372 // A negative (greater than -1.) value of
3373 // BOOM will cause an 'implosion'; for even lower values of BOOM
3374 // the volumes' positions will be reflected respect to the origin.
3375 // This command can be useful to improve the 3D effect for very
3376 // complex detectors. The following commands will make explode the
3377 // detector:
3378 //
3379 InitHIGZ();
3380 setbomb(boom);
3381}
3382
3383//_____________________________________________________________________________
3384void TGeant3::SetBREM(Int_t par)
3385{
3386 //
3387 // To control bremstrahlung.
3388 // par =0 no bremstrahlung
3389 // =1 bremstrahlung. Photon processed.
3390 // =2 bremstrahlung. No photon stored.
3391 //
3392 fGcphys->ibrem = par;
3393}
3394
3395
3396//_____________________________________________________________________________
3397void TGeant3::SetCKOV(Int_t par)
3398{
3399 //
3400 // To control Cerenkov production
3401 // par =0 no Cerenkov;
3402 // =1 Cerenkov;
3403 // =2 Cerenkov with primary stopped at each step.
3404 //
3405 fGctlit->itckov = par;
3406}
3407
3408
3409//_____________________________________________________________________________
3410void TGeant3::SetClipBox(const char *name,Float_t xmin,Float_t xmax,
3411 Float_t ymin,Float_t ymax,Float_t zmin,Float_t zmax)
3412{
3413 //
3414 // The hidden line removal technique is necessary to visualize properly
3415 // very complex detectors. At the same time, it can be useful to visualize
3416 // the inner elements of a detector in detail. This function allows
3417 // subtractions (via boolean operation) of BOX shape from any part of
3418 // the detector, therefore showing its inner contents.
3419 // If "*" is given as the name of the
3420 // volume to be clipped, all volumes are clipped by the given box.
3421 // A volume can be clipped at most twice.
3422 // if a volume is explicitely clipped twice,
3423 // the "*" will not act on it anymore. Giving "." as the name
3424 // of the volume to be clipped will reset the clipping.
3425 // Parameters
3426 // NAME Name of volume to be clipped
3427 // +
3428 // XMIN Lower limit of the Shape X coordinate
3429 // XMAX Upper limit of the Shape X coordinate
3430 // YMIN Lower limit of the Shape Y coordinate
3431 // YMAX Upper limit of the Shape Y coordinate
3432 // ZMIN Lower limit of the Shape Z coordinate
3433 // ZMAX Upper limit of the Shape Z coordinate
3434 //
3435 // This function performs a boolean subtraction between the volume
3436 // NAME and a box placed in the MARS according the values of the given
3437 // coordinates.
3438
3439 InitHIGZ();
3440 char vname[5];
3441 Vname(name,vname);
3442 setclip(PASSCHARD(vname),xmin,xmax,ymin,ymax,zmin,zmax PASSCHARL(vname));
3443}
3444
3445//_____________________________________________________________________________
3446void TGeant3::SetCOMP(Int_t par)
3447{
3448 //
3449 // To control Compton scattering
3450 // par =0 no Compton
3451 // =1 Compton. Electron processed.
3452 // =2 Compton. No electron stored.
3453 //
3454 //
3455 fGcphys->icomp = par;
3456}
3457
3458//_____________________________________________________________________________
3459void TGeant3::SetCUTS(Float_t cutgam,Float_t cutele,Float_t cutneu,
3460 Float_t cuthad,Float_t cutmuo ,Float_t bcute ,
3461 Float_t bcutm ,Float_t dcute ,Float_t dcutm ,
3462 Float_t ppcutm, Float_t tofmax)
3463{
3464 //
3465 // CUTGAM Cut for gammas D=0.001
3466 // CUTELE Cut for electrons D=0.001
3467 // CUTHAD Cut for charged hadrons D=0.01
3468 // CUTNEU Cut for neutral hadrons D=0.01
3469 // CUTMUO Cut for muons D=0.01
3470 // BCUTE Cut for electron brems. D=-1.
3471 // BCUTM Cut for muon brems. D=-1.
3472 // DCUTE Cut for electron delta-rays D=-1.
3473 // DCUTM Cut for muon delta-rays D=-1.
3474 // PPCUTM Cut for e+e- pairs by muons D=0.01
3475 // TOFMAX Time of flight cut D=1.E+10
3476 //
3477 // If the default values (-1.) for BCUTE ,BCUTM ,DCUTE ,DCUTM
3478 // are not modified, they will be set to CUTGAM,CUTGAM,CUTELE,CUTELE
3479 // respectively.
3480 // If one of the parameters from CUTGAM to PPCUTM included
3481 // is modified, cross-sections and energy loss tables must be
3482 // recomputed via the function Gphysi.
3483 //
3484 fGccuts->cutgam = cutgam;
3485 fGccuts->cutele = cutele;
3486 fGccuts->cutneu = cutneu;
3487 fGccuts->cuthad = cuthad;
3488 fGccuts->cutmuo = cutmuo;
3489 fGccuts->bcute = bcute;
3490 fGccuts->bcutm = bcutm;
3491 fGccuts->dcute = dcute;
3492 fGccuts->dcutm = dcutm;
3493 fGccuts->ppcutm = ppcutm;
3494 fGccuts->tofmax = tofmax;
3495}
3496
3497//_____________________________________________________________________________
3498void TGeant3::SetDCAY(Int_t par)
3499{
3500 //
3501 // To control Decay mechanism.
3502 // par =0 no decays.
3503 // =1 Decays. secondaries processed.
3504 // =2 Decays. No secondaries stored.
3505 //
3506 fGcphys->idcay = par;
3507}
3508
3509
3510//_____________________________________________________________________________
3511void TGeant3::SetDEBU(Int_t emin, Int_t emax, Int_t emod)
3512{
3513 //
3514 // Set the debug flag and frequency
3515 // Selected debug output will be printed from
3516 // event emin to even emax each emod event
3517 //
3518 fGcflag->idemin = emin;
3519 fGcflag->idemax = emax;
3520 fGcflag->itest = emod;
3521}
3522
3523
3524//_____________________________________________________________________________
3525void TGeant3::SetDRAY(Int_t par)
3526{
3527 //
3528 // To control delta rays mechanism.
3529 // par =0 no delta rays.
3530 // =1 Delta rays. secondaries processed.
3531 // =2 Delta rays. No secondaries stored.
3532 //
3533 fGcphys->idray = par;
3534}
3535
9e7a32d1 3536//_____________________________________________________________________________
3537void TGeant3::SetERAN(Float_t ekmin, Float_t ekmax, Int_t nekbin)
3538{
3539 //
3540 // To control cross section tabulations
3541 // ekmin = minimum kinetic energy in GeV
3542 // ekmax = maximum kinetic energy in GeV
3543 // nekbin = number of logatithmic bins (<200)
3544 //
3545 fGcmulo->ekmin = ekmin;
3546 fGcmulo->ekmax = ekmax;
3547 fGcmulo->nekbin = nekbin;
3548}
3549
fe4da5cc 3550//_____________________________________________________________________________
3551void TGeant3::SetHADR(Int_t par)
3552{
3553 //
3554 // To control hadronic interactions.
3555 // par =0 no hadronic interactions.
3556 // =1 Hadronic interactions. secondaries processed.
3557 // =2 Hadronic interactions. No secondaries stored.
3558 //
3559 fGcphys->ihadr = par;
3560}
3561
3562//_____________________________________________________________________________
3563void TGeant3::SetKINE(Int_t kine, Float_t xk1, Float_t xk2, Float_t xk3,
3564 Float_t xk4, Float_t xk5, Float_t xk6, Float_t xk7,
3565 Float_t xk8, Float_t xk9, Float_t xk10)
3566{
3567 //
3568 // Set the variables in /GCFLAG/ IKINE, PKINE(10)
3569 // Their meaning is user defined
3570 //
3571 fGckine->ikine = kine;
3572 fGckine->pkine[0] = xk1;
3573 fGckine->pkine[1] = xk2;
3574 fGckine->pkine[2] = xk3;
3575 fGckine->pkine[3] = xk4;
3576 fGckine->pkine[4] = xk5;
3577 fGckine->pkine[5] = xk6;
3578 fGckine->pkine[6] = xk7;
3579 fGckine->pkine[7] = xk8;
3580 fGckine->pkine[8] = xk9;
3581 fGckine->pkine[9] = xk10;
3582}
3583
3584//_____________________________________________________________________________
3585void TGeant3::SetLOSS(Int_t par)
3586{
3587 //
3588 // To control energy loss.
3589 // par =0 no energy loss;
3590 // =1 restricted energy loss fluctuations;
3591 // =2 complete energy loss fluctuations;
3592 // =3 same as 1;
3593 // =4 no energy loss fluctuations.
3594 // If the value ILOSS is changed, then cross-sections and energy loss
3595 // tables must be recomputed via the command 'PHYSI'.
3596 //
3597 fGcphys->iloss = par;
3598}
3599
3600
3601//_____________________________________________________________________________
3602void TGeant3::SetMULS(Int_t par)
3603{
3604 //
3605 // To control multiple scattering.
3606 // par =0 no multiple scattering.
3607 // =1 Moliere or Coulomb scattering.
3608 // =2 Moliere or Coulomb scattering.
3609 // =3 Gaussian scattering.
3610 //
3611 fGcphys->imuls = par;
3612}
3613
3614
3615//_____________________________________________________________________________
3616void TGeant3::SetMUNU(Int_t par)
3617{
3618 //
3619 // To control muon nuclear interactions.
3620 // par =0 no muon-nuclear interactions.
3621 // =1 Nuclear interactions. Secondaries processed.
3622 // =2 Nuclear interactions. Secondaries not processed.
3623 //
3624 fGcphys->imunu = par;
3625}
3626
3627//_____________________________________________________________________________
3628void TGeant3::SetOPTI(Int_t par)
3629{
3630 //
3631 // This flag controls the tracking optimisation performed via the
3632 // GSORD routine:
3633 // 1 no optimisation at all; GSORD calls disabled;
3634 // 0 no optimisation; only user calls to GSORD kept;
3635 // 1 all non-GSORDered volumes are ordered along the best axis;
3636 // 2 all volumes are ordered along the best axis.
3637 //
3638 fGcopti->ioptim = par;
3639}
3640
3641//_____________________________________________________________________________
3642void TGeant3::SetPAIR(Int_t par)
3643{
3644 //
3645 // To control pair production mechanism.
3646 // par =0 no pair production.
3647 // =1 Pair production. secondaries processed.
3648 // =2 Pair production. No secondaries stored.
3649 //
3650 fGcphys->ipair = par;
3651}
3652
3653
3654//_____________________________________________________________________________
3655void TGeant3::SetPFIS(Int_t par)
3656{
3657 //
3658 // To control photo fission mechanism.
3659 // par =0 no photo fission.
3660 // =1 Photo fission. secondaries processed.
3661 // =2 Photo fission. No secondaries stored.
3662 //
3663 fGcphys->ipfis = par;
3664}
3665
3666//_____________________________________________________________________________
3667void TGeant3::SetPHOT(Int_t par)
3668{
3669 //
3670 // To control Photo effect.
3671 // par =0 no photo electric effect.
3672 // =1 Photo effect. Electron processed.
3673 // =2 Photo effect. No electron stored.
3674 //
3675 fGcphys->iphot = par;
3676}
3677
3678//_____________________________________________________________________________
3679void TGeant3::SetRAYL(Int_t par)
3680{
3681 //
3682 // To control Rayleigh scattering.
3683 // par =0 no Rayleigh scattering.
3684 // =1 Rayleigh.
3685 //
3686 fGcphys->irayl = par;
3687}
3688
fd91b664 3689//_____________________________________________________________________________
3690void TGeant3::SetSTRA(Int_t par)
3691{
3692 //
3693 // To control energy loss fluctuations
3694 // with the PhotoAbsorption Ionisation model.
3695 // par =0 no Straggling.
3696 // =1 Straggling yes => no Delta rays.
3697 //
3698 fGcphlt->istra = par;
3699}
3700
fe4da5cc 3701//_____________________________________________________________________________
3702void TGeant3::SetSWIT(Int_t sw, Int_t val)
3703{
3704 //
3705 // sw Switch number
3706 // val New switch value
3707 //
3708 // Change one element of array ISWIT(10) in /GCFLAG/
3709 //
3710 if (sw <= 0 || sw > 10) return;
3711 fGcflag->iswit[sw-1] = val;
3712}
3713
3714
3715//_____________________________________________________________________________
3716void TGeant3::SetTRIG(Int_t nevents)
3717{
3718 //
3719 // Set number of events to be run
3720 //
3721 fGcflag->nevent = nevents;
3722}
3723
7ac3f11b 3724//_____________________________________________________________________________
1578254f 3725void TGeant3::SetUserDecay(Int_t pdg)
7ac3f11b 3726{
3727 //
3728 // Force the decays of particles to be done with Pythia
3729 // and not with the Geant routines.
3730 // just kill pointers doing mzdrop
3731 //
1578254f 3732 Int_t ipart = IdFromPDG(pdg);
3733 if(ipart<0) {
3734 printf("Particle %d not in geant\n",pdg);
3735 return;
3736 }
7ac3f11b 3737 Int_t jpart=fGclink->jpart;
3738 Int_t jpa=fZlq[jpart-ipart];
3739 //
3740 if(jpart && jpa) {
3741 Int_t jpa1=fZlq[jpa-1];
3742 if(jpa1)
3743 mzdrop(fGcbank->ixcons,jpa1,PASSCHARD(" ") PASSCHARL(" "));
3744 Int_t jpa2=fZlq[jpa-2];
3745 if(jpa2)
3746 mzdrop(fGcbank->ixcons,jpa2,PASSCHARD(" ") PASSCHARL(" "));
3747 }
3748}
3749
fe4da5cc 3750//______________________________________________________________________________
3751void TGeant3::Vname(const char *name, char *vname)
3752{
3753 //
3754 // convert name to upper case. Make vname at least 4 chars
3755 //
3756 Int_t l = strlen(name);
3757 Int_t i;
3758 l = l < 4 ? l : 4;
3759 for (i=0;i<l;i++) vname[i] = toupper(name[i]);
3760 for (i=l;i<4;i++) vname[i] = ' ';
3761 vname[4] = 0;
3762}
3763
6991054d 3764//______________________________________________________________________________
3765void TGeant3::Ertrgo()
3766{
ef42d733 3767 //
3768 // Perform the tracking of the track Track parameters are in VECT
3769 //
6991054d 3770 ertrgo();
3771}
3772
3773//______________________________________________________________________________
3774void TGeant3::Ertrak(const Float_t *const x1, const Float_t *const p1,
3775 const Float_t *x2, const Float_t *p2,
3776 Int_t ipa, Option_t *chopt)
3777{
ef42d733 3778 //************************************************************************
3779 //* *
3780 //* Perform the tracking of the track from point X1 to *
3781 //* point X2 *
3782 //* (Before calling this routine the user should also provide *
3783 //* the input informations in /EROPTS/ and /ERTRIO/ *
3784 //* using subroutine EUFIL(L/P/V) *
3785 //* X1 - Starting coordinates (Cartesian) *
3786 //* P1 - Starting 3-momentum (Cartesian) *
3787 //* X2 - Final coordinates (Cartesian) *
3788 //* P2 - Final 3-momentum (Cartesian) *
3789 //* IPA - Particle code (a la GEANT) of the track *
3790 //* *
3791 //* CHOPT *
3792 //* 'B' 'Backward tracking' - i.e. energy loss *
3793 //* added to the current energy *
3794 //* 'E' 'Exact' calculation of errors assuming *
3795 //* helix (i.e. pathlength not *
3796 //* assumed as infinitesimal) *
3797 //* 'L' Tracking upto prescribed Lengths reached *
3798 //* 'M' 'Mixed' prediction (not yet coded) *
3799 //* 'O' Tracking 'Only' without calculating errors *
3800 //* 'P' Tracking upto prescribed Planes reached *
3801 //* 'V' Tracking upto prescribed Volumes reached *
3802 //* 'X' Tracking upto prescribed Point approached *
3803 //* *
3804 //* Interface with GEANT : *
3805 //* Track parameters are in /CGKINE/ and /GCTRAK/ *
3806 //* *
3807 //* ==>Called by : USER *
3808 //* Authors M.Maire, E.Nagy ********//* *
3809 //* *
3810 //************************************************************************
6991054d 3811 ertrak(x1,p1,x2,p2,ipa,PASSCHARD(chopt) PASSCHARL(chopt));
3812}
3813
fe4da5cc 3814//_____________________________________________________________________________
3815void TGeant3::WriteEuclid(const char* filnam, const char* topvol,
3816 Int_t number, Int_t nlevel)
3817{
3818 //
3819 //
3820 // ******************************************************************
3821 // * *
3822 // * Write out the geometry of the detector in EUCLID file format *
3823 // * *
3824 // * filnam : will be with the extension .euc *
3825 // * topvol : volume name of the starting node *
3826 // * number : copy number of topvol (relevant for gsposp) *
3827 // * nlevel : number of levels in the tree structure *
3828 // * to be written out, starting from topvol *
3829 // * *
3830 // * Author : M. Maire *
3831 // * *
3832 // ******************************************************************
3833 //
3834 // File filnam.tme is written out with the definitions of tracking
3835 // medias and materials.
3836 // As to restore original numbers for materials and medias, program
3837 // searches in the file euc_medi.dat and comparing main parameters of
3838 // the mat. defined inside geant and the one in file recognizes them
3839 // and is able to take number from file. If for any material or medium,
3840 // this procedure fails, ordering starts from 1.
3841 // Arrays IOTMED and IOMATE are used for this procedure
3842 //
ef42d733 3843 const char kShape[][5]={"BOX ","TRD1","TRD2","TRAP","TUBE","TUBS","CONE",
fe4da5cc 3844 "CONS","SPHE","PARA","PGON","PCON","ELTU","HYPE",
3845 "GTRA","CTUB"};
3846 Int_t i, end, itm, irm, jrm, k, nmed;
3847 Int_t imxtmed=0;
3848 Int_t imxmate=0;
3849 FILE *lun;
3850 char *filext, *filetme;
3851 char natmed[21], namate[21];
3852 char natmedc[21], namatec[21];
3853 char key[5], name[5], mother[5], konly[5];
3854 char card[133];
3855 Int_t iadvol, iadtmd, iadrot, nwtot, iret;
3856 Int_t mlevel, numbr, natt, numed, nin, ndata;
3857 Int_t iname, ivo, ish, jvo, nvstak, ivstak;
3858 Int_t jdiv, ivin, in, jin, jvin, irot;
3859 Int_t jtm, imat, jma, flag=0, imatc;
3860 Float_t az, dens, radl, absl, a, step, x, y, z;
3861 Int_t npar, ndvmx, left;
3862 Float_t zc, densc, radlc, abslc, c0, tmaxfd;
3863 Int_t nparc, numb;
3864 Int_t iomate[100], iotmed[100];
3865 Float_t par[50], att[20], ubuf[50];
3866 Float_t *qws;
3867 Int_t *iws;
3868 Int_t level, ndiv, iaxe;
3869 Int_t itmedc, nmatc, isvolc, ifieldc, nwbufc, isvol, nmat, ifield, nwbuf;
3870 Float_t fieldmc, tmaxfdc, stemaxc, deemaxc, epsilc, stminc, fieldm;
3871 Float_t tmaxf, stemax, deemax, epsil, stmin;
ef42d733 3872 const char *k10000="!\n%s\n!\n";
fe4da5cc 3873 //Open the input file
3874 end=strlen(filnam);
3875 for(i=0;i<end;i++) if(filnam[i]=='.') {
3876 end=i;
3877 break;
3878 }
176551d7 3879 filext=new char[end+5];
3880 filetme=new char[end+5];
fe4da5cc 3881 strncpy(filext,filnam,end);
3882 strncpy(filetme,filnam,end);
3883 //
3884 // *** The output filnam name will be with extension '.euc'
3885 strcpy(&filext[end],".euc");
3886 strcpy(&filetme[end],".tme");
3887 lun=fopen(filext,"w");
3888 //
3889 // *** Initialisation of the working space
3890 iadvol=fGcnum->nvolum;
3891 iadtmd=iadvol+fGcnum->nvolum;
3892 iadrot=iadtmd+fGcnum->ntmed;
3893 if(fGclink->jrotm) {
3894 fGcnum->nrotm=fZiq[fGclink->jrotm-2];
3895 } else {
3896 fGcnum->nrotm=0;
3897 }
3898 nwtot=iadrot+fGcnum->nrotm;
3899 qws = new float[nwtot+1];
3900 for (i=0;i<nwtot+1;i++) qws[i]=0;
3901 iws = (Int_t*) qws;
3902 mlevel=nlevel;
3903 if(nlevel==0) mlevel=20;
3904 //
3905 // *** find the top volume and put it in the stak
3906 numbr = number>0 ? number : 1;
3907 Gfpara(topvol,numbr,1,npar,natt,par,att);
3908 if(npar <= 0) {
3909 printf(" *** GWEUCL *** top volume : %s number : %3d can not be a valid root\n",
3910 topvol, numbr);
3911 return;
3912 }
3913 //
3914 // *** authorized shape ?
3915 strncpy((char *)&iname, topvol, 4);
3916 ivo=0;
3917 for(i=1; i<=fGcnum->nvolum; i++) if(fZiq[fGclink->jvolum+i]==iname) {
3918 ivo=i;
3919 break;
3920 }
3921 jvo = fZlq[fGclink->jvolum-ivo];
3922 ish = Int_t (fZq[jvo+2]);
3923 if(ish > 12) {
3924 printf(" *** GWEUCL *** top volume : %s number : %3d can not be a valid root\n",
3925 topvol, numbr);
3926 }
3927 //
3928 level = 1;
3929 nvstak = 1;
3930 iws[nvstak] = ivo;
3931 iws[iadvol+ivo] = level;
3932 ivstak = 0;
3933 //
3934 //*** flag all volumes and fill the stak
3935 //
3936 L10:
3937 //
3938 // pick the next volume in stak
3939 ivstak += 1;
3940 ivo = TMath::Abs(iws[ivstak]);
3941 jvo = fZlq[fGclink->jvolum - ivo];
3942 //
3943 // flag the tracking medium
3944 numed = Int_t (fZq[jvo + 4]);
3945 iws[iadtmd + numed] = 1;
3946 //
3947 // get the daughters ...
3948 level = iws[iadvol+ivo];
3949 if (level < mlevel) {
3950 level += 1;
3951 nin = Int_t (fZq[jvo + 3]);
3952 //
3953 // from division ...
3954 if (nin < 0) {
3955 jdiv = fZlq[jvo - 1];
3956 ivin = Int_t (fZq[jdiv + 2]);
3957 nvstak += 1;
3958 iws[nvstak] = -ivin;
3959 iws[iadvol+ivin] = level;
3960 //
3961 // from position ...
3962 } else if (nin > 0) {
3963 for(in=1; in<=nin; in++) {
3964 jin = fZlq[jvo - in];
3965 ivin = Int_t (fZq[jin + 2 ]);
3966 jvin = fZlq[fGclink->jvolum - ivin];
3967 ish = Int_t (fZq[jvin + 2]);
3968 // authorized shape ?
3969 if (ish <= 12) {
3970 // not yet flagged ?
3971 if (iws[iadvol+ivin]==0) {
3972 nvstak += 1;
3973 iws[nvstak] = ivin;
3974 iws[iadvol+ivin] = level;
3975 }
3976 // flag the rotation matrix
3977 irot = Int_t ( fZq[jin + 4 ]);
3978 if (irot > 0) iws[iadrot+irot] = 1;
3979 }
3980 }
3981 }
3982 }
3983 //
3984 // next volume in stak ?
3985 if (ivstak < nvstak) goto L10;
3986 //
3987 // *** restore original material and media numbers
3988 // file euc_medi.dat is needed to compare materials and medias
3989 //
3990 FILE* luncor=fopen("euc_medi.dat","r");
3991 //
3992 if(luncor) {
3993 for(itm=1; itm<=fGcnum->ntmed; itm++) {
3994 if (iws[iadtmd+itm] > 0) {
3995 jtm = fZlq[fGclink->jtmed-itm];
3996 strncpy(natmed,(char *)&fZiq[jtm+1],20);
3997 imat = Int_t (fZq[jtm+6]);
3998 jma = fZlq[fGclink->jmate-imat];
3999 if (jma <= 0) {
4000 printf(" *** GWEUCL *** material not defined for tracking medium %5i %s\n",itm,natmed);
4001 flag=1;
4002 } else {
4003 strncpy(namate,(char *)&fZiq[jma+1],20);
4004 }
4005 //*
4006 //** find the material original number
4007 rewind(luncor);
4008 L23:
4009 iret=fscanf(luncor,"%4s,%130s",key,card);
4010 if(iret<=0) goto L26;
4011 flag=0;
4012 if(!strcmp(key,"MATE")) {
4013 sscanf(card,"%d %s %f %f %f %f %f %d",&imatc,namatec,&az,&zc,&densc,&radlc,&abslc,&nparc);
4014 Gfmate(imat,namate,a,z,dens,radl,absl,par,npar);
4015 if(!strcmp(namatec,namate)) {
4016 if(az==a && zc==z && densc==dens && radlc==radl
4017 && abslc==absl && nparc==nparc) {
4018 iomate[imat]=imatc;
4019 flag=1;
4020 printf("*** GWEUCL *** material : %3d '%s' restored as %3d\n",imat,namate,imatc);
4021 } else {
4022 printf("*** GWEUCL *** different definitions for material: %s\n",namate);
4023 }
4024 }
4025 }
4026 if(strcmp(key,"END") && !flag) goto L23;
4027 if (!flag) {
4028 printf("*** GWEUCL *** cannot restore original number for material: %s\n",namate);
4029 }
4030 //*
4031 //*
4032 //*** restore original tracking medium number
4033 rewind(luncor);
4034 L24:
4035 iret=fscanf(luncor,"%4s,%130s",key,card);
4036 if(iret<=0) goto L26;
4037 flag=0;
4038 if (!strcmp(key,"TMED")) {
4039 sscanf(card,"%d %s %d %d %d %f %f %f %f %f %f %d\n",
4040 &itmedc,natmedc,&nmatc,&isvolc,&ifieldc,&fieldmc,
4041 &tmaxfdc,&stemaxc,&deemaxc,&epsilc,&stminc,&nwbufc);
4042 Gftmed(itm,natmed,nmat,isvol,ifield,fieldm,tmaxf,stemax,deemax,
4043 epsil,stmin,ubuf,&nwbuf);
4044 if(!strcmp(natmedc,natmed)) {
4045 if (iomate[nmat]==nmatc && nwbuf==nwbufc) {
4046 iotmed[itm]=itmedc;
4047 flag=1;
4048 printf("*** GWEUCL *** medium : %3d '%20s' restored as %3d\n",
4049 itm,natmed,itmedc);
4050 } else {
4051 printf("*** GWEUCL *** different definitions for tracking medium: %s\n",natmed);
4052 }
4053 }
4054 }
4055 if(strcmp(key,"END") && !flag) goto L24;
4056 if(!flag) {
4057 printf("cannot restore original number for medium : %s\n",natmed);
4058 goto L27;
4059 }
4060 }
4061 }
4062 goto L29;
4063 //*
4064 }
4065 L26: printf("*** GWEUCL *** cannot read the data file\n");
4066 L27: flag=2;
4067 L29: if(luncor) fclose (luncor);
4068 //
4069 //
4070 // *** write down the tracking medium definition
4071 //
4072 strcpy(card,"! Tracking medium");
ef42d733 4073 fprintf(lun,k10000,card);
fe4da5cc 4074 //
4075 for(itm=1;itm<=fGcnum->ntmed;itm++) {
4076 if (iws[iadtmd+itm]>0) {
4077 jtm = fZlq[fGclink->jtmed-itm];
4078 strncpy(natmed,(char *)&fZiq[jtm+1],20);
4079 natmed[20]='\0';
4080 imat = Int_t (fZq[jtm+6]);
4081 jma = fZlq[fGclink->jmate-imat];
4082 //* order media from one, if comparing with database failed
4083 if (flag==2) {
4084 iotmed[itm]=++imxtmed;
4085 iomate[imat]=++imxmate;
4086 }
4087 //*
4088 if(jma<=0) {
4089 strcpy(namate," ");
4090 printf(" *** GWEUCL *** material not defined for tracking medium %5d %s\n",
4091 itm,natmed);
4092 } else {
4093 strncpy(namate,(char *)&fZiq[jma+1],20);
4094 namate[20]='\0';
4095 }
4096 fprintf(lun,"TMED %3d '%20s' %3d '%20s'\n",iotmed[itm],natmed,iomate[imat],namate);
4097 }
4098 }
4099 //*
4100 //* *** write down the rotation matrix
4101 //*
4102 strcpy(card,"! Reperes");
ef42d733 4103 fprintf(lun,k10000,card);
fe4da5cc 4104 //
4105 for(irm=1;irm<=fGcnum->nrotm;irm++) {
4106 if (iws[iadrot+irm]>0) {
4107 jrm = fZlq[fGclink->jrotm-irm];
4108 fprintf(lun,"ROTM %3d",irm);
4109 for(k=11;k<=16;k++) fprintf(lun," %8.3f",fZq[jrm+k]);
4110 fprintf(lun,"\n");
4111 }
4112 }
4113 //*
4114 //* *** write down the volume definition
4115 //*
4116 strcpy(card,"! Volumes");
ef42d733 4117 fprintf(lun,k10000,card);
fe4da5cc 4118 //*
4119 for(ivstak=1;ivstak<=nvstak;ivstak++) {
4120 ivo = iws[ivstak];
4121 if (ivo>0) {
4122 strncpy(name,(char *)&fZiq[fGclink->jvolum+ivo],4);
4123 name[4]='\0';
4124 jvo = fZlq[fGclink->jvolum-ivo];
4125 ish = Int_t (fZq[jvo+2]);
4126 nmed = Int_t (fZq[jvo+4]);
4127 npar = Int_t (fZq[jvo+5]);
4128 if (npar>0) {
4129 if (ivstak>1) for(i=0;i<npar;i++) par[i]=fZq[jvo+7+i];
4130 Gckpar (ish,npar,par);
ef42d733 4131 fprintf(lun,"VOLU '%4s' '%4s' %3d %3d\n",name,kShape[ish-1],iotmed[nmed],npar);
fe4da5cc 4132 for(i=0;i<(npar-1)/6+1;i++) {
4133 fprintf(lun," ");
4134 left=npar-i*6;
4135 for(k=0;k<(left<6?left:6);k++) fprintf(lun," %11.5f",par[i*6+k]);
4136 fprintf(lun,"\n");
4137 }
4138 } else {
ef42d733 4139 fprintf(lun,"VOLU '%4s' '%4s' %3d %3d\n",name,kShape[ish-1],iotmed[nmed],npar);
fe4da5cc 4140 }
4141 }
4142 }
4143 //*
4144 //* *** write down the division of volumes
4145 //*
ef42d733 4146 fprintf(lun,k10000,"! Divisions");
fe4da5cc 4147 for(ivstak=1;ivstak<=nvstak;ivstak++) {
4148 ivo = TMath::Abs(iws[ivstak]);
4149 jvo = fZlq[fGclink->jvolum-ivo];
4150 ish = Int_t (fZq[jvo+2]);
4151 nin = Int_t (fZq[jvo+3]);
4152 //* this volume is divided ...
4153 if (nin<0) {
4154 jdiv = fZlq[jvo-1];
4155 iaxe = Int_t ( fZq[jdiv+1]);
4156 ivin = Int_t ( fZq[jdiv+2]);
4157 ndiv = Int_t ( fZq[jdiv+3]);
4158 c0 = fZq[jdiv+4];
4159 step = fZq[jdiv+5];
4160 jvin = fZlq[fGclink->jvolum-ivin];
4161 nmed = Int_t ( fZq[jvin+4]);
4162 strncpy(mother,(char *)&fZiq[fGclink->jvolum+ivo ],4);
4163 mother[4]='\0';
4164 strncpy(name,(char *)&fZiq[fGclink->jvolum+ivin],4);
4165 name[4]='\0';
4166 if ((step<=0.)||(ish>=11)) {
4167 //* volume with negative parameter or gsposp or pgon ...
4168 fprintf(lun,"DIVN '%4s' '%4s' %3d %3d\n",name,mother,ndiv,iaxe);
4169 } else if ((ndiv<=0)||(ish==10)) {
4170 //* volume with negative parameter or gsposp or para ...
4171 ndvmx = TMath::Abs(ndiv);
4172 fprintf(lun,"DIVT '%4s' '%4s' %11.5f %3d %3d %3d\n",
4173 name,mother,step,iaxe,iotmed[nmed],ndvmx);
4174 } else {
4175 //* normal volume : all kind of division are equivalent
4176 fprintf(lun,"DVT2 '%4s' '%4s' %11.5f %3d %11.5f %3d %3d\n",
4177 name,mother,step,iaxe,c0,iotmed[nmed],ndiv);
4178 }
4179 }
4180 }
4181 //*
4182 //* *** write down the the positionnement of volumes
4183 //*
ef42d733 4184 fprintf(lun,k10000,"! Positionnements\n");
fe4da5cc 4185 //
4186 for(ivstak = 1;ivstak<=nvstak;ivstak++) {
4187 ivo = TMath::Abs(iws[ivstak]);
4188 strncpy(mother,(char*)&fZiq[fGclink->jvolum+ivo ],4);
4189 mother[4]='\0';
4190 jvo = fZlq[fGclink->jvolum-ivo];
4191 nin = Int_t( fZq[jvo+3]);
4192 //* this volume has daughters ...
4193 if (nin>0) {
4194 for (in=1;in<=nin;in++) {
4195 jin = fZlq[jvo-in];
4196 ivin = Int_t (fZq[jin +2]);
4197 numb = Int_t (fZq[jin +3]);
4198 irot = Int_t (fZq[jin +4]);
4199 x = fZq[jin +5];
4200 y = fZq[jin +6];
4201 z = fZq[jin +7];
4202 strcpy(konly,"ONLY");
4203 if (fZq[jin+8]!=1.) strcpy(konly,"MANY");
4204 strncpy(name,(char*)&fZiq[fGclink->jvolum+ivin],4);
4205 name[4]='\0';
4206 jvin = fZlq[fGclink->jvolum-ivin];
4207 ish = Int_t (fZq[jvin+2]);
4208 //* gspos or gsposp ?
4209 ndata = fZiq[jin-1];
4210 if (ndata==8) {
4211 fprintf(lun,"POSI '%4s' %4d '%4s' %11.5f %11.5f %11.5f %3d '%4s'\n",
4212 name,numb,mother,x,y,z,irot,konly);
4213 } else {
4214 npar = Int_t (fZq[jin+9]);
4215 for(i=0;i<npar;i++) par[i]=fZq[jin+10+i];
4216 Gckpar (ish,npar,par);
4217 fprintf(lun,"POSP '%4s' %4d '%4s' %11.5f %11.5f %11.5f %3d '%4s' %3d\n",
4218 name,numb,mother,x,y,z,irot,konly,npar);
4219 fprintf(lun," ");
4220 for(i=0;i<npar;i++) fprintf(lun," %11.5f",par[i]);
4221 fprintf(lun,"\n");
4222 }
4223 }
4224 }
4225 }
4226 //*
4227 fprintf(lun,"END\n");
4228 fclose(lun);
4229 //*
4230 //****** write down the materials and medias *****
4231 //*
4232 lun=fopen(filetme,"w");
4233 //*
4234 for(itm=1;itm<=fGcnum->ntmed;itm++) {
4235 if (iws[iadtmd+itm]>0) {
4236 jtm = fZlq[fGclink->jtmed-itm];
4237 strncpy(natmed,(char*)&fZiq[jtm+1],4);
4238 imat = Int_t (fZq[jtm+6]);
4239 jma = Int_t (fZlq[fGclink->jmate-imat]);
4240 //* material
4241 Gfmate (imat,namate,a,z,dens,radl,absl,par,npar);
4242 fprintf(lun,"MATE %4d '%20s'%11.5E %11.5E %11.5E %11.5E %11.5E %3d\n",
4243 iomate[imat],namate,a,z,dens,radl,absl,npar);
4244 //*
4245 if (npar>0) {
4246 fprintf(lun," ");
4247 for(i=0;i<npar;i++) fprintf(lun," %11.5f",par[i]);
4248 fprintf(lun,"\n");
4249 }
4250 //* medium
4251 Gftmed(itm,natmed,nmat,isvol,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin,par,&npar);
4252 fprintf(lun,"TMED %4d '%20s' %3d %1d %3d %11.5f %11.5f %11.5f %11.5f %11.5f %11.5f %3d\n",
4253 iotmed[itm],natmed,iomate[nmat],isvol,ifield,
4254 fieldm,tmaxfd,stemax,deemax,epsil,stmin,npar);
4255 //*
4256 if (npar>0) {
4257 fprintf(lun," ");
4258 for(i=0;i<npar;i++) fprintf(lun," %11.5f",par[i]);
4259 fprintf(lun,"\n");
4260 }
4261
4262 }
4263 }
4264 fprintf(lun,"END\n");
345f4f8a 4265 fclose(lun);
fe4da5cc 4266 printf(" *** GWEUCL *** file: %s is now written out\n",filext);
4267 printf(" *** GWEUCL *** file: %s is now written out\n",filetme);
4268 // Clean up
4269 delete [] filext;
4270 delete [] filetme;
4271 delete [] qws;
4272 iws=0;
4273 return;
4274}
4275
4276//_____________________________________________________________________________
4277void TGeant3::Streamer(TBuffer &R__b)
4278{
4279 //
4280 // Stream an object of class TGeant3.
4281 //
4282 if (R__b.IsReading()) {
4283 Version_t R__v = R__b.ReadVersion(); if (R__v) { }
4284 AliMC::Streamer(R__b);
4285 R__b >> fNextVol;
1578254f 4286 R__b >> fNPDGCodes;
4287 R__b.ReadStaticArray(fPDGCode);
fe4da5cc 4288 } else {
4289 R__b.WriteVersion(TGeant3::IsA());
4290 AliMC::Streamer(R__b);
4291 R__b << fNextVol;
1578254f 4292 R__b << fNPDGCodes;
4293 R__b.WriteArray(fPDGCode, fNPDGCodes);
fe4da5cc 4294 }
4295}
4296