Primary particle Giovanni Santin ESA / ESTEC and RheaTech Ltd On behalf of the Geant4 collaboration Ecole Geant4 Annecy, 18-21 and 25-28 Nov 2008 With.

Slides:



Advertisements
Similar presentations
Primary Particle KOI, Tatsumi Geant4 V9.4 Geant4 Tutorial at Texas A&M 11-Jan
Advertisements

山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01.
User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.3.
山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01.
Geant4 v9.2p02 Particle Gun Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.2p02 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Primary particle generation Makoto Asai (SLAC) Geant4 Users CERN Nov. 12 th, 2002.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 15 th, 2002 Customizing Run Management.
Geant4 v9.4 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.4 User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 11 th, 2002 Getting Started.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002 Getting Started.
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 20th, 2002 Stack management, Digitization and Pile-up.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 13th, 2002 Stack management, Digitization and Pile-up.
Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
Introduction to Geant4 Makoto Asai (SLAC) Geant4 Tutorial Course the 2nd Finnish Geant4 Workshop June , Helsinki Institute of Physics June 2005,
A introduction Luciano Pandola INFN-LNGS Partially based on a presentation by G.A.P. Cirrone (INFN-LNS) and M.G. Pia (INFN-Ge) Queen’s University, Belfast.
A stable interface to read and write IAEA phase-space files in Geant4 M. A. Cortés-Giraldo 1, R. Capote 2, J. M. Quesada 1 1 Dep. Física Atómica, Molecular.
Primary particle Geant4 tutorial Paris, 4-8 June 2007 Giovanni Santin ESA / ESTEC Rhea System SA With material from previous tutorials by Makoto Asai.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
1 Primary particles Geant4 User's Tutorial CERN, February 2010 Talk from previous tutorial by Giovanni Santin Ecole Geant4, Annecy 2008.
Geant4 Training 2003 Basic structure of the Geant4 Simulation Toolkit The full set of lecture notes of this Geant4 Course is available.
Normalisation modelling sources Geant4 tutorial Paris, 4-8 June 2007 Giovanni Santin ESA / ESTEC Rhea System SA.
Maria Grazia Pia Detector Response Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Basic Structure of the Geant4 Simulation Toolkit
Geant4 internal Classes and Objects Gunter Folger / CERN Geant4 course, Annecy 2008 User Action & Information Classes.
Monte Carlo /12/07. What is Geant ? Monte Carlo simulation tool for nuclear and particle physics Set up detectors –Sensitive detector which returns.
User Application Toolkit + User application toolkit Geant4 is a toolkit –i.e. you cannot “run” it out of the box –You must write.
User Application Luciano Pandola INFN-LNGS Partially based on a presentation by Maria Grazia Pia (INFN-Ge)
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Geant4 internal Classes and Objects Geant4 Users’ Tutorial February 2010 Gunter Folger / CERN User Action & Information Classes.
Generating Primary Particles Each Geant4 Event starts with generation of one or multiple primary particles It is up to the user to define primary particle.
G4GeneralParticleSource Class: Developed by ESA as the space radiation environment is often quite complex in energy and angular distribution, and requires.
Maria Grazia Pia INFN Genova Salamanca, July 2002
CBM Software Meeting 1 CBM Simulation & Analysis Framework Geant3 / Gean4 configuration M. Al-Turany, D. Bertini.
Basics of Primary Particle Generation and Tracking Makoto Asai (SLAC) Geant4 Tutorial CERN May 25-27, 2005 May 2005, Geant4 v7.0p01.
Run and Event G4Run and G4RunManager In Geant4, the Run is the largest unit of simulation and it consist of a series of events Within a Run, the detector.
Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.
22.July.2003 M.Smizanska: EvtGen in ATLAS EvtGen in ATLAS Outline: ATLAS EvtGen users: General requirements ATLAS EvtGen B-physics group requirements ATLAS.
Geant4 Training 2003 Primary Particle Generation The full set of lecture notes of this Geant4 Course is available at
Geant4 internal Classes and Objects Gunter Folger / CERN MC-PAD, DESY/Hamburg January 2010 User Action & Information Classes.
Introduction to Geant4 Makoto Asai (SLAC) Geant4 Tutorial Course the 2nd Finnish Geant4 Workshop June , Helsinki Institute of Physics June 2005,
The interface to EvtGen in CMS Roberto Covarelli University of Rochester EvtGen workshop, 06/12/2010.
1 Exercises 0 Go inside the “hadrontherapy” directory: cd hadrontherapy Copy the Hadrontherapy example to your home folder: cp –r $G4INSTALL/examples/advanced/hadrontherapy.
GPS General Particle Source
Maria Grazia Pia Retrieving information from kernel Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Interaction with the Geant4 kernel
Interaction with the Geant4 kernel
Basics of a user application
Geant4:User Actions and Analysis
Primary Particle Generation
Makoto Asai (SLAC) Geant4 Users CERN Nov. 11th, 2002
G.A.P.Cirrone, S.E.Mazzaglia - INFN/LNS, Italy
Primary Particle Generation
The n-3He Simulation Using Geant4
Use of Geant4 in experiment interactive frameworks AliRoot
G4GeneralParticleSource Class:
User Application
User Application
User Application
The full set of lecture notes of this Geant4 Course is available at
Customizing Run Management
The full set of lecture notes of this Geant4 Course is available at
Kernel Author: Makoto Asai.
Primary particle Makoto Asai (SLAC Computing Services)
The full set of lecture notes of this Geant4 Course is available at
Presentation transcript:

