1 march 2009 c.p. ward monte carlo detector simulation pat ward memorable quote from ua5:- a:...

74
1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in this experiment”

Post on 22-Dec-2015

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

1 March 2009 C.P. Ward

Monte Carlo Detector Simulation

Pat Ward

Memorable quote from UA5:-

A: “Monte Carlo isn’t the only source of truth”

B: “It is in this experiment”

Page 2: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

2 March 2009 C.P. Ward

Monte Carlo Detector Simulation

1) Introduction – why, how, random numbers, Monte Carlo techniques

2) Event Generation

3) Geometry and Materials

4) Tracking

5) Physics Processes

6) Hits and Digitisation

7) Fast Simulation

Page 3: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

3 March 2009 C.P. Ward

A Simulated ATLAS event

Page 4: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

4 March 2009 C.P. Ward

1) Introduction

Why do we use MC simulations so extensively?Design detectorUnderstand detector responseDevelop reconstruction and analysis

algorithmsEstimate efficiencies and backgrounds

These studies need large numbers of simulated events – often many times the number of data events.

Page 5: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

5 March 2009 C.P. Ward

Full / Fast Simulation

Full simulation: track particles through detailed detector geometry, taking account of interactions and decays. Secondary particles produced in interactions of primaries with detector material are tracked.

Fast simulation: parameterize response of detector to primary particles.

Hybrid: full tracking in parts of detector (e.g. tracking chambers) with parameterization in other regions, e.g. calorimeters.

Will first concentrate on full simulation.

Page 6: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

6 March 2009 C.P. Ward

Event Generator

DetectorGeometry

PhysicsProcesses

TrackingDigitisation

Reconstruction

Primary Event Hits

Digits(Raw data)

All steps in one job or output results at each stage and input to next stage

Page 7: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

7 March 2009 C.P. Ward

MC Programs

Most experiments now use GEANT4 toolkit for detector simulation (OO, C++).

Contains tracking, physics processes, tools for user to build detector geometry, visualisation.

Developed from earlier Fortran GEANT3, used by e.g. LEP experiments.

Most of following applies to GEANT4. S.Agostinelli et al., Nucl. Inst. And Methods A506 (2003) 250;

J.Allison et al., IEEE Transactions 53 (2006) 270. http://geant4.web.cern.ch/geant4/

Page 8: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

8 March 2009 C.P. Ward

Random Number Generation

Random number generation obviously important for any Monte Carlo simulations.

Has caused numerous problems when the random number generator was “not random enough” – e.g. periodic behaviour.

A single event uses huge numbers of random numbers – e.g. a typical atmospheric neutrino event (mean energy ~1 GeV) in MINOS uses ~2.3x105 .

Assuming scales with energy, LHC event needs ~3x109 .

Page 9: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

9 March 2009 C.P. Ward

Types of Random Number Generators

Truly random: from random physical process, e.g. radioactive decay.

Pseudorandom: generated from simple numerical algorithm, appear random if algorithm not known.

Quasirandom: from numerical algorithm, but designed to be as uniform as possible rather than to appear random. Used for MC integration.

Monte Carlo simulations use pseudorandom numbers.

Page 10: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

10 March 2009 C.P. Ward

Random Number Generators

Generators for any distribution depend on a basic generator producing numbers uniform in [0,1].

N.B. endpoints of range may or may not be included – if included beware log(0).

Set state using initial ‘seed’ or multiple seeds. State at any time defined by one or more seeds,

which can be retrieved for restarting generator. All pseudorandom number generators have

some period after which sequence repeats.

Page 11: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

11 March 2009 C.P. Ward

Required Properties

Good distribution – i.e. randomness. Long period – no repeat events. Repeatability – need to be able to regenerate a

particular event in middle of run to debug problem, for example.

Long disjoint sequences – run many jobs in parallel.

Portability – use many different systems. Efficiency.

Page 12: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

12 March 2009 C.P. Ward

Simple Generators

Simple generators use a single seed. With single seed, 32-bit computer -> maximum

