Field propagation in Geant4 John Apostolakis 25 th May 2005 Ver. 

Slides:



Advertisements
Similar presentations
Steady-state heat conduction on triangulated planar domain May, 2002
Advertisements

Feedback Control Real- time Scheduling James Yang, Hehe Li, Xinguang Sheng CIS 642, Spring 2001 Professor Insup Lee.
Finite element method Among the up-to-date methods of stress state analysis, the finite element method (abbreviated as FEM below, or often as FEA for analyses.
Parameterizing a Geometry using the COMSOL Moving Mesh Feature
M 1 and M 2 – Masses of the two objects [kg] G – Universal gravitational constant G = 6.67x N m 2 /kg 2 or G = 3.439x10 -8 ft 4 /(lb s 4 ) r – distance.
Simona Bettoni and Remo Maccaferri, CERN Wiggler modeling Double-helix like option.
Use of G EANT 4 in CMS AIHENP’99 Crete, April 1999 Véronique Lefébure CERN EP/CMC.
Sources of the Magnetic Field
Chapter 32 Magnetic Fields.
Chapter 16 Wave Motion.
1Notes. 2 Triangle intersection  Many, many ways to do this  Most robust (and one of the fastest) is to do it based on determinants  For vectors a,b,c.
1 Vertex fitting Zeus student seminar May 9, 2003 Erik Maddox NIKHEF/UvA.
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
Usually a diluted salt solution chemical decomposition
I have made the second half of the poster, first half which is made by tarak will have neutrino information. A patch between the two, telling why we do.
Angular Motion, General Notes
Gauss’s Law The electric flux through a closed surface is proportional to the charge enclosed The electric flux through a closed surface is proportional.
Automated Electron Step Size Optimization in EGS5 Scott Wilderman Department of Nuclear Engineering and Radiological Sciences, University of Michigan.
Simulation of direct space charge in Booster by using MAD program Y.Alexahin, N.Kazarinov.
1 Electric Field – Continuous Charge Distribution As the average separation between source charges is smaller than the distance between the charges and.
Geometry and Field: New features and Developments T. Nikitina For Geometry Working Group Geant4 workshop, Hebden Bridge september 2007 G4Paraboloid.
Track Reconstruction: the trf & ftf toolkits Norman Graf (SLAC) ILD Software Meeting, DESY July 6, 2010.
Maria Grazia Pia Detector Response Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
EDGE DETECTION IN COMPUTER VISION SYSTEMS PRESENTATION BY : ATUL CHOPRA JUNE EE-6358 COMPUTER VISION UNIVERSITY OF TEXAS AT ARLINGTON.
Mechanics 105 Standards Dimensional analysis Unit conversions Order of magnitude calculations/estimation Significant figures Coordinates Vectors and scalars.
The Pattern Recognition issue for the Mu2e experiment Giovanni F. Tassielli - G. Marconi University.
Field propagation in Geant4 John Apostolakis, CERN Ecole Geant June 2007, Paris 25 th May 2005 Ver. 
Detector Description: Sensitive Detector & Field
The propagation of a microwave in an atmospheric pressure plasma layer: 1 and 2 dimensional numerical solutions Conference on Computation Physics-2006.
Hadronic Interaction Studies for LHCb Nigel Watson/Birmingham [Thanks to Silvia M., Jeroen v T.]
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Aerosol Limits for Target Tracking Ronald Petzoldt ARIES IFE Meeting, Madison, WI April 22-23, 2002.
Magnetic Field Issues for Simulation and Reconstruction N. Amapane, N. Neumeister Workshop on LHC Physics with High-p T Muons in CMS Bologna, April 9-12,
STAR STAR VMC tracker V. Perevoztchikov Brookhaven National Laboratory,USA.
STAR Kalman Track Fit V. Perevoztchikov Brookhaven National Laboratory,USA.
ChE 452 Lecture 25 Non-linear Collisions 1. Background: Collision Theory Key equation Method Use molecular dynamics to simulate the collisions Integrate.
Geant4 Simulation of the Beam Line for the HARP Experiment M.Gostkin, A.Jemtchougov, E.Rogalev (JINR, Dubna)
22.7 Source of magnetic field due to current
Photon reconstruction and matching Prokudin Mikhail.
Detector Description – Part III Ivana Hrivnacova, IPN Orsay Tatiana Nikitina, CERN Aknowledgement: Slides by: J.Apostolakis, G.Cosmo, A. Lechner.
Geant4 Tracking Test (D. Lunesu)1 Daniela Lunesu, Stefano Magni Dario Menasce INFN Milano GEANT4 TRACING TESTs.
Midwest Accelerator Physics Meeting. Indiana University, March 15-19, ORBIT Electron Cloud Model Andrei Shishlo, Yoichi Sato, Slava Danilov, Jeff.
Exercises Alberto Ribon Alberto Ribon CERN PH/SFT CERN PH/SFT Geant4 tutorial, May 2005.
City College of New York 1 John (Jizhong) Xiao Department of Electrical Engineering City College of New York Mobile Robot Control G3300:
Global Tracking for CBM Andrey Lebedev 1,2 Ivan Kisel 1 Gennady Ososkov 2 1 GSI Helmholtzzentrum für Schwerionenforschung GmbH, Darmstadt, Germany 2 Laboratory.
V.Ivanchenko Salamanca1 Geant4: Electromagnetic Processes 1  Introduction  Interfaces  PhysicsList  Optical process.
By Verena Kain CERN BE-OP. In the next three lectures we will have a look at the different components of a synchrotron. Today: Controlling particle trajectories.
Conductor, insulator and ground. Force between two point charges:
Lecture 4 - E. Wilson - 23 Oct 2014 –- Slide 1 Lecture 4 - Transverse Optics II ACCELERATOR PHYSICS MT 2014 E. J. N. Wilson.
Optimization of planar pixel detector. T. Habermann Planar pixel detectors L W H ground U.
Tutorial 2, Part 2: Calibration of a damped oscillator.
Geometry and Fields: Further and advanced features J. Apostolakis & G. Cosmo.
CHEP ’06 GEANT4E 1 GEANT4E: Error propagation for track reconstruction inside the GEANT4 framework Pedro Arce (CIEMAT) CHEP 2006, Mumbai, 13-17th February.
Track Reconstruction in MUCH and TRD Andrey Lebedev 1,2 Gennady Ososkov 2 1 Gesellschaft für Schwerionenforschung, Darmstadt, Germany 2 Laboratory of Information.
Track Reconstruction: the ftf and trf toolkits Norman Graf (SLAC) Common Software Working Meeting CERN, January 31, 2013.
Numerical methods Themes Solution of equations
Dmitry Sorokin (GSoC 2016), John Apostolakis (CERN)
Larmor Orbits The general solution of the harmonic oscillator equation
Use of interpolation and FSAL property for integration in field
GLAST Large Area Telescope:
Data Analysis in Particle Physics
Field propagation in Geant4
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
Field propagation in Geant4
Preliminary results of the PTC/ORBIT convergence studies in the PSB
Field propagation in Geant4
Field propagation in Geant4
GEANT4 performance studies
Lesson 4: Application to transport distributions
Presentation transcript:

Field propagation in Geant4 John Apostolakis 25 th May 2005 Ver. 

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 2 Contents 1.What is involved in propagating in a field 2.A first example Defining a field in Geant4 3.More capabilities 4.Understanding and controlling the precision 5.Contrast with an alternative approach

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 3 To propagate a particle in a field (e.g. magnetic, electric or other), we solve the equation of motion of the particle in the field Using this solution we break up this curved path into linear chord segments –We determine the chord segments so that they closely approximate the curved path. –each chord segment will be ‘intersected’ so see it crosses a volume boundary. Magnetic field: overview

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 4 Magnetic field: a first example Create your Magnetic field class –Uniform field : Use an object of the G4UniformMagField class #include "G4UniformMagField.hh" #include "G4FieldManager.hh" #include "G4TransportationManager.hh “ G4MagneticField* magField= new G4UniformMagField( G4ThreeVector(1.0*Tesla, 0.0, 0.0 ) ); –Non-uniform field : Create your own concrete class derived from G4MagneticField (see eg ExN04Field in novice example N04) Part 1/2

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 5 Magnetic field: a first example Set your field as the ‘global’ field Find the global Field Manager G4FieldManager* globalFieldMgr= G4TransportationManager:: GetTransportationManager() ->GetFieldManager(); Set the field for this FieldManager, globalFieldMgr->SetDetectorField(magField); and create a Chord Finder. globalFieldMgr->CreateChordFinder(magField); Part 2/2

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 6 In practice: exampleN03 From ExN03DetectorConstruction.cc, which you can find also in geant4/examples/novice/N03/src In the class definition G4UniformMagField* magfield; In the method SetMagField(G4double fieldValue): G4FieldManager* fieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager(); // create a uniform magnetic field along Z axis magField = new G4UniformMagField(G4ThreeVector(0.,0.,fieldValue)); // Set this field as the global field fieldMgr->SetDetectorField(magField); // Prepare the propagation with default parameters and other choices. fieldMgr->CreateChordFinder(magField);

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 7 Beyond your first field Create your own field class –To describe your setup’s EM field Global field and local fields –The world or detector field manager –An alternative field manager can be associated with any logical volume Currently the field must accept position global coordinates and return field in global coordinates Customizing the field propagation classes –Choosing an appropriate stepper for your field –Setting precision parameters

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 8 Creating your own field void ExN04Field::GetFieldValue( const double Point[4], double *field) const { field[0] = 0.; field[1] = 0.; if(abs(Point[2])<zmax && (sqr(Point[0])+sqr(Point[1]))<rmax_sq) { field[2] = Bz; } else { field[2] = 0.; } } Create a class, with one key method – that calculates the value of the field at a Point Point [0..2] position Point[3] time

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 9 Global and local fields One field manager is associated with the ‘world’ –Set in G4TransportationManager Other volumes can override this –By associating a field manager with any logical volume By default this is propagated to all its daughter volumes G4FieldManager* localFieldMgr= new G4FieldManager(magField); logVolume->setFieldManager(localFieldMgr, true); where ‘ true ’ makes it push the field to all the volumes it contains.

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 10 Solving the Equation of Motion In order to propagate a particle inside a field (e.g. magnetic, electric or both), we solve the equation of motion of the particle in the field. We use a Runge-Kutta method for the integration of the ordinary differential equations of motion. –Several Runge-Kutta ‘steppers’ are available. In specific cases other solvers can also be used: –In a uniform field, using the analytical solution. –In a nearly uniform field (BgsTransportation/future) –In a smooth but varying field, with new RK+helix.

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 11 Using the method to calculate the track's motion in a field, Geant4 breaks up this curved path into linear chord segments. Choose the chord segments so that their sagitta is small enough –The sagitta is the maximum distance between the curved path and the straight line. –Small enough: is smaller than a user-defined maximum. We use the chords to interrogate the Navigator, to see whether the track has crossed a volume boundary. Splitting the path into chords sagitta

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 12 Stepping and accuracy You can set the accuracy of the volume intersection, –by setting a parameter called the “miss distance” it is a measure of the error in whether the approximate track intersects a volume. Default “miss distance” is 0.25 mm (used to be 3.0 mm). One physics/tracking step can create several chords. –In some cases, one step consists of several helix turns. miss distance In one ‘tracking’ step Chords real trajectory

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 13 Precision parameters Errors come from –Break-up of curved trajectory into linear chords –Numerical integration of equation of motion or potential approximation of the path, –Intersection of path with volume boundary. Precision parameters enable the user to limit these errors and control performance. –The following slides attempt to explain these parameters and their effects.

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 14 Imprecisions Due to approximating the curved path by linear sections (chords) –Parameter to limit this is maximum sagitta  chord Due to numerical integration, ‘error’ in final position and momentum –Parameters to limit are  integration max, min Due to intersecting approximate path with volume boundary –Parameter is  intersection

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 15 Key elements Precision of track required by the user relates primarily to –The precision (error in position) e pos after a particle has undertaken track length s –Precision DE in final energy (momentum)  E =  E/E –Expected maximum number N int of integration steps. Recipe for parameters: –Set  integration (min, max) smaller than The minimum ratio of e pos / s along particle’s trajectory  E / N int the relative error per integration step (in E/p) –Choosing how to set  chord is less well-define. One possible choice is driven by the typical size of your geometry (size of smallest volume)

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 16 Where to find the parameters Paramete r NameClassDefault value  miss DeltaChordChordFinder0.25 mm d min stepMinimumChordFinder 0.01 mm  intersection DeltaIntersectionFieldManager1 micron epsilonMaxFieldManager0.001 epsilonMinFieldManager  one step DeltaOneStep FieldManager0.01 mm

Details of Precision Parameters For further/later use

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 18 Parameter  chord = maximum sagitta Effect of this parameter as  chord 0 s 1step propagator ~ (8  chord R curv ) 1/2 so long as s propagator d min (integr) Volume miss error Due to the approximation of the curved path by linear sections (chords) d sagitta <  chord  chord d sagitta Parameter value =

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 19 Integration error Due to error in the numerical integration (of equations of motion) Parameter(s):  integration The size s of the step is limited so that the estimated errors of the final position  r and momentum  p are both small enough: max( ||  r || / s, ||  p|| / ||p|| ) <  integration For ClassicalRK4 Stepper s 1step integration ~ (  integration ) 1/3 for small enough  integration The integration error should be influenced by the precision of the knowledge of the field (measurement or modeling ). s 1step rr N steps ~ (  integration ) -1/3

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 20 Integration errors (cont.) In practice –  integration is currently represented by 3 parameters –epsilonMin, a minimum value (used for big steps) –epsilonMax, a maximum value (used for small steps) –DeltaOneStep, a distance error (for intermediate steps)  integration =  one step / s physics Determining a reasonable value –I suggest it should be the minimum of the ratio (accuracy/distance) between sensitive components,.. Another parameter –d min is the minimum step of integration (newly enforced in Geant4 4.0) Defaults 0.5* mm Default 0.01 mm

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 21 Intersection error In intersecting approximate path with volume boundary –In trial step AB, intersection is found with a volume at C –Step is broken up, choosing D, so S AD = S AB * |AC| / |AB| –If | CD | <  intersection Then C is accepted as intersection point. –So  int is a position error/bias A C B D S AD p

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 22 Intersection error (cont) So  int must be small –compared to tracker hit error –Its effect on reconstructed momentum estimates should be calculated And limited to be acceptable Cost of small  int is less –than making  chord small –Is proportional to the number of boundary crossings – not steps. Quicker convergence / lower cost –Possible with optimization adding std algorithm, as in BgsLocation B D A E F If C is rejected, a new intersection point E is found. E is good enough if |EF| <  int

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 23 The ‘driving force’ Distinguish cases according to the factor driving the tracking step length –‘physics’, eg in dense materials –fine-grain geometry Distinguish the factor driving the propagator step length (if different) –Need for accuracy in ‘seeing’ volume –Integration inaccuracy Strongly varying field Potential Influence G4 Safety improvement Other Steppers, tuning d min

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 24 What if time does not change much? If adjusting these parameters (together) by a significant factor (10 to 100) does not produce results, –Then field propagation may not the dominant (most CPU intensive) part of your program. –Look into alternative measures modifying the physics ‘cuts’ – ie production thresholds –To create fewer secondaries, and so track fewer particles determining the number of steps of neutral vs charged particles, –To find whether neutrons, gammas ‘dominate’ profiling your application –You can compile using G4PROFILE=yes, run your program and then use “gprof” to get an execution profile.

25th May 2005Geant4 Fields, J. Apostolakis, Geant4 Tutorial CERN 25 Contributors to Field sub-category Current Contributors John Apostolakis Vladimir Grichine Past contributor Simone Giani Wolfgang Wander With thanks to users contributing significant feedback including Pedro Arce, Alberto Ribon, Stefano Magni, … and to David Williams for useful discussions