Primary particle Giovanni Santin ESA / ESTEC and RheaTech Ltd On behalf of the Geant4 collaboration Ecole Geant4 Annecy, and Nov 2008 With material from previous tutorials by Makoto Asai

Giovanni Santin - Primary particle - Geant4 tutorial, Paris Outline General concepts –G4VUserPrimaryGeneratorAction class –Primary vertex and primary particle –Pre-assigned decays Built-in primary particle generators –G4ParticleGun –Interfaces to HEPEVT and HEPMC –General Particle Source (GPS)

Giovanni Santin - Primary particle - Geant4 tutorial, Paris General concepts

Giovanni Santin - Primary particle - Geant4 tutorial, Paris User classes Initialization classes –Use G4RunManager::SetUserInitialization() to define. –Invoked at the initialization G4VUserDetectorConstruction G4VUserPhysicsList Action classes –Use G4RunManager::SetUserAction() to define. –Invoked during an event loop G4VUserPrimaryGeneratorAction G4UserRunAction G4UserEventAction G4UserStackingAction G4UserTrackingAction G4UserSteppingAction main() –Geant4 does not provide main(). Note : classes written in orange are mandatory.

Giovanni Santin - Primary particle - Geant4 tutorial, Paris G4VUserPrimaryGeneratorAction This class is one of the mandatory user classes and controls the generation of primaries –What kind of particle (how many) what energy, position, direction, polarisation, etc This class should NOT generate primaries itself but invoke GeneratePrimaryVertex() method of primary generator(s) to make primaries ( G4VPrimaryGenerator ) Constructor –Instantiate primary generator(s) –Set default values to it (them) GeneratePrimaries() method –Randomize particle-by-particle value(s) –Set these values to primary generator(s) Never use hard-coded UI commands –Invoke GeneratePrimaryVertex() method of primary generator(s)

Giovanni Santin - Primary particle - Geant4 tutorial, Paris Primary vertices and primary particles Primary vertices and primary particles are stored in G4Event in advance to processing an event. –G4PrimaryVertex and G4PrimaryParticle classes –These classes don ’ t have any dependency to G4ParticleDefinition nor G4Track. –They will become “ primary tracks ” only at Begin-of-Event phase and put into a “ stack ” MyPrimaryGenerator (G4VUserPrimaryGeneratorAction) Computes desired primary properties MyParticleGun (G4VPrimaryGenerator) Vertices and Primary particles are created G4Event Primaries are stored for later tracking

Giovanni Santin - Primary particle - Geant4 tutorial, Paris Pre-assigned decay for primaries Capability of bookkeeping decay chains Primary particles may not necessarily be particles which can be tracked by Geant4 –Pre-assigned decay channels attached to particles –Also, “ exotic ” particles can be imported from Particle Generators, followed by either decay or user defined physics processes (e.g. Higgs, W/Z boson, SUSY particle, … )