period ~230 (~109). E.g. multiplicative linear congruential generator:

si+1 = (a si + c) mod m

a is well-chosen multiplier; constant c may be 0;

m (slightly <) largest integer

Integer seed si converted to floating by dividing by m.

Not adequate for typical MC applications.

Page 13: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

13 March 2009 C.P. Ward

Some Random Number Generators

Various techniques exist for improving simple generators.

See F. James, Comp. Phys. Comm. 60 (1990) 329. Some of the commonly used generators,

available in GEANT4, are: Ranecu

From Cernlib RANECUPeriod 1018

Not easy to make disjoint sequences Initialized / restarted by one 32-bit integer

Page 14: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

14 March 2009 C.P. Ward

Some Random Number Generators

Ranlux From Cernlib RANLUX – improvement on RCARRY 109 disjoint sequences of length 10161

Initialized by one 32-bit integer, but need 25 words to store state

HepJamesRandom From Cernlib RANMAR Default in GEANT4 109 disjoint sequences of length 1034

Initialized by one 32-bit integer, but need 100 words to store state

Page 15: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

15 March 2009 C.P. Ward

Random Numbers from Common Distributions

Isotropic distribution in 3D Probability density ~ dΩ ~ d(cosθ)dφ cosθ uniform (2u1 – 1)

Φ uniform 2πu2

Gaussian z1 = sin2πu1√(-2lnu2)

z2 = cos2πu1√(-2lnu2)

z1 and z2 are independent and Gaussian distributed with mean zero and standard deviation 1

N.B. there are faster variants

u1, u2 are random numbers uniform in [0,1]

Page 16: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

16 March 2009 C.P. Ward

Inverse Transform Method

Want to generate random number x from f(x)

f(x) normalized Cumulative distribution

F(a) = ∫af(x)dx If a is chosen randomly

from f(x), then F(a) is uniform in [0,1]

Choose u uniform in [0,1] Find x = F-1(u) Good for simple, easily

inverted functions

Useful for obtaining random number according to histogram

Page 17: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

17 March 2009 C.P. Ward

Acceptance-Rejection Method

Enclose f(x) in shape C*h(x) where h(x) is easily generated function

f, h normalized, C > 1

Generate random number x0 from h(x)

Generate u = uniform random number in [0,1]

Accept x0 if u*C*h(x)≤f(x) Otherwise reject and

generate new x0

Choose C*h(x) as close to f(x) as possible for maximum efficiency: importance sampling

Page 18: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

18 March 2009 C.P. Ward

Aside….

Even with a good basic uniform random number generator beware problems in distributions.

E.g GEANT3 generated Poisson distribution using GPOISS which returned integer.

For mean > 16, routine used Gaussian approx. which calculated a float.

Result inadvertently rounded down when GPOISS returned integer.

So, e.g. many calls with mean = 16.1 would give distribution with mean = 15.6 .

Page 19: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

19 March 2009 C.P. Ward

Another Aside……

Reproducibility problem with Gaussian random numbers generated in pairs. Generator in CLHEP:First entry – generate pair, return one of them

and set flagSecond entry – return second number without

calling uniform generator again and reset flag Hence state not fully defined by uniform

generator state – not reproducible

Page 20: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

20 March 2009 C.P. Ward

2) Event Generation

At colliders, generally use stand-alone program to generate final-state particles of primary event for input to detector simulation.

Examples are Pythia, Herwig – discussed in Bryan’s lectures.

Need standard, well-defined interface between generator and detector simulation program.

E.g. HEPEVT common block in Fortran or HepMC in C++ .

Page 21: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

21 March 2009 C.P. Ward

HepMC

Particles and vertices in tree structure Can be input to GEANT4

Z

vertex

Z

vertex vertex

e e q qbar

Page 22: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

22 March 2009 C.P. Ward

Particle Codes

Particles are identified by a unique code – often called the ‘PDG’ code.

Particles positive code, antiparticles negative. Quarks: d = 1, u = 2, s = 3, …… Leptons: e- = 11, νe = 12, μ- = 13, νμ = 14, …. Mesons and baryons: spin and quark content

