1
% This file was converted to LaTeX by Writer2LaTeX ver. 1.2
2
% see http://writer2latex.sourceforge.net for more info
3
\documentclass[letterpaper]{article}
4
\usepackage[ascii]{inputenc}
5
\usepackage[T1]{fontenc}
6
\usepackage[english]{babel}
8
\usepackage{amssymb,amsfonts,textcomp}
11
\usepackage{supertabular}
14
\hypersetup{pdftex, colorlinks=true, linkcolor=blue, citecolor=blue, filecolor=blue, urlcolor=blue, pdftitle=, pdfauthor=, pdfsubject=, pdfkeywords=}
15
\usepackage[pdftex]{graphicx}
16
\newcommand\textsubscript[1]{\ensuremath{{}_{\text{#1}}}}
18
\setcounter{secnumdepth}{0}
20
\newcommand\arraybslash{\let\\\@arraycr}
23
\newcommand\liststyleLi{%
24
\renewcommand\labelitemi{${\bullet}$}
25
\renewcommand\labelitemii{${\circ}$}
26
\renewcommand\labelitemiii{${\blacksquare}$}
27
\renewcommand\labelitemiv{${\bullet}$}
29
\newcommand\liststyleLii{%
30
\renewcommand\labelitemi{${\bullet}$}
31
\renewcommand\labelitemii{${\circ}$}
32
\renewcommand\labelitemiii{${\blacksquare}$}
33
\renewcommand\labelitemiv{${\bullet}$}
35
\newcommand\liststyleLiii{%
36
\renewcommand\labelitemi{${\bullet}$}
37
\renewcommand\labelitemii{${\circ}$}
38
\renewcommand\labelitemiii{${\blacksquare}$}
39
\renewcommand\labelitemiv{${\bullet}$}
41
\newcommand\liststyleLiv{%
42
\renewcommand\labelitemi{${\bullet}$}
43
\renewcommand\labelitemii{${\circ}$}
44
\renewcommand\labelitemiii{${\blacksquare}$}
45
\renewcommand\labelitemiv{${\bullet}$}
47
\newcommand\liststyleLv{%
48
\renewcommand\labelitemi{${\bullet}$}
49
\renewcommand\labelitemii{${\circ}$}
50
\renewcommand\labelitemiii{${\blacksquare}$}
51
\renewcommand\labelitemiv{${\bullet}$}
53
\newcommand\liststyleLvi{%
54
\renewcommand\labelitemi{${\bullet}$}
55
\renewcommand\labelitemii{${\circ}$}
56
\renewcommand\labelitemiii{${\blacksquare}$}
57
\renewcommand\labelitemiv{${\bullet}$}
59
\newcommand\liststyleLvii{%
60
\renewcommand\labelitemi{${\bullet}$}
61
\renewcommand\labelitemii{${\circ}$}
62
\renewcommand\labelitemiii{${\blacksquare}$}
63
\renewcommand\labelitemiv{${\bullet}$}
65
\newcommand\liststyleLviii{%
66
\renewcommand\labelitemi{{\textbullet}}
67
\renewcommand\labelitemii{${\circ}$}
68
\renewcommand\labelitemiii{${\blacksquare}$}
69
\renewcommand\labelitemiv{{\textbullet}}
71
\newcommand\liststyleLix{%
72
\renewcommand\labelitemi{{\textbullet}}
73
\renewcommand\labelitemii{${\circ}$}
74
\renewcommand\labelitemiii{${\blacksquare}$}
75
\renewcommand\labelitemiv{{\textbullet}}
77
\newcommand\liststyleLx{%
78
\renewcommand\labelitemi{{\textbullet}}
79
\renewcommand\labelitemii{${\circ}$}
80
\renewcommand\labelitemiii{${\blacksquare}$}
81
\renewcommand\labelitemiv{{\textbullet}}
83
\newcommand\liststyleLxi{%
84
\renewcommand\theenumi{\arabic{enumi}}
85
\renewcommand\theenumii{\arabic{enumii}}
86
\renewcommand\theenumiii{\arabic{enumiii}}
87
\renewcommand\theenumiv{\arabic{enumiv}}
88
\renewcommand\labelenumi{\theenumi.}
89
\renewcommand\labelenumii{\theenumii.}
90
\renewcommand\labelenumiii{\theenumiii.}
91
\renewcommand\labelenumiv{\theenumiv.}
93
\newcommand\liststyleLxii{%
94
\renewcommand\labelitemi{${\bullet}$}
95
\renewcommand\labelitemii{${\circ}$}
96
\renewcommand\labelitemiii{${\blacksquare}$}
97
\renewcommand\labelitemiv{${\bullet}$}
99
\newcommand\liststyleLxiii{%
100
\renewcommand\labelitemi{${\bullet}$}
101
\renewcommand\labelitemii{${\circ}$}
102
\renewcommand\labelitemiii{${\blacksquare}$}
103
\renewcommand\labelitemiv{${\bullet}$}
105
\newcommand\liststyleLxiv{%
106
\renewcommand\labelitemi{${\bullet}$}
107
\renewcommand\labelitemii{${\circ}$}
108
\renewcommand\labelitemiii{${\blacksquare}$}
109
\renewcommand\labelitemiv{${\bullet}$}
111
% Page layout (geometry)
112
\setlength\voffset{-1in}
113
\setlength\hoffset{-1in}
114
\setlength\topmargin{2cm}
115
\setlength\oddsidemargin{2cm}
116
\setlength\textheight{23.017668cm}
117
\setlength\textwidth{17.59cm}
118
\setlength\footskip{26.144882pt}
119
\setlength\headheight{0cm}
120
\setlength\headsep{0cm}
122
\setlength{\skip\footins}{0.119cm}
123
\renewcommand\footnoterule{\vspace*{-0.018cm}\setlength\leftskip{0pt}\setlength\rightskip{0pt plus 1fil}\noindent\textcolor{black}{\rule{0.25\columnwidth}{0.018cm}}\vspace*{0.101cm}}
126
\newcommand\ps@Standard{
127
\renewcommand\@oddhead{}
128
\renewcommand\@evenhead{}
129
\renewcommand\@oddfoot{\thepage{}}
130
\renewcommand\@evenfoot{\@oddfoot}
131
\renewcommand\thepage{\arabic{page}}
135
\setlength\tabcolsep{1mm}
136
\renewcommand\arraystretch{1.3}
141
\section{Mice Module Documentation}
142
This document documents the main functionality of the Mice Modules that control geometry and fields of G4MICE. The
143
document is divided into three parts. Part 1 gives an overview of the basic usage of Mice Modules. Part 2 gives details
144
on how to implement different geometry models in G4MICE. Part 3 gives details on how to implement different
145
electromagnetic field models in G4MICE.
147
\subsection{How to Use this document}
148
This document is best used in conjunction with the various examples than can be found in any installation of G4MICE. If
149
you are familiar with Mice Modules already, the first part can be omitted and the latter two parts used as reference
152
Any problems or omissions should be emailed to the document author, chris.rogers@stfc.ac.uk. I really like to get
153
feedback on what is annoying in the documentation, what doesn't make sense and what is just wrong -- so I encourage you
159
\setcounter{tocdepth}{10}
160
\renewcommand\contentsname{Table of Contents}
165
\clearpage\section{Overview}
166
Mice Modules are the objects that control the geometry and fields that are simulated in G4MICE. They are used in
167
conjunction with a datacard file, which provides global run control parameters. Mice Modules are created by reading in
168
a series of text files when G4MICE applications are run. All Mice Module files must be in a subdirectory of the
169
directory defined by the environment variable \textit{\$\{MICEFILES\}}.
171
This geometry information is used primarily by the Simulation application for tracking of particles through magnetic
172
fields. A few commands are specific to detector Reconstruction and accelerator beam Optics applications.
174
The Mice Modules are created in a tree structure. Each module is a parent of any number of child modules. Typically the
175
parent module will describe a physical volume, and child modules will describe physical volumes that sit inside the
176
parent module. Modules cannot be used to describe volumes that do not sit at least partially inside the volume if the
179
Each Mice Module file consists of a series of lines of text. Firstly the Module name is defined. This is followed by an
180
opening curly bracket, then the description of the module and the placement of any child modules, and finally a closing
181
curly bracket. Commands, curly brackets etc must be separated by an end of line character.
183
Comments are indicated using either two slashes or an exclamation mark. Characters placed after a comment on a line are
186
G4MICE operates in a right handed coordinate system \textit{(x,y,z)}. In the absence of any rotation, lengths are
187
considered to be extent along the \textit{z}{}-axis, widths to be extent along the \textit{x}{}-axis and heights to be
188
extent along the \textit{y}{}-axis. Rotations (q\textsubscript{x}, q\textsubscript{y}, q\textsubscript{z}) are defined
189
as a rotation about the z-axis through q\textsubscript{z}, followed by a rotation about the y-axis through
190
q\textsubscript{y}, followed by a rotation about the x-axis through q\textsubscript{x}.
192
\subsection{Configuration File}
193
The Configuration file places the top level objects in MICE. The location of the file is controlled by the datacard
194
\textit{MiceModel}. G4MICE looks for the configuration file in the first instance in the directory
196
\ \ \$\textit{\{MICEFILES\}/Models/Configuration/{\textless}MiceModel{\textgreater}}
198
where \textit{\$\{MICEFILES\}} is a user-defined environment variable. If G4MICE fails to find the file it searches the
201
The world volume is defined in the Configuration file and any children of the world volume are referenced by the
202
Configuration file. The Configuration file looks like:
205
\ \ Configuration \textit{{\textless}Configuration Name{\textgreater}}}
211
\ \ \ \ \textup{Dimensions\ \ }{\textless}x{\textgreater} {\textless}y{\textgreater} {\textless}z{\textgreater}
212
{\textless}Units{\textgreater}}
215
\ \ \ \ {\textless}Properties{\textgreater}}
218
\ \ \ \ {\textless}Child Modules{\textgreater}}
223
\textit{{\textless}Configuration Name{\textgreater}} is the name of the configuration. Typically the Configuration file
224
name is given by \textit{{\textless}Configuration Name{\textgreater}}.dat. The world volume is always a rectangular box
225
centred on (0,0,0) with x, y, and z extent set by the Dimensions. Properties and Child Modules are described below and
226
added as in any Module.
228
\subsubsection{Substitutions}
229
It is possible to make keyword substitutions that substitutes all instances of {\textless}name{\textgreater} with
230
{\textless}value{\textgreater} in all Modules. The syntax is
233
\ \ Substitution {\textless}name{\textgreater} {\textless}value{\textgreater}}
235
{\textless}name{\textgreater} must start with a single \$ sign. Substitutions must be defined in the Configuration file.
236
Note this is a direct text substitution in the MiceModules before the modules are parsed properly. So for example,
239
\ \ Substitution \$Sub SomeText}
242
\ \ PropertyString FieldType \$Sub}
245
\ \ PropertyDouble \$SubValue 10}
247
would be parsed as G4MICE like
250
\ \ PropertyString FieldType \ \ \ \ SomeText}
253
\ \ PropertyDouble SomeTextValue 10}
255
\subsubsection{Expressions}
256
The use of equations in properties of type double and Hep3Vector is also allowed in place of a single value. So, for
259
\ \ \texttt{PropertyDouble FieldStrength 0.5*2 T}
261
would result in a FieldStrength property of 1 Tesla.\texttt{ }
263
\subsubsection{Expression Substitutions}
264
Some additional variables can be defined in specific cases by G4MICE itself for substitution into experssions, in which
265
case they will start with @ symbol. For these variable substitutions, it is only possible to make the substitution into
266
expressions. So for example,
269
\ \ PropertyDouble ScaleFactor 2*@RepeatNumber}
271
Would substitute @RepeatNumber \ into the expression. @RepeatNumber \ is defined by G4MICE when repeating modules are
272
used (see RepeatModule2, below). Note the following code is not valid
275
\ \ PropertyString FileName File@RepeatNumber //NOT VALID}
277
This is because Expression Substitutions can only be used in an expression (i.e. an equation).
279
\subsection[Module Files]{Module Files}
280
Children of the top level Mice Module are defined by Modules. G4MICE will attempt to find a module in an external file.
281
The location of the file is controlled by the parent Module. Initially G4MICE looks in the directory
283
\ \ \$\textit{\{MICEFILES\}/Models/Modules/{\textless}Module{\textgreater}}
285
If the Mice Module cannot be found, G4MICE searches the local directory. If the module file still cannot be found,
286
G4MICE will issue a warning and proceed.
288
The Module description is similar in structure to the Configuration file:
291
\ \ Module \textit{{\textless}Module Name{\textgreater}}}
297
\ \ \ \ Volume\ \ \textit{{\textless}Volume Type{\textgreater}}}
300
\ \ \ \ \textup{Dimensions\ \ }{\textless}Dimension1{\textgreater} {\textless}Dimension2{\textgreater}
301
{\textless}Dimension3{\textgreater} {\textless}Units{\textgreater}}
304
\ \ \ \ {\textless}Properties{\textgreater}}
307
\ \ \ \ {\textless}Child Modules{\textgreater}}
312
\textit{{\textless}Module Name{\textgreater}} is the name of the module. Typically the Module file name is given by
313
\textit{{\textless}Module Name{\textgreater}}.dat.
315
The definition of Volume, Dimensions, Properties and Child Modules are described below.
317
\subsection{Volume and Dimensions}
318
The volume described by the MiceModule can be one of several types. Replace \textit{{\textless}Volume
319
Type{\textgreater}} with the appropriate volume below. Cylinder, Box and Tube define cylindrical and cuboidal volumes.
320
Polycone defines an arbitrary volume of rotation and is described in detail below. Wedge describes a wedge with a
321
triangular projection in the y-z plane and rectangular projections in x-z and x-y planes. Quadrupole defines an
322
aperture with four cylindrical pole tips.
324
In general, the physical volumes that scrape the beam are defined independently of the field maps. This is the more
325
versatile way to do things, but there are some pitfalls which such an implementation introduces. For example, in
326
hard-edged fields like pillboxes, tracking errors can be introduced when G4MICE steps into the field region. This can
327
be avoided by adding windows (probably made of vacuum material) to force GEANT4 to stop tracking, make a small step
328
over the field boundary, and then restart tracking inside the field. However, such details are left for the user to
332
\tablefirsthead{\hline
334
\multicolumn{1}{m{4.321cm}|}{{\bfseries Dimension1}} &
335
\multicolumn{1}{m{4.564cm}|}{{\bfseries Dimension2}} &
336
{\bfseries Dimension3}\\}
339
\multicolumn{1}{m{4.321cm}|}{{\bfseries Dimension1}} &
340
\multicolumn{1}{m{4.564cm}|}{{\bfseries Dimension2}} &
341
{\bfseries Dimension3}\\}
344
\begin{supertabular}{|m{2.659cm}|m{4.321cm}m{4.564cm}m{5.25cm}|}
347
\multicolumn{3}{m{14.535cm}|}{No dimensions required. Note cannot define daughter Modules for this volume type.}\\\hline
349
\multicolumn{1}{m{4.321cm}|}{Radius} &
350
\multicolumn{1}{m{4.564cm}|}{Length in z} &
351
Not used (leave blank)\\\hline
353
\multicolumn{1}{m{4.321cm}|}{Width in x} &
354
\multicolumn{1}{m{4.564cm}|}{Height in y} &
355
Length along z\\\hline
357
\multicolumn{1}{m{4.321cm}|}{Inner Radius} &
358
\multicolumn{1}{m{4.564cm}|}{Outer Radius} &
361
\multicolumn{1}{m{4.321cm}|}{Half Width in x} &
362
\multicolumn{1}{m{4.564cm}|}{Half Height in y} &
363
Half Length in z\\\hline
365
\multicolumn{3}{m{14.535cm}|}{See documentation below.}\\\hline
367
\multicolumn{3}{m{14.535cm}|}{No dimensions required. Volume defined from external file.}\\\hline
369
\multicolumn{3}{m{14.535cm}|}{No dimensions required. Dimensions defined from module properties.}\\\hline
371
\multicolumn{3}{m{14.535cm}|}{No dimensions required. Dimensions defined from module properties.}\\\hline
373
\multicolumn{3}{m{14.535cm}|}{No dimensions required. Dimensions defined from module properties.}\\\hline
375
\multicolumn{3}{m{14.535cm}|}{See documentation below.}\\\hline
378
\clearpage\subsection{Properties}
379
Many of the features of G4MICE that can be enabled in a module are described using properties. For example, properties
380
enable the user to define detectors and fields. Properties can be either of several types: PropertyDouble,
381
PropertyString, PropertyBool, PropertyHep3Vector or PropertyInt. A property is declared via
384
\ \ \ \ {\textless}Property Type{\textgreater} {\textless}Property Name{\textgreater} {\textless}Value{\textgreater}
385
{\textless}Units if appropriate{\textgreater}}
387
Different properties that can be enabled for Mice Modules are described elsewhere in this document. Properties of type
388
PropertyDouble and PropertyHep3Vector can have units. Units are defined in the CLHEP library. Units are case sensitive;
389
G4MICE will return an error message if it fails to parse units. Combinations of units such as T/m or N*m can be defined
390
using '*' and '/' as appropriate. Properties cannot be defined more than once within the same module.
392
\subsection{Child Modules}
393
Child Modules are defined with a position, rotation and scale factor. This places, and rotates, the child volume and any
394
fields present relative to the parent volume. Scale factor scales fields defined in the child module and any of its
395
children. Scale factors are recursively multiplicative; that is the field generated by a child module will be scaled by
396
the product of the scale factor defined in the parent module and all of its parents.
398
The child module definition looks like:
401
\ \ Module \textit{{\textless}Module File Name{\textgreater}}}
407
\ \ \ \ Position\ \ \textit{{\textless}x position{\textgreater} {\textless}y position{\textgreater} {\textless}z
408
position{\textgreater} {\textless}Units{\textgreater}}}
411
\ \ \ \ \textup{Rotation\ \ }{\textless}x rotation{\textgreater} {\textless}y rotation{\textgreater} {\textless}z
412
rotation{\textgreater} {\textless}Units{\textgreater}}
415
\ \ \ \ \textup{ScaleFactor\ \ }{\textless}Value{\textgreater}}
418
\ \ \ \ {\textless}Define volume, dimensions and properties for this instance only{\textgreater}}
423
\textit{{\textless}Module File Name{\textgreater}} is defined relative to the folder
424
\textit{\$\{MICEFILES\}/Models/Modules/}. The position and rotation default to 0 0 0 and the scale factor defaults to
429
\item Volume, Dimension and Properties of the child module can be defined at the level of the parent; in this case these
430
values will be used only for this instance of the module.
434
\item If no file can be found, G4MICE will press on regardless, attempting to build a geometry using the information
435
defined in the parent volume.
437
\subsection[Module Hierarchy and GEANT4 Physical Volumes]{Module Hierarchy and GEANT4 Physical Volumes}
438
[Warning: Draw object ignored]G4MICE enables users to place arbitrary physical volumes in a GEANT4 geometry. The
439
formatting of G4MICE is such that users are encouraged to use the GEANT4 tree structure for placing physical volumes.
440
This is a double-edged sword, in that it provides users with a convenient interface for building geometries, but it is
441
not a terribly safe interface.
443
Consider the cartoon of physical volumes shown above. Here there is a blue volume sitting inside a red volume sitting
444
inside the black world volume. For the volumes to be represented properly, the module that represents the blue volume
445
MUST be a child of the module that represents the red volume. The module that represents the red volume MUST, in turn,
446
be a child of the module that represents the black volume, in this case the Configuration file.
448
What would happen if we placed the blue volume directly into the Black volume, i.e. the Configuration file? GEANT4 would
449
silently ignore the blue volume, or the red volume, depending on the order in which they are added into the GEANT4
450
geometry. What would happen if we placed the blue volume overlapping the red and black volumes? The behaviour of GEANT4
451
is not clear in this case.
455
\item Never allow a volume to overlap any part of another volume that is not it's direct parent.
457
It is possible to check for overlaps by setting the datacard \textit{CheckVolumeOverlaps} to 1.
460
\clearpage\subsection{A Sample Configuration File}
461
Below is listed a sample configuration file, which is likely to be included in the file
462
\textit{ExampleConfiguration.dat;} the actual name is specified by the datacard MiceModel.
465
\ \ Configuration ExampleConfiguration}
471
\ \ \ \ Dimensions 1500.0 1000.0 5000.0 cm}
474
\ \ \ \ PropertyString Material AIR}
477
\ \ \ \ Substitution \ \ \$MyRedColour 0.75}
480
\ \ \ \ Module BeamLine/SolMag.dat}
486
\ \ \ \ \ \ Position 140.0 0.0 -2175.0 cm}
489
\ \ \ \ \ \ Rotation 0.0 30.0 0.0 degree}
492
\ \ \ \ \ \ ScaleFactor 1.}
498
\ \ \ \ Module BeamLine/BendMag.dat}
504
\ \ \ \ \ \ \ \ Position 0.0 0.0 -1935.0 cm}
507
\ \ \ \ \ \ \ \ Rotation 0.0 15.0 0.0 degree}
510
\ \ \ \ \ \ ScaleFactor 1.}
516
\ \ \ \ Module NoFile\_Box1}
522
\ \ \ \ \ \ Volume \ \ \ Box}
525
\ \ \ \ \ \ Dimension 1.0 1.0 1.0}
528
\ \ \ \ \ \ \ \ Position 0.0 0.0 \ 200.0 cm}
531
\ \ \ \ \ \ \ \ Rotation 0.0 15.0 0.0 degree}
534
\ \ \ \ \ \ PropertyString Material Galactic}
537
\ \ \ \ \ \ PropertyDouble RedColour \$MyRedColour}
540
\ \ \ \ \ \ Module NoFile\_Box2}
546
\ \ \ \ \ \ \ \ Volume \ \ \ Box}
549
\ \ \ \ \ \ \ \ Dimension 0.5 0.5 0.5*3 m //z length = 0.5*3 = 1.5 m}
552
\ \ \ \ \ \ \ \ \ \ Rotation \ 0.0 15.0 0.0 degree //Rotation relative to parent}
555
\ \ \ \ \ \ \ \ PropertyString Material Galactic}
558
\ \ \ \ \ \ \ \ PropertyDouble RedColour \$MyRedColour}
568
\clearpage\subsection{A Sample Child Module File}
569
Below is listed a sample module file, which is likely to be included in the file \textit{SolMag.dat}; the actual
570
location is specified by the module or configuration that calls FCoil. The module contains a number of properties that
580
\ \ \ \ Volume Tube }
583
\ \ \ \ Dimensions 263.0 347.0 210.0 mm}
586
\ \ \ \ PropertyString Material Al}
589
\ \ \ \ PropertyDouble BlueColour 0.75}
592
\ \ \ \ PropertyDouble GreenColour 0.75}
598
\ \ \ \ PropertyString FieldType \ \ \ \ \ \ Solenoid}
601
\ \ \ \ PropertyString FileName \ \ \ \ \ \ \ focus.dat}
604
\ \ \ \ PropertyDouble CurrentDensity \ \ \ \ \ 1.}
607
\ \ \ \ PropertyDouble Length \ \ \ \ \ \ \ \ \ \ \ 210. mm}
610
\ \ \ \ PropertyDouble Thickness \ \ \ \ \ \ \ \ \ 84. mm}
613
\ \ \ \ PropertyDouble InnerRadius \ \ \ \ \ \ 263. mm}
619
\clearpage\section{Geometry and Tracking Properties}
620
Properties for various aspects of the physical and engineering model of the simulation are described below. This
621
includes properties for sensitive detectors.
623
\subsection{General Properties}
624
There are a number of properties that are applicable to any MiceModule.
627
\tablefirsthead{\hline
628
{\bfseries Property} &
630
{\bfseries Description}\\}
632
{\bfseries Property} &
634
{\bfseries Description}\\}
637
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
641
The material that the volume is made up from\\\hline
644
Set to 1 to make the object invisible in visualisation, or 0 to make the object visible.\\\hline
645
\multicolumn{2}{m{5.143cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.278cm}}
653
\end{tabular}\hspace*{-\tabcolsep}
655
Alter the colour of objects as they are visualised\\\hhline{~~-}
658
The maximum step length that Geant4 can make in the volume. Inherits values from the parent volumes.\\\hline
659
\multicolumn{2}{m{5.143cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.278cm}}
665
\end{tabular}\hspace*{-\tabcolsep}
667
The maximum track length and particle time of a track. Tracks outside this bound are killed. Inherits values from the
668
parent volumes.\\\hhline{~~-}
671
The minimum kinetic energy of a track. Tracks outside this bound are killed. Inherits values from the parent
675
Set to the type of sensitive detector required. Possible sensitive detectors are \textit{TOF}, \textit{SciFi},
676
\textit{CKOV}, \textit{SpecialVirtual, Virtual, Envelope} or \textit{EMCAL}.\\\hline
679
\subsection{Sensitive Detectors}
680
A sensitive detector (one in which hits are recorded) can be defined by including the SensitiveDetector property. When a
681
volume is set to be a sensitive detector G4MICE will automatically record tracks entering, exiting and crossing the
682
volume. Details such as the energy deposited by the track are sometimes also recorded in order to enable subsequent
683
modelling of the detector response.
685
Some sensitive detectors use extra properties.
687
\subsubsection[Scintillating Fibre Detector (SciFi)]{Scintillating Fibre Detector (SciFi)}
688
\subsubsection{Cerenkov Detector (CKOV)}
689
\subsubsection{Time Of Flight Counter (TOF)}
690
\subsubsection{Special Virtual Detectors}
691
Special virtual detectors are used to monitor tracking through a particular physical volume. Normally particle tracks
692
are written in the global coordinate system, although an alternate coordinate system can be defined. Additional
693
properties can be used to parameterise special virtual detectors.
696
\tablefirsthead{\hline
697
{\bfseries Property} &
699
{\bfseries Description}\\}
701
{\bfseries Property} &
703
{\bfseries Description}\\}
706
\begin{supertabular}{|m{3.665cm}|m{1.3579999cm}|m{11.973001cm}|}
708
\multicolumn{2}{m{5.223cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.3579999cm}}
716
\end{tabular}\hspace*{-\tabcolsep}
718
Set the number of segments in the detector in Z, R or f. Defaults to 1.\\\hhline{~~-}
719
\multicolumn{2}{m{5.223cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.3579999cm}}
729
\end{tabular}\hspace*{-\tabcolsep}
731
Set to true to record tracks stepping through, into, out of or across the volume. Defaults to true.\\\hhline{~~-}
734
Define an integer that is written to the output file to identify the station. Defaults to a unique integer identifier
735
chosen by G4MICE, which will be different each time the same Special Virtual is placed.\\\hline
740
If set, record hits relative to a reference rotation in the coordinate system of the SpecialVirtual detector.\\\hline
745
If set, record hits relative to a reference rotation in the coordinate system of the Configuration.\\\hline
750
If set, record hits relative to a reference position in the coordinate system of the SpecialVirtual detector.\\\hline
755
If set, record hits relative to a reference position in the coordinate system of the Configuration.\\\hline
759
\clearpage\subsubsection{Virtual Detectors}
760
Virtual detectors are used to extract all particle data at a particular plane, irrespective of geometry. Virtual
761
detectors do not need to have a physical volume. The \textit{plane} can be a plane in z, time, proper time, or a
762
physical plane with some arbitrary rotation and translation.
765
\tablefirsthead{\hline
766
{\bfseries Property} &
768
{\bfseries Description}\\}
770
{\bfseries Property} &
772
{\bfseries Description}\\}
775
\begin{supertabular}{|m{3.665cm}|m{1.3579999cm}|m{11.973001cm}|}
777
{\itshape IndependentVariable} &
781
\item If set to \textit{t}, particle data will be written for particles at the time defined by the \textit{PlaneTime}
786
\item If set to \textit{tau},\textit{ }particle data will be written for particles at the proper time defined by the
791
\item If set to \textit{z}, particle data will be written for particles crossing the module's z-position.
795
\item If set to \textit{u}, particle data will be written for particles crossing a plane extending in \textit{x} and
799
{\itshape PlaneTime} &
801
If \textit{IndependentVariable} is \textit{t }or \textit{tau,} particle data will be written out at this time. Mandatory
802
if \textit{IndependentVariable} is \textit{t} or \textit{tau}.\\\hline
805
If set, particles outside this radius in the plane of the detector will not be recorded by the Virtual detector.\\\hline
808
If set to 0, particle data is written in the coordinate system of the module. Otherwise particle data is written in
809
global coordinates.\\\hline
812
Set how the VirtualPlane handles particles that pass through more than once. If set to Ignore, particles will be ignored
813
on second and subsequent passes. If set to SameStation, particles will be registered with the same station number. If
814
set to NewStation, particles will be registered with a NewStation number given by the \textit{(total number of
815
stations) + (this plane's station number)}, i.e. a new station number appropriate for a ring geometry.\\\hline
818
Set to false to prevent backwards-going particles from being recorded. Default is true.\\\hline
822
\clearpage\subsubsection{Envelope Detectors}
823
Envelope detectors are a type of Virtual detector that take all of the properties listed under virtual detectors, above.
824
In addition, in the optics application they can be used to interact with the beam envelope in a special way. The
825
following properties can be defined for Envelope Detectors \textit{in addition to} the properties specified above for
828
The The EnvelopeOut properties are used to make output from the envelope for use in the Optics optimiser.
831
\tablefirsthead{\hline
832
{\bfseries Property} &
834
{\bfseries Description}\\}
836
{\bfseries Property} &
838
{\bfseries Description}\\}
841
\begin{supertabular}{|m{3.665cm}|m{1.3579999cm}|m{11.973001cm}|}
843
{\itshape EnvelopeOut1\_Name} &
845
Defines the variable name that can be used as an expression substitution at the end of each iteration, typically
846
substituted into the Score parameters in the optimiser (see optimiser, below).\\\hline
847
{\itshape EnvelopeOut1\_Type} &
849
Defines the type of variable that will be calculated for the substitution. Options are
855
\item Standard\_Deviation
857
\item Bunch\_Parameter
860
{\itshape EnvelopeOut1\_Variable} &
862
Defines the variable that will be calculated for the substitution. Options are for Bunch\_Parameter
866
\item \begin{itemize}
867
\item {\itshape emit\_6d \textup{: 6d emittance}}
868
\item {\itshape emit\_4d:\textup{ 4d emittance (in x-y space)}}
869
\item {\itshape emit\_t:\textup{ 2d emittance (in time space)}}
870
\item {\itshape emit\_x:\textup{ 2d emittance (in x space)}}
871
\item {\itshape emit\_y:\textup{ 2d emittance (in y space)}}
872
\item {\itshape beta\_4d:\textup{ 4d transverse beta function}}
873
\item {\itshape beta\_t:\textup{ 2d longitudinal beta function}}
874
\item {\itshape beta\_x: \textup{2d beta function (in(x space)}}
875
\item {\itshape beta\_y: \textup{2d beta function (in y space)}}
876
\item {\itshape alpha\_4d:\textup{ 4d transverse alpha function}}
877
\item {\itshape alpha\_t:\textup{ 2d longitudinal alpha function}}
878
\item {\itshape alpha\_x: \textup{2d alpha function (in(x space)}}
879
\item {\itshape alpha\_y: \textup{2d alpha function (in y space)}}
880
\item {\itshape gamma\_4d:\textup{ 4d transverse gamma function}}
881
\item {\itshape gamma\_t:\textup{ 2d longitudinal gamma function}}
882
\item {\itshape gamma\_x: \textup{2d gamma function (in(x space)}}
883
\item {\itshape gamma\_y: \textup{2d gamma function (in y space)}}
884
\item {\itshape disp\_x:\textup{ x-dispersion}}
885
\item {\itshape disp\_y:\textup{ y-dispersion}}
886
\item {\itshape ltwiddle:\textup{ normalised angular momentum}}
887
\item {\itshape lkin:\textup{ standard angular momentum}}
891
For Mean, Standard\_Deviation, Covariance and Correlation, variables should be selected from the options
895
\item \textit{x: x-}position
896
\item {\itshape y:y-position}
897
\item {\itshape t: \textup{time}}
898
\item {\itshape px:\textup{ x-momentum}}
899
\item {\itshape py:\textup{ y-momentum}}
900
\item {\itshape E:\textup{ energy}}
902
For Mean, a single variable should be selected and value corresponding to the reference trajectory will be returned.
904
For Standard\_Deviation, a single variable should be selected and the 1 sigma beam size will be returned.
906
For Covariance and Correlation, two variables should be selected separated by a comma.\\\hline
909
\subsection{Unconventional Volumes}
910
It is possible to define a number of volumes that use properties rather than the Dimensions keyword to define the volume
916
Volume Trapezoid gives a trapezoid which is not necessarily isosceles. Its dimensions are given by:
919
\tablefirsthead{\hline
920
{\bfseries Property} &
922
{\bfseries Description}\\}
924
{\bfseries Property} &
926
{\bfseries Description}\\}
929
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
933
Gives width1 in x\\\hline
936
Gives width2 in x\\\hline
939
Gives height1 in y\\\hline
942
Gives height2 in y\\\hline
945
Gives length along z\\\hline
948
\subsubsection{A Trapezoid Volume is like a Wedge Volume (look visualization below) with the possibility to have
949
different values for x width and 2 (non-zero) values for y.}
951
\clearpage\subsubsection{Volume Wedge}
952
A wedge is a triangular prism as shown in the diagram. Here the blue line extends along the positive z-axis and the red
953
line extends along the x-axis.
956
\includegraphics[width=13.968cm,height=8.394cm]{MiceModule-img001.png}
959
\tablefirsthead{\hline
960
{\bfseries Property} &
962
{\bfseries Description}\\}
964
{\bfseries Property} &
966
{\bfseries Description}\\}
969
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
977
\item Width of the prism in x
978
\item Open end height of the prism in y
979
\item Length of the prism in z
984
\subsubsection{Volume Polycone}
985
A polycone is a volume of rotation, defined by a number of points in r and z. The volume is found by a linear
986
interpolation of the points.
989
\tablefirsthead{\hline
990
{\bfseries Property} &
992
{\bfseries Description}\\}
994
{\bfseries Property} &
996
{\bfseries Description}\\}
999
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
1003
Set to Fill to define a solid volume of rotation. Set to Cone to define a shell volume of rotation with an inner and
1004
outer surface.\\\hline
1007
The name of the file that contains the polycone data.\\\hline
1010
\subsubsection{Volume Quadrupole}
1011
Quadrupoles are defined by an empty cylinder with four further cylinders that are approximations to pole tips.
1014
\tablefirsthead{\hline
1015
{\bfseries Property} &
1017
{\bfseries Description}\\}
1019
{\bfseries Property} &
1021
{\bfseries Description}\\}
1024
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
1028
The length of the quadrupole container.\\\hline
1031
The distance from the quad centre to the outside of the quad.\\\hline
1034
The distance from the quad centre to the pole tip.\\\hline
1045
The material from which the beamline volume is made.\\\hline
1048
The material from which the quadrupole volume is made.\\\hline
1051
\subsubsection{Volume Multipole}
1052
Multipoles are defined by an empty box with an arbitrary number of cylinders that are approximations to pole tips. Poles
1053
are placed around the centre of the box with n-fold symmetry. Multipoles can be curved, in which case poles cannot be
1054
defined -- only a curved rectangular aperture will be present.
1057
\tablefirsthead{\hline
1058
{\bfseries Property} &
1060
{\bfseries Description}\\}
1062
{\bfseries Property} &
1064
{\bfseries Description}\\}
1067
\begin{supertabular}{|m{3.892cm}|m{1.333cm}|m{11.77cm}|}
1069
{\itshape ApertureCurvature} &
1071
Radius of curvature of the multipole aperture. For now curved apertures cannot have poles. Set to 0 for a straight
1073
{\itshape ApertureLength} &
1075
Length of the multipole aperture.\\\hline
1078
Number of poles.\\\hline
1081
The distance from the centre of the aperture to the centre of the cylindrical pole.\\\hline
1084
The distance from the centre of the aperture to the tip of the cylindrical pole.\\\hline
1085
{\itshape ApertureInnerHeight} &
1087
The inner full height of the aperture.\\\hline
1088
{\itshape ApertureInnerWidth} &
1090
The inner full width of the aperture.\\\hline
1091
{\itshape AppertureOuterHeight} &
1093
The outer full height of the aperture.\\\hline
1094
{\itshape ApertureOuterWidth} &
1096
The outer full width of the aperture.\\\hline
1099
\subsubsection{Volume Boolean}
1100
Boolean volumes enable several volumes to be combined to make very sophisticated shapes from a number of elements.
1101
Elements can be combined either by union, intersection or subtraction operations. A union creates a volume that is the
1102
sum of two elements; an intersection creates a volume that covers the region where two volumes intersect each other;
1103
and a subtraction creates a volume that contains all of one volume except the region that another volume sits in.
1105
Boolean volumes combine volumes modelled by other MiceModules (submodules), controlled using the properties listed
1106
below. Only the volume shape is used; position, rotation and field models etc are ignored. Materials, colours and other
1107
relevant properties are all taken only from the Boolean Volume's properties.
1109
Note that unlike in other parts of G4MICE, submodules for use in Booleans (BaseModule, BooleanModule1, BooleanModule2
1110
...) must be defined in a separate file, either defined in \$MICEFILES/Models/Modules or in the working directory.
1112
Also note that visualisation of boolean volumes is rather unreliable. Unfortunately this is a feature of GEANT4. An
1113
alternative technique is to use special virtual detectors to examine hits in boolean volumes.
1116
\tablefirsthead{\hline
1117
{\bfseries Property} &
1119
{\bfseries Description}\\}
1121
{\bfseries Property} &
1123
{\bfseries Description}\\}
1126
\begin{supertabular}{|m{3.89cm}|m{1.333cm}|m{11.772cm}|}
1128
{\itshape BaseModule} &
1130
Name of the physical volume that the BooleanVolume is based on. This volume will be placed at (0,0,0) with no rotation,
1131
and all subsequent volumes will be added, subtracted or intersected with this one.\\\hline
1132
{\itshape BooleanModule1} &
1134
The first module to add. G4MICE will search for the MiceModule with path
1135
\$MICEFILES/Models/Modules/{\textless}BooleanModule1{\textgreater}.\\\hline
1136
{\itshape BooleanModule1Type} &
1138
The type of boolean operation to apply, either ``Union'', ``Intersection'' or ``Subtraction''.\\\hline
1139
{\itshape BooleanModule1Pos} &
1143
The position of the new volume with respect to the Base volume.\\\hline
1144
{\itshape BooleanModule1Rot} &
1148
The rotation of the new volume with respect to the Base volume.\\\hline
1149
{\itshape BooleanModuleN} &
1151
Add extra modules as required. Replace ``N'' with the module number. N must be a continuous series incrementing by 1 for
1152
each new module. Note that the order in which modules are added is important -- (A-B) \textsf{U }C is different to A-(B
1153
\textsf{U }C).\\\hline
1154
{\itshape BooleanModuleNType} &
1155
\multicolumn{1}{m{1.333cm}}{string} &
1157
{\itshape BooleanModuleNPos} &
1158
\multicolumn{1}{m{1.333cm}}{Hep3
1162
{\itshape BooleanModuleNRot} &
1163
\multicolumn{1}{m{1.333cm}}{Hep3
1169
\subsubsection{Volume Sphere}
1170
A sphere is a spherical shell, with options for opening angles to make segments.
1173
\tablefirsthead{\hline
1174
{\bfseries Property} &
1176
{\bfseries Description}\\}
1178
{\bfseries Property} &
1180
{\bfseries Description}\\}
1183
\begin{supertabular}{|m{3.89cm}|m{1.333cm}|m{11.772cm}|}
1185
{\itshape Dimensions} &
1189
The x value defines the inner radius. The y value defines the outer radius of the shell. The z value is not
1195
The x value defines the start opening angle in phi. The y value defines the end opening angle. The z value is not used.
1196
Phi values must be in the range 0 to 360 degrees. If undefined, defaults to the range 0-360 degrees.\\\hline
1201
The x value defines the start opening angle in theta. The y value defines the end opening angle. The z value is not
1202
used. Theta values must be in the range 0 to 180 degrees. If undefined, defaults to the range 0-360 degrees.\\\hline
1205
\clearpage\subsection{Repeating Modules}
1206
It is possible to set up a repeating structure for e.g. a repeating magnet lattice. The RepeatModule property enables
1207
the user to specify that a particular module will be repeated a number of times, with all properties passed onto the
1208
child module, but with a new position, orientation and scale factor. Each successive repetition will be given a
1209
translation and a rotation relative to the coordinate system of the previous repetition, enabling the construction of
1210
circular and straight accelerator lattices. Additionally, successive repetitions can have fields scaled relative to
1211
previous repetitions, enabling for example alternating lattices.
1214
\tablefirsthead{\hline
1215
{\bfseries Property} &
1217
{\bfseries Description}\\}
1219
{\bfseries Property} &
1221
{\bfseries Description}\\}
1224
\begin{supertabular}{|m{3.892cm}|m{1.333cm}|m{11.77cm}|}
1226
{\itshape RepeatModule} &
1228
Set to 1 to enable repeats in this module.\\\hline
1229
{\itshape NumberOfRepeats} &
1231
Number of times the module will be repeated in addition to the initial placement.\\\hline
1232
{\itshape RepeatTranslation} &
1236
Translation applied to successive repeats, applied in the coordinate system of the previous repetition.\\\hline
1237
{\itshape RepeatRotation} &
1241
Rotation applied to successive repeats, applied in the coordinate system of the previous repetition.\\\hline
1242
{\itshape RepeatScaleFactor} &
1244
ScaleFactor applied to successive repeats, applied relative to previous repetition's scale factor.\\\hline
1247
The RepeatModule2 property also enables the user to specify that a particular module will be repeated a number of times.
1248
In this case, G4MICE will set a substitution variable @RepeatNumber that holds an index between 0 and NumberOfRepeats.
1249
This can be used in an expression in to provide a versatile interface between user and accelerator lattice.
1252
\tablefirsthead{\hline
1253
{\bfseries Property} &
1255
{\bfseries Description}\\}
1257
{\bfseries Property} &
1259
{\bfseries Description}\\}
1262
\begin{supertabular}{|m{3.892cm}|m{1.333cm}|m{11.77cm}|}
1264
{\itshape RepeatModule2} &
1266
Set to 1 to enable repeats in this module.\\\hline
1267
{\itshape NumberOfRepeats} &
1269
Number of times the module will be repeated in addition to the initial placement.\\\hline
1273
\clearpage\subsection{Beam Definition and Beam Envelopes}
1274
The Optics application can be used to track a trajectory and associated beam envelope through the accelerator structure.
1275
Optics works by finding the Jacobian around some arbitrary trajectory using a numerical differentiation. This is used
1276
to define a linear mapping about this trajectory, which can then be used to transport the beam envelope.
1278
The Simulation application can be used to generate a random particle beam with a Gaussian distribution and RMS
1279
parameters defined in the same way as the Optics beam envelope. Alternatively, pencil beams and beams from some input
1280
file can also be defined here.
1282
A beam envelope is defined by a reference trajectory and a beam ellipse. The reference trajectory takes its position and
1283
direction from the position and rotation of the module. No rotation builds a reference trajectory along the z-axis. The
1284
magnitude of the momentum and the initial time of the reference trajectory is defined by properties. RF cavities are
1285
phased using the reference trajectory defined here.
1287
The beam ellipse is represented by a matrix, which can either be set using
1291
\item Twiss-style parameters in (x,px),(y,py) and (t,E) spaces.
1292
\item Twiss-style parameters in (t,E) space and Penn-style parameters in a cylindrically symmetric (x,px,y,py) space.
1293
\item A 6x6 beam ellipse matrix where the ellipse equation is given by \textbf{X}.\textbf{T}() \textbf{M} \textbf{X} =
1296
The Penn ellipse matrix is given by
1299
M=\left(\begin{matrix}\epsilon _Lmc\frac{\beta _L}{p}&-\epsilon _Lmc\alpha _L&0&0&0&0\\&\epsilon _Lmc\gamma
1300
_Lp&\frac{D_x}{E}V(E)&\frac{D_x'}{E}V(E)&\frac{D_y}{E}V(E)&\frac{D_y'}{E}V(E)\\&&\epsilon _Tmc\frac{\beta _T}{p}&-\epsilon
1301
_Tmc\alpha _T&0&-\epsilon _Tmc(\frac{q}{2}\beta _T\frac{B_z}{P}-L)\\&&&\epsilon _Tmc\gamma _Tp&\epsilon _Tmc(\frac{q}{
1302
2}\beta _T\frac{B_z}{P}-L)&0\\&&&&\epsilon _Tmc\frac{\beta _T}{p}&-\epsilon _Tmc\alpha _T\\&&&&&\epsilon _Lmc\gamma
1303
_Tp\end{matrix}\right)
1305
Here L is a normalised canonical angular momentum, \textit{q} is the reference particle charge,
1306
\textit{B}\textit{\textsubscript{z}} is the nominal on-axis magnetic field, \textit{p} is the reference momentum,
1307
\textit{m} is the reference mass, e\textsubscript{T} is the transverse emittance, b\textsubscript{T} and
1308
a\textsubscript{T} are the transverse Twiss-like functions, e\textsubscript{L} is the longitudinal emittance and
1309
b\textsubscript{L} and a\textsubscript{L} are the longitudinal Twiss-like functions. Additionally D\textsubscript{x},
1310
D\textsubscript{y}, D'\textsubscript{x}, D'\textsubscript{y} are the dispersions and their derivatives with respect to
1311
z and V(E) is the variance of energy (given by the (2,2) term in the matrix above).
1313
The Twiss ellipse matrix is given by
1316
M=\left(\begin{matrix}\epsilon _Lmc\frac{\beta _L}{p}&-\epsilon _Lmc\alpha _L&0&0&0&0\\&\epsilon _Lmc\gamma
1317
_Lp&\frac{D_x}{E}V(E)&\frac{D_x'}{E}V(E)&\frac{D_y}{E}V(E)&\frac{D_y'}{E}V(E)\\&&\epsilon _xmc\frac{\beta _x}{p}&-\epsilon
1318
_xmc\alpha _x&0&0\\&&&\epsilon _xmc\gamma _xp&0&0\\&&&&\epsilon _ymc\frac{\beta _y}{p}&-\epsilon _ymc\alpha
1319
_y\\&&&&&\epsilon _ymc\gamma _yp\end{matrix}\right)
1321
Here \textit{p} is the reference momentum, \textit{m} is the reference mass, e\textsubscript{i}, b\textsubscript{i} and
1322
a\textsubscript{i} are the emittances and Twiss functions in the (t,E), (x,p\textsubscript{x}) and
1323
(y,p\textsubscript{y}) planes respectively, D\textsubscript{x}, D\textsubscript{y}, D'\textsubscript{x},
1324
D'\textsubscript{y} are the dispersions and their derivatives with respect to z and V(E) is the variance of energy
1325
(given by the (2,2) term in the matrix above).
1328
\tablefirsthead{\hline
1329
{\bfseries Property} &
1331
{\bfseries Description}\\}
1333
{\bfseries Property} &
1335
{\bfseries Description}\\}
1338
\begin{supertabular}{|m{3.319cm}|m{1.2019999cm}|m{11.974cm}|}
1340
{\itshape EnvelopeType} &
1342
Set to \textit{TrackingDerivative} to evolve a beam envelope in the Optics application.\\\hline
1343
{\itshape BeamType} &
1345
Set to \textit{Random} to generate a beam using the parameters below for the Simulation application. Set to
1346
\textit{Pencil }to generate a pencil beam (with no random distribution). Set to \textit{ICOOL}, \textit{Turtle,
1347
G4MICE\_PrimaryGenHit} or \textit{G4BeamLine} to use a beam file.\\\hline
1350
The particle ID of particles in the envelope or beam.\\\hline
1351
{\itshape Longitudinal}
1353
{\itshape Variable} &
1355
Set the longitudinal variable used to define the reference trajectory momentum. Options are \textit{Energy},
1356
\textit{KineticEnergy, Momentum} and\textit{ ZMomentum.}\\\hline
1357
\multicolumn{1}{m{3.319cm}}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.319cm}}
1360
KineticEnergy\\\hline
1363
\end{tabular}\hspace*{-\tabcolsep}
1365
\hspace*{-\tabcolsep}\begin{tabular}{|m{1.2019999cm}}
1371
\end{tabular}\hspace*{-\tabcolsep}
1373
Define the value of the longitudinal variable used to calculate the mean momentum and energy. The usual relationship
1374
E\textsuperscript{2}+p\textsuperscript{2}c\textsuperscript{2}=m\textsuperscript{2}c\textsuperscript{4} applies. Kinetic
1375
energy E\textsubscript{k} is related to energy E by E\textsubscript{k}+m=E.\\\hhline{~~-}
1376
{\itshape EllipseDefinition} &
1378
Define the beam ellipse that will be used in calculating the evolution of the Envelope, or used to generate a beam for
1379
BeamType \textit{Random}. Options are \textit{Twiss, Penn} and\textit{ Matrix}.\\\hline
1380
\multicolumn{3}{|m{16.894999cm}|}{{\itshape The following properties are only used if EllipseDefinition is set to
1382
\multicolumn{2}{m{4.721cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.319cm}|m{1.2019999cm}}
1384
{\itshape Emittance\_X} &
1386
{\itshape Emittance\_Y} &
1388
{\itshape Emittance\_L} &
1390
\end{tabular}\hspace*{-\tabcolsep}
1392
Emittance in each 2d subspace, (x,px), (y,py) and (t,E).\\\hhline{~~-}
1393
\multicolumn{2}{m{4.721cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.319cm}|m{1.2019999cm}}
1395
{\itshape Beta\_X} &
1397
{\itshape Beta\_Y} &
1399
{\itshape Beta\_L} &
1401
\end{tabular}\hspace*{-\tabcolsep}
1403
Twiss b function in each 2d subspace, (x,px), (y,py) and (t,E).\\\hhline{~~-}
1404
\multicolumn{2}{m{4.721cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.319cm}|m{1.2019999cm}}
1406
{\itshape Alpha\_X} &
1408
{\itshape Alpha\_Y} &
1410
{\itshape Alpha\_L} &
1412
\end{tabular}\hspace*{-\tabcolsep}
1414
Twiss a function in each 2d subspace, (x,px), (y,py) and (t,E).\\\hhline{~~-}
1415
\multicolumn{3}{|m{16.894999cm}|}{{\itshape The following properties are only used if EllipseDefinition is set to
1417
\multicolumn{2}{m{4.721cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.319cm}|m{1.2019999cm}}
1419
{\itshape Covariance(t,t)} &
1421
{\itshape Covariance(t,E)} &
1423
{\itshape Covariance(t,x)} &
1427
{\itshape Covariance(Py,Py)} &
1429
\end{tabular}\hspace*{-\tabcolsep}
1431
Set the 6x6 matrix that will be used in the to define the beam ellipse. Covariances should be covariances of elements of
1432
the matrix (x,Px,y,Py,t,E).
1434
\ This must be a positive definite matrix, i.e. determinant {\textgreater} 0. Note that this means that at least the 6
1435
terms on the diagonal must be defined. Other terms default to 0.\\\hline
1436
\multicolumn{3}{|m{16.894999cm}|}{{\itshape The following properties are only used if EllipseDefinition is set to
1438
{\itshape Emittance\_T} &
1440
Transverse emittance for the 4d (x,px,y,py) subspace.\\\hline
1441
{\itshape Emittance\_L} &
1443
Longitudinal emittance for the 2d (t,E) subspace.\\\hline
1444
{\itshape Beta\_T} &
1446
Transverse beta for the 4d (x,px,y,py) subspace.\\\hline
1447
{\itshape Beta\_L} &
1449
Longitudinal beta for the 2d (t,E) subspace.\\\hline
1450
{\itshape Alpha\_T} &
1452
Transverse alpha for the 4d (x,px,y,py) subspace.\\\hline
1453
{\itshape Alpha\_L} &
1455
Longitudinal alpha for the 2d (t,E) subspace.\\\hline
1456
{\itshape Normalised}
1458
{\itshape AngularMomentu} &
1460
Normalised angular momentum for the transverse phase space.\\\hline
1463
Nominal magnetic field on the reference particle.\\\hline
1464
\multicolumn{3}{|m{16.894999cm}|}{{\itshape The following properties are used if EllipseDefinition is set to Penn or
1468
Dispersion in x (x-energy correlation).\\\hline
1471
Dispersion in y (y-energy correlation).\\\hline
1472
DispersionPrime\_X &
1474
D' in x (Px-energy correlation).\\\hline
1475
DispersionPrime\_Y &
1477
D' in y (Py-energy correlation).\\\hline
1478
\multicolumn{3}{|m{16.894999cm}|}{{\itshape The following properties are only relevant for generating a beam
1482
Output file name for writing output beam envelope in ROOT binary format.\\\hline
1485
Output file name for writing output beam envelope in string format.\\\hline
1488
Output file name for writing output beam envelope in string format. This abbreviated output omits some of the fields
1489
that are present in LongTextOutput files.\\\hline
1492
If a BeamType is defined, this property controls the file name to which beam data is written.\\\hline
1495
Offset in time used for calculating numerical derivatives. Default is 0.1 ns.\\\hline
1498
Offset in energy used for calculating numerical derivatives. Default is 1 MeV.\\\hline
1501
Offset in x position used for calculating numerical derivatives. Default is 1 mm.\\\hline
1504
Offset in x momentum used for calculating numerical derivatives. Default is 1 MeV/c.\\\hline
1507
Offset in y position used for calculating numerical derivatives. Default is 1 mm.\\\hline
1510
Offset in y momentum used for calculating numerical derivatives. Default is 1 MeV/c.\\\hline
1511
\multicolumn{2}{m{4.721cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.319cm}|m{1.2019999cm}}
1525
\end{tabular}\hspace*{-\tabcolsep}
1527
Maximum offsets when polyfit algorithm is used. In some cases the offset can keep increasing without limit unless these
1528
maximum offsets are defined. Default is no limit.\\\hhline{~~-}
1529
\multicolumn{3}{|m{16.894999cm}|}{{\itshape The following properties are only relevant for generating a particle
1533
If set to true and the datacard \textit{FirstParticleIsReference} is set to 0, the first event in the Module will be
1534
used as the reference particle that sets cavity phases. This particle will then have the mean trajectory (i.e. no
1535
gaussian distribution).\\\hline
1536
{\itshape BeamFile} &
1538
If the BeamType is \textit{ICOOL}, \textit{Turtle, G4MICE\_PrimaryGenHit} or \textit{G4BeamLine}, this property defines
1539
the name of the file containing tracks for G4MICE.\\\hline
1542
Set the maximum number of events to take from this module. If other modules are defined, G4MICE will iterate over the
1543
modules until it the datacard \textit{numEvts} is reached or all modules have been run to \textit{NumberOfEvents}.
1544
Default is for G4MICE to keep tracking from the first module it finds until \textit{numEvts} is reached.\\\hline
1547
\subsection{Optimiser}
1548
It is possible to define an optimiser for use in the Optics application. The optimiser enables the user to vary
1549
parameters in the MiceModule file and try to find some optimum setting. For each value of the parameters, G4MICE Optics
1550
will calculate a score; the optimiser attempts to find a minimum value for this score.
1553
\tablefirsthead{\hline
1554
{\bfseries Property} &
1556
{\bfseries Description}\\}
1558
{\bfseries Property} &
1560
{\bfseries Description}\\}
1563
\begin{supertabular}{|m{3.319cm}|m{1.2019999cm}|m{11.974cm}|}
1565
{\itshape Optimiser} &
1567
Controls the function used for optimising. For now Minuit is the only available option.\\\hline
1568
{\itshape Algorithm} &
1570
For \textit{Minuit} optimiser, controls the \textit{Minuit} algorithm used. In general Simplex is a good option to use
1571
here. An alternative is Migrad. See Minuit documentation (for example at http://root.cern.ch/root/html/TMinuit.html)
1572
for further information. Minuit attempts to minimise the score function defined by the Score properties.\\\hline
1573
{\itshape NumberOfTries} &
1575
Maximum number of iterations G4MICE will make in order to find the optimum value.\\\hline
1576
{\itshape StartError} &
1578
Guess at the initial error in the score.\\\hline
1579
{\itshape EndError} &
1581
Required final error in the score for the optimisation to converge successfully.\\\hline
1584
Set to False to tell G4MICE not to rebuild the simulation on each iteration. This should be used to speed up the
1585
optimiser when a parameter is used that does not change the field maps. Default is true.\\\hline
1586
{\itshape Parameter1\_Start} &
1588
Seed value for the parameter, that is used in the first iteration.\\\hline
1589
{\itshape Parameter1\_Name} &
1591
Name of the parameter. This name is used as an expression substitution variable elsewhere in the code and should start
1592
with @. See Expression Substitutions above for details on usage of expression substitutions.\\\hline
1595
Estimated initial error on the parameter. Default is 1.\\\hline
1598
Set to true to fix the parameter (so that it is excluded from the optimisation). Default is false.\\\hline
1601
If required, set to the minimum value that the parameter can hold.\\\hline
1604
If required, set to the maximum value that the parameter can hold.\\\hline
1605
\multicolumn{2}{m{4.721cm}}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.319cm}|m{1.2019999cm}}
1619
\end{tabular}\hspace*{-\tabcolsep}
1621
\multicolumn{1}{m{11.974cm}}{\hspace*{-\tabcolsep}\begin{tabular}{|m{11.974cm}|}
1623
Define an arbitrary number of parameters. Parameters must be numbered consecutively, and each parameter must have at
1624
least the start value and name defined.\\\hline
1625
The optimiser will attempt to optimise against a score that is calculated by summing the Score1, Score2,... parameters
1626
on each iteration.\\\hline
1627
\end{tabular}\hspace*{-\tabcolsep}
1631
\clearpage\section{Field Properties}
1632
Invoke a field using PropertyString FieldType {\textless}fieldtype{\textgreater}. The field will be placed, normally
1633
centred on the MiceModule Position and with the appropriate Rotation. Further options for each field type are specified
1634
below, and relevant datacards are also given. If a fieldtype is specified some other properties must also be specified,
1635
while others may be optional, usually taking their value from defaults specified in the datacards. Only one fieldtype
1636
can be specified per module. However, fields from multiple modules are superimposed, each transformed according to the
1637
MiceModule specification. This enables many different field configurations to be simulated using G4MICE.
1639
To use BeamTools fields, datacard FieldMode Full must be set. This is the default.
1642
\tablefirsthead{\hline
1643
{\bfseries Property} &
1645
{\bfseries Description}\\}
1647
{\bfseries Property} &
1649
{\bfseries Description}\\}
1652
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
1654
{\itshape FieldType} &
1656
Set the field type of the MiceModule.\\\hline
1659
\subsection{FieldType CylindricalField}
1660
Sets a constant magnetic field in a cylindrical region symmetric about the z-axis of the module.
1663
\tablefirsthead{\hline
1664
{\bfseries Property} &
1666
{\bfseries Description}\\}
1668
{\bfseries Property} &
1670
{\bfseries Description}\\}
1673
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
1675
{\itshape ConstantField} &
1679
The magnetic field that will be placed in the region.\\\hline
1680
\multicolumn{2}{m{5.143cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.278cm}}
1686
\end{tabular}\hspace*{-\tabcolsep}
1688
The physical extent of the region.\\\hhline{~~-}
1691
\subsection{FieldType RectangularField}
1692
Sets a constant magnetic field in a rectangular region.
1695
\tablefirsthead{\hline
1696
{\bfseries Property} &
1698
{\bfseries Description}\\}
1700
{\bfseries Property} &
1702
{\bfseries Description}\\}
1705
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
1707
{\itshape ConstantField} &
1711
The magnetic field that will be placed in the region.\\\hline
1712
\multicolumn{2}{m{5.143cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.278cm}}
1720
\end{tabular}\hspace*{-\tabcolsep}
1722
The physical extent of the region.\\\hhline{~~-}
1725
\subsection{FieldType Solenoid}
1726
G4MICE simulates solenoids using a series of current sheets. The field for each solenoid is written to a field map on a
1727
rectangular grid and can then be reused. The field from each current sheet is calculated using the formula for current
1728
sheets detailed in MUCOOL Note 281, \textit{Modeling solenoids using coil, sheet and block conductors}.
1731
\tablefirsthead{\hline
1732
{\bfseries Property} &
1734
{\bfseries Description}\\}
1736
{\bfseries Property} &
1738
{\bfseries Description}\\}
1741
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
1743
{\itshape FileName} &
1745
Read or write solenoid data to the filename. If different modules have the same filename, G4MICE assumes they are the
1749
If set to Read, G4MICE will attempt to read existing data from the FileName. If set to Write, G4MICE will generate new
1750
data and write it to the FileName. If set to Analytic, G4MICE will calculate fields directly without interpolating. If
1751
set to WriteDynamic acts as in Write except the grid extent and grid spacing at each point is chosen dynamically to
1752
some tolerance defined in the FieldTolerance property. Takes default from datacard SolDataFiles (Write).\\\hline
1753
\multicolumn{2}{m{5.143cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.278cm}}
1757
{\itshape Thickness} &
1759
{\itshape InnerRadius} &
1761
{\itshape CurrentDensity} &
1763
\end{tabular}\hspace*{-\tabcolsep}
1765
Coil physical parameters. Only used in Write/Analytic mode where they are mandatory.\\\hhline{~~-}
1768
Field map extends to length + ZExtentFactor*innerRadius in Write mode. Takes default from datacard SolzMapExtendFactor
1769
(10.). Map size is chosen dynamically in WriteDynamic mode.\\\hline
1772
Field map extends to radius RExtentFactor*innerRadius in Write mode. Takes default from datacard SolrMapExtendFactor
1773
(2.018...). Avoid allowing grid nodes to fall on sheets.\\\hline
1776
Number of coordinates in \textit{z} in field map grid in Write mode. Takes default from datacard NumberNodesZGrid
1780
Number of coordintes in \textit{r} in field map grid in Write mode. Takes default from datacard NumberNodesRGrid
1784
Number of sheets used to calculate the field. Takes default from datacard DefaultNumberOfSheets (10).\\\hline
1785
{\itshape FieldTolerance } &
1787
Mandatory when FieldMapMode is WriteDynamic. If field map mode is write dynamic, this datacard controls the tolerance on
1788
errors in the field with which the field grid and the grid extent will be chosen. \\\hline
1793
Choose the interpolation algorithm. Options are BiLinear for a linear interpolation in \textit{r} and \textit{z}, or
1794
LinearCubic \ for a linear interpolation in \textit{r} and a cubic spline in \textit{z}. Default is
1795
LinearCubic.\\\hline
1798
Set to 1 to add the coil to CoilAmalgamtion parent field (see below).\\\hline
1802
\clearpage\subsection{FieldType FieldAmalgamation}
1803
During tracking, G4MICE stores a list of fields and for each one G4MICE checks to see if tracking is performed through a
1804
particular field map's bounding box. This can be slow if a large number of fields are present. One way to speed this up
1805
is to store contributions from many coils in a single CoilAmalgamation. A CoilAmalgamation searches through child
1806
modules for solenoids with PropertyBool IsAmalgamated set to true. If it finds such a coil, it will add the field
1807
generated by the solenoid to its own field map and disable the coil.
1810
\tablefirsthead{\hline
1811
{\bfseries Property} &
1813
{\bfseries Description}\\}
1815
{\bfseries Property} &
1817
{\bfseries Description}\\}
1820
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
1824
The Length of the field map generated by the CoilAmalgamation.\\\hline
1827
The maximum radius of the field map generated by the CoilAmalgamation.\\\hline
1832
Choose the interpolation algorithm. Options are BiLinear for a linear interpolation in \textit{r} and \textit{z}, or
1833
LinearCubic \ for a linear interpolation in \textit{r} and a cubic spline in \textit{z}. Default is
1834
LinearCubic.\\\hline
1835
\multicolumn{2}{m{5.143cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.278cm}}
1841
\end{tabular}\hspace*{-\tabcolsep}
1843
Step size of the field map generated by the CoilAmalgamation.\\\hhline{~~-}
1849
\clearpage\subsection{FieldType FastSolenoid}
1850
This is an alternative field model for solenoids that uses a power law expansion of the on-axis magnetic field and its
1851
derivatives, and an exponential fall-off for the fringe field (tanh).
1854
\tablefirsthead{\hline
1855
{\bfseries Property} &
1857
{\bfseries Description}\\}
1859
{\bfseries Property} &
1861
{\bfseries Description}\\}
1864
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
1866
{\itshape PeakField} &
1868
Nominal peak field of the solenoid.\\\hline
1869
{\itshape EFoldLength} &
1871
The fall-off length for the fringe field.\\\hline
1872
{\itshape CentreLength} &
1874
Nominal length for the peak field region.\\\hline
1877
Order to which the field will be calculated.\\\hline
1880
If positive, G4MICE will abort tracking if a particle crosses through a field with estimated error {\textgreater}
1881
FieldTolerance. G4MICE estimates the error as the field value calculated at highest order. Default is -1 (i.e.
1885
\subsection{Phasing Models}
1886
G4MICE has a number of sophisticated models for phasing RF cavities. These powerful models can make setting up RF
1887
cavities with realistic fields both quick and easy.
1889
When CavityMode is Unphased, G4MICE attempts to phase the cavity itself. When using CavityMode Unphased G4MICE needs to
1890
know when particles enter, cross the middle, and leave cavities. This means that:
1894
\item The cavity must sit in a rectangular or cylindrical physical volume.
1895
\item No other physical volumes may overlap or sit within the physical volume of the cavity.
1897
If these conditions are not met the phasing algorithm is likely to fail.
1899
To phase a cavity, G4MICE builds a volume in the centre of the cavity that is used for phasing and then fires a
1900
reference particle through the system. Stochastic processes are always disabled during this process, while mean energy
1901
loss can be disabled using the datacard ReferenceEnergyLossModel. If a reference particle crosses a plane through the
1902
centre of a cavity, it sets the phase of the cavity to the time at which the particle crosses.
1904
The field of the cavity during phasing is controlled by the property FieldDuringPhasing. There are four modes:
1908
\item \textit{None}: Cavity fields are disabled during phasing
1909
\item \textit{Electrostatic}: An electrostatic field with no positional dependence given by
1910
PeakEField*sin(ReferenceParticlePhase) is enabled during phasing.
1911
\item \textit{TimeVarying}: A standard time varying field is applied during phasing, initially with arbitrary phase
1912
relative to the reference particle. G4MICE uses a Newton-Raphson method to find the appropriate reference phase
1913
iteratively, with tolerance set by the datacard PhaseTolerance.
1914
\item \textit{EnergyGainOptimised}: A standard time varying field is applied during phasing, initially with arbitrary
1915
phase and peak field relative to the reference particle. G4MICE uses a 2D Newton-Raphson method to find the appropriate
1916
reference phase and peak field iteratively, so that the reference particle crosses the cavity centre with phase given
1917
by property ReferenceParticlePhase and gains energy over the whole cavity given by property EnergyGain with tolerances
1918
set by the datacards PhaseTolerance and RFDeltaEnergyTolerance.
1920
\subsection{Tracking Stability Around RF Cavities}
1921
Usually RF cavities have little or no fringe field, and this can lead to some instability in the tracking algorithms.
1922
When G4MICE makes a step into an RF cavity volume, the tracking algorithms tend to smooth out a field in a non-physical
1923
way. This can be prevented by either (i) making the step size rather small in the RF cavity or (ii) forcing G4MICE to
1924
stop tracking by adding a physical volume at the entrance of the RF cavity (a window, typically made of vacuum). Doing
1925
this should improve stability of tracking.
1927
\subsection{FieldType PillBox}
1928
Sets a PillBox field in a particular region. G4MICE represents pillboxes using a sinusoidally varying TM010 pill box
1929
field, with non-zero field vector elements given by
1932
\begin{gathered}B_{\phi }=J_1(k_rr)\cos (\omega t)\\E_z=J_0(k_rr)\cos (\omega t)\end{gathered}
1934
Here J\textsubscript{n} are Bessel functions and k\textsubscript{r} is a constant. See, for example, SY Lee VI.1. All
1938
\tablefirsthead{\hline
1939
{\bfseries Property} &
1941
{\bfseries Description}\\}
1943
{\bfseries Property} &
1945
{\bfseries Description}\\}
1948
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
1952
Length of the region in which the field is present.\\\hline
1953
{\itshape CavityMode} &
1955
Phasing mode of the cavity - options are Phased, Unphased and Electrostatic.\\\hline
1956
{\itshape FieldDuringPhasing} &
1958
Controls the field during cavity phasing -- options are None, Electrostatic, TimeVarying and
1959
EnergyGainOptimised.\\\hline
1960
{\itshape EnergyGain} &
1962
WhenFieldDuringPhasing is set to EnergyGainOptimised, controls the peak electric field.\\\hline
1963
{\itshape Frequency} &
1965
The cavity frequency.\\\hline
1966
{\itshape PeakEField} &
1968
The peak field of the cavity. Not used when the FieldDuringPhasing is EnergyGainOptimised.\\\hline
1969
{\itshape TimeDelay} &
1971
In Phased mode the time delay (absolute time) of the cavity.\\\hline
1974
Set to SpecialVirtual to make the central volume a special virtual.\\\hline
1975
\multicolumn{2}{m{5.143cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.278cm}}
1985
\end{tabular}\hspace*{-\tabcolsep}
1987
In Electrostatic mode, G4MICE calculates the peak field and the field the reference particle sees using a combination of
1988
the reference particle energy, charge and phase. Take defaults from datacards NominalKineticEnergy and MuonCharge
1994
G4MICE tries to phase the field so that the reference particle crosses the cavity at ReferenceParticlePhase (units are
1995
angular). 0\textsuperscript{o} corresponds to no energy gain, 90\textsuperscript{o} corresponds to operation on-crest.
1996
Default from datacard rfAcclerationPhase.\\\hline
1999
\subsection{FieldType RFFieldMap}
2000
Sets a cavity with an RF field map in a particular region. RFFieldMap uses the same phasing algorithm as described
2004
\tablefirsthead{\hline
2005
{\bfseries Property} &
2007
{\bfseries Description}\\}
2009
{\bfseries Property} &
2011
{\bfseries Description}\\}
2014
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
2018
Length of the region in which the field is present.\\\hline
2019
{\itshape CavityMode} &
2021
Phasing mode of the cavity - options are Phased and Unphased. RFFieldMaps cannot operated in Electrostatic mode.\\\hline
2022
{\itshape FieldDuringPhasing} &
2024
Controls the field during cavity phasing -- options are None, Electrostatic, TimeVarying and
2025
EnergyGainOptimised.\\\hline
2026
{\itshape EnergyGain} &
2028
WhenFieldDuringPhasing is set to EnergyGainOptimised, controls the peak electric field.\\\hline
2029
{\itshape Frequency} &
2031
The cavity frequency.\\\hline
2032
{\itshape PeakEField} &
2034
The peak field of the cavity. Not used when the FieldDuringPhasing is EnergyGainOptimised.\\\hline
2035
{\itshape TimeDelay} &
2037
In Phased mode the time delay (absolute time) of the cavity.\\\hline
2040
Set to SpecialVirtual to make the central volume a special virtual.\\\hline
2041
\multicolumn{2}{m{5.143cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.278cm}}
2051
\end{tabular}\hspace*{-\tabcolsep}
2053
In Electrostatic mode, G4MICE calculates the peak. field and the field the reference particle sees using a combination
2054
of the reference particle energy, charge and phase. Take defaults from datacards NominalKineticEnergy and MuonCharge
2060
G4MICE tries to phase the field so that the reference particle crosses the cavity at ReferenceParticlePhase (units are
2061
angular). 0\textsuperscript{o} corresponds to no energy gain, 90\textsuperscript{o} corresponds to operation on-crest.
2062
Default from datacard rfAcclerationPhase.\\\hline
2063
{\itshape FileName} &
2065
The file name of the field map file.\\\hline
2066
{\itshape FileType} &
2068
The file type of the field map. Only supported option is SuperFishSF7.\\\hline
2072
\clearpage\subsection{FieldType Multipole}
2073
Creates a multipole of arbitrary order. Fields are generated using either a hard edged model, with no fringe fields at
2074
all; or an Enge model similar to ZGoubi and COSY. In the former case fields are calculated using a simple polynomial
2075
expansion. In the latter case fields are calculated using the polynomial expansion with an additional exponential drop
2076
off. Fields can be superimposed onto a bent coordinate system to generate a sector multipole with arbitrary fixed
2077
radius of curvature.
2079
Unlike most other field models in G4MICE, the zero position corresponds to the center of the entrance of the multipole;
2080
and the multipole extends in the +z direction.
2082
The method to define end fields is described in the section EndFieldTypes below
2085
\tablefirsthead{\hline
2086
{\bfseries Property} &
2088
{\bfseries Description}\\}
2090
{\bfseries Property} &
2092
{\bfseries Description}\\}
2095
\begin{supertabular}{|m{3.691cm}|m{1.252cm}|m{12.052cm}|}
2099
The reference pole of the magnet. 1=dipole, 2=quadrupole, 3=sextupole etc.\\\hline
2100
{\itshape FieldStrength} &
2102
Scale the field strength in the good field region. For dipoles, this sets the dipole field; for quadrupoles this sets
2103
the field gradient. Note that for some end field settings there can be no good field region (e.g. if the end length is
2104
{\textgreater}\~{} centre length).\\\hline
2107
Height of the field region.\\\hline
2110
Width or delta radius of the field region.\\\hline
2113
Length of the field along the bent trajectory.\\\hline
2116
Set to HardEdged to disable fringe fields. Set to Enge or Tanh to use those models, as described elsewhere. Default is
2120
Choose the model for curvature. Straight forces no curvature. Constant gives a constant radius of curvature;
2121
StraightEnds gives a constant radius of curvature along the length of the multipole with straight end fields beyond
2122
this length. MomentumBased gives radius of curvature determined by a momentum and a total bending angle.\\\hline
2123
ReferenceCurvature &
2125
Radius of curvature of the magnet in Constant or StraightEnds mode. Set to 0 for a straight magnet. Default is
2129
Reference momentum used to calculate the radius of curvature of a dipole in MomentumBased mode. Default is 0.\\\hline
2130
{\itshape BendingAngle} &
2132
The angle used to calculate the radius of curvature of a dipole in MomentumBased mode. Note that this is mandatory in
2133
MomentumBased mode.\\\hline
2139
\clearpage\subsection{FieldType CombinedFunction}
2140
This creates superimposed dipole, quadrupole and sextupole fields with a common radius of curvature. The field is
2141
intended to mimic the first few terms in a multipole expansion of a field like
2144
B(y=0)=B_0\left(\frac r{r_0}\right)^k
2146
The field index is a user defined parameter, while the dipole field and radius of curvature can either be defined
2147
directly by the user or defined in terms of a reference momentum and total bending angle. Fields are calculated as in
2148
the multipole field type defined above.
2151
\tablefirsthead{\hline
2152
{\bfseries Property} &
2154
{\bfseries Description}\\}
2156
{\bfseries Property} &
2158
{\bfseries Description}\\}
2161
\begin{supertabular}{|m{3.689cm}|m{1.252cm}|m{12.054cm}|}
2165
The reference pole of the magnet. 1=dipole, 2=quadrupole, 3=sextupole etc.\\\hline
2166
{\itshape BendingField} &
2168
The nominal dipole field \textit{B}\textit{\textsubscript{0}}. Note that this is mandatory in all cases except where
2169
CurvatureModel is MomentumBased, when the BendingAngle and ReferenceMomentum is used to calculate the \ dipole field
2171
{\itshape FieldIndex} &
2173
The field index \textit{k}.\\\hline
2176
Height of the field region.\\\hline
2179
Width or delta radius of the field region.\\\hline
2182
Length of the field along the bent trajectory.\\\hline
2185
Set to HardEdged to disable fringe fields. Set to Enge or Tanh to use those models, as described elsewhere. Default is
2189
Choose the model for curvature. Straight forces no curvature. Constant gives a constant radius of curvature;
2190
StraightEnds gives a constant radius of curvature along the length of the multipole with straight end fields beyond
2191
this length. MomentumBased gives radius of curvature determined by a momentum and a total bending angle.\\\hline
2192
ReferenceCurvature &
2194
Radius of curvature of the magnet in Constant or StraightEnds mode. Set to 0 for a straight magnet. Default is
2198
Reference momentum used to calculate the radius of curvature of a dipole in MomentumBased mode. Default is 0.\\\hline
2199
{\itshape BendingAngle} &
2201
The angle used to calculate the radius of curvature of a dipole in MomentumBased mode. Note that this is mandatory in
2202
MomentumBased mode.\\\hline
2205
\clearpage\subsection{EndFieldTypes}
2206
In the absence of current sources, the magnetic field can be calculated from a scalar potential using the standard
2212
The scalar magnetic potential of the n\textsuperscript{th}{}-order multipole field is given by
2215
V_n=\sum _{q=0}^{q_m}\sum _{m=0}^nn!^2\frac{G^{(2q)}(s)(r^2+y^2)^q\sin (\frac{m\pi } 2)r^{n-m}y^m}{4^qq!(n+q)!m!(n-m)!}
2217
where \textit{G(s)} is either the double Enge function,
2220
G(s)=E[(x-x_0)/\lambda ]+E[(-x-x_0)/\lambda ]-1
2223
E(s)=\frac{B_0}{R_0^n}\frac 1{1+\exp (C_1+C_2s+C_3s^2+...)}
2225
or G(s) is the double tanh function,
2228
G(s)=\tanh [(x+x_0)/\lambda ]/2+\tanh [(x-x_0)/\lambda ]/2
2230
and \textit{(r, y, s)} is the position vector in the rotating coordinate system. Note that here s is the distance from
2231
the nominal end of the field map.
2234
\tablefirsthead{\hline
2235
{\bfseries Property} &
2237
{\bfseries Description}\\}
2239
{\bfseries Property} &
2241
{\bfseries Description}\\}
2244
\begin{supertabular}{|m{3.689cm}|m{1.252cm}|m{12.054cm}|}
2248
Set to HardEdged to disable fringe fields. Set to Enge or Tanh to use those models, as described elsewhere. Default is
2250
\multicolumn{3}{|m{17.394999cm}|}{{\itshape The following properties are used for EndFieldType Tanh}}\\\hline
2253
Set the l parameter that defines the rapidity of the field fall off.\\\hline
2256
Set the \textit{x}\textit{\textsubscript{0}} parameter that defines the length of the flat field region.\\\hline
2259
Set the maximum pole that will be calculated -- should be larger than the multipole pole.\\\hline
2260
\multicolumn{3}{|m{17.394999cm}|}{{\itshape The following properties are used for EndFieldType Enge}}\\\hline
2263
Set the l parameter that defines the rapidity of the field fall off.\\\hline
2266
Set the \textit{x}\textit{\textsubscript{0}} parameter that defines the length of the flat field region.\\\hline
2269
Set the maximum pole that will be calculated -- should be larger than the multipole pole.\\\hline
2270
\multicolumn{2}{m{5.1410003cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.689cm}|m{1.252cm}}
2280
\end{tabular}\hspace*{-\tabcolsep}
2282
Set the parameters C\textsubscript{i} as defined in the Enge function above.\\\hhline{~~-}
2285
\subsection{FieldType MagneticFieldMap}
2286
Reads or writes a magnetic field map in a particular region. Two sorts of field maps are supported; either a 2d field
2287
map, in which cylindrical symmetry is assumed, or a 3d field map.
2289
For 2d field maps, G4MICE reads or writes a file that contains information about the radial and longitudinal field
2290
components. This is intended for solenoidal field maps where only radial and longitudinal field components are present.
2291
Note that in write mode, G4MICE assumes cylindrical symmetry of the fields. In this case, G4MICE writes the \textit{x}
2292
and \textit{z} components of the magnetic field at points on a grid in \textit{x} and \textit{z}. Fields with an
2293
electric component are excluded from this summation.
2295
For 3d field maps, G4MICE reads a file that contains the position and field in cartesian coordinates and performs a
2296
linear interpolation. This requires quite large field map files; the file size can be slightly reduced by using certain
2297
symmetries, as described below. It is currently not possible to write 3d field maps.
2300
\tablefirsthead{\hline
2301
{\bfseries Property} &
2303
{\bfseries Description}\\}
2305
{\bfseries Property} &
2307
{\bfseries Description}\\}
2310
\begin{supertabular}{|m{3.665cm}|m{1.278cm}|m{12.052cm}|}
2312
{\itshape FieldMapMode} &
2314
Set to Read to read a field map; and Write to write a field map.\\\hline
2315
{\itshape FileName} &
2317
The file name that is used for reading or writing.\\\hline
2320
The file format. Supported options in Read mode are g4micetext, g4micebinary, g4beamline, icool, g4bl3dGrid. Only
2321
g4micetext is supported in Write mode. Default is g4micetext.\\\hline
2324
Symmetry option for g4bl3dGrid file type. Options are None, Dipole or Quadrupole. None uses the field map as is, while
2325
Dipole and Quadrupole reflect the octant between the positive \textit{x}, \textit{y} and \textit{z} axes to give an
2326
appropriate field for a dipole or quadrupole.\\\hline
2327
\multicolumn{2}{m{5.143cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.278cm}}
2333
\end{tabular}\hspace*{-\tabcolsep}
2335
Step size in \textit{z} and \textit{r}. Mandatory in Write mode but not used in Read mode (where step size comes from
2336
the map file).\\\hhline{~~-}
2337
\multicolumn{2}{m{5.143cm}|}{\hspace*{-\tabcolsep}\begin{tabular}{|m{3.665cm}|m{1.278cm}}
2347
\end{tabular}\hspace*{-\tabcolsep}
2349
Upper and lower bounds in \textit{z} and \textit{r}. Mandatory in Write mode but not used in Read mode (where boundaries
2350
come from the map file).\\\hhline{~~-}
2353
Some file formats are described below. I am working towards making the file format more generic and hence possibly
2354
easier to use, but backwards compatibility will hopefully be maintained.
2356
\clearpage\subsubsection{g4micetext Field Map Format}
2357
The native field map format used by g4mice in text mode is described below.
2360
\# GridType = Uniform N = \textbf{number\_rows}}
2363
\# Z1 = \textbf{z\_start} Z2 = \textbf{z\_end} dZ = \textbf{z\_step}}
2366
\# R1 = \textbf{r\_start} R2 = \textbf{r\_end} dR = \textbf{r\_step}}
2369
Bz\_Values\ \ Br\_Values}
2375
{\textless}Repeat as necessary{\textgreater}}
2377
In this mode, field maps are represented by field values on a regular 2d grid that is assumed to have solenoidal
2378
symmetry, i.e. cylindrical symmetry with no tangential component.
2381
\tablefirsthead{\hline
2384
{\bfseries Description}\\}
2388
{\bfseries Description}\\}
2391
\begin{supertabular}{|m{3.665cm}|m{2.305cm}|m{11.025001cm}|}
2393
{\ttfamily\bfseries number\_rows} &
2395
Number of rows in the field map file.\\\hline
2396
{\ttfamily\bfseries z\_start} &
2398
Position of the grid start along the \textit{z} axis.\\\hline
2399
{\ttfamily\bfseries z\_end} &
2401
Position of the grid end along the \textit{z} axis.\\\hline
2402
{\ttfamily\bfseries z\_step} &
2404
Step size in \textit{z}.\\\hline
2405
{\ttfamily\bfseries r\_start} &
2407
Position of the grid start along the \textit{r} axis.\\\hline
2408
{\ttfamily\bfseries r\_end} &
2410
Position of the grid end along the \textit{r} axis.\\\hline
2411
{\ttfamily\bfseries r\_step} &
2413
Step size in \textit{r}.\\\hline
2414
{\ttfamily\bfseries Bz\_Values} &
2416
\textit{Bz} field value.\\\hline
2417
{\ttfamily\bfseries Br\_Values} &
2419
\textit{Br} field value.\\\hline
2422
\subsubsection{g4bl3dGrid Field Map Format}
2423
The file format for 3d field maps is a slightly massaged version of a file format used by another code, g4beamline. In
2424
this mode, field maps are represented by field values on a regular cartesian 3d grid.
2427
number\_x\_points number\_y\_points number\_z\_points global\_scale}
2430
1 X [\textbf{x\_scale}]}
2433
2 Y [\textbf{y\_scale}]}
2436
3 Z [\textbf{z\_scale}]}
2439
4 BX [\textbf{bx\_scale}]}
2442
5 BY [\textbf{by\_scale}]}
2445
6 BZ [\textbf{bz\_scale}]}
2451
X\_Values \ \ Y\_Values\ \ Z\_Values\ \ Bx\_values\ \ By\_values\ \ Bz\_values}
2454
...\ \ \ \ ...\ \ \ \ ...\ \ \ \ ...\ \ \ \ ...\ \ \ \ ...}
2457
{\textless}Repeat as necessary{\textgreater}}
2459
where text in bold indicates a value described in the following table
2462
\tablefirsthead{\hline
2465
{\bfseries Description}\\}
2469
{\bfseries Description}\\}
2472
\begin{supertabular}{|m{3.665cm}|m{2.305cm}|m{11.025001cm}|}
2474
{\ttfamily\bfseries number\_x\_points} &
2476
Number of points along x axis.\\\hline
2477
{\ttfamily\bfseries number\_y\_points} &
2479
Number of points along y axis.\\\hline
2480
{\ttfamily\bfseries number\_z\_points} &
2482
Number of points along z axis.\\\hline
2483
{\ttfamily\bfseries global\_scale} &
2485
Global scale factor applied to all x, y, z and Bx, By, Bz values.\\\hline
2486
{\ttfamily\bfseries x\_scale} &
2488
Scale factor applied to all x values.\\\hline
2489
{\ttfamily\bfseries y\_scale} &
2491
Scale factor applied to all y values.\\\hline
2492
{\ttfamily\bfseries z\_scale} &
2494
Scale factor applied to all z values.\\\hline
2495
{\ttfamily\bfseries bx\_scale} &
2497
Scale factor applied to all Bx values.\\\hline
2498
{\ttfamily\bfseries by\_scale} &
2500
Scale factor applied to all By values.\\\hline
2501
{\ttfamily\bfseries bz\_scale} &
2503
Scale factor applied to all Bz values.\\\hline
2504
{\ttfamily\bfseries X\_Values} &
2506
List (column) of each x value.\\\hline
2507
{\ttfamily\bfseries Y\_Values} &
2509
List (column) of each y value.\\\hline
2510
{\ttfamily\bfseries Z\_Values} &
2512
List (column) of each z value.\\\hline
2513
{\ttfamily\bfseries Bx\_Values} &
2515
List (column) of each Bx value.\\\hline
2516
{\ttfamily\bfseries By\_Values} &
2518
List (column) of each By value.\\\hline
2519
{\ttfamily\bfseries Bz\_Values} &
2521
List (column) of each Bz value.\\\hline