# 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 350 250 900 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 NPole 200 20 150 G4_Fe 0 95 0 log_World norot dead 201 nofield /sr1/command construct box NYoke 150 30 50 G4_Fe 0 145 0 log_World norot dead 202 nofield /sr1/command construct box NConn 75 17.5 50 G4_Fe 225 157.5 0 log_World norot dead 203 nofield /sr1/command construct box YokeL 25 175 50 G4_Fe 325 0 0 log_World norot dead 210 nofield /sr1/command construct box SPole 200 20 150 G4_Fe 0 -95 0 log_World norot dead 205 nofield /sr1/command construct box SYoke 150 30 50 G4_Fe 0 -145 0 log_World norot dead 206 nofield /sr1/command construct box SConn 75 17.5 50 G4_Fe 225 -157.5 0 log_World norot dead 207 nofield # Front shield /sr1/command construct box FShU 225 50 5 G4_Fe 0 125 -175 log_World norot dead 301 nofield /sr1/command construct box FShD 225 50 5 G4_Fe 0 -125 -175 log_World norot dead 302 nofield /sr1/command construct box FShL 75 75 5 G4_Fe 150 0 -175 log_World norot dead 303 nofield /sr1/command construct box FShR 75 75 5 G4_Fe -150 0 -175 log_World norot dead 304 nofield # Back shield /sr1/command construct box BShU 225 50 5 G4_Fe 0 125 175 log_World norot dead 321 nofield /sr1/command construct box BShD 225 50 5 G4_Fe 0 -125 175 log_World norot dead 322 nofield /sr1/command construct box BShL 75 75 5 G4_Fe 150 0 175 log_World norot dead 323 nofield /sr1/command construct box BShR 75 75 5 G4_Fe -150 0 175 log_World norot dead 324 nofield # Top coils /sr1/command construct box TCoil1 170 12.5 10 G4_Cu 0 127.5 -60 log_World norot dead 401 nofield /sr1/command construct box TCoil2 170 12.5 10 G4_Cu 0 127.5 60 log_World norot dead 402 nofield /sr1/command construct box TCoil3 10 12.5 50 G4_Cu 160 127.5 0 log_World norot dead 403 nofield /sr1/command construct box TCoil4 10 12.5 50 G4_Cu -160 127.5 0 log_World norot dead 404 nofield # Bottom coils /sr1/command construct box BCoil1 170 12.5 10 G4_Cu 0 -127.5 -60 log_World norot dead 421 nofield /sr1/command construct box BCoil2 170 12.5 10 G4_Cu 0 -127.5 60 log_World norot dead 422 nofield /sr1/command construct box BCoil3 10 12.5 50 G4_Cu 160 -127.5 0 log_World norot dead 423 nofield /sr1/command construct box BCoil4 10 12.5 50 G4_Cu -160 -127.5 0 log_World norot dead 424 nofield # Capacitor /sr1/command construct box Cap_p 0.5 50 150 Brass 50 0 0 log_World norot dead 501 nofield /sr1/command construct box Cap_n 0.5 50 150 Brass -50 0 0 log_World norot dead 502 nofield #*/sr1/command construct box Uniform 49 49 150 G4_Galactic 0 0 0 log_World norot dead 503 nofield # Lens 1 - 1st Einzel Lens # L1z = -(38 + 25) = -63 cm. # Gap = 10.0 mm => G/D = 10/80 = 0.125 (Lens Gap = gap between Ground and Anode, D - Diameter) # L1ENV - Lens 1 envelope - for easy positioning of lens parts (outer dia: 100 mm, length: 300 mm) /sr1/command construct tubs L1ENV 0 50 150 0 360 G4_Galactic 0 0 -630 log_World norot dead 600 nofield # GPn - Ground Potential Electrodes. (n = 1-2, inner dia: 80 mm, outer dia: 84 mm, length: 100 mm) # n = 1 - Ground Electrode 1 (further from SR). /sr1/command construct tubs L1GP1 40 44 50 0 360 Steel 0 0 -100 log_L1ENV norot dead 651 nofield # n = 2 - Ground Electrode 2 (closer to SR). /sr1/command construct tubs L1GP2 40 44 50 0 360 Steel 0 0 100 log_L1ENV norot dead 653 nofield # HP - High Potential Electrode (Central Anode - usually at +8.5 kV, for a 15 keV muon beam) /sr1/command construct tubs L1HP 40 44 40 0 360 Steel 0 0 0 log_L1ENV norot dead 652 nofield # Lens 1 visual attributes (optional) /sr1/command visattributes log_L1ENV invisible /sr1/command visattributes log_L1HP darkred # 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 702 nofield /sr1/command construct tubs BField 0 0.01 0.005 0 360 G4_Galactic 0 0 0.1 log_World norot dead 704 nofield /sr1/command construct tubs LField 0 0.01 0.005 0 360 G4_Galactic 0 0 0.0 log_L1ENV norot dead 706 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 752 nofield #*/sr1/command construct box Bvol 70 70 500 G4_Galactic 0 0 0 log_World norot dead 754 nofield #*/sr1/command construct tubs Lvol 0 38 180 0 360 G4_Galactic 0 0 -630 log_World norot dead 756 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 800 nofield #*/sr1/command construct tubs saveBSpot 0 20.5 1 0 360 G4_Galactic 0 0 -490 log_World norot sr1/ScintSD 800 nofield /sr1/command construct tubs saveBSpot 0 20.5 1 0 360 G4_Galactic 0 0 -835 log_World norot sr1/ScintSD 800 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 851 nofield /sr1/command construct tubs target 0 65 1.5 0 360 G4_Galactic 0 0 490 log_World norot dead 851 nofield /sr1/command construct tubs saveIT 0 40 1 0 360 G4_Galactic 0 0 -300 log_World norot sr1/ScintSD 900 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_YokeL oxsteel /sr1/command visattributes log_TCoil1 Grid_style /sr1/command visattributes log_TCoil2 Grid_style /sr1/command visattributes log_TCoil3 Grid_style /sr1/command visattributes log_TCoil4 Grid_style /sr1/command visattributes log_BCoil1 Grid_style /sr1/command visattributes log_BCoil2 Grid_style /sr1/command visattributes log_BCoil3 Grid_style /sr1/command visattributes log_BCoil4 Grid_style /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 # E_0 = 20 keV, E = 21 kV, B = 360 G # E_0 = 15 keV, E = 18.1865 kV, B = 311.7691 G (= sqrt(15/20)) # CONSTANT Electric and Magnetic fields (15 keV 15.7 0.0312 T; 20 keV 21.0 0.036 T) (16.6 if with B map) #/sr1/command globalfield Ele_field 0. 0. 0. fromfile 3DE E3D_const.map log_EField 16.6 #/sr1/command globalfield Mag_field 0. 0. 0.1 fromfile 3DB B3D_const.map log_BField 0.03117691 # FIELD MAPS (using symmetric E-field map +/- 500 V). E3D_cap_symm.map or E3D_cap_symm_edge.map # E0 = 20 keV #*/sr1/command globalfield Ele_field 0. 0. 0. fromfile 3DE E3D_cap_symm_edge.map log_EField 21.0 #*/sr1/command globalfield Mag_field 0. 0. 0.1 fromfile 3DB B3D_iron2.map log_BField 0.036 # E0 = 15 keV #/sr1/command globalfield Ele_field 0. 0. 0. fromfile 3DE E3D_cap_symm_edge.map log_EField 15.8 /sr1/command globalfield Ele_field 0. 0. 0. fromfile 3DE E3D_edge_rod.map log_EField 15.9 #*/sr1/command globalfield Ele_field 0. 0. 0. fromfile 3DE E3D_edge_3rods.map log_EField 15.2 ####*/sr1/command globalfield Mag_field 0. 0. 0.1 fromfile 3DB B3D_iron2.map log_BField 0.0312 # Do NOT forget the minus sign for OPERA generated B-field maps! /sr1/command globalfield Mag_field 0. 0. 0.1 fromfile 3DB sep_1nl_ext.map log_BField -0.0312 # LENS 1. Best L1 settings: 8.5 kV for 15 keV muons, 11.33 kV for 20 keV muons /sr1/command globalfield L1E_field 0. 0. -630 fromfile 2DE L1_Erz.map log_L1ENV 8. # 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. /sr1/command globalfield printFieldValueAtPoint 0. 35. -670. ################################################################################################################ # -- 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 2 # 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 # For use only with SR: d = -495 mm, when L1 is included d = -835 mm. #/gun/vertex 0. 0. -495. mm /gun/vertex 0. 0. -835. 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 #/gun/kenergy 3.4 MeV /gun/kenergy 15.0 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 1.4 1.4 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 # For running a batch see the files v1.mac and changefield.mac in /home/l_shiroka/geant4/musim_alc2 # BEAM ON #*/run/beamOn 1000000 #*/run/beamOn 2 #/run/beamOn 1000000 /run/beamOn 10000