are incorporated in code. See ‘Monte Carlo Particle Numbering Scheme’

in PDG.

Page 23: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

23 March 2009 C.P. Ward

Short-lived Particles

Event generators usually decay resonances, and may optionally decay other short-lived particles.

Specialized packages may be used – e.g. TAUOLA for tau decays, EvtGen for B decays.

At detector simulation stage, these particles need to be tracked until decay, but then use the decay products already generated.

This is possible in GEANT4 (G4PreAssignedDecayProducts)

Page 24: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

24 March 2009 C.P. Ward

Fixed-Target Event Generation

For fixed-target experiments the primary event generation may be hard to separate from detector simulation.

Simulate primary interaction within detector simulation program – often with specialized generator, e.g. NEUGEN for neutrino interactions.

Tracking beam particles through detector until interact not feasible for neutrinos - cross-sections far too small.

Neutrino beam contains range of energies, and detector unlikely to be homogenous. Cross-section depends on energy and target nucleus.

Calculate maximum interaction probability at initialisation and reweight all probabilities to get efficient generation.

Page 25: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

25 March 2009 C.P. Ward

Neutrino Event Generation

Initialize detector geometry, neutrino flux generator and neutrino interaction generator.

Estimate maximum weight (i.e. interaction probability). In event loop:

Pick neutrino from flux generator. Calculate accumulated mass distribution, cross-

sections, for materials along ν trajectory. Use total cross-section*mass to decide whether to

interact – if not, pick another ν. Pick material, vertex location and generate

kinematics.

Page 26: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

26 March 2009 C.P. Ward

3) Geometry and Materials

Detector geometry is modelled as a hierarchy of volumes (i.e. tree structure).

A logical volume represents a detector element of certain shape:Made of certain materialMay be a sensitive volumeMay contain other volumes

A physical volume represents the spatial positioning or placement of the logical volume within a mother (logical) volume.

Page 27: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

27 March 2009 C.P. Ward

SCT_BarrelTube, air

SCT:Layer0SupportTube, air

SCT:Layer0ActiveTube, air

SCT:Layer0Tube, air

SCT:InterlinkTube, air

SCT:Layer0AuxTube, air

SCT:Layer1

SCT:Layer2

SCT:Layer3

Thermal shield etc.

SCT:Ski0 SCT:Clamp SCT:CoolingEnd

SCT:FlangeSCT:SupportCylinderModules, doglegs, cooling blocks

Interlink segments, B6 bearings

x2

x32 x2 x2

x2

(13 vols)

Bracket, harness

Example

Page 28: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

28 March 2009 C.P. Ward

Geometry

A logical volume may be: A simple shape: e.g. box, cylinder, cone…. Made from boolean combinations of these shapes

In Geant4 it is also possible to define shapes using bounding surfaces (useful for interfacing to CAD systems).

Physical volumes are positioned within the mother logical volume using translation and rotation relative to the local coordinate system.

The daughter volumes must not overlap, and must not protrude from the mother volume.

Page 29: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

29 March 2009 C.P. Ward

Example Shape: Tube Section

Page 30: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

30 March 2009 C.P. Ward

Example Shape: Polyhedron

Page 31: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

31 March 2009 C.P. Ward

Materials

An element can be defined by atomic number and atomic mass.

A material is built from elements or other materials: need to specify density and fraction (by mass) of each element / material.

From composition and density useful properties (radiation length, interaction length, dE/dx etc) can be calculated.

Specifying correct composition is important for simulation of energy loss, multiple scattering, photon conversion probability etc..

Page 32: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

32 March 2009 C.P. Ward

Sensitive Volume

A logical volume may be a sensitive volume: one for which hits are stored during tracking.

In GEANT4 a sensitive detector may have a readout geometry.

The readout geometry is completely separate from the tracking geometry; it is used to determine the readout channel for a hit, for example.

Page 33: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

33 March 2009 C.P. Ward

4) Tracking

