Primary Particle KOI, Tatsumi Geant4 V9.4 Geant4 Tutorial at Texas A&M 11-Jan- 2011 1.

Slides:



Advertisements
Similar presentations
Study of Position Sensitive  E-E for Space Particle Telescope Pre-results of Geant4 simulation 张云龙,王文骁,李翠.
Advertisements

山下智弘 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.
User Documents and Examples II KOI, Tatsumi Geant4 V9.4.p01Geant4 Tutorial at ORNL 10-March
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.
Event Generators Norman Graf (SLAC) May 20, 2003 May 20, 2003.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
1 MECH 221 FLUID MECHANICS (Fall 06/07) Tutorial 6 FLUID KINETMATICS.
Geant4 v9.4 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
14 User Documents and Examples I SLAC Geant4 Tutorial 3 November 2009 Dennis Wright Geant4 V9.2.p02.
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
14 Overview of Geant4 Examples 2 nd Finnish Geant4 Workshop 6-7 June 2005 Dennis Wright (SLAC)
Makoto Asai (SLAC) Geant4 Tutorial Course
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
14 User Documents and Examples II SLAC Geant4 Tutorial 17 May 2007 Dennis Wright Geant4 V8.3.
Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Japan.
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.
SMRD April 2007 Status of the atmospheric muon studies Piotr Mijakowski OUTLINE: Primary muon spectrum at the sea level Primary muon.
14 Overview of Geant4 Examples Geant4 Tutorial 8-10 March 2004 Dennis Wright (SLAC)
Gamma calorimeter for R3B: first simulation results INDEX ● The calGamma Geant4 simulation ( a short introduction ) ● Crystal and geometry selection: –
R 3 B Gamma Calorimeter Agenda. ● Introduction ● Short presentation on the first ● Task definition for R&D period ( )
Primary particle Geant4 tutorial Paris, 4-8 June 2007 Giovanni Santin ESA / ESTEC Rhea System SA With material from previous tutorials by Makoto Asai.
User Documents and Examples I Sébastien Incerti Slides thanks to Dennis Wrigth, SLAC.
SuperNEMO Simulations Darren Price University of Manchester July, 2005.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Physics I: Physics Lists Geant4 Tutorial at Jefferson Lab 10 July 2012 Dennis Wright (SLAC) Geant4 9.6 beta.
Pedro Arce Introducción a GEANT4 1 GAMOS tutorial Plug-in’s Exercises Pedro Arce Dubois CIEMAT
1 Primary particles Geant4 User's Tutorial CERN, February 2010 Talk from previous tutorial by Giovanni Santin Ecole Geant4, Annecy 2008.
User Documents and Examples II Geant4 Tutorial at Marshall Space Flight Center 18 April 2012 Dennis Wright (SLAC) Geant4 V9.5.
Normalisation modelling sources Geant4 tutorial Paris, 4-8 June 2007 Giovanni Santin ESA / ESTEC Rhea System SA.
Source Specifications in MCNP
S. Guatelli, M.G Pia, INFN Genova G. Cosmo, S. Guatelli, M.G Pia Salamanca, July 2002
Primary particle Giovanni Santin ESA / ESTEC and RheaTech Ltd On behalf of the Geant4 collaboration Ecole Geant4 Annecy, and Nov 2008 With.
Geant4 Event Biasing Marc Verderi, LLR (Heavily copied from Jane Tinslay, SLAC) June 2007.
6th April 2005Wah-kai Ngai1 First Example in Geant4 3rd HK simulation group meeting.
Monte Carlo /12/07. What is Geant ? Monte Carlo simulation tool for nuclear and particle physics Set up detectors –Sensitive detector which returns.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Alex Howard - Event Biasing Geant4 Users - Lisbon Event biasing and Variance Reduction - Geometrical Alex Howard, CERN Geant4 Users Workshop, Lisbon.
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.
Anne Dabrowski 26 February Semileptonic Analysis from Low Intensity Run Anne Dabrowski Northwestern University NA48 Collaboration Meeting 26 February.
Beam MC activity A.K.Ichikawa for beam group For more details,
G4GeneralParticleSource Class: Developed by ESA as the space radiation environment is often quite complex in energy and angular distribution, and requires.
Cosmic rays at sea level. There is in nearby interstellar space a flux of particles—mostly protons and atomic nuclei— travelling at almost the speed of.
Alex Howard, ETH, Zurich 13 th September 2012, 17 th Collaboration Meeting, Chartres 1 Geometrical Event Biasing Facility Alex Howard ETH, Zurich Geometrical.
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.
Towards comparisons between TFluka and TGeant3 ( within CbmRoot Framework) Denis Bertini (IT-GSI) Antonin Maire (IPHC Strasbourg)
STAR STAR MC Filter V. Perevoztchikov Brookhaven National Laboratory,USA.
Workshop On Nuclear Data for Advanced Reactor Technologies, ICTP , A. Borella1 Monte Carlo methods.
Makoto Asai (SLAC) Getting Started MGP: added class diagram of basic user application.
Physics I: Physics Lists Puebla Geant4 Tutorial 15 June 2010 Dennis Wright Geant4 V9.3.p01.
Geant4 Training 2003 Primary Particle Generation The full set of lecture notes of this Geant4 Course is available at
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
STAR Simulation. Status and plans V. Perevoztchikov Brookhaven National Laboratory,USA.
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
A Short Course on Geant4 Simulation Toolkit Introduction
GAMOS tutorial Shielding Exercises
User Documents and Examples I
Introduction Goal: Can we reconstruct the energy depositions of the proton in the brain if we are able to reconstruct the photons produced during this.
(CMS GEANT4 simulation)
Primary Particle Generation
Primary Particle Generation
Use of Geant4 in experiment interactive frameworks AliRoot
G4GeneralParticleSource Class:
GAMOS tutorial Plug-in’s Exercises
Primary particle Makoto Asai (SLAC Computing Services)
Presentation transcript:

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

