Updated documentation.

This commit is contained in:
salman committed 2026-08-12 13:46:52 +02:00
1 parent 88cc30829f
commit 815c0f01c5
3 files changed
+1099 -1014

No files matched your search

BIN
View File
Binary file not shown.
+196 -153
View File
@@ -37,14 +37,13 @@ $^3$ ISIS Facility, Rutherford Appleton Laboratory, Chilton, Oxon OX11 0QX, U.K.
\maketitle
\footnotesize
\begin{center}
PSI, August 12th, 2016
PSI, original manual August 2016; source-checked documentation revision August 2026
\end{center}\vspace{2mm}
\normalsize
\abstracts{
``musrSim'' is a simulation program based on Geant4,
optimised for the $\mu$SR instruments.
This document describes some of the commands used in the user macros
of the simulation program for the $\mu$SR instruments based on the {\sc
This document describes the user-macro interface implemented by the supplied source code for the $\mu$SR instruments based on the {\sc
Geant4}. The root output variables are also described.}
%========================================================================================================
@@ -126,7 +125,7 @@ and with Root version 6.30.02. While the version of Root should not be critical,
the users of musrSim are encouraged to always use the latest version of Geant4
due to continuous improvements of this package. Up to date
instructions are available on
https://bitbucket.org/zaher-salman/musrsim/. A novice
https://gitea.psi.ch/LMU/musrsim. A novice
user of Geant4 may consider reading 30 pages of chapter~2 of the
Geant4 User's Guide for Application Developers, called
``Getting Started with Geant4 - Running a Simple Example''.
@@ -136,7 +135,7 @@ simulation is started by executing:
{\bf $>$ musrSim \emph{RUNNUMBER}.mac} \\
where \emph{RUNNUMBER}.mac is a ``macro file'' containing the information about
the instrument setup. The string \emph{RUNNUMBER} is an integer representing the run number.
the instrument setup. The conventional macro name begins with an integer run number. The executable applies \texttt{atoi()} to the macro-file name when setting the Geant4 run-ID counter, so a leading integer is recommended.
In order to simulate a new instrument, the user has to define the following blocks of information
in the macro file:
@@ -195,7 +194,7 @@ are summarised in table~\ref{tab:units}.
Energy && MeV \\
Momentum && MeV/c\\
Magnetic field && tesla \\
Electric field && keV/mm \\
Electric field && kV/mm \\
Angle && degree \\
\hline
\end{tabular}
@@ -266,7 +265,7 @@ If a particle enters the ``kill \ldots'' volume, it is removed from further simu
The same is true for the ``shield \ldots'' or ``Shield \ldots'' volumes for
any particle apart for a muon.
The motivation for this kind of volumes was to speed up the simulation by removing tracks
that are unlikely to hit any detector. The ``kill'', ``shield'' and ``Shield'' volumes should be use with
that are unlikely to hit any detector. The ``kill'', ``shield'' and ``Shield'' volumes should be used with
care.
\begin{description}
@@ -274,45 +273,41 @@ care.
\item{\bf /musr/command construct \emph{solid} \emph{name} \emph{dimensions} ... \emph{material}
\emph{x} \emph{y} \emph{z} \emph{motherVolume} \emph{matrixName}
\emph{sensitiveClass} \emph{idNumber} }\\
This command defines a volume in {\sc Geant4} (It comprises three steps of {\sc Geant4}: defines a solid,
This command defines a volume in {\sc Geant4} (It comprises three steps of {\sc Geant4}: defines a solid,
logical volume and physical volume. Details can be found in {\sc Geant4} manual). \\
\begin{itemize}
\item \emph{solid} (string) can be one of the G4VSolid.cc particular types, presently ``tubs'', ``cons'',
``box'', ``trd'', ``sphere'', ``para'', ``polycone''
or it can be one of the specifically implemented solids by our program as ``uprofile''
(an U-profiled bar), ``alcSupportPlate'' (shape specific to ALC support plate), ``tubsbox''
(a tube with a rectangular hole along its axis), ``tubsboxsegm''
(a volume that looks like an intersection of tube and box) and
``trd90y'' (a trd volume rotated by 90 degrees around $y$ axis in addition
to the rotation requested by \emph{matrixName}),
``cylpart'' (cylinder from which a box has been subtracted)
``GPDcollimator'' (collimator used at GPD instrument). Not all G4VSolids defined
in Geant4 are
presently supported, but it is relatively easy to implement a new kind of solids
in the musrDetectorConstruction.cc class.
The ``polycone'' in Geant4 can be defined in two ways, which have to be
distinguished in the musrSim macro file:
``polyconeA'' corresponds to \\
G4Polycone(solidName, phiStart, phiTotal, numZPlanes, zPlane[ ], rInner[ ], rOuter[ ])\\
while ``polyconeB'' corresponds to \\
G4Polycone(solidName, phiStart, phiTotal, numRZ, r[ ], z[ ]),\\
where \emph{zPlane}, \emph{rInner}, \emph{rOuter}, \emph{r}, \emph{z} are arrays, which
have to be defined by the command ``/musr/command arrayDef''.
\item \emph{name} (string) stands for the name of the volume. As the command
``/musr/command construct'' constructs
three kinds of Geant4 classes/volumes (the solid, logical volume and physical
\begin{itemize}
\item \emph{solid} (string) selects the solid constructor. The parser in the present source recognises the
Geant4-like tokens ``tubs'', ``cons'', ``box'', ``trd'', ``trd90y'', ``sphere'', ``para'', ``torus'',
``polyconeA'' and ``polyconeB''. It also contains specialised constructors
``cylpart'', ``uprofile'', ``BarWithBevelledEdgesX'', ``alcSupportPlate'',
``TubeWithTubeHole'', ``TubeWithHoleAndTubeHole'', ``TubeWithHolePlusTubeHole'',
``tubsbox'', ``tubsbox2'', ``boxbox'', ``GPSforward'', ``GPSbackward'', ``GPSbackwardVeto'',
``tubeWithWindows'', ``GPDcollimator'', ``tubsboxsegm'', ``GPDsampleHolderA'', ``GPDmHolder'' and
``cruciform''. The specialised shapes have parameter lists defined directly in
\texttt{musrDetectorConstruction.cc}; users should copy a working example or check that source before
using a specialised shape whose dimensions are not documented below.
A Geant4 polycone must be requested as either ``polyconeA'' or ``polyconeB''; the plain token
``polycone'' is not accepted by the current parser. ``polyconeA'' corresponds to \\
G4Polycone(solidName, phiStart, phiTotal, numZPlanes, zPlane[ ], rInner[ ], rOuter[ ])\\
while ``polyconeB'' corresponds to \\
G4Polycone(solidName, phiStart, phiTotal, numRZ, r[ ], z[ ]).\\
The arrays \emph{zPlane}, \emph{rInner}, \emph{rOuter}, \emph{r} and \emph{z} have to be
defined previously with ``/musr/command arrayDef''.
\item \emph{name} (string) stands for the name of the volume. As the command
``/musr/command construct'' constructs
three kinds of Geant4 classes/volumes (the solid, logical volume and physical
volume), there are three names of the concrete volume used internally inside
musrSim: sol\_\emph{name}, log\_\emph{name} and phys\_\emph{name}.
The main volume, inside which all other volumes are positioned, has to be called ``World''.
\item \emph{dimensions} (floats) define the size of the required solid. They are kept equivalent to the
dimensions of solids as used in {\sc Geant4}. For example the ``box'' is defined
by its {\bf halflengths} along $x$, $y$ and $z$ coordinates. Note that the number of
\emph{dimensions} varies for each type of solid. The units are mm for lengths
and degrees for angles.
\item \emph{material} (float) one of the materials defined in {\sc Geant4}, namely in the file
\$G4INSTALL/source/materials/src/G4NistMaterialBuilder.cc (e.g. ``G4\_Galactic'' for
vacuum, ``G4\_Cu'' for copper, ``G4\_AIR'' for air,
by its {\bf halflengths} along $x$, $y$ and $z$ coordinates. Note that the number of
\emph{dimensions} varies for each type of solid. The units are mm for lengths
and degrees for angles.
\item \emph{material} (string) one of the materials defined in {\sc Geant4}, namely in the file
\$G4INSTALL/source/materials/src/G4NistMaterialBuilder.cc (e.g. ``G4\_Galactic'' for
vacuum, ``G4\_Cu'' for copper, ``G4\_AIR'' for air,
``G4\_PLASTIC\_SC\_VINYLTOLUENE'' for a scintillator, ...).
One can also define a new material inside the function
musrDetectorConstruction::DefineMaterials(). Presently ``Mylar'', ``Brass''
@@ -585,8 +580,19 @@ care.
\item{\bf /musr/command process SetLossFluctuations\_OFF \emph{particle} \emph{process}}\\
Switches off the statistical fluctuations in the ionisation losses. Can be usefull
for some technical studies. Presently works only for \emph{G4eIonisation} and
for \emph{G4MuIonisation}.
for some technical studies. Presently works only for \emph{G4eIonisation} and
for \emph{G4MuIonisation}.
\item{\bf /musr/command process addModel \emph{particle} \emph{process} \emph{model} \emph{priority}}\\
Adds a supported electromagnetic model to a process. In the present source the implemented
combinations are \texttt{G4WentzelVIModel} or \texttt{G4UrbanMscModel} for
\texttt{G4MuMultipleScattering}. The process has to exist before the model is added.
\item{\bf /musr/command process cutForGamma \emph{cutInMm}}\\
\item{\bf /musr/command process cutForElectron \emph{cutInMm}}\\
Set the Geant4 production cuts for gamma and for electrons/positrons, respectively.
The numeric value is interpreted as millimetres. A corresponding \texttt{cutForMuon}
implementation is present only as disabled/commented code and is not a supported macro command.
\end{description}
\noindent For the interaction of keV $\mu^+$ with nanometer-thin carbon foils -- as they are used in the
@@ -687,19 +693,19 @@ This way the smearing of the vertex as well as beam tilt/pitch are propagated th
Set maximum allowed radius of the beam relative to x0 and y0,
i.e.\ relative to the centre of the beam. This command might be useful when the beam
centre is not created at x0=y0=0, but the user wishes to restrict the beam
within a symmetric cone around x0 and y0. \\
(Ignored by the TURTLE input).
within a symmetric cone around x0 and y0. \\
(Ignored by the TURTLE input).
\item{\bf /gun/boxboundarycentre \emph{xMaxSource0} \emph{yMaxSource0} \emph{xMaxSource0} \emph{unit}} \\
\item{\bf /gun/boxboundarycentre \emph{xMaxSource0} \emph{yMaxSource0} \emph{zMaxSource0} \emph{unit}} \\
See below ``/gun/boxboundary''.
\item{\bf /gun/boxboundary \emph{xMaxSource} \emph{yMaxSource} \emph{xMaxSource} \emph{unit}} \\
\item{\bf /gun/boxboundary \emph{xMaxSource} \emph{yMaxSource} \emph{zMaxSource} \emph{unit}} \\
Define a box, within which the generated particles (muons) are created.
The variables \emph{xMaxSource0}, \emph{yMaxSource0} and \emph{xMaxSource0} define the
centre of the box, the variables \emph{xMaxSource}, \emph{yMaxSource} and \emph{xMaxSource} define the
halfwidth, halfheight and halflength of the box. \\
This command can be useful for the laser-induced muon beam at ISIS.\\
(Ignored by the TURTLE input).
The variables \emph{xMaxSource0}, \emph{yMaxSource0} and \emph{zMaxSource0} define the
centre of the box, the variables \emph{xMaxSource}, \emph{yMaxSource} and \emph{zMaxSource} define the
halfwidth, halfheight and halflength of the box. \\
This command can be useful for the laser-induced muon beam at ISIS.\\
(Ignored by the TURTLE input).
\item{\bf /gun/kenergy \emph{kineticEnergy} \emph{unit}}\\
Set the mean kinetic energy of the initial particles (muons).\\
@@ -724,12 +730,16 @@ This way the smearing of the vertex as well as beam tilt/pitch are propagated th
\item{\bf /gun/tilt \emph{xangle0} \emph{yangle0} \emph{dummy} \emph{unit}}\\
The ``beam tilt'' is understood as a constant angle tilt that is applied to
all initial particles (muons) regardless on their distance from the centre of the beam.\\
(Applicable also to TURTLE input).
(Applicable also to TURTLE input).
\item{\bf /gun/tiltsigma \emph{xangleSigma} \emph{yangleSigma} \emph{zangleSigma} \emph{unit}}\\
Gaussian smearing of the tilt angle, if zangleSigma $>= 0$\\
generation of $\cos\Theta$ distribution, if zangleSigma $< 0$.\\
(Presently ignored by the TURTLE input).
Gaussian smearing of the tilt angle is used when \emph{zangleSigma} $>= 0$; generation of a
$\cos\Theta$ angular distribution is selected when \emph{zangleSigma} $< 0$. Although the
Geant4 messenger guidance still labels the third component as a dummy value, the present implementation
uses it as this mode selector.\\
{\bf Current implementation caveat:} \texttt{zangleSigma} is not initialised in the constructor.
Explicitly issue this command in ParticleGun mode rather than relying on an implicit default.\\
(Presently ignored by the TURTLE input).
\item{\bf /gun/pitch \emph{pitch} \emph{unit}}\\
The ``beam pitch'' is understood as a variable angle applied to the initial particles
@@ -842,11 +852,13 @@ This way the smearing of the vertex as well as beam tilt/pitch are propagated th
the mean momentum from 28\,MeV/c to 14\,MeV/c, this scaling factor has to be set to 0.5.
Note that also the momentum bite will be reduced by the same scaling factor.
This scaling is done before the command ``/gun/turtleMomentumBite'' (if both are
requested).
requested).
\item{\bf /gun/turtleFirstEventNr \emph{lineNumberOfTurtleFile} }\\
Set the line number that should be taken as the first event from the TURTLE input file.
This option is needed when the user wants to reproduce the simulation of an event
In the present implementation this value is the number of TURTLE lines skipped before the first event is read.
Thus a value of 0 starts with the first line, and a value of N starts with the line after N skipped lines.
The command name and messenger text describe this as a line number, so take care with the off-by-one convention.
This option is needed when the user wants to reproduce the simulation of an event
using the same random number generator and TURTLE initial particle as in some previous
run, however he wants to skip some (uninteresting) events at the beginning of the simulation.
@@ -854,16 +866,19 @@ This way the smearing of the vertex as well as beam tilt/pitch are propagated th
In most cases, musrSim uses the so called ``G4ParticleGun'' to generate the primary
particles (muons). The commands for G4ParticleGun were summarised previously,
they start with /gun/ keyword.\\
However, there is an alternative particle generator
called ``GPS (General Particle Source)'', which is useful when simulating
the decays of radioactive atoms and for other purposes.
Whenever the /gps/ keyword is used, the ``G4ParticleGun'' is not initiated
(and all /gun/* commands are ignored).
The description of GPS can be found at http://reat.space.qinetiq.com/gps/~,
some of the useful commands are:\\
/gps/particle ion\\
/gps/ion 38 90 0 0\\
/gps/position 0 0 0\\
However, there is an alternative particle generator
called ``GPS (General Particle Source)'', which is useful when simulating
the decays of radioactive atoms and for other purposes.
Whenever any /gps/ keyword is present in the macro, musrSim selects
\texttt{G4GeneralParticleSource} instead of constructing its \texttt{G4ParticleGun}.
{\bf Current implementation caveat:} the custom \texttt{/gun/} messenger is still registered and several
\texttt{/gun/} handlers dereference the ParticleGun. Therefore do \emph{not} mix \texttt{/gun/*} commands with a GPS
macro; they are not reliably ignored by the present source.
The GPS commands themselves are Geant4 commands; consult the Geant4 General Particle Source documentation.
Some useful commands are:\\
/gps/particle ion\\
/gps/ion 38 90 0 0\\
/gps/position 0 0 0\\
/gps/energy 0 keV\\
/gps/ang/maxtheta 2 deg\\
/gps/ang/maxphi 2 deg\\
@@ -896,6 +911,13 @@ in order to simulate optical photons:
will be ignored internally in musrSim, and the user therefore does not have to
comment out other parameters connected with optical photons in the macro file.
\item{\bf /musr/command G4OpticalPhotonsUnprocess \emph{true}}\\
Keeps optical photons enabled in Geant4 but suppresses musrSim's optical-photon signal processing in
\texttt{musrScintSD}. This specialised mode was introduced for workflows that first preselect reproducible
events and only later perform the expensive optical-signal processing. It is meaningful only together with
\texttt{G4OpticalPhotons true}. The default is false.
\item{\bf /musr/command materialPropertiesTable \emph{MPT\_name} \emph{property} \emph{n}
\emph{E(1)} ... \emph{E(n)} \emph{val(1)} ... \emph{val(n)} } \\
Defines some optical \emph{property} of a given material (e.g.\ absorption lenght,
@@ -986,11 +1008,29 @@ in order to simulate optical photons:
second column ... amplitude of the APD response function\\
{\bf Internally in musrSim, the data read from this file are interpolated to the
centres of the bins of the histograms defined by
``/musr/command OPSA OPSAhist ''}.
``/musr/command OPSA OPSAhist ''}.
\item{\bf CFD \emph{a1} \emph{delay} \emph{timeShiftOffset}}\\
\item{\bf minNrOfDetectedPhotons}\\
\item{\bf photonFractions}\\
\item{\bf CFD \emph{a1} \emph{delay} \emph{timeShiftOffset}}\\
Configures the constant-fraction-discriminator calculation. \emph{a1} is the scale applied to the
unshifted pulse, \emph{delay} is the time shift used when constructing the CFD waveform, and
\emph{timeShiftOffset} is added to the reported crossing time. The numerical time values use the same
time coordinate as the OPSA histogram (normally ns).
\item{\bf minNrOfDetectedPhotons \emph{N}}\\
Minimum number of detected photons required for an optical-photon signal to be processed by OPSA.
\item{\bf signalSeparationTime \emph{time}}\\
Time separation in ns above which detected photons are assigned to a new optical-photon signal.
\item{\bf photonFractions \emph{fracA} \emph{fracB} \emph{thresholdC} \emph{thresholdD}}\\
Sets the fractions used for \texttt{odet\_timeA}/\texttt{odet\_timeB} and the absolute/normalised
signal thresholds used for \texttt{odet\_timeC}/\texttt{odet\_timeD}.
\item{\bf APDcells \emph{nx} \emph{ny} \emph{nz} \emph{halfX} \emph{halfY} \emph{halfZ}}\\
Enables finite APD-cell effects. The sensitive device is divided into \emph{nx}$\times$\emph{ny}$\times$\emph{nz}
cells within the supplied half-dimensions. The parser passes the dimensions directly to the APD-cell
calculation; Geant4 internal length units are mm, so these numerical half-dimensions are interpreted as mm.
\item{\bf SetAPDcellsTimeVariationSigma \emph{sigma}}\\
Enables a Gaussian time variation for APD cells when \emph{sigma} is non-zero. The parser interprets
\emph{sigma} in ns.
\item{\bf SetAPDcrossTalk \emph{probability}}\\
Enables APD cross-talk when the supplied probability is greater than zero.
\end{description}
\end{description}
@@ -1073,12 +1113,17 @@ in order to simulate optical photons:
This command is similar to the previous one. Only the events,
in which there was at least one hit in the volume with the
\emph{volumeID} will be saved into the output Root tree.
This command might be useful in some technical studies, it might
introduce some bias in a physics study.
This command might be useful in some technical studies, it might
introduce some bias in a physics study.
\item{\bf /musr/command storeOnlyEventsWithMuonsDecayedInDetID \emph{volumeID}}\\
Store only events for which the muon decay/stopping detector ID equals \emph{volumeID}.
As with other event-selection commands, this changes the population written to the ROOT tree and
can bias a physics analysis if it is used unintentionally.
\item{\bf /musr/command storeOnlyTheFirstTimeHit true}\\
This command specifies that only the hit that happens first will be
saved, while all the other hits will be ignored.
This command specifies that only the hit that happens first will be
saved, while all the other hits will be ignored.
This command might be useful in some technical studies, it would
be harmful in most physics studies.
@@ -1145,13 +1190,9 @@ in order to simulate optical photons:
exceeds \emph{timeMax}.
Note that the units of \emph{timeMax} are seconds,
and the default value is set to 85000\,s (23\,hours, 37\,minutes).\\
(Note that the simulation can also be terminated gently by creating a file
(Note that the simulation can also be terminated gently by creating a file
``RUNNUMBER.stop'' in the working directory, where RUNNUMBER matches the
run number specified in the name of the macro file.)
\item{\bf /musr/command writeFile \emph{filename.gdml}}\\
When set, enables exporting the detector geometry description to \emph{filename.gdml}.
This will fail, if \emph{filename.gdml} already exists.
run number specified in the name of the macro file.)
\end{description}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Output root tree variables}
@@ -1161,32 +1202,38 @@ The value of -999 or -1000 indicates that the given variable could not be filled
For example if the variable ``muTargetTime'' is set to -1000 it means that the initial muon missed the sample,
and therefore no time can be assigned to the sample hit.
The user can choose which variables should not be stored in the output file using the command
The user can control many (but not all) ROOT branches with
\begin{description}
\item{\bf /musr/command rootOutput \emph{variableName} off} \\
The \emph{variableName} is identical with the variable names stored in the Root tree
(see below). Presently the exception is ``save'' volume, for which all variables
will be stored in the Root tree, if such a ``save'' volume is requested.
Another exception are the Root tree variables ``nFieldNomVal'' and ``fieldNomVal[nFieldNomVal]'',
which are both suppressed using the keyword ``fieldNomVal''.
The last exceptions are the variables ``fieldIntegralBx'',
``fieldIntegralBy'', ``fieldIntegralBz'', ``fieldIntegralBz1'',
``fieldIntegralBz2'', ``fieldIntegralBz3'', which are usually not required
in an analysis program, and they are therefore not written out to the Root tree by default.
This can be changed using the command ``/musr/command rootOutput \emph{variableName} on''.
\item{\bf /musr/command rootOutput \emph{configurationKey} off} \\
Disables a branch or branch group that is enabled by default.
\item{\bf /musr/command rootOutput \emph{configurationKey} on} \\
Enables one of the branch groups that is disabled by default.
\end{description}
The configuration key is usually the ROOT branch name, but there are important exceptions.
In particular, \texttt{det\_start} controls ROOT branch \texttt{det\_time\_start} and
\texttt{det\_end} controls \texttt{det\_time\_end}. The key \texttt{fieldNomVal}
controls both \texttt{nFieldNomVal} and \texttt{fieldNomVal}. The field-integral keys
\texttt{fieldIntegralBx}, \texttt{fieldIntegralBy}, \texttt{fieldIntegralBz},
\texttt{fieldIntegralBz1}, \texttt{fieldIntegralBz2} and \texttt{fieldIntegralBz3}
are disabled by default and are enabled with ``on''. Likewise \texttt{odet\_timeCFDarray},
\texttt{odet\_timeC1} and \texttt{phot\_time} are optional groups enabled with ``on''.
Special \texttt{save\_*} branches are created as a group when a save volume is present and are not
controlled individually by this command. The ROOT branches \texttt{det\_n} and, when optical
output is active, \texttt{odet\_n}, are also created directly rather than through an individual
``off'' key. Although \texttt{timeToNextEvent} has an internal store flag, the present macro
parser has no \texttt{rootOutput timeToNextEvent off} entry.
The list of variables that can be stored in the Root tree:
The list of variables that can be stored in the ROOT tree:
\begin{description}
\item{\bf runID} (Int\_t) -- run ID number.
\item{\bf eventID} (Int\_t) -- event ID number.
\item{\bf timeToNextEvent} (Double\_t) -- time difference between two subsequent events (at continuous beam facility) (in $\mu$s).
This time difference is generated randomly using the ``meanArrivalTime'' defined in ``/gun/meanarrivaltime meanArrivalTime''.
\item{\bf weight} (Double\_t) -- event weight.
\item{\bf BFieldAtDecay\_Bx, BFieldAtDecay\_By, BFieldAtDecay\_Bz, BFieldAtDecay\_B3, BFieldAtDecay\_B4, BFieldAtDecay\_B5} (Double\_t) --
value of the 6 coordinates of the electromagnetic field at the position and time where and when the muon decayed.
The first three coordinates correspond to the magnetic field (in tesla), the last three to the electric field
(in kV/mm).
\item{\bf BFieldAtDecay} -- one ROOT branch containing six Double\_t leaves named
\texttt{Bx}, \texttt{By}, \texttt{Bz}, \texttt{B3}, \texttt{B4} and \texttt{B5}.
They are the six components of the electromagnetic field at the muon-decay position and time.
The first three leaves are the magnetic field (tesla); the last three are the electric field (kV/mm).
\item{\bf muIniTime} (Double\_t) -- time when the initial muon was generated (in $\mu$s).
\item{\bf muIniPosX, muIniPosY, muIniPosZ} (Double\_t) -- initial position where muon was generated (in mm).
\item{\bf muIniMomX, muIniMomY, muIniMomZ} (Double\_t) -- initial momentum of the muon when it was generated (in MeV/c).
@@ -1195,9 +1242,9 @@ The list of variables that can be stored in the Root tree:
\item{\bf muDecayTime} (Double\_t) -- the time at which the muon decayed (in $\mu$s).
\item{\bf muDecayPosX, muDecayPosY, muDecayPosZ} (Double\_t) -- the position where the muon stopped and decayed (in mm).
\item{\bf muDecayPolX, muDecayPolY, muDecayPolZ} (Double\_t) -- polarisation of the muon when it stopped and decayed.
\item{\bf muTargetTime} (Double\_t) -- time at which the muon entered the volume whose name starts by ``target'' -- usually the sample (in $\mu$s).
\item{\bf muTargetPolX, muTargetPolY, muTargetPolZ} (Double\_t) -- polarisation of the muon when it entered the volume whose name is ``target'' -- usually the sample.
\item{\bf muTargetMomX, muTargetMomY, muTargetMomZ} (Double\_t) -- momentum of the muon when it entered the volume whose name is ``target'' -- usually the sample.
\item{\bf muTargetTime} (Double\_t) -- time at which the muon entered the volume named exactly ``Target'' or ``target'' -- usually the sample (in $\mu$s).
\item{\bf muTargetPolX, muTargetPolY, muTargetPolZ} (Double\_t) -- polarisation of the muon when it entered the volume named exactly ``Target'' or ``target'' -- usually the sample.
\item{\bf muTargetMomX, muTargetMomY, muTargetMomZ} (Double\_t) -- momentum of the muon when it entered the volume named exactly ``Target'' or ``target'' -- usually the sample.
\item{\bf muM0Time} (Double\_t) -- time at which the muon entered the detector called ``M0'' or ``m0'' (in $\mu$s).
\item{\bf muM0PolX, muM0PolY, muM0PolZ} (Double\_t) -- polarisation of the muon when it entered the detector called ``M0'' or ``m0''.
\item{\bf muM1Time} (Double\_t) -- time at which the muon entered the detector called ``M1'' or ``m1'' (in $\mu$s).
@@ -1224,9 +1271,12 @@ The list of variables that can be stored in the Root tree:
and probably also to generate the muons well outside the magnetic field and put target such
that muons stop at $z=0$.
Note that these variables are by default not calculated (and not stored) and therefore the user has
to switch the calculation on by ``/musr/command rootOutput fieldIntegralBx on'' in the macro file.
Note that these variables are by default not calculated (and not stored) and therefore the user has
to switch the calculation on by ``/musr/command rootOutput fieldIntegralBx on'' in the macro file.
\item{\bf nOptPhot} (Int\_t) -- total number of optical photons generated in the current event.
\item{\bf nOptPhotDet} (Int\_t) -- number of detected optical photons for which per-photon timing can be stored.
\item{\bf phot\_time[nOptPhotDet]} (array of Double\_t) -- optional per-detected-photon times. This branch is created when
``/musr/command rootOutput phot\_time on'' is used and optical-photon output is active.
\item{\bf det\_n} (Int\_t) -- number of ``detector hits'' in this event. Note that more then 1 detector
might be hit, and even the same detector might be hit more than once. The hit might be induced by just one
particle, by more then one particle originating from the same particle initially hitting the detector,
@@ -1267,8 +1317,9 @@ The list of variables that can be stored in the Root tree:
belonging to the hit was created inside of the logical volume where the hit occurs, then it's track is followed
to its mother track (even several times) until the track (particle) is found that has been created outside the
given volume. This way one can better investigate which (hopefully) single particle caused the hit. Even though
even in this case it is not guaranteed that only a single particle gave origin to the hit, it is quite likely, though,
that it was in fact just a single particle. If the
even in this case it is not guaranteed that only a single particle gave origin to the hit, it is quite likely, though,
that it was in fact just a single particle. The available \texttt{det\_Vvv} branches mirror the
\texttt{det\_Vrtx} set: kinetic energy, vertex position, volume ID, process ID, track ID and particle ID.
\item{\bf odet\_n} (Int\_t) -- number of ``optical photon signals'' in this event. Note that there can be several optical photon signals
per detector. In principle, the optical photons contributing to the same signal may originate from more than
one charged particle. Ideally, there should be the same number of optical photon signals as there are
@@ -1276,9 +1327,17 @@ The list of variables that can be stored in the Root tree:
optical photon signals, and they do not have to match perfectly.
\item{\bf odet\_ID[odet\_n]} (array of Int\_t) -- ID number of the detector where the given optical photon signal occurred.
The detection of optical photons happens at the boundary of surfaces, and it is assigned to the volume ID \emph{to} which
the photon enters (and not \emph{from} which it comes). This e.g.\ allows one to attach more APDs to one scintillator,
in which case odet\_ID[] will correspond to the volume IDs of individual APDs.
the photon enters (and not \emph{from} which it comes). This e.g.\ allows one to attach more APDs to one scintillator,
in which case odet\_ID[] will correspond to the volume IDs of individual APDs.
\item{\bf odet\_nPhot[odet\_n]} (array of Int\_t) -- number of photons detected in the given optical photon signal.
\item{\bf odet\_nPhotPrim[odet\_n]} (array of Int\_t) -- number of primary photons associated with the optical signal, when stored.
\item{\bf odet\_amplCFD[odet\_n]} (array of Double\_t) -- maximum amplitude of the CFD waveform for the optical signal.
\item{\bf odet\_timeCFD100--112, odet\_timeCFD200--212, odet\_timeCFD300--312, odet\_timeCFD400--412, odet\_timeCFD500--512} (arrays of Double\_t) -- optional families of CFD times
calculated for the hard-coded CFD scale/delay combinations in \texttt{musrScintSD}. These branches are created
when ``/musr/command rootOutput odet\_timeCFDarray on'' is used.
\item{\bf odet\_timeC1--odet\_timeC40[odet\_n]} (arrays of Double\_t) -- optional signal-threshold crossing times
for the hard-coded C1--C40 thresholds. These branches are created when
``/musr/command rootOutput odet\_timeC1 on'' is used.
\item{\bf odet\_timeFirst[odet\_n], odet\_timeSecond[odet\_n], odet\_timeThird[odet\_n], odet\_timeLast[odet\_n]} (array of Double\_t)
-- times, when the the first, second, third and last photons, contributing to the given signal, were detected.
\item{\bf odet\_timeA[odet\_n], odet\_timeB[odet\_n]} (array of Double\_t)
@@ -1379,7 +1438,10 @@ These are typically not interesting for the analysis of the results of the simul
obtained with Geant~4.9.2.
\end{description}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Example 1 -- Electrons passing through two scintillator tiles (101.mac)}
\section{Historical Example 1 -- Electrons passing through two scintillator tiles (101.mac)}
{\bf Archive status:} \texttt{run/101.mac} is referenced by this historical section and by the current
CMake file, but it is not present in the supplied source snapshot. The description below is retained for
historical context and cannot be reproduced from this repository without restoring the macro.
One of the easiest example to illustrate the basic features of the musrSim (and/or Geant4) is to
shoot electrons into a scintillator block, and to observe the energy deposited inside it.
Figure~\ref{vis101}
@@ -1432,7 +1494,10 @@ To run this example, do the following:
has two peaks -- at a positive and at a negative time.
\end{enumerate}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Example 2 -- Sr decay electrons passing through two scintillator tiles (102.mac)}
\section{Historical Example 2 -- Sr decay electrons passing through two scintillator tiles (102.mac)}
{\bf Archive status:} \texttt{run/102.mac} is not present in the supplied source snapshot. The Geant4 9.4
radioactive-decay data-file editing instructions below are historical and should not be treated as installation
instructions for the current Geant4 11.x-based source tree.
This example is very similar to the previous one. The only difference is that initial
particles are decay electrons from a $^{90}$Sr source. Because $^{90}$Sr decays to $^{90}$Y,
which in turn also decays emitting an electron, we have in fact two decay electrons per event
@@ -1468,7 +1533,8 @@ shorter time than the ``interesting'' events.)
The example {\tt 102.mac} is based on the results published in~\cite{FirstExperience}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Example 3 -- Simulation of the light transport (103.mac)}
\section{Historical Example 3 -- Simulation of the light transport (103.mac)}
{\bf Archive status:} \texttt{run/103.mac} is not present in the supplied source snapshot.
This example is similar to example~1, and extended by the simulation of light (``optical
photons''). The light simulation slows down the execution of musrSim dramatically.
@@ -1478,7 +1544,8 @@ in its current implementation, so you can start using it. A lot of useful infor
about the optical photons is given in chapter ``Optical Photon Processes'' in
the Geant4 User Manual~\cite{geantUserManual}.\\
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Example 4 -- GPD instrument (201.mac)}
\section{Historical Example 4 -- GPD instrument (201.mac)}
{\bf Archive status:} \texttt{run/201.mac} is not present. Current GPD macros are supplied under \texttt{run/GPD/}.
%
The General Purpose Decay-Channel Spectrometer (GPD)
instrument~\cite{GPD} at PSI, more or less as implemented in reality in the year 2010, is exemplified in
@@ -1557,8 +1624,8 @@ are not shown in the plot, however they are included in the simulation.}
\label{dimensions}
\end{table}
%
A non-standard feature of this simulation is the muon momentum, which is $~sim$100\,MeV/c.
The copper collimator used in GPD has a bit complicate shape, which required to use subtraction
A non-standard feature of this simulation is the muon momentum, which is $\sim 100$\,MeV/c.
The copper collimator used in GPD has a somewhat complicated shape, which required the use of subtraction
of logical volumes in Geant\,4. This operation can not be specified through the macro file,
and therefore a special kind of volume called {\tt GPDcollimator} has been hard-coded into
the source code (namely in the routine {\tt musrDetectorConstruction.cc}), and it is
@@ -1568,47 +1635,23 @@ then activated in the macro file using the command \\[2ex]
The results of this GPD simulation are described in the \emph{musrSimAna} manual~\cite{musrSimAna}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Example 5 -- GPS instrument}
For the details about the GPS simulation see the documents
``Simulation of the GPS μSR instrument 1--4'' (currently saved as
/afs/psi.ch/project/lmu/Facility/musr\_simulations/documentation/GPS/*.pdf).
\section{Examples included in the current source tree}
The source snapshot reviewed for this revision contains example and production-style macros in instrument-specific
subdirectories rather than the old \texttt{101.mac}/\texttt{201.mac} layout. In particular:
\begin{itemize}
\item {\tt 50121.mac} -- GPS as installed in reality in 2011.
\item {\tt 50131.mac} -- GPS planned upgrade; bottle-shaped forward veto.
\item {\tt 50161.mac, 50171.mac, 50181.mac} -- GPS planned upgrade; pyramidal forward veto.
\item \texttt{run/GPD/}: bundled GPD macros including \texttt{40111.mac}, \texttt{40505.mac},
\texttt{40506.mac}, \texttt{40507.mac} and \texttt{40601.mac}--\texttt{40605.mac}, together with
several matching \texttt{.v1190} analysis files and a field table.
\item \texttt{run/GPS/}: GPS instrument macros \texttt{50131.mac}, \texttt{50132.mac},
\texttt{50133.mac}, \texttt{50134.mac} and \texttt{template\_Mark-II.mac}, together with field-map/data files.
\item \texttt{run/LEM/}: LEM examples and templates, including recent 2024-named macro files and the field maps
they reference.
\end{itemize}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Other Examples}
During the years a lot of ``*.mac'' files were created and used.
Most of these files are stored in the file ``run\_many\_files.tar.gz''.
It is not guaranteed that all the ``*.mac'' files stored there are
compatible with the newest version of musrSim/Geant4. However,
they can be still useful, at least as a source of inspiration.
See the file ``README.TXT'' for a short description of what the purpose
of the different files was.
These files are the best starting point for syntax examples because they are actually distributed with this
source snapshot. Some are instrument-specific and may require the associated map/data files in the same directory.
The older numbered examples described above are retained only as historical documentation until their macro files
are restored or those sections are rewritten around current examples.
Sometimes the runs need additional input files (e.g.\ a field map
,TURTLE file, ...). These files are too large to be stored in the svn repository,
and typically can be found in subdirectories of the high field project:
/afs/psi.ch/project/HighFieldMuSR/.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\clearpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%\begin{figure}\centering
%\epsfig{file=pict/HiFi_01.eps,width=\linewidth,%
%bbllx=56pt,bblly=288pt,bburx=505pt,bbury=555pt,clip=}
%\caption{The cross-section of the first version of the High Field \musr\ apparatus including
%an example interaction. Only the inner part of the apparatus is shown. The picture was generated
%using GEANT package.}
%\label{HiFi_01}
%\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Conclusions}
Please let us know your comments and suggestions for further improvement/development of the
musrSim program.
@@ -1659,4 +1702,4 @@ Nucl. Inst. and Meth. in Phys. Res. A {\bf 610} (2009), 374-377.
\end{thebibliography}
\end{document}
\end{document}
+903 -861
View File
File diff suppressed because it is too large. Load diff