Particles are transported through the detector geometry in a series of steps. Particle at (x,y,z) with momentum (px,py,pz). Calculate step to nearest boundary.

Exit current volume or enter daughter.

For each physics process calculate distance to interaction or decay.

Take shortest step. Apply dE/dx, multiple scattering and any other

continuous processes. Interact / decay particle if that was what limited step.

Page 34: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

34 March 2009 C.P. Ward

Tracking Optimization

Tracking of particles is the time-consuming part of simulation.

Various techniques to reduce number of candidate volumes for intersection.

Virtual Divisions (used in Geant3). Slice mother volume evenly along one axis.Each section stores list of daughters

contained.Works well in hierarchical geometry.

Page 35: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

35 March 2009 C.P. Ward

Tracking Optimization

Smart Voxels used in Geant4.One-dimensional virtual division for each

mother volume.Combine divisions containing same volumes. If division has too many volumes divide again

along a different axis.Still too many volumes → divide again along

third axis.

Page 36: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

36 March 2009 C.P. Ward

Smart Voxels Example

Mother volume sliced along horizontal axis. Each slice has independent set of vertical divisions.

From S. Agostinelli et al., Nucl. Inst. Meth. A506 (2003) 250

Page 37: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

37 March 2009 C.P. Ward

Tracking in EM Field

Charged particle does not follow linear trajectory in magnetic field.

Propagate by integrating equation of motion. Uniform field → helical path, analytic solution. Non-uniform field → non-analytic solution.

Geant4 uses 4th order Runge-Kutta method by default. Best method of solution depends on field.

Near-uniform field: start from helical solution and use Runge-Kutta iteration.

Field not smooth: use lower order method.

Page 38: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

38 March 2009 C.P. Ward

Tracking in EM Field

Curved path broken into linear chord segments. Chord segments used to test intersection with boundary. Need to choose parameters (e.g. miss distance)

carefully to give desired accuracy, else momentum bias.

Page 39: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

39 March 2009 C.P. Ward

Distance to interaction or decay characterised by mean free path λ (for each process).Decay: λ=γvτ

v = velocity, τ = mean lifetime

Interaction: 1/λ = ρΣi{xiσi/mi} ρ = density of material xi = mass fraction σi = cross-section mi = mass

λ varies as particle loses energy or crosses boundary.

Interactions and Decays

} isotope i

Page 40: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

40 March 2009 C.P. Ward

Interactions and Decays

Probability of surviving distance l is

P(l) = exp(-nλ ) where nλ = ∫l0

dl/λ(l). P(nλ) is exponential, independent of material and

energy. At particle production point set nλ = - ln(η) where

η is random number uniform in [0,1]. Different random number for each process.

Use this to determine point of interaction or decay in current material.

Update remaining nλ after each step if particle still alive.

Page 41: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

41 March 2009 C.P. Ward

5) Physics Processes

Physics processes may happenContinuously along a step (e.g. energy loss).At the end of a step (decay, interaction).At rest (e.g. decay at rest).

Most important processes (for our simulations) are electromagnetic and hadronic interactions.

N.B. Geant4 has wide range of physics processes available, covering wide energy range; e.g. Compton scattering, photoelectron production, synchrotron radiation……..

Page 42: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

42 March 2009 C.P. Ward

Main Physics Processes

Photon:Pair production, Compton scattering,

photoelectric effect All charged particles:

Ionization / δ-rays, multiple scattering Electron / positron

Bremsstrahlung, annihilation (e+) Hadron:

Hadronic interactions

Page 43: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

43 March 2009 C.P. Ward

Range Cuts

In Geant3 particles below (user-defined) energy were stopped and remaining energy deposited → results depend on cut-off used.

In Geant4 all particles are tracked to end of range.

But number of secondaries increases rapidly as energy decreases for δ-rays, bremsstrahlung → necessary to have cut-off for production of secondary particles.

Cuts (for e+,e-,γ) given as range – internally translated into energy for each material.

Page 44: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

44 March 2009 C.P. Ward

