# Macro file for sr1.cc - Construct detector, set fields and other parameters. # Last modified by T. Shiroka: 31.10.2008 # How to run: sr1 10xx.mac (append "idle" for prompt after running) # sr1 10xx.mac > fname.txt (stores output on a txt file) ############################################################################################### # # # Specify the geometry parameters in this file (all dimensions in mm) # # a. Lines starting with hash marks "#" are comments # # b Lines starting with #* are temporary comments. Remove/modify to change the configuration # # c. Lines starting with /sr1/command are commands for the executable program # # d. Lines starting with /vis, /gun, etc. are common macro commands # # e. Beam-line components are ordered from exp. area (MCP2) to trigger detector (TD) # #---------------------------------------------------------------------------------------------# # Syntax example (following /sr1/command): # # construct solid_type volume_name parameters_defining_solid material position mothers_name # # (mothers_name starts with log_) # ############################################################################################### # For the meaning of the acronyms see also the original G3 file ugeom.F at: # http://savannah.psi.ch/viewcvs/trunk/simulation/geant3/src/lemsr/ugeom.F?root=nemu%2Flem&rev=2964&view=markup ################################################################################################################ # -- ROTATION MATRICES -- ################################################################################################################ # 3 parameters -> Define Euler angles (the 4th par. is set to zero). # 4 parameters -> Define axis + rotation. # HEP computations ordinarily use the active rotation viewpoint (object is rotated NOT axes). # Therefore, rotations about an axis imply ACTIVE COUNTER-CLOCKWISE rotation in this package. # Rotation around a specified axis means counter-clockwise rot. around the positive direction of the axis. # Define rotations for the field maps of Trigger and Ring Anode: /sr1/command rotation rotPole 1 0 0 90 /sr1/command rotation rotTrig 0 1 0 -90 /sr1/command rotation rotRAnR 0 0 1 -90 /sr1/command rotation rotRAnL 0 0 1 90 /sr1/command rotation rotRAnD 0 0 1 180 ################################################################################################################ # -- SPIN ROTATOR GEOMETRY -- ################################################################################################################ # WORLD = Laboratory reference frame /sr1/command construct box World 250 250 500 G4_Galactic 0 0 0 no_logical_volume norot dead -1 # World visual attributes (optional) /sr1/command visattributes log_World invisible # Electromagnet with iron yoke # U - up, D - down, L - left, R - right (with respect to muon's view - momentum direction) /sr1/command construct box YokeU 200 25 50 G4_Fe 0 200 0 log_World norot dead 201 nofield /sr1/command construct box YokeD 200 25 50 G4_Fe 0 -200 0 log_World norot dead 204 nofield /sr1/command construct box YokeL 25 175 50 G4_Fe 175 0 0 log_World norot dead 203 nofield /sr1/command construct box YokeR 25 175 50 G4_Fe -175 0 0 log_World norot dead 202 nofield /sr1/command construct tubs NPole 0 100 25 0 360 G4_Fe 0 100 0 log_World rotPole dead 211 nofield /sr1/command construct tubs NYoke 0 50 25 0 360 G4_Fe 0 150 0 log_World rotPole dead 212 nofield /sr1/command construct tubs NCoil 50 60 25 0 360 G4_Cu 0 150 0 log_World rotPole dead 213 nofield /sr1/command construct tubs SPole 0 100 25 0 360 G4_Fe 0 -100 0 log_World rotPole dead 221 nofield /sr1/command construct tubs SYoke 0 50 25 0 360 G4_Fe 0 -150 0 log_World rotPole dead 222 nofield /sr1/command construct tubs SCoil 50 60 25 0 360 G4_Cu 0 -150 0 log_World rotPole dead 223 nofield # Capacitor /sr1/command construct box Cap_p 0.5 50 150 Brass 50 0 0 log_World norot dead 301 nofield /sr1/command construct box Cap_n 0.5 50 150 Brass -50 0 0 log_World norot dead 302 nofield #*/sr1/command construct box Uniform 49 49 150 G4_Galactic 0 0 0 log_World norot dead 303 nofield # Visualize Electric and Magnetic field volumes. COMMENT during normal run, otherwise the root file is empty! #/sr1/command construct box Evol 50 50 300 G4_Galactic 0 0 0 log_World norot dead 311 nofield #/sr1/command construct box Bvol 70 70 500 G4_Galactic 0 0 0 log_World norot dead 312 nofield # Dummy, thin cylindres used for applying the field maps. # NOTE: EM field cannot be applied to non simply connected bodies, as e.g. rings, cones, tori, etc.! /sr1/command construct tubs EField 0 0.01 0.005 0 360 G4_Galactic 0 0 0.0 log_World norot dead 322 nofield /sr1/command construct tubs BField 0 0.01 0.005 0 360 G4_Galactic 0 0 0.1 log_World norot dead 324 nofield # Beam spot (just for having a visual idea!). Assume r = 3*sigma to intercept 99.73% of all events, with sigma = 6.83 mm #/sr1/command construct tubs BSpot 0 30 1 0 360 G4_Galactic 0 0 -490 log_World norot dead 650 nofield /sr1/command construct tubs saveBSpot 0 20.5 1 0 360 G4_Galactic 0 0 -490 log_World norot sr1/ScintSD 650 nofield # Dummy plane or target to intercept muon events. # Use it either as (DMCP-sr1/ScintSD) - with no info on mu+ polariz., or as (target-dead) with info on mu+ polariz. #/sr1/command construct box saveCFoil 65 60 5e-4 G4_Galactic 0 0 -199 log_World norot dead 623 nofield /sr1/command construct tubs target 0 65 1.5 0 360 G4_Galactic 0 0 490 log_World norot dead 101 nofield #/sr1/command construct tubs DMCP 0 76.5 1.5 0 360 MCPglass 0 0 108 log_MCPV norot dead 202 nofield # Visual attributes (optional) /sr1/command visattributes log_NPole red /sr1/command visattributes log_SPole lightblue /sr1/command visattributes log_NCoil Grid_style /sr1/command visattributes log_SCoil Grid_style /sr1/command visattributes log_YokeR oxsteel /sr1/command visattributes log_Cap_p darkred /sr1/command visattributes log_Cap_n blue_style #/sr1/command visattributes log_Uniform invisible ################################################################################################################ # -- Setting the ELECTRIC and MAGNETIC fields -- ################################################################################################################ # Use ABSOLUTE coordinates to specify the field position (i.e. with respect to GLOBAL WORLD)! # Default field units: Magnetic - T, Electric - kV/mm (or kV for E-field maps). # NOTE: Applying a field to an invisible log_vol makes is visible! ### Uniform Electric and Magnetic field at Spin Rotator: #*/sr1/command globalfield UniMag_field 0. 0. 0. uniform log_Uniform 0 -0.036 0 0 0 0 #*/sr1/command globalfield UniEle_field 0. 0. 0. uniform log_Uniform 0 0 0 -0.21 0 0 #*/sr1/command globalfield UniEM_field 0. 0. 0. uniform log_Uniform 0 -0.036 0 -0.21 0 0 ###15 cm gap /sr1/command globalfield Ele_field 0. 0. 0. fromfile 3DE E3D_capacitor.map log_EField 22.1 ###1000-0 V /sr1/command globalfield Ele_field 0. 0. 0. fromfile 3DE E3D_capacitor.map log_EField 14.74 #*/sr1/command globalfield Ele_field 0. 0. 0. fromfile 3DE E3D_const.map log_EField 21.0 ## Symmetric field map +/- 500 V. /sr1/command globalfield Ele_field 0. 0. 0. fromfile 3DE E3D_cap_symm.map log_EField 21.0 /sr1/command globalfield Mag_field 0. 0. 0.1 fromfile 3DB B3D_iron2.map log_BField 0.036 # Set parameters for particle tracking in an EM field /sr1/command globalfield setparameter SetLargestAcceptableStep 5 /sr1/command globalfield setparameter SetMinimumEpsilonStep 5e-5 /sr1/command globalfield setparameter SetMaximumEpsilonStep 0.001 /sr1/command globalfield setparameter SetDeltaOneStep 0.1 /sr1/command globalfield setparameter SetDeltaIntersection 0.01 /sr1/command globalfield printparameters # TESTING EM FIELD /sr1/command globalfield printFieldValueAtPoint 0. 0. 0. ################################################################################################################ # -- Setting simulation PARAMETERS -- ################################################################################################################ # Set processes from: lowenergy, penelope, coulombAndMultiple (default, Coul. only for CFoil), coulomb (for all, very slow). #**/sr1/command typeofprocesses coulombAndMultiple #*/sr1/command typeofprocesses penelope #*/sr1/command includeMuoniumProcesses false # Set the overall range cut (default 0.1 mm) #*/run/setCut 1 mm # Set the range cut on particular volumes (in mm) #*/sr1/command SetUserLimits log_target 0.01 #*/sr1/command SetUserLimits log_targetscint 0.01 #*/sr1/command SetUserLimits log_cryostatscint 0.01 # Set particle energy cuts on particular volumes (in eV) #*/sr1/command SetUserMinEkine log_World 0.1 # Store ALL the events in a ROOT tree or just the interesting ones? (default is true) #*/sr1/command storeOnlyEventsWithHits false # Set the minimum time separation between two subsequent signals in the same detector (in ns) /sr1/command signalSeparationTime 0.1 # Override runID number #*/sr1/run/runID 21 # Set the frequency of event printing /sr1/run/howOftenToPrintEvent 1000 # RANDOM option choices: (specify the random number generator initialisation) # 0 ... no initialisation (default) # 1 ... use actual computer time to initialise now # Pseudo-random numbers # 2 ... use event number to initialise at the beginning of each event # Reproducible numbers # 3 ... read in the random no. initial values for each event from a file /sr1/run/randomOption 1 # VISUALIZATION options # To enable or disable visualization uncomment one of these lines # To modify visualization options edit the file vis.mac /vis/disable #*/control/execute vis.mac #alias g4='export G4WORKDIR="/home/sedlak/bin_4.9.1"; source /home/geant4/4.9.1/env.sh; #export G4VRMLFILE_VIEWER="vrmlview"; echo "On this machine the G4VRMLFILE_VIEWER=$G4VRMLFILE_VIEWER"' ################################################################################################################ # -- Setting PARTICLE GUN parameters -- ################################################################################################################ # Default momentum direction: 001, i.e. 0z. # Default muon spin direction: 100, i.e. 0x. # Default particle type: mu+ (can be changed to Mu or proton) # Set particle type #*/gun/particle Mu #*/gun/particle proton /gun/particle mu+ # Set the position of the beam vertex /gun/vertex 0. 0. -495. mm # A point-like uniform beam #*/gun/vertexsigma -0.1 -0.1 0 mm # Set beam transverse spread (default GAUSSIAN spread) # If FWHM = 10 mm ==> sigma = 10/2.354 = 4.2481 mm (last 0 is a dummy value) # Negative sigma values => random FLAT RECTANGULAR distribution (area 2x.2y) # Use vertexboundary with (vb < sigma_xy) to obtain a CIRCULAR beam spot # /gun/vertexsigma 0 0 0 mm ==> Very SLOW with mag. field ON and centered beam ## The LEMUSR beam has a sigma of 6.83 mm => FWHM = 2.355*6.83 = 16.08 mm /gun/vertexsigma 6.83 6.83 0 mm #/gun/vertexsigma -20 -20 0 mm #/gun/vertexboundary 20 -1e6 1e6 mm # /gun/vertexboundary: rMaxAllowed, zMinAllowed, zMaxAllowed # Beam AND gating #*/gun/vertexboundary 7 -1314.4 -1305 mm # Without restrictions in z, but only on r: #*/gun/vertexboundary 3 -1e6 1e6 mm # Set beam momentum (USE only as an ALTERNATIVE to setting energy!) # /gun/momentum 0 0 29.79 MeV #*/gun/momentum 0 0 1.8 MeV # Energy loss at p = 1.2 MeV/c (E = 6.8 keV) => 1.23 +/- 0.2 keV # Energy loss at p = 1.8 MeV/c (E = 15.3 keV) => 1.25 +/- 0.3 keV # 1.2 MeV/c -> 6.8 keV, 1.8 MeV/c -> 15.3 keV, 2.056 MeV/c -> 20 keV. # muon rest mass = 105.658 MeV/c2 # With Trigger ON use 15 keV, with Trigger OFF use 11.27 keV (15 - 3.73 = 11.27 keV) #/gun/kenergy 3.4 MeV /gun/kenergy 16.27 keV # Set beam momentum direction /gun/direction 0.0 0.0 1.0 # Set muon spin direction /gun/muonPolarizVector 1 0 0 # Other useful test parameters: # # FWHM = 3% ==> sigma = 29.79*0.03/2.354 = 0.37965 MeV/c #*/gun/momentumsmearing 0.37965 MeV #---/gun/momentumboundary: pMinAllowed, pMaxAllowed, dummy #*/gun/momentumboundary 20 40 0 MeV #---/gun/tilt: xangle, yangle, dummy #*/gun/tilt 0 0.5 0 deg #---/gun/tiltsigma: xangleSigma, yangleSigma, dummy (1 degree at 1 m => 17 mm) #*/gun/tiltsigma 0.2 0.2 0 deg #*/gun/pitch 0.5 deg #---/gun/decaytimelimits: decayMin, decayMax, decayTime #*/gun/decaytimelimits 10400 10420 2197.03 ns # Selectively inactivate or activate sensitive detectors #*/hits/inactivate /sr1/ScintSD # Only for code debugging! #/tracking/verbose 1 # BEAM ON #*/run/beamOn 1000000 #/run/beamOn 2 #/run/beamOn 1000000 /run/beamOn 5000