Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TGeant4.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Geant4 Virtual Monte Carlo package
3// Copyright (C) 2007, 2014 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
14
15#include "TGeant4.h"
16#include "TG4ApplicationState.h"
17#include "TG4GeometryManager.h"
18#include "TG4Globals.h"
20#include "TG4PhysicsManager.h"
21#include "TG4RunConfiguration.h"
22#include "TG4RunManager.h"
23#include "TG4SDManager.h"
24#include "TG4StateManager.h"
25#include "TG4StepManager.h"
26#include "TG4Version.h"
27#include "TG4VisManager.h"
28
29#include <G4ApplicationState.hh>
30#include <G4StateManager.hh>
31#include <G4Threading.hh>
32#include <G4VisExecutive.hh>
33
34#include <TVirtualMCGeometry.h>
35
37ClassImp(TGeant4)
39
40 //_____________________________________________________________________________
42TVirtualMCApplication* TGeant4::fgMasterApplicationInstance = 0;
43
44namespace
45{
46
47//_____________________________________________________________________________
48Bool_t CheckApplicationState(const TString& methodName,
49 TG4ApplicationState requiredState, Bool_t allowLater = false,
50 Bool_t allowSooner = false, Bool_t allowJustAfter = false)
51{
55
57 TG4ApplicationState currentState = stateManager->GetCurrentState();
58 TG4ApplicationState previousState = stateManager->GetPreviousState();
59 if (currentState != requiredState &&
60 !((allowLater && currentState > requiredState) ||
61 (allowLater && previousState >= requiredState)) &&
62 !((allowSooner && currentState < requiredState) ||
63 (allowSooner && previousState <= requiredState)) &&
64 !(allowJustAfter && previousState == requiredState)) {
65
66 TString message =
67 TString("MC::") + methodName +
68 +TString(" can be called only from VMCApplication::") +
69 TString(stateManager->GetStateName(requiredState).c_str());
70 if (allowLater) message += TString(" or after");
71 if (allowSooner) message += TString(" or before");
72 if (allowJustAfter) message += TString(" or just after");
73 message += TG4Globals::Endl() +
74 TString("while detected in VMCApplication::") +
75 TString(stateManager->GetStateName(currentState).c_str());
76 if (currentState == kNotInApplication)
77 message += TString(" after VMCApplication::") +
78 TString(stateManager->GetStateName(previousState).c_str());
79
80 TG4Globals::Warning("TGeant4", methodName, message);
81 return false;
82 }
83
84 return true;
85}
86
87//_____________________________________________________________________________
88Bool_t CheckG4ApplicationState(const TString& methodName,
89 G4ApplicationState requiredState, Bool_t allowLater = false)
90{
94
95 G4ApplicationState currentState =
96 G4StateManager::GetStateManager()->GetCurrentState();
97
98 if (currentState != requiredState &&
99 !(allowLater && currentState > requiredState)) {
100
101 // States as strings
102 static std::vector<TString> g4StateNames;
103 g4StateNames.push_back("G4State_PreInit");
104 g4StateNames.push_back("G4State_Init");
105 g4StateNames.push_back("G4State_Idle");
106 g4StateNames.push_back("G4State_GeomClosed");
107 g4StateNames.push_back("G4State_EventProc");
108 g4StateNames.push_back("G4State_Quit");
109 g4StateNames.push_back("G4State_Abort");
110
111 TString message = TString("MC::") + methodName +
112 +TString(" can be called only when Geant4 is in state ") +
113 g4StateNames[requiredState];
114 if (allowLater) message += TString(" or later");
115 message += TG4Globals::Endl() + TString("while detected in state ") +
116 g4StateNames[currentState];
117
118 TG4Globals::Warning("TGeant4", methodName, message);
119 return false;
120 }
121
122 return true;
123}
124
125//_____________________________________________________________________________
126void PrintVersion()
127{
129
130 G4cout << G4endl
131 << "============================================================="
132 << G4endl << " Geant4 Virtual Monte Carlo " << G4endl << " Version "
133 << GEANT4_VMC_RELEASE << " ( " << GEANT4_VMC_RELEASE_DATE << " )"
134 << G4endl << " WWW : http://root.cern.ch/drupal/content/geant4-vmc"
135 << G4endl
136 << "============================================================="
137 << G4endl << G4endl;
138}
139
140} // namespace
141
142//_____________________________________________________________________________
143TGeant4::TGeant4(const char* name, const char* title,
144 TG4RunConfiguration* configuration, int argc, char** argv)
145 : TVirtualMC(name, title),
146 fStateManager(0),
147 fGeometryManager(0),
148 fSDManager(0),
149 fPhysicsManager(0),
150 fStepManager(0),
151 fVisManager(0),
152 fVisExecutive(0),
153 fRunManager(0),
154 fRunConfiguration(configuration),
155 fMediumCounter(0),
156 fMaterialCounter(0),
157 fMatrixCounter(0),
158 fUserGeometry(configuration->GetUserGeometry()),
159 fIsMT(configuration->IsMTApplication())
160{
162
163 PrintVersion();
164
165 G4bool isMaster = !G4Threading::IsWorkerThread();
166 if (isMaster) {
167 fgMasterInstance = this;
168 fgMasterApplicationInstance = TVirtualMCApplication::Instance();
169 }
170
171 // Inactivate MT mode if Geant4 is built in sequential mode
172 if (G4Threading::G4GetThreadId() == -2) {
173 fIsMT = false;
174 }
175
176 // Update title with a physics selection
177 TString newTitle = title;
178 newTitle.Append(" : ");
179 newTitle.Append(configuration->GetPhysicsListSelection());
180 SetTitle(newTitle);
181
182 // create state manager - thread local
185 // add verbose level
186 // G4cout << "TG4StateManager has been created." << G4endl;
187
188 // create geometry manager - shared
189 if (isMaster) {
191 // add verbose level
192 // G4cout << "TG4GeometryManager has been created." << G4endl;
193
194 // create sensitive detectors manager - shared
195 fSDManager = new TG4SDManager();
196 // add verbose level
197 // G4cout << "TG4SDManager has been created." << G4endl;
198
199 // create physics manager
201 // add verbose level
202 // G4cout << "TG4PhysicsManager has been created." << G4endl;
203 }
204 else {
208 }
209
210 // create step manager
212 // add verbose level
213 // G4cout << "TG4StepManager has been created." << G4endl;
214
215 // create run manager
216 fRunManager = new TG4RunManager(configuration, argc, argv);
217 // add verbose level
218 // G4cout << "TG4RunManager has been created." << G4endl;
219
220 if (isMaster) {
221 // create visualization managers
223 fVisExecutive = new G4VisExecutive();
224 }
225 else {
228 }
229
230#ifdef MCDEBUG
231 G4cout << "Debug mode is switched on." << G4endl;
232#endif
233
234 // add verbose level
235 // G4cout << "TGeant4::TGeant4 done " << this << G4endl;
236}
237
238//_____________________________________________________________________________
240{
242
243 // G4cout << "TGeant4::~TGeant4 " << this << G4endl;
244
245 G4bool isMaster = !G4Threading::IsWorkerThread();
246 if (isMaster) {
249 }
250
251 delete fRunManager;
252 delete fStateManager;
253 if (isMaster) {
254 delete fGeometryManager;
255 delete fSDManager;
256 delete fPhysicsManager;
257 }
258 delete fStepManager;
259 if (isMaster) {
260 delete fVisManager;
261 delete fVisExecutive;
262 }
263 // G4cout << "TGeant4::~TGeant4 done " << this << G4endl;
264}
265
266//
267// methods for building/management of geometry
268//
269
270//_____________________________________________________________________________
272{
274
275 return true;
276}
277
278//_____________________________________________________________________________
280{
283
284 if (!CheckApplicationState("FinishGeometry", kConstructGeometry)) return;
285
286 // Ggclos();
288}
289
290//_____________________________________________________________________________
291void TGeant4::Gfmate(Int_t imat, char* name, Float_t& a, Float_t& z,
292 Float_t& dens, Float_t& radl, Float_t& absl, Float_t* ubuf, Int_t& nbuf)
293{
295
297 imat, name, a, z, dens, radl, absl, ubuf, nbuf);
298}
299
300//_____________________________________________________________________________
301void TGeant4::Gfmate(Int_t imat, char* name, Double_t& a, Double_t& z,
302 Double_t& dens, Double_t& radl, Double_t& absl, Double_t* ubuf, Int_t& nbuf)
303{
305
307 imat, name, a, z, dens, radl, absl, ubuf, nbuf);
308}
309
310//_____________________________________________________________________________
311void TGeant4::Gckmat(Int_t /*itmed*/, char* /*natmed*/)
312{
315
316 TG4Globals::Warning("TGeant4", "Gckmat", "Not implemented.");
317}
318
319//_____________________________________________________________________________
320void TGeant4::Material(Int_t& kmat, const char* name, Double_t a, Double_t z,
321 Double_t dens, Double_t radl, Double_t absl, Float_t* buf, Int_t nwbuf)
322{
325
326 if (!CheckApplicationState("Material", kConstructGeometry)) return;
327
328 kmat = ++fMaterialCounter;
329
330 fGeometryManager->GetMCGeometry()->Material(
331 kmat, name, a, z, dens, radl, absl, buf, nwbuf);
332}
333
334//_____________________________________________________________________________
335void TGeant4::Material(Int_t& kmat, const char* name, Double_t a, Double_t z,
336 Double_t dens, Double_t radl, Double_t absl, Double_t* buf, Int_t nwbuf)
337{
340
341 if (!CheckApplicationState("Material", kConstructGeometry)) return;
342
343 kmat = ++fMaterialCounter;
344
345 fGeometryManager->GetMCGeometry()->Material(
346 kmat, name, a, z, dens, radl, absl, buf, nwbuf);
347}
348
349//_____________________________________________________________________________
350void TGeant4::Mixture(Int_t& kmat, const char* name, Float_t* a, Float_t* z,
351 Double_t dens, Int_t nlmat, Float_t* wmat)
352{
355
356 if (!CheckApplicationState("Mixture", kConstructGeometry)) return;
357
358 kmat = ++fMaterialCounter;
359
361 kmat, name, a, z, dens, nlmat, wmat);
362
363#if (defined(USE_ROOT_VMC) && (ROOT_VERSION_CODE < ROOT_VERSION(6, 18, 5)))
364 // Work around for a problem in TGeoMCGeometry where the wmat values
365 // were not properly updated when nlmat < 0 (fixed in ROOt v6.18/06)
366 if (nlmat > 0) return;
367 if (fUserGeometry == "VMCtoRoot" || fUserGeometry == "Root") {
368 G4cout << "TGeant4::Mixture: work-around for updating wmat values"
369 << G4endl;
370 G4int nmat = -nlmat;
371 G4double amol = 0;
372 for (G4int i = 0; i < nmat; ++i) {
373 amol += a[i] * wmat[i];
374 }
375 for (G4int i = 0; i < nmat; i++) {
376 wmat[i] *= a[i] / amol;
377 }
378 }
379#endif
380}
381
382//_____________________________________________________________________________
383void TGeant4::Mixture(Int_t& kmat, const char* name, Double_t* a, Double_t* z,
384 Double_t dens, Int_t nlmat, Double_t* wmat)
385{
388
389 if (!CheckApplicationState("Mixture", kConstructGeometry)) return;
390
391 kmat = ++fMaterialCounter;
392
394 kmat, name, a, z, dens, nlmat, wmat);
395}
396
397//_____________________________________________________________________________
398void TGeant4::Medium(Int_t& kmed, const char* name, Int_t nmat, Int_t isvol,
399 Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax,
400 Double_t deemax, Double_t epsil, Double_t stmin, Float_t* ubuf, Int_t nbuf)
401{
404
405 if (!CheckApplicationState("Medium", kConstructGeometry)) return;
406
407 kmed = ++fMediumCounter;
408
409 fGeometryManager->GetMCGeometry()->Medium(kmed, name, nmat, isvol, ifield,
410 fieldm, tmaxfd, stemax, deemax, epsil, stmin, ubuf, nbuf);
411}
412
413//_____________________________________________________________________________
414void TGeant4::Medium(Int_t& kmed, const char* name, Int_t nmat, Int_t isvol,
415 Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax,
416 Double_t deemax, Double_t epsil, Double_t stmin, Double_t* ubuf, Int_t nbuf)
417{
420
421 if (!CheckApplicationState("Medium", kConstructGeometry)) return;
422
423 kmed = ++fMediumCounter;
424
425 fGeometryManager->GetMCGeometry()->Medium(kmed, name, nmat, isvol, ifield,
426 fieldm, tmaxfd, stemax, deemax, epsil, stmin, ubuf, nbuf);
427}
428
429//_____________________________________________________________________________
430void TGeant4::Matrix(Int_t& krot, Double_t thetaX, Double_t phiX,
431 Double_t thetaY, Double_t phiY, Double_t thetaZ, Double_t phiZ)
432{
434
435 if (!CheckApplicationState("Matrix", kConstructGeometry)) return;
436
437 krot = ++fMatrixCounter;
438
440 krot, thetaX, phiX, thetaY, phiY, thetaZ, phiZ);
441}
442
443//_____________________________________________________________________________
445 const char* name, const char* shape, Int_t nmed, Double_t* upar, Int_t np)
446{
448
449 if (!CheckApplicationState("Gsvolu", kConstructGeometry)) return 0;
450
451 return fGeometryManager->GetMCGeometry()->Gsvolu(name, shape, nmed, upar, np);
452}
453
454//_____________________________________________________________________________
456 const char* name, const char* shape, Int_t nmed, Float_t* upar, Int_t np)
457{
459
460 if (!CheckApplicationState("Gsvolu", kConstructGeometry)) return 0;
461
462 return fGeometryManager->GetMCGeometry()->Gsvolu(name, shape, nmed, upar, np);
463}
464
465//_____________________________________________________________________________
467 const char* name, const char* mother, Int_t ndiv, Int_t iaxis)
468{
470
471 if (!CheckApplicationState("Gsdvn", kConstructGeometry)) return;
472
473 fGeometryManager->GetMCGeometry()->Gsdvn(name, mother, ndiv, iaxis);
474}
475
476//_____________________________________________________________________________
477void TGeant4::Gsdvn2(const char* name, const char* mother, Int_t ndiv,
478 Int_t iaxis, Double_t c0i, Int_t numed)
479{
481
482 if (!CheckApplicationState("Gsdvn2", kConstructGeometry)) return;
483
485 name, mother, ndiv, iaxis, c0i, numed);
486}
487
488//_____________________________________________________________________________
489void TGeant4::Gsdvt(const char* name, const char* mother, Double_t step,
490 Int_t iaxis, Int_t numed, Int_t ndvmx)
491{
493
494 if (!CheckApplicationState("Gsdvt", kConstructGeometry)) return;
495
497 name, mother, step, iaxis, numed, ndvmx);
498}
499
500//_____________________________________________________________________________
501void TGeant4::Gsdvt2(const char* name, const char* mother, Double_t step,
502 Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx)
503{
505
506 if (!CheckApplicationState("Gsdvt2", kConstructGeometry)) return;
507
509 name, mother, step, iaxis, c0, numed, ndvmx);
510}
511
512//_____________________________________________________________________________
513void TGeant4::Gsord(const char* name, Int_t iax)
514{
516
517 if (!CheckApplicationState("Gsord", kConstructGeometry)) return;
518
519 fGeometryManager->GetMCGeometry()->Gsord(name, iax);
520}
521
522//_____________________________________________________________________________
523void TGeant4::Gspos(const char* name, Int_t nr, const char* mother, Double_t x,
524 Double_t y, Double_t z, Int_t irot, const char* konly)
525{
527
528 if (!CheckApplicationState("Gspos", kConstructGeometry)) return;
529
531 name, nr, mother, x, y, z, irot, konly);
532}
533
534//_____________________________________________________________________________
535void TGeant4::Gsposp(const char* name, Int_t nr, const char* mother, Double_t x,
536 Double_t y, Double_t z, Int_t irot, const char* konly, Double_t* upar,
537 Int_t np)
538{
541
542 if (!CheckApplicationState("Gsposp", kConstructGeometry)) return;
543
545 name, nr, mother, x, y, z, irot, konly, upar, np);
546}
547
548//_____________________________________________________________________________
549void TGeant4::Gsposp(const char* name, Int_t nr, const char* mother, Double_t x,
550 Double_t y, Double_t z, Int_t irot, const char* konly, Float_t* upar,
551 Int_t np)
552{
555
556 if (!CheckApplicationState("Gsposp", kConstructGeometry)) return;
557
559 name, nr, mother, x, y, z, irot, konly, upar, np);
560}
561
562//_____________________________________________________________________________
563void TGeant4::Gsbool(const char* onlyVolName, const char* manyVolName)
564{
568
569 if (!CheckApplicationState("Gsbool", kConstructGeometry)) return;
570
571 fGeometryManager->GetMCGeometry()->Gsbool(onlyVolName, manyVolName);
572}
573
574//_____________________________________________________________________________
575void TGeant4::SetCerenkov(Int_t itmed, Int_t npckov, Float_t* ppckov,
576 Float_t* absco, Float_t* effic, Float_t* rindex, Bool_t aspline,
577 Bool_t rspline)
578{
580
581 if (!CheckApplicationState("SetCerenkov", kConstructOpGeometry)) return;
582
584 itmed, npckov, ppckov, absco, effic, rindex, aspline, rspline);
585}
586
587//_____________________________________________________________________________
588void TGeant4::SetCerenkov(Int_t itmed, Int_t npckov, Double_t* ppckov,
589 Double_t* absco, Double_t* effic, Double_t* rindex, Bool_t aspline,
590 Bool_t rspline)
591{
593
594 if (!CheckApplicationState("SetCerenkov", kConstructOpGeometry)) return;
595
597 itmed, npckov, ppckov, absco, effic, rindex, aspline, rspline);
598}
599
600//_____________________________________________________________________________
601void TGeant4::DefineOpSurface(const char* name, EMCOpSurfaceModel model,
602 EMCOpSurfaceType surfaceType, EMCOpSurfaceFinish surfaceFinish,
603 Double_t sigmaAlpha)
604{
606
607 if (!CheckApplicationState("DefineOpSurface", kConstructOpGeometry)) return;
608
610 name, model, surfaceType, surfaceFinish, sigmaAlpha);
611}
612
613//_____________________________________________________________________________
614void TGeant4::SetBorderSurface(const char* name, const char* vol1Name,
615 int vol1CopyNo, const char* vol2Name, int vol2CopyNo,
616 const char* opSurfaceName)
617{
619
620 if (!CheckApplicationState("SetBorderSurface", kConstructOpGeometry)) return;
621
623 name, vol1Name, vol1CopyNo, vol2Name, vol2CopyNo, opSurfaceName);
624}
625
626//_____________________________________________________________________________
628 const char* name, const char* volName, const char* opSurfaceName)
629{
631
632 if (!CheckApplicationState("SetSkinSurface", kConstructOpGeometry)) return;
633
635 name, volName, opSurfaceName);
636}
637
638//_____________________________________________________________________________
639void TGeant4::SetMaterialProperty(Int_t itmed, const char* propertyName,
640 Int_t np, Double_t* pp, Double_t* values, Bool_t createNewKey, Bool_t spline)
641{
643
644 if (!CheckApplicationState("SetMaterialProperty", kConstructOpGeometry))
645 return;
646
648 itmed, propertyName, np, pp, values, createNewKey, spline);
649}
650
651//_____________________________________________________________________________
653 Int_t itmed, const char* propertyName, Double_t value)
654{
656
657 if (!CheckApplicationState("SetMaterialProperty", kConstructOpGeometry))
658 return;
659
661 itmed, propertyName, value);
662}
663
664//_____________________________________________________________________________
665void TGeant4::SetMaterialProperty(const char* surfaceName,
666 const char* propertyName, Int_t np, Double_t* pp, Double_t* values,
667 Bool_t createNewKey, Bool_t spline)
668{
670
671 if (!CheckApplicationState("SetMaterialProperty", kConstructOpGeometry))
672 return;
673
675 surfaceName, propertyName, np, pp, values, createNewKey, spline);
676}
677
678//_____________________________________________________________________________
680 const TString& volumePath, TGeoHMatrix& matrix)
681{
685
686 if (!CheckApplicationState("GetTransformation", kInitGeometry, true))
687 return false;
688
689 return fGeometryManager->GetMCGeometry()->GetTransformation(
690 volumePath, matrix);
691}
692
693//_____________________________________________________________________________
695 const TString& volumePath, TString& shapeType, TArrayD& par)
696{
699
700 if (!CheckApplicationState("GetShape", kInitGeometry, true)) return false;
701
702 return fGeometryManager->GetMCGeometry()->GetShape(
703 volumePath, shapeType, par);
704}
705
706//______________________________________________________________________
707Bool_t TGeant4::GetMaterial(Int_t imat, TString& name, Double_t& a, Double_t& z,
708 Double_t& density, Double_t& radl, Double_t& inter, TArrayD& par)
709{
712
714 imat, name, a, z, density, radl, inter, par);
715}
716
717//_____________________________________________________________________________
718Bool_t TGeant4::GetMaterial(const TString& volumeName, TString& name,
719 Int_t& imat, Double_t& a, Double_t& z, Double_t& density, Double_t& radl,
720 Double_t& inter, TArrayD& par)
721{
724
725 if (!CheckApplicationState("GetMaterial", kInitGeometry, true)) return false;
726
727 return fGeometryManager->GetMCGeometry()->GetMaterial(
728 volumeName, name, imat, a, z, density, radl, inter, par);
729}
730
731//_____________________________________________________________________________
732Bool_t TGeant4::GetMedium(const TString& volumeName, TString& name, Int_t& imed,
733 Int_t& nmat, Int_t& isvol, Int_t& ifield, Double_t& fieldm, Double_t& tmaxfd,
734 Double_t& stemax, Double_t& deemax, Double_t& epsil, Double_t& stmin,
735 TArrayD& par)
736{
739
740 if (!CheckApplicationState("GetMedium", kInitGeometry, true)) return false;
741
742 return fGeometryManager->GetMCGeometry()->GetMedium(volumeName, name, imed,
743 nmat, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin, par);
744}
745
746//_____________________________________________________________________________
747void TGeant4::WriteEuclid(const char* /*fileName*/, const char* /*topVol*/,
748 Int_t /*number*/, Int_t /*nlevel*/)
749{
752
753 TG4Globals::Warning("TGeant4", "WriteEuclid", "Not implemented.");
754}
755
756//_____________________________________________________________________________
761
762//_____________________________________________________________________________
763void TGeant4::SetUserParameters(Bool_t isUserParameters)
764{
768
769 if (!CheckApplicationState("SetUserParameters", kInitGeometry, false, true))
770 return;
771
772 fGeometryManager->SetIsUserMaxStep(isUserParameters);
773}
774
775//_____________________________________________________________________________
776Int_t TGeant4::VolId(const Text_t* volName) const
777{
779
780 if (!CheckApplicationState("VolId", kInitGeometry, true)) return 0;
781
782 return fSDManager->VolId(volName);
783}
784
785//_____________________________________________________________________________
786const char* TGeant4::VolName(Int_t id) const
787{
788 //
791
792 if (!CheckApplicationState("VolName", kInitGeometry, true)) return "";
793
794 return fSDManager->VolName(id);
795}
796
797//_____________________________________________________________________________
798Int_t TGeant4::MediumId(const Text_t* medName) const
799{
801
803 if (fUserGeometry == "RootToGeant4" || fUserGeometry == "Geant4")
804 requiredState = kInitGeometry;
805
806 if (!CheckApplicationState("MediumId", requiredState, true)) return 0;
807
808 return fGeometryManager->GetMCGeometry()->MediumId(medName);
809}
810
811//_____________________________________________________________________________
813{
816
817 if (!CheckApplicationState("NofVolumes", kInitGeometry, true)) return 0;
818
819 return fSDManager->NofVolumes();
820}
821
822//_____________________________________________________________________________
823Int_t TGeant4::NofVolDaughters(const char* volName) const
824{
826
827 if (!CheckApplicationState("NofVolDaughters", kInitGeometry, true)) return 0;
828
829 return fSDManager->NofVolDaughters(volName);
830}
831
832//_____________________________________________________________________________
833const char* TGeant4::VolDaughterName(const char* volName, Int_t i) const
834{
836
837 if (!CheckApplicationState("VolDaughterName", kInitGeometry, true)) return "";
838
839 return fSDManager->VolDaughterName(volName, i);
840}
841
842//_____________________________________________________________________________
843Int_t TGeant4::VolDaughterCopyNo(const char* volName, Int_t i) const
844{
846
847 if (!CheckApplicationState("VolDaughterCopyNo", kInitGeometry, true))
848 return 0;
849
850 return fSDManager->VolDaughterCopyNo(volName, i);
851}
852
853//_____________________________________________________________________________
854Int_t TGeant4::VolId2Mate(Int_t id) const
855{
857
858 if (!CheckApplicationState("VolId2Mate", kInitGeometry, true)) return 0;
859
860 return fSDManager->VolId2Mate(id);
861}
862
863//
864// methods for sensitive detectors
865//
866
867//_____________________________________________________________________________
869 const TString& volName, TVirtualMCSensitiveDetector* sd)
870{
871 if (!CheckApplicationState("SetSensitiveDetector", kConstructSD)) return;
872
873 fSDManager->SetSensitiveDetector(volName, sd);
874}
875
876//_____________________________________________________________________________
877TVirtualMCSensitiveDetector* TGeant4::GetSensitiveDetector(
878 const TString& volName) const
879{
880 if (!CheckApplicationState("SetSensitiveDetector", kConstructSD, true))
881 return 0;
882
883 return fSDManager->GetSensitiveDetector(volName);
884}
885
886//_____________________________________________________________________________
887void TGeant4::SetExclusiveSDScoring(Bool_t exclusiveSDScoring)
888{
889 if (!CheckApplicationState("SetSensitiveDetector", kConstructSD, true))
890 return;
891
892 fSDManager->SetExclusiveSDScoring(exclusiveSDScoring);
893}
894
895//
896// methods for physics management
897//
898
899//_____________________________________________________________________________
900void TGeant4::Gstpar(Int_t itmed, const char* param, Double_t parval)
901{
903
904 if (!CheckApplicationState("Gstpar", kInitGeometry, false, false, true))
905 return;
906
907 fPhysicsManager->Gstpar(itmed, param, parval);
908}
909
910//_____________________________________________________________________________
911Bool_t TGeant4::SetCut(const char* cutName, Double_t cutValue)
912{
914
915 if (!CheckApplicationState("SetCut", kPreInit)) return false;
916
917 return fPhysicsManager->SetCut(cutName, cutValue);
918}
919
920//_____________________________________________________________________________
921Bool_t TGeant4::SetProcess(const char* flagName, Int_t flagValue)
922{
924
925 if (!CheckApplicationState("SetProcess", kPreInit)) return false;
926
927 return fPhysicsManager->SetProcess(flagName, flagValue);
928}
929
930//_____________________________________________________________________________
931Bool_t TGeant4::DefineParticle(Int_t /*pdg*/, const char* /*name*/,
932 TMCParticleType /*mcType*/, Double_t /*mass*/, Double_t /*charge*/,
933 Double_t /*lifetime*/)
934{
936
937 TG4Globals::Warning("TGeant4", "DefineParticle",
938 "Deprecated function: the function with long argument list should be used "
939 "instead.");
940
941 return false;
942}
943
944//_____________________________________________________________________________
945Bool_t TGeant4::DefineParticle(Int_t pdg, const char* name,
946 TMCParticleType mcType, Double_t mass, Double_t charge, Double_t lifetime,
947 const TString& pType, Double_t width, Int_t iSpin, Int_t iParity,
948 Int_t iConjugation, Int_t iIsospin, Int_t iIsospinZ, Int_t gParity,
949 Int_t lepton, Int_t baryon, Bool_t stable, Bool_t shortlived,
950 const TString& subType, Int_t antiEncoding, Double_t magMoment,
951 Double_t excitation)
952{
954
955 if (!CheckApplicationState("DefineParticle", kAddParticles)) return false;
956
957 return fPhysicsManager->DefineParticle(pdg, name, mcType, mass, charge,
958 lifetime, pType, width, iSpin, iParity, iConjugation, iIsospin, iIsospinZ,
959 gParity, lepton, baryon, stable, shortlived, subType, antiEncoding,
960 magMoment, excitation);
961}
962
963//_____________________________________________________________________________
964Bool_t TGeant4::DefineIon(const char* name, Int_t Z, Int_t A, Int_t Q,
965 Double_t excEnergy, Double_t mass)
966{
969
970 if (!CheckApplicationState("DefineIon", kAddIons)) return false;
971
972 return fPhysicsManager->DefineIon(name, Z, A, Q, excEnergy, mass);
973}
974
975//_____________________________________________________________________________
976inline void TGeant4::SetUserDecay(Int_t pdg)
977{
980
981 if (!CheckApplicationState("SetUserDecay", kAddParticles) &&
982 !CheckApplicationState("SetUserDecay", kAddIons))
983 return;
984
986}
987
988//_____________________________________________________________________________
989Bool_t TGeant4::SetDecayMode(Int_t pdg, Float_t bratio[6], Int_t mode[6][3])
990{
992
993 if (!CheckApplicationState("SetDecayMode", kAddParticles)) return false;
994
995 return fPhysicsManager->SetDecayMode(pdg, bratio, mode);
996}
997
998//_____________________________________________________________________________
999Double_t TGeant4::Xsec(char* reac, Double_t energy, Int_t part, Int_t mate)
1000{
1002
1003 return fPhysicsManager->Xsec(reac, energy, part, mate);
1004}
1005
1006//_____________________________________________________________________________
1007Int_t TGeant4::IdFromPDG(Int_t pdgID) const
1008{
1011
1012 if (!CheckG4ApplicationState("IdFromPDG", G4State_Idle, true)) return 0;
1013
1014 return fPhysicsManager->IdFromPDG(pdgID);
1015}
1016
1017//_____________________________________________________________________________
1018Int_t TGeant4::PDGFromId(Int_t mcID) const
1019{
1022
1023 if (!CheckG4ApplicationState("PDGFromId", G4State_Idle, true)) return 0;
1024
1025 return fPhysicsManager->PDGFromId(mcID);
1026}
1027
1028//_____________________________________________________________________________
1029TString TGeant4::ParticleName(Int_t pdg) const
1030{
1032
1033 if (!CheckG4ApplicationState("ParticleName", G4State_Idle, true)) return "";
1034
1035 return fPhysicsManager->ParticleName(pdg);
1036}
1037
1038//_____________________________________________________________________________
1039Double_t TGeant4::ParticleMass(Int_t pdg) const
1040{
1042
1043 if (!CheckG4ApplicationState("ParticleName", G4State_Idle, true)) return 0;
1044
1045 return fPhysicsManager->ParticleMass(pdg);
1046}
1047
1048//_____________________________________________________________________________
1049Double_t TGeant4::ParticleCharge(Int_t pdg) const
1050{
1052
1053 if (!CheckG4ApplicationState("ParticleCharge", G4State_Idle, true)) return 0;
1054
1055 return fPhysicsManager->ParticleCharge(pdg);
1056}
1057
1058//_____________________________________________________________________________
1059Double_t TGeant4::ParticleLifeTime(Int_t pdg) const
1060{
1062
1063 if (!CheckG4ApplicationState("ParticleLifeTime", G4State_Idle, true))
1064 return 0;
1065
1066 return fPhysicsManager->ParticleLifeTime(pdg);
1067}
1068
1069//_____________________________________________________________________________
1070TMCParticleType TGeant4::ParticleMCType(Int_t pdg) const
1071{
1073
1074 if (!CheckG4ApplicationState("ParticleMCType", G4State_Idle, true))
1075 return kPTUndefined;
1076
1077 return fPhysicsManager->ParticleMCType(pdg);
1078}
1079
1080//
1081// methods for step management
1082// inlined (in TGeant4.icc)
1083//
1084
1085//
1086// methods for visualization
1087//
1088
1089//_____________________________________________________________________________
1090void TGeant4::DrawOneSpec(const char* name)
1091{
1093
1094 fVisManager->DrawOneSpec(name);
1095}
1096
1097//_____________________________________________________________________________
1098void TGeant4::Gsatt(const char* name, const char* att, Int_t val)
1099{
1101
1102 fVisManager->Gsatt(name, att, val);
1103}
1104
1105//_____________________________________________________________________________
1106void TGeant4::Gdraw(const char* name, Double_t theta, Double_t phi,
1107 Double_t psi, Double_t u0, Double_t v0, Double_t ul, Double_t vl)
1108{
1110
1111 fVisManager->Gdraw(name, theta, phi, psi, u0, v0, ul, vl);
1112}
1113
1114//
1115// methods for run control
1116//
1117
1118//_____________________________________________________________________________
1120{
1122
1124
1125 fVisExecutive->SetVerboseLevel(0);
1126 fVisExecutive->Initialize();
1127
1129}
1130
1131//_____________________________________________________________________________
1132void TGeant4::InitMT(Int_t /*threadRank*/)
1133{
1135
1136 TG4Globals::Warning("TGeant4", "InitMT", "Deprecated function.");
1137
1138 Init();
1139}
1140
1141//_____________________________________________________________________________
1143{
1146
1148}
1149
1150//_____________________________________________________________________________
1152{
1155
1157}
1158
1159//_____________________________________________________________________________
1160void TGeant4::ProcessEvent(Int_t eventId)
1161{
1165
1166 fRunManager->ProcessEvent(eventId, kFALSE);
1167}
1168
1169//_____________________________________________________________________________
1170void TGeant4::ProcessEvent(Int_t eventId, Bool_t isInterruptible)
1171{
1175
1176 fRunManager->ProcessEvent(eventId, isInterruptible);
1177}
1178
1179//_____________________________________________________________________________
1180Bool_t TGeant4::ProcessRun(Int_t nofEvents)
1181{
1183
1184 return fRunManager->ProcessRun(nofEvents);
1185}
1186
1187//_____________________________________________________________________________
1189{
1191
1192 return fRunManager->FinishRun();
1193}
1194
1195//_____________________________________________________________________________
1196void TGeant4::SetCollectTracks(Bool_t collectTracks)
1197{
1199
1200 fStepManager->SetCollectTracks(collectTracks);
1201}
1202
1203//_____________________________________________________________________________
1205{
1207
1208 return fStepManager->IsCollectTracks();
1209}
1210
1211//_____________________________________________________________________________
1213{
1215
1217}
1218
1219//_____________________________________________________________________________
1221{
1223
1225}
1226
1227//_____________________________________________________________________________
1228void TGeant4::ProcessGeantMacro(const char* macroName)
1229{
1231
1232 fRunManager->ProcessGeantMacro(macroName);
1233}
1234
1235//_____________________________________________________________________________
1236void TGeant4::ProcessGeantCommand(const char* command)
1237{
1239
1241}
1242
1243//_____________________________________________________________________________
1245{
1247
1248 return fRunManager->CurrentEvent();
1249}
1250
1251//_____________________________________________________________________________
1253{
1256
1258}
1259
1260//_____________________________________________________________________________
1262{
1264
1265 TGeant4* geant4 = new TGeant4(GetName(), GetTitle(), fRunConfiguration);
1266
1267 // G4cout << "TGeant4::CloneForWorker: " << geant4 << G4endl;
1268 // G4cout << "TVirtualMCApplication: " << TVirtualMCApplication::Instance() <<
1269 // G4endl;
1270
1271 return geant4;
1272}
1273
1274// Geant3 specific methods
1275// !!! need to be transformed to common interface
1276// ------------------------------------------------
1277
1278//_____________________________________________________________________________
1279void TGeant4::Gdopt(const char* /*name*/, const char* /*value*/)
1280{
1283
1284 TG4Globals::Warning("TGeant4", "Gdopt", "Not implemented.");
1285}
1286
1287//_____________________________________________________________________________
1288void TGeant4::SetClipBox(const char* /*name*/, Double_t /*xmin*/,
1289 Double_t /*xmax*/, Double_t /*ymin*/, Double_t /*ymax*/, Double_t /*zmin*/,
1290 Double_t /*zmax*/)
1291{
1294
1295 TG4Globals::Warning("TGeant4", "SetClipBox", "Not implemented.");
1296}
1297
1298//_____________________________________________________________________________
1300{
1303
1304 TG4Globals::Warning("TGeant4", "DefaultRange", "Not implemented.");
1305}
1306
1307//_____________________________________________________________________________
1308void TGeant4::Gdhead(Int_t /*isel*/, const char* /*name*/, Double_t /*chrsiz*/)
1309{
1312
1313 TG4Globals::Warning("TGeant4", "Gdhead", "Not implemented.");
1314}
1315
1316//_____________________________________________________________________________
1317void TGeant4::Gdman(Double_t /*u*/, Double_t /*v*/, const char* /*type*/)
1318{
1321
1322 TG4Globals::Warning("TGeant4", "Gdman", "Not implemented.");
1323}
1324//_____________________________________________________________________________
1326{
1329
1330 TG4Globals::Warning("TGeant4", "InitLego", "Not implemented.");
1331}
1332//_____________________________________________________________________________
Definition of the enumeration TG4ApplicationState.
Definition of the TG4GeometryManager class.
Definition of the TG4Globals class and basic container types.
Definition of the TG4OpGeometryManager class.
Definition of the TG4PhysicsManager class.
Definition of the TG4RunConfiguration class.
Definition of the TG4RunManager.h class.
Definition of the TG4SDManager class.
Definition of the TG4StateManager class.
Definition of the TG4StepManager class.
Definition of the code version and release date.
#define GEANT4_VMC_RELEASE_DATE
Definition TG4Version.h:19
#define GEANT4_VMC_RELEASE
Definition TG4Version.h:18
Definition of the TG4VisManager class.
Definition of the TGeant4 class.
The manager class for building Geant4 geometry depending on a selected user input.
TVirtualMCGeometry * GetMCGeometry() const
void SetIsUserMaxStep(G4bool isUserMaxStep)
TG4OpGeometryManager * GetOpManager() const
static void Warning(const TString &className, const TString &methodName, const TString &text)
static TString Endl()
Definition TG4Globals.h:100
virtual void SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov, Float_t *absco, Float_t *effic, Float_t *rindex, Bool_t aspline, Bool_t rspline)
virtual Bool_t GetMaterial(Int_t imat, TString &name, Double_t &a, Double_t &z, Double_t &density, Double_t &radl, Double_t &inter, TArrayD &par)
virtual void SetMaterialProperty(Int_t itmed, const char *propertyName, Int_t np, Double_t *pp, Double_t *values, Bool_t createNewKey, Bool_t spline)
virtual void Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl, Float_t *ubuf, Int_t &nbuf)
virtual void SetSkinSurface(const char *name, const char *volName, const char *opSurfaceName)
virtual void SetBorderSurface(const char *name, const char *vol1Name, int vol1CopyNo, const char *vol2Name, int vol2CopyNo, const char *opSurfaceName)
virtual void DefineOpSurface(const char *name, EMCOpSurfaceModel model, EMCOpSurfaceType surfaceType, EMCOpSurfaceFinish surfaceFinish, Double_t sigmaAlpha)
Geant4 implementation of the TVirtualMC interface methods for building Geant4 physics and access to i...
Bool_t SetDecayMode(Int_t pdg, Float_t bratio[6], Int_t mode[6][3])
Double_t ParticleCharge(Int_t pdg) const
TMCParticleType ParticleMCType(Int_t pdg) const
Int_t PDGFromId(Int_t mcID) const
Double_t ParticleMass(Int_t pdg) const
Double_t ParticleLifeTime(Int_t pdg) const
Bool_t SetCut(const char *cutName, Float_t cutValue)
void SetUserDecay(Int_t pdg)
TString ParticleName(Int_t pdg) const
Bool_t DefineIon(const char *name, Int_t Z, Int_t A, Int_t Q, Double_t excEnergy, Double_t mass)
Bool_t SetProcess(const char *controlName, Int_t controlValue)
Int_t IdFromPDG(Int_t pdgID) const
Bool_t DefineParticle(Int_t pdg, const char *name, TMCParticleType mcType, Double_t mass, Double_t charge, Double_t lifetime, const TString &pType, Double_t width, Int_t iSpin, Int_t iParity, Int_t iConjugation, Int_t iIsospin, Int_t iIsospinZ, Int_t gParity, Int_t lepton, Int_t baryon, Bool_t stable, Bool_t shortlived=kFALSE, const TString &subType="", Int_t antiEncoding=0, Double_t magMoment=0.0, Double_t excitation=0.0)
Float_t Xsec(char *reac, Float_t energy, Int_t part, Int_t mate)
void Gstpar(Int_t itmed, const char *param, Float_t parval)
Takes care of creating Geant4 user action classes using VMC.
TString GetPhysicsListSelection() const
Return physics list selection.
Geant4 implementation of the TVirtualMC interface methods for access to Geant4 at run level.
void ProcessGeantCommand(G4String command)
void SetRandomSeed()
picks up random seed from ROOT gRandom and propagates to Geant4
Bool_t SecondariesAreOrdered() const
Int_t CurrentEvent() const
void ProcessGeantMacro(G4String macroName)
Bool_t ProcessRun(G4int nofEvents)
Geant4 implementation of the TVirtualMC interface methods for access to Geant4 geometry related with ...
Int_t NofVolDaughters(const char *volName) const
const char * VolDaughterName(const char *volName, Int_t i) const
TVirtualMCSensitiveDetector * GetSensitiveDetector(const TString &volName) const
Int_t NofVolumes() const
void SetSensitiveDetector(const TString &volName, TVirtualMCSensitiveDetector *sd)
void SetExclusiveSDScoring(Bool_t exclusiveSDScoring)
Int_t VolDaughterCopyNo(const char *volName, Int_t i) const
const char * VolName(Int_t id) const
Int_t VolId(const Text_t *volName) const
Int_t VolId2Mate(Int_t volumeId) const
The manager class for application state.
TG4ApplicationState GetPreviousState() const
static G4String GetStateName(TG4ApplicationState state)
void SetNewState(TG4ApplicationState state)
static TG4StateManager * Instance()
TG4ApplicationState GetCurrentState() const
Geant4 implementation of the TVirtualMC interface methods for access to Geant4 at step level.
Bool_t IsCollectTracks() const
void SetCollectTracks(Bool_t collectTracks)
Visualization manager class.
void Gsatt(const char *name, const char *att, Int_t val)
void DrawOneSpec(const char *name)
void Gdraw(const char *name, Float_t theta, Float_t phi, Float_t psi, Float_t u0, Float_t v0, Float_t ul, Float_t vl)
Implementation of the TVirtualMC interface for Geant4.
Definition TGeant4.h:47
void StartGeantUI()
Definition TGeant4.cxx:1212
virtual Int_t PDGFromId(Int_t mcID) const
Definition TGeant4.cxx:1018
virtual const char * VolDaughterName(const char *volName, Int_t i) const
Definition TGeant4.cxx:833
virtual Bool_t SetProcess(const char *flagName, Int_t flagValue)
Definition TGeant4.cxx:921
TG4StepManager * fStepManager
step manager
Definition TGeant4.h:382
virtual Double_t Xsec(char *reac, Double_t energy, Int_t part, Int_t mate)
Definition TGeant4.cxx:999
TG4StateManager * fStateManager
application state manager
Definition TGeant4.h:378
TG4GeometryManager * fGeometryManager
geometry manager
Definition TGeant4.h:379
virtual void Medium(Int_t &kmed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm, Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin, Float_t *ubuf, Int_t nbuf)
Definition TGeant4.cxx:398
Int_t fMediumCounter
global medium counter
Definition TGeant4.h:387
virtual void BuildPhysics()
Definition TGeant4.cxx:1142
virtual void Init()
Definition TGeant4.cxx:1119
virtual void Material(Int_t &kmat, const char *name, Double_t a, Double_t z, Double_t dens, Double_t radl, Double_t absl, Float_t *buf, Int_t nwbuf)
Definition TGeant4.cxx:320
virtual TMCParticleType ParticleMCType(Int_t pdg) const
Definition TGeant4.cxx:1070
static TVirtualMCApplication * fgMasterApplicationInstance
master application instance
Definition TGeant4.h:375
TG4RunManager * fRunManager
run manager
Definition TGeant4.h:385
virtual Double_t ParticleMass(Int_t pdg) const
Definition TGeant4.cxx:1039
virtual void Gsposp(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly, Double_t *upar, Int_t np)
Definition TGeant4.cxx:535
virtual void SetMaterialProperty(Int_t itmed, const char *propertyName, Int_t np, Double_t *pp, Double_t *values, Bool_t createNewKey=false, Bool_t spline=false)
Definition TGeant4.cxx:639
virtual Bool_t GetShape(const TString &volumePath, TString &shapeType, TArrayD &par)
Definition TGeant4.cxx:694
void SetRandomSeed()
Definition TGeant4.cxx:1333
virtual void Gdraw(const char *, Double_t theta, Double_t phi, Double_t psi, Double_t u0, Double_t v0, Double_t ul, Double_t vl)
Definition TGeant4.cxx:1106
virtual Double_t ParticleLifeTime(Int_t pdg) const
Definition TGeant4.cxx:1059
Bool_t fIsMT
multi-threading mode
Definition TGeant4.h:391
virtual void SetExclusiveSDScoring(Bool_t exclusiveSDScoring)
Definition TGeant4.cxx:887
TG4PhysicsManager * fPhysicsManager
physics manager
Definition TGeant4.h:381
virtual void WriteEuclid(const char *fileName, const char *topVol, Int_t number, Int_t nlevel)
Definition TGeant4.cxx:747
virtual void Gfmate(Int_t imat, char *name, Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl, Float_t *ubuf, Int_t &nbuf)
Definition TGeant4.cxx:291
virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv, Int_t iaxis)
Definition TGeant4.cxx:466
virtual Bool_t IsCollectTracks() const
Definition TGeant4.cxx:1204
virtual void SetUserDecay(Int_t)
Definition TGeant4.cxx:976
virtual Bool_t DefineIon(const char *name, Int_t Z, Int_t A, Int_t Q, Double_t excEnergy, Double_t mass)
Definition TGeant4.cxx:964
virtual void DefineOpSurface(const char *name, EMCOpSurfaceModel model, EMCOpSurfaceType surfaceType, EMCOpSurfaceFinish surfaceFinish, Double_t sigmaAlpha)
Definition TGeant4.cxx:601
virtual void FinishGeometry()
Definition TGeant4.cxx:279
Int_t fMatrixCounter
global matrix counter
Definition TGeant4.h:389
virtual Int_t IdFromPDG(Int_t pdgID) const
Definition TGeant4.cxx:1007
virtual ~TGeant4()
Definition TGeant4.cxx:239
virtual void ProcessEvent()
Definition TGeant4.cxx:1151
virtual Bool_t GetTransformation(const TString &volumePath, TGeoHMatrix &matrix)
Definition TGeant4.cxx:679
virtual void Gdopt(const char *name, const char *value)
Definition TGeant4.cxx:1279
virtual void Gsdvt(const char *name, const char *mother, Double_t step, Int_t iaxis, Int_t numed, Int_t ndvmx)
Definition TGeant4.cxx:489
virtual Int_t GetMedium() const
virtual void SetRootGeometry()
Definition TGeant4.cxx:757
virtual void Gsdvt2(const char *name, const char *mother, Double_t step, Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx)
Definition TGeant4.cxx:501
virtual void Gckmat(Int_t itmed, char *natmed)
Definition TGeant4.cxx:311
virtual const char * VolName(Int_t id) const
Definition TGeant4.cxx:786
TG4RunConfiguration * fRunConfiguration
run configuration
Definition TGeant4.h:386
virtual void SetClipBox(const char *name, Double_t xmin, Double_t xmax, Double_t ymin, Double_t ymax, Double_t zmin, Double_t zmax)
Definition TGeant4.cxx:1288
virtual void Gsatt(const char *name, const char *att, Int_t val)
Definition TGeant4.cxx:1098
virtual void SetSkinSurface(const char *name, const char *volName, const char *opSurfaceName)
Definition TGeant4.cxx:627
virtual void InitLego()
Definition TGeant4.cxx:1325
virtual void DrawOneSpec(const char *name)
Definition TGeant4.cxx:1090
virtual void SetBorderSurface(const char *name, const char *vol1Name, int vol1CopyNo, const char *vol2Name, int vol2CopyNo, const char *opSurfaceName)
Definition TGeant4.cxx:614
virtual Bool_t DefineParticle(Int_t pdg, const char *name, TMCParticleType mcType, Double_t mass, Double_t charge, Double_t lifetime)
Definition TGeant4.cxx:931
virtual Bool_t SetDecayMode(Int_t pdg, Float_t bratio[6], Int_t mode[6][3])
Definition TGeant4.cxx:989
virtual Bool_t GetMaterial(Int_t imat, TString &name, Double_t &a, Double_t &z, Double_t &density, Double_t &radl, Double_t &inter, TArrayD &par)
Definition TGeant4.cxx:707
virtual void SetUserParameters(Bool_t isUserParameters)
Definition TGeant4.cxx:763
virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Double_t *upar, Int_t np)
Definition TGeant4.cxx:444
virtual Int_t VolId2Mate(Int_t id) const
Definition TGeant4.cxx:854
virtual Bool_t ProcessRun(Int_t nofEvents)
Definition TGeant4.cxx:1180
TString fUserGeometry
user geometry
Definition TGeant4.h:390
G4VisExecutive * fVisExecutive
Geant4 visualization manager.
Definition TGeant4.h:384
virtual void Gspos(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly="ONLY")
Definition TGeant4.cxx:523
Int_t fMaterialCounter
global material counter
Definition TGeant4.h:388
virtual Int_t MediumId(const Text_t *medName) const
Definition TGeant4.cxx:798
TG4VisManager * fVisManager
visualization manager
Definition TGeant4.h:383
virtual TString ParticleName(Int_t pdg) const
Definition TGeant4.cxx:1029
virtual void SetCollectTracks(Bool_t collectTracks)
Definition TGeant4.cxx:1196
virtual Bool_t SecondariesAreOrdered() const
Definition TGeant4.cxx:1252
void ProcessGeantCommand(const char *commandPath)
Definition TGeant4.cxx:1236
TG4SDManager * fSDManager
sensitive detectors manager
Definition TGeant4.h:380
virtual void InitMT(Int_t threadRank)
Definition TGeant4.cxx:1132
TGeant4()
Not implemented.
virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv, Int_t iaxis, Double_t c0i, Int_t numed)
Definition TGeant4.cxx:477
virtual void Gsord(const char *name, Int_t iax)
Definition TGeant4.cxx:513
virtual void SetSensitiveDetector(const TString &volName, TVirtualMCSensitiveDetector *sd)
Definition TGeant4.cxx:868
virtual Int_t VolId(const Text_t *volName) const
Definition TGeant4.cxx:776
virtual Int_t NofVolumes() const
Definition TGeant4.cxx:812
virtual Bool_t SetCut(const char *cutName, Double_t cutValue)
Definition TGeant4.cxx:911
virtual Int_t CurrentEvent() const
Definition TGeant4.cxx:1244
void ProcessGeantMacro(const char *macroName)
Definition TGeant4.cxx:1228
virtual void SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov, Float_t *absco, Float_t *effic, Float_t *rindex, Bool_t aspline=false, Bool_t rspline=false)
Definition TGeant4.cxx:575
Bool_t FinishRun()
Definition TGeant4.cxx:1188
virtual Int_t NofVolDaughters(const char *volName) const
Definition TGeant4.cxx:823
virtual void Mixture(Int_t &kmat, const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat)
Definition TGeant4.cxx:350
virtual Bool_t IsRootGeometrySupported() const
Definition TGeant4.cxx:271
virtual void Gstpar(Int_t itmed, const char *param, Double_t parval)
Definition TGeant4.cxx:900
virtual void DefaultRange()
Definition TGeant4.cxx:1299
TGeant4 * CloneForWorker() const
Definition TGeant4.cxx:1261
void StartRootUI()
Definition TGeant4.cxx:1220
static TGeant4 * fgMasterInstance
master instance
Definition TGeant4.h:372
virtual Int_t VolDaughterCopyNo(const char *volName, Int_t i) const
Definition TGeant4.cxx:843
virtual void Gdman(Double_t u, Double_t v, const char *type)
Definition TGeant4.cxx:1317
virtual void Matrix(Int_t &krot, Double_t thetaX, Double_t phiX, Double_t thetaY, Double_t phiY, Double_t thetaZ, Double_t phiZ)
Definition TGeant4.cxx:430
virtual TVirtualMCSensitiveDetector * GetSensitiveDetector(const TString &volName) const
Definition TGeant4.cxx:877
virtual Double_t ParticleCharge(Int_t pdg) const
Definition TGeant4.cxx:1049
virtual void Gdhead(Int_t isel, const char *name, Double_t chrsiz)
Definition TGeant4.cxx:1308
virtual void Gsbool(const char *onlyVolName, const char *manyVolName)
Definition TGeant4.cxx:563
TG4ApplicationState
Enumeration for application states.
@ kConstructSD
in ConstructSensitiveDetectors
@ kAddIons
in AddIons
@ kConstructGeometry
in ConstructGeometry
@ kAddParticles
in AddParticles
@ kPreInit
in PreInit
@ kNotInApplication
not in VMC application
@ kInitGeometry
in InitGeometry
@ kConstructOpGeometry
in ConstructOpGeometry