Range Cuts

Energy thresholds corresponding to range cuts in silicon

Range e+ e- photon

5 μm 6.7 keV 6.7 keV (990 eV)

10 μm 31 keV 31 keV (990 eV)

50 μm 79 keV 80 keV 1.7 keV

100 μm 119 keV 120 keV 2.3 keV

200 μm 181 keV 185 keV 3.2 keV

1 mm 521 keV 541 keV 6.9 keV

Page 45: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

45 March 2009 C.P. Ward

Range Cuts

Different range cuts are appropriate for different parts of detector.Sensitive detector – need range cuts

comparable to spatial resolution. Inert material – not interested in detailed

tracking of particles which do not emerge, use higher range cuts to improve speed.

Example: ATLAS SCT (silicon wafers 285 μm thick, strip pitch 80 μm). Number of clusters for single muon depends on range cut for electrons.

Page 46: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

46 March 2009 C.P. Ward

Total no of clusters in 1 events

Vary StepLim

Page 47: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

47 March 2009 C.P. Ward

Ionization Energy Loss

Important for all charged particles. Above electron cut-off kinetic energy Tcut

simulate discrete δ-ray production. Below Tcut continuous energy loss along step. Imposes limit on step length because cross-

section energy-dependent.

Page 48: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

48 March 2009 C.P. Ward

Continuous Energy Loss

For hadrons typically use Bethe-Bloch restricted energy loss:

Page 49: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

49 March 2009 C.P. Ward

Continuous Energy Loss

Shell correction accounts for interaction of atomic electrons with nucleus – 10% correction for T = 2 MeV protons.

Density effect arises from polarization of medium; important at high energies.

Bethe-Bloch good for T > 2 MeV; at lower energy use Bragg model.

For each step, compute mean energy loss and then apply fluctuations .

Page 50: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

50 March 2009 C.P. Ward

Multiple Scattering

Charged particles traversing medium deflected by many small-angle scatters – Coulomb scattering from nuclei.

Detailed model: simulate all interactions (thin foils). Condensed model: simulate global effects at end of track

segment (usually used in MC, e.g. Geant4). Path length correction Net displacement Change of direction

For small deflection angles distribution is approx. Gaussian with r.m.s. angular deviation in a plane

Page 51: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

51 March 2009 C.P. Ward

Multiple Scattering

For larger deflections ( > few θ0) behaves like Rutherford scattering – longer tails.

Geant4 uses theory of Lewis (does not assume small angle) H. W. Lewis Phys. Rev. 78 (1950) 526.

All theoretical distributions have some error: simulation results depend on step length.

Older versions of Geant (to 4.7) – MS not allowed to limit step.

Newer releases (4.8) MS can limit step (for low energy particles). Reduces speed by ~ factor 2 for ATLAS.

Page 52: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

52 March 2009 C.P. Ward

Photon Conversion into e+e- Pairs

Example of process in which secondary particles are produced – other processes follow similar pattern

To calculate distance to next interaction need: Total cross-section per atom For pair-production this is parametrized in terms of

(Z,Eγ ) with parameters from fit to data Mean free path is then given by:

1/λ(Eγ) = Σni σ(Zi,Eγ)

ni = number of atoms / vol of ith element

Simulation of final state proceeds in several steps using differential cross-section

Page 53: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

53 March 2009 C.P. Ward

Photon Conversion into e+e- Pairs

Choose element according to

Prob(Zi,Eγ) = ni σ(Zi,Eγ) / Σni σ(Zi,Eγ) Choose energy carried by one particle

From Bethe-Heitler formula corrected for screening, Coulomb waves, electron field.

Choose charge of this particle randomly Choose polar angle of particle wrt photon direction

Function depends on energy Choose azimuthal angle from isotropic distribution Assume pair coplanar with photon and use energy

conservation to calculate momentum vectors of both Rotate to global reference frame

Page 54: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

54 March 2009 C.P. Ward

Hadronic Interactions

Wide range of incident particle energies, from thermal neutrons to TeV.

