VMC Version 2.0
Loading...
Searching...
No Matches
TVirtualMC.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------
2// Copyright (C) 2019 CERN and copyright holders of VMC Project.
3// This software is distributed under the terms of the GNU General Public
4// License v3 (GPL Version 3), copied verbatim in the file "LICENSE".
5//
6// See https://github.com/vmc-project/vmc for full licensing information.
7// -----------------------------------------------------------------------
8
9// Authors: Ivana Hrivnacova, Rene Brun, Federico Carminati 13/04/2002
10
11/*************************************************************************
12 * Copyright (C) 2006, Rene Brun and Fons Rademakers. *
13 * Copyright (C) 2002, ALICE Experiment at CERN. *
14 * All rights reserved. *
15 * *
16 * For the licensing terms see $ROOTSYS/LICENSE. *
17 * For the list of contributors see $ROOTSYS/README/CREDITS. *
18 *************************************************************************/
19
20#ifndef ROOT_TVirtualMC
21#define ROOT_TVirtualMC
22
24// //
25// //
26// Abstract Monte Carlo interface //
27// //
28// //
30
31#include "TMCProcess.h"
32#include "TMCParticleType.h"
33#include "TMCOptical.h"
34#include "TMCtls.h"
36#include "TVirtualMCStack.h"
37#include "TMCManagerStack.h"
38#include "TVirtualMCDecayer.h"
39#include "TVirtualMagField.h"
40#include "TRandom.h"
41#include "TString.h"
42
43class TLorentzVector;
44class TGeoHMatrix;
45class TArrayI;
46class TArrayD;
48
49class TVirtualMC : public TNamed {
50
51 // To have access to private methods
52 friend class TMCManager;
53
54public:
59 TVirtualMC(const char *name, const char *title, Bool_t isRootGeometrySupported = kFALSE);
60
62 TVirtualMC();
63
65 virtual ~TVirtualMC();
66
68 static TVirtualMC *GetMC();
69
70 //
71 // ------------------------------------------------
72 // methods for building/management of geometry
73 // ------------------------------------------------
74 //
75
77 virtual Bool_t IsRootGeometrySupported() const = 0;
78
79 //
80 // functions from GCONS
81 // ------------------------------------------------
82 //
83
98 virtual void Material(Int_t &kmat, const char *name, Double_t a, Double_t z, Double_t dens, Double_t radl,
99 Double_t absl, Float_t *buf, Int_t nwbuf) = 0;
100
102 virtual void Material(Int_t &kmat, const char *name, Double_t a, Double_t z, Double_t dens, Double_t radl,
103 Double_t absl, Double_t *buf, Int_t nwbuf) = 0;
104
116 virtual void Mixture(Int_t &kmat, const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nlmat,
117 Float_t *wmat) = 0;
118
120 virtual void Mixture(Int_t &kmat, const char *name, Double_t *a, Double_t *z, Double_t dens, Int_t nlmat,
121 Double_t *wmat) = 0;
122
142 virtual void Medium(Int_t &kmed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm,
143 Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin, Float_t *ubuf,
144 Int_t nbuf) = 0;
145
147 virtual void Medium(Int_t &kmed, const char *name, Int_t nmat, Int_t isvol, Int_t ifield, Double_t fieldm,
148 Double_t tmaxfd, Double_t stemax, Double_t deemax, Double_t epsil, Double_t stmin,
149 Double_t *ubuf, Int_t nbuf) = 0;
150
159 virtual void Matrix(Int_t &krot, Double_t thetaX, Double_t phiX, Double_t thetaY, Double_t phiY, Double_t thetaZ,
160 Double_t phiZ) = 0;
161
172 virtual void Gstpar(Int_t itmed, const char *param, Double_t parval) = 0;
173
174 //
175 // functions from GGEOM
176 // ------------------------------------------------
177 //
178
185 virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t np) = 0;
186
188 virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Double_t *upar, Int_t np) = 0;
189
197 virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv, Int_t iaxis) = 0;
198
203 virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv, Int_t iaxis, Double_t c0i, Int_t numed) = 0;
204
213 virtual void Gsdvt(const char *name, const char *mother, Double_t step, Int_t iaxis, Int_t numed, Int_t ndvmx) = 0;
214
223 virtual void Gsdvt2(const char *name, const char *mother, Double_t step, Int_t iaxis, Double_t c0, Int_t numed,
224 Int_t ndvmx) = 0;
225
229 virtual void Gsord(const char *name, Int_t iax) = 0;
230
241 virtual void Gspos(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot,
242 const char *konly = "ONLY") = 0;
243
246 virtual void Gsposp(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot,
247 const char *konly, Float_t *upar, Int_t np) = 0;
248
250 virtual void Gsposp(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot,
251 const char *konly, Double_t *upar, Int_t np) = 0;
252
257 virtual void Gsbool(const char *onlyVolName, const char *manyVolName) = 0;
258
272 virtual void SetCerenkov(Int_t itmed, Int_t npckov, Float_t *ppckov, Float_t *absco, Float_t *effic, Float_t *rindex,
273 Bool_t aspline = false, Bool_t rspline = false) = 0;
274
276 virtual void SetCerenkov(Int_t itmed, Int_t npckov, Double_t *ppckov, Double_t *absco, Double_t *effic,
277 Double_t *rindex, Bool_t aspline = false, Bool_t rspline = false) = 0;
278
279 //
280 // functions for definition of surfaces
281 // and material properties for optical physics
282 // ------------------------------------------------
283 //
284
292 virtual void DefineOpSurface(const char *name, EMCOpSurfaceModel model, EMCOpSurfaceType surfaceType,
293 EMCOpSurfaceFinish surfaceFinish, Double_t sigmaAlpha) = 0;
294
303 virtual void SetBorderSurface(const char *name, const char *vol1Name, int vol1CopyNo, const char *vol2Name,
304 int vol2CopyNo, const char *opSurfaceName) = 0;
305
311 virtual void SetSkinSurface(const char *name, const char *volName, const char *opSurfaceName) = 0;
312
322 virtual void SetMaterialProperty(Int_t itmed, const char *propertyName, Int_t np, Double_t *pp, Double_t *values,
323 Bool_t createNewKey = false, Bool_t spline = false) = 0;
324
330 virtual void SetMaterialProperty(Int_t itmed, const char *propertyName, Double_t value) = 0;
331
341 virtual void SetMaterialProperty(const char *surfaceName, const char *propertyName, Int_t np, Double_t *pp,
342 Double_t *values, Bool_t createNewKey = false, Bool_t spline = false) = 0;
343
344 //
345 // functions for access to geometry
346 // ------------------------------------------------
347 //
348
351 virtual Bool_t GetTransformation(const TString &volumePath, TGeoHMatrix &matrix) = 0;
352
355 virtual Bool_t GetShape(const TString &volumePath, TString &shapeType, TArrayD &par) = 0;
356
359 virtual Bool_t GetMaterial(Int_t imat, TString &name, Double_t &a, Double_t &z, Double_t &density, Double_t &radl,
360 Double_t &inter, TArrayD &par) = 0;
361
364 virtual Bool_t GetMaterial(const TString &volumeName, TString &name, Int_t &imat, Double_t &a, Double_t &z,
365 Double_t &density, Double_t &radl, Double_t &inter, TArrayD &par) = 0;
366
369 virtual Bool_t GetMedium(const TString &volumeName, TString &name, Int_t &imed, Int_t &nmat, Int_t &isvol,
370 Int_t &ifield, Double_t &fieldm, Double_t &tmaxfd, Double_t &stemax, Double_t &deemax,
371 Double_t &epsil, Double_t &stmin, TArrayD &par) = 0;
372
381 virtual void WriteEuclid(const char *filnam, const char *topvol, Int_t number, Int_t nlevel) = 0;
382
384 virtual void SetRootGeometry() = 0;
385
390 virtual void SetUserParameters(Bool_t isUserParameters) = 0;
391
392 //
393 // get methods
394 // ------------------------------------------------
395 //
396
398 virtual Int_t VolId(const char *volName) const = 0;
399
401 virtual const char *VolName(Int_t id) const = 0;
402
404 virtual Int_t MediumId(const char *mediumName) const = 0;
405
407 virtual Int_t NofVolumes() const = 0;
408
410 virtual Int_t VolId2Mate(Int_t id) const = 0;
411
413 virtual Int_t NofVolDaughters(const char *volName) const = 0;
414
416 virtual const char *VolDaughterName(const char *volName, Int_t i) const = 0;
417
419 virtual Int_t VolDaughterCopyNo(const char *volName, Int_t i) const = 0;
420
421 //
422 // ------------------------------------------------
423 // methods for sensitive detectors
424 // ------------------------------------------------
425 //
426
430 virtual void SetSensitiveDetector(const TString &volName, TVirtualMCSensitiveDetector *sd) = 0;
431
434 virtual TVirtualMCSensitiveDetector *GetSensitiveDetector(const TString &volName) const = 0;
435
439 virtual void SetExclusiveSDScoring(Bool_t exclusiveSDScoring) = 0;
440
441 //
442 // ------------------------------------------------
443 // methods for physics management
444 // ------------------------------------------------
445 //
446
447 //
448 // set methods
449 // ------------------------------------------------
450 //
451
453 virtual Bool_t SetCut(const char *cutName, Double_t cutValue) = 0;
454
456 virtual Bool_t SetProcess(const char *flagName, Int_t flagValue) = 0;
457
483 virtual Bool_t DefineParticle(Int_t pdg, const char *name, TMCParticleType mcType, Double_t mass, Double_t charge,
484 Double_t lifetime) = 0;
485
511 virtual Bool_t DefineParticle(Int_t pdg, const char *name, TMCParticleType mcType, Double_t mass, Double_t charge,
512 Double_t lifetime, const TString &pType, Double_t width, Int_t iSpin, Int_t iParity,
513 Int_t iConjugation, Int_t iIsospin, Int_t iIsospinZ, Int_t gParity, Int_t lepton,
514 Int_t baryon, Bool_t stable, Bool_t shortlived = kFALSE, const TString &subType = "",
515 Int_t antiEncoding = 0, Double_t magMoment = 0.0, Double_t excitation = 0.0) = 0;
516
525 virtual Bool_t DefineIon(const char *name, Int_t Z, Int_t A, Int_t Q, Double_t excEnergy, Double_t mass = 0.) = 0;
526
532 virtual Bool_t SetDecayMode(Int_t pdg, Float_t bratio[6], Int_t mode[6][3]) = 0;
533
537 virtual Double_t Xsec(char *, Double_t, Int_t, Int_t) = 0;
538
539 //
540 // particle table usage
541 // ------------------------------------------------
542 //
543
545 virtual Int_t IdFromPDG(Int_t pdg) const = 0;
546
548 virtual Int_t PDGFromId(Int_t id) const = 0;
549
550 //
551 // get methods
552 // ------------------------------------------------
553 //
554
556 virtual TString ParticleName(Int_t pdg) const = 0;
557
559 virtual Double_t ParticleMass(Int_t pdg) const = 0;
560
562 virtual Double_t ParticleCharge(Int_t pdg) const = 0;
563
565 virtual Double_t ParticleLifeTime(Int_t pdg) const = 0;
566
568 virtual TMCParticleType ParticleMCType(Int_t pdg) const = 0;
569 //
570 // ------------------------------------------------
571 // methods for step management
572 // ------------------------------------------------
573 //
574
575 //
576 // action methods
577 // ------------------------------------------------
578 //
579
581 virtual void StopTrack() = 0;
582
584 virtual void StopEvent() = 0;
585
587 virtual void StopRun() = 0;
588
589 //
590 // set methods
591 // ------------------------------------------------
592 //
593
595 virtual void SetMaxStep(Double_t) = 0;
596
598 virtual void SetMaxNStep(Int_t) = 0;
599
602 virtual void SetUserDecay(Int_t pdg) = 0;
603
605 virtual void ForceDecayTime(Float_t) = 0;
606
607 //
608 // tracking volume(s)
609 // ------------------------------------------------
610 //
611
613 virtual Int_t CurrentVolID(Int_t &copyNo) const = 0;
614
617 virtual Int_t CurrentVolOffID(Int_t off, Int_t &copyNo) const = 0;
618
620 virtual const char *CurrentVolName() const = 0;
621
625 virtual const char *CurrentVolOffName(Int_t off) const = 0;
626
628 virtual const char *CurrentVolPath() = 0;
629
632 virtual Bool_t CurrentBoundaryNormal(Double_t &x, Double_t &y, Double_t &z) const = 0;
633
635 virtual Int_t CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl) const = 0;
636
638 virtual Int_t CurrentMedium() const = 0;
639 // new function (to replace GetMedium() const)
640
642 virtual Int_t CurrentEvent() const = 0;
643
651 virtual void Gmtod(Float_t *xm, Float_t *xd, Int_t iflag) = 0;
652
654 virtual void Gmtod(Double_t *xm, Double_t *xd, Int_t iflag) = 0;
655
663 virtual void Gdtom(Float_t *xd, Float_t *xm, Int_t iflag) = 0;
664
666 virtual void Gdtom(Double_t *xd, Double_t *xm, Int_t iflag) = 0;
667
669 virtual Double_t MaxStep() const = 0;
670
672 virtual Int_t GetMaxNStep() const = 0;
673
674 //
675 // get methods
676 // tracking particle
677 // dynamic properties
678 // ------------------------------------------------
679 //
680
683 virtual void TrackPosition(TLorentzVector &position) const = 0;
684
686 virtual void TrackPosition(Double_t &x, Double_t &y, Double_t &z) const = 0;
687
689 virtual void TrackPosition(Float_t &x, Float_t &y, Float_t &z) const = 0;
690
693 virtual void TrackMomentum(TLorentzVector &momentum) const = 0;
694
697 virtual void TrackMomentum(Double_t &px, Double_t &py, Double_t &pz, Double_t &etot) const = 0;
698
701 virtual void TrackMomentum(Float_t &px, Float_t &py, Float_t &pz, Float_t &etot) const = 0;
702
704 virtual Double_t TrackStep() const = 0;
705
707 virtual Double_t TrackLength() const = 0;
708
710 virtual Double_t TrackTime() const = 0;
711
713 virtual Double_t Edep() const = 0;
714
716 virtual Double_t NIELEdep() const = 0;
717
719 virtual Int_t StepNumber() const = 0;
720
722 virtual Double_t TrackWeight() const = 0;
723
725 virtual void TrackPolarization(Double_t &polX, Double_t &polY, Double_t &polZ) const = 0;
726
728 virtual void TrackPolarization(TVector3 &pol) const = 0;
729
730 //
731 // get methods
732 // tracking particle
733 // static properties
734 // ------------------------------------------------
735 //
736
738 virtual Int_t TrackPid() const = 0;
739
741 virtual Double_t TrackCharge() const = 0;
742
744 virtual Double_t TrackMass() const = 0;
745
747 virtual Double_t Etot() const = 0;
748
749 //
750 // get methods - track status
751 // ------------------------------------------------
752 //
753
755 virtual Bool_t IsNewTrack() const = 0;
756
758 virtual Bool_t IsTrackInside() const = 0;
759
761 virtual Bool_t IsTrackEntering() const = 0;
762
764 virtual Bool_t IsTrackExiting() const = 0;
765
767 virtual Bool_t IsTrackOut() const = 0;
768
772 virtual Bool_t IsTrackDisappeared() const = 0;
773
775 virtual Bool_t IsTrackStop() const = 0;
776
779 virtual Bool_t IsTrackAlive() const = 0;
780
781 //
782 // get methods - secondaries
783 // ------------------------------------------------
784 //
785
787 virtual Int_t NSecondaries() const = 0;
788
791 virtual void GetSecondary(Int_t isec, Int_t &particleId, TLorentzVector &position, TLorentzVector &momentum) = 0;
792
795 virtual TMCProcess ProdProcess(Int_t isec) const = 0;
796
799 virtual Int_t StepProcesses(TArrayI &proc) const = 0;
800
802 virtual Bool_t SecondariesAreOrdered() const = 0;
803
804 //
805 // ------------------------------------------------
806 // Control methods
807 // ------------------------------------------------
808 //
809
811 virtual void Init() = 0;
812
814 virtual void BuildPhysics() = 0;
815
817 virtual void ProcessEvent() = 0;
818
820 virtual void ProcessEvent(Int_t eventId);
821
824 virtual Bool_t ProcessRun(Int_t nevent) = 0;
825
827 virtual void TerminateRun() {}
828
830 virtual void InitLego() = 0;
831
833 virtual void SetCollectTracks(Bool_t collectTracks) = 0;
834
836 virtual Bool_t IsCollectTracks() const = 0;
837
839 virtual Bool_t IsMT() const { return kFALSE; }
840
841 //
842 // ------------------------------------------------
843 // Set methods
844 // ------------------------------------------------
845 //
846
848 virtual void SetStack(TVirtualMCStack *stack);
849
851 virtual void SetExternalDecayer(TVirtualMCDecayer *decayer);
852
854 virtual void SetRandom(TRandom *random);
855
857 virtual void SetMagField(TVirtualMagField *field);
858
859 //
860 // ------------------------------------------------
861 // Get methods
862 // ------------------------------------------------
863 //
864
866 TVirtualMCStack *GetStack() const { return fStack; }
867
870
872 TVirtualMCDecayer *GetDecayer() const { return fDecayer; }
873
875 TRandom *GetRandom() const { return fRandom; }
876
878 TVirtualMagField *GetMagField() const { return fMagField; }
879
881 Int_t GetId() const { return fId; }
882
883private:
885 void SetId(UInt_t id);
886
888 void SetManagerStack(TMCManagerStack *stack);
889
895 virtual void ProcessEvent(Int_t eventId, Bool_t isInterruptible) = 0;
896
899 virtual void InterruptTrack() = 0;
900
901 // Private, no copying.
904
905protected:
907
908private:
909#if !defined(__CINT__)
910 static TMCThreadLocal TVirtualMC *fgMC;
911#else
912 static TVirtualMC *fgMC;
913#endif
914
915private:
918 // TObjects in in general.
920 Int_t fId;
921
924 TVirtualMCDecayer *fDecayer;
925 TRandom *fRandom;
926 TVirtualMagField *fMagField;
927
928 ClassDef(TVirtualMC, 1) // Interface to Monte Carlo
929};
930
931#define gMC (TVirtualMC::GetMC())
932
933#endif // ROOT_TVirtualMC
EMCOpSurfaceModel
Optical surface models.
Definition: TMCOptical.h:30
EMCOpSurfaceType
Optical surface types.
Definition: TMCOptical.h:39
EMCOpSurfaceFinish
Optical surface finish types.
Definition: TMCOptical.h:50
TMCParticleType
VMC particle type codes.
TMCProcess
VMC physics process codes.
Definition: TMCProcess.h:30
Concrete implementation of particles stack used by the TMCManager.
Singleton manager class for handling and steering a run with multiple TVirtualMC engines sharing even...
Definition: TMCManager.h:43
Interface to a user Monte Carlo application.
Interface to a user defined sensitive detector.
Interface to a user defined particles stack.
Abstract Monte Carlo interface.
Definition: TVirtualMC.h:49
virtual Bool_t IsMT() const
Return the info if multi-threading is supported/activated.
Definition: TVirtualMC.h:839
virtual Int_t StepProcesses(TArrayI &proc) const =0
Return the array of the VMC code of the processes active in the current step.
TMCManagerStack * GetManagerStack() const
Return the particle stack managed by the TMCManager (if any)
Definition: TVirtualMC.h:869
virtual Bool_t IsCollectTracks() const =0
Return the info if collecting tracks is activated.
virtual Double_t ParticleMass(Int_t pdg) const =0
Return mass of the particle specified by pdg.
virtual void Mixture(Int_t &kmat, const char *name, Double_t *a, Double_t *z, Double_t dens, Int_t nlmat, Double_t *wmat)=0
The same as previous but in double precision.
virtual Int_t CurrentEvent() const =0
Return the number of the current event.
virtual Int_t IdFromPDG(Int_t pdg) const =0
Return MC specific code from a PDG and pseudo ENDF code (pdg)
TVirtualMC()
Default constructor.
Definition: TVirtualMC.cxx:84
virtual Bool_t IsNewTrack() const =0
Return true when the track performs the first step.
virtual Bool_t GetMaterial(const TString &volumeName, TString &name, Int_t &imat, Double_t &a, Double_t &z, Double_t &density, Double_t &radl, Double_t &inter, TArrayD &par)=0
Return the material parameters for the volume specified by the volumeName.
virtual void SetMaterialProperty(const char *surfaceName, const char *propertyName, Int_t np, Double_t *pp, Double_t *values, Bool_t createNewKey=false, Bool_t spline=false)=0
Define optical surface property via a table of values.
virtual void TrackPosition(Double_t &x, Double_t &y, Double_t &z) const =0
Only return spatial coordinates (as double)
virtual Int_t StepNumber() const =0
Return the current step number.
virtual Bool_t IsTrackAlive() const =0
Return true if the current particle is alive and will continue to be transported.
virtual Double_t MaxStep() const =0
Return the maximum step length in the current medium.
virtual void InterruptTrack()=0
That triggers stopping the transport of the current track without dispatching to common routines like...
virtual Double_t TrackTime() const =0
Return the current time of flight of the track being transported (in s)
virtual void Gmtod(Double_t *xm, Double_t *xd, Int_t iflag)=0
The same as previous but in double precision.
virtual Bool_t IsTrackInside() const =0
Return true if the track is not at the boundary of the current volume.
virtual Double_t Edep() const =0
Return the energy lost in the current step.
virtual void Gsdvt2(const char *name, const char *mother, Double_t step, Int_t iaxis, Double_t c0, Int_t numed, Int_t ndvmx)=0
Create a new volume by dividing an existing one Divides mother into divisions called name along axis ...
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, Double_t *ubuf, Int_t nbuf)=0
The same as previous but in double precision.
TVirtualMC(const TVirtualMC &mc)
virtual void TrackPolarization(TVector3 &pol) const =0
Get the current polarization.
virtual Int_t VolId2Mate(Int_t id) const =0
Return material number for a given volume id.
virtual void StopRun()=0
Stop simulation of the current event and set the abort run flag to true.
TRandom * fRandom
Random number generator.
Definition: TVirtualMC.h:925
virtual const char * VolName(Int_t id) const =0
Return the volume name for a given volume identifier id.
virtual Double_t TrackLength() const =0
Return the length of the current track from its origin (in cm)
virtual void Gsbool(const char *onlyVolName, const char *manyVolName)=0
Helper function for resolving MANY.
virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Float_t *upar, Int_t np)=0
Create a new volume.
virtual void TerminateRun()
Additional cleanup after a run can be done here (optional)
Definition: TVirtualMC.h:827
virtual void Gdtom(Double_t *xd, Double_t *xm, Int_t iflag)=0
The same as previous but in double precision.
TVirtualMC & operator=(const TVirtualMC &)
TVirtualMCDecayer * GetDecayer() const
Return the external decayer.
Definition: TVirtualMC.h:872
virtual Int_t CurrentVolID(Int_t &copyNo) const =0
Return the current volume ID and copy number.
virtual TMCParticleType ParticleMCType(Int_t pdg) const =0
Return VMC type of the particle specified by pdg.
virtual void Init()=0
Initialize MC.
virtual Double_t TrackMass() const =0
Return the mass of the track currently transported.
virtual Bool_t GetShape(const TString &volumePath, TString &shapeType, TArrayD &par)=0
Return the name of the shape (shapeType) and its parameters par for the volume specified by the path ...
virtual void Gsposp(const char *name, Int_t nr, const char *mother, Double_t x, Double_t y, Double_t z, Int_t irot, const char *konly, Float_t *upar, Int_t np)=0
Place a copy of generic volume name with user number nr inside mother, with its parameters upar(1....
virtual void Gsdvn2(const char *name, const char *mother, Int_t ndiv, Int_t iaxis, Double_t c0i, Int_t numed)=0
Create a new volume by dividing an existing one.
virtual Bool_t IsTrackStop() const =0
Return true if the track energy has fallen below the threshold.
static TVirtualMC * GetMC()
Static access method.
Definition: TVirtualMC.cxx:109
virtual void SetSensitiveDetector(const TString &volName, TVirtualMCSensitiveDetector *sd)=0
Set a sensitive detector to a volume.
virtual void ForceDecayTime(Float_t)=0
Force the decay time of the current particle.
virtual Int_t CurrentMedium() const =0
virtual void TrackPosition(Float_t &x, Float_t &y, Float_t &z) const =0
Only return spatial coordinates (as float)
TMCManagerStack * fManagerStack
Stack handled by the TMCManager.
Definition: TVirtualMC.h:923
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)=0
Define a medium.
virtual void SetBorderSurface(const char *name, const char *vol1Name, int vol1CopyNo, const char *vol2Name, int vol2CopyNo, const char *opSurfaceName)=0
Define the optical surface border.
virtual void Mixture(Int_t &kmat, const char *name, Float_t *a, Float_t *z, Double_t dens, Int_t nlmat, Float_t *wmat)=0
Define a mixture or a compound with a number kmat composed by the basic nlmat materials defined by ar...
virtual void SetUserParameters(Bool_t isUserParameters)=0
Activate the parameters defined in tracking media (DEEMAX, STMIN, STEMAX), which are,...
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)=0
The same as previous but in double precision.
virtual Int_t TrackPid() const =0
Return the PDG of the particle transported.
virtual void SetUserDecay(Int_t pdg)=0
Force the decays of particles to be done with Pythia and not with the Geant routines.
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")=0
Position a volume into an existing one.
virtual Double_t ParticleLifeTime(Int_t pdg) const =0
Return life time of the particle specified by pdg.
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)=0
Define the tables for UV photon tracking in medium itmed.
virtual void DefineOpSurface(const char *name, EMCOpSurfaceModel model, EMCOpSurfaceType surfaceType, EMCOpSurfaceFinish surfaceFinish, Double_t sigmaAlpha)=0
Define the optical surface.
virtual void SetMaterialProperty(Int_t itmed, const char *propertyName, Double_t value)=0
Define material property via a value.
virtual void Gstpar(Int_t itmed, const char *param, Double_t parval)=0
Change the value of cut or mechanism param to a new value parval for tracking medium itmed.
virtual Bool_t IsTrackEntering() const =0
Return true if this is the first step of the track in the current volume.
virtual void ProcessEvent()=0
Process one event.
TRandom * GetRandom() const
Return the random number generator.
Definition: TVirtualMC.h:875
virtual Double_t ParticleCharge(Int_t pdg) const =0
Return charge (in e units) of the particle specified by pdg.
virtual void Material(Int_t &kmat, const char *name, Double_t a, Double_t z, Double_t dens, Double_t radl, Double_t absl, Double_t *buf, Int_t nwbuf)=0
The same as previous but in double precision.
virtual void SetMaxStep(Double_t)=0
Set the maximum step allowed till the particle is in the current medium.
virtual Bool_t DefineIon(const char *name, Int_t Z, Int_t A, Int_t Q, Double_t excEnergy, Double_t mass=0.)=0
Set a user defined ion.
virtual void SetRandom(TRandom *random)
Set the random number generator.
Definition: TVirtualMC.cxx:149
void SetId(UInt_t id)
Set the VMC id.
Definition: TVirtualMC.cxx:170
virtual Double_t Etot() const =0
Return the total energy of the current track.
virtual void TrackPolarization(Double_t &polX, Double_t &polY, Double_t &polZ) const =0
Get the current polarization.
virtual Int_t CurrentVolOffID(Int_t off, Int_t &copyNo) const =0
Return the current volume off upward in the geometrical tree ID and copy number.
virtual Bool_t IsTrackDisappeared() const =0
Return true if the current particle has disappeared either because it decayed or because it underwent...
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)=0
Define a material.
virtual void InitLego()=0
Set switches for lego transport.
virtual void Gsdvn(const char *name, const char *mother, Int_t ndiv, Int_t iaxis)=0
Create a new volume by dividing an existing one.
virtual void ProcessEvent(Int_t eventId, Bool_t isInterruptible)=0
An interruptible event can be paused and resumed at any time.
virtual Double_t TrackWeight() const =0
Get the current weight.
virtual Bool_t GetMedium(const TString &volumeName, TString &name, Int_t &imed, Int_t &nmat, Int_t &isvol, Int_t &ifield, Double_t &fieldm, Double_t &tmaxfd, Double_t &stemax, Double_t &deemax, Double_t &epsil, Double_t &stmin, TArrayD &par)=0
Return the medium parameters for the volume specified by the volumeName.
virtual TString ParticleName(Int_t pdg) const =0
Return name of the particle specified by pdg.
Int_t fId
Unique identification of this VMC.
Definition: TVirtualMC.h:920
virtual void SetExclusiveSDScoring(Bool_t exclusiveSDScoring)=0
The scoring option: if true, scoring is performed only via user defined sensitive detectors and MCApp...
virtual 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)=0
Set a user defined particle Function is ignored if particle with specified pdg already exists and err...
virtual Double_t TrackCharge() const =0
Return the charge of the track currently transported.
virtual void TrackPosition(TLorentzVector &position) const =0
Return the current position in the master reference frame of the track being transported.
virtual TVirtualMCSensitiveDetector * GetSensitiveDetector(const TString &volName) const =0
Get a sensitive detector of a volume.
virtual const char * VolDaughterName(const char *volName, Int_t i) const =0
Return the name of i-th daughter of the volume specified by volName.
virtual void StopTrack()=0
Stop the transport of the current particle and skip to the next.
virtual Bool_t SetProcess(const char *flagName, Int_t flagValue)=0
Set process control.
virtual Bool_t ProcessRun(Int_t nevent)=0
Process one run and return true if run has finished successfully, return false in other cases (run ab...
virtual Int_t NSecondaries() const =0
Return the number of secondary particles generated in the current step.
virtual const char * CurrentVolName() const =0
Return the current volume name.
virtual Bool_t SecondariesAreOrdered() const =0
Return the information about the transport order needed by the stack.
virtual void Gsord(const char *name, Int_t iax)=0
Flag volume name whose contents will have to be ordered along axis iax, by setting the search flag to...
virtual void BuildPhysics()=0
Initialize MC physics.
virtual void Gdtom(Float_t *xd, Float_t *xm, Int_t iflag)=0
Computes coordinates xm in mother reference system from known coordinates xd in daughter reference sy...
virtual void SetRootGeometry()=0
Set geometry from Root (built via TGeo)
TVirtualMagField * GetMagField() const
Return the magnetic field.
Definition: TVirtualMC.h:878
virtual void SetStack(TVirtualMCStack *stack)
Set the particle stack.
Definition: TVirtualMC.cxx:129
virtual Double_t TrackStep() const =0
Return the length in centimeters of the current step (in cm)
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)=0
Return the material parameters for the material specified by the material Id.
void SetManagerStack(TMCManagerStack *stack)
Set container holding additional information for transported TParticles.
Definition: TVirtualMC.cxx:179
virtual void GetSecondary(Int_t isec, Int_t &particleId, TLorentzVector &position, TLorentzVector &momentum)=0
Return the parameters of the secondary track number isec produced in the current step.
virtual Bool_t IsTrackOut() const =0
Return true if the track is out of the setup.
TVirtualMagField * fMagField
Magnetic field.
Definition: TVirtualMC.h:926
virtual void Gsdvt(const char *name, const char *mother, Double_t step, Int_t iaxis, Int_t numed, Int_t ndvmx)=0
Create a new volume by dividing an existing one Divide mother into divisions called name along axis i...
virtual void Matrix(Int_t &krot, Double_t thetaX, Double_t phiX, Double_t thetaY, Double_t phiY, Double_t thetaZ, Double_t phiZ)=0
Define a rotation matrix.
virtual Bool_t SetCut(const char *cutName, Double_t cutValue)=0
Set transport cuts for particles.
virtual const char * CurrentVolOffName(Int_t off) const =0
Return the current volume off upward in the geometrical tree name and copy number' if name=0 no name ...
virtual Int_t VolId(const char *volName) const =0
Return the unique numeric identifier for volume name volName.
virtual Int_t CurrentMaterial(Float_t &a, Float_t &z, Float_t &dens, Float_t &radl, Float_t &absl) const =0
Return the parameters of the current material during transport.
virtual void SetSkinSurface(const char *name, const char *volName, const char *opSurfaceName)=0
Define the optical skin surface.
static TMCThreadLocal TVirtualMC * fgMC
Static TVirtualMC pointer.
Definition: TVirtualMC.h:910
virtual Double_t NIELEdep() const =0
Return the non-ionising energy lost (NIEL) in the current step.
TVirtualMCApplication * fApplication
User MC application.
Definition: TVirtualMC.h:906
virtual void TrackMomentum(Float_t &px, Float_t &py, Float_t &pz, Float_t &etot) const =0
Return the direction and the momentum (GeV/c) of the track currently being transported (as float)
virtual void SetCollectTracks(Bool_t collectTracks)=0
(In)Activate collecting TGeo tracks
virtual void SetExternalDecayer(TVirtualMCDecayer *decayer)
Set the external decayer.
Definition: TVirtualMC.cxx:139
virtual void WriteEuclid(const char *filnam, const char *topvol, Int_t number, Int_t nlevel)=0
Write out the geometry of the detector in EUCLID file format.
virtual TMCProcess ProdProcess(Int_t isec) const =0
Return the VMC code of the process that has produced the secondary particles in the current step.
virtual Int_t Gsvolu(const char *name, const char *shape, Int_t nmed, Double_t *upar, Int_t np)=0
The same as previous but in double precision.
virtual void TrackMomentum(TLorentzVector &momentum) const =0
Return the direction and the momentum (GeV/c) of the track currently being transported.
TVirtualMCStack * GetStack() const
Return the particle stack.
Definition: TVirtualMC.h:866
virtual void SetCerenkov(Int_t itmed, Int_t npckov, Double_t *ppckov, Double_t *absco, Double_t *effic, Double_t *rindex, Bool_t aspline=false, Bool_t rspline=false)=0
The same as previous but in double precision.
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)=0
Define material property via a table of values.
virtual Int_t MediumId(const char *mediumName) const =0
Return the unique numeric identifier for medium name mediumName.
virtual Double_t Xsec(char *, Double_t, Int_t, Int_t)=0
Calculate X-sections (Geant3 only) Deprecated.
virtual Int_t NofVolDaughters(const char *volName) const =0
Return number of daughters of the volume specified by volName.
Int_t GetId() const
Return the VMC's ID.
Definition: TVirtualMC.h:881
virtual void TrackMomentum(Double_t &px, Double_t &py, Double_t &pz, Double_t &etot) const =0
Return the direction and the momentum (GeV/c) of the track currently being transported (as double)
virtual Bool_t IsTrackExiting() const =0
Return true if this is the last step of the track in the current volume.
virtual Int_t GetMaxNStep() const =0
Return the maximum number of steps allowed in the current medium.
virtual Bool_t CurrentBoundaryNormal(Double_t &x, Double_t &y, Double_t &z) const =0
If track is on a geometry boundary, fill the normal vector of the crossing volume surface and return ...
virtual void SetMagField(TVirtualMagField *field)
Set the magnetic field.
Definition: TVirtualMC.cxx:160
virtual Int_t VolDaughterCopyNo(const char *volName, Int_t i) const =0
Return the copyNo of i-th daughter of the volume specified by volName.
virtual void Gmtod(Float_t *xm, Float_t *xd, Int_t iflag)=0
Computes coordinates xd in daughter reference system from known coordinates xm in mother reference sy...
virtual Bool_t DefineParticle(Int_t pdg, const char *name, TMCParticleType mcType, Double_t mass, Double_t charge, Double_t lifetime)=0
Set a user defined particle Function is ignored if particle with specified pdg already exists and err...
virtual void SetMaxNStep(Int_t)=0
Set the maximum number of steps till the particle is in the current medium.
virtual ~TVirtualMC()
Destructor.
Definition: TVirtualMC.cxx:95
TVirtualMCStack * fStack
Particles stack.
Definition: TVirtualMC.h:922
virtual Bool_t IsRootGeometrySupported() const =0
Info about supporting geometry defined via Root.
virtual Int_t PDGFromId(Int_t id) const =0
Return PDG code and pseudo ENDF code from MC specific code (id)
virtual Bool_t SetDecayMode(Int_t pdg, Float_t bratio[6], Int_t mode[6][3])=0
Set a user phase space decay for a particle.
virtual Int_t NofVolumes() const =0
Return total number of volumes in the geometry.
virtual Bool_t GetTransformation(const TString &volumePath, TGeoHMatrix &matrix)=0
Return the transformation matrix between the volume specified by the path volumePath and the top or m...
virtual const char * CurrentVolPath()=0
Return the path in geometry tree for the current volume.
virtual void StopEvent()=0
Stop simulation of the current event and skip to the next.
TVirtualMCDecayer * fDecayer
External decayer.
Definition: TVirtualMC.h:924