From 5705835d11353ac1981048b35d957cd9b9783f98 Mon Sep 17 00:00:00 2001 From: Thomas Prokscha Date: Fri, 7 Nov 2008 15:18:39 +0000 Subject: [PATCH] Remove ke_offset in PrimaryGeneratorAction since it causes confusion and inconsistencies. Instead, add another homogeneous accelerating electric field in front of TD foil. Update TD and MCP2 positions. --- geant4/LEMuSR/run/1050.mac | 104 +++++++++++------- geant4/LEMuSR/run/vis.mac | 8 +- .../LEMuSR/src/lem4PrimaryGeneratorAction.cc | 7 +- 3 files changed, 74 insertions(+), 45 deletions(-) diff --git a/geant4/LEMuSR/run/1050.mac b/geant4/LEMuSR/run/1050.mac index 5e32a42..e8fd7dd 100644 --- a/geant4/LEMuSR/run/1050.mac +++ b/geant4/LEMuSR/run/1050.mac @@ -1,5 +1,8 @@ # Macro file for lem4.cc - Construct detector, set fields and other parameters. # Last modified by T. Shiroka: 17.03.2008 +# +# Corrected TD and MCP2 distances by T. Prokscha, 07.11.2008. +# # How to run: lem4 10xx.mac (append "idle" for prompt after running) # lem4 10xx.mac > fname.txt (stores output on a txt file) @@ -49,7 +52,7 @@ # -- LEM GEOMETRY -- ################################################################################################################ -# WORLD = Laboratory reference frame +# WORLD = Laboratory reference frame, the origin is in the centre of the LEM sample tube /lem4/command construct box World 250 250 2250 G4_Galactic 0 0 0 no_logical_volume norot dead -1 # MINIMUM WORD HALF LENGTH 1250 mm! #/lem4/command construct box World 2000 2000 4000 G4_Galactic 0 0 0 no_logical_volume norot dead -1 @@ -66,10 +69,10 @@ #=============================================================================================================== ## Inner Scintillators - I -#*/lem4/command construct tubs ScIU 90 95 130 45 90 G4_PLASTIC_SC_VINYLTOLUENE 0 0 0 log_World norot lem4/ScintSD 011 nofield -#*/lem4/command construct tubs ScIR 90 95 130 135 90 G4_PLASTIC_SC_VINYLTOLUENE 0 0 0 log_World norot lem4/ScintSD 012 nofield -#*/lem4/command construct tubs ScID 90 95 130 225 90 G4_PLASTIC_SC_VINYLTOLUENE 0 0 0 log_World norot lem4/ScintSD 013 nofield -#*/lem4/command construct tubs ScIL 90 95 130 315 90 G4_PLASTIC_SC_VINYLTOLUENE 0 0 0 log_World norot lem4/ScintSD 014 nofield +/lem4/command construct tubs ScIU 90 95 130 45 90 G4_PLASTIC_SC_VINYLTOLUENE 0 0 0 log_World norot lem4/ScintSD 011 nofield +/lem4/command construct tubs ScIR 90 95 130 135 90 G4_PLASTIC_SC_VINYLTOLUENE 0 0 0 log_World norot lem4/ScintSD 012 nofield +/lem4/command construct tubs ScID 90 95 130 225 90 G4_PLASTIC_SC_VINYLTOLUENE 0 0 0 log_World norot lem4/ScintSD 013 nofield +/lem4/command construct tubs ScIL 90 95 130 315 90 G4_PLASTIC_SC_VINYLTOLUENE 0 0 0 log_World norot lem4/ScintSD 014 nofield ## Outer Scintillators - O /lem4/command construct tubs ScOU 96 101 130 45 90 G4_PLASTIC_SC_VINYLTOLUENE 0 0 0 log_World norot lem4/ScintSD 021 nofield @@ -80,27 +83,30 @@ # Visual attributes (optional) #*/lem4/command visattributes log_ScOU SCINT_style #*/lem4/command visattributes log_ScOD dSCINT_style -#*/lem4/command visattributes log_ScOL darkred - +/lem4/command visattributes log_ScOL darkred +/lem4/command visattributes log_ScIL darkred #=============================================================================================================== # Experimental Area - Can host EITHER the Cryostat OR the MCP2 (For the tests we usually use the MCP) # Delimited by the F160 and F100 (blank end) flanges +# +# 07/Nov/2008: correct sample tube dimensions: the new tubes have 75 mm / 78 mm inner/outer radius +# #=============================================================================================================== # MCP - Multi-Channel Plate 2 Chamber; V - Vacuum, S - Solid # Note: VERY IMPORTANT: mcpv_z = -92.5 mm! # OLD way of assigning a field #/lem4/command construct tubs MCPV 0 76.5 254.5 0 360 G4_Galactic 0 0 -92.5 log_World norot dead 100 MCPSfield -/lem4/command construct tubs MCPV 0 76.5 254.5 0 360 G4_Galactic 0 0 -92.5 log_World norot dead 100 nofield -/lem4/command construct tubs MCPS 76.5 79.5 162.0 0 360 Steel 0 0 0 log_World norot dead 101 nofield +/lem4/command construct tubs MCPV 0 75.0 254.5 0 360 G4_Galactic 0 0 -92.5 log_World norot dead 100 nofield +/lem4/command construct tubs MCPS 75.0 78.0 162.0 0 360 Steel 0 0 0 log_World norot dead 101 nofield # F - Flanges: F160, F100, F200 (used only when the Asymmetry check is OFF) # F160 - 160 CF flange upstream of MCP2 tube # F100 (Blank end flange) # OLD Value was 162.0 -/lem4/command construct tubs F160 79.5 101.25 11 0 360 Steel 0 0 -151.0 log_World norot dead 901 nofield -/lem4/command construct tubs F100 0 76.5 10 0 360 Steel 0 0 172.0 log_World norot dead 902 nofield +/lem4/command construct tubs F160 78.0 101.25 11 0 360 Steel 0 0 -151.0 log_World norot dead 901 nofield +/lem4/command construct tubs F100 0 75.0 10 0 360 Steel 0 0 172.0 log_World norot dead 902 nofield # NOTE: Original F100 referred to MCPV (as shown below) was moved to World. #/lem4/command construct tubs F100 0 76.5 10 0 360 Steel 0 0 264.5 log_MCPV norot dead 902 nofield @@ -117,33 +123,39 @@ #=============================================================================================================== # MCP - Micro Channel Plate Detector MCP2 (Used as an alternative to cryostat) # mcpv_z = -92.5 mm! +# +# We have a 324 mm long sample tube; +# the MCP2 front side is at 142 mm from the end of the sample tube. +# the front face of the sample plate of the cryostat is 145 mm from the end of the sample tube. +# #=============================================================================================================== # MCPM1 - MCP Macor ring 1 -# MCPD - electron multiplying glass disk (also known as target) # Sensitive surface at z = 14 mm wrt. World +# MCPD - electron multiplying glass disk (also known as target) +# Sensitive surface at z = 20 mm wrt. World # MCPM2 - MCP Macor ring 2 #*/lem4/command construct tubs MCPM1 24 32.5 0.75 0 360 Macor 0 0 105.75 log_MCPV norot dead 201 nofield # Use it either as (DMCP-lem4/ScintSD) - no info on mu+ polariz., or as (target-dead) with info on mu+ polariz. #*/lem4/command construct tubs target 0 25.0 1.50 0 360 MCPglass 0 0 108.0 log_MCPV norot dead 032 nofield -/lem4/command construct tubs MCPM2 24 32.5 0.75 0 360 Macor 0 0 110.25 log_MCPV norot dead 203 nofield +/lem4/command construct tubs MCPM2 24 32.5 0.75 0 360 Macor 0 0 116.25 log_MCPV norot dead 203 nofield # NOTE: To intercept ALL the incoming muons, comment the DMCP and MCPM1 lines above and uncomment this one: #*/lem4/command construct tubs DMCP 0 76.5 1.5 0 360 MCPglass 0 0 108 log_MCPV norot lem4/ScintSD 202 nofield -/lem4/command construct tubs target 0 76.5 1.5 0 360 MCPglass 0 0 108 log_MCPV norot lem4/ScintSD 202 nofield +/lem4/command construct tubs target 0 75.0 1.5 0 360 MCPglass 0 0 114 log_MCPV norot lem4/ScintSD 202 nofield # MCSR - Stainless Steel Ring for MCP2 mounting (modelled as a box with a circular hole) # MCVR - "Vacuum Ring" (circular hole) -/lem4/command construct box MCSR 36.5 36.5 1 Steel 0 0 112.5 log_MCPV norot dead 204 nofield +/lem4/command construct box MCSR 36.5 36.5 1 Steel 0 0 118.5 log_MCPV norot dead 204 nofield /lem4/command construct tubs MCVR 0 27.5 1 0 360 G4_Galactic 0 0 0 log_MCSR norot dead 205 nofield # MCPA = MCP Anode (modelled as a box with two symmetrically subtracted "vacuum" disks) # ANVA1 - Anode "Vacuum" 1 - Part of MCP Anode # ANVA2 - Anode "Vacuum" 2 - Part of MCP Anode -/lem4/command construct box MCPA 36.5 36.5 4 Steel 0 0 123.5 log_MCPV norot dead 206 nofield +/lem4/command construct box MCPA 36.5 36.5 4 Steel 0 0 129.5 log_MCPV norot dead 206 nofield /lem4/command construct tubs ANVA1 0 27.5 1.5 0 360 G4_Galactic 0 0 -2.5 log_MCPA norot dead 207 nofield /lem4/command construct tubs ANVA2 0 27.5 1.5 0 360 G4_Galactic 0 0 2.5 log_MCPA norot dead 208 nofield # MCSS - MCP Stainless Steel Support Ring -/lem4/command construct tubs MCSS 40 48 2.5 0 360 Steel 0 0 156.3 log_MCPV norot dead 209 nofield +/lem4/command construct tubs MCSS 40 48 2.5 0 360 Steel 0 0 162.3 log_MCPV norot dead 209 nofield # MCP2 visual attributes (optional) @@ -157,6 +169,8 @@ #=============================================================================================================== # CRY - Cryostat - Used as an ALTERNATIVE to MCP2 - Uncomment lines with #*. (Offset = 0.0 cm) +# +# at the moment, sample plate front face is still at z = 14.0mm --> should be changed to 17mm. #=============================================================================================================== # SAH - SAmple Holder components (Cu plate) Cu or Al plates 1. Cu plate (sample holder) on Cold finger, 0.5cm @@ -335,7 +349,7 @@ #=============================================================================================================== -# Trigger - Trigger Detector # Triggerz = -1092 mm +# Trigger - Trigger Detector # Triggerz = -1092 mm; total length of TD is 110 mm; carbon foil at -1144 mm. #=============================================================================================================== # Trigger tube and relative vacuum @@ -346,10 +360,13 @@ /lem4/command construct tubs TF1 103 126.5 12 0 360 Steel 0 0 -956 log_World norot dead 611 nofield /lem4/command construct tubs TF2 103 126.5 12 0 360 Steel 0 0 -1228 log_World norot dead 612 nofield +#------------------------------------------------------------- +# trigger foil is 52mm upstream of Triggerz, i.e. at -1144 mm +#------------------------------------------------------------- # Carbon Foil (default HALF-thickness 0.000005147 mm, see below => CFoil thick = 10.3 nm). # USE THE NAME CFoil or coulombCFoil, otherwise lem4MuFormation won't work! ####/lem4/command construct box CFoil 60 60 0.000005147 G4_GRAPHITE 0 0 -45 log_TriggerV norot dead 621 nofield -/lem4/command construct box CFoil 60 60 0.000006471 G4_GRAPHITE 0 0 -45 log_TriggerV norot dead 621 nofield +/lem4/command construct box CFoil 60 60 0.0000049 G4_GRAPHITE 0 0 -52.1 log_TriggerV norot dead 621 nofield ####/lem4/command construct box coulombCFoil 60 60 0.000005147 G4_GRAPHITE 0 0 -45 log_TriggerV norot dead 621 nofield # Notes: NIST tables use G4_GRAPHITE with 1.7 g/cm3 and 78 eV ioniz. energy. @@ -358,25 +375,28 @@ # If necessary, use Graphite as defined in lem4DetectorConstruction.cc and set any density. # Dummy plane to intercept outgoing muons from the Carbon foil. -/lem4/command construct box saveCFoil 60 60 5e-4 G4_Galactic 0 0 -44.995 log_TriggerV norot dead 623 nofield +#*/lem4/command construct box saveCFoil 60 60 5e-4 G4_Galactic 0 0 -52.0005 log_TriggerV norot dead 623 nofield +/lem4/command construct box saveAfterTD 60 60 5e-4 G4_Galactic 0 0 58.0006 log_TriggerV norot dead 623 nofield # Electrical Field areas in the Trigger Detector # En = Electrical Field n: TnFieldMgr (n = 1-3) # Original TriggE2: [4.*sqrt(2), 4.5, 0.7/sqrt(2)] cm -> changed due to overlaps with E1 and E3 -/lem4/command construct box TriggE1 45 45 4 G4_Galactic 0 0 -38.5 log_TriggerV norot dead 631 nofield +/lem4/command construct box TriggE0 45 45 5 G4_Galactic 0 0 -57.15 log_TriggerV norot dead 630 nofield +/lem4/command construct box TriggE1 45 45 4 G4_Galactic 0 0 -48.0 log_TriggerV norot dead 631 nofield /lem4/command construct box TriggE2 45 45 4.9497 G4_Galactic 0 0 2.25 log_TriggerV rotTrig dead 632 nofield -/lem4/command construct box TriggE3 45 45 4 G4_Galactic 0 0 43.0 log_TriggerV norot dead 633 +/lem4/command construct box TriggE3 45 45 4 G4_Galactic 0 0 54.0 log_TriggerV norot dead 633 # Beam spot (just for having a visual idea!) -/lem4/command construct tubs BSpot 0 20 1 0 360 G4_Galactic 0 0 -48.0 log_TriggerV norot dead 650 nofield +/lem4/command construct tubs BSpot 0 20 1 0 360 G4_Galactic 0 0 -63.15 log_TriggerV norot dead 650 nofield # Trigger visual attributes (optional) /lem4/command visattributes log_TriggerV invisible /lem4/command visattributes log_Trigger invisible -#/lem4/command visattributes log_CFoil MACOR_style -/lem4/command visattributes log_BSpot fblue_style +#*/lem4/command visattributes saveCFoil MACOR_style +/lem4/command visattributes log_saveAfterTD darkred +/lem4/command visattributes log_BSpot darkred # One can set visible attrib. also on a MATERIAL basis, rather than on log_VOL. # E.g. /lem4/command visattributes Steel red @@ -394,9 +414,10 @@ # NOTE: Applying a field to an invisible log_vol makes is visible! ### Electric field at TRIGGER Detector TD: Three different uniform fields -/lem4/command globalfield Trigg1_field 0. 0. -1130.5 uniform log_TriggE1 0 0 0 0 0 -0.02375 +/lem4/command globalfield Trigg0_field 0. 0. -1149.15 uniform log_TriggE0 0 0 0 0 0 0.373 +/lem4/command globalfield Trigg1_field 0. 0. -1140. uniform log_TriggE1 0 0 0 0 0 -0.02375 /lem4/command globalfield Trigg2_field 0. 0. -1089.75 uniform log_TriggE2 0 0 0 0 0 0.041416 -/lem4/command globalfield Trigg3_field 0. 0. -1049.0 uniform log_TriggE3 0 0 0 0 0 -0.49375 +/lem4/command globalfield Trigg3_field 0. 0. -1038.0 uniform log_TriggE3 0 0 0 0 0 -0.49375 ### Electric field at Einzel LENS 3 - from folded 2D axial field map (f - folded, i.e. symmetric) @@ -404,7 +425,7 @@ # # ATTENTION: The electric field is ANTI-symmetric: DO NOT use folded field map L3_Erz4.map!! # -/lem4/command globalfield Lens3_field 0. 0. -567. fromfile 2DE L3_Erz.map log_L3VA 6.78 +/lem4/command globalfield Lens3_field 0. 0. -567. fromfile 2DE L3_Erz.map log_L3VA 6.51 # To change the field in regular steps (e.g. for testing) use (f_min f_max step_no), e.g.: #*/lem4/command globalfield Lens3_field 0. 0. -567. fromfile 2DE L3_Erz.map log_L3VA 7 11 5 @@ -413,10 +434,10 @@ # Typically set at +11.0 kV for a muon beam at 15 keV # To create an arbitrary configuration, switch on all fields and set different potentials. #######/lem4/command globalfield RngAnU_field 0. 0. -167.00 fromfile 3DE EM_3D_extc.map log_RA_U 11.0 -/lem4/command globalfield RngAnU_field 0. 0. -143.00 fromfile 3DE EM_3D_ext_gridf.map log_RA_U 8.6 -/lem4/command globalfield RngAnR_field 0. 0. -143.02 fromfile 3DE EM_3D_ext_gridf.map log_RA_R 8.6 -/lem4/command globalfield RngAnD_field 0. 0. -143.04 fromfile 3DE EM_3D_ext_gridf.map log_RA_D 8.6 -/lem4/command globalfield RngAnL_field 0. 0. -143.06 fromfile 3DE EM_3D_ext_gridf.map log_RA_L 8.6 +/lem4/command globalfield RngAnU_field 0. 0. -143.00 fromfile 3DE EM_3D_ext_gridf.map log_RA_U 8.26 +/lem4/command globalfield RngAnR_field 0. 0. -143.02 fromfile 3DE EM_3D_ext_gridf.map log_RA_R 8.26 +/lem4/command globalfield RngAnD_field 0. 0. -143.04 fromfile 3DE EM_3D_ext_gridf.map log_RA_D 8.26 +/lem4/command globalfield RngAnL_field 0. 0. -143.06 fromfile 3DE EM_3D_ext_gridf.map log_RA_L 8.26 ### LAST FIELD OK: EM_3D_ext2f.map # EXTENDED MAPS (from -28 to +20 mm) EM_3D_extc.map or EM_3D_extf.map (coord + field or field only) @@ -461,12 +482,15 @@ # All distances in mm and in GLOBAL coordinates (preferably at field center) # The test points below are just some examples. Any point can be checked. +# Trigger 0 +/lem4/command globalfield printFieldValueAtPoint 0. 0. -1149.15 + # Trigger 1 -/lem4/command globalfield printFieldValueAtPoint 0. 0. -1130.5 +/lem4/command globalfield printFieldValueAtPoint 0. 0. -1140. # Trigger 2 /lem4/command globalfield printFieldValueAtPoint 0. 0. -1089.75 # Trigger 3 -/lem4/command globalfield printFieldValueAtPoint 0. 0. -1049.0 +/lem4/command globalfield printFieldValueAtPoint 0. 0. -1038.0 # Einzel Lens 3 - L3 (center at -567.0, but max field at rel. +/-62 mm) /lem4/command globalfield printFieldValueAtPoint 0. 0. -507.0 @@ -547,8 +571,9 @@ #*/gun/particle Mu /gun/particle mu+ -# Set beam vertex (CFoil at -1137. To start after C Foil use z = -1130, before -1170) -/gun/vertex 0. 0. -1138. mm +# Set beam vertex +# CFoil at -1144 mm, acceleration starts at -1154.15 mm +/gun/vertex 0. 0. -1155. mm # A point-like uniform beam /gun/vertexsigma -0.1 -0.1 0 mm @@ -558,7 +583,7 @@ # 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 -#*/gun/vertexsigma 42.5 42.5 0 mm +#*/gun/vertexsigma 42.5 42.5 0 mm /gun/vertexsigma -20 -20 0 mm /gun/vertexboundary 20 -1e6 1e6 mm @@ -575,7 +600,8 @@ # 1.2 MeV/c -> 6.8 keV, 1.8 MeV/c -> 15.3 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) +# Set muon energy before hitting TD; a constant field in front of the C-foil accelerates the muons +# to add 3.73 keV /gun/kenergy 12.0 keV # Set beam momentum direction @@ -608,5 +634,5 @@ # BEAM ON #*/run/beamOn 1000000 #*/run/beamOn 2 -/run/beamOn 10000 +/run/beamOn 1000 diff --git a/geant4/LEMuSR/run/vis.mac b/geant4/LEMuSR/run/vis.mac index c72b811..992aed1 100644 --- a/geant4/LEMuSR/run/vis.mac +++ b/geant4/LEMuSR/run/vis.mac @@ -4,6 +4,8 @@ # Create an OpenGL driver (i.e. a scene handler and viewer) # Some useful choices: VRML2FILE, OGLSX, OGLIX, DAWNFILE, etc. /vis/open VRML2FILE +#*/vis/open OGLIX 600x600-0+0 +#*/vis/open DAWNFILE # Create a new empty scene and attach it to handler /vis/scene/create @@ -43,11 +45,11 @@ #/vis/modeling/trajectories/drawByCharge-0/set 1 cyan /vis/modeling/trajectories/create/drawByParticleID -/vis/modeling/trajectories/drawByParticleID-0/set gamma grey +#*/vis/modeling/trajectories/drawByParticleID-0/set gamma grey /vis/modeling/trajectories/drawByParticleID-0/setRGBA mu+ 1 0 1 1 /vis/modeling/trajectories/drawByParticleID-0/setRGBA e+ 0 0 0.8 0.5 -/vis/modeling/trajectories/drawByParticleID-0/setRGBA nu_e 0.7 0.7 0 1 -/vis/modeling/trajectories/drawByParticleID-0/setRGBA anti_nu_mu 0.3 1.0 0 0.5 +#*/vis/modeling/trajectories/drawByParticleID-0/setRGBA nu_e 0.7 0.7 0 1 +#*/vis/modeling/trajectories/drawByParticleID-0/setRGBA anti_nu_mu 0.3 1.0 0 0.5 # Verbosity of hits #/hits/verbose 2 diff --git a/geant4/LEMuSR/src/lem4PrimaryGeneratorAction.cc b/geant4/LEMuSR/src/lem4PrimaryGeneratorAction.cc index 3baa990..eff3902 100644 --- a/geant4/LEMuSR/src/lem4PrimaryGeneratorAction.cc +++ b/geant4/LEMuSR/src/lem4PrimaryGeneratorAction.cc @@ -79,10 +79,10 @@ void lem4PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) // } G4double x, y, z; - G4double p, ke_offset; + G4double p;// ke_offset; G4double xangle, yangle; - ke_offset = 3.73*keV; // Kin. energy offset due to a 3.73 kV acceleration at the Carbon foil + //ke_offset = 3.73*keV; // Kin. energy offset due to a 3.73 kV acceleration at the Carbon foil if (takeMuonsFromTurtleFile) { char line[501]; @@ -219,7 +219,8 @@ void lem4PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) particleGun->SetParticlePosition(G4ThreeVector(x,y,z)); //particleGun->SetParticleMomentum(G4ThreeVector(px,py,pz)); G4double particleEnergy = std::sqrt(p*p+mu_mass*mu_mass)-mu_mass; - particleGun->SetParticleEnergy(particleEnergy + ke_offset); + //particleGun->SetParticleEnergy(particleEnergy+ke_offset); + particleGun->SetParticleEnergy(particleEnergy); particleGun->SetParticleMomentumDirection(G4ThreeVector(px,py,pz)); particleGun->SetParticlePolarization(G4ThreeVector(xpolaris,ypolaris,zpolaris)); particleGun->GeneratePrimaryVertex(anEvent);