Calorimeters at colliders: modelling of pion - nucleon interactions fundamental (cross-sections, pT distributions…).

Good model of muon production in hadronic interactions needed for accurate background in muon detectors.

Different models appropriate for different incident particles, energy ranges, applications.

Page 55: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

55 March 2009 C.P. Ward

Hadronic Interactions

Model types:Data driven – low energy neutron transportParameterised – hadronic showers in

calorimeters (e.g. GHEISHA)Theory based – parton string models; used for

extrapolation to high energy In Geant4 usually specify the ‘physics list’ – set

of models to be used for various processes, e.g. LHEP, QGSP, QGSP_BERT, QGSP_BIC

Page 56: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

56 March 2009 C.P. Ward

Physics Lists in Geant4

LHEPParameterised models (LEP and HEP for low

and high energies respectively) based on GHEISHA.

Fast.Good shower shape, not so good for detailed

interactions.Used as backbone for other lists (i.e. to fill in

gap in energy range or particle coverage).

Page 57: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

57 March 2009 C.P. Ward

Physics Lists in Geant4

QGSPQuark gluon string model for high energy p, n,

π, K (> 20 GeV) (uses LHEP for lower energy).

Creates excited nucleus – passed to precompound model for nuclear de-excitation.

Theoretically motivated.Problems with shower shape at high energy.

QGSCAs QGSP but CHIPS (Chiral Invariant Phase

Space) model for nuclear de-excitation.

Page 58: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

58 March 2009 C.P. Ward

Physics Lists in Geant4

Above may be combined with intra-nuclear transport models at low energy.

QGSP_BERTAs QGSP but uses Bertini cascade model for

p, n, π, K < 10 GeV.More secondary protons and neutrons.Slower.

QGSP_BICAs QGSP but uses binary cascade model for

p, n, π, K < 3 GeV.

Page 59: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

59 March 2009 C.P. Ward

ATLAS Tile Calorimeter Test Beam

Energy deposited in sensitive elements for incident pions

Shower longer with Bertini cascade

Better agreement with data

Average energy greater with Bertini cascade

Page 60: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

60 March 2009 C.P. Ward

6) Hits and Digitisation

As particles traverse a sensitive volume, record information about position, energy loss etc.

These records are termed hits. The process which simulates the detector

response, i.e. turns the hits into the detector signals, is termed digitisation.

The output of the digitisation process is termed digits (or maybe raw data).

Page 61: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

61 March 2009 C.P. Ward

Hits

The information stored in a hit depends on the type of detector.

For a tracking detector, typically store step start and end points, step length, energy deposited, time, particle.

For a calorimeter such detailed information is usually unnecessary, and consumes too much space.

Store sum of energy deposited in each readout cell rather than individual steps.

Page 62: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

62 March 2009 C.P. Ward

Digitisation

Details of digitisation very detector dependent. Example: silicon strip detector (ATLAS SCT):

Convert energy deposited to charge. Electron-hole pair creation energy = 3.63 eV/pair.

Drift charges to surface of wafer, including effects of diffusion (depends on temperature), Lorentz angle (depends on

bias voltage). Sum charges on each strip. Add noise (using measured noise occupancy). Simulate electronics response.

Page 63: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

63 March 2009 C.P. Ward

Digitisation

Example: MINOS scintillator strips:Convert energy deposited to photons.Transport photons along wls fibres allowing

for attenuation, reflection (model efficiency v distance).

Convert photons to electrons at photocathode (quantum efficiency).

Model readout electronics. Include noise and cross-talk.

Page 64: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

64 March 2009 C.P. Ward

Pile-up and Data Overlay

At LHC nominal luminosity of 1034 cm-2s-1 and 25 ns bunch spacing, each bunch crossing contains 23 pp ‘minimum bias’ events (on average) in addition to the hard-scattering event causing trigger.

Also beam gas, beam halo, cavern background. Integration time of detector electronics means

need to consider >1 BC Would take too long to simulate all these events

together

Page 65: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

65 March 2009 C.P. Ward

