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