Home

BDSIM User's Manual v0.4

image

Contents

1. 0 02 cece eee eee eee 29 A 2 3 Defining a Mokka element in the gmad file 30 ALS Edmund tale eed ages EIU TATE es 30 Appendix B Field description formats 30 Appendix C Bunch description formats 30 Appendix D Known Issues 31 B References veste ime eo p tnu 32 11 Chapter 2 Obtaining Installing and Running 1 BDSIM v0 4 User s Manual This file is updated automatically from manual texi last updated on Feb 19 2008 1 About BDSIM BDSIM is a Geant4 Geant page 32 extension toolkit for simulation of particle transport in accelerator beamlines It provides a collection of classes representing typical accelerator components a collection of physics processes for fast tracking procedures of on the fly geometry construction and interfacing to ROOT analysis Root page 32 2 Obtaining Installing and Running BDSIM can be downloaded from http ilc pp rhul ac uk bdsim html This site also contains some information on planned releases and other issues Alternatively a develop ment version is accessible under http cvs pp rhul ac uk Download the tarball and extract the source code Make sure Geant4 is installed and appropriate environment vari ables defined Then go through the configuration procedure by running the configure script configure It will create a Makefile from template defined in Makefile in You may want to edit the Makefile manually to meet yo
2. A custom distribution file format can be specified in the form distrType fieldi uniti fieldi1 uniti The allowed values for fields units are For instance 12 see src BDSBunch cc for more details Chapter 8 References 31 beam particle e energy ener GeV distrType pt 1 E GeV xp rad yp rad z mum x nm y nm distrFile bunches beam dat Appendix D Known Issues A bug is present where a sampler attached to a bending magnet RBend SBend will cause the magnetic field to fail to be set The reference frame rotates correctly but the particle trajectory does not follow To work around this issue samplers should be attached to a marker rather than directly to the magnet For example dip sbend l 1 m angle 0 1 temp line dip use period temp sample range dip should be replaced by dip sbend l 1 m angle 0 1 dipMark marker temp line dipMark dip use period temp sample range dipMark Samplers attached to multiple instances of the same element incorrectly register hits only from the first instance in all such samplers For example drifti drift l 1 m mark1 marker linei line mark1 drift1 mark1 drift1 sample range mark1 1 sample range mark1 2 will incorrectly record hits at mark1 1 in the sampler attached to mark1 2 To avoid this samplers should be attached to uniquely named elements There is a known issue with ROOT output using ROOT versions hi
3. Bunch description formats page 30 3 4 3 sample and csample To record the tracking results one uses the sample and csample commands To insert a sampling plane before element the following command should be used sample range lt element gt Example sample range d To put a cylindrical sampler of length 10 in m around element element at distance r0 in m the following command should be used csample range lt element gt r r0 1 10 Samplers output the following parameters at the specified location E Energy GeV EO Energy at last scatter Gev X Global X position S path length Y Global Y position t time of flight Z Global Z position t0 time of flight at last scatter Xp Global angle in x z trackID trackID of particle Yp Global angle in y z weight weight of track Zp 1 sqrt Xp Yp parentIDtrackID of parent particle x Relative x position x0 x at last scatter y Relative y position y0 y at last scatter Z Relative z position 20 z at last scatter xp Relative angle in x z xp0 xp at last scatter yp Relative angle in y z yp0 yp at last scatter Zp 1 sqrt xp yp zp0 xp at last scatter nEvent Event number partID PDG particle identifier 3 4 4 dump Used in conjuction with option fifo lt filename gt to output the bunch distribution at a given point If the specified output file is a fifo the distribution can be modified by an external program before being piped back in to continue tracking This is useful
4. LENGTHZ Variable type DOUBLE 10 3 These are required parameters There values will be used to specify the box s dimen sions A 2 1 3 Trapezoid Solid Types Append TRAP to the table name in order to make use of the G4Trd solid type which is deined as a trapezoid with the X and Y dimensions varying along z functions The following table parameters are specific to the trapezoid solid LENGTHXPLUS Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the x extent of the box s dimensions at the surface positioned at dz LENGTHXPMINUS Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the x extent of the box s dimensions at the surface positioned at dz LENGTHYPLUS Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the y extent of the box s dimensions at the surface positioned at dz LENGTHYPMINUS Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the y extent of the box s dimensions at the surface positioned at dz LENGTHZ Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the z extent of the box s dimensions Appendix A Geometry description formats 27 A 2 1 4 Cone Solid Types Append _CONE to the table name in order to make use of the G4Cons solid type The following table parameters are s
5. knl 0 0 1 ksl 0 0 0 Note that both kn1 and ks1 are required and must contain the same number of param eters 3 3 11 rf rf defines an rf cavity Attributes e 1 length m default 0 e gradient field gradient MV m Chapter 3 Lattice description 9 e material the cavity material default set to Iron Example rfi rf l 5 m gradient 10 MV m 3 3 12 rcol rcol defines a rectangular collimator the aperture is a rectangle the external profile in the transverse plane is a square The longitudinal collimator structure is not taken into account To do this the user has to describe the collimator with the generic type element Attributes e 1 length m default 0 e xsize horisontal aperture m default set to boxSize e ysize vertical aperture m default set to boxSize e outR external extent m in x and y of the collimator default set to boxSize e material collimator material default set to Graphite Example coli rcol 1 0 4 m xsize 2 mm ysize i mm material W 3 3 13 ecol ecol defines an elliptical collimator the aperture is an ellipse the external profile in the transverse plane is a square Here again the longitudinal collimator structure is not taken into account Attributes 1 length m default 0 e xsize horisontal aperture m default set to boxSize e ysize vertical aperture m default set to boxSize e outR limits external exte
6. 1 hadronic standard standard electromagnetic fission neutron capture neutron and proton elastic and inelastic scattering By default the standard physics List is used 5 2 Transportation The transportation follows the scheme the step length is selected which is defined either by the distance of the particle to the boundary of the logical volume it is currently in which could be e g field boundary material boundary or boundary between two adjacent elements or by the mean free path of the activated processes Then the particle is pushed to the new position and secondaries are generated if necessary Each volume has an associated Chapter 7 Implementation Notes 20 transportation algorithm For an on energy particle travelling close to the optical axis of a quadrupole dipole or a drift standard matrix transportation algorithms are used Course page 32 For multipoles of higher orders and for off axis energy particles Runge Kutta methods are used 5 3 Tracking accuracy The following options influence the tracking accuracy chordStepMinimum minimum chord length for the step deltaIntersection determines the precision of locating the point of intersection of the particle trajectory with the boundary and hence the error in the path length in each volume This may influence the results especially in the case when EM fields are present deltaChord lengthSafety all volumes will have an additional overlap of this length threshol
7. 13 3 3 25 Material table 0 cece cee ete eee 14 3 4 Run control and output 0 c eee eee eee 14 OAT O Anea heels una UM Eel NS AG i ee 14 3 4 2 RN 15 3 43 sample and csample cee cece eee eee 17 IAA CUM pis a aa big weed Ba SR as eda EG hte eye ob deren 17 GAO WSO 25 date o eet bc SUMI PATIOR DON 18 AY VistialiZation AAA AGA 18 0 JPBHySICS ra AA BIS TS 19 5 1 physicsList Options cene o Aa 19 0 2 Transportation tana as Dyer HER 19 5 3 Tracking accuracy 0 eee hn 20 6 Output Analysis ui aa 20 7 Implementation Notes 20 Tol ArGl tecture A Cv SR Ree bt a done ees 20 7 2 Features to be added in next releases oooooooooooooo o 21 Appendix A Geometry description formats 21 Ad MAC domat hs ese eonte ertt tea Eres ipe inert evan remate 21 A 2 mokka areka ron ORI DU AS REMISE NP d EUR 22 A 2 1 Describing the geometry 0 000 cece ee eee 22 A 2 1 1 Common Table ParameterS oooooooooooooo 23 A 2 1 2 Box Solid Types 0 0 c ee eee eee teens 26 A 2 1 3 Trapezoid Solid Types 0 00 cece eee ee 26 A 2 1 4 Cone Solid Types 0 0 c cece cece eens 27 A 2 1 5 Torus Solid Types 02 cece eee e eee eee 27 A 2 1 6 Polycone Solid Types 0 000 cece eee eee 28 A 2 1 7 Elliptical Cone Solid Types 0000 29 A 2 2 Creating a geometry list
8. A mass number g mol e symbol atom symbol Then the compound material can be specified in two manners 1 If the number of atoms of each component in material unit is known the following syntax can be used 5 In this case in src BDSDetectorConstruction cc the BDSMaterials AddMaterial name Z A density method is called which in turns src BDSMaterials cc invokes the Geant4 G4Material constructor G4Material name Z A density 6 In this case in src BDSDetectorConstruction cc the BDSMaterials AddElement name symbol Z A method is called which in turns src BDSMaterials cc invokes the Geant4 G4Element constructor G4Element name symbol Z A In this case in src BDSDetectorConstruction cc the BDSMaterials AddMaterial name density state temp pressure list lt char gt itsComponents list lt G4int gt itsComponentsWeights method is called which in turns src BDSMaterials cc invokes the Geant4 G4Material constructor G4Material name density G4int itsComponents size state temp pressure Then each component is added with a call to the G4Material AddElement G4string G4int method Chapter 3 Lattice description lt material gt matdef density lt double gt T lt double gt P lt double gt state lt char gt components lt list lt charx gt gt componentsWeights lt list lt int gt gt Attributes e density density in g cm e T temperature in K default set to 300 e P pressur
9. etc can be accessed by putting square brackets after the element name e g x d 1 See Appendix D Known Issues page 31 Chapter 3 Lattice description 14 3 3 25 Material table There is a set of predefined materials for use in elements such as collimators e g Air LiquidHelium Aluminium NbTi BeamGasPlugMat Niobium Beryllium Silicon CarbonMonoxide SmCo CarbonSteel Soil Concrete Titanium Copper Titanium Alloy Graphite Tungsten Invar Vacuum Iron Vanadium LaserVac Water Lead WeightIron Lead Tungstate Currently Air CarbonMonoxide and Vacuum are gas at T 300K p 107 bar both Air and Vacuum are a N 80 0 20 mixture CarbonMonoxide is composed of CO molecules There are also predefined elements i e atoms that can be used for building composite materials H He Be nu UN gu Al Si p S Ca ppt yn Mn Fe Co Ni Cu Nb Sm yw Pb For more details see the file src BDSMaterials cc or run the command bdsim materials from the command line 3 4 Run control and output The execution control is performed in the GMAD input file through option and sample commands How the results are recorded is controlledby the sample command When the visualization is turned on it is also contr
10. file which is then passes to bdsim via the file command line option for example bdsim file line gmad output root batch The next section describes how to do it in more detail 3 Lattice description The beamline beam properties and physics processes are specified in the input file written in the GMAD language which is a variation of MAD X language MAD page 32 extended to handle sophisticated geometry and parameters relevant to radiation transport GMAD is described in this section Examples of input files can be found in the BDSIM distribution in the examples directory In order to convert a MAD file into a GMAD one a utility called mad2gmad sh is provided in the utils directory The following MAD commands are not supported e assign e bmpm e btrns e envelope e optics e title e option e plot e print e return e survey e title The following MAD commands e moni e monitor e wire e prof are replaced with the marker command 1 To dump the optical properties of the lattice one can invoke bdsim with the outline file txt outline type optics options 2 To compute the coordinates of all machine elements in a global reference system one can invoke bdsim with the outline file txt outline type survey options Chapter 3 Lattice description 3 3 1 Program structure A GMAD program consists of a sequence of element definitions and control commands For example tracking a 1 GeV electron beam thro
11. make sure that there is no overlap between them A 2 mokka As well as using the gmad format to describe user defined physical geometry it is also possible to use a Mokka style format This format is currently in the form of a dumped MySQL database format although future versions of BDSIM will also support online querying of MySQL databases Note that throughout any of the Mokka files a may be used to represent a commented line There are three key stages which are detailed in the following sections that are required to setting up the Mokka geometry e Describing the geometry e Creating a geometry list e Defining a Mokka Element to load geometry descriptions from a list A 2 1 Describing the geometry An object must be described by creating a MySQL file containing commands that would typically be used for uploading creating a database and a corresponding new table into a MySQL database BDSIM supports only a few such commands specifically the CREATE TABLE and INSERT INTO commands When writing a table to describe a solid there are some parameters that are common to all solid types such as NAME and MATERIAL and some that are more specific such as those relating to radii for cone objects A full list of the standard and specific table parameters as well as some basic examples are given below with each solid type All files containing geometry descriptions must have the following database creation commands at the top of the file DR
12. 3 25 INSERT INTO mytable BOX VALUES a box vacuum 50 0 50 0 50 0 0 0 0 0 0 0 0 0 0 0 0 0 INSERT INTO mytable BOX VALUES another box iron 10 0 150 0 50 0 1000 0 0 0 500 0 0 0 0 0 0 0 Further examples of the Mokka geometry implementation can be found in the exam ples Mokka General directory See the common table parameters and solid type sections below for more information on the table parameters available for use A 2 1 1 Common Table Parameters The following is a list of table parameters that are common to all solid types either as an optional or mandatory parameter Appendix A Geometry description formats 24 e NAME Variable type VARCHAR 32 This is an optional parameter If supplied then the Geant4 Logical Volume associated with the solid will be labelled with this name The default is set to be the table s name plus an automatically assigned volume number e MATERIAL Variable type VARCHAR 32 This is an optional parameter If supplied then the volume will be created with this material type note that the material must be given as a character string inside double quotation marks The default material is set as Vacuum e PARENTNAME Variable type VARCHAR 32 This is an optional parameter If supplied then the volume will be placed as a daughter volume to the object with ID equal to PARENTNAME The default parent is set to be the Component Volume Note that if PARENTID is set to the Com
13. BDSIM User s Manual v0 4 I Agapov S Malton revision 0 4 last updated Feb 19 2008 Table of Contents BDSIM v0 4 User s Manual 1 1 About BDSINL id nd t RR 1 2 Obtaining Installing and Running 1 3 Lattice descriptioN o 2 34 Program struct pi A a 3 3 2 Arithmetical expressions 0 0c cece ee eee rrenen 3 3 3 Physical elements and Entities 0 0 00 e eee eee eee 4 3 3 1 Coordinate system 0 cece ce tee een eee 5 332 UB ente A A EA p 5 91919 Hat KeE AAA urhe OE ebur Be ad tenis 5 0 94 TAPE acrid A ER his Pad Bh re LE os Bee de 6 Didi A PELLIT bee NU RUM te RP EP RM 6 DIO DO di VERTU ERE EC RU 6 Didi quadr pole c us cpi Rer n dE ER NE REM 7 3 9 9 SOX DUPOL e ii tad d 7 3 59 OCEUPOLE iia A A ba A Ka e 8 BOAO AA E eua 8 Bisel et eee EN 8 9 912 NCO ee Hin ie eio em CL RS ANH oe Se te eee te Utd 9 9 9 19 ecol iberk dr tne DUIS 9 3 9 14 solenoid 2 1 beak No a Me ge 9 3 3 15 hkick and VkliCk orina ee boe pU A 9 3 9 10 transform3d niega ve bow eHebE Ip hes Lae eee Me 10 SO LG element soe RELEASE RARE 10 Sid LS linesinl2icidcesslgR ba X RR ba RA RAPERE ERR 10 9 9 19 diatdefcocc uper uua e EYE e ek I 2 920 A ej wise tel rc RU e 13 SUAM IE PER 13 3 3 22 spec keyword 00 cece cece ee eee eh 13 3 3 23 Element number aeia a a e eee eene 13 3 3 24 Element attributes 0 0 00 ee eee ee eee
14. Materials cc invokes the Geant4 G4Material constructor G4Material name density G4int itsComponents size state temp pressure Then each component is added with a call to the G4Material AddElement G4string G4double method Chapter 3 Lattice description 13 0 338 0 662 The second syntax can be used also to define materials which are composed by other materials and not by atoms Nb Square brackets are required for the list of element symbols curly brackets for the list of weights or fractions 3 3 20 laser laser defines a drift section with a laser beam inside The laser is considered to be the intersection of the laser beam with the volume of the drift section Attributes e 1 length of the drift section m e x y z components of the laser direction vector e wavelength laser wave length m laserWire laser l 1 um x 1 y 0 z 0 waveLength 532 nm 3 3 21 gas To be implemented in v0 5 3 3 22 spec keyword This has been removed in v0 4 and no longer has an effect For setting the outer radius of a quadrupole use the outR parameter in the same way as for other elements 3 3 23 Element number When several elements with the same name are present in the beamline they can be accessed by their number in the sequence In the next example the sampler is put before the second drift bl line d d d sample range d 2 3 3 24 Element attributes Element attributes such as length multipole coefficients
15. OP DATABASE IF EXISTS DATABASE NAME CREATE DATABASE DATABASE NAME USE DATABASE NAME A table must be created to allow for the insertion of the geometry descriptions A table is created using the following MySQL compliant commands CREATE TABLE TABLE NAME GEOMETRY TYPE TABLE PARAMETER VARIABLE TYPE TABLE PARAMETER VARIABLE TYPE TABLE PARAMETER VARIABLE TYPE 25 Once a table has been created values must be entered into it in order to define the solids and position them The insertion command must appear after the table creation and must the MySQL compliant table insertion command INSERT INTO TABLE NAME GEOMETRY TYPE VALUES valuei value2 char value 225 Appendix A Geometry description formats 23 The values must be inserted in the same order as their corresponding parameter types are described in the table creation Note that ALL length types must be specified in mm and that ALL angles must be in radians An example of two simple boxes with no visual attributes set is shown below The first box is a simple vacuum cube whilst the second is an iron box with length x 10mm length y 150mm length z 50mm positioned at x 1m y 0 z 0 5m and with zero rotation CREATE TABLE mytable BOX NAME VARCHAR 32 MATERIAL VARCHAR 32 LENGTHX DOUBLE 10 3 LENGTHY DOUBLE 10 3 LENGTHZ DOUBLE 10 3 POSX DOUBLE 10 3 POSY DOUBLE 10 3 POSZ DOUBLE 10 3 ROTPSI DOUBLE 10 3 ROTTHETA DOUBLE 10 3 ROTPHI DOUBLE 10
16. as beampipe radius outR external radius m of magnet default set to aper 22cm material the magnet material default set to Iron Chapter 3 Lattice description 8 Example Sf sextupole 1 0 5 m k2 0 5 tilt 0 01 3 3 9 octupole octupole defines an octupole Attributes e 1 length m default 0 e k3 normal octupole coefficient k3 1 Bp d B da m Positive k3 means ho risontal focusing of positively charged particles default 0 e ks3 skew octupole coefficient ks3 1 Bp d B da m where x y is now a co ordinate system rotated by 30 degrees around s with respect to the normal one default 0 e tilt roll angle rad about the longitudinal axis clockwise e outR external radius m of magnet default set to aper 22cm e material the magnet material default set to Iron Example of octupole 1 0 5 m k3 0 5 tilt 0 01 3 3 10 multipole multipole defines a multipole Attributes e 1 length m default 0 e knl normal multipole knl n 1 Bp d B dx m e ksl skew multipole ksln 1 Bp d B dx m D where x y is now a coor dinate system rotated by 30 degrees around s with respect to the normal one default 0 e tilt roll angle rad about the longitudinal axis clockwise e outR external radius m of magnet default set to aper 22cm e material the magnet material default set to Iron Example mul multipole 1 0 5 m
17. ch can usually be overridden with the outR option An already defined element can be used as a new element type The child element will have the attributes of the parent Chapter 3 Lattice description q quadrupole l 1 m k1 0 1 qq q k1 0 2 3 3 1 Coordinate system The usual accelerator coordinate system is assumed see MAD page 32 3 3 2 Units In GMAD the SI units are used length time angle quadrupole coefficient multipole coefficient 2n poles electric voltage electric field strength particle energy particle mass particle momentum beam current particle charge emittances density temperature pressure mass number m metres s seconds rad radians ni m MV Megavolts MV m GeV GeV c GeV c A Amperes e elementary charges pi m mrad g cm K Kelvin atm atmosphere g mol There are some predefined numerical values are pi 3 14159265358979 GeV 1 eV 107 KeV 1078 MeV 10 3 TeV 10 MV 1 Tesla 1 rad 1 mrad 1073 clight 2 99792458 x 108 m 1 cm 107 mm 10 3 um 10 6 nm 10 9 S 1 ms 107 us 1076 ns 107 for example one can write either 100 eV or 0 1 KeV when energy constants are con cerned 4 see add var in parser gmad cc Chapter 3 Lattice description 6 3 3 3 marker marker has no effect no volume is associated to it but allows one to identify a position in the beam line say where a sample
18. dCutCharged energy below which charged particles are not tracked thresholdCutPhotons energy below which photons are not tracked 6 Output Analysis During the execution the following things are recorded e energy deposition along the beamline e sampler hits If the output format is ASCII i e if BDSIM was invoked with the output ascii option then the output file output txt containing the hits will be written which has rows like hits PDGtype p GeV c x micron y micron z m x nicrorad y nicrorad 11 250 4 72907 5 86656 5 00001e 06 0 0 11 250 8 17576 4 99729 796 001 0 320334 0 126792 If ROOT output is used then the root files output_0 root output_1 root etc will be created with each file containing the number of events given by nperfile option The file contains the energy loss histogram and a tree for every sampler in the line with self explanatory branch names 7 Implementation Notes 7 1 Architecture In this section the architecture of BDSIM is briefly described for someone wishing to use it as a class library BDSMultipole gmad Physics list adding own physics processes Appendix A Geometry description formats 21 7 2 Features to be added in next releases Current development is focused on the beam gas scattering and neutron transport Appendix A Geometry description formats The element with user defined physical geometry is defined by lt element_name gt element geometry format filename attribut
19. e in atm default set to 1 e state solid liquid or gas default set to solid e components list of symbols for material components e componentsWeights number of atoms of each component in material unit in order Example niobium atom symbol Nb z 41 a 92 906 titanium atom symbol Ti z 22 a 47 867 NbTi matdef density 5 6 temperature 4 0 Nb Ti 1 1 2 On the other hand if the mass fraction of each component is known the following syntax can be used material matdef density lt double gt T lt double gt P lt double gt state lt char gt components lt list lt charx gt gt componentsFractions lt list lt double gt gt Attributes e density density in g cm e T temperature in K default set to 300 e P pressure in atm default set to 1 e state solid liquid or gas default set to solid e components list of symbols for material components e componentsFractions mass fraction of each component in material unit in order Example samarium atom symbol Sm z 62 a 150 4 cobalt atom symbol Co z 27 a 58 93 SmCo matdef density 8 4 temperature 300 0 Sm Co 8 In this case in src BDSDetectorConstruction cc the BDSMaterials AddMaterial name density state temp pressure list lt char gt itsComponents list lt G4double gt itsComponentsFractions method is called which in turns src BDS
20. e macro is read from the file named vis mac located in the current directory The name of the file with the macro can also be passed via the vis_mac switch bdsim file line gmad vis_mac my_macro mac Chapter 5 Physics 19 In interactive mode all the Geant4 interactive comamnds are available For instance to fire 100 particles type run beamOn 100 and to end the session type exit To display help menu help For more details see Geant page 32 5 Physics BDSIM can exploit all physics processes that come with Geant4 In addition fast tracking inside multipole magnets is provided More detailed description of the physics is given below 5 1 physicsList option Depending on for what sort of problem BDSIM is used different sorts of physics processes should be turned on This processes are groupes into so called physics lists The physics list is specified by the physicsList option in the input file e g option physicsList em standard Several predefined physics lists are available standard transportation of primary particles only em standard transportation of primary particles ionization bremsstrahlung Cerenkov multiple scattering em low the same but using low energy electromagnetic models em muon the same but using biased muon cross sections lw list for laser wire simulation standard electromagnetic physics and laser wire physics which is Compton Scattering with total cross section renormalized to
21. e start of the component volume Note that if the object is being placed inside another volume using PARENTNAME then the position will refers to the center of the parent object e ROTPSI ROTTHETA ROTPHI Variable type DOUBLE 10 3 These are optional parameters They are the Euler angles in radians used to rotate the obejct before it is placed The default is set to zero for each angle e RED BLUE GREEN Variable type DOUBLE 10 3 These are optional parameters They are the RGB colour components assigned to the object and should be a value between 0 and 1 The default is set to zero for each colour e VISATT Variable type VARCHAR 32 This is an optional parameter This is the visual state setting for the object Setting this to W results in a wireframe displayment of the object S produces a shaded solid and I leaves the object invisible The default is set to be solid Appendix A Geometry description formats 26 FIELDX FIELDY FIELDZ Variable type DOUBLE 10 3 These are optional parameters They can be used to apply a uniform field to any volume with default units of Tesla Note that if there is a solenoid field present throughout the enitre element then this uniform field will act in addition to the solenoid field A 2 1 2 Box Solid Types Append BOX to the table name in order to make use of the G4Box solid type The following table parameters are specific to the box solid LENGTHX LENGTHY
22. es for example colli element geometry gmad colli geo A 1 gmad format gmad is a simple format used as G4geometry wrapper It can be used for specifying more or less simple geometries like collimators Available shapes are Box Tubs 1 xO x origin xO x origin y0 y_origin y0 y_origin z0 z_origin z0 z_origin x xsize rmin inner radius y ysize rmax outer radius z zsize z zsize phi Euler angle for rotation theta Euler angle for rotation psi Euler angle for rotation material MaterialName Cons x0 x_origin y0 y_origin z0 z_origin rmini inner radius at start rmaxi outer radius at start rmin2 inner radius at end rmax2 outer radius at end z zsize material MaterialName phi Euler angle for rotation theta Euler angle for rotation psi Euler angle for rotation phiO angle for start of sector dphi angle swept by sector phi Euler angle for rotation theta Euler angle for rotation psi Euler angle for rotation material MaterialName Trd x0 x_origin y0 y_origin z0 z_origin x1 half length at wider side x2 half length at narrower side yi half length at wider side y2 half length at narrower side Z zsize phi Euler angle for rotation theta Euler angle for rotation psi Euler angle for rotation material MaterialName Appendix A Geometry description formats 22 A file can contain several objects which will be placed sequentially into the volume A user has to
23. for including multi particle effects such as wakefields at given points in the lattice dump range dumpMarker1 option fifo tmp temp dat Output is in the standard Guineapig format with a header line stating the number of particles to be output The file to be read back should be in the same format as this 11 See Appendix D Known Issues page 31 Chapter 4 Visualization 18 3 4 5 use use command selects the beam line for study use period 11 range q1 q2 4 Visualization When BDSIM is invoked in interactive mode the run is controlled by the Geant4 shell A visualization macro should be then provided A simple visualization macro is include with the distribution and is outlined below Invoke the OGLSX driver Create a scene handler and a viewer for the OGLSX driver vis open OGLIX Create an empty scene vis scene create Add detector geometry to the current scene vis scene add volume Attach the current scene handler to the current scene omittable vis sceneHandler attach Add trajectories to the current scene Note This command is not necessary in exampleNOS3 since the C method DrawTrajectory is described in the event action vis viewer set viewpointThetaPhi 90 90 vis drawVolume vis scene add trajectories tracking storeTrajectory 0 vis viewer zoom tracking storeTrajectory 1 for BDS vis viewer zoom 300 vis viewer set viewpointThetaPhi 3 45 By default th
24. g SR photons standard overall production cuts for photons precision production cuts for photons in element standard overall production cuts for electrons precision production cuts for electrons in element standard overall production cuts for positrons precision production cuts for positrons in element The following options influence the generation randomSeed ngenerate Miscellaneous options nperfile nlinesIgnore seed for the random number generator setting to 1 uses the system clock to generate the seed number of primary particles fired when in batch mode number of events recorded per file in ROOT output number of lines to skip when reading bunch files For a more detailed description of how the option influence the tracking see Chapter 5 Physics page 19 3 4 2 beam The parameters related to the beam are set with the beam command Chapter 3 Lattice description 16 beam lt name gt value There is a set of predefined distribution types that can be generated In this case one needs to specify the following parameters e particle particle name e e gamma proton etc e energy particle energy e distrType type of distribution and in addition other parameters that depend on the distribution type that has been chosen 1 Global options XO Offset of distribution centre in x m YO Offset of distribution centre in y m ZO Offset of distribution centre in z m Xp0 Angula
25. gher than 5 10 To use ROOT output BDSIM should be compiled with ROOT version 5 10 or lower There is a known issue with the z parameter output to samplers As particle data is output at the z location of the sampler when the global position is transformed from global to relative coordinates z is identically zero For a description of a particle s longitudinal position in the bunch please use the parameter s instead Chapter 8 References 8 A References Blair G Blair Simulation of the CLIC Beam Delivery System Using BDSIM CLIC Note 509 Root Root User s Guide http root cern ch root doc RootDoc html Geant Geant4 User s Guide http geant4 cern ch support userdocuments shtml MAD MAD X User s Guide http mad home cern ch mad uguide html Course for example Basic course on Accelerator optics by Schmuesser Rossbach CERN Accelerator school
26. l be used to specify the z position of the corresponding z plane of the polycone There should be as many PLANEPOS parameters set as the number of z planes For example 3 z planes will require that PLANEPOS1 PLANEPOS2 and PLANEPOS3 are all set up e RINNER1 RINNER2 RINNERN Variable type DOUBLE 10 3 These are required parameters These values will be used to specify the inner radius of the corresponding z plane of the polycone There should be as many RINNER parameters set as the number of z planes For example 3 z planes will require that RINNER1 RINNER2 and RINNERS are all set up e ROUTER1 ROUTER2 ROUTERN Variable type DOUBLE 10 3 These are required parameters These values will be used to specify the outer radius of the corresponding z plane of the polycone There should be as many ROUTER parameters set as the number of z planes For example 3 z planes will require that ROUTER1 ROUTER2 and ROUTERS are all set up Appendix A Geometry description formats 29 e STARTPHI Variable type DOUBLE 10 3 This is an optional parameter If set then this value will be used to specify the starting angle of the polycone The default value is zero e DELTAPHI Variable type DOUBLE 10 3 This is an optional parameter If set then this value will be used to specify the delta angle of the polycone The default value is 2 PI A 2 1 7 Elliptical Cone Solid Types Append _ELLIPTICALCONE to the table name in orde
27. map 3 3 18 line Elements are grouped into sequences by the line command line name line element 1 element 2 where element_n can be any element or another line Lines can also be reversed using line name line line 2 or within another line by line line_1 line_2 Re versing a line also reverses all nested lines within Example A sequence of FODO cells can be defines as qf quadrupole 1 0 5 k1 0 1 qd quadrupole 1 0 5 k1 0 1 Chapter 3 Lattice description d drift 120 5 fodo line qf d qd d section line fodo fodo fodo beamline line section section section 3 3 19 matdef To define a material the matdef keyword must be used If the material is composed by a single element it can be defined using the following syntax material matdef Z lt int gt A lt double gt density lt double gt T lt double gt P lt double gt state lt char gt Attributes e Z atomic number e A mass number g mol e density density in g cm e T temperature in K default set to 300 e P pressure atm default set to 1 e state solid liquid or gas default set to solid Example iron matdef Z 26 A 55 845 density 7 87 If the material is made up by several components first of all each of them must be specified with the atom keyword element atom Z lt int gt A lt double gt symbol lt char gt Attributes e Z atomic number e
28. mats 25 This is an optional parameter If supplied then the object will be set up to produce the appropriate magnetic field using the supplied K1 or K2 table parameter values Three magnet types are available QUAD SEXT and OCT The default is set to no magnet type Note that if MAGTYPE is set to a value whilst K1 K2 K3 are not set then no magnetic field will be implemented e K1 Variable type DOUBLE 10 3 This is an optional parameter If set to a value other than zero in conjuction with MAGTYPE set to QUAD then a quadrupole field with this K1 value will be set up within the object Default is set to zero e K2 Variable type DOUBLE 10 3 This is an optional parameter If set to a value other than zero in conjuction with MAGTYPE set to SEXT then a sextupole field with this K2 value will be set up within the object Default is set to zero e K3 Variable type DOUBLE 10 3 This is an optional parameter If set to a value other than zero in conjuction with MAGTYPE set to OCT then a sextupole field with this K3 value will be set up within the object Default is set to zero e POSX POSY POSZ Variable type DOUBLE 10 3 These are required parameters They are form the position in mm used to place the object in the component volume POSX and POSY are defined with respect to the center of the component volume and with respect to the component volume s rotation POSZ is defined with respect to th
29. nt m in x and y of the collimator default set to boxSize e material collimator material default set to Graphite Example col2 ecol l 0 4 m xsize 2 mm ysize 1 mm material W 3 3 14 solenoid Not yet implemented 3 3 15 hkick and vkick hkick and vkick are equivalent to a rbend and an rbend rotated by 90 degrees respectively However hkick and vkick do not rotate the frame of reference Chapter 3 Lattice description 10 3 3 16 transform3d An arbitrary 3 dimensional transformation of the coordinate system is done by placing a transform3d element in the beamline Attributes e x lt x offset e y Xy offset e z lt z offset e phi lt phi Euler angle gt e theta lt theta Euler angle gt e psi lt psi Euler angle gt Example rot transform3d psi pi 2 3 3 17 element All the elements are in principle examples of a general type element which can represent an arbitrary geometric entity with arbitrary B field maps Attributes e geometry lt geometry_description gt e bmap lt bmap_description gt e outR limits external extent component box size default set to tunnelRadius 2 Descriptions are of the form format filename where filename is the path to the file with the geometry description and format defines the geometry description format The possible formats are given in Appendix A Geometry page 21 Example qq element geometry mokka qq sql bmap mokka qq b
30. olled through Geant4 command prompt 3 4 1 option Most of the options in bdsim are set up by the command option lt name gt value The following options influence the geometry beampipeRadius default beampipe outer radius m beampipeThickness default beampipe thickness m beampipeMaterial default beampipe material tunnelRadius tunnel Radius m boxSize default accelerator component size m The following options influence the tracking Chapter 3 Lattice description 15 deltaChord deltaIntersection chordStepMinimum lengthSafety minimumEpsilonStep maximumEpsilonStep delta neStep chord finder precision boundary intersection precision minimum step size element overlap safety minimum relative error acceptable in stepping maximum relative error acceptable in stepping set position error acceptable in an integration steps The following options influence the physics physicsList thresholdCutCharged thresholdCutPhotons stopTracks synchRadOn srTrackPhotons srLowX srLowGamE prodCutPhotons prodCutPhotonsP prodCutElectrons prodCutElectronsP prodCutPositrons prodCutPositronsP determines the set of physics processes used charged particle cutoff energy photon cutoff energy if set tracks are terminated after interaction with material and energy deposit recorded turn on Synchrotron Radiation process whether to track the SR photons sets lowest energy of SR to X E_critical lowest energy of propagatin
31. pecific to the cone solid LENGTH Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the z extent of the cone s dimensions RINNERSTART Variable type DOUBLE 10 3 This is an optional parameter If set then this value will be used to specify the inner radius of the start of the cone The default value is zero RINNEREND Variable type DOUBLE 10 3 This is an optional parameter If set then this value will be used to specify the inner radius of the end of the cone The default value is zero ROUTERSTART Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the outer radius of the start of the cone ROUTEREND Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the outer radius of the end of the cone STARTPHI Variable type DOUBLE 10 3 This is an optional parameter If set then this value will be used to specify the starting angle of the cone The default value is zero DELTAPHI Variable type DOUBLE 10 3 This is an optional parameter If set then this value will be used to specify the delta angle of the cone The default value is 2 PI A 2 1 5 Torus Solid Types Append _TORUS to the table name in order to make use of the G4Torus solid type The following table parameters are specific to the torus solid RINNER Variable type DOUBLE 10 3 This is an optional parameter If se
32. ponent Volume then POSZ will be defined with respect to the start of the object Else POSZ will be defined with respect to the center of the parent object e INHERITSTYLE Variable type VARCHAR 32 This is an optional parameter to be used with PARENTNAME If set to SUBTRACT then the instead of placing the volume within the parent volume as an inherited object it will be subtracted from the parent volume in a boolean solid operation The default for this value is set to which sets to the usual mother daughter volume inheritance e ALIGNIN Variable type INTEGER 11 This is an optional parameter If set to 1 then the placement of components will be rotated and translated such that the incoming beamline will pass through the z axis of this object The default is set to 0 e ALIGNOUT Variable type INTEGER 11 This is an optional parameter If set to 1 then the placement of the next beamline component will be rotated and translated such that the outgoing beamline will pass through the z axis of this object The default is set to 0 e SETSENSITIVE Variable type INTEGER 11 This is an optional parameter If set to 1 then the object will be set up to register energy depositions made within it and to also record the z position at which this deposition occurs This information will be saved in the ELoss Histogram if using ROOT output The default is set to 0 e MAGTYPE Variable type VARCHAR 32 Appendix A Geometry description for
33. r offset from nominal axis in x z plane YpO Angular offset from nominal z axis in y z plane ZpO Directional flag Zp0 lt 0 points the particle back up the beamline TO Global time offset s 2 distrType gauss a gaussian in x x y y energy and time with given widths sigmaX RMS of x distribution in m sigmaXp RMS of x distribution in rad sigmaY RMS of y distribution in m sigmaYp RMS of y distribution in rad sigmaE RMS of energy distribution divided by nominal beam kinetic energy sigmaT RMS of time distribution in s 3 distrType eshell a thin elliptic shell in x x and y y with given semiaxes e x e xp y yp e sigmaE 4 distrType ring in the x y plane the particles are uniformly distributed in r and in inside a ring with inner radius Rmin and outer radius Rmax x y and time are exactly XpO YpO and TO respectively for each generated particle The kinetic energy distribution is a gaussian of width sigmaE centered about the nominal beam kinetic energy e Rmin Rmax inner and outer radius in m e sigmaE RMS energy spread GeV Example 10 see src BDSBunch cc for more details Chapter 3 Lattice description 17 beam particle e energy 100 MeV distrType gauss sigmaX 0 01 sigmaXp 0 1 sigmaY 0 01 sigmaYp 0 1 In alternative one can pass to the simulation a file containing a list of particles to be generated For more details see Appendix C
34. r to make use of the G4Ellipticalcone solid type The following table parameters are specific to the elliptical cone solid e XSEMIAXIS Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the Semiaxis in X e YSEMIAXIS Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the Semiaxis in Y e LENGTHZ Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the height of the elliptical cone e ZCUT Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the upper cut plane level Note that the above parameters are used to define an elliptical cone with the following parametric equations in the usual Geant4 way x XSEMIAXIS LENGTHZ u u Cos v Y YSEMIAXIS LENGTHZ u u Sin v z u where v is between 0 and 2 PI and u between 0 and h respectively A 2 2 Creating a geometry list A geometry list is a simple file consisting of a list of filenames that contain geometry descriptions This is the file that should be passed to the GMAD file when defining the mokka element An example of a geometry list containing boxes sql and cones sql would be symbols can be used for commenting out an entire line directory boxes sql directory cones sql Appendix C Bunch description formats A 2 3 Defining a Mokka element in the gmad file The Mokka elemen
35. r will be placed It has no attributes Example mi marker 3 3 4 drift drift defines a straight drift space Its volume contains only the vacuum beampipe no outer iron cylinder Attributes e 1 length m default 0 e aper aperture m default same as beampipeRadius Example d13 drift 1 20 5 m 3 3 5 rbend rbend defines a rectangular bending magnet Attributes 1 length m default 0 e angle bending angle rad default 0 e B magnetic field T e aper aperture m default same as beampipe radius e outR external radius m of magnet default set to aper 22cm e material the magnet material default set to Iron e THE CODE ALSO ALLOWS FOR A QUADRUPOLE FIELD GRADIENT K1 when B is set this defines a magnet with appropriate field strength and angle is not taken into account Otherwise the value of B that corresponds to bending angle angle for a particle in use defined by the beam command with appropriate energy and rest mass is calculated and used in the simulations Example rbi rbend 1 0 5 m angle 0 01 3 3 6 sbend sbend defines a sector bending magnet Attributes e 1 length m default 0 e angle bending angle rad default 0 Ch apter 3 Lattice description T B magnetic field T aper aperture m default same as beampipe radius outR external radius m of magnet default set to aper 22cm material the magnet material default set to I
36. ron THE CODE ALSO ALLOWS FOR A QUADRUPOLE GRADIENT K1 The meaning of B and angle is the same as for rbend Example sbi sbend 1 0 5 m angle 0 01 3 3 7 quadrupole quadrupole defines a quadrupole Attributes 1 length m default 0 k1 normal quadrupole coefficient kl 1 Bp dB dx m Positive k1 means hori zontal focusing of positively charged particles default 0 dB dx is the magnetic field gradient while Bp is the magnetic rigidity Bp T m p GeV 0 299792458 charge e ks1 skew quadrupole coefficient ks1 1 Bp dB dx m where x y is now a co ordinate system rotated by 45 degrees around s with respect to the normal one default 0 tilt roll angle rad about the longitudinal axis clockwise aper aperture m default same as beampipe radius outR external radius m of magnet default set to aper 22cm material the magnet material default set to Iron Example qf quadrupole 1 0 5 m ki 0 5 tilt 0 01 3 3 8 sextupole sextupole defines a sextupole Attributes 1 length m default 0 k2 normal sextupole coefficient k2 1 Bp d B dx m ks2 skew sextupole coefficient ks2 1 Bp d B dz m where x y is now a co ordinate system rotated by 30 degrees around s with respect to the normal one default 0 tilt roll angle rad about the longitudinal axis clockwise aper aperture m default same
37. standard MAD elements but also allows to define ar bitrary geometric entities and magnetic field configurations The geometry description capabilities are extended by using drivers to other geometry description formats which makes interfacing and standardisation easier The syntax of a physical element declaration is element name element type attributes for example qd quadrupole 1 0 1 m k1 0 01 element type can be of basic type or inherited Allowed basic types are e marker e drift e rbend e sbend e quadrupole e sextupole e octupole e multipole e vkick e hkick e rf e rcol e ecol e solenoid e laser e transform3d e element All elements except marker element ecol and rcol are by default modeled with an inner cylindrical beampipe and an outer cylindrical volume FOR MAD COMPATIBILITY sbend SHOULD BE A TORUS The beampipe outer radius and thickness are defined by the global beampipeRadius and beampipeThickness options the beampipe outer radius can be redefined for almost every element with the aper option The beampipe material is defined by the global beampipeMaterial option default Vacuum while the residual gas in the beampipe at the moment cannot be changed by the user and is set to Vacuum The outer volume is represented with the exception of the drift element by a cylinder with inner radius equal to the beampipe outer radius and with outer radius given by default by the global boxSize option whi
38. t can be defined by the following command lt element_name gt element geometry format filename attributes where format must be set to mokka and filename must point to a file that contains a list of files that have the geometry descriptions for example collimator element geometry mokka coll geomlist sql A 3 gdml GDML is a XML schema for detector description GDML will be supported as an external format starting from next release Appendix B Field description formats The element with user defined magnetic field map is defined by the command lt element_name gt element bmap format filename attributes for example colli element bmap XY colli bmap Supported formats are mokka and XY In the latter case a text files must be speci fied where each rows must have the following format x y Bx By Bz Appendix C Bunch description formats For compatibility with other simulation codes following bunch formats can be read For example to use the file distr dat as input the beam definition should look like beam particle e distrType guineapig bunch distrFile distr dat The formats currently supported are listed below e guineapig bunch E GeV x mum y mum z mum x murad y murad e guineapig slac E GeV x rad y rad z mum x nm y nm e guineapig pairs E GeV x rad y rad Z rad x nm y nm z nm here a particle with E gt 0 is assumed to be an electron and with E lt 0 a positron e cain
39. t then this value will be used to specify the inner radius of the torus tube The default value is zero ROUTER Variable type DOUBLE 10 3 Appendix A Geometry description formats 28 This is a required parameter This value will be used to specify the outer radius of the torus tube e RSWEPT Variable type DOUBLE 10 3 This is a required parameter This value will be used to specify the swept radius of the torus It is defined as being the distance from the center of the torus ring to the center of the torus tube For this reason this value should not be set to less than ROUTER e STARTPHI Variable type DOUBLE 10 3 This is an optional parameter If set then this value will be used to specify the starting angle of the torus The default value is zero e DELTAPHI Variable type DOUBLE 10 3 This is an optional parameter If set then this value will be used to specify the delta swept angle of the torus The default value is 2 PI A 2 1 6 Polycone Solid Types Append _POLYCONE to the table name in order to make use of the G4Polycone solid type The following table parameters are specific to the polycone solid e NZPLANES Variable type INTEGER 11 This is a required parameter This value will be used to specify the number of z planes to be used in the polycone This value must be set to greater than 1 e PLANEPOS1 PLANEPOS2 PLANEPOSN Variable type DOUBLE 10 3 These are required parameters These values wil
40. ugh a FODO cell will require a file like this mk marker qf quadrupole 1 0 5x m k1 0 1x m 2 qd quadrupole 1 0 5x m k1 0 1x m 2 d drift 1 0 5x m fodo line qf d qd d mk use period fodo beam particle e energy 1 GeV option beampipeRadius 5 cm beampipeThickness 5 mm sample range mk Generally the user has to define a sequence of elements with drift quadrupole line etc then select the beamline with the use command and specify beam parameters and other options with beam and option commands The sample and csample commands control what sort of information will be recorded during the execution The parser is case sensitive However for convenience of porting lattice descriptions from MAD the keywords can be both lower and upper case The GMAD language is discussed in more detail in this section 3 2 Arithmetical expressions Throughout the program a standard set of arithmetical expressions is available Every expression is ended with a semicolon for example x 1 y 2 5 x z sin x log y 8e5 Available binary operators are Available unary operators are Available boolean operators are gt lt gt lt gt Available functions are e sqrt e cos e sin e exp e log e tan e asin 3 see add func in parser gmad cc Chapter 3 Lattice description 4 e acos e abs 3 3 Physical elements and Entities GMAD implements almost all the
41. ur needs if your CLHEP version is greater than 2 x put DCLHEP_VERSION 9 Then start the compilation by typing make If the compilation is successful the bdsim executable should be created in BD SIM bin S ARCH where BDSIM is the directory specified during configuration and ARCH is of the form OSTYPE COMPILER eg Linux g Next set up the DY LD LIBRARY PATH variable to point to the parser directory and also to the directory where libbdsim so is if building shared libraries BDSIM is invoked by the command bdsim options where the options are file lt filename gt specify the lattice file output fmt output format rootlascii default ascii outfile lt file gt output file name Will be appended with _N where N 0 1 2 3 etc vis mac file visualization macro script default vis mac help display this message verbose display general parameters before run verbose event display information for every event verbose step N display tracking information after each step verbose event num display tracking information for event number N batch batch mode no graphics outline file print geometry optics info to file outline_type lt fmt gt type of outline format Chapter 3 Lattice description 2 where fmt optics survey materials list materials included in bdsim by default To run bdsim one first has to define the beamline geometry in a

Download Pdf Manuals

image

Related Search

Related Contents

Kanex USB3GBIT  Serial Over IP Ethernet Device Server  Manuel d`utilisation  #07288.05 - Smith-Root  Severin KA 4770  Mise m plus Validation des données  Samsung MM-N7 User Manual  ハイエース200系(ディーゼル車)用 取扱説明書  取扱説明書  Aquamaster User Guide Cover  

Copyright © All rights reserved.
Failed to retrieve file