Pile-up and Data Overlay

One solution: add events at digitisation stage – pile-up Generate and simulate signal, minimum bias and

other background events separately as far as hits files Add hits from appropriate numbers of events before

digitisation Re-use minimum bias and background events

Second solution: add real data to MC – data overlay Real data from random beam crossings (zero bias) Signal event from simulation Need to remove noise from simulation – already be

included in the real data

Page 66: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

66 March 2009 C.P. Ward

7) Fast Simulation

Full detector simulation is very cpu (and memory) intensive for high energy events.

10 – 15 mins / event (or more) for ATLAS

Electromagnetic shower: number of particles (hence time) is proportional to energy.

Usually not feasible to generate large samples of events with different generator parameters needed for systematic studies, for example.

Use fast generation techniques instead: may be adequate for parameter comparisons if not for detailed studies of detector performance.

Page 67: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

67 March 2009 C.P. Ward

Fast Simulation

Fastest simulation: simply smear parameters of particles from event generator. 1s / event for ATLAS

May include detailed parameterization of detector response as function of production angle (e.g. reflecting number of layers of tracking detector traversed, thickness and resolution of calorimeter etc).

Hard to include effects of overlapping particles: shared tracking hits, spatial resolution in calorimeters.

Hard to simulate tails of distributions. Hybrid techniques combining full simulation of tracking

detector with parameterization of calorimeter increase speed while still giving accurate simulation.

Page 68: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

68 March 2009 C.P. Ward

EM Shower Simulation

Most time is taken by detailed simulation of showers in calorimeters.

Methods to reduce this: Dump energy of low energy particles (< 10 MeV)

instead of tracking to end of range. Parameterization of showers. Frozen shower libraries.

N.B. need parameterization for electrons and positrons only – photons soon convert.

Hadronic showers contain large EM component, so hope gains in EM showers help these.

Page 69: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

69 March 2009 C.P. Ward

EM Shower Parameterization

EM showers have well-defined (average) longitudinal and transverse profile which depend on radiation length.

Longitudinal profile:

Radial profile depends on Molière radius, RM=X0Es/Ec

(Ec = critical energy, Es ~ 21 MeV)

Can be parameterized as sum of 2 Gaussians or by:

Page 70: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

70 March 2009 C.P. Ward

EM Shower Parameterization

Determine parameters from full simulation. Validate full simulation using test beam data. During event simulation, when electron enters, or is

produced in, calorimeter: Stop tracking. Use parameterization to determine mean energy

deposit in each calorimeter cell. Apply fluctuations.

Parameterization valid above a few GeV. Also slow at low energy – in fact full tracking may be faster.

At low energy use frozen shower (or continue full tracking).

Page 71: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

71 March 2009 C.P. Ward

Frozen Shower Library

Generate special samples of electrons incident on calorimeter and store hits.

During routine event generation, retrieve one of these pre-generated showers instead of tracking particle (matched in energy, angle).

Map to current shower position. Useful for low energies (< 1 GeV) where

parameterization not accurate. Optimal scheme may combine all techniques.

Page 72: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

72 March 2009 C.P. Ward

Example Scheme

Gives factor ~4 reduction in simulation time in ATLAS calorimeter for dijet events.

Page 73: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

73 March 2009 C.P. Ward

Summary

MC simulations are crucial to design and understand detector and extract physics from data.

Full simulation consists of several steps: event generation; tracking through detector geometry taking account of energy loss, multiple scattering, decays and interactions; simulation of detector response.

Most full detector simulations are carried out in the GEANT4 framework. http://geant4.web.cern.ch/geant4/

Full simulation is slow: fast or hybrid techniques also needed.

Understanding of these steps is necessary part of physics analysis.

Page 74: 1 March 2009 C.P. Ward Monte Carlo Detector Simulation Pat Ward Memorable quote from UA5:- A: “Monte Carlo isn’t the only source of truth” B: “It is in

74 March 2009 C.P. Ward

And Finally……

Monte Carlo simulations are only useful if they are validated against (your) data!