March.2006, Geant4.v8.0p01 Introduction to Hands-on 4 ~Digest of exercise ~ Toyama National College of Maritime Tech. Tsukasa Aso
Image of Hands-on example Z Very simple beamline components and a Target. Spherical Scoring geometry User is expected to implement only a beam line component (Target volume) in the Hands-on 3. Target Spherical Scoring Geometry: (Filled with Air) (Striping with a theta interval of 1 degree ) User is expected to setup scorers for counting photon yields in Hands-on 4. Beam w indow Vacuum Pipe Electron beam Evacuation chamber w indow Silicon m onitor
Scoring Goal of scoring in this example => Count photon yield from targets at the spherical surface by electrons, as a function of solid angle and photon energy. (Striping with a theta interval of 1 degree ) Z Scoring geom etry (The geom etry is defined using param eterized volum e) (1) By attaching a primitive scorer to the striped logical volume, user can get particle yield in each striped geometry. => Angular dependence (2) By setting a SD-filter to the scorer, the scorer works only for a particular particle with a particular energy interval. => Photon energy dependence
Hands-on 4 Setup scorers Primitive scorers ( Photon counting ) Accumulating result Output result Getting accumulated results Example for dumping result for analysis Physics lists Alternative Physics list
Class structure of Hands-on 4 Hands-on 4 example contains these files beamtest Main program for Hands-on 4 example BeamTestDetectorConstruction Sub-class of G4VUserDetectorConstruction class. In Hands-on 4, users are required to define scorers for the scoring geometry at SetupScorer(). BeamTestScoreParameterisation Same as Hands-on 3 for defining stripping sphere volume of scoring geometry BeamTestRun Sub-class of G4Run class. It accumulates scoring results for entire run. BeamTestRunAction Sub-class of G4VUserRunAction class. In Hands-on 4, users are required to generate a user-specific specific run object and output results. BeamTestPrimaryGeneratorAction Same as Hands-on 3 PhysicsList There are two alternative physics-list BeamTestPhysicsList : same as Hands-on 3 BeamTestPhysicsListLowEnergy : using low energy EM processes
Starting point of Hands-on 4 You try to shoot primary particles, however, you can not get any physical quantities without scorers.
Overview of exercise -1- Users are required to do: Setup scorers to the LogicalVolume; DetectorConstruction::SetupScorer() Assign sensitive detector G4MultiFunctionalDetector object, to the t scoring logical volume Register primitive scorer to the MultiFunctionalDetector object. The primitive scorer should be a G4PSSphereSurfaceCurrent with a SD-filter G4SDParticleWithEnergyFilter for specifying a particle type and energy intervals Note: If the scoring photon energies are from 0 MeV to 12 MeV with 0.25 MeV interval, we need 12/0.25 = 48 scorers. Accumulating event data for entire run Hands-on 4 provides BeamTestRun class for this purpose Generate BeamTestRun at BeamTestRunAction class Output result ; BeamTestRunAction::EndOfRunAction() Edit the code for getting result to standard device and/or into CSV files
Overview of exercise -1- (continue) After implementation of scorers, you will see: Standard output at execution. And you will also get files : Current000.csv ~ Current047.csv Run Summary Num ber of events processed : 1000000 User=1893.16s Real=2119.25s Sys=222.55s P rim itivescorer R UN M FDet,Current000 Number of entries 60 copy no.: 0 Run Value : 0.91853412 / mm2 copy no.: 1 Run Value : 0.87473393 / mm2 copy no.: 2 Run Value : 0.76614128 / mm2 copy no.: 3 Run Value : 0.66934179 / mm2 copy no.: 4 Run Value : 0.59831269 / mm2 copy no.: 5 Run Value : 0.53672097 / mm2 copy no.: 6 Run Value : 0.4813613 / mm2 copy no.: 7 Run Value : 0.43104425 / mm2 copy no.: 8 Run Value : 0.3846766 / mm2 copy no.: 9 Run Value : 0.35254134 / mm2 If you may use gnuplot, for example, $ gnuplot gnuplot> set logscale y gnuplot> plot "Current000.csv","Current001.csv, Current002.csv, Current003.csv using 1:2 gnuplot> quit
Overview of exercise -1- (continue)
Overview of exercise -2- Alternative physics-lists are introduced. Users can try it by registering one of those physics-lists to RunManager.. ( at beamtest.cc) (Note) Building hadronic physics list is required. See instruction. For example, you will see differences between BeamTestPhysicsList and QGSP_BERT by injecting 500 MeV protons. BeamTestPhysicsList defines only standard electro-magnetic processes QGSP_BERT defines both electromagnetic and hadronic processes.
Full-set Hands-on example Because of time limitation, we may not talk about the following stuff, but you can find these functionalities inside the Hands-on (full-set) example code. Handling primary beam particles BeamTestPrimaryGeneratorAction extended from G4ParticleGun can produce primary particles according to the user specification given by UI commands. Beam is produced with given particle type, direction, position with fluctuation in x-y plane, and energy with fluctuation. Handling target materials and geometries The user can change a target using UI command. The detail implementation is in BeamTestDetectorConsturction. Both material and geometry are changed associating to the target type. This will be a simple example to change geometry on the fly.