Giovanni Santin - Primary particle - Geant4 tutorial, Paris Built-in primary particle generators Geant4 provides some concrete implementations of G4VPrimaryGenerator. –G4ParticleGun –G4HEPEvtInterface, G4HEPMCInterface –G4GeneralParticleSource

Giovanni Santin - Primary particle - Geant4 tutorial, Paris G4ParticleGun Concrete implementations of G4VPrimaryGenerator –A good example for experiment-specific primary generator implementation It shoots one primary particle of a certain energy from a certain point at a certain time to a certain direction. –Various C++ set methods are available Intercoms commands are also available for setting initial values –/gun/List List available particles –/gun/particle Set particle to be generated –/gun/direction Set momentum direction –/gun/energy Set kinetic energy –/gun/momentum Set momentum –/gun/momentumAmp Set absolute value of momentum –/gun/position Set starting position of the particle –/gun/time Set initial time of the particle –/gun/polarization Set polarization –/gun/number Set number of particles to be generated (per event) –/gun/ionSet properties of ion to be generated [usage] /gun/ion Z A Q

Giovanni Santin - Primary particle - Geant4 tutorial, Paris Complex sources with G4ParticleGun (1) G4ParticleGun is basic, but it can be used from inside UserPrimaryGeneratorAction to model complex source types / distributions: –Generate the desired distributions (by shooting random numbers) –Use (C++) set methods of G4ParticleGun –Use G4ParticleGun as many times as you want –Use any other primary generators as many times as you want to make overlapping events

Giovanni Santin - Primary particle - Geant4 tutorial, Paris Complex sources with G4ParticleGun (2) Example of user PrimaryGeneratorAction using G4ParticleGun void T01PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent){ G4ParticleDefinition* particle; G4int i = (int)(5.*G4UniformRand()); switch(i){ case 0: particle = positron; break; case 1:... } particleGun->SetParticleDefinition(particle); G4double pp = momentum+(G4UniformRand()-0.5)*sigmaMomentum; G4double mass = particle->GetPDGMass(); G4double Ekin = sqrt(pp*pp+mass*mass)-mass; particleGun->SetParticleEnergy(Ekin); G4double angle = (G4UniformRand()-0.5)*sigmaAngle; particleGun->SetParticleMomentumDirection (G4ThreeVector(sin(angle),0.,cos(angle))); particleGun->GeneratePrimaryVertex(anEvent); } You can repeat this for generating more than one primary particles.

Giovanni Santin - Primary particle - Geant4 tutorial, Paris Interfaces to external event generators Concrete implementations of G4VPrimaryGenerator –Good examples for experiment-specific primary generator implementation –Interface to external physics generators G4HEPEvtInterface –Event record structure based on /HEPEVT/ common block –Used by (FORTRAN) HEP physics generators –Developed and agreed on within the framework of the 1989 LEP physics study –ASCII file input G4HepMCInterface –HepMC Event record for MC generators. Object Oriented, C++ –Used by new (C++) HEP physics generators –ASCII file input or direct linking to a generator through HepMC

Giovanni Santin - Primary particle - Geant4 tutorial, Paris User actions for external event generators Adapted from examples/extended/eventgenerator/HepMC/HepMCEx01 and examples/extended/runAndEvent/RE01 PrimaryGeneratorAction::PrimaryGeneratorAction() { // HepMC m_currentGenerator = new HepMCG4AsciiReader(); // HEPEvt // G4String filename = "pythia_event.data"; // m_currentGenerator = new G4HEPEvtInterface(filename); } PrimaryGeneratorAction::~PrimaryGeneratorAction() { delete m_currentGenerator; } void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { m_currentGenerator-> GeneratePrimaryVertex(anEvent); } /generator/hepmcAscii/open filename /run/beamOn 1

Giovanni Santin - Primary particle - Geant4 tutorial, Paris G4GeneralParticleSource (GPS) An advanced concrete implementation of G4VPrimaryGenerator Offers as pre-defined many common (and not so common) options –Position, angular and energy distributions –Multiple sources, with user defined relative intensity Capability of event biasing (variance reduction). All features can be used via C++ or command line (or macro) UI See related talk this afternoon

Giovanni Santin - Primary particle - Geant4 tutorial, Paris Exercises Proton source Vertices on rectangle along xz at +y edge of World Planar emission along -y Monoenergetic: 500 MeV