G4VUserPrimaryGeneratorAction This is one of the three mandatory classes which user must implement in the code. – The others are G4VUserDetectorConstruction and G4VUserPhysicsList – Geant4 is a toolkit, so that the main() should be also prepared by user Control the generation of primary particles – Primaries particles are initial particles of each event. they will be transported in the Geometry. 290AMeV Carbon beam Cosmic ray particles bombarding space craft All secondary particles which produced by a 7TeV cms proton- proton collision Geant4 V9.42Geant4 Tutorial at Texas A&M 11-Jan-2011

G4VUserPrimaryGeneratorAction Cont. One or more concrete class of G4VPrimaryGenerator (primary generator) should be member of this class. This class itself should NOT generate primaries but invoke GeneratePrimaryVertex() method of the concrete class to generate primaries. In the Constructor – Instantiate primary generator(s) – Set default values to it(them) In the GeneratePrimaries() method – Randomize particle-by-particle (event-by-event) value(s) Posisiton and momentum of particle Type of particle – Set these values to primary generator(s) – Invoke GeneratePrimaryVertex() method of primary generator(s) Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan-20113

Example of UserPrimaryGeneratorAction Constructor GeneratePrimaryVertex() Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan PrimaryGeneratorAction::PrimaryGeneratorAction( DetectorConstruction* DC) :Detector(DC),rndmFlag("off") { G4int n_particle = 1; particleGun = new G4ParticleGun(n_particle); //create a messenger for this class gunMessenger = new PrimaryGeneratorMessenger(this); // default particle kinematic G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); G4String particleName; G4ParticleDefinition* particle = particleTable->FindParticle(particleName="e-"); particleGun->SetParticleDefinition(particle); particleGun- >SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.)); particleGun->SetParticleEnergy(50.*MeV); G4double position = -0.5*(Detector->GetWorldSizeX()); particleGun- >SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm)); } void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { //this function is called at the begining of event // G4double x0 = -0.5*(Detector->GetWorldSizeX()); G4double y0 = 0.*cm, z0 = 0.*cm; if (rndmFlag == "on") {y0 = (Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5); z0 = (Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5); } particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0)); particleGun->GeneratePrimaryVertex(anEvent); }

Primary particle and Primary vertex G4PrimaryVertex and G4PrimaryParticle classes – These classes don’t have any dependency to G4ParticleDefinition nor G4Track. – Usually create in concrete class of G4VPrimaryGenerator G4PrimaryVertex object has one or more G4PrimaryParticle objects as primary particle. These are stored in G4Event in advance to processing an event. Primary Vertex – Capability of bookkeeping decay chains Pre-assigned decay products (See in appendix) Primary particles may not necessarily be particles which can be tracked by Geant4. Geant4 provides some concrete class of G4VPrimaryGenerator. – G4ParticleGun – G4GeneralParticleSource – G4HEPEvtInterface, G4HEPMCInterface (See in appendix) Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan-20115

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 set methods are available – Intercoms commands are also available for setting initial values One of most frequently asked questions is : – I want “particle shotgun”, “particle machinegun”, etc. Instead of implementing such a fancy weapon, in your implementation of UserPrimaryGeneratorAction, you can – Shoot random numbers in arbitrary distribution – Use 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 Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan-20116

How to use ParticleGun Constructor GeneratePrimaryVertex() Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan PrimaryGeneratorAction::PrimaryGeneratorAction( DetectorConstruction* DC) :Detector(DC),rndmFlag("off") { G4int n_particle = 1; particleGun = new G4ParticleGun(n_particle); //create a messenger for this class gunMessenger = new PrimaryGeneratorMessenger(this); // default particle kinematic G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); G4String particleName; G4ParticleDefinition* particle = particleTable->FindParticle(particleName="e-"); particleGun->SetParticleDefinition(particle); particleGun- >SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.)); particleGun->SetParticleEnergy(50.*MeV); G4double position = -0.5*(Detector->GetWorldSizeX()); particleGun- >SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm)); } void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { //this function is called at the begining of event // G4double x0 = -0.5*(Detector->GetWorldSizeX()); G4double y0 = 0.*cm, z0 = 0.*cm; if (rndmFlag == "on") {y0 = (Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5); z0 = (Detector->GetCalorSizeYZ())*(G4UniformRand()-0.5); } particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0)); particleGun->GeneratePrimaryVertex(anEvent); }

G4GeneralParticleSource Concrete implementations of G4VPrimaryGenerator Primary vertex can be randomly chosen on the surface of a certain volume. Momentum direction and kinetic energy of the primary particle can also be randomized. Distribution could be set by UI commands. Capability of event biasing (variance reduction). – By enhancing particle type, distribution of vertex point, energy and/or direction Detailed description – Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan-20118

Example of primary particle generation through G4GeneralParticleSource Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan Spherical surface, isotropic radiation, black-body energy Square plane, cosine-law direction, linear energy

Example of primary particle generation through G4GeneralParticleSource Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan Spherical volume with z biasing, isotropic radiation with theta and phi biasing, integral arbitrary point-wise energy distribution with linear interpolation. Cylindrical surface, cosine-law radiation, Cosmic diffuse energy

How to use G4GeneralParticleSource User PrimaryGeneratorAction MyPrimaryGeneratorAction::MyPrim aryGeneratorAction() { generator = new G4GeneralParticleSource; } void MyPrimaryGeneratorAction::Generat ePrimaries(G4Event* anEvent) { generator- >GeneratePrimaryVertex(anEvent); } Command lime /control/verbose 0 /tracking/verbose 0 /event/verbose 0 /gps/verbose 2 /gps/particle gamma /gps/pos/type Plane /gps/pos/shape Square /gps/pos/centre cm /gps/pos/halfx 2 cm /gps/pos/halfy 2 cm /gps/ang/type cos /gps/ene/type Lin /gps/ene/min 2 MeV /gps/ene/max 10 MeV /gps/ene/gradient 1 /gps/ene/intercept 1 /run/beamOn The above macro defines a planar source, square in shape, 4 cm by 4 cm and centred at (1,2,1) cms. By default the normal of this plane is the z-axis. The angular distribution is to follow the cosine-law. The energy spectrum is linear, with gradient and intercept equal to 1, and extends from 2 to 10 MeV. 10,000 primaries are to be generated. Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan

G4ParticleGun vs. G4GeneralParticleSource Particle Gun – Simple and naïve – Shoot one track at a time You can shoot more than one tracks within an event. – Easy to handle. Use set methods to alternate track-by-track or event-by- event values. General Particle Source – Powerful – Controlled by UI commands. Almost impossible to control through set methods – Capability of shooting particles from a surface of a volume. – Capability of randomizing kinetic energy, position and/or direction following a user-specified distribution (histogram). Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan If you need to shoot primary particles from a surface of a complicated volume, either outward or inward, GPS is the choice. If you need a complicated distribution, GPS is the choice. Otherwise, use Particle Gun.

What to do and where to do In the constructor of your UserPrimaryGeneratorAction – Instantiate G4ParticleGun – Set default values by set methods of G4ParticleGun Particle type, kinetic energy, position and direction In your macro file or from your interactive terminal session – Set values for a run Particle type, kinetic energy, position and direction In the GeneratePrimaries() method of your UserPrimaryGeneratorAction – Shoot random number(s) and prepare track-by-track or event-by-event values Kinetic energy, position and direction – Use set methods of G4ParticleGun to set such values – Then invoke GeneratePrimaryVertex() method of G4ParticleGun – If you need more than one primary tracks per event, loop over randomization and GeneratePrimaryVertex(). examples/extended/analysis/A01/src/A01PrimaryGeneratorAction.cc is a good example to start with. – Also, new example to demonstrate how to use ParticleGun to alternate most of the GPS functionalities is to be included in Geant Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan

Summary UserPrimaryActionGenerator – User's mandatory action class for primary vertex/particle generation. – have one or more G4VPrimaryGenerator concrete classes – set/change properties of generator(s) Primary Particle – This class represents a primary particle Primary Vertex – This class has one or more G4PrimaryParticle objects as primary particles. PrimaryGenerator – This class set Primary Vertex to G4Event object G4ParticleGun and G4GeneralParticleSource – Concrete class of G4VPrimaryGenerator Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan

Appendix Pre-assigned decay products Interfaces to HEPEvt and HepMC Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan

Pre-assigned decay products Physics generator can assign a decay channel for each individual particle separately, while in Geant4 you cannot specify a decay channel for each particle. – Decay chain can be “pre-assigned”. A parent particle in the form of G4Track object travels in the detector, bringing “pre-assigned” decay daughters as objects of G4DynamicParticle. – When the parent track comes to the decay point, pre-assigned daughters become to secondary tracks, instead of randomly selecting a decay channel defined to the particle type. Decay time of the parent can be pre-assigned as well. Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan Geant4 Tutorial at Texas A&M 11-Jan D0D0 --  K-K- ++  B-B- G4PrimaryParticle B-B- G4Track D0D0 --  K-K- ++  pre-assigned decay products K-K- ++  D0D0 --  B-B- K-K- ++  D0D0

Interfaces to HEPEvt and HepMC Concrete implementations of G4VPrimaryGenerator – A good example for experiment-specific primary generator implementation G4HEPEvtInterface – Suitable to /HEPEVT/ common block, which many of (FORTRAN) HEP physics generators are compliant to. – ASCII file input G4HepMCInterface – An interface to HepMC class, which a few new (C++) HEP physics generators are compliant to. – ASCII file input or direct linking to a generator through HepMC. Geant4 V9.4Geant4 Tutorial at Texas A&M 11-Jan