c Copyright by Zachary Paul Meisel, 2010
Simulation of Silicon Detector Response
        for 69 Kr β-Delayed Proton Emission




                         by

                Zachary Paul Meisel




                      THESIS

 Submitted in partial fulfillment of the requirements
for the degree of Bachelors of Science of Astrophysics
         in the College of Natural Science of
           Michigan State University, 2010




               East Lansing, Michigan
Simulation of Silicon Detector Response
                           for 69 Kr β-Delayed Proton Emission

                                     Zachary Paul Meisel
                            Department of Physics and Astronomy
                               Michigan State University, 2010
                          Hendrik Schatz, Director of Thesis Research



   Modern nuclear astrophysics experiments rely on simulations to ensure accurate and

efficient data interpretation. Here Monte Carlo simulations have been performed using

the simulation packages MCNPX, GEANT4, and CASINO to aid in the identification of

                                                        69
decay branches in the β-delayed proton emission of           Kr. Information regarding these

                                                                        68
branches will be used to determine a proton-capture Q-value for              Se to determine its

impact as a waiting point in the astrophysical rapid proton-capture (rp-)process. It is well

known that waiting points in the rp-process, the dominant mechanism of nucleosynthesis

in type-I x-ray bursts, dominate many of the features of the burst’s light curves. Thus

                 68
information on        Se will help advance our understanding of this cosmic phenomenon.




                                              iii
iv
Acknowledgments

This work was completed with support from the Physics and Astronomy department at

Michigan State University, and from the National Science Foundation grants PHY02-

16783(JINA) and PHY01-10253(NSCL). Much thanks to my research advisor Hendrik

Schatz. He has provided me with many unique opportunities to present and discuss my

research and has also connected me with a superior group of research scientists. I am also

greatly indebted to Richard Cyburt and Karl Smith, each of whom have provided much

needed mentoring over the last two years. Additional thanks are certainly due to Marcelo

del Santo, Heather Crawford, and Giuseppe Lorusso for helping me with difficulties I

encountered in creating my simulations and to Ana Becerril, Fernando Montes, and

Sebastian George for useful discussions.




                                            v
vi
Contents

Acknowledgments                                                                                              v

Foreward                                                                                                   xiii

1 Introduction to the Study of Nuclear           Reactions                                                   1
  1.1 The Study of Proton-Rich Nuclei . .        . . . . . . . . . . . . . . . . . . . .                     3
  1.2 The Study of 69 Kr . . . . . . . . . .     . . . . . . . . . . . . . . . . . . . .                     4
  1.3 Importance of Simulations . . . . . .      . . . . . . . . . . . . . . . . . . . .                     5

2 Astrophysical Motivation                                                                                   9
  2.1 X-Ray Bursts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                        10
  2.2 RP-Process and Its Waiting Points . . . . . . . . . . . . . . . . . . . . .                           13

3 Simulation Packages                                                                                       15
  3.1 MCNPX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                         15
  3.2 GEANT4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                          19
  3.3 CASINO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                        22

4 Verification and Validation of Simulations                                                                 25
  4.1 Verification . . . . . . . . . . . . . . . . . . . . . . . . .    .   .   .   .   .   .   .   .   .    25
  4.2 Validation . . . . . . . . . . . . . . . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .    28
      4.2.1 Validation Experiment: 207 Bi Calibration Source .         .   .   .   .   .   .   .   .   .    28
      4.2.2 Replication via Simulation . . . . . . . . . . . . .       .   .   .   .   .   .   .   .   .    29
      4.2.3 Comparison Between Simulation and Experiment               .   .   .   .   .   .   .   .   .    30
  4.3 Potential Further Verification and Validation . . . . . . .       .   .   .   .   .   .   .   .   .    31

5 Prediction of Experimental Results                                                                        35
  5.1 69 Kr Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                        35
  5.2 Simulation and Results . . . . . . . . . . . . . . . . . . . . . . . . . . . .                        36
  5.3 Future Use of Simulations for Data Analysis . . . . . . . . . . . . . . . .                           38

                                           vii
Bibliography                                                                                                                41

Appendix: Code                                                                                                              45
  5.4 MCNPX . . . . . . . . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   45
  5.5 GEANT4 . . . . . . . . . . . . . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   47
      5.5.1 Driver and Compact Macro . . .          .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   47
      5.5.2 Header Files . . . . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   49
      5.5.3 EventAction.hh . . . . . . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   49
      5.5.4 experimentalHall.hh . . . . . . .       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   49
      5.5.5 experimentalhall Messenger.hh . .       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   49
      5.5.6 Materials.hh . . . . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   50
      5.5.7 ME2bDetectorConstruction.hh . .         .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   51
      5.5.8 ME2bPhysicsList.hh . . . . . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   52
      5.5.9 ME2bPrimaryGeneratorAction.hh           .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   52
      5.5.10 PixelParameterisation.hh . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   53
      5.5.11 Results.hh . . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   53
      5.5.12 RunAction.hh . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   54
      5.5.13 SiBlock.hh . . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   55
      5.5.14 SiBlock Messenger.hh . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   56
      5.5.15 SourceData.hh . . . . . . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   56
      5.5.16 SteppingAction.hh . . . . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   57
      5.5.17 SteppingVerbose.hh . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   57
      5.5.18 TrackerIonHit.hh . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   57
      5.5.19 TrackerIonSD.hh . . . . . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   59
      5.5.20 TrackerIonSD Messenger.hh . . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   59
      5.5.21 VisManager.hh . . . . . . . . . .      .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   60
      5.5.22 Source Files . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   60
      5.5.23 EventAction.cc . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   60
      5.5.24 experimentalHall.cc . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   61
      5.5.25 exerimentalHall Messenger.cc . .       .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   61
      5.5.26 Materials.cc . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   62
      5.5.27 ME2bDetectorConstruction.cc . .        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   62
      5.5.28 ME2bPhysicsList.cc . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   64
      5.5.29 ME2bPrimaryGeneratorAction.cc          .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   66
      5.5.30 PixelParameterisation.cc . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   69
      5.5.31 Results.cc . . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   70
      5.5.32 RunAction.cc . . . . . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   73
      5.5.33 SiBlock.cc . . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   73
      5.5.34 SiBlock Messenger.cc . . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   74
      5.5.35 SteppingAction.cc . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   75

                                         viii
5.5.36   SteppingVerbose.cc . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   75
      5.5.37   TrackerIonHit.cc . . . . . .     .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   77
      5.5.38   TrackerIonSD.cc . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   78
      5.5.39   TrackerIonSD Messenger.cc        .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   79
      5.5.40   VisManager.cc . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   80
      5.5.41   Sort to Root . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   81

Curriculum Vitae                                                                                                                    89




                                           ix
x
List of Figures

 1.1   Chart of nuclides . . . . . . . . . . . . . . . . . . . .   .   .   .   .   .   .   .   .   .   .   .    2
 1.2   Proposed level scheme 69 Br. . . . . . . . . . . . . . .    .   .   .   .   .   .   .   .   .   .   .    4
 1.3   NSCL Cyclotrons and A1900 Fragment Separator. . .           .   .   .   .   .   .   .   .   .   .   .    6
 1.4   Produced nuclei expected to reach the detector setup.       .   .   .   .   .   .   .   .   .   .   .    7

 2.1   The Crab Nebula as seen from the Hubble Space Telescope. . . . . . . .                                  10
 2.2   Stellar evolution possibilities. . . . . . . . . . . . . . . . . . . . . . . . .                        11
 2.3   Artist’s conception of an accreting binary system. . . . . . . . . . . . . .                            12

 3.1   A minimalistic MCNPX simulation input file. . . . . . . . . . . . . . . .                                16

 4.1   Near identical initial conditions used for verification simulations. . . . . .                           27
 4.2   General agreement between MCNPX and GEANT4 verification simulations.                                     28
 4.3   Evidence 976MeV e− can be stopped in 500µm of Si. . . . . . . . . . . .                                 29
 4.4   Engineering drawing of Beta Counting Station[52] . . . . . . . . . . . . . .                            30
 4.5   Formula and schematic for Compton scattering. . . . . . . . . . . . . . .                               31
 4.6   Experimental data and GEANT4 simulation comparison for validation. .                                    32
 4.7   Unphysical behavior by MCNPX when simulating an e− in a single Si strip.                                33

 5.1   Experimental set up for experiment 07025 at the NSCL. . . . .                       . .      . . .      36
 5.2   Characteristics of a 14MeV Q-value β + -decay. . . . . . . . . . .                  . .      . . .      38
                                                                                                   69
 5.3   Summing effect for IAS and proposed ground state decay branch                        for        Kr
       β-delayed proton emission (blue=proton, red=sum). . . . . . . .                     . .      . . .      39
 5.4   Closeup of the summing effect for simulated decay branches. . .                      . .      . . .      40




                                            xi
xii
Foreward

   This paper is likely to have readers with various backgrounds in nuclear astrophysics,

thus some of the following chapters may be of more interest to a given reader than others.

It is the author’s belief that these readers will be of three types: the non-physicist looking

for an example of an undergraduate’s contribution to the field of nuclear astrophysics,

the undergraduate or early graduate student in physics whose task it may be to simulate

silicon detector response, and the specialist who requires information on the simulations

performed for the NSCL’s experiment 07025. Chapters 1 and 2 are aimed at the first

class of reader, though the remaining chapters should still be comprehensible. The second

class of reader may use the first two chapters as a refresher and pay more attention to

the remaining text, where the most valuable sections will likely be chapter 3 and the

appendix. The third class of reader will most likely be interested only in chapters 4 and

5 as well as the appendix. However these are only suggestions and each section should

hopefully be comprehensible and perhaps enlightening to the majority of readers.




                                             xiii
xiv
Chapter 1

Introduction to the Study of
Nuclear Reactions

Nuclear physics strives to understand the nuclei of the elements that make up our uni-
verse. The study of nuclear reactions strives to understand how these nuclei interact.
A convenient context in which we speak of nuclei is the chart of nuclides, also known
as a Segr` chart, which is shown in Figure 1.1[1] . The x-axis denotes neutron number
          e
N , the y-axis denotes proton number Z, and the combination of these two gives us the
atomic mass A = Z + N . Using these numbers we refer to a nucleus with a given symbol
S with the notation A SN . For example, the ultimate nucleus of interest in this study,
                      Z
Selenium-68 (A = 68, Z = 34, N = 34), is denoted by 68 Se34 .
                                                        34
    To describe nuclear reactions, or interactions between nuclei and leptons, we incorpo-
rate our notation for individual nuclei. In a nuclear reaction, the participating particles
that interact are the reactants and the resultant particles after the reaction are the
products. A convenient way to write the reaction is


                                 reactants −→ products.

For this study we’ll deal with one or two reactants and two or three products, so instead
the reaction looks something like


                                   A + B −→ C + D.

Then, to save space, we condense this notation by placing the heavier reactant and the
heavier product, i.e. the nuclei, on the outside of a set of parentheses and place the
lighter reactant and product on the inside of these parentheses, separated by a comma.
So, our fictitious equation above now looks like, A(B, C)D. Often times we will refer to
the outside reactant as the target and the inside reactant as the beam, but in the context

                                            1
Figure 1.1: Chart of nuclides


of a stellar environment it does not really matter which reactant gets which label. In
the physical process that occurs in an astrophysical environment, all that matters is that
the reactants interact to produce the products.
    The main factors which control whether or not a nuclear reaction will occur are
the temperature of the environment and the density of reactants in the environment.
A multitude of nuclear reactions are often possible in similar conditions, meaning that
they can occur simultaneously. Thus, we could imagine a situation where our fictitious
reactants A and B can interact along side product C interacting with some other reactant
E.
                                     A + B −→ C + D
                                     C + E −→ F + G
    It doesn’t take much of an extension of this idea to realize that whole networks can
form, depleting nuclei of lower mass to build nuclei of higher mass, absorbing and re-
leasing energy along the way. Many such networks exist in astrophysical environments.
The reaction network of interest in this study is the rapid proton-capture (rp-)process.
In the rp-process successively heavier nuclei capture protons (p), releasing energy in
the form of photons (γ). Whenever a nucleus is created that deviates too much from
stability (N = Z for light nuclei), indicated by the black squares in Figure 1.1, this
nucleus undergoes β + decay, where one of its protons changes to a neutron, a positron
(e+ ), and an electron neutrino (νe ). One such piece of the rp-reaction chain looks like [33]


                                              2
34
                                     Cl + p −→ 35 Ar + γ
                                   35
                                      Ar + p −→ 36 K + γ
                                   36
                                      K + p −→ 37 Ca + γ
                                 37
                                    Ca −→ 37 K + e+ + νe .

If the above proton capture reactions are faster than decays on the respective nuclei then
the process can create so called neutron deficient (a.k.a. proton-rich nuclei). Hence the
name “rapid” proton-capture process.


1.1      The Study of Proton-Rich Nuclei
When classifying nuclei each falls into one of three general classes: stable, proton-rich, or
neutron-rich. As you might expect, proton-rich nuclei have more protons than a stable
nucleus of the same mass A and neutron-rich nuclei have more neutrons than a stable
nucleus of mass A. This begs the question, what makes a nucleus stable?
     While the nature of stability is much too complicated to be discussed here, it is
worthwhile to briefly consider the simple model for a nucleus. In this model protons
and neutrons, generically known as nucleons, are bound together via the strong force,
which is roughly 100 times stronger than the Coulomb force that causes protons to repel
each other. The bound nucleons must obey the Pauli principle. That is, since they
have half-integer quantum spin, they cannot simultaneously occupy the same spatial and
spin state[3] . Then if space were at a premium, as in a nucleus, it makes sense that it
would be highly efficient, i.e. energetically favorable, to pair protons and neutrons. This
pairing is observed as a tendency for the line of nuclear stability to stay near N = Z
[4]
    . Keeping in mind that charged protons repel each other due to the Coulomb force,
it would be expected that at large A more neutrons are added. As a consequence of
the previously stated criterion for a bound nucleus, there are far fewer proton-rich nuclei
than neutron-rich nuclei. But this does not mean proton-rich nuclei are not interesting.
     Proton-rich nuclei are the nuclei which are created in explosive hydrogen burning
events, as will be explained in Chapter 2. Hence, it is these nuclei that we must study if
we are to understand the astrophysical events in which explosive hydrogen burning occurs.
While many proton-rich nuclei are created and participate in the rp-process, it would be
incredibly time consuming to study them all. So, given guidance from theoretical nuclear
astrophysicists, experimental nuclear astrophysicists set out to measure the nuclei of
particular importance.
     More information will be given in Chapter 2 as to which nuclei are important in the
rp-process, but for the moment we can just refer to these as waiting points. Waiting
points, as the name indicates, are nuclei that delay the flow of the rp-process. This
study will contribute information to the task of finding out how slow one of these waiting
points, that of 68 Se, is. Though there are theoretical predictions, experiment is needed

                                             3
69
                         Figure 1.2: Proposed level scheme         Br.



to verify or falsify the theory. The experiment which this study simulates will add one
piece of the required experimental input.


                                 69
1.2      The Study of                 Kr
69
   Kr (Kr is the symbol for Krypton) is not itself a waiting point nucleus for the rp-
process, but it is key in studying the proton capture of 68 Se. It might then be surprising
that a quick reference of the chart of nuclides, or the periodic table, reveals that the
nucleus one unit of Z greater than Selenium’s Z = 34 is Bromine (Br) with Z = 35,
and not Krypton (Z = 36). However, recalling that proton capture is a process which
transforms nuclei as A SN −→ A+1 TN , it becomes apparent that proton-capture on 68 Se
                       Z          Z+1
creates the (likely) proton-unbound 69 Br[5] . Note that proton capture by 68 Se is still of
interest because reaction rate timescales are short enough in the explosive astrophysical
environments in which the rp-process occurs to allow 69 Br to capture a proton before it
expels the initially captured proton.
    Being that 69 Br is too short-lived to allow for study in the lab[6] , we instead exploit
a fortuitous characteristic of 69 Kr. To the advantage of experimental nuclear astrophysi-
cists, 69 Kr undergoes β + -decay to become 69 Br. The decay product is so short-lived, that
the entire decay chain, 69 Kr−→ e+ + νe + 69 Br−→ 68 Se+p is referred to as the β-delayed
proton emission of 69 Kr. In a way that will be outlined in Chapter 5, the light charged
products of this decay chain, e+ and p, are detected with relative ease.
    When 69 Kr undergoes β + -decay, it does not necessarily populate the ground state of
69
   Br. The “state” refers to the total energy of nucleons within the nucleus. A higher
state has more energy. The binding energy, or energy per nucleon, varies from nucleus to
nucleus. We can determine this energy from a level scheme and, consequently, determine
possible relevant decays. One possible level scheme for 69 Br is shown in Figure 1.2 [7] .
Here the arrows from 69 Kr to levels in 69 Br represent positron emissions of different

                                             4
energies and the arrows from 69 Br levels to 68 Se represent proton emissions of different
energies. It should be noted that of the shown 69 Br levels, only that labeled IAS is
confirmed to exist[5] .
   In the experiment which this study (described in more detail in Chapter 5) simulates,
the goal is to identify other levels in 69 Br. Due to experimental limitations, Xu et al.
were only able to identify β-delayed proton emission involving 69 Br’s isobaric analog state
(IAS). As the study was forced to look at a small range in proton energy, they chose to
look at energies that corresponded to the IAS. This is because the majority of β-decays
tend to populate the IAS due to its similar level structure [8] , and indeed Xu et al.
were able to determine 83% of 69 Kr decays populated the IAS. Therefore, other β-decay
branches, and consequently other proton emission branches, can be expected to occur in
the β-delayed proton emission of 69 Kr.
   Why not be satisfied with the known decay branch, since it is so dominant? This is
answered simply by relating the excitation energy E of the IAS to its respective tempera-
ture T using the well known relation E ∼ kT , where k is Boltzmann’s constant. Inserting
the IAS energy of 4.07MeV (MeV = 1 million electron-volts) provides the rough astro-
physical temperature necessary to populate this state: T ∼ 1 × 1010 Kelvin. This over 10
times the typical temperature associated with expected rp-process sites[9] , as shown in
Chapter 2. Given the previously stated information about the levels in 69 Br it is appar-
ent that the levels of interest will be at energies below the IAS and that these levels will
scarcely be populated. More details on the experimental set-up are given in Chapter 5.


1.3      Importance of Simulations
If we could isolate a single 69 Kr nucleus, observe it decay to 69 Br, and then collect
the proton with our detector system, and repeat this process many times over, then
identifying new proton branches would be somewhat trivial. However this simple picture
is far from reality. The first detail to be considered is the time between 69 Kr decaying
to 69 Br and 69 Br emitting a proton. The second concerns the process by which 69 Kr is
produced and delivered to the detector system.
    As was stated in the previous subsection, 69 Br is proton-unbound. This means that,
upon coming into existence, it almost immediately expels a proton. The only information
on the lifetime of 69 Br is its non-observation, so that its half-life has an upper limit of
t 1 < 24 nanoseconds[10] . This means that a positron is emitted and detected in our
  2
detector system and, on average, less than 24ns later a proton is emitted and detected.
However, the time for the electronics to process information on particles detected so
that the information (e.g. the energy they deposited) can be recorded is of the order of
microseconds[11] . So we must instead gather the information on the positron and the
proton at the same time. This leads to a summing effect that effectively shifts the proton

                                             5
Figure 1.3: NSCL Cyclotrons and A1900 Fragment Separator.


energy peak to higher energies. In order to correct for the β summing effect, simulations
are required to evaluate its impact. Once the shift in the energy distribution peak is
determined, we will be able to more accurately determine the energy of protons emitted
in various decay branches.
     Further complications arise due to the 69 Kr production process. Since 69 Kr has a half-
life of 32ms[10] , it must be produced just prior to implantation in the detector system.
The process in which it is produced is called fragmentation. In fragmentation a heavy
isotope, here 72 Kr, is accelerated as the primary beam and collided into a production
target, here Beryllium. These collisions produce many different kinds of isotopes, occa-
sionally producing our nucleus of interest. A series of magnets, here the A1900 Fragment
Separator (See Figure 1.3[30] ) then separates out the nucleus of interest, but often the
process is imperfect and other nuclei make it to the detector system. The simulation
will only simulate the processes of interest, i.e. β-delayed proton emission, thus it should
help in discerning relevant data from the whole.
     One may wonder how it can be known that simulations are accurately reproducing
the physical conditions of the experiment. This subject is discussed some in Chapter
3 and at length in Chapter 4. The main simulation of this project and the experiment
it simulates are detailed in Chapter 5. How this simulation will be used to aid in the
interpretation of the experimental results follows this in Chapter 6.




                                             6
Figure 1.4: Produced nuclei expected to reach the detector setup.




                               7
8
Chapter 2

Astrophysical Motivation

Since ancient times humans have been intrigued by the lights that illuminate their night’s
sky. For those observing before the invention of telescope, these objects were simply
unchanging points that were static with respect to each other. Once in a very long while
a new light would appear, often shining throughout the day, and then slowly fade out of
existence. The Crab Nebula (see Figure 2.1[15] ) is a well known example of one of these
transient lights in the night sky that the Chinese observed in 1054AD. These occurrences
offered the first clues that these lights were much more than decorations on the ceiling
of the celestial sphere.
    With the invention of the telescope astronomers were able to analyze the lights of
our night sky more detail. The introduction of the fields of spectroscopy, the study of
light’s interaction with matter as a function of wavelength, and spectrometry, the study
of the creation and absorption of light due to atomic and nuclear structure, empowered
astronomers with the quantitative capabilities they have today. Applying these two
disciplines, Suess and Urey [16] were able to determine the relative abundances of the
nuclei in our solar system. One year later Burbidge, Burbidge, Fowler, and Hoyle[17] ,
and separately Cameron[18] , used this information and that from the then 20 year old
field of nuclear physics to propose how all of the nuclei in the universe were synthesized.
Thus nuclear astrophysicists were provided one of the major foundations of the field.
    Nuclear astrophysics studies the synthesis of elements in stars and stellar environ-
ments and their dispersion into the interstellar medium. It provides us with unique
insight into the building blocks of nature, allowing us to study nuclei in environments
that are only marginally reproducible on earth. Volumes could be (and have been) filled
on the many nucleosynthesis sites extant in our universe, but the remaining discussion
will focus on the main site that is pertinent to this study. This is the astrophysical site
known as a type-I x-ray burst.

                                            9
Figure 2.1: The Crab Nebula as seen from the Hubble Space Telescope.



2.1      X-Ray Bursts
Type-I x-ray bursts are frequently recurring thermonuclear (driven by temperature de-
pendent nuclear reactions) explosions on the surface of an accreting neutron star’s crust[19] .
They were first observed in the early to mid-1970s [20][21] , characterized by a steady peak
flux of light in the x-ray region (0.01nm ≤ λ ≤ 10nm) with an occasional sharp rise in
luminosity followed by an exponential decay. Astrophysics theorist produced sugges-
tions as to their underlying cause shortly after a multitude of these observations were
published[22][23][24] . The essence of these models involves a binary star system in which
a neutron star and a main sequence or giant star revolve around each other, as in Figure
2.3.
    A neutron star is an extremely dense body, mostly composed of neutrons, left behind
from a massive star’s core-collapse explosion, known a type-II supernova. Main sequence
stars synthesize helium from hydrogen in their cores, but are mostly hydrogen. Giant
stars have evolved off the main sequence, having burned through most of their core
hydrogen, and have an outer envelope made mostly of hydrogen and helium. All stars
begin as main sequence stars and evolve into giant stars. Those that are roughly 8 times
the mass of the sun (8M⊙ ) and above eventually become type-II supernova. The main
paths taken in stellar evolution are shown in Figure 2.2[25] . For a typical x-ray bursting
system the neutron star is a roughly 1.4M⊙ supernova remnant and its companion is a
giant star of order 1M⊙ or less.
    In an x-ray binary system giant star is transferring gas to the neutron star in a process
called “accretion”. Mass transfer is possible because the giant star has expanded so that

                                             10
Figure 2.2: Stellar evolution possibilities.


its gas fills its Roche lobe while overlapping the neutron star’s Roche lobe. The Roche
lobe is essentially sphere in which a star’s mass is gravitationally bound [26] . Once mass
transfer is initiated gas flows freely from the surface of the giant star to the surface of the
neutron star, as shown in Figure 2.3[27] . As a result of accretion, gas rich in hydrogen
and helium builds up on the crust of the neutron star. This results in the emission of
x-rays due to the gravitational energy released during accretion in all of these systems
and nearly half also undergo in type-I x-ray bursts [28] .
    Due to the system’s steady emission of light which peaks in the x-ray portion of
the spectrum, astrophysicists can infer the temperature of the environment via the well
known relations
                                             hc
                                        E=      ∼ kT
                                             λ
                        (4.1 × 10−21 M eV ∗ s)(3. × 108 m/s)
                   T ∼           −9             −11           ∼ 1. × 108 K,
                        (0.1 × 10 m)(8.6 × 10 M eV /K)
where k is Boltzmann’s constant, h is Planck’s constant, and c is the speed of light. A
                                                                    6               6
more realistic approach utilizes Wien’s displacement law, T = 2.9×10λnm∗K = 2.9×10 nm∗K =
                                                                                 0.1nm
2.9 × 107 K. While this allows us to calculate the temperature at the surface of the burst-
ing site, this temperature must be related to the temperature of the bursting zone via
models. In general models infer the thickness of a burning layer by calculating how many
nuclei, each releasing roughly 5MeV of energy in a given fusion reaction, it would take
to create the observed energy of ∼1038 erg . Observational indications that the site is a
                                          sec


                                             11
Figure 2.3: Artist’s conception of an accreting binary system.




neutron star, which are beyond the scope of this paper, can be included to arrive at the
general conditions for an x-ray burst that can be included in simulations.
     Why study x-ray bursts? From a statistical point of view x-ray bursts are unique
astronomical objects in that over 1,000 have been observed from over 40 separate sites
[29]
     . We are thus able to see how bursts vary between binary systems and how the bursts
vary within a single system’s recorded bursting history. This allows for the identification
of common features and dependencies of the bursts on things such as the giant star’s
mass, the giant star’s composition, and the rate of accretion. In astronomy such a robust
data set is very rare, meaning that x-ray bursts are invaluable sources of information.
    X-ray bursts have the potential to be a wealth of physics information, though much
work must still be put into understanding them before that wealth can be exploited. Of
particular interest is the nuclear physics of x-ray bursts that provides input regarding
the neutron star’s radius and its crustal composition. Each of these allows us to learn
about the neutron star structure, which provides information about the equation of state
of dense nuclear matter and consequently about the strong nuclear force [30] . Observing
the effects gravitational redshift has on the thermal emission spectrum of matter being
accreted onto the neutron star provides information on its mass to radius ratio and
studying the final abundances of nuclei produced by the rp-process indicates what the
crustal composition neutron star would be[19] . However, we will not be able to extract
these parameters with the necessary level of confidence until we have improved our models
of x-ray bursts[31] , which are very sensitive to nuclear physics data [32] . Currently one
of the main ways to determine which nuclear physics data is of particular importance in
x-ray bursts is to determine which data are important in the rp-process.

                                            12
2.2      RP-Process and Its Waiting Points
The rp-process is a mechanism of nucleosynthesis in which protons are captured on nuclei
to create successively heavier proton-rich nuclei. Proton capture can be stalled when a
nucleus is reached whose proton capture rate is prohibitively small so that it must undergo
β + -decay for the process to continue[33] . The nuclei that cause this occasional stalling
are especially interesting because differences in the time the rp-process waits there can
cause a large difference in the final abundance of nuclei produced [19] . These nuclei
are called “waiting points”. Nuclear physics data combined with nuclear astrophysical
models allow us to determine which nuclei are waiting points.
     Before the rp-process is initiated, the x-ray burst begins due to thermonuclear run-
away, a process in which a reaction that is highly sensitive to temperature releases energy,
increasing the temperature, thereby increasing the reaction rate and providing positive
feedback [26] . Here runaway is triggered due to the highly temperature sensitive triple-
alpha reaction, which ultimately synthesizes 12 C from three 4 He (a.k.a. α). Temperatures
then rise to initiate α-capture which then provides the energy and seed nuclei necessary
to initiate hydrogen burning for the rp-process [34] . The exact path of the rp-process
is highly dependent on temperature and density, particularly regarding capture on light
nuclei due to competition with α-capture induced reactions, but above calcium the rp-
process is only determined by proton captures and β-decays[33] . For nuclei in this region
along the proton drip line, the rp-process is dominated by β-decay lifetime of waiting
point nuclei [33] . Thus if the process were able to bypass a waiting point nucleus via a
proton capture, the path of the rp-process, and consequently the light curve and final
composition of the x-ray burst, could be significantly altered[35] .
     Of the high A nuclei on the rp-process, one that has been identified as a waiting
point, from β-decay measurements, is 68 Se. However, uncertainties remain in calculating
the proton capture reaction rate, so it is possible that successive capture of two protons
could allow the rp-process to bypass 68 Se [19] . The issue then is to determine these proton
capture rates on earth.
     When studying nuclei that are proton-rich we have seen that are short-lived. Being
that they do not maintain their current proton-rich state for very long, it is apparent that
adding a proton to one of these nuclei is not a simple task. So, to circumvent this issue,
we instead study the opposite process. Here this means we study the proton emission of
69
   Be instead of the proton capture by 68 Se. Though the rates for these processes are far
from equivalent, the nuclear structure is the same. As the mass difference, given from
nuclear structure, between 69 Br and 68 Se is the most important variable in determining
the proton-capture Q-value, we attempt to determine 69 Br’s ground state mass. We de-
termine this mass by detecting the energy of protons resulting from 69 Br proton emission,
which we study by necessity via the β-delayed proton emission of 69 Kr. The method of
determining this structure is detailed in Chapter 5.


                                             13
14
Chapter 3

Simulation Packages

The physics of charged particle interactions in detector systems involves many processes
that are highly sensitive to incident energies, occur on small timescales, and involve small
spatial scales. As a result, modeling this physics requires a simulation code that is able
to take into account large and varied data and implement this data with the smallest
possible spatial and temporal resolution. While creating a personal simulation package
for such physics is not out of the question, the process would require years of effort to
ensure a properly working code. Thus, to avoid reinventing the wheel, it is often more
practical to employ previously tested and developed simulation packages.
    The simulation packages used here were Monte Carlo N-Particle X (MCNPX)[36] ,
Geometry and Tracking 4 (GEANT)[37] , and Monte Carlo Simulation of Electron Tra-
jectory in Solids (CASINO)[38] . Each of these packages is the result of over a decade of
development and testing. Also, each is relatively easy to acquire, though MCNPX takes
some extra effort. GEANT4 was the primary simulation package used and MCNPX and
CASINO were used to verify its results. The following sections will attempt to briefly
explain the uses and methods of simulation for each package.


3.1      MCNPX
MCNPX is a simulation package developed by Los Alamos National Laboratory which
has major updates roughly every 3 years [36] . The version used in this study was MCNPX
2.6.0 (package ID:C00740MNYCP02), originally released in April 2008. A copy of this
software can be obtained by contacting the Radiation Safety Information Computational
Center (RSICC)[39] . However, as MCNPX is a product of the United States Department
of Energy, it requires paperwork to be submitted and it is advisable that contact with
RSICC is initiated by a laboratory or university software representative. The entire
process can take anywhere between two weeks and one month before the software is in
hand.

                                            15
Figure 3.1: A minimalistic MCNPX simulation input file.



    Additionally, it must be noted that once the MCNPX package has been approved
for use, the source code is likely to be unavailable for viewing. A user’s manual that
describes every aspect of the physics and algorithms employed in the code is provided in
addition to the simulation package. It is generally sufficient in describing what the code
can do and how one can make the code perform specific tasks. It is important to note
that this manual cannot be shown to anyone who does not also have permission to use
MCNPX from RSICC under penalty of imprisonment. However, input and output of the
simulations are free to share amongst research colleagues.
    Regarding input, the simulations in MCNPX are coded in a unique, single-document
environment separated by an empty line into three sections: cell, surface, and data. The
input in each section generally devotes one line of code to specify a given aspect of the
simulation, where each line is referred to as a “card”. Thus a simulation is coded card
by card, where the simplest of simulations could contain as few as 10 cards (A very
simple example is shown in Figure 3.1). In the author’s opinion, a marked advantage
here is simplicity, however the accompanying disadvantage is a general obfuscation of the
simulation’s inner workings.

                                           16
As it is easiest to describe the input cards with an example, Figure 3.1 will be de-
scribed beginning at the first line and continuing to the bottom, with some mention of
cards and options for cards that are not shown. While this example fills only 26 lines,
including comments, some simulations in this study were over four times this length, un-
derlining the importance of ample comments (See Appendix). The example shown fires
a neutron 1 × 105 times with an initial direction selected from an isotropic distribution
inside the center of a sphere of Oxygen located near a sphere of Iron, all inside a cube of
Carbon, which itself is located inside an infinite vacuum. Data is only recorded regarding
the flux of the neutrons and distance traveled by neutrons within the iron sphere.
    A given cell card, of which there are four, lists the assigned cell number, number
assigned to a desired material that is defined below, the density of said material, and the
volume of the cell as defined by the surface cards. Negative signs for density indicate units
     g
of cm3 and negative signs for cell surfaces indicate a cell is located within that surface.
                                                   g
Thus cell one is Oxygen with a density of 0.0014 cm3 bounded within the spherical surface
                                                              g
number seven. Similarly cell two is Iron of density 7.86 cm3 bounded by the spherical
                                                      g
surface eight. Cell three is Carbon of density 1.6 cm3 bounded within the cube defined
by planar surfaces one through six. Finally, cell four is the vacuum that surrounds cell
three. Much more complicated cell volumes could be defined, however these will not
be described here as this work consisted solely of rectangular, spherical, and cylindrical
cells.
    Surface cards, as is evident in the preceding paragraph, describe surfaces that can
be used to construct cells. Unused surfaces will register a warning upon running the
simulation. Surface cards list the assigned surface number, the area type with a label
defined in the MCNPX user manual, and a sequence of numbers describing coordinates
within the entire volume required to fully define said surface, also detailed in the user
manual. Surface one is a plane with its normal oriented along the z-axis, as indicated
by “PZ”, at z = −5cm. Here one may be bothered by the introduction of arbitrary
axes, but it is necessary that one make a choice of orientation with the beginning surface
cards and stick to that convention to assure consistency in defining cell cards. Surfaces
two through six are defined in a similar manner to surface one. As a general note, one
could instead define the surfaces of a rectangular prism in one card. Surface seven is a
sphere, as indicated by “S” with a centroid located at (x,y,z)=(0.cm,−4.0cm,−2.5cm)
and a radius r = 0.5cm. Surface eight is similarly defined but with centroid coordinates
(0.cm,4.cm,4.5cm). As with the cell cards, much more complicated surfaces are possible,
where many examples of these are given in the MCNPX user manual.
    Whereas the previous cards describe the geometry of the simulation, the data cards
primarily describe the physics input and output. The importance card, denoted by “IMP”
specifies what particle type, here “N” for neutron, to track in which cells. By default
MCNPX includes all known physical processes relevant to the tracked particle. Physics
relevant to other particle types could be additionally specified by using the “PHY:” card

                                            17
and its respective options, followed by the symbol for the desired particle, on the line
beneath the “IMP” card. Cell importances are assigned in the order they are defined
with a 1 indicating important and a 0 indicating not important. Note that if the particle
of interest must traverse a cell that may be of no interest in order to get to one that is
of interest, the traversed cell must still be assigned a 1 so that the particle “makes it” to
the interesting cell.
    “SDEF” is the source definition card that specifies all of the characteristics of the
simulated source. The source shown here is as simple as it could possible be. In general
this card will be used with many more options which additionally specify things such as
initial direction, initial energy, and particle type. Directions and energies can be selected
from self-defined or predefined functional or discrete distributions. The source here is
taken to b a neutron by default since it is the only particle assigned any importance
by the “IMP” card, located at the coordinate (0.cm,−4.0cm,−2.5cm). As an additional
check, one can specify the cell of the origin to ensure the chosen position is correct, or
nearly so. If left undefined, the default directional distribution is isotropic and the default
initial energy is particle specific and defined in the MCNPX user manual.
    The following sets of cards, beginning with “F” and “E” always appear in conjunction
and are referred to as “tallies”. The cards with “F” followed by some number specify the
physics of the source particle to be recorded for output. The letter-number combinations
that correspond to given data are listed in the MCNPX user manual. Following “F#:” is
the particle type and the cell(s) for which to record this data, as is evident in Figure 3.1.
The “E” card indicates how to bin the data that is specified to record, with the number
following “E” denoting which type of recorded data it is binning and the units of said
binning (usually energy in MeV) being defined for each data type in the MCNPX user
manual. If a given data type as already been binned, the number listed is increased by
an increment of ten from the previous “E” card that pertains to this data type (e.g. for
F2 one could have cards E2, E12, E22, etc). If one wishes to use the same binning for
all “F” cards then the “E0” card is used.
    The “M” cards specify the materials used to fill various cells in the simulation. If a
material is specified, but not used a warning will be issued upon running the simulation.
The card contains “M” followed by an assigned material number, then the isotope(s)
the material is composed, followed by the relative amount of that isotope in the given
material. The elements are specified with six or less numbers were the first three denote
the element and the last three the atomic mass A. If the numbers for A are all zero, the
average mass of a particular element on earth is used. The total amount of isotopes in a
given material should add up to some multiple of 10, so as to mimic percentages, however
if they do not the simulation will normalize the total fractional amount to one and issue
a warning. Thus material one is fully 16 O, two is mostly 56 Fe with some 54,57,58 Fe, and
three is mostly 12 C with some 13 C. Finally the “NPS” card indicates how many times
the Monte Carlo simulation will run. Recall that much more complex data cards are

                                             18
possible, however one should consult the MCNPX user manual for such cards.
    To produce output, one must first source the MCNPX package software with the
command “source /filepath/”. The simulation is then run with the command “mcnpx
i=InputFilename o=OutputFilename. Additional commands can be appended to this
line for a more customized output. Of particular use in the debugging phases is the
option “PRINT”, however this should not be used for long (> 1e4) simulations as it
creates a large output and consequently slows runtime. Visual output, also invaluable in
debugging, can be created by loading input files into the VISED[40] software, however
this too must be obtained from RSICC.
    The output of the MCNPX simulation contains many pieces of information, most
are of little interest here, so an attempt will be made to briefly highlight important
output quantities. The basic structure of the output is as follows: restate the input,
describe the input geometry, describe the specified source, list physical characteristics
of initial group of Monte Carlo simulations, list results of “F” tallies as binned by “E”
tallies, list statistical qualities of recorded tallies, and list the total simulation time in
human units (e.g. actual minutes). A sample output is not pictured here due to its
excessive length, e.g. 300 lines for the simple input shown. As was stated,a more verbose
output can be printed, and should be during debugging phases, using the “PRINT”
option. Additionally, warnings will be listed after the listed physics input or output that
MCNPX developers think generally require special attention. In practice the output
initially requires a close reading with the MCNPX manual in hand, so no effort will be
made to describe it any further. Output from simulations performed in this study is not
listed in the appendix due to size, however the author can be contacted if one wishes to
consult a full output file of a simulation presented.


3.2      GEANT4
GEANT4 is a simulation package developed by users of the CERN facility[41],[42] and is
maintained by the its user community. The installation used here was version 9.1.0, which
was released in January 2008. GEANT4 software is freely available online, provided one
is able to download a roughly 0.5Gigabyte file. As the code is open source, one is freely
available to inspect and alter source code with the caution that the software has been
developed and inspected by hundreds of professionals.
    GEANT4 simulations are coded modularly in a C++ style language, where hundreds
of pre-made classes contained in the original software are available for use. General
knowledge of C++ syntax is not required to create GEANT4 simulations, but it is highly
recommended. An attempt will be made here to describe the general make-up of a simple
GEANT4 simulation, however due to the modularity of the code the following description
will certainly lack the clarity of that given in the section on MCNPX. All codes described

                                             19
will be located in the appendix.
     Regarding general modules of the simulation, a main code is run that contains ref-
erences to the header files of the primary components of the simulation. These primary
components are main geometry, materials used, physics processes included, method in
which a single simulation iteration is generated, and method in which desired data is
recorded. Each header file contains definitions of included classes as well as references to
minor components of the simulation that specify things such as an individual detector’s
geometry or a special method of tracking data in a particular component of the simu-
lation. Header files have a corresponding source file which contains instances of classes
defined in the headers. Generally the main code exists in a directory above two sepa-
rate directories, include which has the header files and src which has the source files.
Throughout the code references are often made to predefined classes that contain infor-
mation such as a method of specifying a given geometry or an algorithm to sample a
Gaussian distribution. Other than this, no pieces of physics, input, or output are pro-
vided for the user. As such, the author advises that one begin by working by inspecting
and imitating working examples, using references such as the GEANT4 User Support
[43]
     and the doxygen GEANT4 documentation [44] .
     The main code is the driver for all other codes. It initializes the conditions of the
simulation by calling the main modules of the simulation. The driver constructs the
simulation volume, initializes the method of outputting the results, initializes the physics
to be included, initialize the visualization method, initialize the method of generating
a given simulation event, and finally the simulation event is run. The simulation is
compiled such that it handles a single event. The compiled code is iterated over for a
user-specified number of events by a compact macro that will be described after main
code components.
     Construction of the volumes within the simulation is generally done by a code called
DetectorConstruction, or something similar to this. Within this code each physical com-
ponent of the desired simulation is constructed and oriented within an arbitrarily defined
“world volume”. It is generally more convenient to reference the components of the sys-
tem via separate modules so that one could swap, say, a cylinder made of aluminum
with a rectangle made of lead, by changing a few lines of code. For each component
constructed, a material is specified to fill the volume, the volume itself is specified via
some shape and central coordinates, and an associated “messenger” class is called. A
messenger class is necessary for any volume through which the particle of interest might
pass on its way to a volume of interest, much like the “IMP” card in MCNPX. Ad-
ditionally, for volumes that are detectors which will ultimately “detect” your particle,
as the double-sided silicon strip detector in this study, the volume must be specified as
“sensitive”. Sensitive volumes require an additional code that specifies what and how to
track in said volume.
     The method of recording and outputting of results is varied and very loosely defined in

                                            20
GEANT4 documentation. The results code must interface with the code that generates
the initial source particles as well as the code for the sensitive detector. (The code used
here, Results, was based on work by Ron Fox.) In this code a hexadecimal value is
assigned to variables that indicate the type and initial energy of source particles and the
type and energy of particles that impact a sensitive detector. Prior to printing the string
of assigned variables for an event to an output file, a variable is written indicating the
beginning of an event and, after the string of variables, a variable is written indicating
the end of an event. This data is sorted into a ROOT readable format by a code that will
be described after the description of the macro that runs the simulation. Note that one
does not necessarily need to output results in the same manner as described here, but
some method must be employed if one is to go beyond simply visualizing the simulation
results.
    The physical processes to be included in a simulation are contained in the code called
something like PhysicsList. Here the processes in which a source particle can interact
with a detector system are individually listed for each potential particle of interest. For
certain particle types, like the electron, special “low energy” (< 1MeV) processes can be
employed. The processes are assigned an order to be evaluated and some are executed
only once a particle has dropped below a given kinetic energy. For example, when simu-
lating a positron in this study, included are scattering, ionization, bremsstrahlung, and,
only once the positron is “at rest”, annihilation. During a single event of a simulation the
particle will move along in steps with the direction of motion being decided in a proba-
bilistic (but physical) manner and whose length are specified in GEANT4 documentation
(but are changeable). Certain types of processes, e.g. scattering and ionization, can hap-
pen at substeps of a given step, while others, e.g. bremsstrahlung, only occur after a
step. Additionally, one can specify here at what energy to effectively stop a given par-
ticle or simply choose to accept default values. (Here default values were used because
a positron is stopped at 1keV, however the detector thresholds in the actual experiment
are no lower than 70keV.)
    As with simulation results, the method of visualization varies widely amongst GEANT4
codes. Here the package VRMLview[45] version 1.0 was used. This package is not nec-
essarily recommended, particularly as it is from 1997, however it was used in this study
because it was available. Regardless of the package employed, a code generally named
VisManager initializes the graphics system and allows it to communicate with the simu-
lation as it runs. Creation of a visualization can be turned on or off in the compact macro
that runs the simulation. It is advisable to not create visualizations for simulations of
more than 1,000 events unless a computer with considerable processor power is employed.
    Source particles are emitted (“fired”) by a code generally named something like Pri-
maryGeneratorAction. This code specifies all of the characteristics of the source. Here a
source can be as simple as a monoenergetic electron fired in a single direction, or it can
be made to fully replicate an actual radiation source. If the latter is chosen, one must

                                            21
code all source particles, energies, and their respective probabilities of emission. When
choosing this option it is wise to consult the National Nuclear Data Center (NNDC)[46]
and to be sure to include only decay branches that have a statistically significant proba-
bility of occurring during the total number of simulations run. Regardless of the source
chosen, one can specify the initial position of the source as well as the direction in which
to fire the source particle, where each could be chosen probabilistically.
    To compile the code, one must first source the GEANT4 library with the command
“source env.sh”. evn.sh and env.csh are two files which exist in the same directory
as the driver. These files contain information on how to compile the GEANT4 code.
Before the code is executed one must ensure that their .bashrc file contains the command
“export G4WORKDIR=/filepath.” One then runs “make clean”, “make”, and finally
“./ExecutableName”. At this point a compact code for a single simulation as been created
which typically shares the name of the executable file, but lacks the file extension.
    The full simulation is finally run using a compact macro, here my vis.mac. This is
a short code, typically 10s of lines long, in which it is specified how verbose the output
of the simulation should be, whether or not to create a visualization, and how many
simulation events to perform. The full Monte Carlo simulation is then run with the
command “./ExecutableName CompactMacro OutputFile”. The contents of the output
file are specified by the results code.
    For analysis it is desirable to convert the output into a ROOT[47] -readable format.
(There are likely many ways to do this, however the author simply followed an example
created by Ron Fox.) This code, generically called something like Sort2Root, initializes
a ROOT Tree, its Branches, and their Leafs to bin the data from the OutputFile into
histograms that can be used in analysis. Additionally, this code can be used to apply
detector-like resolution by effectively smearing out data bins with some desired distribu-
tion. Here this was done by taking each event energy as the centroid of a Gaussian and
using the weighted probability of the Gaussian to select a new energy, finally putting the
event into the corresponding new energy bin. Prior to writing such a code it is advisable
that one gain some familiarity with the ROOT software. Examples of all of the previously
described code will be included in the appendix as they looked for the final performed
simulations. Source code for simpler versions are also available if one wishes to contact
the author.


3.3      CASINO
CASINO is software created to model the trajectory of electrons in solids, particularly for
situations involving Scanning Electron Microscopoes (SEM)[48] . The code was developed
by the research teams at the Universit´ de Sherbrooke[38] and is freely available for
                                        e
download online, provided one register for permission on their website. The full source

                                            22
code is available for download, however only the executable graphical user interface (GUI)
was used in this study.
    A simulation in CASINO consists of firing an electron given some initial positional
distribution with some initial angular distribution directly into a volume of specified size
and composition. Results from the simulation are given in graphical form and include
information such as the energy of backscattered electrons, depth to which electrons pen-
etrated, paths electrons followed, and x-rays emitted due to electron interactions. In
studies such as the one performed, CASINO is useful for verifying simulation results by
checking quantities such as the required thickness of a given material to stop an electron
of a given energy.
    One begins creating a simulation by specifying the material composition and thickness
through which the electron is to be fired. Multiple layers can be created, however here a
single layer of Silicon was used. The range of electron energies, the positional and angular
distributions of fired electrons, as well as the total number of electron firing events to
simulate are then specified. One then chooses which data to output in graphical form.
Next the physics models for different electron energy loss processes and random number
generator are chosen. Finally one chooses how many electron trajectories to display and
the simulation is started. The entire process is quite simple to learn and, in the author’s
opinion, this simplicity justifies CASINO’s use though its output is limited.




                                            23
24
Chapter 4

Verification and Validation of
Simulations

In order to properly interpret the results of any experiment in nuclear physics, it is often
necessary to have an accompanying simulation. Simulations provide insight into the
involved physical processes and they provide a laboratory in which one can freely change
experimental conditions and visualized their impact on the results. Here the simulation
is required to correct the observed particle energy for β-summing to extract the correct
proton energy. However, before a simulation can be used it must be extensively tested to
ensure it provides results that replicate the system of interest. The processes of testing
a simulation are known as verification and validation.
    Verification is ensuring that a code accurately reproduces the desired theoretical
model being used to describe a physical situation. Validation is ensuring that the cho-
sen physical model accurately represents the physics of the situation of interest[49] . In
verifying a code one uses methods such as plausibility checks, back of the envelope calcu-
lations, rigorous examination of output for known cases, echoing of input upon output,
and comparison with codes made for a similar purpose. In validating a code one per-
forms a controlled, usually simple, experiment whose results are robust and compares the
experimental results to those of a simulation replicating that experiment. The actions
taken to verify and validate the simulations presented in this study are given below.


4.1      Verification
Verification has two main classes: internal verification and external verification. Internal
verification checks the output of a given code against its input to ensure the desired
model was properly simulated. External verification, or benchmarking, compares the
results of simulations performed with separate codes that have identical, or as identical
as possible, conditions. Internal verification was performed here for the MCNPX and

                                            25
GEANT4 simulators and benchmarking was performed for GEANT4 using MCNPX and
CASINO.
    MCNPX prints a multitude of information in its output files that can be used in
verifying a simulation. The first set of information described aids in determining if
the simulation setup is correct. The input file used to generate a given output file is
included at the beginning of the output so that it is very clear which simulation led to
which results. Warnings are sometimes listed here when errors are made in constructing
the geometry, though errors that elicit these warnings often stop the simulation from
running. The volume, material, and importance of each cell is listed in Print Table 60
so that one can be sure their geometry is as intended. Print Table 126 provides the
user with information on the total number of particle interactions occurring in a given
cell. While this information doesn’t necessarily indicate the simulation was correct, it
can provide a quick confirmation that something is very wrong, e.g. if a given cell has an
anomalously high relative number of interactions. Arguably the most important check
on the simulation setup is the visualization, where the general orientation of objects in
the simulation can be quickly confirmed.
    A second set of MCNPX output information that can be used for verification indicates
that statistical validity of the entire Monte Carlo simulation as a whole. While these
checks do not guarantee statistical validity, they do provide supporting evidence that
an ample amount of events have been run to ensure convergence. The tally information
                                                             √
given includes a statistical error assigned to each bin as N , where N is the number
of counts in a bin. The MCNPX manual suggests that no bin have an error greater
than 10% and provides near assurance of convergence if no bin has an error greater than
1%. These errors are used to provide information following the tallies on the validity
of the simulation using 10 statistical checks, which are described in the MCNPX user
manual. In practice final simulations should be run to satisfy all suggested statistical
conditions, however such simulations are computationally expensive. Thus a practical
solution during development is to reduce the number of events by a factor of 10 for
the initially working simulation until the results no loner agree. Subsequent simulations
run during development should be run with a much smaller number of events, though
occasional checks should be made to ensure these results are convergent with a longer
simulation. For example, simulations performed in this study often satisfied all statistical
checks for 1 × 107 events, but they provided the same results for 1 × 105 events. So many
of the simulations during development were run with the shorter number of events, but
those for final results were run with the greater number of events.
    While equally thorough verification output is possible with GEANT4, it was not
implemented in this study in order to simplify coding of the output. Internal verification
consisted mainly of checks with the visualization as well as ensuring the output was
reasonable. An example of reasonable output being roughly even total energy depositions
for all detector strips in a given hemisphere when the source is isotropic. Another more

                                            26
(a) MCNPX Verification Setup         (b) GEANT4 Verification Setup

     Figure 4.1: Near identical initial conditions used for verification simulations.



rigid check is ensuring the energy deposited in a detector is never greater than the initial
energy of the source particle.
    Once MCNPX and GEANT4 were separately internally verified, GEANT4 was bench-
marked with MCNPX. With as identical conditions as possible, several simulations were
performed. The physical setup of the simulations consisted of an Aluminum cylinder sur-
rounding a double-sided Silicon strip detector (DSSD), with a vacuum in the open space.
The cylinder has a length l = 16.32cm, inner radius RI = 7.5cm and outer radius RO =
7.62cm and the DSSD has dimensions length × width × height = 4cm×4cm×0.05cm,
where the long axis of the cylinder and the height of the DSSD are oriented along the
z-direction. The plane of the closest cylinder end is 8.27cm from the closest DSSD surface
and the centroid of the DSSD is at (x,y)=(0,0) with respect to the cylinder’s coordinates.
The source is located at the center, (x,y,z)=(0,0,0), of the cylinder emitting monoener-
getic electrons isotropically. (See Figure 4.1.)
    Each verification simulation was carried out with a single electron energy. Energies
chosen were 0.481, 0.553, 0.565, 0.975, 1.000, 1.047, 1.059,and 1.682MeV. 1.000MeV was
chosen arbitrarily, while the other energies were chosen because they are each included
in the source for the validation experiment. No detector resolution was included in the
simulations. For all energies the simulations had excellent agreement, except for the
marked divergence below 0.17MeV, where MCNPX generally had twice the counts of
GEANT4. As an example the counts vs deposited energy are shown for the low, middle,
and high initial source energies simulated in Figure 4.2, where each simulation had 1×106
initial source events with an overall isotropic distribution.
    GEANT4 was verified in a very general way with CASINO. As identical simulation
conditions could not be reproduced, instead CASINO was used to check if it was plausible

                                            27
(a) 0.481MeV e−                  (b) 1.000MeV e−                   (c) 1.682MeV e−

Figure 4.2: General agreement between MCNPX and GEANT4 verification simulations.



that electrons of a given energy could be stopped in Silicon of a given thickness. To
mimic the DSSD, the material chosen in the CASINO verification simulation was 500µm
of Silicon. The initial electron energy was chosen to be 975keV, as this is the energy of
primary importance in the validation experiment, and the initial angle was chosen to be
50◦ , admittedly an extreme case. This simulation confirms that some of these electrons
can and are stopped in the Silicon, as is shown by the energy deposited by depth in
Figure 4.3. Here it is shown that 90% of the electron’s energy are deposited within the
red contour when an electron enters the Silicon at an angle of 50◦ , well within a depth
of 500µm, the thickness of the DSSD. (A useful paper for interpreting CASINO plots is
[50].)


4.2      Validation
                                              207
4.2.1     Validation Experiment:                    Bi Calibration Source
Validation was performed using an experiment whose basic setup was identical to that
described for the verification simulations. The source used was 207 Bi which predominantly
emits electrons with energies 0.481, 0.553, 0.565, 0.976, 1.048, 1.059, and 1.682MeV with
probabilities 13.1, 3.8, 1.3, 60.9, 16.0, 4.7, and 0.2%, respectively[46] , where probabilities
are normalized to only include these electrons. Electron energies which 207 Bi also emits
were not included due to their small probability of emission. For example, the most
frequent electron energy that was not simulated is MeV, which is emitted once in every
2 × 103 times the 976keV electron is emitted. (See [46] for a full characterization of the
source). The DSSD, a type “BB1” purchased from MicronSemiconductor[51] , was held
up by four aluminum rods which extended from one of the cylinder end caps. The data
collected was relative energy deposited by electrons in the DSSD, which was recorded

                                              28
Figure 4.3: Evidence 976MeV e− can be stopped in 500µm of Si.



by collecting electron-hole pairs created as the electron passed through the Silicon. A
voltage of 50V was applied across the detector so that charges from all parts of the
detector could be collected. An engineering drawing of the actual setup, without the
surrounding cylinder, is shown in Figure 4.4.




4.2.2    Replication via Simulation

In the simulation many simplifications were made, however it seems they are justified.
Source energies mentioned in the previous subsection are not all of the electron energies
emitted by 207 Bi, however other physical energies are emitted with a relatively low proba-
bility. Additionally 207 Bi emits photons, but it was found these do not significantly affect
the energy spectra. A full characterization of 207 Bi can be found at [46]. As is apparent
from comparing Figure 4.4 and 4.1, numerous approximations were made in creating the
simulation geometry. Ultimately only the Aluminum cylinder and the DSSD were in-
cluded because it was found that backscattering of electrons off the Aluminum chamber
had little impact on simulation results. So it was then assumed that the aluminum rods
supporting the DSSD would have an even smaller effect.

                                            29
Figure 4.4: Engineering drawing of Beta Counting Station[52] .


4.2.3    Comparison Between Simulation and Experiment
In order to compare data from the validation experiment and simulations of that ex-
periment, a calibration had to be performed to the DSSD. This was necessary because
the energy that is recorded is relative and is binned into “channels”. Channel to energy
calibration was performed by M. del Santo by recording the channels the recorded energy
deposition for several sources of known energy. M. del Santo additionally performed a
calibration using Compton scattering. Here photons from a source that mainly emits a
photon of a given energy is allowed to pass through the DSSD and is detected afterward
by a germanium detector. The change in the photon’s angle and energy is sufficient to
obtain the energy imparted to the detector, as is shown schematically in Figure 4.5.
    The channel to energy calibration ultimately resulted in a 4th order polynomial func-
tion that could be applied to the data. Adjustments were also made to the gain applied
to the data and the total number of simulation events was designed such that the total
number of recorded events would match the data. The resulting calibration function
applied to the data in the presented results was



      Energy(x = Channel) = G ∗ (p0 + p1 ∗ x + p2 ∗ x2 + p3 ∗ x3 + p4 ∗ x4 ),       (4.1)

where, to two decimal places, G = 8.6 × 102 and p0,1,2,3,4 = 0.0, 4.90 × 10−3 , 2.02 ×
10−4 , −6.94 × 10−7 , and 8.15 × 10−10 , respectively. The GEANT4 simulation used for
comparison had 1 × 105 source events, but the resulting data bins were multiplied by a
factor of 25 to have the same overall counts. The resulting comparison is shown in Figure
4.6.

                                           30
Figure 4.5: Formula and schematic for Compton scattering.


   Note the general agreement between the GEANT4 simulation and the experimental
data. Relative count peak heights are reproduced very well as are their profiles. It is
apparent that the relative spacing between the two most prominent peaks is not consistent
between simulation and experiment. This suggests that perhaps adjustments need to be
made to the calibration function or maybe more calibration data is required in the energy
range of interest.


4.3     Potential Further Verification and Validation
Ideally more verification and validation checks will be performed to ensure the accuracy
of the code.
    Regarding additional verification of the GEANT4 simulations, there are many options.
The first, and perhaps most obvious, would be to upgrade the output so that it includes
information on the volume and coordinates of simulation components. It would also
be beneficial to add statistical errors to the output, as it is done in MCNPX, so that
the statistical validity of a simulation will be more apparent. Arguably the most useful
additional verification would be benchmarking for more situations and with other codes.
    Ideally benchmarking would have been performed for a dual positron and proton
emission as well, as for β-delayed proton emission, which is the focus of this study.
However, it was found that non-physical behaviour occurs for MCNPX when positrons are
emitted within a detector of small volume. As an example of nonphysical behavior, note
the double-peaked mean energy deposition for a 1MeV isotropic electron emitting source

                                           31
Figure 4.6: Experimental data and GEANT4 simulation comparison for validation.


centrally located within in a DSSD shown in Figure 4.7. These simulations could not
be performed with CASINO as it only simulates the trajectory of electrons in materials.
For benchmarking this type of physics, the author has recently become aware of the
FLUKA[55],[56] simulation package, which seems well suited due to its versatility and
well developed user support.
    Regarding additional validation, any number of experiments could be performed. The
most useful experiments would use another discrete electron source or an alpha source
or a proton beam. An alpha source was not simulated in this study. Being that the
proton, for which the alpha calibrates, is generally fully stopped within the DSSD, it was
assumed here that the centroid of its energy distribution would be centered around its
full energy with a full width half maximum of the detector’s resolution. As experimental
information provided this full width half maximum, it seemed unnecessary to perform
a simulation to confirm this result as the full width half maximum of detector response
is given to the simulation as input. A proton beam was not simulated because it seems
unlikely that the DSSD will be taken to a facility with a proton beam in the near future.




                                           32
1MeV e- centrally emitted from 0.5 X 1 X 40mm Si strip
                          600000
                                                                              1e7 runs, perfect resolution



                          500000



                          400000
    Counts (total: 1e7)




                          300000




                          200000




                          100000




                              0
                                   0   0.2               0.4                0.6                   0.8        1
                                                    Pulse Height (MeV), 10keV bins

Figure 4.7: Unphysical behavior by MCNPX when simulating an e− in a single Si strip.




                                                               33
34
Chapter 5

Prediction of Experimental Results

Prior to describing the experiment and simulation that were the focus of this study,
the purpose will be briefly rehashed. Recall that the goal is to identify levels in 69 Br,
particularly the ground state, that lay below its isobaric analogs state (IAS). The proton
emitted from the ground state of 69 Br is of particular interest because it will allow us
to determine a ground state mass for the nucleus, which can be used to experimentally
assign a proton capture Q-value to the rp-process waiting point nucleus 68 Se. The method
which will be used to measure the proton’s energy is the detection of β-delayed proton
emission by 69 Kr, which will inherently sum the energy of the emitted positron with the
energy of the proton, upon detection. The experiment being described to accomplish this
task is scheduled to be performed by Marcelo del Santo, accompanied by the research
group of Hendrik Schatz, from May 10 to May 18 (roughly one week from this writing)
as experiment 07025 at the National Superconducting Cyclotron Laboratory (NSCL).


         69
5.1           Kr Experiment
As 69 Kr has a half-life of t 1 = 32ms[46] , it must be produced on site at the NSCL. An ion
                              2

source produces 78 Kr, which is accelerated by the coupled K500 and K1200 cyclotrons[57] ,
schematically shown in Figure 1.3, to an energy of 150 Mu (MeV per Nucleon). At 25
                                                          eV

particle-nanoamps (pnA), the beam will be fragmented by a Beryllium target to produce
69
   Kr and along with some contaminants. Most of the contaminants will then be removed
as the beam passes through the A1900 fragment separator[30] and the Radio Frequency
Fragment Separator[58] (RF Kicker). Finally the beam will pass through three single
sided PIN Silicon detectors and one DSSD, implanting 69 Kr in a second DSSD which has
behind it a third DSSD and a fourth PIN detector. Collectively these Silicon detectors
are the Beta Counting Station (BCS)[52] . This is shown schematically in Figure 5.1. Not
shown is the Segmented Germanium Array (SeGA)[59] which will surround the BCS.

                                            35
Figure 5.1: Experimental set up for experiment 07025 at the NSCL.



    The data of primary interest in the experiment is the energy deposited in the BCS
and SeGA. The BCS will collect energy from positrons and protons resultant from 69 Kr
β-delayed proton emission and SeGA will collect energy from photons emitted in the
de-excitation of 69 Br. As each system will also detect radiation from background and
contaminants, gates have been devised so that events having decay signals in the BCS
and SeGA in coincidence can be isolated so as to effectively remove the majority of
contaminants and background for decay branches that pass through an excited state
of 69 Br. For the ground state decay branch one would not expect a photon. Working
from the assumption that said gating will be effective, the simulation in this study only
examines the effects of radiation from β-delayed proton emission in the BCS.


5.2     Simulation and Results
As was the case for the validation experiment, simplifications were made to approximate
the system of interest. Indeed the setup simulated here is identical to that described in
section 4.2.2 and shown in Figure 4.1, with the only difference being the source and its
location. Here the source is located within the DSSD and emits a positron and then a
proton, so as to replicate β-delayed proton emission of 69 Kr. A time delay between the
positron and proton emission is not included, as this time in reality will be undetectable
using the given experimental setup.
    Any number of decay branches could have been simulated, however here we only
examined the decay through the IAS and the lower limit for the ground state of 69 Br.
The IAS branch was chosen because it has been previously observed[5] . The ground

                                           36
state decay branch was simulated because extracting its energy is the main goal of the
experiment and the lower limit was chosen because it provides the lowest energy signature,
closest to detector threshold, we expect to detect.
    The simulation goes through the IAS branch 83% of the time, as this was the branch-
ing ratio assigned by [5]. Upon selecting the decay branch, the rejection method[53] is
used to select the energy of the emitted positron according to its β-spectrum, which is
defined by the decay’s Q-value. Recall that the positrons can have different energies for a
decay of a given Q-value because β-decay is a three-body reaction and thus the positron
and electron neutrino may divide the total available kinetic energy differently each time
(see Figure 5.2). The β-spectrum was calculated using the simple relation[4]

                                    dPE              dp
                                     dE
                                          = ξ ∗ dP ∗ dE
                                                dp
                               dPE
                                dE
                                   = ξ ∗ p2 ∗ (Q − E)2 ∗ dE
                                                         dp

                           dPE                     2
                            dE
                                 = ξ ∗ p ∗ (Q − E) ∗ (E + me )

where PE is the probability of emitting a positron of a given kinetic energy, E is an
energy selected randomly from E = 0 to E = Q, Q is the Q-value of the decay, p is
the momentum, me is the mass of a positron, and ξ is a normalization constant[4] that
contains cancelling units and brings the maximum probability to 1. If PE is greater
than a random number selected from 0 to a number greater than Pmaximum then the
positron is fired with energy E. A Coulomb correction factor[54] could have been added,
however this would require integration of the probability distribution each event and,
upon comparison, the distribution was negligibly different for the purposes of this study.
    Following positron emission, a proton is emitted with an energy in accordance to the
decay branch chosen. Thus, roughly 83% of the time a positron will be emitted with with
an energy defined by a 10.069MeV Q-value, followed by a 4.07MeV proton, and the rest
of the time a positron will be emitted with an energy defined by a 14.019MeV Q-value,
followed by a 0.50MeV proton.
    The simulation result that was primarily investigated was the total energy deposited
in the DSSD in a decay event compared to the energy deposited only by the event’s
proton. More specifically, the comparison made was the difference between the centroids
of the peaks for these energy deposition distributions, as this is the information used to
correct for the summing effect. For the results shown (see Figures 5.3 and 5.4) the energy
deposited was segmented into 0.035MeV bins and a detector resolution of 0.175MeV,
experimentally determined by M. del Santo, was applied at all energies.
    One can see that the shift in the centroid of the energy deposition distribution due
to β + summing is 0.215MeV for both decay branches. This result indicates that this
shift will apply to all detected protons. Consequently, it seems unnecessary to simulate
additional decay branches until the experiment is performed. Once peaks in energy
deposition from β-delayed proton emission are identified in data analysis, subtracting

                                           37
Figure 5.2: Characteristics of a 14MeV Q-value β + -decay.


0.215MeV from the peak’s mean value should yield a more accurate proton energy and, in
the case of the ground state decay branch, a more accurate ground state mass of 69 Br that
can be used to help determine 68 Se’s proton capture Q-value. Note the asymmetric shape
of the summed energy peak. This asymmetry will allow for the disentanglement of the
summing effect from detector resolution, which spreads the energy peak symmetrically,
in the analysis of the experimental data.


5.3     Future Use of Simulations for Data Analysis
More simulations will be performed to ensure a swift and accurate data analysis. Regard-
ing the 69 Kr simulations, it will be important to simulate various combinations of decay
branches with different energies and ratios until the experimental results are reproduced.
Of primary importance is the reproduction of the IAS decay branch, as the energy of
these protons is known. Additionally, simulations of 22 Si and 23 Si could be performed, as
these β-delayed proton emitters have recently been measured at the NSCL. Regarding
all simulations, a significant improvement would be to make the simulation setup more
realistic with the addition of the surrounding DSSDs. It will then be possible to find
correlations between the implantation location in the central DSSD and the location of
positron detection in the surrounding DSSDs. Should the results find some group of
strips in a surrounding DSSD detects a positron more often than others, this information
can be used to gate on the more relevant strips and consequently speed the analysis

                                            38
69
Figure 5.3: Summing effect for IAS and proposed ground state decay branch for        Kr
β-delayed proton emission (blue=proton, red=sum).


process. Ultimately many more simulations may be performed, however this depends on
the needs of the team involved in data analysis.




                                        39
(a) Ground state decay branch            (b) IAS decay branch

Figure 5.4: Closeup of the summing effect for simulated decay branches.




                                   40
Bibliography

[1] http://www.phy.ornl.gov/hribf/science/abc/

[2] Van Wormer, L. et al. Astrophysical Journal. 432 (1994), 326

[3] Gottfried, K. & Yan, T. Quantum Mechanics: Fundamentals. New York: Springer-
   Verlag, 2003

[4] Martin, B. Introduction to Nuclear Physics. West Sussex, United Kingdom: Wiley &
   Sons, 2009

[5] Xu, X.J. et al. Physical Review C. 55 (1997), 2, R553

[6] Lima, G.F. et al. Physical Review C. 65 (2002), 044618

[7] Schatz, H. et al. Private Communication

[8] Kramer, K. Introductory Nuclear Physics. Hoboken, New Jersey: Wiley & Sons, 1988

[9] Schatz, H. et al. Physics Reports. 294 (1998), 167

[10] Tuli, J. NNDC 2007 Nuclear Wallet Cards http:://www.nndc.bnl.gov/wallet

[11] Smith, K. Private Communication

[12] Stolz, A. et al. Nuclear Instruments & Methods B. 241 (2005), 1, 858

[13] Nunes, F. & Thompson, I. Nuclear Reactions for Astrophysics. New York: Cam-
   bridge University Press, 2009

[14] del Santo, M. Private Communication

[15] Hester,   J. & Scowen,         P. (Arizona State University)           &   NASA.
   http://hubblesite.org/newscenter/archive/releases/1996/22/

[16] Suess, H. & Urey, H. Reviews of Modern Physics 28 (1956), 1, 53

                                           41
[17] Burbidge, E. et al. Reviews of Modern Physics 29 (1957), 4, 547

[18] Cameron, A. Publications of the Astronomical Society of the Pacific 69 (1957), 201

[19] Schatz, H. & Rehm, K. Nuclear Physics A 777 (2006), 601

[20] Grindlay, J. Comments on Astrophysics 6 (1976), 165

[21] Evans, W. et al. Astrophysical Journal 206 (1976), L135

[22] Hansen, C. & van Horn, H. Astrophysical Journal 195 (1975), 735

[23] Woosley, S. & Taam, R. Nature 263 (1976), 101

[24] Joss, P. & Rappaport, S. Nature 265 (1977), 222

[25] http://essayweb.net/astronomy/blackhole.shtml

[26] Iliadis, C. Nuclear Physics of Stars Berlin: Wiley-VCH, 2007.

[27] Weiss,      M.     &     NASA      Chandra      X-ray           Space   Telescope.
   http://chandra.harvard.edu/photo/2001v1494aql/index.html

[28] Maurer, I. & Watts, A. Monthly Notices of the Royal Astronomical Society 383
   (2008), 387

[29] Galloway, D. et al. Astrophysical Journal Supplement Series 179 (2008), 360

[30] Steiner, A. et al. Physics Reports 411 (2005), 6, 325

[31] Cyburt, R. et al. Currently under review by Astrophysical Journal Supplements
   Series

[32] Meisel, Z. et al. Proceedings of the 10th Symposium on Nuclei in the Cosmos (2008),
   173

[33] Van Wormer, L. et al. Astrophysical Journal 432 (1994), 326

[34] Schatz, H. et al. Proceedings of the American Chemical Society symposium: Origins
   of Elements in the Solar System: Implications of Post 1957 Observations (2000), 153

[35] Smith, K. et al. Proceedings of the 10th Symposium on Nuclei in the Cosmos (2008),
   178

[36] https://mcnpx.lanl.gov/

[37] http://www.geant4.org/geant4/

                                           42
[38] http://www.gel.usherbrooke.ca/casino/index.html

[39] http://www-rsicc.ornl.gov/

[40] http://www.mcnpvised.com/

[41] Agostinelli, S. et al. Nuclear Instruments and Methods in Physics Research A 506
   (2003), 3, 250

[42] Allison, J. et al. IEEE Transactions on Nuclear Science 53 (2006), 1, 270

[43] http://geant4.web.cern.ch/geant4/support/index.shtml

[44] http://www.lcsim.org/software/geant4/doxygen/html/index.html

[45] http://www.vias.org/pngguide/chapter06 08.html

[46] http://www.nndc.bnl.gov/

[47] http://root.cern.ch/drupal/

[48] Drouin, D. Microscopy and Microanalysis 12 (2006), S02, 1512

[49] Post, D. & Votta, L. Physics Today Jan. 2005, 35

[50] Drouin, D. et al. Scanning 29 (2007), 92

[51] http://www.micronsemiconductor.co.uk/pdf/bb.pdf

[52] Prisciandaro, J. et al. Nuclear Instruments & Methods A 505 (2003), 1, 140

[53] Press, W. et al. Numerical Recipes in C, 2nd Ed. New York: Cambridge University
   Press, 1992. (p.290)

[54] Blatt, J. & Weisskopf V. Theoretical Nuclear Physics. New York: Springer-Verlag,
   1979.

[55] http://www.fluka.org/fluka.php

[56] Fass`, A. et al. CERN-2005-10 (2005), INFN/TC 05/11 SLAC-R-773
         o

[57] http://www.nscl.msu.edu/tech/accelerators

[58] Bazin, D. et al. Nuclear Instruments & Methods A 606 (2009), 3, 314

                                           43
[59] http://www.nscl.msu.edu/files/sega sld 2007.pdf


  This thesis was prepared using the L TEX typesetting language [60, 61].
                                     A




[60] L. Lamport, 1985 Addison-Wesley, Boston, “LTEX: A Document preparation Sys-
                                               A

   tem”

[61] D. E. Knuth, 1985 Addison-Wesley, Boston, “The TEXbook”




                                          44
Appendix: Code

          The following Code is for final simulations performed in this study. Code for MCNPX

     simulates the validation experiment described in chapter 4. The file path for this work

     is: /projects/jina/jinalib/meisel/Thesis69Br/MCNP/Comp2Geant/. Code for GEANT4

     simulates the experiment described in chapter 5. The file path for this work is: /project-

     s/jina/jinalib/meisel/Thesis69Br/GEANT/SimpleSetup/. Code for all simulations are

     available and one can contact the author for access to these.


     5.4           MCNPX
 1   207 Bi t o w a r d s 40 s t r i p DSSD
 2   c cells
 3   c
 4   c Exterior void
 5   1 0 2
 6   c
 7   c DSSD s t r i p s
 8   2 1 −2.329 −1 −4
 9   3 1 −2.329 −1 4 −5
10   4 1 −2.329 −1 5 −6
11   5 1 −2.329 −1 6 −7
12   6 1 −2.329 −1 7 −8
13   7 1 −2.329 −1 8 −9
14   8 1 −2.329 −1 9 −10
15   9 1 −2.329 −1 10 −11
16   10 1 −2.329 −1 11 −12
17   11 1 −2.329 −1 12 −13
18   12 1 −2.329 −1 13 −14
19   13 1 −2.329 −1 14 −15
20   14 1 −2.329 −1 15 −16
21   15 1 −2.329 −1 16 −17
22   16 1 −2.329 −1 17 −18
23   17 1 −2.329 −1 18 −19
24   18 1 −2.329 −1 19 −20
25   19 1 −2.329 −1 20 −21
26   20 1 −2.329 −1 21 −22
27   21 1 −2.329 −1 22 −23
28   22 1 −2.329 −1 23 −24
29   23 1 −2.329 −1 24 −25
30   24 1 −2.329 −1 25 −26
31   25 1 −2.329 −1 26 −27




                                                45
32   26 1 −2.329 −1 27 −28
 33   27 1 −2.329 −1 28 −29
 34   28 1 −2.329 −1 29 −30
 35   29 1 −2.329 −1 30 −31
 36   30 1 −2.329 −1 31 −32
 37   31 1 −2.329 −1 32 −33
 38   32 1 −2.329 −1 33 −34
 39   33 1 −2.329 −1 34 −35
 40   34 1 −2.329 −1 35 −36
 41   35 1 −2.329 −1 36 −37
 42   36 1 −2.329 −1 37 −38
 43   37 1 −2.329 −1 38 −39
 44   38 1 −2.329 −1 39 −40
 45   39 1 −2.329 −1 40 −41
 46   40 1 −2.329 −1 41 −42
 47   41 1 −2.329 −1 42
 48   c
 49   c Aluminum C y l i n d e r
 50   42 2 −2.7 43 −44
 51   c
 52   c v o i d between s p h e r e and DSSD
 53   43 0 −2 #2 #3 #4 #5 #6 #7 #8 #9 #10 #11 #12 #13 #14 #15 #16 #17 #18 #19 &
 54             #20 #21 #22 #23 #24 #25 #26 #27 #28 #29 #30 #31 #32 #33 #34 #35&
 55             #36 #37 #38 #39 #40 #41 #42
 56
 57   c surfaces                                                                         80 CHAR|
 58   c 1 RPP −2. 2 . −0.025 0 . 0 2 5 −2. 2 . $ Main block
 59   c d e t e c t o r i s 525um t h i c k f o r Expt H a l l Apr 2010   cal .   runs
 60   1 RPP −2. 2 . −0.02625 0 . 0 2 6 2 5 −2. 2 .
 61   c    xmin xmax                y                z
 62   c
 63   c Sphere
 64   2 SO 1 4 . 0 5
 65   c
 66   c S l i c e s i n DSSD
 67   4 PX −1.9
 68   5 PX −1.8
 69   6 PX −1.7
 70   7 PX −1.6
 71   8 PX −1.5
 72   9 PX −1.4
 73   10 PX −1.3
 74   11 PX −1.2
 75   12 PX −1.1
 76   13 PX −1.0
 77   14 PX −0.9
 78   15 PX −0.8
 79   16 PX −0.7
 80   17 PX −0.6
 81   18 PX −0.5
 82   19 PX −0.4
 83   20 PX −0.3
 84   21 PX −0.2
 85   22 PX −0.1
 86   23 PX 0 .
 87   24 PX 0 . 1
 88   25 PX 0 . 2
 89   26 PX 0 . 3
 90   27 PX 0 . 4
 91   28 PX 0 . 5
 92   29 PX 0 . 6
 93   30 PX 0 . 7
 94   31 PX 0 . 8
 95   32 PX 0 . 9
 96   33 PX 1 . 0
 97   34 PX 1 . 1
 98   35 PX 1 . 2
 99   36 PX 1 . 3
100   37 PX 1 . 4
101   38 PX 1 . 5
102   39 PX 1 . 6
103   40 PX 1 . 7
104   41 PX 1 . 8
105   42 PX 1 . 9
106   c
107   c Aluminium c y l i n d e r
108   43 RCC 0 −8.05 0 0 1 6 . 0 7 . 5
109   c               base    vector radius
110   44 RCC 0 −8.062 0 0 1 6 . 6 2 0 7 . 6 2
111
112   c D T CARDS
         A A                                                                               80 CHAR|
113   MODE E P




                                                                           46
114   IMP : E 0 1 41R
115   IMP : P 0 1 41R
116   c
117   c S o u r c e ( 7 e n e r g i e s w i t h i n . 2 5 cm r a d i u s , 7cm away , a n g u l a r e m i s s i o n )
118   c SDEF POS= 0 −7.05 0 CEL=43 ERG                     =D1 PAR=3$                              i s o t r o p i c point source
119   c S o u r c e was moved to 2 . 2 5 cm away f o r Apr 2010 r u n s
120   SDEF POS= 0 −2.25 0 CEL=43 ERG                    =D1 PAR=3
121   c
122   c d e f a u l t DIR s e n d s p a r t i c l e anywhere i n f o r w a r d h e m i s p h e r e
123   c
124   c E n e r g i e s and p r o b a b i l i t i e s
125   SI1 L 0.48169 0.55383 0.56584 0.97565 1.04779 1.05981 1.68222
126   SP1 D 131 38 13 609 160 47 2
127   c
128   c Tally
129   F8 : E 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 &
130           28 29 30 31 32 33 34 35 36 37 38 39 40 41 T
131   E8 0 . 1 . e−5 1 . e−3 0 . 0 1 84 I 1 . 6 9 $ 20 keV b i n s ( T r i a l Run f o r peak m a t c h i n g )
132   F18 : E 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 &
133           28 29 30 31 32 33 34 35 36 37 38 39 40 41 T
134   E18 0 . 1 . e−5 1 . e−3 0 . 0 1 84 I 1 . 6 9
135   ∗F28 : E 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 &
136             28 29 30 31 32 33 34 35 36 37 38 39 40 41 T
137   E28 0 . 1 . e−5 1 . e−3 0 . 0 1 84 I 1 . 6 9
138   c
139   FT8 GEB 0 . 1 7 5 0 0 $175keV r e s o l u t i o n a t a l l E
140   PHYS : E 1 . 6 8 2 2 2
141   c
142   c material
143   M1 1 4 0 0 0     1 COND=1 $ n a t u r a l s i l i c o n , s e t to c o n d u c t o r
144   M2 1 3 0 0 0 1 COND=1 $ n a t u r a l aluminium , s e t to c o n d u c t o r
145   c
146   c s e t e n e r g y i n d e x i n g to ITS 3 . 0
147   DBCN 17 J 1
148   c
149   c c u t o f f c a r d (number o f h i s t o r i e s to t r a c k )
150   NPS 1 e 6



      5.5            GEANT4
      5.5.1             Driver and Compact Macro
      Driver
  1   /∗ MonoE2block . c c :                                                         a line     in C++ can be 80 c h a r |
  2
  3   Purpose :
  4       T h i s i s t h e main program i n a s i m p l e GEANT s i m u l a t i o n .
  5       I t s h o u l d run an e n t i r e GEANT s c e n a r i o .     Zach M e i s e l
  6       began b u i l d i n g t h i s f i l e from s c r a t c h on Aug−4−09
  7       u s i n g t h e e x a m p l e s from t h e User ’ s A p p l i c a t i o n Guide
  8       a s w e l l a s H e a t h e r Crawford ’ s Geant s i m u l a t i o n s f o r
  9       e x p t s 0 8 0 0 8 and 0 7 0 2 5 , which a r e l o c a t e d i n my
 10       T h e s i s 6 9 B r /GEANT/BCS/ d i r e c t o r y .
 11   ∗/
 12   /# # # # # # # # # # # # # # # # # #
       / # # # # # # # # # # # # # # # # # #
 13   // To be i n c l u d e d e v e n t u a l l y ( some s o o n e r than o t h e r s )
 14   /# # # # # # # # # # # # # # # # # #
      ∗ # # # # # # # # # # # # # # # # # #
 15   #include ” S t e p p i n g V e r b o s e . hh”
 16   # # # # # # # # # # # # # # # # # # #/
        # # # # # # # # # # # # # # # # # # ∗
 17   // ANYTHING INVOLVING RESUTLTS OR RANDOMIZE
 18   // WAS ADDED 9 / 2 9 / 0 9
 19
 20   #include      ”G4RunManager . hh”
 21   #include      ” G4UImanager . hh”
 22   #include      ” G 4 U I t e r m i n a l . hh”
 23   #include      ” G4UItcsh . hh”
 24
 25   #i f d e f G4UI USE XM
 26   #include ”G4UIXm . hh ”
 27   #e n d i f
 28
 29   #i f d e f G4VIS USE //                         ZM 1 0 / 1 9 / 0 9
 30   #include ” VisManager . hh”
 31   #e n d i f
 32




                                                                                  47
33   #include       ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh”
 34   #include       ” M E 2 b P h y s i c s L i s t . hh”
 35   #include       ” ME2bPrimaryGeneratorAction . hh”
 36   #include       ” RunAction . hh”
 37   #include       ” E v e n t A c t i o n . hh”
 38   #include       ” S t e p p i n g A c t i o n . hh”
 39   #include       ” S t e p p i n g V e r b o s e . hh”
 40   #include       ” Randomize . hh”
 41   #include       ” R e s u l t s . hh”
 42
 43   i n t main ( i n t ,     c h a r ∗∗ a r g v )
 44   {
 45
 46       //Random E n g i n e   ZM 9 / 2 9 / 0 9
 47       CLHEP : : HepRandom : : s e t T h e E n g i n e ( new CLHEP : : RanecuEngine ) ;
 48
 49       // V e r b o s e o u t p u t c l a s s
 50       G4VSteppingVerbose ∗ v e r b o s i t y = new S t e p p i n g V e r b o s e ;
 51       G4VSteppingVerbose : : S e t I n s t a n c e ( v e r b o s i t y ) ;
 52
 53       // s e t o u t p u t f i l e
 54       G4String o u t p u t f i l e n a m e = argv [ 2 ] ;
 55
 56       // s e t mandatory i n i t i a l i z a t i o n c l a s s e s
 57       M E 2 b D e t e c t o r C o n s t r u c t i o n ∗ d e t e c t o r = new M E 2 b D e t e c t o r C o n s t r u c t i o n ( ) ;
 58       R e s u l t s ∗ r e s u l t s = new R e s u l t s ( d e t e c t o r , o u t p u t f i l e n a m e ) ;
 59
 60        if   ( r e s u l t s − i l e a t t a c h e d f l a g == f a l s e )
                                 >f
 61             {
 62                   exit ( 1 ) ;
 63             }
 64
 65       // c o n s t r u c t t h e d e f a u l t run manager
 66       G4RunManager∗ runManager = new G4RunManager ;
 67       runManager−         >S e t U s e r I n i t i a l i z a t i o n ( d e t e c t o r ) ;
 68
 69       // s e t a n o t h e r mandatory i n i t i a l i z a t i o n c l a s s
 70       G 4 V U s e r P h y s i c s L i s t ∗ p h y s i c s = new M E 2 b P h y s i c s L i s t ;
 71       runManager−        >S e t U s e r I n i t i a l i z a t i o n ( p h y s i c s ) ;
 72
 73       // v i s u a l i z a t i o n manager           ZM 1 0 / 1 9 / 0 9
 74       #i f d e f G4VIS USE
 75            G4VisManager ∗ v i s M a n a g e r = new VisManager ( ) ;
 76            v i s M a n a g e r− I n i t i a l i z e ( ) ;
                                     >
 77       #e n d i f
 78
 79       // s e t mandatory u s e r a c t i o n c l a s s
 80       G 4 V U s e r P r i m a r y G e n e r a t o r A c t i o n ∗ g e n a c t i o n = new ME2bPrimaryGeneratorAction ( r e s u l t s ) ;
 81       runManager−         >S e t U s e r A c t i o n ( g e n a c t i o n ) ;
 82       G4UserRunAction ∗ r u n a c t i o n = new RunAction ( d e t e c t o r ) ;
 83       runManager−         >S e t U s e r A c t i o n ( r u n a c t i o n ) ;
 84       G4UserEventAction ∗ e v e n t a c t i o n = new E v e n t A c t i o n ( r e s u l t s ) ;
 85       runManager−         >S e t U s e r A c t i o n ( e v e n t a c t i o n ) ;
 86       G 4 U s e r S t e p p i n g A c t i o n ∗ s t e p p i n g a c t i o n = new S t e p p i n g A c t i o n ;
 87       runManager−         >S e t U s e r A c t i o n ( s t e p p i n g a c t i o n ) ;
 88
 89       // I n i t i a l i z e G4 k e r n e l
 90       runManager− I n i t i a l i z e ( ) ;
                               >
 91
 92       // s e t v e r b o s i t i e s
 93       // UI−  >ApplyCommand ( ” / run / v e r b o s e 1 ” ) ;
 94       // UI−  >ApplyCommand ( ” / e v e n t / v e r b o s e 1 ” ) ;
 95       // UI−  >ApplyCommand ( ” / t r a c k i n g / v e r b o s e 1 ” ) ;
 96
 97       //Read macro ( n e c e s s a r y f o r VRMLview )
 98       G4UImanager ∗ UI = G4UImanager : : G e t U I p o i n t e r ( ) ;
 99       G 4 S t r i n g command = ” / c o n t r o l / e x e c u t e ” ;
100       G4String fileName = argv [ 1 ] ;
101       UI−  >ApplyCommand ( command+f i l e N a m e ) ;
102       / / / / / i n s t e a d ( f o r now ) s t a r t t h e run i n t h i s f i l e
103       // i n t numberOfEvent = 1 0 0 0 0 ;
104       // runManager−         >BeamOn( numberOfEvent ) ;
105       /////
106       // j o b t e r m i n a t i o n
107
108       #i f d e f G4VIS USE
109            d e l e t e visManager ;
110       #e n d i f
111
112        d e l e t e runManager ;
113        delete verbosity ;
114




                                                                                                 48
115         // g o o f y c++ return number to                 let    t h e program know t h i n g s r a n   fine
116         return 0 ;
117   }

  1
  2   #
  3   # # # ONCE FIXED COMMENT ALL EXCEPT / c o n t r o l s a v e H i s t o r y t h r o u g h l i n e 8
       # #
  4   #/ c o n t r o l / v e r b o s e 0
  5   / control / saveHistory
  6   #/run / v e r b o s e 2
  7   #/e v e n t / v e r b o s e 0
  8   #/ t r a c k i n g / v e r b o s e 1
  9   # 4 g i v e s VERY d e t a i l e d t r a c k p o s i t i o n i n f o r m a t i o n                ˆˆˆˆ
 10   #
 11   # Create a s c e n e h a n d l e r f o r a s p e c i f i c g r a p h i c s system
 12   # ( E d i t t h e n e x t l i n e ( s ) to c h o o s e a n o t h e r g r a p h i c s y s t e m )
 13   #
 14   # Open a v i e w e r and o u t p u t to i t
 15   #/ v i s /open VRML2FILE
 16   # C r e a t e an empty s c e n e
 17   #/ v i s / s c e n e / c r e a t e
 18   #/ v i s / s c e n e H a n d l e r / a t t a c h
 19   # Output an empty d e t e c t o r
 20   #/ v i s / v i e w e r / f l u s h
 21   #
 22   # f o r drawing the t r a c k s
 23   # ( i f t o o many t r a c k s c a u s e c o r e dump =                   > s t o r e T r a j e c t o r y 0)
 24   #
 25   #/ t r a c k i n g / s t o r e T r a j e c t o r y 1
 26   #/ v i s / s c e n e / e n d O f E v e n t A c t i o n a c c u m u l a t e −1#number added by ZM 8 / 0 4 / 0 9
 27   #/ v i s / s c e n e / add / t r a j e c t o r i e s
 28
 29   / run /beamOn 1 0 0 0 0 0 0
 30
 31   #/ v i s / s c e n e / endOfRunAction a c c u m u l a t e


      5.5.2                 Header Files
      5.5.3                 EventAction.hh
 1    #i f n d e f    EventAction h
 2    #d e f i n e    EventAction h 1
 3
 4    #include ” G4UserEventAction . hh”
 5    #include ” TrackerIonSD . hh”
 6    //#include ”TrackerGammaSD . hh”
 7    #include ” G4Event . hh”
 8    #include ” G 4 T r a j e c t o r y C o n t a i n e r . hh ”
 9    #include ” G 4 T r a j e c t o r y . hh”
10    #include ” G 4 i o s . hh ”
11    #include ” g l o b a l s . hh”
12    #include ” G4UnitsTable . hh”
13    #include ” R e s u l t s . hh”
14
15    c l a s s E v e n t A c t i o n : public G4UserEventAction
16    {
17        public :
18            EventAction ( R e s u l t s ∗ ) ;
19          ˜ EventAction ( ) ;
20
21            v o i d B e g i n O f E v e n t A c t i o n ( c o n s t G4Event ∗ ) ;
22            v o i d EndOfEventAction ( c o n s t G4Event ∗ ) ;
23
24         private :
25         Results ∗ r e s u l t s ;
26         G4int i o n C o l l e c t i o n I D ;
27         // G 4 i n t g a m m a C o l l e c t i o n I D ;
28    };
29
30    #e n d i f //EVENTACTION H


      5.5.4                 experimentalHall.hh
      5.5.5                 experimentalhall Messenger.hh

                                                                                       49
1   #i f n d e f   experimentalHall Messenger h
 2   #d e f i n e   experimentalHall Messenger h 1
 3
 4   #include        ” e x p e r i m e n t a l H a l l . hh”
 5   #include        ” g l o b a l s . hh”
 6   #include        ” G4UImessenger . hh”
 7   #include        ” G 4 U I d i r e c t o r y . hh”
 8   #include        ” G4UIcmdWithAString . hh ”
 9   #include        ” G4UIcmdWithADoubleAndUnit . hh”
10   #include        ” G4UIcmdWithoutParameter . hh”
11
12   c l a s s e x p e r i m e n t a l H a l l M e s s e n g e r : public G4UImessenger {
13         public :
14             experimentalHall Messenger ( experimentalHall ∗);
15             ˜ experimentalHall Messenger ( ) ;
16
17         // v o i d SetNewValue ( G4UIcommand ∗ , G 4 S t r i n g ) ; / / p r o b a b l y n o t n e e d e d
18
19         private :
20            experimentalHall ∗ expHall ;
21
22                G4UIdirectory ∗                        expHallDIR ;
23                G4UIcmdWithAString ∗                   MatCmd ;
24                G4UIcmdWithADoubleAndUnit∗             XCmd;
25                G4UIcmdWithADoubleAndUnit∗             YCmd;
26                G4UIcmdWithADoubleAndUnit∗             ZCmd ;
27                G4UIcmdWithoutParameter ∗              RepCmd ;
28   };
29
30   #e n d i f



     5.5.6               Materials.hh
 1   #i f n d e f   Materials H
 2   #d e f i n e   Materials H 1
 3
 4   #include ” G 4 M a t e r i a l . hh”
 5
 6   class Materials
 7   {
 8     public :
 9
10
11        Materials ( ) ;
12        ˜ Materials ( ) ;
13
14        G4Material ∗ FindMaterial ( G4String               );
15
16          private :
17        // E l e m e n t s
18
19        G4Element ∗          elementH ;
20        G4Element ∗          elementC ;
21        G4Element ∗          elementN ;
22        G4Element ∗          elementO ;
23        G4Element ∗          elementMg ;
24        G4Element ∗          elementAl ;
25        G4Element ∗          elementSi ;
26        G4Element ∗          elementTi ;
27        G4Element ∗          elementV ;
28        G4Element ∗          elementFe ;
29        G4Element ∗          elementMo ;
30        G4Element ∗          elementPt ;
31        G4Element ∗          elementAu ;
32
33   /∗Ta and I r added by P h i l and L u c i a on 1 / 2 0 / 0 9 ∗ /
34     G4Element ∗ e l e m e n t I r ;
35     G4Element ∗ elementTa ;
36     G4Element ∗ elementW ;
37
38   // M a t e r i a l s
39
40        G4Material ∗         vacuum ;
41        G4Material ∗         Al ;
42        G4Material ∗         Nb ;
43        G4Material ∗         C;
44        G4Material ∗         Au ;
45        G4Material ∗         Si ;
46        G4Material ∗         Be ;
47        G4Material ∗         nylon6 ;




                                                                                 50
48
49   /∗Ta and I r added by P h i l and L u c i a on 1 / 2 0 / 0 9 ∗ /
50
51        G4Material ∗ I r ;
52        G 4 M a t e r i a l ∗ Ta ;
53        G 4 M a t e r i a l ∗ W;
54   };
55
56   #e n d i f




     5.5.7                ME2bDetectorConstruction.hh

 1   #i f n d e f   ME2bDetectorConstruction H
 2   #d e f i n e   ME2bDetectorConstruction H 1
 3
 4   #include ” M a t e r i a l s . hh”
 5   #include ”G4SDManager . hh”
 6   //#include ”G4RunManager . hh”
 7   //#include ” G 4 M a t e r i a l . hh”
 8   //#include ”G4Box . hh”
 9   //#include ” G4ThreeVector . hh”
10   //#include ” G4PVPlacement . hh”
11   //#include ” G 4 V i s A t t r i b u t e s . hh”
12   #include ” G4LogicalVolume . hh”
13   #include ” G4VPhysicalVolume . hh”
14   //#include ” g l o b a l s . hh” // I S THIS NECESSARY?
15   #include ” G 4 V U s e r D e t e c t o r C o n s t r u c t i o n . hh”
16   #include ” TrackerIonSD . hh”
17   #include ” T r a c k e r I o n S D M e s s e n g e r . hh ”
18   #include ”G4SDManager . hh”
19   #include ” S i B l o c k M e s s e n g e r . hh”
20   #include ” S i B l o c k . hh”
21   #include ” e x p e r i m e n t a l H a l l . hh”
22   #include ” e x p e r i m e n t a l H a l l M e s s e n g e r . hh”
23
24   // i t seems a s i f t h e s e 4 might be r e p l a c e d by #include s t a t e m e n t s
25   // c l a s s G4Box ;
26   // c l a s s G4LogicalVolume ;
27   // c l a s s G4VPhysicalVolume ;
28   // c l a s s G 4 M a t e r i a l ;
29
30   c l a s s M E 2 b D e t e c t o r C o n s t r u c t i o n : public G 4 V U s e r D e t e c t o r C o n s t r u c t i o n
31   {
32     // public c l a s s members a r e a c c e s s i b l e from anywhere t h e o b j e c t i s v i s i b l e
33     public :
34         ME2bDetectorConstruction ( ) ;
35         ˜ ME2bDetectorConstruction ( ) ;
36
37         G4VPhysicalVolume ∗ C o n s t r u c t ( ) ;
38
39         // t h e s e a r e r e a l l y q u e s t i o n a b l e ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜
40         // S i B l o c k ( G4LogicalVolume ∗ , G 4 M a t e r i a l ∗ ) ;
41         //˜ S i B l o c k ( ) ;
42
43     // p r i v a t e c l a s s members a r e            accessible          only from w i t h i n          o t h e r members o f
44     // t h e same c l a s s
45     private :
46
47         SiBlock ∗ theSiBlock ;
48
49         // L o g i c a l Volumes
50         G4LogicalVolume ∗ e x p e r i m e n t a l H a l l l o g ;
51         G4LogicalVolume ∗ aluminumChamber log ;
52         // G4LogicalVolume ∗ S i B l o c k l o g ;
53
54         // P h y s i c a l Volumes
55         G4VPhysicalVolume ∗ e x p e r i m e n t a l H a l l p h y s ;
56         G4VPhysicalVolume ∗ aluminumChamber phys ;
57         // G4VPhysicalVolume ∗ S i B l o c k p h y s ;
58
59    private :
60      TrackerIonSD ∗ T r a c k e r I o n ;
61      TrackerIonSD Messenger ∗ TrackerIonSDMessenger ;
62      SiBlock Messenger ∗ SiBlockMessenger ;
63      experimentalHall Messenger ∗ experimentalHallMessenger ;
64   };
65
66   #e n d i f




                                                                                                 51
5.5.8              ME2bPhysicsList.hh
 1   #i f n d e f   ME2bPhysicsList h
 2   #d e f i n e   ME2bPhysicsList h 1
 3
 4   #include ” G 4 V U s e r P h y s i c s L i s t . hh ”
 5   #include ” g l o b a l s . hh”
 6
 7   c l a s s ME2bPhysicsList :           public G 4 V U s e r P h y s i c s L i s t
 8   {
 9     public :
10         ME2bPhysicsList ( ) ;
11         ˜ ME2bPhysicsList ( ) ;
12
13    protected :
14      // c o n s t r u c t p a r t i c l e and p h y s i c s   process
15      void ConstructParticle ( ) ;
16      void ConstructProcess ( ) ;
17      v o i d ConstructEM ( ) ;
18      void SetCuts ( ) ;
19   };
20
21   #e n d i f


     5.5.9              ME2bPrimaryGeneratorAction.hh
 1   #i f n d e f   ME2bPrimaryGeneratorAction h
 2   #d e f i n e   ME2bPrimaryGeneratorAction h 1
 3
 4   #include ” G 4 V U s e r P r i m a r y G e n e r a t o r A c t i o n . hh”
 5   #include ” G4RandomDirection . hh”
 6   #include <v e c t o r >//< v e c t o r >       ! ! ! a l s o w o r k s w/ d e p r e c a t e d   h e a d e r < v e c t o r . h >!? w/ o u t   Nolley ’ s   changes
 7   #include ” R e s u l t s . hh”
 8   //#include ” Randomize . hh”
 9   #include ” S o u r c e D a t a . hh”
10
11   c l a s s G4ParticleGun ;
12   c l a s s G4Event ;
13
14   c l a s s ME2bPrimaryGeneratorAction : public G 4 V U s e r P r i m a r y G e n e r a t o r A c t i o n
15   {
16     public :
17         ME2bPrimaryGeneratorAction ( R e s u l t s ∗ ) ;
18         ˜ ME2bPrimaryGeneratorAction ( ) ;
19
20     public :
21       v o i d G e n e r a t e P r i m a r i e s ( G4Event ∗ anEvent ) ;
22
23        // S e t S o u r c e function d e f i n e d h e r e
24        //// I ’m p r e t t y s u r e t h e s e 5 l i n e s a r e n ’ t n e c e s s a r y
25        v o i d S e t S o u r c e ( ) { gamma source = t r u e ; } ;
26        v o i d SetInBeam ( ) {
27              gamma source = f a l s e ;
28              alpha source = f a l s e ;
29              beta source = f a l s e ;
30              kr69decay = f a l s e ;
31        };
32        //// I ’m a l s o u n s u r e a s to n e c e s s i t y o f t h e s o u r c e p o s i t i o n
33        v o i d S e t S o u r c e X ( G4double x ) { s o u r c e P o s i t i o n . s e t X ( x ) ; } ;
34        v o i d S e t S o u r c e Y ( G4double y ) { s o u r c e P o s i t i o n . s e t Y ( y ) ; } ;
35        v o i d S e t s o u r c e Z ( G4double z ) { s o u r c e P o s i t i o n . s e t Z ( z ) ; } ;
36
37        void SetSourceBi207 ( ) ;
38        G4double G e t S o u r c e E n e r g y ( ) ;
39
40     private :
41       G4ParticleGun ∗ p a r t i c l e G u n ;
42       Results ∗ r e s u l t s ;
43       G4int n p a r t i c l e ;
44       // E x t r a d e f i n i t i o n s h e r e i f s o u r c e function d e f i n e d above
45       G4ParticleTable ∗ particleTable ;
46       G4bool gamma source ;
47       G4bool a l p h a s o u r c e ;
48       G4bool b e t a s o u r c e ;
49       G4bool k r 6 9 d e c a y ;
50       // G4bool d e c a y s i m u l a t i o n ;
51       G4ThreeVector s o u r c e P o s i t i o n ;
52       //// was :
53       / / / / / v e c t o r <S o u r c e D a t a∗> TheSource ;




                                                                                        52
54         //// now , upon n o l l e y ’ s s u g g e s t i o n :
55         s t d : : v e c t o r <S o u r c e D a t a∗> TheSource ;
56         /// end a d d i t i o n s due to n o l l e y
57         G4double s o u r c e B r a n c h i n g S u m ;
58   };
59
60   #e n d i f


     5.5.10                  PixelParameterisation.hh
 1   #i f n d e f   PixelParameterisation H
 2   #d e f i n e   PixelParameterisation H 1
 3
 4   #include ” g l o b a l s . hh”
 5   #include ” G4VPVParameterisation . hh ”
 6
 7   c l a s s G4VPhysicalVolume ;
 8   c l a s s G4Box ;
 9
10   // Dummy d e c l a r a t i o n s to g e t              rid   of   warnings        ...
11   c l a s s G4Trd ;
12   c l a s s G4Trap ;
13   c l a s s G4Cons ;
14   c l a s s G4Orb ;
15   c l a s s G4Sphere ;
16   c l a s s G4Torus ;
17   c l a s s G4Para ;
18   c l a s s G4Hype ;
19   c l a s s G4Tubs ;
20   c l a s s G4Polycone ;
21   c l a s s G4Polyhedra ;
22
23   class PixelParameterisation                        :    public G4VPVParameterisation
24   {
25   public :
26
27        P i x e l P a r a m e t e r i s a t i o n ( G4int NoPixels ,
28                                G4double w i d t h P i x e l ) ;
29
30        virtual
31        ˜ PixelParameterisation ( ) ;
32
33        v o i d C o m p u t e T r a n s f o r m a t i o n ( c o n s t G4int ,   G4VPhysicalVolume ∗ ) c o n s t ;
34
35        v o i d ComputeDimensions ( G4Box& , c o n s t G4int ,
36                   c o n s t G4VPhysicalVolume ∗ ) c o n s t { } ;
37
38   private :         // Dummy d e c l a r a t i o n s to g e t          rid     of    warnings       ...
39
40     v o i d ComputeDimensions                  ( G4Trd&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
41     v o i d ComputeDimensions                  ( G4Trap&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
42     v o i d ComputeDimensions                  ( G4Cons&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
43     v o i d ComputeDimensions                  ( G4Sphere &, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
44     v o i d ComputeDimensions                  ( G4Orb&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
45     v o i d ComputeDimensions                  ( G4Torus&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
46     v o i d ComputeDimensions                  ( G4Para&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
47     v o i d ComputeDimensions                  ( G4Hype&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
48     v o i d ComputeDimensions                  ( G4Tubs&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
49     v o i d ComputeDimensions                  ( G4Polycone &, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
50     v o i d ComputeDimensions                  ( G4Polyhedra &, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {}
51   private :
52
53        G4int    fNoPixels ;
54        G4double f H a l f W i d t h ;           //       The h a l f −w i d t h o f       each   t r a c k e r chamber
55
56   };
57
58   #e n d i f


     5.5.11                  Results.hh
 1   #i f n d e f R e s u l t s h
 2   #d e f i n e R e s u l t s h 1
 3   #include ” g l o b a l s . hh”
 4   #include ” T r a c k e r I o n H i t . hh”
 5   //#include ” TrackerGammaHit . hh”
 6   #include ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh”
 7   #include <s t d i o . h>




                                                                                              53
8   #include < s t d l i b . h>
 9   #include < s t r i n g . h>
10   #include <f s t r e a m >//ZM 1 0 / 2 0 / 0 9
11
12   cl ass Results
13   {
14   public :
15      R e s u l t s ( ME2bDetectorConstruction ∗ , G4String ) ;
16      ˜ Results ( ) ;
17
18   public :
19     G4bool           file attached flag ;
20
21   public :
22      // d e l e t e d s e c o n d i n p u t i n t o f u n c t i o n s , b e c a u s e n o t u s i n g gamma h i t s
23     void Print2Screen ( TrackerIonHitsCollection ∗ ) ;
24     v o i d SaveData ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ ) ;
25     void ExtractData ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ ) ;
26     v o i d S e t P o s i t r o n I E ( G4double en ) { p o s i t r o n I E = en ; } ;
27     v o i d S e t E l e c t r o n I E ( G4double en ) { e l e c t r o n I E = en ; } ;
28     v o i d SetProtonOneIE ( G4double en ) { protonOneIE = en ; } ;
29     v o i d SetProtonTwoIE ( G4double en ) { protonTwoIE = en ; } ;
30     v o i d S e t P r o t o n T h r e e I E ( G4double en ) { p r o t o n T h r e e I E = en ; } ;
31     v o i d S e t A l p h a I E ( G4double en ) { a l p h a I E = en ; } ;
32     v o i d SetGammaOneIE ( G4double en ) { gammaOneIE = en ; } ;
33     v o i d SetGammaTwoIE ( G4double en ) { gammaTwoIE = en ; } ;
34     v o i d SetGammaThreeIE ( G4double en ) { gammaThreeIE = en ; } ;
35     v o i d SetGammaFourIE ( G4double en ) { gammaFourIE = en ; } ;
36
37   private :
38
39        G4double      positronIE ;
40        G4double      electronIE ;
41        G4double      protonOneIE ;
42        G4double      protonTwoIE ;
43        G4double      protonThreeIE ;
44        G4double      alphaIE ;
45        G4double      gammaOneIE ;
46        G4double      gammaTwoIE ;
47        G4double      gammaThreeIE ;
48        G4double      gammaFourIE ;
49
50        G4bool   print ;
51        G4String o u t p u t f i l e n a m e ;
52
53        struct ion event t {
54          bool        hit ;
55          double      trackID ;
56          double      particleID ;
57          double      beta ;
58          double      theta ;
59          double      phi ;
60          double      time ;
61          double      labtime ;
62          double      globaltime ;
63          double      KE;
64          double      Edep ;
65          double      pos x ;
66          double      pos y ;
67          double      pos z ;
68          double      pixelID ;
69   };
70
71          //4 p a r t i c l e t y p e s ( i n R e s u l t s . c c ) , 1600   pixels
72        i o n e v e n t t monoblock ev [ 4 ] [ 1 6 0 0 ] ;
73
74   //      g a m m a e v e n t t gamma ev [ 4 ] [ 1 7 ] ;
75
76        ME2bDetectorConstruction∗ d e t e c t o r ;
77
78   };
79
80   #e n d i f



     5.5.12                RunAction.hh
 1   #i f n d e f   RunAction h
 2   #d e f i n e   RunAction h 1
 3
 4   #include ” G4UserRunAction . hh”




                                                                                        54
5   #include          ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh”
 6   #include          ”G4Run . hh ”
 7   #include          ” g l o b a l s . hh”
 8   #include          ” G4UnitsTable . hh”
 9
10   c l a s s RunAction : public G4UserRunAction
11   {
12   public :
13       RunAction ( M E 2 b D e t e c t o r C o n s t r u c t i o n ∗ ) ;
14       ˜ RunAction ( ) ;
15
16   public :
17     v o i d BeginOfRunAction ( c o n s t G4Run ∗ ) ;
18     v o i d EndOfRunAction ( c o n s t G4Run ∗ ) ;
19
20   private :
21     M E 2 b D e t e c t o r C o n s t r u c t i o n ∗ myDetector ;
22
23   };
24
25
26
27
28   #e n d i f



     5.5.13                    SiBlock.hh
 1   #i f n d e f    SiBlock H
 2   #d e f i n e    SiBlock H 1
 3
 4   //#include ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh”
 5   #include ”G4RunManager . hh”
 6   #include ” G 4 M a t e r i a l . hh”
 7   #include ” M a t e r i a l s . hh”
 8   #include ”G4Box . hh ”
 9   //#include ” G 4 S u b t r a c t i o n S o l i d . hh ”
10   #include ” G4LogicalVolume . hh”
11   #include ” G4VPhysicalVolume . hh”
12   #include ” G4ThreeVector . hh”
13   #include ” G4PVPlacement . hh”
14   #include ” G 4 V i s A t t r i b u t e s . hh”
15   #include ” G4Colour . hh”
16   #include ” G 4 R o t a t i o n M a t r i x . hh”
17   #include ” G4Transform3D . hh”
18   #include ” G4UnitsTable . hh”
19   #include ” G 4 U s e r L i m i t s . hh”
20   #include ” G4PVParameterised . hh”
21   #include ” P i x e l P a r a m e t e r i s a t i o n . hh ”
22
23
24   c l a s s SiBlock {
25         public :
26             G4LogicalVolume ∗ e x p e r i m e n t a l H a l l l o g ;
27
28                S i B l o c k ( G4LogicalVolume ∗ ,              Materials ∗);
29                ˜ SiBlock ( ) ;
30
31                void Construct ( ) ;
32                v o i d S e t S i B l o c k X ( G4double ) ;
33                v o i d S e t S i B l o c k Y ( G4double ) ;
34                v o i d S e t S i B l o c k Z ( G4double ) ;
35                v o i d S e t S i B l o c k T h i c k n e s s ( G4double ) ;
36                v o i d S e t S i B l o c k P o s X ( G4double ) ;
37                v o i d S e t S i B l o c k P o s Y ( G4double ) ;
38                v o i d S e t S i B l o c k P o s Z ( G4double ) ;
39                G4LogicalVolume ∗ G e t S i B l o c k L o g ( ) { return         p i x e l l o g ; } / / was S i B l o c k l o g
40
41        private :
42           // C o n s t r u c t i o n f l a g s
43           G4bool BUILD SiBlock ;
44
45                // D i m e n s i o n s
46                G4double S i B l o c k x ; / / = 4 . 0 ∗ cm ; / / s i d e x , dx
47                G4double S i B l o c k y ; / / = 4 . 0 ∗ cm ; / / s i d e y , dy
48                G4double S i B l o c k z ; / / = 0 . 0 5 ∗ cm ; // t h i c k n e s s ,   dz
49
50                G4double         pixel x ;
51                G4double         pixel y ;
52
53                // P o s i t i o n s




                                                                                       55
54                G4double b l o c k P o s x ; / / = 0∗m; / / x−p o s i t i o n o f S i B l o c k
55                G4double b l o c k P o s y ; / / = 0∗m; / / y−p o s i t i o n o f S i B l o c k
56                G4double b l o c k P o s z ; / / = 7 . 5 ∗ cm ; / / z−p o s i t i o n o f S i B l o c k
57
58                // M a t e r i a l s
59                Materials ∗ materials ;
60                G4Material ∗ D e t e c t o r M a t e r i a l ;
61                G 4 M a t e r i a l ∗ VacuumMaterial ;
62                // G 4 M a t e r i a l ∗ P l a s t i c M a t e r i a l ; add    if   i add t h e       plastic      blocks
63
64                // s h a p e
65                G4Box∗ S i B l o c k b o x ;
66
67                G4Box∗ p i x e l b o x ;
68
69                // G 4 S u b t r a c t i o n S o l i d ∗ S i B l o c k s u r r o u n d b o x ;
70
71                // L o g i c a l volume
72                G4LogicalVolume ∗ S i B l o c k l o g ;
73                G4LogicalVolume ∗ p i x e l l o g ;
74
75                // P h y s i c a l volume
76                G4VPhysicalVolume ∗ S i B l o c k p h y s ;
77                G4VPhysicalVolume ∗ p i x e l p h y s ;
78   };
79   #e n d i f


     5.5.14                   SiBlock Messenger.hh
 1   #i f n d e f    SiBlock Messenger h
 2   #d e f i n e    SiBlock Messenger h 1
 3
 4   //#include ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh”
 5   #include ” S i B l o c k . hh”
 6   #include ” g l o b a l s . hh”
 7   #include ” G4UImessenger . hh”
 8   #include ” G 4 U I d i r e c t o r y . hh”
 9   #include ” G4UIcmdWithAString . hh ”
10   #include ” G4UIcmdWithADoubleAndUnit . hh”
11   #include ”G4UIcmdWithADouble . hh ”
12   #include ” G4UIcmdWithoutParameter . hh”
13   #include ” G4UIcmdWithAnInteger . hh ”
14
15   c l a s s S i B l o c k M e s s e n g e r : public G4UImessenger
16   {
17     public :
18         SiBlock Messenger ( SiBlock ∗ ) ;
19         ˜ SiBlock Messenger ( ) ;
20
21   // v o i d SetNewValue ( G4UIcommand ∗ , G 4 S t r i n g ) ;
22
23    private :
24      SiBlock ∗ theSiBlock ;
25      G4UIdirectory ∗                                            SiBlockDIR ;
26      G4UIcmdWithADoubleAndUnit∗                                 XSiBlockCmd ;
27      G4UIcmdWithADoubleAndUnit∗                                 YSiBlockCmd ;
28      G4UIcmdWithADoubleAndUnit∗                                 ZSiBlockCmd ;
29      G4UIcmdWithADoubleAndUnit∗                                 XPosSiBlockCmd ;
30      G4UIcmdWithADoubleAndUnit∗                                 YPosSiBlockCmd ;
31      G4UIcmdWithADoubleAndUnit∗                                 ZPosSiBlockCmd ;
32   };
33
34   #e n d i f


     5.5.15                   SourceData.hh
 1   #i f n d e f    SourceData h
 2   #d e f i n e    SourceData h 1
 3
 4   c l a s s SourceData
 5   {
 6   public :
 7       S o u r c e D a t a ( ) {}
 8       S o u r c e D a t a ( G4double d e f e ,           G4double d e f b )           :   e n e r g y ( d e f e ) , b r a n c h ( d e f b ) {}
 9       v i r t u a l ˜ S o u r c e D a t a ( ) {}
10
11        G4double e n e r g y ,         branch ;
12   };




                                                                                                   56
13   #e n d i f



     5.5.16                  SteppingAction.hh
 1   #i f n d e f    SteppingAction h
 2   #d e f i n e    SteppingAction h 1
 3
 4   #include ” G 4 U s e r S t e p p i n g A c t i o n . hh ”
 5
 6   class        SteppingAction              :       public G 4 U s e r S t e p p i n g A c t i o n
 7   {
 8
 9   public :
10
11        SteppingAction ( ) ;
12        ˜ SteppingAction ( ) { } ;
13
14        v o i d U s e r S t e p p i n g A c t i o n ( c o n s t G4Step ∗ ) ;
15
16   };
17
18   #e n d i f



     5.5.17                  SteppingVerbose.hh
 1   class        SteppingVerbose ;
 2
 3   #i f n d e f    SteppingVerbose h
 4   #d e f i n e    SteppingVerbose h 1
 5
 6   #include ” G 4 S t e p p i n g V e r b o s e . hh”
 7
 8   class        SteppingVerbose                 :    public G 4 S t e p p i n g V e r b o s e
 9   {
10
11   public :
12
13        SteppingVerbose ( ) ;
14        ˜ SteppingVerbose ( ) ;
15
16        void      StepInfo ( ) ;
17        void      TrackingStarted ( ) ;
18
19   };
20
21   #e n d i f



     5.5.18                  TrackerIonHit.hh
 1   #i f n d e f    TrackerIonHit h
 2   #d e f i n e    TrackerIonHit h 1
 3
 4   #d e f i n e   GUN FLAG                                     1
 5   #d e f i n e   TARGET FACE FLAG                             2// was t a r g e t =2 , d e g r a d e r =3
 6   #d e f i n e   TARGET BACK FLAG                             3// rxn =4 , d e c a y =5 ,max=6
 7   #d e f i n e   DEGRADER FACE FLAG                           4
 8   #d e f i n e   DEGRADER BACK FLAG                           5
 9   #d e f i n e   REACTION FLAG                                6
10   #d e f i n e   DECAY FLAG                                   7
11   #d e f i n e   MAX FLAGS                                    8
12
13   #include        ”G4VHit . hh ”
14   #include        ” G 4 T H i t s C o l l e c t i o n . hh”
15   #include        ” G 4 A l l o c a t o r . hh”
16   #include        ” G4ThreeVector . hh”
17   #include        ” G4UnitsTable . hh”
18   #include        ” G4VVisManager . hh”
19   #include        ” G 4 C i r c l e . hh”
20   #include        ” G4Colour . hh”
21   #include        ” G 4 V i s A t t r i b u t e s . hh”
22   #include        <iomanip>
23
24   c l a s s TrackerIonHit              :       public G4VHit
25   {
26   public :




                                                                                                       57
27
 28        TrackerIonHit ( ) ;
 29        ˜ TrackerIonHit ( ) ;
 30        TrackerIonHit ( c o n s t TrackerIonHit &);
 31        c o n s t T r a c k e r I o n H i t& operator=( c o n s t T r a c k e r I o n H i t & ) ;
 32        G 4 i n t operator==( c o n s t T r a c k e r I o n H i t &) c o n s t ;
 33
 34        inline     v o i d ∗ operator new ( s i z e t ) ;
 35        inline     void      operator d e l e t e ( v o i d ∗ ) ;
 36
 37        v o i d Draw ( ) ;
 38        v o i d Print ( ) ;
 39
 40   public :
 41
 42        void    SetTrackID ( G4int t r a c k ) { trackID = t r a c k ; } ;
 43        void    S e t P a r t i c l e I D ( G4String p a r t i c l e ) { p a r t i c l e I D = p a r t i c l e ;                     };
 44        void    S e t B e t a ( G4double b ) { b e t a = b ; } ;
 45        void    S e t T h e t a ( G4double t h ) { t h e t a = t h ; } ;
 46        void    S e t P h i ( G4double ph ) { p h i = ph ; } ;
 47        void    SetTime ( G4double p t ) { t i m e = p t ; } ;
 48        void    SetLabTime ( G4double l t ) { l a b t i m e = l t ; } ;
 49        void    SetGlobTime ( G4double g t ) { g l o b a l t i m e = g t ; } ;
 50        void    SetKE ( G4double k ) { KE = k ; } ;
 51        void    SetEdep ( G4double E) { Edep = E ; } ;
 52        void    S e t P o s ( G4ThreeVector xyz ) { p o s = xyz ; } ;
 53        void    SetGunFlag ( ) { f l a g = GUN FLAG ; }
 54        void    S e t D e c a y F l a g ( ) { f l a g = DECAY FLAG ; }
 55        void    S e t R e a c t i o n F l a g ( ) { f l a g = REACTION FLAG ; }
 56        void    S e t T a r g e t F a c e F l a g ( ) { f l a g = TARGET FACE FLAG ; }
 57        void    S e t T a r g e t B a c k F l a g ( ) { f l a g = TARGET BACK FLAG ; }
 58        void    S e t D e g r a d e r F a c e F l a g ( ) { f l a g = DEGRADER FACE FLAG ; }
 59        void    S e t D e g r a d e r B a c k F l a g ( ) { f l a g = DEGRADER BACK FLAG ; }
 60        void    SetVolName ( G 4 S t r i n g vn ) { volname = vn ; }
 61        void    S e t L e n g t h ( G4double l e n ) { l e n g t h = l e n ; }
 62        void    S e t P i x e l ( G4int p i x e l ) { p i x e l I D = p i x e l ; }
 63
 64     G 4 i n t GetTrackID ( ) { return t r a c k I D ; } ;
 65     G 4 S t r i n g G e t P a r t i c l e I D ( ) { return p a r t i c l e I D ; } ;
 66     G4double GetBeta ( ) { return b e t a ; } ;
 67     G4double GetTheta ( ) { return t h e t a ; } ;
 68     G4double GetPhi ( ) { return p h i ; } ;
 69     G4double GetTime ( ) { return t i m e ; } ;
 70     G4double GetLabTime ( ) { return l a b t i m e ; } ;
 71     G4double GetGlobTime ( ) { return g l o b a l t i m e ; } ;
 72     G4double GetKE ( ) { return KE; } ;
 73     G4double GetEdep ( ) { return Edep ; } ;
 74     G4ThreeVector GetPos ( ) { return p o s ; } ;
 75     G 4 S t r i n g GetVolName ( ) { return volname ; } ;
 76     G4int           G e t P i x e l ( ) { return p i x e l I D ; } ;
 77     G4int           G e t F l a g ( ) { return f l a g ; }
 78     G4double GetLength ( ) { return l e n g t h ; }
 79   private :
 80
 81        G4int                   trackID ;
 82        G4String                particleID ;
 83        G4double                beta ;
 84        G4double                theta ;
 85        G4double                phi ;
 86        G4double                time ;
 87        G4double                labtime ;
 88        G4double                globaltime ;
 89        G4double                KE;
 90        G4double                Edep ;
 91        G4ThreeVector           pos ;
 92        G4String                volname ;
 93        G4int                   pixelID ;
 94        G4int                   flag ;
 95        G4double                length ;
 96   };
 97
 98   typedef        G 4 T H i t s C o l l e c t i o n <T r a c k e r I o n H i t > T r a c k e r I o n H i t s C o l l e c t i o n ;
 99
100   extern       G 4 A l l o c a t o r <T r a c k e r I o n H i t > T r a c k e r I o n H i t A l l o c a t o r ;
101
102   i n l i n e v o i d ∗ T r a c k e r I o n H i t : : operator new ( s i z e t )
103   {
104       void ∗ aHit ;
105       aHit = ( void ∗) T r a c k e r I o n H i t A l l o c a t o r . M a l l o c S i n g l e ( ) ;
106       return a H i t ;
107   }
108




                                                                                                      58
109   i n l i n e v o i d T r a c k e r I o n H i t : : operator d e l e t e ( v o i d ∗ a H i t )
110   {
111       T r a c k e r I o n H i t A l l o c a t o r . F r e e S i n g l e ( ( TrackerIonHit ∗) aHit ) ;
112   }
113
114   #e n d i f


      5.5.19                 TrackerIonSD.hh
  1   #i f n d e f   TrackerIonSD h
  2   #d e f i n e   TrackerIonSD h 1
  3
  4   #include        ” G 4 V S e n s i t i v e D e t e c t o r . hh ”
  5   #include        ” T r a c k e r I o n H i t . hh”
  6   #include        ” G4HCofThisEvent . hh”
  7   #include        ” G4Step . hh ”
  8   #include        ” G4ThreeVector . hh”
  9   #include        ”G4SDManager . hh”
 10   #include        ” G 4 i o s . hh ”
 11   #include        ” G4UnitsTable . hh”
 12   #include        ” G4VTouchable . hh”
 13   #include        ” G4VProcess . hh”
 14   #include        ” G 4 S t e p S t a t u s . hh”
 15   #include        ” G 4 T r a c k S t a t u s . hh”
 16
 17   c l a s s TrackerIonSD : public G 4 V S e n s i t i v e D e t e c t o r
 18   {
 19   public :
 20       TrackerIonSD ( G 4 S t r i n g ) ;
 21       ˜ TrackerIonSD ( ) ;
 22
 23        void SetPrint ( ) {
 24          G4cout << ”− − − > Ion                t r a c k data        set   to   print   a t t h e end o f   e v e n t ”<<G4endl ;
 25          print = t r u e ;
 26        }
 27        void UnSetPrint ( ) {
 28          G4cout << ”− − − > Ion                t r a c k data        set   not to   print    a t t h e end o f   e v e n t ”<<G4endl ;
 29          print = f a l s e ;
 30        }
 31
 32        v o i d I n i t i a l i z e ( G4HCofThisEvent ∗ ) ;
 33        G4bool P r o c e s s H i t s ( G4Step ∗ , G 4 T o u c h a b l e H i s t o r y ∗ ) ;
 34        v o i d EndOfEvent ( G4HCofThisEvent ∗ ) ;
 35
 36   private :
 37     TrackerIonHitsCollection ∗ ionCollection ;
 38     G4bool p r i n t ;
 39
 40   };
 41
 42
 43   #e n d i f


      5.5.20                 TrackerIonSD Messenger.hh
  1   #i f n d e f   TrackerIonSD Messenger h
  2   #d e f i n e   TrackerIonSD Messenger h 1
  3
  4   #include        ” TrackerIonSD . hh”
  5   #include        ” g l o b a l s . hh”
  6   #include        ” G4UImessenger . hh”
  7   #include        ” G 4 U I d i r e c t o r y . hh”
  8   #include        ” G4UIcmdWithAString . hh ”
  9   #include        ” G4UIcmdWithADoubleAndUnit . hh”
 10   #include        ”G4UIcmdWithADouble . hh ”
 11   #include        ” G4UIcmdWithoutParameter . hh”
 12   #include        ” G4UIcmdWithAnInteger . hh ”
 13
 14
 15   c l a s s T r a c k e r I o n S D M e s s e n g e r : public G4UImessenger
 16   {
 17   public :
 18       T r a c k e r I o n S D M e s s e n g e r ( TrackerIonSD ∗ ) ;
 19       ˜ TrackerIonSD Messenger ( ) ;
 20
 21        v o i d SetNewValue ( G4UIcommand ∗ , G 4 S t r i n g ) ;
 22
 23   private :




                                                                                              59
24        TrackerIonSD ∗ t r a c k e r ;
25        G4UIdirectory ∗                                   PrtDir ;
26        G4UIcmdWithoutParameter ∗                         PrtSCmd ;
27        G4UIcmdWithoutParameter ∗                         PrtUCmd ;
28
29   };
30
31
32   #e n d i f



     5.5.21                  VisManager.hh
 1   //  V i s u a l i z a t i o n Manager
 2   // Updated November 1 0 , 2008
 3
 4   #i f n d e f    VisManager h
 5   #d e f i n e    VisManager h 1
 6
 7   #i f d e f G4VIS USE
 8
 9   #include ” G4VisManager . hh”
10
11   class        VisManager :         public G4VisManager
12   {
13
14   public :
15
16        VisManager ( ) ;
17
18   private :
19
20        void      RegisterGraphicsSystems ( ) ;
21
22   };
23
24   #e n d i f
25   #e n d i f



     5.5.22                  Source Files
     5.5.23                  EventAction.cc
 1   #include ” E v e n t A c t i o n . hh”
 2
 3
 4   E v e n t A c t i o n : : E v e n t A c t i o n ( R e s u l t s ∗ RE ) :   r e s u l t s (RE)
 5   {
 6      i o n C o l l e c t i o n I D =−1;
 7      // g a m m a C o l l e c t i o n I D =−1;
 8   }
 9
10
11   EventAction : : ˜ EventAction ( )
12   {
13     ;
14   }
15
16   v o i d E v e n t A c t i o n : : B e g i n O f E v e n t A c t i o n ( c o n s t G4Event ∗ )
17   {
18
19        G4SDManager ∗ SDman = G4SDManager : : GetSDMpointer ( ) ;
20
21        i f ( i o nCo l l e c t i o nID < 0)
22            {
23              // g a m m a C o l l e c t i o n I D=SDman− >G e t C o l l e c t i o n I D ( ” g a m m a C o l l e c t i o n ” ) ;
24              i o n C o l l e c t i o n I D=SDman−   >G e t C o l l e c t i o n I D ( ” i o n C o l l e c t i o n ” ) ;
25            }
26
27   }
28
29
30
31   v o i d E v e n t A c t i o n : : EndOfEventAction ( c o n s t G4Event ∗ e v t )
32   {
33      //    G4cout << ”+++++ End o f e v e n t ” << e v t−           >GetEventID ( ) << G4endl ;
34




                                                                                                     60
35       G4int        e v e n t i d = e v t−>GetEventID ( ) ;
36
37       i f ( e v e n t i d % 10000==0) {
38           G4cout << ” Number o f p r o c e s s e d                    e v e n t s ” << e v e n t i d << G4endl ;
39       }
40
41       i f ( i o n C o l l e c t i o n I D < 0 ) return ;
42
43       G4TrajectoryContainer ∗ t r a j e c t o r y C o n t a i n e r = evt−     >G e t T r a j e c t o r y C o n t a i n e r ( ) ;
44       G4int n t r a j e c t o r i e s = 0 ;
45       if ( trajectoryContainer )
46         {
47            n t r a j e c t o r i e s = trajectoryContainer −     >e n t r i e s ( ) ;
48         }
49
50       G4HCofThisEvent ∗ HCE = e v t−>GetHCofThisEvent ( ) ;
51
52       i f (HCE) {
53           //     results −>P r i n t 2 S c r e e n ( ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ ) (HCE >GetHC ( i o n C o l l e c t i o n I D ) ) ,
                                                                                                                  −                                               ( TrackerGammaHitsCollectio
54           results −>SaveData ( ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ ) (HCE >GetHC ( i o n C o l l e c t i o n I D ) ) ) ;
                                                                                                 −
55       }
56   }



     5.5.24                     experimentalHall.cc
 1   #include ” e x p e r i m e n t a l H a l l . hh”
 2
 3   e x p e r i m e n t a l H a l l : : e x p e r i m e n t a l H a l l ( M a t e r i a l s ∗ mat ) {
 4        m a t e r i a l s = mat ;
 5        e x p H a l l x = 1 5 . 0 ∗ cm ;
 6        e x p H a l l y = 1 8 . 0 ∗ cm ;
 7        e x p H a l l z = 1 5 . 0 ∗ cm ;
 8
 9           e x p e r i m e n t a l H a l l M a t e r i a l = m a t e r i a l s −>F i n d M a t e r i a l ( ”vacuum” ) ;
10   }
11
12   experimentalHall : : ˜ experimentalHall (){;}
13
14   G4VPhysicalVolume ∗ e x p e r i m e n t a l H a l l : : C o n s t r u c t ( ) {
15      e x p H a l l = new G4Box ( ” e x p H a l l b o x ” , e x p H a l l x , e x p H a l l y , e x p H a l l z ) ;
16      e x p e r i m e n t a l H a l l l o g = new G4LogicalVolume ( e x p H a l l ,
17                                                      experimentalHallMaterial , ” expHall log ” ,0 ,0 ,0);
18      e x p e r i m e n t a l H a l l p h y s = new G4PVPlacement ( 0 , G4ThreeVector ( ) ,
19                                                   experimentalHall log , ” expHall ” ,0 , f a l s e , 0 ) ;
20
21           // v i s i b i l i t y   business      here ,      if   added
22
23           return e x p e r i m e n t a l H a l l p h y s ;
24   }



     5.5.25                     exerimentalHall Messenger.cc
 1   #include ” e x p e r i m e n t a l H a l l M e s s e n g e r . hh”
 2
 3   e x p e r i m e n t a l H a l l M e s s e n g e r : : e x p e r i m e n t a l H a l l M e s s e n g e r ( e x p e r i m e n t a l H a l l ∗){
 4        expHallDIR = new G 4 U I d i r e c t o r y ( ” / e x p H a l l / ” ) ;
 5        expHallDIR−          >S e t G u i d a n c e ( ” exp . H a l l c o n t r o l ” ) ;
 6
 7           MatCmd = new G4UIcmdWithAString ( ” / e x p H a l l / M a t e r i a l ” , t h i s ) ;
 8           MatCmd−>S e t G u i d a n c e ( ” S e l e c t m a t e r i a l f o r t h e exp . h a l l ” ) ;
 9           MatCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ;
10           MatCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ;
11
12        XCmd = new G4UIcmdWithADoubleAndUnit ( ” / e x p H a l l / X l e n g t h ” , t h i s ) ;
13        XCmd >S e t G u i d a n c e ( ” S e l e c t t h e X l e n g t h f o r t h e exp . h a l l ” ) ;
              −
14        XCmd >SetParameterName ( ” c h o i c e ” , f a l s e ) ;
              −
15        XCmd >A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ;
              −
16
17        YCmd = new G4UIcmdWithADoubleAndUnit ( ” / e x p H a l l / Y l e n g t h ” , t h i s ) ;
18        YCmd >S e t G u i d a n c e ( ” S e l e c t t h e Y l e n g t h f o r t h e exp . h a l l ” ) ;
              −
19        YCmd >SetParameterName ( ” c h o i c e ” , f a l s e ) ;
              −
20        YCmd >A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ;
              −
21
22        ZCmd = new G4UIcmdWithADoubleAndUnit ( ” / e x p H a l l / Z l e n g t h ” , t h i s ) ;
23        ZCmd >S e t G u i d a n c e ( ” S e l e c t t h e Z l e n g t h f o r t h e exp . h a l l ” ) ;
              −
24        ZCmd >SetParameterName ( ” c h o i c e ” , f a l s e ) ;
              −
25        ZCmd >A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ;
              −




                                                                                                    61
26   }
27
28   experimentalHall Messenger : : ˜ experimentalHall Messenger (){
29      d e l e t e XCmd;
30      d e l e t e YCmd;
31      d e l e t e ZCmd ;
32      d e l e t e MatCmd ;
33      d e l e t e expHallDIR ;
34   }


     5.5.26                    Materials.cc
 1   #include ” M a t e r i a l s . hh”
 2
 3       Materials : :         Materials ()
 4   {
 5
 6        // E l e m e n t s
 7
 8        elementH =           new    G4Element ( ” Hydrogen ” ,                 ”H” ,      1.    ,       1 . 0 0 7 9 ∗ g / mole ) ;
 9        elementC =           new    G4Element ( ” Carbon ” ,                   ”C” ,      6.    ,       1 2 . 0 1 1 ∗ g / mole ) ;
10        elementN =           new    G4Element ( ” N i t r o g e n ” ,          ”N” ,      7.    ,       1 4 . 0 0 7 ∗ g / mole ) ;
11        elementO =           new    G4Element ( ” Oxygen ” ,                   ”O” ,      8.    ,     1 5 . 9 9 9 4 ∗ g / mole ) ;
12        elementMg =          new    G4Element ( ” Magnesium ” ,                ”Mg” , 1 2 .     ,     2 4 . 3 0 5 0 ∗ g / mole ) ;
13        elementAl =          new    G4Element ( ” Aluminium ” ,                ” Al ” , 1 3 .   ,     2 6 . 9 8 1 5 ∗ g / mole ) ;
14        elementSi =          new    G4Element ( ” S i l i c o n ” ,            ” Si ” ,14.      ,     2 8 . 0 8 5 5 ∗ g / mole ) ;
15        elementTi =          new    G4Element ( ” Titanium ” ,                 ” Ti ” , 2 2 .   ,         4 7 . 9 0 ∗ g / mole ) ;
16        elementV =           new    G4Element ( ” Vanadium ” ,                 ”V” , 2 3 .      ,     5 0 . 9 4 1 5 ∗ g / mole ) ;
17        elementFe =          new    G4Element ( ” I r o n ” ,                  ” Fe ” , 2 6 .   ,       5 5 . 8 4 5 ∗ g / mole ) ;
18        elementMo =          new    G4Element ( ”Molybdenum ”                , ”Mo” , 4 2 .     ,         9 5 . 9 4 ∗ g / mole ) ;
19        elementPt =          new    G4Element ( ” Platinum ” ,                 ” Pt ” , 7 8 .   ,       1 9 5 . 0 8 ∗ g / mole ) ;
20        elementAu =          new    G4Element ( ” Gold ” ,                     ”Au” , 7 9 .     ,       1 9 6 . 9 7 ∗ g / mole ) ;
21        elementIr =          new    G4Element ( ” I r i d i u m ” ,            ” Ir ” ,77.      ,     1 9 2 . 2 1 7 ∗ g / mole ) ;
22        elementTa =          new    G4Element ( ” Tantalum ” ,                 ”Ta” , 7 3 .     ,     1 8 0 . 9 4 8 ∗ g / mole ) ;
23        elementW =           new    G4Element ( ” Tungsten ” ,                 ”W” , 7 4 . ,        1 8 3 . 8 5 ∗ g / mole ) ;
24
25   // M a t e r i a l s
26
27        vacuum = new G 4 M a t e r i a l ( ”vacuum ” , 1 , 1 . 0 0 7 9 4 ∗ g / mole ,
28            1 . 0 E−25∗g /cm3 , k S t a t e G a s , 0 . 1 ∗ k e l v i n , 1 . 0 E−19∗ p a s c a l ) ;
29
30       Al   =   new    G 4 M a t e r i a l ( ” Al ”   , 1 3 , 2 6 . 9 8 1 5 3 ∗ g / mole , 2 . 7 0 ∗ g /cm3 ) ;
31       Nb   =   new    G 4 M a t e r i a l ( ”Nb”     , 4 1 , 9 2 . 9 0 6 3 8 ∗ g / mole , 8 . 5 7 ∗ g /cm3 ) ;
32       C    =   new    G 4 M a t e r i a l ( ”C” ,        6 , 1 2 . 0 1 1 ∗ g / mole ,      2 . 1 5 ∗ g /cm3 ) ;
33       Au   =   new    G 4 M a t e r i a l ( ”Au”     , 7 9 . , 1 9 6 . 9 ∗ g / mole , 1 9 . 3 2 ∗ g /cm3 ) ;
34       Be   =   new    G 4 M a t e r i a l ( ”Be”     , 4 , 9 . 0 1 2 1 8 2 ∗ g / mole , 1 . 8 4 ∗ g /cm3 ) ;
35       Si   =   new    G4Material ( ” Si ”            , 1 4 . , 2 8 . 0 8 5 5 ∗ g / mole , 2 . 3 3 ∗ g /cm3 ) ;
36       Ir   =   new    G4Material ( ” I r ”           , 7 7 . , 1 9 2 . 2 1 7 ∗ g / mole , 2 2 . 5 6 ∗ g /cm3 ) ;
37       Ta   =   new    G 4 M a t e r i a l ( ”Ta”     , 7 3 . , 1 8 0 . 9 4 8 ∗ g / mole , 1 6 . 6 9 ∗ g /cm3 ) ;
38        W   =   new    G 4 M a t e r i a l ( ”W” ,     7 4 . , 1 8 3 . 8 5 ∗ g / mole , 1 9 . 3 ∗ g /cm3 ) ;
39
40         n y l o n 6 = new G 4 M a t e r i a l ( ” n y l o n 6 ” , 1 . 1 4 ∗ g /cm3 , 4 ) ;
41         n y l o n 6−>AddElement ( elementH , 9 . 7 9 7 6 ∗ p e r C e n t ) ;
42         n y l o n 6−>AddElement ( elementC , 6 3 . 6 8 5 6 ∗ p e r C e n t ) ;
43         n y l o n 6−>AddElement ( elementN , 1 2 . 3 7 7 9 ∗ p e r C e n t ) ;
44         n y l o n 6−>AddElement ( elementO , 1 4 . 1 3 8 9 ∗ p e r C e n t ) ;
45   }
46
47    Materials : : ˜           Materials ()
48   {;}
49
50
51   G4Material ∗      M a t e r i a l s : : F i n d M a t e r i a l ( G4String materialName )
52   {
53      // s e a r c h t h e m a t e r i a l by i t s name
54     G4Material ∗ p t t o M a t e r i a l = G4Material : : Ge t Ma t e r i a l ( materialName ) ;
55     return p t t o M a t e r i a l ;
56
57   }


     5.5.27                    ME2bDetectorConstruction.cc
 1   /∗ l i k e l y l a t e r a d d i t i o n s :
 2    #include ” G4PVReplica . hh”
 3   ∗/
 4   #include ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh”
 5   #include ” P i x e l P a r a m e t e r i s a t i o n . hh ”
 6   #include ”G4SDManager . hh”




                                                                                                      62
7   #include ” G 4 M a t e r i a l . hh”
 8   #include ”G4Box . hh ”
 9   #include ”G4Tubs . hh ”
10   #include ”G4Cons . hh ”
11   #include ” G4LogicalVolume . hh”
12   #include ” G4ThreeVector . hh”
13   #include ” G4PVPlacement . hh”
14   #include ” G4Colour . hh”
15   #include ” G 4 i o s . hh ”
16   #include ” G 4 V i s A t t r i b u t e s . hh”
17   #include ” G4PVReplica . hh”
18   //#include ” G4VPhysicalVolume . hh ”
19   //#include ” G 4 V U s e r D e t e c t o r C o n s t r u c t i o n . hh”
20   #include ” g l o b a l s . hh”
21   // − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − −
       − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − −
22   // c a l l t h e c o n s t r u c t e r function o f t h e d e t e c t o r c l a s s
23   //( d e f i n e d in the header f i l e )
24   ME2bDetectorConstruction : : ME2bDetectorConstruction ( )
25    {;}
26
27   // c a l l t h e d e s t r u c t o r o f t h e same c l a s s
28   ME2bDetectorConstruction : : ˜ ME2bDetectorConstruction ( )
29   {
30     d e l e t e TrackerIonSDMessenger ;
31     d e l e t e SiBlockMessenger ;
32     delete experimentalHallMessenger ;
33   }
34
35   // c o n s t r u c t t h e p h y s i c a l volume
36   G4VPhysicalVolume ∗ M E 2 b D e t e c t o r C o n s t r u c t i o n : : C o n s t r u c t ( )
37   {
38
39        // d e f i n e   t h e m a t e r i a l s to be used− − − − − − − − − − − − − − − − − − − − − −
                                                              − − − − − − − − − − − − − − − − − − − − −
40        G4double         a ; // Atomic mass
41        G4double         z ; // Atomic number
42        G4double         density ;
43
44        M a t e r i a l s ∗ m a t e r i a l s = new M a t e r i a l s ( ) ;
45
46        // G 4 M a t e r i a l ∗ S i =
47        // new G 4 M a t e r i a l ( ” S i l i c o n ” , z = 1 4 . , a = 2 8 . 0 8 5 5 ∗ g / mole ,       d e n s i t y= 2 . 3 2 9 ∗ g /cm3 ) ;
48
49       G 4 M a t e r i a l ∗ Al=
50       new G 4 M a t e r i a l ( ” Aluminium ” , z = 1 3 . , a = 2 6 . 9 8 1 5 ∗ g / mole ,               d e n s i t y =2.7∗ g /cm3 ) ;
51
52        // G 4 M a t e r i a l ∗ Vac =
53        // new G 4 M a t e r i a l ( ”Vacuum” , z = 1 . , a = 1 . 0 0 7 9 4 ∗ g / mole ,
54        //             d e n s i t y =1.0E−13∗g /cm3 , k S t a t e G a s , 0 . 1 ∗ k e l v i n ,             1 . 3 3 0 E−3∗ p a s c a l ) ;
55
56        e x p e r i m e n t a l H a l l ∗ e x p H a l l = new e x p e r i m e n t a l H a l l ( m a t e r i a l s ) ;
57        e xp e r i me n t a l Ha l l p h ys = expHall−          >C o n s t r u c t ( ) ;
58        e x p e r i m e n t a l H a l l l o g = expHall−       >GetLogVolume ( ) ;
59        e x p e r i m e n t a l H a l l M e s s e n g e r = new e x p e r i m e n t a l H a l l M e s s e n g e r ( e x p H a l l ) ;
60
61        // d e f i n e   t h e volumes− − − − − − − − − − − − − − − − − − − − − − − − − − − −
                                         − − − − − − − − − − − − − − − − − − − − − − − − − − − −
62
63        // added to s e p a r a t e module
64        // w o r l d volume
65        / / ( ” e x p e r i m e n t a l h a l l ” w/ b e a m l i n e a l o n g y−a x i s )
66        // G4double e x p H a l l x = 1 5 . 0 ∗ cm ;
67        // G4double e x p H a l l y = 1 8 . 0 ∗ cm ;
68        // G4double e x p H a l l z = 1 5 . 0 ∗ cm ;
69
70        //G4Box∗ e x p e r i m e n t a l H a l l b o x
71        // = new G4Box ( ” e x p H a l l b o x ” , e x p H a l l x , e x p H a l l y , e x p H a l l z ) ;
72
73        // e x p e r i m e n t a l H a l l l o g = new G4LogicalVolume ( e x p e r i m e n t a l H a l l b o x ,
74        //                                                          Vac , ” e x p H a l l l o g ” , 0 , 0 , 0 ) ;
75
76        // e x p e r i m e n t a l H a l l p h y s = new G4PVPlacement ( 0 , G4ThreeVector ( ) ,
77        //                                            experimentalHall log , ” expHall ” ,0 , f a l s e , 0 ) ;
78
79       // Aluminium Chamber              ( a l o n g z−a x i s )
80       G4double T u b e I n n e r R a d i u s = 7 . 5 ∗ cm ;
81       G4double TubeOuterRadius = 7 . 6 2 ∗ cm ;
82       G4double T u b e h a l f H e i g h t D Z = 8 . 3 1 ∗ cm ; / / ∗ ∗HALF t h e t u b e l e n g t h
83       G4double T u b e S t a r t A n g l e = 0 . ∗ deg ; // a n g l e i s i n p l a n e o f c i r c u l a r f a c e
84       G4double TubeSpanAngle = 3 6 0 . ∗ deg ; // t h i s p l u s t h e above a n g l e <=2∗ p i
85       G4Tubs∗ aluminumChamber = new G4Tubs ( ” AlChamber ” , T u b e I n n e r R a d i u s ,
86                                                                 TubeOuterRadius , TubehalfHeightDZ ,
87                                                                 T u b e S t a r t A n g l e , TubeSpanAngle ) ;
88




                                                                                                63
89        aluminumChamber log = new G4LogicalVolume ( aluminumChamber , Al ,
 90                                   ” AlChamber log ” , 0 , 0 , 0 ) ;
 91
 92        G4double ChamberPos x = 0∗m; / / p o s i t o n s w/ r e s p e c t to w o r l d volume
 93        G4double ChamberPos y = 0∗m ; / / . . . t h e s e might be way wrong
 94        G4double ChamberPos z = 0∗m;
 95        aluminumChamber phys = new G4PVPlacement ( 0 ,
 96                    G4ThreeVector ( ChamberPos x , ChamberPos y , ChamberPos z ) ,
 97                    aluminumChamber log , ” chamber ” , e x p e r i m e n t a l H a l l l o g , f a l s e , 0 ) ;
 98
 99        // ADDED TO M D L S i B l o c k . c c
                               O UE
100        /////////////////////////////////////////////////////
101        // S i l i c o n Block ( l i k e a s o l i d DSSD)
102        // G4double S i B l o c k x = 4 . 0 ∗ cm ; // h o p e f u l l y t h i s means s i d e l e n g t h
103        // G4double S i B l o c k y = 4 . 0 ∗ cm ;
104        // G4double S i B l o c k z = 0 . 0 5 ∗ cm ;
105        //G4Box∗ S i B l o c k b o x = new G4Box ( ” s i l i c o n B l o c k b o x ” , S i B l o c k x ,
106        //                                           SiBlock y , SiBlock z ) ;
107
108        // S i B l o c k l o g = new G4LogicalVolume ( S i B l o c k b o x , S i , ” s i l i c o n B l o c k l o g ” ,
109        //                                        0 ,0 ,0);
110
111        // G4double b l o c k P o s x = 0∗m;
112        // G4double b l o c k P o s y = 0∗m;
113        // G4double b l o c k P o s z = 7 . 5 ∗ cm ;
114        // S i B l o c k p h y s = new G4PVPlacement ( 0 ,
115        //                   G4ThreeVector ( b l o c k P o s x , b l o c k P o s y , b l o c k P o s z ) ,
116        //                   SiBlock log , ” SiBlock ” , experimentalHall log , f a l s e , 0 ) ;
117
118        t h e S i B l o c k = new S i B l o c k ( e x p e r i m e n t a l H a l l l o g , m a t e r i a l s ) ; / / was S i B l o c k ( aluminumChamber log ,   materials )
119        theSiBlock−          >C o n s t r u c t ( ) ;
120        S i B l o c k M e s s e n g e r = new S i B l o c k M e s s e n g e r ( t h e S i B l o c k ) ;
121
122        //SENSITIVE DETECTOR
123        G4SDManager∗ SDman = G4SDManager : : GetSDMpointer ( ) ;
124        T r a c k e r I o n = new TrackerIonSD ( ” I o n T r a c k e r ” ) ;
125        T r a c k e r I o n S D M e s s e n g e r = new T r a c k e r I o n S D M e s s e n g e r ( T r a c k e r I o n ) ;
126        SDman−     >AddNewDetector ( T r a c k e r I o n ) ;
127
128        // I b e l i e v e t h e l o g i c a l volume must be u s e d f o r s e n s i t i v i t y . . . . . . . ?
129        theSiBlock−       >G e t S i B l o c k L o g ()−> S e t S e n s i t i v e D e t e c t o r ( T r a c k e r I o n ) ;
130
131        return e x p e r i m e n t a l H a l l p h y s ;
132   }



      5.5.28                   ME2bPhysicsList.cc
  1   // M E 2 b P h y s i c s L i s t . c c   for   the simple        s e t −up
  2
  3   //CODE ALTERATIONS :
  4   // ZM 9 / 2 5 / 0 9 :
  5   //       WHAT: 1 ) a t t e m p t e d to f i x i n d i c e s f o r e+ p r o c e s s e s
  6   //                    2 ) a t t e m p t e d to f i x p r o c e s s manager f o r p
  7   //       W Y: 1 ) e r r o r thrown s a y i n g i n d e x out o f r a n g e
                 H
  8   //                      f o r G4ProcessManager : : G e t A t t r i b u t e ( ) : p a r t i c l e [ e +]
  9   //                     and i r e a l i z e d e+ had no i n d i c e s f o r p r o c e s s e s
 10   //                 2 ) e r r o r thrown s a y i n g No P r o c e s s Manager f o r p r o t o n
 11   //                      p r o t o n s h o u l d be c r e a t e d i n y o u r P h y s i c s L i s t
 12   //       WORKED? : 1 ) No , but I t h i n k t h e i n d i c e s were n e e d e d
 13   //                          2 ) Yes
 14   // ZM 9 / 2 9 / 0 9 :
 15   //       WHAT: 1 ) swapped lowE i o n i z a t i o n and b r e m s s t r a h l u n g o f
 16   //                        e+ to r e g u l a r i o n i z a t i o n and b r e m s s t r a h l u n g
 17   //       W Y:
                 H          1 ) b e c a u s e t h e o t h e r s didn ’ t work
 18   //       WORKED? : 1 ) Yes
 19
 20
 21   #include         ” M E 2 b P h y s i c s L i s t . hh”
 22   #include         ” G 4 P a r t i c l e T y p e s . hh”
 23   #include         ” G4ComptonScattering . hh ”
 24   #include         ” G4GammaConversion . hh”
 25   #include         ” G 4 P h o t o E l e c t r i c E f f e c t . hh ”
 26   #include         ” G 4 e p l u s A n n i h i l a t i o n . hh ”
 27   #include         ” G 4 e B r e m s s t r a h l u n g . hh”
 28   #include         ” G4LowEnergyBremsstrahlung . hh”
 29   #include         ” G 4 e I o n i s a t i o n . hh”
 30   #include         ” G 4 M u l t i p l e S c a t t e r i n g . hh ”
 31   #include         ” G4ProcessManager . hh”
 32   #include         ” G 4 h M u l t i p l e S c a t t e r i n g . hh ”
 33   #include         ” G 4 h I o n i s a t i o n . hh”




                                                                                                 64
34   #include ” G 4 L o w E n e r g y I o n i s a t i o n . hh ”
 35
 36   // c a l l t h e c o n s t r u c t o r
 37   ME2bPhysicsList : : ME2bPhysicsList ( )
 38   {;}
 39
 40   // c a l l t h e d e s t r u c t o r
 41   ME2bPhysicsList : : ˜ ME2bPhysicsList ( )
 42   {;}
 43
 44   // d e f i n e t h e p a r t i c l e s
 45   void ME2bPhysicsList : : C o n s t r u c t P a r t i c l e ( )
 46   {
 47       // must c o n s t r u c t ALL p a r t i c l e s which w i l l                     be t r a n s p o r t e d / c r e a t e d
 48       G4Electron : : E l e c t r o n D e f i n i t i o n ( ) ;
 49       G4Positron : : P o s i t r o n D e f i n i t i o n ( ) ;
 50       G4Gamma : : GammaDefinition ( ) ;
 51       G4Alpha : : A l p h a D e f i n i t i o n ( ) ;
 52       G4Proton : : P r o t o n D e f i n i t i o n ( ) ; / /                                                                added ZM 9 / 2 5 / 0 9
 53   }
 54
 55   // d e f i n e p r o c e s s e s
 56   void ME2bPhysicsList : : C o n s t r u c t P r o c e s s ( )
 57   {
 58       // t r a n s p o r t a t i o n
 59       AddTransportation ( ) ;
 60
 61        // e l e c t r o m a g n e t i c   processes
 62        ConstructEM ( ) ;
 63   }
 64
 65   // d e f i n e t h e a l l o w e d e l e c t r o m a g n e t i c i n t e r a c t i o n s
 66   v o i d M E 2 b P h y s i c s L i s t : : ConstructEM ( )
 67   {
 68         //NOTE: t h i s p a r t o f t h e c o d e i s a DIRECT COPY o f Heather ’ s c o d e
 69         //         I ’m u n s u r e a s to w h e t h e r i t i s c o m p a t i b l e w i t h what I have
 70
 71        // c a l l r e s e t , t h e member o f t h e data s t r u c t                       which t P I         p o i n t s to
 72        theParticleIterator − eset (); >r
 73
 74        // while t h e v a l u e p o i n t e d to by t h e p a r t i c l e i t e r a t o r i s t r u e
 75        while ( ( ∗ t h e P a r t i c l e I t e r a t o r ) ( ) )
 76        {
 77          // Get t h e p r o c e s s manager f o r t h e p a r t i c l e
 78          G4ParticleDefinition∗ particle = theParticleIterator −                                       >v a l u e ( ) ;
 79          G4ProcessManager ∗ pmanager = p a r t i c l e −                >G e t P r o c e s s M a n a g e r ( ) ;
 80          G4String particleName = p a r t i c l e −               >G e t P a r t i c l e N a m e ( ) ;
 81
 82          // C o n s t r u c t p r o c e s s e s f o r G M A r a y s
                                                                 A M
 83          i f ( p a r t i c l e N a m e == ”gamma” )
 84          {
 85            G 4 P h o t o E l e c t r i c E f f e c t ∗ t h e P h o t o E l e c t r i c E f f e c t=new G 4 P h o t o E l e c t r i c E f f e c t ( ) ;
 86            G4ComptonScattering ∗ t h e C o m p t o n S c a t t e r i n g = new G4ComptonScattering ( ) ;
 87            G4GammaConversion∗ theGammaConversion = new G4GammaConversion ( ) ;
 88
 89              // r e g i s t e r p r o c e s s e s to gamma p r o c e s s manager
 90              pmanager−       >A d d D i s c r e t e P r o c e s s ( t h e P h o t o E l e c t r i c E f f e c t ) ;
 91              pmanager−       >A d d D i s c r e t e P r o c e s s ( t h e C o m p t o n S c a t t e r i n g ) ;
 92              pmanager−       >A d d D i s c r e t e P r o c e s s ( theGammaConversion ) ;
 93          }
 94
 95          // c o n s t r u c t t h e p r o c e s s e s f o r PROTONS and ALPHAS
 96          i f ( p a r t i c l e N a m e == ” p r o t o n ” | | p a r t i c l e N a m e == ” a l p h a ” )
 97          {
 98
 99              // r e g i s t e r p r o c e s s e s to p r o t o n p r o c e s s manager
100              pmanager−       >A d d P r o c e s s ( new G 4 h M u l t i p l e S c a t t e r i n g , − 1 , 1 , 1 ) ;
101              pmanager−       >A d d P r o c e s s ( new G 4 h I o n i s a t i o n , − 1 , 2 , 2 ) ;
102          }
103
104          // c o n s t r u c t t h e p r o c e s s e s f o r ELECTRONS
105          e l s e i f ( p a r t i c l e N a m e == ” e−” )
106          {
107              G4VProcess ∗ t h e e m i n u s M u l t i p l e S c a t t e r i n g = new G 4 M u l t i p l e S c a t t e r i n g ( ) ;
108              G4VProcess ∗ t h e e m i n u s I o n i s a t i o n = new G 4 L o w E n e r g y I o n i s a t i o n ( ) ;
109              G4VProcess ∗ t h e e m i n u s B r e m s s t r a h l u n g = new G4LowEnergyBremsstrahlung ( ) ;
110
111               // r e g i s t e r p r o c e s s e s to e l e c t r o n p r o c e s s manager
112               pmanager−       >A d d P r o c e s s ( t h e e m i n u s M u l t i p l e S c a t t e r i n g , − 1 , 1 , 1 ) ;
113               pmanager−       >A d d P r o c e s s ( t h e e m i n u s I o n i s a t i o n , − 1 , 2 , 2 ) ;
114               pmanager−       >A d d P r o c e s s ( t h e e m i n u s B r e m s s t r a h l u n g , − 1 , − 1 , 3 ) ; / / mid i n d x −1, NOT 3
115                  // Energy n o t d e p o s i t e d c o r r e c t l y i f m i d d l e i n d e x i s a n o t h e r number




                                                                                                      65
116                       // VERY DIFFERENT BEHAVIOR
117
118                   // s e t o r d e r i n g f o r A l o n g S t e p D o I t
119                   pmanager−     >S e t P r o c e s s O r d e r i n g ( t h e e m i n u s M u l t i p l e S c a t t e r i n g , i d x A l o n g S t e p , 1 ) ;
120                   pmanager−     >S e t P r o c e s s O r d e r i n g ( t h e e m i n u s I o n i s a t i o n , i d x A l o n g S t e p , 2 ) ;
121
122                   // s e t o r d e r i n g f o r P o s t S t e p D o I t
123                   pmanager−     >S e t P r o c e s s O r d e r i n g ( t h e e m i n u s M u l t i p l e S c a t t e r i n g , i d x P o s t S t e p , 1 ) ;
124                   pmanager−     >S e t P r o c e s s O r d e r i n g ( t h e e m i n u s I o n i s a t i o n , i d x P o s t S t e p , 2 ) ;
125                   pmanager−     >S e t P r o c e s s O r d e r i n g ( t h e e m i n u s B r e m s s t r a h l u n g , i d x P o s t S t e p , 3 ) ;
126
127              }
128              // c o n s t r u c e t h e p r o c e s s e s f o r POSITRONS
129              e l s e i f ( p a r t i c l e N a m e == ” e+” )
130              {
131                  G4VProcess ∗ t h e e p l u s M u l t i p l e S c a t t e r i n g = new G 4 M u l t i p l e S c a t t e r i n g ( ) ;
132                  //Low e n e r g y p r o c e s s e s don ’ t work f o r p o s i t r o n s ! ! !
133                  G4VProcess ∗ t h e e p l u s I o n i s a t i o n = new G 4 e I o n i s a t i o n ( ) ;
134                  G4VProcess ∗ t h e e p l u s B r e m s s t r a h l u n g = new G 4 e B r e m s s t r a h l u n g ( ) ;
135                  // G4VProcess ∗ t h e e p l u s I o n i s a t i o n = new G 4 L o w E n e r g y I o n i s a t i o n ( ) ;
136                  // G4VProcess ∗ t h e e p l u s B r e m s s t r a h l u n g = new G4LowEnergyBremsstrahlung ( ) ;
137                  G4VProcess ∗ t h e e p l u s A n n i h i l a t i o n = new G 4 e p l u s A n n i h i l a t i o n ( ) ;
138
139                   // r e g i s t e r p r o c e s s e s to p o s i t r o n p r o c e s s manager
140                      // t h e numbers I add h e r e copy t h o s e f o r t h e e −. They
141                      // c o r r e s p o n d to which s t e p s t h e p r o c e s s e s a p p l y ( i . e .
142                      // a t r e s t , a l o n g s t e p , p o s t s t e p ) and t h e i r r e s p e c t i v e
143                      // o r d e r . A minus s i g n means i t doesn ’ t happen a t t h a t s t e p
144                      / / (REALLY I COPIED THE VALUES FROM an EX . i n manual S e c 5 . 2 )                                             ZM 9 / 2 5 / 0 9
145                   pmanager−       >A d d P r o c e s s ( t h e e p l u s M u l t i p l e S c a t t e r i n g , − 1 , 1 , 1 ) ;
146                   pmanager−       >A d d P r o c e s s ( t h e e p l u s I o n i s a t i o n , − 1 , 2 , 2 ) ;
147                   pmanager−       >A d d P r o c e s s ( t h e e p l u s B r e m s s t r a h l u n g , − 1 , 3 , 3 ) ; / / mid i n d x −1−−>3, 9 / 2 5 / 0 9
148                   pmanager−       >A d d P r o c e s s ( t h e e p l u s A n n i h i l a t i o n , 0 , − 1 , 4 ) ;
149
150                   // s e t o r d e r i n g f o r A t R e s t D o I t
151                   pmanager−     >S e t P r o c e s s O r d e r i n g T o F i r s t ( t h e e p l u s A n n i h i l a t i o n , i d x A t R e s t ) ;
152
153                   // s e t o r d e r i n g f o r A l o n g S t e p D o I t
154                   pmanager−     >S e t P r o c e s s O r d e r i n g ( t h e e p l u s M u l t i p l e S c a t t e r i n g , i d x A l o n g S t e p , 1 ) ;
155                   pmanager−     >S e t P r o c e s s O r d e r i n g ( t h e e p l u s I o n i s a t i o n , i d x A l o n g S t e p , 2 ) ;
156
157                 // s e t o r d e r i n g f o r P o s t S t e p D o I t
158                 pmanager−     >S e t P r o c e s s O r d e r i n g ( t h e e p l u s M u l t i p l e S c a t t e r i n g , i d x P o s t S t e p , 1 ) ;
159                 pmanager−     >S e t P r o c e s s O r d e r i n g ( t h e e p l u s I o n i s a t i o n , i d x P o s t S t e p , 2 ) ;
160                 pmanager−     >S e t P r o c e s s O r d e r i n g ( t h e e p l u s B r e m s s t r a h l u n g , i d x P o s t S t e p , 3 ) ;
161              //WHAT ABOUT . . . O r d e r i n g ( t h e e p l u s A n n i h i l a t i o n , i d x P o s t S t e p , 4 ) ; ? ? ? ?
162              }
163          }
164   }
165
166   void ME2bPhysicsList : : SetCuts ( )
167   {
168     // s u p p r e s s e r r o r m e s s a g e s e v e n i n case e /gamma/ p r o t o n do n o t e x i s t
169     // ? ? ? ? ? ? ? ? ? ? ? ? ?     REALLY ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? why?
170     G 4 i n t temp = G e t V e r b o s e L e v e l ( ) ;
171     SetVerboseLevel ( 0 ) ;
172
173       // ” G 4 V U s e r P h y s i c s L i s t : : S e t C u t s W i t h D e f a u l t ” method s e t s         the default
174       // c u t v a l u e f o r a l l p a r t i c l e t y p e s
175       SetCutsWithDefault ( ) ;
176
177       // R e t r i e v e v e r b o s e l e v e l
178       S e t V e r b o s e L e v e l ( temp ) ;
179   }



      5.5.29                      ME2bPrimaryGeneratorAction.cc
 1    #include ” ME2bPrimaryGeneratorAction . hh”
 2
 3    #include ” G4Event . hh”
 4    #include ” G 4 P a r t i c l e G u n . hh”
 5    #include ” G 4 P a r t i c l e T a b l e . hh”
 6    #include ” G 4 P a r t i c l e D e f i n i t i o n . hh ”
 7    #include ” g l o b a l s . hh”
 8    //#include ” Randomize . hh”
 9    //#include ” G4ThreeVector . hh”
10
11    #include <math . h>
12    #include <t i m e . h>
13




                                                                                                        66
14   // added due to n o l l e y :
15   u s i n g namespace s t d ;
16   /// end a d d i t i o n s due to n o l l e y
17
18
19   ME2bPrimaryGeneratorAction : : ME2bPrimaryGeneratorAction ( R e s u l t s ∗ RE ) : r e s u l t s (RE)
20   {
21   // s o u r c e p a r t i c l e ( s t y l e l i k e h e a t h e r ’ s c o d e )
22
23       gamma source = f a l s e ;
24       alpha source = f a l s e ;
25       beta source = f a l s e ;
26       kr69decay = true ;
27       i f ( b e t a s o u r c e ){
28         s o u r c e P o s i t i o n . setX ( 0 ) ;
29         s o u r c e P o s i t i o n . setY ( 0 ) ;
30         s o u r c e P o s i t i o n . s e t Z ( 0 . 0 0 1 ∗ cm ) ;
31         SetSourceBi207 ( ) ;
32       }
33       else i f ( kr69decay ){
34         s o u r c e P o s i t i o n . s e t X ( 0 . 0 5 ∗ cm ) ;
35         s o u r c e P o s i t i o n . s e t Y ( 0 . 0 5 ∗ cm ) ;
36         s o u r c e P o s i t i o n . s e t Z ( 7 . 0 1 2 5 ∗ cm ) ;
37       }
38
39       // S e t S o u r c e E u 1 5 2 ( ) ;
40       // S e t S o u r c e T h 2 2 8 ( ) ;
41       // S e t S o u r c e S r 9 0 ( ) ;
42       // S e t S o u r c e B i 2 0 7 ( ) ;
43       // SetSourceSRM ( ) ;
44
45       n particle = 1;
46       p a r t i c l e G u n = new G 4 P a r t i c l e G u n ( n p a r t i c l e ) ;
47
48       // t h i n g s i n c l u d e d i n EXN01 , but n o t i n h e a t h e r ’ s g e n e r a t o r a c t i o n
49       // vvv THIS I S USED FOR JUST A MONOENERGETIC ELECTRON SOURCE vvv
50       ////// G4P ar t i c l e Tabl e ∗ p a r t i c l e T a b l e = G4P ar t i c l e Tabl e : : G e t P a r t i c l e T a b l e ( ) ;
51       ////// G4String particleName ;
52       ////// particleGun −           >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e −>F i n d P a r t i c l e ( p a r t i c l e N a m e=” e−” ) ) ;
53       //////// I n d i v i d u a l Bi207 E’ s
54       ///////// particleGun −            >S e t P a r t i c l e E n e r g y ( 0 . 9 7 5 6 5 1 ∗MeV ) ;
55       ////// particleGun −           >S e t P a r t i c l e E n e r g y ( 0 . 4 8 1 6 9 ∗MeV    );//#############             CHECK TO MAKE SURE THIS I S CORRECT
56       ////// particleGun −           >S e t P a r t i c l e P o s i t i o n ( G4ThreeVector ( 0 . 0 , 0 . 0 , 0 . 0 0 1 ∗ cm ) ) ;
57   }
58
59   ME2bPrimaryGeneratorAction : : ˜ ME2bPrimaryGeneratorAction ( )
60   {
61     delete particleGun ;
62   }
63
64   v o i d ME2bPrimaryGeneratorAction : : G e n e r a t e P r i m a r i e s ( G4Event ∗ anEvent )
65   {
66
67       particleTable = G4ParticleTable : : GetParticleTable ( ) ;
68
69       //// T h i s s e c t i o n was u s e d f o r monoE s o u r c e
70       // Here I w i l l c r e a t e an i s o t r o p i c s o u r c e d i s t r i b u t i o n
71       //       //W Y PREVIOUSLY USED(NOT o v e r 4 p i )
                         A
72       //       // G4double d i r e c t i o n x = 2 . ∗ ( G4UniformRand ( ) − 0 . 5 ) ;
73       //       // G4double d i r e c t i o n y = 2 . ∗ ( G4UniformRand ( ) − 0 . 5 ) ;
74       //       // G4double d i r e c t i o n z = 2 . ∗ ( G4UniformRand ( ) − 0 . 5 ) ;
75       //       // p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4ThreeVector ( d i r e c t i o n x , d i r e c t i o n y , d i r e c t i o n z ) ) ;
76       //
77       //    //2 nd way to do i t ( d e f i n i t e l y i s o t r o p i c )
78       //       // p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ;
79       //
80       /∗ i f you d e f i n e d ” s o u r c e P o s i t i o n ” above , h e r e you would put :
81        ∗ particleGun−              >S e t P a r t i c l e P o s i t i o n ( s o u r c e P o s i t i o n ) ; ∗ /
82       //
83       ////FIRE THE PARTICLE GUN!
84       // p a r t i c l e G u n − >G e n e r a t e P r i m a r y V e r t e x ( anEvent ) ;
85
86       // B e g i n newly added b u s i n e s s to s i m u l a t e S o u r c e s
87       i f ( gamma source ) {
88          particleGun−          >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e − >F i n d P a r t i c l e ( ”gamma” ) ) ;
89          particleGun−          >S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ;
90          particleGun−          >S e t P a r t i c l e P o s i t i o n ( s o u r c e P o s i t i o n ) ;
91          particleGun−          >S e t P a r t i c l e E n e r g y ( G e t S o u r c e E n e r g y ( ) ) ; }
92       else i f ( a l p h a s o u r c e ){
93          particleGun−          >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e − >F i n d P a r t i c l e ( ” a l p h a ” ) ) ;
94          // d i s t r i b u t e s s o u r c e o v e r cone , i f d e s i r e d
95          /// G4double t h e t a = G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ;




                                                                                                       67
96      /// G4double p h i − G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ; / / v a r y t h i s to make c o n e s m a l l e r ( now f u l l s p h e r e )
 97      /// p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4ThreeVector ( 1 ∗ c o s ( t h e t a ) ∗ s i n ( p h i ) , 1 ∗ s i n ( t h e t a ) ∗ s i n ( p h i ) , −1∗ c o s ( p
 98      // i s o t r o p i c d i s t r i b u t i o n
 99      particleGun−          >S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ;
100      particleGun−          >S e t P a r t i c l e P o s i t i o n ( s o u r c e P o s i t i o n ) ;
101      particleGun−          >S e t P a r t i c l e E n e r g y ( G e t S o u r c e E n e r g y ( ) ) ;
102      particleGun−          >G e n e r a t e P r i m a r y V e r t e x ( anEvent ) ; }
103    else i f ( beta source ) {
104      particleGun−          >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e − >F i n d P a r t i c l e ( ” e−” ) ) ;
105      // d i s t r i b u t e s s o u r c e o v e r cone , i f d e s i r e d
106      /// G4double t h e t a = G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ;
107      /// G4double p h i − G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ; / / v a r y t h i s to make c o n e s m a l l e r ( now f u l l s p h e r e )
108      /// p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4ThreeVector ( 1 ∗ c o s ( t h e t a ) ∗ s i n ( p h i ) , 1 ∗ s i n ( t h e t a ) ∗ s i n ( p h i ) , −1∗ c o s ( p
109      // i s o t r o p i c d i s t r i b u t i o n
110      particleGun−          >S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ;
111      particleGun−          >S e t P a r t i c l e P o s i t i o n ( s o u r c e P o s i t i o n ) ;
112      particleGun−          >S e t P a r t i c l e E n e r g y ( G e t S o u r c e E n e r g y ( ) ) ;
113      particleGun−          >G e n e r a t e P r i m a r y V e r t e x ( anEvent ) ;
114      }
115    else i f ( kr69decay ){
116      // f o r now , t h e d e c a y w i l l be l o c a t e d a t a s i n g l e p l a c e
117      particleGun−          >S e t P a r t i c l e P o s i t i o n ( G4ThreeVector ( 0 . 0 5 ∗ cm , 0 . 0 5 ∗ cm , 7 . 0 1 2 5 ∗ cm ) ) ;
118
119       //now we ’ l l p r o d u c e t h e p o s i t r o n from k r 6 9
120       G4String particleName ;
121       particleGun−   >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e −>F i n d P a r t i c l e ( p a r t i c l e N a m e=” e+” ) ) ;
122
123       // s e l e c t   the    p o s i t r o n randomly o v e r t h e b e t a s p e c t r u m
124
125      // f i r s t p i c k which s t a t e you ’ r e g o i n g from and to
126      // g . s . to g . s (Q=14.53 −−> Ee+max = 1 4 . 5 3 −0.511 MeV)
127      G4double Qvalue ;
128      i f ( G4UniformRand ( ) < 0 . 8 3 ) {
129           Qvalue = 1 4 0 1 9 ; / / keV
130      }
131      else {
132           Qvalue = 1 0 0 6 9 ; / / keV       69 Kr g . s . − Me − ( 6 9 B r x . s . − 69 B r g . s . )
133      }
134   // G4double Qvalue ;
135   // Qvalue = 1 0 . 0 6 9 ;
136      //now s a m p l e t h e d i s t r i b u t i o n
137      G4double randombase =1;
138      G4double randomE =0;
139      G4double c a l c P r o b =0;
140      G4double MomentPos =0;
141
142       while ( c a l c P r o b < randombase ) {
143          randombase = G4UniformRand ( ) ∗ 7 0 0 0 ; / / max P from c a l c u l a t e d s p e c t r u m i s ˜ 6 7 0 0
144          // randomE = G4UniformRand ( ) ∗ Qvalue ;
145         randomE = G4UniformRand ( ) ∗ Qvalue ;
146          // add coulomb c o r r e c t i o n F ( Z , Ee ) i f d e s i r e d , but s e e from B e t a S p e c C a l c t h a t i t ’ s minimal
147         MomentPos =(( randomE∗randomE ) + 2 . ∗ randomE ∗ 5 1 1 . 0 0 3 ) ;
148
149            c a l c P r o b= MomentPos ∗ ( Qvalue−randomE ) ∗ ( Qvalue−randomE ) ∗ ( 0 . 5 ∗ ( 1 / s q r t ( MomentPos ) ) ∗ 2 . ∗ ( randomE + 5 1 1 . 0 0 3 ) ) ; / / c o u l d a
150       }
151
152       particleGun−>S e t P a r t i c l e E n e r g y ( randomE∗keV ) ;
153
154       results −>S e t P o s i t r o n I E ( randomE / 1 0 0 0 . ) ;
155
156       //// r a n d o m i z e e       over 4 pi
157       // p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ;
158       //// d i s t r i b u t e s s o u r c e o v e r cone , i f d e s i r e d
159       G4double t h e t a = G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ; / / a l w a y s 2∗ p i
160       G4double p h i = G4UniformRand ( ) ∗ ( 3 . 1 4 1 5 9 2 6 5 / 2 . ) ∗ r a d ; / / v a r y t h i s to make c o n e s m a l l e r ( now f u l l s p h e r e )
161       particleGun−           >S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4ThreeVector ( 1 ∗ c o s ( t h e t a ) ∗ s i n ( p h i ) , 1 ∗ s i n ( t h e t a ) ∗ s i n ( p h i ) , 1∗ c o s ( p h i ) )
162
163       // F i r e t h e p o s i t r o n !
164       particleGun−      >G e n e r a t e P r i m a r y V e r t e x ( anEvent ) ;
165
166       //Now do t h e p r o t o n , e n e r g y d e p e n d s on which Q                        −v a l u e you u s e d
167       particleGun−           >S e t P a r t i c l e P o s i t i o n ( G4ThreeVector ( 0 . 0 5 ∗ cm , 0 . 0 5 ∗ cm , 7 . 0 1 2 5 ∗ cm ) ) ;
168       particleGun−           >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e −>F i n d P a r t i c l e ( p a r t i c l e N a m e=” p r o t o n ” ) ) ;
169       // p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ;
170       //// d i s t r i b u t e s s o u r c e o v e r cone , i f d e s i r e d
171       t h e t a = G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ; / / a l w a y s 2∗ p i
172       p h i = G4UniformRand ( ) ∗ ( 3 . 1 4 1 5 9 2 6 5 / 2 . ) ∗ r a d ; / / v a r y t h i s to make c o n e s m a l l e r ( now f u l l s p h e r e )
173       particleGun−           >S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4ThreeVector ( 1 ∗ c o s ( t h e t a ) ∗ s i n ( p h i ) , 1 ∗ s i n ( t h e t a ) ∗ s i n ( p h i ) , 1∗ c o s ( p h i ) )
174
175       if   ( Qvalue ==10069)
176       {
177            // G4cout<<”Q v a l u e = 4 . 0 7 Mev”<<G4endl ;




                                                                                                68
178               particleGun− >S e t P a r t i c l e E n e r g y ( 4 . 0 7 ∗MeV ) ;
179               results −>SetProtonOneIE ( 4 . 0 7 ) ;
180       }
181       e l s e i f ( Qvalue ==14019)
182       {
183             // G4cout<  <”Q v a l u e = 0 . 5MeV”<<G4endl ;
184             particleGun−    >S e t P a r t i c l e E n e r g y ( 0 . 5 ∗MeV ) ;
185             results − >SetProtonOneIE ( 0 . 5 ) ;
186       }
187       else {
188             G4cout< I don ’ t know what y o u r Qvalue i s ”<<G4endl ;
                         <”
189       }
190
191       // f i r e t h e p r o t o n
192       particleGun−      >G e n e r a t e P r i m a r y V e r t e x ( anEvent ) ;
193
194     }
195   else {
196       G4cout< I don ’ t know what you ’ r e t r y i n g t o s i m u l a t e ;
                  <”                                                                                           i n PrimGenAct ”<<G4endl ;
197       }
198       // add d e c a y s i m u l a t i o n h e r e i n w i t h t h e e l s e s
199
200       //EVENT COMPLETED
201   }
202
203   // new w/ B i 2 0 7 S o u r c e
204   v o i d ME2bPrimaryGeneratorAction : : S e t S o u r c e B i 2 0 7 ( )
205   {
206         G4double e ;
207         s o u r c e B r a n c h i n g S u m =0;
208
209           // s t a r t from t h e b e g i n n i n g o f               the array
210           v e c t o r <S o u r c e D a t a ∗ > : : i t e r a t o r    i t P o s = TheSource . b e g i n ( ) ;
211
212           // c l e a r a l l e l e m e n t s from t h e a r r a y
213           f o r ( ; i t P o s < TheSource . end ( ) ; i t P o s ++){
214             d e l e t e ∗ i t P o s ; // f r e e t h e e l e m e n t from memory
215       }
216
217       // c l e a r a l l e l e m e n t s from t h e a r r a y ( f o r                   real   this   time )
218        TheSource . c l e a r ( ) ;
219
220           // e l e c t r o n e n e r g i e s and b r a n c h i n g r a t i o s
221           // t h i s i s s l i g h t l y d i f f e r e n t from Heather ’ s ( e x c l u d e 57 keV ,              include 1682 keV e ’ s )
222              // r a t i o s computed from NNDC data
223           e = 4 8 1 . 6 9 ∗ keV ; s o u r c e B r a n c h i n g S u m +=2155;
224           TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ;
225           e = 5 5 3 . 8 3 ∗ keV ; s o u r c e B r a n c h i n g S u m +=623;
226           TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ;
227           e = 5 6 5 . 8 4 ∗ keV ; s o u r c e B r a n c h i n g S u m +=209;
228           TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ;
229           e = 9 7 5 . 6 5 ∗ keV ; s o u r c e B r a n c h i n g S u m +=10000;
230           TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ;
231           e = 1 0 4 7 . 7 9 ∗ keV ; s o u r c e B r a n c h i n g S u m +=2617;
232           TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ;
233           e = 1 0 5 9 . 8 1 ∗ keV ; s o u r c e B r a n c h i n g S u m +=768;
234           TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ;
235           e = 1 6 8 2 . 2 2 ∗ keV ; s o u r c e B r a n c h i n g S u m +=34;
236           TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ;
237   }
238
239   G4double ME2bPrimaryGeneratorAction : : G e t S o u r c e E n e r g y ( )
240   {
241      G4double rand ;
242
243       rand = G4UniformRand ( ) ∗ s o u r c e B r a n c h i n g S u m ;
244
245       v e c t o r <S o u r c e D a t a ∗ > : : i t e r a t o r       i t P o s = TheSource . b e g i n ( ) ;
246
247       for       (;    i t P o s < TheSource . end ( ) ;                 i t P o s ++)
248       {
249               if     ( rand < ( ( ∗ i t P o s )−>b r a n c h ) ) {
250                      return ( ∗ i t P o s )−>e n e r g y ;
251          }
252       }
253       return −1∗keV ;
254   }




      5.5.30                   PixelParameterisation.cc

                                                                                                    69
1   #include ” P i x e l P a r a m e t e r i s a t i o n . hh ”
 2
 3   #include ” G4VPhysicalVolume . hh”
 4   #include ” G4ThreeVector . hh”
 5   #include ”G4Box . hh ”
 6
 7   P i x e l P a r a m e t e r i s a t i o n : : P i x e l P a r a m e t e r i s a t i o n ( G4int NoPixels ,      G4double w i d t h P i x e l )
 8   {
 9       fNoPixels = NoPixels ;
10       fHalfWidth =                  widthPixel ∗0.5;
11   }
12
13   PixelParameterisation : : ˜ PixelParameterisation ()
14   {}
15
16   void P i x e l P a r a m e t e r i s a t i o n : : ComputeTransformation
17   ( c o n s t G 4 i n t copyNo , G4VPhysicalVolume ∗ physVol ) c o n s t
18   {
19       // p o s i t i o n s walk a l o n g x−y g r i d o f 1600 p i x e l s
20       // t h i s i s c h e c k e d i n DivVsModulus . f 9 0 i n my ( Z .M. ) Home D i r e c t o r y
21       u n s i g n e d s h o r t x = s t a t i c c a s t <u n s i g n e d s h o r t >(copyNo / 4 0 ) + 1 ; / / why a b s o l u t e and
22       u n s i g n e d s h o r t y = s t a t i c c a s t <u n s i g n e d s h o r t >(copyNo %40) + 1 ; / / why modulus ?
23
24       // p i x e l p o s i t i o n i s ( p i x e l w i d t h ) ∗ ( p i x e l n u m b e r +1) − ( h a l f w i d t h+p i x e l w i d t h / 2 ) o f d e t e c t o r
25       // s i n c e t h e r e a r e p i x e l n u m b e r −1 s t r i p s b e f o r e t h e p i x e l n u m b e r s t r i p
26       // and e a c h have a w i d t h o f ( p i x e l w i d t h =0.1cm ) . and then x i s a p p a r e n t l y
27       // t h e f a r s i d e o f new p i x e l a s compared to t h e a l r e a d y i n p l a c e p i x e l s u n t i l
28       // you s u b s t r a c t ( p i x e l w i d t h / 2 ) [ b e c a u s e t h e o r i g i n o f t h e p i x e l i s i n i t ’ s m i d d l e ]
29       // h a l f w i d t h i s s u b t r a c t e d to c e n t e r t h e DSSD .
30       G4double p i x e l X = ( −2.05 + 0 . 1 ∗ x ) ∗cm ;
31       G4double p i x e l Y = ( −2.05 + 0 . 1 ∗ y ) ∗cm ;
32       G4ThreeVector o r i g i n ( p i x e l X , p i x e l Y , 0 . 0 2 5 ∗ cm ) ; / / o r i g i n w/ r e s p e c t to S i B l o c k l o g
33       physVol−       >S e t T r a n s l a t i o n ( o r i g i n ) ;
34       physVol−       >S e t R o t a t i o n ( 0 ) ;
35   }



     5.5.31                  Results.cc
 1   // E d i t e d from H . Crawford ’ s R e s u l t s . c c
 2   //EDITS :
 3   //            1 0 / 2 0 / 0 9 : d e l e t e d PIN , SEGA, DSSD(# o t h e r than 1 )                    things
 4   //            1 0 / 2 6 : began c o n v e r t i n g from s t r i p s to 1 block
 5
 6   #include ” R e s u l t s . hh”
 7
 8   R e s u l t s : : R e s u l t s ( M E 2 b D e t e c t o r C o n s t r u c t i o n ∗ DE,
 9                              G 4 S t r i n g f i l e n a m e ) : d e t e c t o r (DE)
10   {
11       // Try to open a new f i l e                     called        ’ file name ’ ,         for   o t h e r methods to use t o o .
12
13       std : : ofstream          output file pointer ;
14
15       // Open t h e f i l e a s a new f i l e −− o v e r w r i t e any p r e v i o u s data .
16       o u t p u t f i l e p o i n t e r . open ( f i l e n a m e , s t d : : i o s : : b i n a r y ) ; / / / / / ( f i l e n a m e ,   std : : i o s : : binary ) ;
17
18       if ( ! output file pointer . is open ())
19          {
20              G 4 c e r r << ” E r r o r : Could n o t open d a t a                    file    s p e c i f i e d . ” << G4endl ;
21              this− f i l e a t t a c h e d f l a g = f a l s e ;
                         >
22              this−    >o u t p u t f i l e n a m e = ” s t d o u t ” ;
23          }
24       else i f ( o u t p u t f i l e p o i n t e r . is open ( ) )
25          {
26              this − f i l e a t t a c h e d f l a g = true ;
                         >
27              this−    >o u t p u t f i l e n a m e = f i l e n a m e ;
28          }
29       else
30          {
31              G 4 c e r r << ” E r r o r : Could n o t open d a t a                    file    s p e c i f i e d . ” << G4endl ;
32              this− f i l e a t t a c h e d f l a g = f a l s e ;
                         >
33              this−    >o u t p u t f i l e n a m e = ” s t d o u t ” ;
34          }
35
36       o u t p u t f i l e p o i n t e r . close ( ) ;
37       p r i n t= f a l s e ;
38   }
39
40   Results : : ˜ Results ()
41   {;}
42




                                                                                                  70
43   void Results : : Print2Screen ( TrackerIonHitsCollectio n ∗ i o n C o l l e c t i o n )
 44   {
 45     G4cout << ” P r i n t i n g r e s u l t s r e p o r t t o s c r e e n f o r c u r r e n t e v e n t ” << G4endl ;
 46     G4cout << ” I n i t i a l e v e n t p a r a m e t e r s . . . ” << G4endl ;
 47     G4cout << ”       I n i t i a l p o s i t r o n e n e r g y : ” << p o s i t r o n I E
 48       << ”  I n i t i a l e l e c t r o n e n e r g y : ” << e l e c t r o n I E
 49       << ”  I n i t i a l p r o t o n 1 e n e r g y : ” << protonOneIE
 50       << ”  I n i t i a l p r o t o n 2 e n e r g y : ” << protonTwoIE
 51       << ”  I n i t i a l p r o t o n 3 e n e r g y : ” << p r o t o n T h r e e I E
 52       << ”  I n i t i a l a l p h a e n e r g y : ” << a l p h a I E << G4endl ;
 53     G4cout << ”       I n i t i a l gamma1 e n e r g y : ” << gammaOneIE
 54       << ”  I n i t i a l gamma2 e n e r g y : ” << gammaTwoIE
 55       << ”  I n i t i a l gamma3 e n e r g y : ” << gammaThreeIE
 56       << ”  I n i t i a l gamma4 e n e r g y : ” << gammaFourIE << G4endl ;
 57     ExtractData ( i o n C o l l e c t i o n ) ;
 58     G4cout << ” I o n i n f o r m a t i o n f i r s t . . . ” << G4endl ;
 59
 60       for       ( i n t j =0; j <4; j ++){
 61                 f o r ( i n t k =0; k <1600; k++){
 62                         i f ( m o n o b l o c k e v [ j ] [ k ] . h i t == t r u e ) {
 63                                G4cout << ” P a r t i c l e : ” << m o n o b l o c k e v [ j ] [ k ] . p a r t i c l e I D << ”Time : ”
 64                               << m o n o b l o c k e v [ j ] [ k ] . g l o b a l t i m e << ” Edep : ” << m o n o b l o c k e v [ j ] [ j ] . Edep
 65                                //<<” i n d e t e c t o r ” << m o n o b l o c k e v [ j ] [ k ] . d e t e c t o r I D
 66                               <<” i n p i x e l ”<<m o n o b l o c k e v [ j ] [ k ] . p i x e l I D
 67                               << G4endl ;
 68                       }
 69                 }
 70           }
 71                  G4cout << ”End o f            r e p o r t . OR I S IT ? ? ? ?        . . . it     i s ” << G4endl ;
 72   }
 73
 74   v o i d R e s u l t s : : SaveData ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ i o n C o l l e c t i o n )
 75   {
 76       ExtractData ( i o n C o l l e c t i o n ) ;
 77
 78       std : : ofstream o u t p u t f i l e p o i n t e r ;
 79       o u t p u t f i l e p o i n t e r . open ( t h i s −>o u t p u t f i l e n a m e ,         s t d : : i o s : : app ) ;
 80
 81       if       ( ! output file pointer . is open ()) {
 82               return ;
 83       }
 84
 85       unsigned          s h o r t i o n s = 0xFFF0 ;
 86       unsigned          s h o r t b e g i n = 0xEEEE ;
 87       unsigned          s h o r t end = 0xFFFF ;
 88       unsigned          s h o r t output ;
 89
 90       // Write h e a d e r to b e g i n e v e n t . . .
 91       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& b e g i n ) ,
 92                          s i z e o f ( unsigned short ) ) ;
 93       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& b e g i n ) ,
 94                          s i z e o f ( unsigned short ) ) ;
 95       o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t >      ( p o s i t r o n I E /keV + 0 . 5 ) ;
 96       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& o u t p u t ) ,
 97                          s i z e o f ( unsigned short ) ) ;
 98       o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t >      ( e l e c t r o n I E /keV + 0 . 5 ) ;
 99       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& o u t p u t ) ,
100                          s i z e o f ( unsigned short ) ) ;
101       o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t >      ( protonOneIE /keV + 0 . 5 ) ;
102       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& o u t p u t ) ,
103                          s i z e o f ( unsigned short ) ) ;
104       o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t >      ( protonTwoIE /keV + 0 . 5 ) ;
105       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& o u t p u t ) ,
106                          s i z e o f ( unsigned short ) ) ;
107       o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t >      ( p r o t o n T h r e e I E /keV + 0 . 5 ) ;
108       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& o u t p u t ) ,
109                          s i z e o f ( unsigned short ) ) ;
110       o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t >      ( a l p h a I E /keV + 0 . 5 ) ;
111       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& o u t p u t ) ,
112                          s i z e o f ( unsigned short ) ) ;
113       o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t >      ( gammaOneIE/keV + 0 . 5 ) ;
114       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& o u t p u t ) ,
115                          s i z e o f ( unsigned short ) ) ;
116       o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t >      ( gammaTwoIE/keV + 0 . 5 ) ;
117       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& o u t p u t ) ,
118                          s i z e o f ( unsigned short ) ) ;
119       o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t >      ( gammaThreeIE /keV + 0 . 5 ) ;
120       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& o u t p u t ) ,
121                          s i z e o f ( unsigned short ) ) ;
122       o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t >      ( gammaFourIE/keV + 0 . 5 ) ;
123       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t    c a s t <c h a r∗> (& o u t p u t ) ,
124                          s i z e o f ( unsigned short ) ) ;




                                                                                                71
125
126       // Write i o n data
127
128       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& i o n s ) ,
129                          s i z e o f ( unsigned short ) ) ;
130
131         for     ( i n t j =0; j <4; j ++){
132               f o r ( i n t k =0; k <1600; k++){
133                     i f ( m o n o b l o c k e v [ j ] [ k ] . h i t == t r u e ) {
134                     o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( m o n o b l o c k e v [ j ] [ k ] . p i x e l I D ) ;
135                     o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) ,
136                                       s i z e o f ( unsigned short ) ) ;
137                     o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( m o n o b l o c k e v [ j ] [ k ] . p a r t i c l e I D ) ;
138                     o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) ,
139                               s i z e o f ( unsigned short ) ) ;
140                     o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( m o n o b l o c k e v [ j ] [ k ] . Edep /keV + 0 . 5 ) ; / / t h i s Edep i s a sum o f Edeps i n T
141                     // G4cout< P i x e l I D : ”<<m o n o b l o c k e v [ j ] [ k ] . p i x e l I D <
                                         <”                                                                 <” P a r t i c l e I D : ”<<m o n o b l o c k e v [ j ] [ k ] . p a r t i c l e I D <<G4endl ;
142                     // G4cout< Edep /keV + 0 . 5 : ”<<m o n o b l o c k e v [ j ] [ k ] . Edep /keV + 0.5<< G4endl ;
                                         <”
143                     o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) ,
144                               s i z e o f ( unsigned short ) ) ;
145
146                   }
147               }
148        }
149
150       // Write gamma data . . .                     psych !
151
152       // Write end o f              e v e n t marker
153
154       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (&end ) ,
155                          s i z e o f ( unsigned short ) ) ;
156       o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (&end ) ,
157                          s i z e o f ( unsigned short ) ) ;
158
159       o u t p u t f i l e p o i n t e r . close ( ) ;
160
161       //      G4cout << ” Data s a v e d t o ” << o u t p u t f i l e n a m e << G4endl ;
162   }
163
164   void R e s u l t s : : ExtractData ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ i o n C o l l e c t i o n )
165   {
166     //  G4cout << ” E x t r a c t i n g d a t a from h i t c o l l e c t i o n s . . . ” << G4endl ;
167
168       /∗      First     extract             the   p a r t i c l e data    ....     ∗/
169
170       G4int        Nion = i o n C o l l e c t i o n −>e n t r i e s ( ) ;         // Get # o f         particle       entries
171       int          i;
172
173       //   Initialize           i o n data c o n t a i n e r s . . .
174
175         for     ( i n t j =0; j <4; j ++){
176               f o r ( i n t k =0; k <1600; k++){
177
178               monoblock        ev   [   j   ] [ k ] . hit = false ;
179               monoblock        ev   [   j   ] [ k ] . p a r t i c l e I D = −1;
180               monoblock        ev   [   j   ] [ k ] . g l o b a l t i m e = −1;
181               monoblock        ev   [   j   ] [ k ] . Edep = 0 ;
182               monoblock        ev   [   j   ] [ k ] . p i x e l I D =−1;
183               }
184        }
185
186       // E x t r a c t i o n data b e l o w
187         // G4cout< Nion : ”<<Nion<
                             <”                          <G4endl ;
188             / / ( ∗ i o n C o l l e c t i o n )[0] − > GetVolName()<<
189             / / ( ∗ i o n C o l l e c t i o n )[1] − > GetVolName()<<
190             / / ( ∗ i o n C o l l e c t i o n )[2] − > GetVolName()<<
191             / / ( ∗ i o n C o l l e c t i o n ) [ Nion −1]−>GetVolName()<<
192       f o r ( i =0; i <Nion ; i ++){
193           G 4 i n t p a r t i c l e I D = −1;
194           G 4 i n t p i x e l = −1;
195           G 4 S t r i n g p a r t i c l e = ( ∗ i o n C o l l e c t i o n ) [ i ]−> G e t P a r t i c l e I D ( ) ;
196           G 4 S t r i n g d e t e c t o r = ( ∗ i o n C o l l e c t i o n ) [ i ]−>GetVolName ( ) ;
197         i f ( p a r t i c l e == ” p r o t o n ” ) {
198               particleID = 0;
199           } e l s e i f ( p a r t i c l e == ” e+” ) {
200               particleID = 1;
201           } e l s e i f ( p a r t i c l e == ” e−” ) {
202               particleID = 2;
203           } e l s e i f ( p a r t i c l e == ”gamma” ) {
204               particleID = 3;
205           }
206           i f ( d e t e c t o r == ” monoblock ” ) {




                                                                                                   72
207             p i x e l = (∗ i o n C o l l e c t i o n   )[   i ]−> G e t P i x e l ( ) ;
208             monoblock ev [ p a r t i c l e I D         ][   pixel ] . hit = true ;
209             monoblock ev [ p a r t i c l e I D         ][   pixel ] . particleID = particleID ;
210             monoblock ev [ p a r t i c l e I D         ][   p i x e l ] . g l o b a l t i m e = ( ∗ i o n C o l l e c t i o n ) [ i ]−>GetGlobTime ( ) ;
211             monoblock ev [ p a r t i c l e I D         ][   p i x e l ] . Edep += ( ∗ i o n C o l l e c t i o n ) [ i ]−>GetEdep ( ) /MeV ;
212             monoblock ev [ p a r t i c l e I D         ][   pixel ] . pixelID = pixel ;
213         }
214       }
215    //−−−−−−−−−−−−− E x t r a c t gamma data b e l o w . . . NOT
216
217   }


      5.5.32                RunAction.cc
  1   #include ” RunAction . hh”
  2
  3   RunAction : : RunAction ( M E 2 b D e t e c t o r C o n s t r u c t i o n ∗ d e t e c t o r ) : myDetector ( d e t e c t o r )
  4   {
  5
  6   }
  7
  8
  9   RunAction : : ˜ RunAction ( )
 10   {
 11
 12   }
 13
 14   v o i d RunAction : : BeginOfRunAction ( c o n s t G4Run∗ aRun )
 15   {
 16      G4cout << ” B e g i n n i n g o f run ” << aRun−  >GetRunID ( ) << G4endl ;
 17   }
 18
 19   v o i d RunAction : : EndOfRunAction ( c o n s t G4Run∗ aRun )
 20   {
 21      G4cout << G4endl ;
 22      G4cout << ” End o f run ” << aRun−         >GetRunID ( ) << G4endl ;
 23
 24       //    G4cout<<” Average e n e r g y d e p o s i t i n t h e t a r g e t ”<<G4endl ;
 25       //    G4cout<<”           s i m u l a t e d : ”<<s t d : : s e t w (9)<< s t d : : s e t p r e c i s i o n (3)<< r e s u l t s −>getTarDepAverage ( ) /MeV <” +/− ”<
                                                                                                                                                                    <
 26
 27       //    G4cout<<” Average K i n e t i c Energy b e h i n d t h e t a r g e t ”<<G4endl ;
 28       //    G4cout<<”          s i m u l a t e d : ”<<s t d : : s e t w (9)<< s t d : : s e t p r e c i s i o n (7)<< r e s u l t s −>getKEAverage ( ) / GeV<<” +/− ”<<s t d
 29
 30   }


      5.5.33                SiBlock.cc
  1   #include ” S i B l o c k . hh”
  2   //#include ” G 4 M a t e r i a l . hh”
  3   //#include ” M a t e r i a l s . hh”
  4
  5   // i ’m n o t s u r e t h i s l i n e i s r i g h t
  6   S i B l o c k : : S i B l o c k ( G4LogicalVolume ∗ e x p e r i m e n t H a l l l o g ,         M a t e r i a l s ∗ mat )
  7   {
  8
  9        BUILD SiBlock = t r u e ;
 10        // G4double a ; // a t o m i c mass
 11        // G4double z ; // a t o m i c number
 12        // G4double d e n s i t y ;
 13
 14
 15   // G 4 M a t e r i a l ∗ S i =
 16   // new G 4 M a t e r i a l ( ” S i l i c o n ” , z = 1 4 . , a = 2 8 . 0 5 5 5 ∗ g / mole , d e n s i t y =2.329∗ g /cm3 ) ;
 17
 18        e x p e r i m e n t a l H a l l l o g=e x p e r i m e n t H a l l l o g ;
 19        m a t e r i a l s = mat ;
 20        // aluminumChamber log = aluminumChamberVac log ;
 21        //THESE ARE HALF LENGTHS! ! ! SO MAKE THEM HALF OF THE DESIRED VALUE ! ! !
                                         −
 22        S i B l o c k x = 2 . 0 ∗ cm ; //HALF OF x−s i d e l e n g t h
 23        S i B l o c k y = 2 . 0 ∗ cm ; //HALF OF y−s i d e l e n g t h
 24        S i B l o c k z = 0 . 0 2 5 ∗ cm ; / /HALF OF z−s i d e l e n g t h
 25        b l o c k P o s x = 0∗m; // x−c e n t r o i d p o s i t i o n o f d e t e c t o r
 26        b l o c k P o s y = 0∗m; // y−”                             ”             ” ”
 27        b l o c k P o s z = 7 . 0 2 5 ∗ cm ; / / z−”                  ”             ” ”
 28
 29        pixel x = SiBlock x /40;
 30        p i x e l y = SiBlock y /40;// half                     the width o f a p i x e l
 31




                                                                                               73
32
33          DetectorMaterial = materials−         >F i n d M a t e r i a l ( ” S i ” ) ;
34          VacuumMaterial = m a t e r i a l s −>F i n d M a t e r i a l ( ”vacuum ” ) ;
35   }
36
37   SiBlock : : ˜ SiBlock ()
38   {}
39
40   void SiBlock : : Construct ()
41   {
42      //G4Box∗ S i B l o c k b o x = new G4Box ( ” S i B l o c k b o x ” , S i B l o c k x , S i B l o c k y , S i B l o c k z ) ; a l t e r n a t e way?
43      S i B l o c k b o x = new G4Box ( ” S i B l o c k b o x ” , S i B l o c k x , S i B l o c k y , S i B l o c k z ) ;
44      S i B l o c k l o g = new G4LogicalVolume ( S i B l o c k b o x , VacuumMaterial , ” S i B l o c k l o g ” , 0 , 0 , 0 ) ;
45      b l o c k P o s x =0.∗cm ;
46      b l o c k P o s y =0∗cm ;
47      b l o c k P o s z =7.025∗cm ;
48      S i B l o c k p h y s = new G4PVPlacement ( 0 ,
49                           G4ThreeVector ( b l o c k P o s x , b l o c k P o s y , b l o c k P o s z ) ,
50                           S i B l o c k l o g , ” monoblock ” , e x p e r i m e n t a l H a l l l o g , f a l s e , 0 ) ;
51
52          // S i B l o c k p i x e l :
53          G4VPVParameterisation ∗ p i x e l P a r a m = new P i x e l P a r a m e t e r i s a t i o n (
54                                           1 6 0 0 , // # o f p i x e l s
55                                           0 . 1 ∗ cm ) ; / / w i d t h o f p i x e l
56          //∗∗ numbers ( e g . p i x e l x ) n o t d i v i d e d by 2 b e c a u s e h a l f −l e n g t h s a r e a l r e a d y t a k e n    into   account
57          p i x e l b o x = new G4Box ( ” p i x e l S i b o x ” , p i x e l x , p i x e l y , S i B l o c k z ) ;
58          p i x e l l o g = new G4LogicalVolume ( p i x e l b o x , D e t e c t o r M a t e r i a l , ” p i x e l l o g ” , 0 , 0 , 0 ) ;
59
60          // p l a c e 1600 p i x e l s i n S i B l o c k Volume :
61          p i x e l p h y s = new G4PVParameterised ( ” S i B l o c k p a r a m e t e r i s e d P i x e l s ” ,
62                          pixel log ,
63                          SiBlock log ,
64                          kUndefined ,
65                          1600 ,
66                          pixelParam ) ;
67   }



     5.5.34                  SiBlock Messenger.cc
 1   #include ” S i B l o c k M e s s e n g e r . hh”
 2
 3   SiBlock Messenger : : SiBlock Messenger ( SiBlock ∗ SiBlock )
 4   : theSiBlock ( SiBlock )
 5   {
 6     SiBlockDIR = new G 4 U I d i r e c t o r y ( ” / S i B l o c k / ” ) ;
 7     SiBlockDIR− >S e t G u i d a n c e ( ” S i B l o c k c o n t r o l ” ) ;
 8
 9       XSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / X l e n g t h ” ,                          this );
10       XSiBlockCmd−>S e t G u i d a n c e ( ” S e l e c t t h e X l e n g t h f o r S i B l o c k ” ) ;
11       XSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ;
12       XSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ;
13
14       YSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / Y l e n g t h ” ,                          this );
15       YSiBlockCmd−>S e t G u i d a n c e ( ” S e l e c t t h e Y l e n g t h f o r S i B l o c k ” ) ;
16       YSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ;
17       YSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ;
18
19       ZSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / Z l e n g t h ” ,                          this );
20       ZSiBlockCmd−>S e t G u i d a n c e ( ” S e l e c t t h e Z l e n g t h f o r S i B l o c k ” ) ;
21       ZSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ;
22       ZSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ;
23
24       XPosSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / X pos ” , t h i s ) ;
25       XPosSiBlockCmd−>S e t G u i d a n c e ( ” S e t t h e X p o s i t i o n f o r t h e S i B l o c k ” ) ;
26       XPosSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ;
27       XPosSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ;
28
29       YPosSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / Y pos ” , t h i s ) ;
30       YPosSiBlockCmd−>S e t G u i d a n c e ( ” S e t t h e Y p o s i t i o n f o r t h e S i B l o c k ” ) ;
31       YPosSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ;
32       YPosSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ;
33
34       ZPosSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / Z p o s ” , t h i s ) ;
35       ZPosSiBlockCmd−>S e t G u i d a n c e ( ” S e t t h e Z p o s i t i o n f o r t h e S i B l o c k ” ) ;
36       ZPosSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ;
37       ZPosSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ;
38   }
39
40   SiBlock Messenger : : ˜ SiBlock Messenger ()
41   {




                                                                                          74
42        delete       XSiBlockCmd ;
43        delete       YSiBlockCmd ;
44        delete       ZSiBlockCmd ;
45        delete       XPosSiBlockCmd ;
46        delete       YPosSiBlockCmd ;
47        delete       ZPosSiBlockCmd ;
48        delete       SiBlockDIR ;
49   }



     5.5.35                 SteppingAction.cc
 1   #include ” S t e p p i n g A c t i o n . hh”
 2   #include ” G4SteppingManager . hh”
 3
 4   SteppingAction : : SteppingAction ()
 5   {
 6   }
 7
 8   v o i d S t e p p i n g A c t i o n : : U s e r S t e p p i n g A c t i o n ( c o n s t G4Step ∗ )
 9   {
10   }



     5.5.36                 SteppingVerbose.cc
 1   #include ” S t e p p i n g V e r b o s e . hh”
 2
 3   #include ” G4SteppingManager . hh”
 4   #include ” G4UnitsTable . hh”
 5
 6   SteppingVerbose : : SteppingVerbose ( )
 7   {
 8   }
 9
10   SteppingVerbose : : ˜ SteppingVerbose ()
11   {
12   }
13
14   void SteppingVerbose : : StepInfo ( )
15   {
16
17       CopyState ( ) ;
18
19       G 4 i n t p r e c = G4cout . p r e c i s i o n ( 3 ) ;
20
21       if     ( v e r b o s e L e v e l >= 1 ) {
22            i f ( v e r b o s e L e v e l >= 4 ) {
23                VerboseTrack ( ) ;
24            }
25            i f ( v e r b o s e L e v e l >= 3 ) {
26                G4cout << G4endl ;
27                G4cout << s t d : : s e t w ( 5 ) << ”#S t e p#” << ” ”
28                   << s t d : : s e t w ( 6 ) << ”X”                << ”    ”
29                   << s t d : : s e t w ( 6 ) << ”Y”                << ”    ”
30                   << s t d : : s e t w ( 6 ) << ”Z”                << ”    ”
31                   << s t d : : s e t w ( 9 ) << ” KineE ” << ” ”
32                   << s t d : : s e t w ( 9 ) << ” dEStep ” << ” ”
33                   << s t d : : s e t w ( 1 0 ) << ” StepL eng ”
34                   << s t d : : s e t w ( 1 0 ) << ” TrakLeng ”
35                   << s t d : : s e t w ( 1 0 ) << ” Volume ” << ”        ”
36                   << s t d : : s e t w ( 1 0 ) << ” P r o c e s s ” << G4endl ;
37            }
38
39            G4cout <<       s t d : : s e t w ( 5 ) << f T r a c k−>GetCurrentStepNumber ( ) << ” ”
40             << s t d : :   s e t w ( 6 ) << G4BestUnit ( f T r a c k−   >G e t P o s i t i o n ( ) . x ( ) , ” Length ” )
41             << s t d : :   s e t w ( 6 ) << G4BestUnit ( f T r a c k−   >G e t P o s i t i o n ( ) . y ( ) , ” Length ” )
42             << s t d : :   s e t w ( 6 ) << G4BestUnit ( f T r a c k−   >G e t P o s i t i o n ( ) . z ( ) , ” Length ” )
43             << s t d : :   s e t w ( 6 ) << G4BestUnit ( f T r a c k−   >G e t K i n e t i c E n e r g y ( ) , ” Energy ” )
44             << s t d : :   s e t w ( 6 ) << G4BestUnit ( f S t e p −   >G e t T o t a l E n e r g y D e p o s i t ( ) , ” Energy ” )
45             << s t d : :   s e t w ( 6 ) << G4BestUnit ( f S t e p −   >G e t S t e p L e n g t h ( ) , ” Length ” )
46             << s t d : :   s e t w ( 6 ) << G4BestUnit ( f T r a c k−   >GetTrackLength ( ) , ” Length ” )
47             << ” ” ;
48
49            if ( fTrack−>GetNextVolume ( ) ! = 0 ) {
50              G4cout << s t d : : s e t w ( 1 0 ) << f T r a c k−>GetVolume()−>GetName ( ) ;
51            } else {
52              G4cout << s t d : : s e t w ( 1 0 ) << ” OutOfWorld ” ;
53            }




                                                                                               75
54
 55            if ( fStep−  >G e t P o s t S t e p P o i n t ()−> G e t P r o c e s s D e f i n e d S t e p ( ) != NULL) {
 56              G4cout << ” ” << s t d : : s e t w ( 1 0 )
 57                << f S t e p −>G e t P o s t S t e p P o i n t ()−> G e t P r o c e s s D e f i n e d S t e p ( )
 58                                                                                       −>GetProcessName ( ) ;
 59            } else {
 60              G4cout << ”          UserLimit ” ;
 61            }
 62
 63            G4cout << G4endl ;
 64
 65             ( v e r b o s e L e v e l == 2 ) {
               if
 66           G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
 67                                         fN2ndariesAlongStepDoIt +
 68                                         fN2ndariesPostStepDoIt ;
 69           i f ( tN2ndariesTot > 0) {
 70        G4cout << ”             :−−−−− L i s t o f 2 n d a r i e s − ”
 71                  << ”#SpawnInStep=” << s t d : : s e t w ( 3 ) << t N 2 n d a r i e s T o t
 72                  << ” ( R e s t=” << s t d : : s e t w ( 2 ) << f N 2 n d a r i e s A t R e s t D o I t
 73                  << ” , Along=” << s t d : : s e t w ( 2 ) << f N 2 n d a r i e s A l o n g S t e p D o I t
 74                  << ” , P o s t=” << s t d : : s e t w ( 2 ) << f N 2 n d a r i e s P o s t S t e p D o I t
 75                  << ” ) , ”
 76                  << ”#SpawnTotal=” << s t d : : s e t w ( 3 ) << ( ∗ f S e c o n d a r y ) . s i z e ( )
 77                  << ” − − − − − − − −”
                                 − − − − − − −
 78                  << G4endl ;
 79
 80         for   ( s i z e t l p l =(∗ f S e c o n d a r y ) . s i z e () − t N 2 n d a r i e s T o t ;
 81                 l p l < ( ∗ f S e c o n d a r y ) . s i z e ( ) ; l p l ++) {
 82             G4cout << ”             : ”
 83              << s t d : : s e t w ( 6 )
 84              << G4BestUnit ( ( ∗ f S e c o n d a r y ) [ l p l ]−> G e t P o s i t i o n ( ) . x ( ) , ” Length ” )
 85              << s t d : : s e t w ( 6 )
 86              << G4BestUnit ( ( ∗ f S e c o n d a r y ) [ l p l ]−> G e t P o s i t i o n ( ) . y ( ) , ” Length ” )
 87              << s t d : : s e t w ( 6 )
 88              << G4BestUnit ( ( ∗ f S e c o n d a r y ) [ l p l ]−> G e t P o s i t i o n ( ) . z ( ) , ” Length ” )
 89              << s t d : : s e t w ( 6 )
 90              << G4BestUnit ( ( ∗ f S e c o n d a r y ) [ l p l ]−> G e t K i n e t i c E n e r g y ( ) , ” Energy ” )
 91              << s t d : : s e t w ( 1 0 )
 92              << ( ∗ f S e c o n d a r y ) [ l p l ]−> G e t D e f i n i t i o n ()−> G e t P a r t i c l e N a m e ( ) ;
 93             G4cout << G4endl ;
 94        }
 95
 96        G4cout <<         ”    : − − − − − − − − − − − − − −
                                  − − − − − − − − − − − − − − −”
 97               <<         ”− − − − − − − − − − − − − − − − −
                               − − − − − − − − − − − − − − − − −”
 98               <<         ”−− End o f 2 n d a r i e s I n f o − − − − −
                                                                  − − − − −”
 99               <<         G4endl ;
100           }
101         }
102
103       }
104       G4cout . p r e c i s i o n ( p r e c ) ;
105   }
106
107   void SteppingVerbose : : TrackingStarted ()
108   {
109
110       CopyState ( ) ;
111       G 4 i n t p r e c = G4cout . p r e c i s i o n ( 3 ) ;
112       i f ( verboseLevel > 0) {
113          G4cout << s t d : : s e t w ( 5 ) << ” S t e p#”               << ” ”
114              << s t d : : s e t w ( 6 ) << ”X”                 <<     ”   ”
115              << s t d : : s e t w ( 6 ) << ”Y”                 <<     ”   ”
116              << s t d : : s e t w ( 6 ) << ”Z”                 <<     ”   ”
117              << s t d : : s e t w ( 9 ) << ” KineE ”           <<     ” ”
118              << s t d : : s e t w ( 9 ) << ” dEStep ”          <<     ” ”
119              << s t d : : s e t w ( 1 0 ) << ” StepL eng ”
120              << s t d : : s e t w ( 1 0 ) << ” TrakLeng ”
121              << s t d : : s e t w ( 1 0 ) << ” Volume ”        <<     ”  ”
122              << s t d : : s e t w ( 1 0 ) << ” P r o c e s s ” <<     G4endl ;
123
124            G4cout << s t d : : s e t w ( 5 ) << f T r a c k−>GetCurrentStepNumber ( ) << ” ”
125             << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k−>G e t P o s i t i o n ( ) . x ( ) , ” Length ” )
126             << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k−>G e t P o s i t i o n ( ) . y ( ) , ” Length ” )
127             << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k−>G e t P o s i t i o n ( ) . z ( ) , ” Length ” )
128             << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k−>G e t K i n e t i c E n e r g y ( ) , ” Energy ” )
129                     << s t d : : s e t w ( 6 ) << G4BestUnit ( f S t e p −  >G e t T o t a l E n e r g y D e p o s i t ( ) , ” Energy ” )
130             << s t d : : s e t w ( 6 ) << G4BestUnit ( f S t e p −>G e t S t e p L e n g t h ( ) , ” Length ” )
131             << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k−>GetTrackLength ( ) , ” Length ” )
132             << ” ” ;
133
134            if    ( fTrack−>GetNextVolume ( ) ) {
135                 G4cout << s t d : : s e t w ( 1 0 ) << f T r a c k−>GetVolume()−>GetName ( ) ;




                                                                                          76
136          } else {
137            G4cout << s t d : : s e t w ( 1 0 ) << ” OutOfWorld ” ;
138          }
139          G4cout << ”     i n i t S t e p ” << G4endl ;
140
141       }
142       G4cout . p r e c i s i o n ( p r e c ) ;
143   }



      5.5.37                   TrackerIonHit.cc
  1   #include ” T r a c k e r I o n H i t . hh”
  2
  3   G 4 A l l o c a t o r <T r a c k e r I o n H i t > T r a c k e r I o n H i t A l l o c a t o r ;
  4
  5
  6   TrackerIonHit : : TrackerIonHit () {
  7     f l a g =0;
  8   }
  9
 10   T r a c k e r I o n H i t : : ˜ T r a c k e r I o n H i t ( ) {}
 11
 12   TrackerIonHit : : TrackerIonHit ( const                            T r a c k e r I o n H i t &r i g h t )
 13     : G4VHit ( )
 14   {
 15       trackID            = r i g h t . trackID ;
 16       p a r t i c l e I D= r i g h t . p a r t i c l e I D ;
 17       pos                = r i g h t . pos ;
 18   }
 19
 20   c o n s t T r a c k e r I o n H i t& T r a c k e r I o n H i t : : operator=( c o n s t             T r a c k e r I o n H i t &r i g h t )
 21   {
 22       trackID            = r i g h t . trackID ;
 23       p a r t i c l e I D= r i g h t . p a r t i c l e I D ;
 24       pos                = r i g h t . pos ;
 25       return ∗ t h i s ;
 26   }
 27
 28   G 4 i n t T r a c k e r I o n H i t : : operator==( c o n s t            T r a c k e r I o n H i t& r i g h t )   const
 29   {
 30      return ( t h i s==&r i g h t ) ? 1 : 0 ;
 31   }
 32
 33   // draws y e l l o w s p h e r e s f o r i o n h i t s
 34   v o i d T r a c k e r I o n H i t : : Draw ( )
 35   {
 36      G4VVisManager ∗ pVVisManager = G4VVisManager : : G e t C o n c r e t e I n s t a n c e ( ) ;
 37       i f ( pVVisManager )
 38      {
 39           G4Circle c i r c l e ( pos ) ;
 40           c i r c l e . SetScreenSize (4);
 41           c i r c l e . S e t F i l l S t y l e ( G4Circle : : f i l l e d ) ;
 42           G4Colour c o l o u r ( 1 . , 1 . , 0 . ) ;
 43           G4VisAttributes a t t r i b s ( colour ) ;
 44           c i r c l e . SetVisAttributes ( attribs ) ;
 45           pVVisManager−            >Draw ( c i r c l e ) ;
 46      }
 47   }
 48
 49   // ” Edep ” h e r e i s one e n e r g y d e p o s i t i o n o f many t h a t makes up a y e l l o w b l o b
 50   // i . e . a sum o f t h e s e ” Edep ” s r e s u l t s i n t h e ” Edep ” p r i n t e d i n R e s u l t s . c c
 51
 52   void     T r a c k e r I o n H i t : : Print ( )
 53   {
 54
 55       G4cout << s t d : : s e t w (2)<< s t d : : r i g h t << t r a c k I D << ” ” << f l a g << ” ”
 56        << s t d : : s e t w (13)<< p a r t i c l e I D << ” ”
 57        << s t d : : s e t p r e c i s i o n ( 4 ) << s t d : : f i x e d
 58        << KE/GeV< ” ” << s t d : : s e t p r e c i s i o n ( 6 )
                            <
 59        << b e t a< ” ”
                        <
 60        << s t d : : s e t p r e c i s i o n ( 4 ) << s t d : : s e t w ( 7 ) << s t d : : r i g h t
 61        << t h e t a ∗1000.<< ” ” << s t d : : s e t w ( 1 0 ) << s t d : : r i g h t
 62        << p h i ∗1000.<< ” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t
 63        << p o s . getX()<<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t // r e p o r t s o u r c e p o s i t i o n . . . but I don ’ t have   this   coded
 64        << p o s . getY()<<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t // ”
 65        << p o s . g e t Z ()<<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t // ”
 66        << t i m e ∗1000.<< ” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t
 67        << l a b t i m e ∗ 1 0 0 0 . << ” ” << s t d : : s e t w ( 1 0 ) << s t d : : r i g h t
 68        << g l o b a l t i m e ∗ 1 0 0 0 . << ” ” << s t d : : s e t w ( 8 ) << s t d : : r i g h t
 69        << Edep /MeV << ” ” << l e n g t h /mm




                                                                                                         77
70         << G4endl ;
71
72   }



     5.5.38                 TrackerIonSD.cc
 1   #include ” TrackerIonSD . hh”
 2
 3   TrackerIonSD : : TrackerIonSD ( G 4 S t r i n g name)
 4     : G 4 V S e n s i t i v e D e t e c t o r (name)
 5   {
 6     G 4 S t r i n g HCname ;
 7     c o l l e c t i o n N a m e . i n s e r t (HCname=” i o n C o l l e c t i o n ” ) ;
 8
 9   }
10
11   TrackerIonSD : : ˜ TrackerIonSD ( )
12   {
13
14   }
15
16   v o i d TrackerIonSD : : I n i t i a l i z e ( G4HCofThisEvent ∗ )
17   {
18       i o n C o l l e c t i o n = new T r a c k e r I o n H i t s C o l l e c t i o n
19           ( SensitiveDetectorName , collectionName [ 0 ] ) ;
20
21   }
22
23   G4bool TrackerIonSD : : P r o c e s s H i t s ( G4Step ∗ aStep ,                        G4TouchableHistory ∗)
24   {
25
26       G4StepPoint ∗             vi ;
27
28       c o n s t G 4 D y n a m i c P a r t i c l e ∗ a P a r t i c l e= aStep−        >GetTrack()−> G e t D y n a m i c P a r t i c l e ( ) ;
29       c o n s t G 4 S t r i n g type =            aParticle−       >G e t D e f i n i t i o n ()−> G e t P a r t i c l e T y p e ( ) ;
30     c o n s t G 4 i n t t r a c k I D = aStep−        >GetTrack()−>GetTrackID ( ) ;
31       c o n s t G 4 S t r i n g name =            aParticle−       >G e t D e f i n i t i o n ()−> G e t P a r t i c l e N a m e ( ) ;
32   c o n s t G4double l e n = aStep−                 >G e t S t e p L e n g t h ( ) ;
33
34       // G4cout << ” P r o c e s s i n g          hit    f o r ” << name << ” ,              t r a c k ” << t r a c k I D << G4endl ;
35
36        G4int p i x e l I D = 1 9 0 0 ;
37
38
39       i f (name == ” p r o t o n ” | | name == ” e+” | | name == ” e−” | |
40            name == ” a l p h a ” )
41         {
42            // G4cout << ” P r o c e s s i n g ” << name << ” h i t ” << G4endl ;
43            v i = aStep−        >G e t P r e S t e p P o i n t ( ) ;
44            G 4 S t r i n g vname = v i −       >G e t P h y s i c a l V o l u m e ()−>GetName ( ) ;
45            i f ( vname ==” S i B l o c k p a r a m e t e r i s e d P i x e l s ” ) {
46                   c o n s t G4TouchableHistory ∗ SiBlockTouchable = ( G4TouchableHistory ∗ ) ( vi−                            >GetTouchable ( ) ) ;
47                   c o n s t G4VPhysicalVolume ∗ S i B l o c k P h y s i c a l = S i B l o c k T o u c h a b l e −   >GetVolume ( ) ;
48                   p i x e l I D= S i B l o c k P h y s i c a l − >GetCopyNo ( ) ;
49                   i f ( ( p i x e l I D >= 1 6 0 0 ) | | ( p i x e l I D < 0 ) ) {
50                          G4cout< E r r o r : I n v a l i d p i x e l I D w h i l e p r o c e s s i n g i o n h i t s : ”
                                      <”
51                               <<p i x e l I D <<G4endl ;
52                          return f a l s e ;
53                   }
54              }
55
56
57             i f ( len > 0 . )
58             {
59                   T r a c k e r I o n H i t ∗ n e w I o n H i t I= new T r a c k e r I o n H i t ( ) ;
60                   newIonHitI− etTrackID ( trackID ) ;
                                          >S
61                   newIonHitI−          >S e t P a r t i c l e I D (name ) ;
62                   newIonHitI−          >SetTime ( v i −       >GetProperTime ( ) ) ;
63                   newIonHitI−          >SetLabTime ( v i −         >GetLocalTime ( ) ) ;
64                   newIonHitI−          >SetGlobTime ( v i −          >GetGlobalTime ( ) ) ;
65                   newIonHitI−          >SetKE ( v i −     >G e t K i n e t i c E n e r g y ( ) ) ; / / T h i s i s t h e k i n e t i c e n e r g y o f t h e e l e c t r o n   at a step
66                   // G4cout< I n TrackerIonSD . cc , Kin . E . : ”<<v i −
                                      <”                                                                   >G e t K i n e t i c E n e r g y ()<<G4endl ;
67                   newIonHitI−          >S e t P o s ( v i − >G e t P o s i t i o n ( ) ) ;
68                   i f ( vname == ” S i B l o c k p a r a m e t e r i s e d P i x e l s ” ) {
69                        newIonHitI−           >SetVolName ( ” monoblock ” ) ; / / s a i d ”vname” i n s t e a d o f monoblock
70                        newIonHitI−           >S e t P i x e l ( p i x e l I D ) ;
71                   }
72                   else {
73                        G4cout< Your volume name i s ”<<vname<
                                        <”                                                       <”NOT WHAT YOU EXPECTED (OR WANT) ”<<G4endl ;
74                   }




                                                                                              78
75                       newIonHitI−           >SetEdep ( aStep−           >G e t T o t a l E n e r g y D e p o s i t ( ) ) ;
 76                       // G4cout< I n TrackerIonSD . cc , Edep : ”<<aStep−
                                           <”                                                                    >G e t T o t a l E n e r g y D e p o s i t ()<<G4endl ;
 77                       newIonHitI−           >S e t L e n g t h ( l e n ) ;
 78                       newIonHitI−           >Draw ( ) ;
 79                       i o n C o l l e c t i o n − n s e r t ( newIonHitI ) ;
                                                     >i
 80                 }
 81
 82           G4TrackStatus TrackStatus ;
 83           T r a c k S t a t u s=aStep−>GetTrack()−> G e t T r a c k S t a t u s ( ) ;
 84        }
 85       return t r u e ;
 86   }
 87
 88   v o i d TrackerIonSD : : EndOfEvent ( G4HCofThisEvent ∗ HCE)
 89   {
 90      G4int i ;
 91      G 4 i n t NbHits = i o n C o l l e c t i o n −>e n t r i e s ( ) ;
 92
 93       i f ( NbHits >0)
 94           {
 95              ( ∗ i o n C o l l e c t i o n )[0] − > SetGunFlag ( ) ;
 96
 97                  if   ( print )
 98        {
 99                G4cout<<G4endl ;
100                G4cout << ”− − − − >H i t s C o l l e c t i o n : i n t h i s
                                 − − − −                                                            event      there     a r e ” << NbHits
101                 << ” h i t s f o r i o n t r a c k i n g : ” << G4endl ;
102
103                G4cout << s t d : : s e t w ( 2 ) << ”ID” << ” ”
104                 << s t d : : s e t w ( 1 2 ) << ”          PID” << ” ”
105                 << s t d : : s e t p r e c i s i o n ( 4 ) << s t d : : f i x e d
106                 << ”KE [ GeV ] ” <<” ” << s t d : : s e t p r e c i s i o n ( 6 )
107                 << ”     b e t a ” << ” ”
108                 << s t d : : s e t p r e c i s i o n ( 4 ) << s t d : : s e t w ( 7 ) << s t d : : r i g h t
109                 << ” t h [ mrad ] ” <<” ” << s t d : : s e t w ( 1 0 ) << s t d : : r i g h t
110                 << ” p h i [ mrad ] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t
111                 << ”X [mm] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t
112                 << ”Y [mm] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t
113                 << ”Z [mm] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t
114                 << ” t a u [ p s ] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t
115                 << ” t [ p s ] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t
116                 << ”T [ p s ] ” <<” ” << s t d : : s e t w ( 8 ) << s t d : : r i g h t
117                 << ”     Ed [ MeV ] ” << ” S t e p Length [mm] ” << G4endl ;
118
119                f o r ( i =0; i <NbHits ; i ++) {
120                    ( ∗ i o n C o l l e c t i o n ) [ i ]−>Print ( ) ;
121                }
122
123        }
124
125            }
126
127       s t a t i c G 4 i n t HCID = −1;
128       i f (HCID<0)
129           {
130              HCID = G4SDManager : : GetSDMpointer()−> G e t C o l l e c t i o n I D ( c o l l e c t i o n N a m e [ 0 ] ) ; / / i don ’ t t h i n k                    [0]   s h o u l d be h e r e
131           }
132       HCE >A d d H i t s C o l l e c t i o n ( HCID , i o n C o l l e c t i o n ) ;
               −
133   }



      5.5.39                     TrackerIonSD Messenger.cc
  1   #include ” T r a c k e r I o n S D M e s s e n g e r . hh ”
  2
  3   T r a c k e r I o n S D M e s s e n g e r : : T r a c k e r I o n S D M e s s e n g e r ( TrackerIonSD ∗ TISD )
  4   : t r a c k e r ( TISD )
  5   {
  6       P r t D i r = new G 4 U I d i r e c t o r y ( ” / P r i n t / ” ) ;
  7       PrtDir−       >S e t G u i d a n c e ( ” Event by e v e n t p r i n t c o n t r o l f o r ” ) ;
  8
  9       PrtSCmd = new G4UIcmdWithoutParameter ( ” / P r i n t / T r a c k S e t ” , t h i s ) ;
 10       PrtSCmd−>S e t G u i d a n c e ( ” S e t s p r i n t i n g o f t r a c k i o n r e s u l t s ” ) ;
 11
 12       PrtUCmd = new G4UIcmdWithoutParameter ( ” / P r i n t / Track UnSet ” , t h i s ) ;
 13       PrtUCmd−>S e t G u i d a n c e ( ”Un s e t s p r i n t i n g o f t r a c k i o n r e s u l t s ” ) ;
 14   }
 15
 16   TrackerIonSD Messenger : : ˜ TrackerIonSD Messenger ( )
 17   {
 18     d e l e t e PrtDir ;




                                                                                                   79
19       d e l e t e PrtSCmd ;
20       d e l e t e PrtUCmd ;
21   }
22
23   v o i d T r a c k e r I o n S D M e s s e n g e r : : SetNewValue ( G4UIcommand∗ command , G 4 S t r i n g )
24   {
25       i f ( command == PrtSCmd ) {
26           t r a c k e r −>S e t P r i n t ( ) ;
27      }
28
29
30       i f ( command == PrtUCmd ) {
31           t r a c k e r −>U n S e t P r i n t ( ) ;
32       }
33   }



     5.5.40                 VisManager.cc
 1   #i f d e f G4VIS USE
 2
 3   #include ” VisManager . hh”
 4
 5   // S u p p o r t e d   drivers . . .
 6
 7   // Not n e e d i n g e x t e r n a l p a c k a g e s o r     libraries ...
 8   #include ” G4ASCIITree . hh”
 9   #include ”G4DAWNFILE . hh”
10   #include ” G4HepRepFile . hh”
11   #include ” G4RayTracer . hh”
12   #include ”G4VRML1File . hh”
13   #include ”G4VRML2File . hh”
14
15   // N e e d i n g e x t e r n a l p a c k a g e s o r   libraries ...
16
17   #i f d e f G4VIS USE DAWN
18   #include ” G4FukuiRenderer . hh”
19   #e n d i f
20
21   #i f d e f G4VIS USE OPACS
22   #include ”G4Wo . hh ”
23   #include ”G4Xo . hh ”
24   #e n d i f
25
26   #i f d e f G4VIS USE OPENGLX
27   #include ”G4OpenGLImmediateX . hh ”
28   #include ”G4OpenGLStoredX . hh”
29   #e n d i f
30
31   #i f d e f G4VIS USE OPENGLWIN32
32   #include ” G4OpenGLImmediateWin32 . hh ”
33   #include ” G4OpenGLStoredWin32 . hh ”
34   #e n d i f
35
36   #i f d e f G4VIS USE OPENGLXM
37   #include ”G4OpenGLImmediateXm . hh ”
38   #include ”G4OpenGLStoredXm . hh”
39   #e n d i f
40
41   #i f d e f G4VIS USE OIX
42   #include ” G4OpenInventorX . hh”
43   #e n d i f
44
45   #i f d e f G4VIS USE OIWIN32
46   #include ” G4OpenInventorWin32 . hh ”
47   #e n d i f
48
49   #i f d e f G4VIS USE VRML
50   #include ”G4VRML1 . hh”
51   #include ”G4VRML2 . hh”
52   #e n d i f
53
54   VisManager : : VisManager ( ) {}
55
56   v o i d VisManager : : R e g i s t e r G r a p h i c s S y s t e m s ( )
57   {
58      // G r a p h i c s S y s t e m s n o t n e e d i n g e x t e r n a l p a c k a g e s o r   libraries ...
59       R e g i s t e r G r a p h i c s S y s t e m ( new G4ASCIITree ) ;
60       R e g i s t e r G r a p h i c s S y s t e m ( new G4DAWNFILE ) ;
61      //       R e g i s t e r G r a p h i c s S y s t e m ( new G4GAGTree ) ;
62       R e g i s t e r G r a p h i c s S y s t e m ( new G4HepRepFile ) ;




                                                                                         80
63        R e g i s t e r G r a p h i c s S y s t e m ( new G4RayTracer ) ;
 64        R e g i s t e r G r a p h i c s S y s t e m ( new G4VRML1File ) ;
 65        R e g i s t e r G r a p h i c s S y s t e m ( new G4VRML2File ) ;
 66
 67        // G r a p h i c s s y s t e m s n e e d i n g e x t e r n a l p a c k a g e s o r   libraries ...
 68
 69   #i f d e f G4VIS USE DAWN
 70      R e g i s t e r G r a p h i c s S y s t e m ( new G4FukuiRenderer ) ;
 71   #e n d i f
 72
 73   #i f d e f G4VIS USE OPACS
 74      R e g i s t e r G r a p h i c s S y s t e m ( new G4Wo ) ;
 75      R e g i s t e r G r a p h i c s S y s t e m ( new G4Xo ) ;
 76   #e n d i f
 77
 78   #i f d e f G4VIS USE OPENGLX
 79      R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLImmediateX ) ;
 80      R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLStoredX ) ;
 81   #e n d i f
 82
 83   #i f d e f G4VIS USE OPENGLWIN32
 84      R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLImmediateWin32 ) ;
 85      R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLStoredWin32 ) ;
 86   #e n d i f
 87
 88   #i f d e f G4VIS USE OPENGLXM
 89      R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLImmediateXm ) ;
 90      R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLStoredXm ) ;
 91   #e n d i f
 92
 93   #i f d e f G4VIS USE OIX
 94      R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenInventorX ) ;
 95   #e n d i f
 96
 97   #i f d e f G4VIS USE OIWIN32
 98      R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenInventorWin32 ) ;
 99   #e n d i f
100
101   #i f d e f G4VIS USE VRML
102      R e g i s t e r G r a p h i c s S y s t e m ( new G4VRML1 ) ;
103      R e g i s t e r G r a p h i c s S y s t e m ( new G4VRML2 ) ;
104   #e n d i f
105
106        if     ( fVerbose > 0)
107        {
108             G4cout <<
109               ” nYou have s u c c e s s f u l l y c h o s e n t o u s e t h e          following         graphics      systems . ”
110             << G4endl ;
111             PrintAvailableGraphicsSystems ( ) ;
112        }
113
114   }
115
116   #e n d i f



      5.5.41                  Sort to Root
  1   //       T h i s w i l l s o r t GEANT4 o u t p u t from t h e s i n g l e −block s i l i c o n
  2   //       d e t e c t o r s i m u l a t i o n b e i n g u s e d f o r t h e 69Kr e x p e r i m e n t .
  3   //       I t w i l l be b a s e d on m o n o b l o c k 2 r o o t . cpp , but i t won ’ t have
  4   //       the s t r i p s b u s i n e s s .      −ZM 1 0 / 2 2 / 0 9
  5
  6   //C++ h e a d e r f i l e s ( note :            t h e s e might n o t      all    be n e c e s s a r y )
  7   #include <i o s t r e a m >
  8   #include <f s t r e a m >
  9   #include <c s t r i n g >
 10   #include <b i t s e t >
 11
 12   //ROOT h e a d e r f i l e s ( n o t e :        t h e s e might n o t      all    be n e c e s s a r y )
 13   #include ” T F i l e . h”
 14   #include ” TTree . h”
 15   #include ”TMath . h”
 16   #include ”TRandom . h”
 17
 18   // v a r i a b l e s   for   t h r e s h o l d and w i d t h ( s e e    m o n o b l o c k 2 r o o t . cpp f o r   description )
 19
 20   double         DSSD THRESH = 8 0 ;
 21   double         DSSD WIDTH = 5 0 ;
 22   double         DSSD F = 3 ;
 23   double         DSSD G = 2 ;




                                                                                                81
24   double DSSD H = 0 ;
 25
 26   // d e f i n e namespace
 27   u s i n g namespace s t d ;
 28
 29   // data c l a s s e s
 30   class Initial conditions {
 31       public : I n i t i a l c o n d i t i o n s ( ) { } ; // d e f a u l t     constructor
 32       Double t PositronE ;
 33       Double t ElectronE ;
 34       D o u b l e t Proton1E ;
 35       D o u b l e t Proton2E ;
 36       D o u b l e t Proton3E ;
 37       D o u b l e t AlphaE ;
 38       D o u b l e t Gamma1E ;
 39       D o u b l e t Gamma2E ;
 40       D o u b l e t Gamma3E ;
 41       D o u b l e t Gamma4E ;
 42   };
 43
 44   c l a s s DSSD{
 45         public : DSSD ( ) { } ; // d e f a u l t c o n s t r u c t o r
 46         I n t t f r o n t H i t [ 4 1 ] ; // t a l l y o f a l l h i t s f o r f r o n t s t r i p s
 47         I n t t b a c k H i t [ 4 1 ] ; // t a l l y a l l h i t s f o r back s t r i p s
 48         D o u b l e t f r o n t d E [ 4 1 ] ; // t a l l y o f t o t a l dE f o r f r o n t s t r i p s
 49         D o u b l e t backdE [ 4 1 ] ; / / t a l l y o f t o t a l dE f o r back s t r i p s
 50
 51        I n t t f r o n t H i t P r o t o n [ 4 1 ] ; // p r o t o n f r o n t h i t s t a l l y
 52        I n t t b a c k H i t P r o t o n [ 4 1 ] ; // ”       back
 53        D o u b l e t f r o n t p r o t o n d E [ 4 1 ] ; // p r o t o n f r o n t dE t a l l y
 54        D o u b l e t backprotondE [ 4 1 ] ; //                ”     back
 55
 56        I n t t f r o n t H i t A l p h a [ 4 1 ] ; // a l p h a s
 57        I n t t backHitAlpha [ 4 1 ] ;
 58        Double t frontalphadE [ 4 1 ] ;
 59        D o u b l e t backalphadE [ 4 1 ] ;
 60
 61        I n t t f r o n t H i t P o s i t r o n [ 4 1 ] ; // p o s i t r o n s
 62        I n t t backHitPositron [ 4 1 ] ;
 63        Double t frontpositrondE [ 4 1 ] ;
 64        Double t backpositrondE [ 4 1 ] ;
 65
 66
 67        I n t t f r o n t H i t E l e c t r o n [ 4 1 ] ; // e l e c t r o n s
 68        I n t t backHitElectron [ 4 1 ] ;
 69        Double t frontelectrondE [ 4 1 ] ;
 70        Double t backelectrondE [ 4 1 ] ;
 71
 72        I n t t frontHitGamma [ 4 1 ] ; //gammas
 73        I n t t backHitGamma [ 4 1 ] ;
 74        D o u b l e t frontgammadE [ 4 1 ] ;
 75        D o u b l e t backgammadE [ 4 1 ] ;
 76
 77        // h i t m u l t i p l i c i t y c o u n t e r s
 78        I n t t frontMult ;
 79        I n t t frontMultProton ;
 80        I n t t frontMultAlpha ;
 81        Int t frontMultPositron ;
 82        Int t frontMultElectron ;
 83        I n t t frontMultGamma ;
 84        I n t t backMult ;
 85        I n t t backMultProton ;
 86        I n t t backMultAlpha ;
 87        I n t t backMultPositron ;
 88        I n t t backMultElectron ;
 89        I n t t backMultGamma ;
 90
 91        // t o t a l       d e t e c t o r sums
 92        Double         t    sumFront ;
 93        Double         t    sumFrontProton ;
 94        Double         t    sumFrontAlpha ;
 95        Double         t    sumFrontPositron ;
 96        Double         t    sumFrontElectron ;
 97        Double         t    sumFrontGamma ;
 98        Double         t    sumBack ;
 99        Double         t    sumBackProton ;
100        Double         t    sumBackAlpha ;
101        Double         t    sumBackPositron ;
102        Double         t    sumBackElectron ;
103        Double         t    sumBackGamma ;
104
105        Int t      frontStrip ;




                                                                                            82
106        I n t t backStrip ;
107        D o u b l e t maxFront ;
108        D o u b l e t maxBack ;
109   };
110
111   // f u n c t i o n s to a p p l y d e t e c t o r r e s o l u t i o n ,     threshold ,
112   D o u b l e t DSSD FWHM ( D o u b l e t e n e r g y ) {
113        Double t e out ;
114        D o u b l e t fwhm , s i g m a ;
115
116        //fwhm = 0 . 0 1 ∗ e n e r g y ; // s e t F H    W M e q u a l to 25 keV
117        // b e s t match i n MCNP:F H =#∗s q r t (E)
                                              W M
118        // need to t a k e e n e r g y , c o n v e r t to MeV, t a k e s q r t , and c o n v e r t back
119        //fwhm = 0 . 2 4 3 ∗ ( s q r t ( e n e r g y / 1 0 0 0 ) ) ∗ 1 0 0 0 ;
120        fwhm =176;// keV
121        s i g m a = fwhm / 2 . 3 5 4 8 2 ;
122        e o u t = gRandom−      >Gaus ( e n e r g y , s i g m a ) ;
123
124        return e o u t ;
125   }
126
127   D o u b l e t DSSD Threshold ( D o u b l e t e n e r g y ) {
128        return 0 . 5 ∗ ( 1 + tanh ( ( e n e r g y −DSSD THRESH) /DSSD WIDTH )                                );
129   }
130
131   //MAIN P O R M
                R G A
132   i n t main ( i n t a r g c ,       char ∗ argv [ ] ) {
133        int events = 0;
134
135        // d e f i n e c l a s s e s t h a t w i l l h o l d data i n r o o t t r e e s
136        I n i t i a l c o n d i t i o n s ∗ i n i t i a l = new I n i t i a l c o n d i t i o n s ( ) ;
137        DSSD ∗ monoblock = new DSSD ( ) ;
138        DSSD ∗ m o n o b l o c k r a w = new DSSD ( ) ;
139
140        fstream        input ;
141
142        T F i l e ∗ f = new T F i l e ( ”GEANT4 . r o o t ” , ”RECREATE” ) ; / / maybe t r y c h a n g i n g t h e name
143        TTree ∗ t r e e = new TTree ( ”T” , ” G e a n t 4 s i m u l a t i o n ” ) ; / / ”  ”        ”            ”    ”
144
145
146   ///∗∗∗∗ t o       look      at a s i n g l e      strip ,      i n ROOT e . g : T >Draw ( ” m o n o b l o c k r a w . f r o n t e l e c t r o n d E [ 2 1 ] ” ) ;
                                                                                       −
147
148      // T r e e s f o r S t r i p p e d D e t e c t o r :
149   tree−>Branch ( ” m o n o b l o c k r a w ” , monoblock raw , ” f r o n t H i t [ 4 1 ] / I : b a c k H i t [ 4 1 ] / I : f r o n t d E [ 4 1 ] /D: backdE [ 4 1 ] /D: f r o n t H i t P r o t o n
150   tree−>Branch ( ” monoblock ” , monoblock , ” f r o n t H i t [ 4 1 ] / I : b a c k H i t [ 4 1 ] / I : f r o n t d E [ 4 1 ] /D : backdE [ 4 1 ] /D: f r o n t H i t P r o t o n [ 4 1 ] / I : b
151      tree−   >Branch ( ” i n i t i a l ” , i n i t i a l , ” P o s i t r o n E /D : E l e c t r o n E /D: Proton1E /D: Proton2E /D : Proton3E /D: AlphaE /D: Gamma1E/D : Gamm
152
153
154
155        // v a r i a b l e s t o     mark p r o g r e s s i n         the   file
156        unsigned long              p o s i t i o n =0;
157        unsigned long              f i l e l e n g t h =0;
158        unsigned long              s t a r t p o s =0;
159
160        i n p u t . open ( a r g v [ 1 ] ,   i o s : : binary | i o s : : in ) ;
161
162        if   ( input . f a i l ()){
163             c o u t< Couldn ’ t open t h e data
                        <”                                                file   ”<<a r g v [1] < < ” . . . bummer , dude . ”<<e n d l ;
164        }
165
166        // f i g u r e o u t t h e l e n g t h o f         the    file
167        i n p u t . s e e k g ( 0 , i o s : : end ) ;
168        f i l e l e n g t h =i n p u t . t e l l g ( ) ;
169
170        // r e t u r n t o b e g i n n i n g t o l o o k         at    file
171        i n p u t . s e e k g ( 0 , i o s : : beg ) ;
172        p o s i t i o n = input . t e l l g ( ) ;
173
174        // T h i s way        f o r t h e s i n g l e S i Block , i n s i d e l o o p f o r S t r i p D e t e c t o r
175         // u n s i g n e d     s h o r t p a r t i c l e I D =9999;
176         // u n s i g n e d     s h o r t eDep =0;// e n e r g y d e p o s i t e d w i t h o u t r e s o l u t i o n a p p l i e d
177         // u n s i g n e d     s h o r t temp =0;
178         // D o u b l e t       e fwhm =0;// e n e r g y d e p o s i t e d t a k i n g i n t o a c c o u n t g a u s s i n a d i s t r i b u t i o n
179         // D o u b l e t       e t h r e s h =0;//? t h r e s h o l d energy ?
180         // D o u b l e t       random =0;
181         // D o u b l e t       randomNUM=0;
182
183        // go t h r o u g h program , p u l l i m p o r t a n t data ,                write     to   tree    structure
184        w h i l e ( p o s i t i o n <f i l e l e n g t h ){
185             s t a r t p o s=p o s i t i o n ;
186
187             unsigned          short     p a r t i c l e I D =9999;




                                                                                               83
188         unsigned short pixelID = 1700;
189         unsigned short f r o n t S t r i p = 100;
190         unsigned short backStrip = 100;
191         D o u b l e t maxF =0;
192         D o u b l e t maxB =0;
193         u n s i g n e d s h o r t s t r i p F =100;
194         unsigned short stripB = 100;
195         // eDep i s ” s h o r t ” b e c a u s e . . . . run w i t h i t . i t h i n k b e c a u s e i t was b i n a r y ?
196         u n s i g n e d s h o r t eDep =0;// e n e r g y d e p o s i t e d w i t h o u t r e s o l u t i o n a p p l i e d
197         D o u b l e t e fwhm =0;// e n e r g y d e p o s i t e d t a k i n g i n t o a c c o u n t g a u s s i a n d i s t r i b u t i o n
198         Double t e t h r e s h =0;//? t h r e s h o l d energy ?
199         D o u b l e t random =0;
200         D o u b l e t randomF =0;
201         D o u b l e t randomB =0;
202
203
204
205         unsigned       s h o r t temp =0;
206
207         initial    −>P o s i t r o n E =0;
208         initial    −>E l e c t r o n E =0;
209         initial    −>Proton1E =0;
210         initial    −>Proton2E =0;
211         initial    −>Proton3E =0;
212         initial    −>AlphaE =0;
213         initial    −>Gamma1E=0;
214         initial    −>Gamma2E=0;
215         initial    −>Gamma3E=0;
216         initial    −>Gamma4E=0;
217
218   for    ( i n t i =0; i <41; i ++){
219         monoblock raw− r o n t H i t [ i ] = 0 ;
                              >f                                           monoblock− r o n t H i t [ i ] = 0 ;
                                                                                     >f
220         monoblock raw−    >b a c k H i t [ i ] = 0 ;                   monoblock−>b a c k H i t [ i ] = 0 ;
221         monoblock raw− r o n t d E [ i ] = 0 ;
                              >f                                           monoblock− r o n t d E [ i ] = 0 ;
                                                                                     >f
222         monoblock raw−    >backdE [ i ] = 0 ;                          monoblock−>backdE [ i ] = 0 ;
223         monoblock raw− r o n t H i t P r o t o n [ i ] = 0 ;
                              >f                                           monoblock− r o n t H i t P r o t o n [ i ] = 0 ;
                                                                                     >f
224         monoblock raw−    >b a c k H i t P r o t o n [ i ] = 0 ;       monoblock−>b a c k H i t P r o t o n [ i ] = 0 ;
225         monoblock raw− r o n t p r o t o n d E [ i ] = 0 ;
                              >f                                           monoblock− r o n t p r o t o n d E [ i ] = 0 ;
                                                                                     >f
226         monoblock raw−    >backprotondE [ i ] = 0 ;                    monoblock−>backprotondE [ i ] = 0 ;
227         monoblock raw− r o n t H i t A l p h a [ i ] = 0 ;
                              >f                                           monoblock− r o n t H i t A l p h a [ i ] = 0 ;
                                                                                     >f
228         monoblock raw−    >b a c k H i t A l p h a [ i ] = 0 ;         monoblock−>b a c k H i t A l p h a [ i ] = 0 ;
229         monoblock raw− r o n t a l p h a d E [ i ] = 0 ;
                              >f                                           monoblock− r o n t a l p h a d E [ i ] = 0 ;
                                                                                     >f
230         monoblock raw−    >backalphadE [ i ] = 0 ;                     monoblock−>backalphadE [ i ] = 0 ;
231         monoblock raw−    >frontHitGamma [ i ] = 0 ;                   monoblock−>frontHitGamma [ i ] = 0 ;
232         monoblock raw−    >backHitGamma [ i ] = 0 ;                    monoblock−>backHitGamma [ i ] = 0 ;
233         monoblock raw−    >frontgammadE [ i ] = 0 ;                    monoblock−>frontgammadE [ i ] = 0 ;
234         monoblock raw−    >backgammadE [ i ] = 0 ;                     monoblock−>backgammadE [ i ] = 0 ;
235         monoblock raw− r o n t H i t E l e c t r o n [ i ] = 0 ;
                              >f                                           monoblock− r o n t H i t E l e c t r o n [ i ] = 0 ;
                                                                                     >f
236         monoblock raw−    >b a c k H i t E l e c t r o n [ i ] = 0 ;   monoblock−>b a c k H i t E l e c t r o n [ i ] = 0 ;
237         monoblock raw− r o n t e l e c t r o n d E [ i ] = 0 ;
                              >f                                           monoblock− r o n t e l e c t r o n d E [ i ] = 0 ;
                                                                                     >f
238         monoblock raw−    >b a c k e l e c t r o n d E [ i ] = 0 ;     monoblock−>b a c k e l e c t r o n d E [ i ] = 0 ;
239         monoblock raw− r o n t H i t P o s i t r o n [ i ] = 0 ;
                              >f                                           monoblock− r o n t H i t P o s i t r o n [ i ] = 0 ;
                                                                                     >f
240         monoblock raw−    >b a c k H i t P o s i t r o n [ i ] = 0 ;   monoblock−>b a c k H i t P o s i t r o n [ i ] = 0 ;
241         monoblock raw− r o n t p o s i t r o n d E [ i ] = 0 ;
                              >f                                           monoblock− r o n t p o s i t r o n d E [ i ] = 0 ;
                                                                                     >f
242         monoblock raw−    >b a c k p o s i t r o n d E [ i ] = 0 ;     monoblock−>b a c k p o s i t r o n d E [ i ] = 0 ;
243   }
244
245         monoblock       raw− r o n t M u l t =0;
                                >f                                      monoblock− r o n t M u l t =0;
                                                                                  >f
246         monoblock       raw−>backMult =0;                           monoblock−>backMult =0;
247         monoblock       raw− r o n t M u l t P r o t o n =0;
                                >f                                      monoblock− r o n t M u l t P r o t o n =0;
                                                                                  >f
248         monoblock       raw− a c k M u l t P r o t o n =0;
                                >b                                      monoblock− a c k M u l t P r o t o n =0;
                                                                                  >b
249         monoblock       raw− r o n t M u l t A l p h a =0;
                                >f                                      monoblock− r o n t M u l t A l p h a =0;
                                                                                  >f
250         monoblock       raw−>backMultAlpha =0;                      monoblock−>backMultAlpha =0;
251         monoblock       raw− r o n t M u l t E l e c t r o n =0;
                                >f                                      monoblock− r o n t M u l t E l e c t r o n =0;
                                                                                  >f
252         monoblock       raw−>b a c k M u l t E l e c t r o n =0;    monoblock−>b a c k M u l t E l e c t r o n =0;
253         monoblock       raw− r o n t M u l t P o s i t r o n =0;
                                >f                                      monoblock− r o n t M u l t P o s i t r o n =0;
                                                                                  >f
254         monoblock       raw−>b a c k M u l t P o s i t r o n =0;    monoblock−>b a c k M u l t P o s i t r o n =0;
255         monoblock       raw−>frontMultGamma =0;                     monoblock−>frontMultGamma =0;
256         monoblock       raw−>backMultGamma=0;                       monoblock−>backMultGamma=0;
257
258         monoblock       raw−>sumFront =0;                           monoblock−>sumFront =0;
259         monoblock       raw−>sumBack =0;                            monoblock−>sumBack =0;
260         monoblock       raw−>sumFrontProton =0;                     monoblock−>sumFrontProton =0;
261         monoblock       raw−>sumBackProton =0;                      monoblock−>sumBackProton =0;
262         monoblock       raw−>sumFrontAlpha =0;                      monoblock−>sumFrontAlpha =0;
263         monoblock       raw−>sumBackAlpha =0;                       monoblock−>sumBackAlpha =0;
264         monoblock       raw− u m F r o n t P o s i t r o n =0;
                                >s                                      monoblock− u m F r o n t P o s i t r o n =0;
                                                                                  >s
265         monoblock       raw− u m B a c k P o s i t r o n =0;
                                >s                                      monoblock− u m B a c k P o s i t r o n =0;
                                                                                  >s
266         monoblock       raw− u m F r o n t E l e c t r o n =0;
                                >s                                      monoblock− u m F r o n t E l e c t r o n =0;
                                                                                  >s
267         monoblock       raw− u m B a c k E l e c t r o n =0;
                                >s                                      monoblock− u m B a c k E l e c t r o n =0;
                                                                                  >s
268         monoblock       raw−>sumFrontGamma=0;                       monoblock−>sumFrontGamma=0;
269         monoblock       raw−>sumBackGamma=0;                        monoblock−>sumBackGamma=0;




                                                                                     84
270
271   monoblock raw− r o n t S t r i p =100;
                    >f                          monoblock raw−>b a c k S t r i p =100;
272   monoblock raw−>maxFront =0;            monoblock raw−>maxBack =0;
273
274   monoblock− r o n t S t r i p =100;
                >f                                        monoblock−>b a c k S t r i p =100;
275   monoblock−>maxFront =0;                             monoblock−>maxBack =0;
276
277   i n p u t . r e a d ( r e i n t e r p r e t c a s t <c h a r ∗ > (&temp ) ,       s i z e o f ( unsigned      short ) ) ;
278
279   // c h e c k f o r b e g i n n i n g o f e v e n t
280   i f ( temp == 0xEEEE) {
281        i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
282        // d o u b l e c h e c k f o r b e g i n n i n g o f e v e n t
283        i f ( temp == 0xEEEE) {
284              // r e a d t h e i n i t i a l e n e r g i e s o f p o t e n t i a l s o u r c e p a r t i c l e s
285              i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
286              initial −       >P o s i t r o n E=temp ;
287              i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
288              initial −       >E l e c t r o n E=temp ;
289              i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
290              initial −       >Proton1E=temp ;
291              i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
292              initial −       >Proton2E=temp ;
293              i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
294              initial −       >Proton3E=temp ;
295              i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
296              initial −       >AlphaE=temp ;
297              i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
298              initial −       >Gamma1E=temp ;
299              i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
300              initial −       >Gamma2E=temp ;
301              i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
302              initial −       >Gamma3E=temp ;
303              i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
304              initial −       >Gamma4E=temp ;
305
306             // c h e c k f o r i o n h i t
307             i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; / /
308             i f ( temp == 0xFFF0 ) {
309                   // unpack i o n d a t a ( p a r t i c l e I D and Energy d e p o s i t e d )
310                   i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
311                   // c o u t< temp i s : ”<<temp< n d l ;
                                   <”                                  <e
312
313                  // was u s e d f o r s i n g l e S i b l o c k , but n o t f o r s t r i p s
314                  // need t o add s o m e t h i n g f a n c y i n h e r e t o e x t r a c t t h e a c t u a l p a r t i c l e I D
315                  // i f ( temp ! = 6 5 5 3 5 ) { / / i f n o t FFFF( i n HEX) / End o f Event
316                  // p a r t i c l e I D=temp ; / / temp i s a c t u a l l y t h e p a r t i c l e number i n t h i s c a s e
317                  // // c o u t<   <”&p a r t i c l e I D i s : ”<<&p a r t i c l e I D < n d l ;
                                                                                            <e
318                  // }
319
320                  // r e a d u n t i l you h i t t h e end o f t h e e v e n t (FFFF)
321                  w h i l e ( temp != 6 5 5 3 5 ) { / / e q u i v : 0xFFFF
322                       // A l l r e a d v a r i a b l e s a r e ” u n s i g n e d s h o r t ” b e c a u s e r e a d d a t a i s i n b i n a r y f o r m a t
323                       // f i r s t r e a d i s P i x e l I D , t h e n p a r t i c l e I D , t h e n . . . s e e R e s u l t s . c c ( ˜ l i n e 1 3 3 )
324                            // i n p u t . r e a d ( r e i n t e r p r e t c a s t <c h a r∗> (& p i x e l I D ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
325                            p i x e l I D=temp ;
326                            i n p u t . r e a d ( r e i n t e r p r e t c a s t <c h a r∗> (& p a r t i c l e I D ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
327                            i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&eDep ) , s i z e o f ( u n s i g n e d s h o r t ) ) ;
328
329                             f r o n t S t r i p = s t a t i c c a s t <u n s i g n e d s h o r t >( p i x e l I D / 4 0 ) +1;
330                             b a c k S t r i p = s t a t i c c a s t <u n s i g n e d s h o r t >( p i x e l I D %40) +1;
331
332                       // c o u t<<” p i x e l I D : ”<<p i x e l I D <<” p a r t i c l e I D : ”<<p a r t i c l e I D < eDep : ”<<eDep< n d l ;
                                                                                                                           <”              <e
333                       // c o u t<<” f r o n t S t r i p : ”<<f r o n t S t r i p < b a c k S t r i p ”<<b a c k S t r i p < n d l ;
                                                                                      <”                                       <e
334
335                             monoblock       raw− r o n t H i t [ f r o n t S t r i p ] = 1 ;
                                                    >f
336                             monoblock       raw−>b a c k H i t [ b a c k S t r i p ] = 1 ;
337                             monoblock       raw− r o n t d E [ f r o n t S t r i p ] +=eDep ;
                                                    >f
338                             monoblock       raw−>backdE [ b a c k S t r i p ] +=eDep ;
339
340                            e fwhm= DSSD FWHM( eDep ) ;
341                            e t h r e s h= DSSD Threshold ( e fwhm ) ;
342                            randomF = gRandom−    >Rndm ( ) ;
343                            randomB = gRandom−    >Rndm ( ) ;
344
345                             if   ( e t h r e s h > randomF ) {
346                                  monoblock− r o n t H i t [ f r o n t S t r i p ] =1;
                                                     >f
347                                  monoblock− r o n t d E [ f r o n t S t r i p ] += e fwhm ;
                                                     >f
348                            }
349
350                             if   ( e t h r e s h > randomB ) {
351                                  monoblock−      >b a c k H i t [ b a c k S t r i p ] = 1 ;




                                                                                  85
352           monoblock−          >backdE [ b a c k S t r i p ] += e fwhm ;
353       }
354       //Now r e a d t h e p a r t i c l e t y p e
355       i f ( p a r t i c l e I D ==0){
356           // c o u t< I m p l a n t i n g an p i n S t r i p : ”<<f r o n t S t r i p < w i t h E : ”<<eDep< n d l ; / / /
                           <”                                                                <”                 <e
357           monoblock raw− r o n t H i t P r o t o n [ f r o n t S t r i p ] = 1 ;
                                      >f
358           monoblock raw−          >b a c k H i t P r o t o n [ b a c k S t r i p ] = 1 ;
359           monoblock raw− r o n t p r o t o n d E [ f r o n t S t r i p ] += eDep ;
                                      >f
360           monoblock raw−          >backprotondE [ b a c k S t r i p ] += eDep ;
361
362            if   ( e t h r e s h > randomF ) {
363                 monoblock− r o n t H i t P r o t o n [ f r o n t S t r i p ] = 1 ;
                                    >f
364                 monoblock− r o n t p r o t o n d E [ f r o n t S t r i p ] += e fwhm ;
                                    >f
365            }
366            if   ( e t h r e s h > randomB ) {
367                 monoblock−      >b a c k H i t P r o t o n [ b a c k S t r i p ] = 1 ;
368                 monoblock−      >backprotondE [ b a c k S t r i p ] += e fwhm ;
369            }
370      } e l s e i f ( p a r t i c l e I D ==1){
371   //       c o u t< I m p l a n t i n g an e+ i n S t r i p : ”<<f r o n t S t r i p < w i t h E : ”<<eDep< n d l ; / / /
                       <”                                                                         <”           <e
372            monoblock raw− r o n t H i t P o s i t r o n [ f r o n t S t r i p ] =1;
                                       >f
373            monoblock raw−          >b a c k H i t P o s i t r o n [ b a c k S t r i p ] = 1 ;
374            monoblock raw− r o n t p o s i t r o n d E [ f r o n t S t r i p ] +=eDep ;
                                       >f
375            monoblock raw−          >b a c k p o s i t r o n d E [ b a c k S t r i p ] += eDep ;
376
377            if   ( e t h r e s h > randomF ) {
378                 monoblock− r o n t H i t P o s i t r o n [ f r o n t S t r i p ] =1;
                                    >f
379                 monoblock− r o n t p o s i t r o n d E [ f r o n t S t r i p ] += e fwhm ;
                                    >f
380            }
381            if   ( e t h r e s h > randomB ) {
382                 monoblock−      >b a c k H i t P o s i t r o n [ b a c k S t r i p ] = 1 ;
383                 monoblock−      >b a c k p o s i t r o n d E [ b a c k S t r i p ] += e fwhm ;
384             }
385       }
386       e l s e i f ( p a r t i c l e I D ==2){
387       // c o u t< I m p l a n t i n g an e− i n S t r i p : ”<<f r o n t S t r i p < w i t h E : ”<<eDep< n d l ; / / /
                      <”                                                                           <”        <e
388             monoblock raw− r o n t H i t E l e c t r o n [ f r o n t S t r i p ] = 1 ;
                                        >f
389             monoblock raw−          >b a c k H i t E l e c t r o n [ b a c k S t r i p ] = 1 ;
390             monoblock raw− r o n t e l e c t r o n d E [ f r o n t S t r i p ] += eDep ;
                                        >f
391             monoblock raw−          >b a c k e l e c t r o n d E [ b a c k S t r i p ] += eDep ;
392
393            if   ( e t h r e s h > randomF ) {
394                 monoblock− r o n t H i t E l e c t r o n [ f r o n t S t r i p ] = 1 ;
                                    >f
395                 monoblock− r o n t e l e c t r o n d E [ f r o n t S t r i p ] += e fwhm ;
                                    >f
396            }
397            if   ( e t h r e s h > randomB ) {
398                 monoblock−      >b a c k H i t E l e c t r o n [ b a c k S t r i p ] = 1 ;
399                 monoblock−      >b a c k e l e c t r o n d E [ b a c k S t r i p ] +=e fwhm ;
400             }
401       }
402       e l s e i f ( p a r t i c l e I D ==3){/∗
403             c o u t< I m p l a n t i n g an g i n S t r i p : ”<<f r o n t S t r i p < w i t h E : ”<<eDep< n d l ; / / /
                        <”                                                                <”                   <e
404             monoblock raw−          >frontHitGamma [ f r o n t S t r i p ] = 1 ;
405             monoblock raw−          >backHitGamma [ b a c k S t r i p ] = 1 ;
406             monoblock raw−          >frontgammadE [ f r o n t S t r i p ] += eDep ;
407             monoblock raw−          >backgammadE [ b a c k S t r i p ] += eDep ;
408
409            if   ( e t h r e s h > randomF ) {
410                 monoblock−      >frontHitGamma [ f r o n t S t r i p ] = 1 ;
411                 monoblock−      >frontgammadE [ f r o n t S t r i p ] += e fwhm ;
412            }
413            if   ( e t h r e s h > randomB ) {
414                 monoblock−      >backHitGamma [ b a c k S t r i p ] = 1 ;
415                 monoblock−      >backgammadE [ b a c k S t r i p ] += e fwhm ;
416             }∗/
417       }
418       e l s e i f ( p a r t i c l e I D ==4){
419             // c o u t< I m p l a n t i n g an a i n S t r i p : ”<<f r o n t S t r i p < w i t h E : ”<<eDep< n d l ; / / /
                           <”                                                                <”                   <e
420             monoblock raw− r o n t H i t A l p h a [ f r o n t S t r i p ] = 1 ;
                                        >f
421             monoblock raw−          >b a c k H i t A l p h a [ b a c k S t r i p ] = 1 ;
422             monoblock raw− r o n t a l p h a d E [ f r o n t S t r i p ] += eDep ;
                                        >f
423             monoblock raw−          >backalphadE [ b a c k S t r i p ] += eDep ;
424
425            if   ( e t h r e s h > randomF ) {
426                 monoblock− r o n t H i t A l p h a [ f r o n t S t r i p ] = 1 ;
                                    >f
427                 monoblock− r o n t a l p h a d E [ f r o n t S t r i p ] += e fwhm ;
                                    >f
428            }
429            if   ( e t h r e s h > randomB ) {
430                 monoblock−      >b a c k H i t A l p h a [ b a c k S t r i p ] = 1 ;
431                 monoblock−      >backalphadE [ b a c k S t r i p ] += eDep ;
432            }
433       }




                                                          86
434
435   //now add t o m u l t i p l i c i t i e s and sums f o r DSSD ’ s 40 s t r i p s
436   f o r ( i n t i =0; i <41; i ++){
437        monoblock raw− r o n t M u l t += monoblock raw− r o n t H i t [ i ] ;
                             >f                                    >f
438        monoblock raw−    >backMult += monoblock raw−          >b a c k H i t [ i ] ;
439        monoblock raw−    >sumFront += monoblock raw− r o n t d E [ i ] ;
                                                                  >f
440        monoblock raw−    >sumBack += monoblock raw−          >backdE [ i ] ;
441
442       e fwhm = DSSD FWHM( monoblock raw− r o n t d E [ i ] ) ;
                                                    >f
443       e t h r e s h = DSSD Threshold ( e fwhm ) ;
444       random = gRandom−       >Rndm ( ) ;
445       i f ( e t h r e s h > random ) {
446           monoblock− r o n t M u l t += monoblock raw− r o n t H i t [ i ] ;
                              >f                             >f
447           monoblock−      >sumFront += e fwhm ;
448       }
449       e fwhm = DSSD FWHM( monoblock raw−        >backdE [ i ] ) ;
450       e t h r e s h = DSSD Threshold ( e fwhm ) ;
451       random = gRandom−       >Rndm ( ) ;
452       i f ( e t h r e s h > random ) {
453           monoblock−      >backMult += monoblock raw−  >b a c k H i t [ i ] ;
454           monoblock−      >sumBack += e fwhm ;
455       }
456
457       monoblock     raw− r o n t M u l t P r o t o n += monoblock raw− r o n t H i t P r o t o n [ i ] ;
                            >f                                            >f
458       monoblock     raw− a c k M u l t P r o t o n += monoblock raw−
                            >b                                           >b a c k H i t P r o t o n [ i ] ;
459       monoblock     raw−>sumFrontProton += monoblock raw− r o n t p r o t o n d E [ i ] ;
                                                                         >f
460       monoblock     raw−>sumBackProton += monoblock raw−            >backprotondE [ i ] ;
461
462       monoblock     raw− r o n t M u l t P o s i t r o n += monoblock raw− r o n t H i t P o s i t r o n [ i ] ;
                            >f                                                 >f
463       monoblock     raw−>b a c k M u l t P o s i t r o n += monoblock raw−>b a c k H i t P o s i t r o n [ i ] ;
464       monoblock     raw− u m F r o n t P o s i t r o n += monoblock raw− r o n t p o s i t r o n d E [ i ] ;
                            >s                                                >f
465       monoblock     raw− u m B a c k P o s i t r o n += monoblock raw−
                            >s                                               >b a c k p o s i t r o n d E [ i ] ;
466
467       monoblock     raw− r o n t M u l t E l e c t r o n += monoblock raw− r o n t H i t E l e c t r o n [ i ] ;
                            >f                                                 >f
468       monoblock     raw−>b a c k M u l t E l e c t r o n += monoblock raw−>b a c k H i t E l e c t r o n [ i ] ;
469       monoblock     raw− u m F r o n t E l e c t r o n += monoblock raw− r o n t e l e c t r o n d E [ i ] ;
                            >s                                                >f
470       monoblock     raw− u m B a c k E l e c t r o n += monoblock raw−
                            >s                                               >b a c k e l e c t r o n d E [ i ] ;
471
472       monoblock     raw− r o n t M u l t A l p h a += monoblock raw− r o n t H i t A l p h a [ i ] ;
                            >f                                          >f
473       monoblock     raw−>backMultAlpha += monoblock raw−           >b a c k H i t A l p h a [ i ] ;
474       monoblock     raw−>sumFrontAlpha += monoblock raw− r o n t a l p h a d E [ i ] ;
                                                                       >f
475       monoblock     raw−>sumBackAlpha += monoblock raw−           >backalphadE [ i ] ;
476
477       monoblock     raw−>frontMultGamma += monoblock raw−>frontHitGamma [ i ] ;
478       monoblock     raw−>backMultGamma += monoblock raw−>backHitGamma [ i ] ;
479       monoblock     raw−>sumFrontGamma += monoblock raw−>frontgammadE [ i ] ;
480       monoblock     raw−>sumBackGamma += monoblock raw−>backgammadE [ i ] ;
481
482
483       monoblock− r o n t M u l t P r o t o n += monoblock− r o n t H i t P r o t o n [ i ] ;
                    >f                                        >f
484       monoblock− a c k M u l t P r o t o n += monoblock−
                    >b                                       >b a c k H i t P r o t o n [ i ] ;
485       monoblock−>sumFrontProton += monoblock− r o n t p r o t o n d E [ i ] ;
                                                             >f
486       monoblock−>sumBackProton += monoblock−            >backprotondE [ i ] ;
487
488       monoblock− r o n t M u l t P o s i t r o n += monoblock− r o n t H i t P o s i t r o n [ i ] ;
                    >f                                             >f
489       monoblock−>b a c k M u l t P o s i t r o n += monoblock−>b a c k H i t P o s i t r o n [ i ] ;
490       monoblock− u m F r o n t P o s i t r o n += monoblock− r o n t p o s i t r o n d E [ i ] ;
                    >s                                            >f
491       monoblock− u m B a c k P o s i t r o n += monoblock−
                    >s                                           >b a c k p o s i t r o n d E [ i ] ;
492
493       monoblock− r o n t M u l t E l e c t r o n += monoblock− r o n t H i t E l e c t r o n [ i ] ;
                    >f                                             >f
494       monoblock−>b a c k M u l t E l e c t r o n += monoblock−>b a c k H i t E l e c t r o n [ i ] ;
495       monoblock− u m F r o n t E l e c t r o n += monoblock− r o n t e l e c t r o n d E [ i ] ;
                    >s                                            >f
496       monoblock− u m B a c k E l e c t r o n += monoblock−
                    >s                                           >b a c k e l e c t r o n d E [ i ] ;
497
498       monoblock− r o n t M u l t A l p h a += monoblock− r o n t H i t A l p h a [ i ] ;
                    >f                                      >f
499       monoblock−>backMultAlpha += monoblock−           >b a c k H i t A l p h a [ i ] ;
500       monoblock−>sumFrontAlpha += monoblock− r o n t a l p h a d E [ i ] ;
                                                           >f
501       monoblock−>sumBackAlpha += monoblock−           >backalphadE [ i ] ;
502
503       monoblock−>frontMultGamma += monoblock−>frontHitGamma [ i ] ;
504       monoblock−>backMultGamma += monoblock−>backHitGamma [ i ] ;
505       monoblock−>sumFrontGamma += monoblock−>frontgammadE [ i ] ;
506       monoblock−>sumBackGamma += monoblock−>backgammadE [ i ] ;
507
508   }// end l o o p   for   multiplicities        and sums
509
510   // l o o p o v e r s t r i p s t o s e e where t h e most e n e g e r y was d e p o s i t e d
511   // − − > p r e s u m a b l y t h i s would h e l p f i n d t h e p o i n t o f an i m p l a n t
             − −
512   f o r ( i n t i =0; i <41; i ++){
513         i f ( monoblock− r o n t d E [ i ] > maxF) {
                                  >f
514             maxF = monoblock− r o n t d E [ i ] ;
                                          >f
515             stripF = i ;




                                                 87
516                                          }
517                                          if   ( monoblock−     >backdE [ i ] > maxB) {
518                                               maxB = monoblock−      >backdE [ i ] ;
519                                               s t r i p B= i ;
520                                          }
521                                     }
522
523                                     monoblock           raw− r o n t S t r i p = s t r i p F ;
                                                                >f
524                                     monoblock           raw−>b a c k S t r i p= s t r i p B ;
525                                     monoblock           raw−>maxFront=maxF ;
526                                     monoblock           raw−>maxBack =maxB ;
527
528                                     monoblock− r o n t S t r i p = s t r i p F ;
                                                  >f
529                                     monoblock−>b a c k S t r i p = s t r i p B ;
530                                     monoblock−>maxFront = maxF ;
531                                     monoblock−>maxBack = maxB ;
532
533                                 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) ,     s i z e o f ( unsigned     short ) ) ;
534                          }
535                      }// end     I f temp=0xFFF0
536
537                      // r e a d end o f e v e n t marker and add t o e v e n t c o u n t s
538                      i f ( temp == 0xFFFF) {
539                           e v e n t s ++;
540                           i f ( e v e n t s %10000 == 0 ) {
541                                 // c o u t << ” P r o c e s s e d ” << e v e n t s <<” e v e n t s . ”<<e n d l ;
542                           }
543                           // r e a d s e c o n d end o f e v e n t marker
544                           i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d   short ) ) ;
545                      }
546                 }
547            }
548                                // i f ( p a r t i c l e I D != 9 9 9 9 ) {
549                                // c o u t<<”# # # # # # # # # # #
                                                  # # # # # # # # # # ECHO # # # # # # # # # # # # #
                                                                                               # # # # # # # # # # # # # #”<<e n d l ;
550                                // c o u t<<” p i x e l I D : ”<<p i x e l I D <<” p a r t i c l e I D : ”<<p a r t i c l e I D < eDep : ”<<eDep< n d l ;
                                                                                                                                    <”              <e
551                                // c o u t<<” f r o n t S t r i p : ”<<f r o n t S t r i p < b a c k S t r i p ”<<b a c k S t r i p < n d l ;
                                                                                               <”                                       <e
552                                // c o u t<<”# # # # # # # # # N ECHO # # # # # # # # # # # # #”<<e n d l ;
                                                  # # # # # # # #E D                           # # # # # # # # # # # # #
553                                //}
554                           // i f ( monoblock− r o n t H i t E l e c t r o n [ 2 1 ] != 0 ) {
                                                          >f
555                           // c o u t< Here f o r s t r i p 2 0 , F r o n t e− h i t : ”<<monoblock− r o n t H i t E l e c t r o n [21] < < ” f r o n t d E e−”<<monoblock−
                                         <”                                                                                  >f
556                           //}
557
558             tree− F i l l ( ) ;
                         >
559             p o s i t i o n = input . t e l l g ( ) ;
560        }
561
562        // c l o s e i n p u t and o u t p u t f i l e s ; d e l e t e    headers
563        c o u t << ”TaDa ! f i n i s h e d . ” << e n d l ;
564
565        tree−>Print ( ) ;
566        input . close ( ) ;
567        f−>Write ( ) ;
568        delete tree ;
569        delete f ;
570   };




                                                                                          88
Curriculum Vitae

National Superconducting Cyclotron Laboratory               Phone: (440) 242-5034
Michigan State University                                   email: meiselza@msu.edu
1 Cyclotron Lab
East Lansing, MI 48824



Education
                           Michigan State University (8/2006-Present)
                           Astrophysics Bachelor of Science
                           Director of Thesis Research: Dr. Hendrik Schatz
                           Current G.P.A.: 3.79/4.00

Fellowships and Awards
                           DOE Office of Science Graduate Student Fellowship Finalist (4/2010)
                           Carl L. Foiles Award, Michigan State University Physics & As-
                           tronomy Department (4/2010)
                           Travel and Lodging Grant, Division of Nuclear Physics Annual
                           Meeting (9/2009)
                           Lawrence W. Hantel Endowed Fellowship, Michigan State Uni-
                           versity Physics & Astronomy Department (11/2008)
                           Travel and Lodging Grant, Division of Nuclear Physics Annual
                           Meeting (9/2008)
                           Honors College National Scholarship, Michigan State University
                           (2006-2010)
Research Experience
                           Research Assistant, National Superconducting Cyclotron Labo-
                           ratory (12/2007-Present)
                           Studied nucleosynthesis, explosive stellar environments, and re-
                           action rate measurement under the guidance of Dr. Hendrik
                           Schatz. Studied nuclear reaction rate parameterization under
                           the guidance of Dr. Richard Cyburt.



                                          89
Research Assistant, Lyman Briggs College at Michigan State Uni-
                    versity (12/2006-7/2007)
                    Studied the history of invisible ink under the guidance of Dr.
                    Kristie Macrakis.

Publications
                    Richard Cyburt, A.M. Amthor, R. Ferguson, A. Heger, R. Hoff-
                    man, Z. Meisel, T. Rauscher, A. Sakharuk, H. Schatz, K. Smith,
                    S. Warren, F.-K. Thielemann, M. Wiescher, and S.E. Woosley.
                    “THE JINA REACLIB Database, its recent updates and impact
                    on Type-I X-ray Bursts”
                    Under review by the Astrophysical Journal Supplement Series

                    A. Matthew Amthor, Karl Smith, R. Cyburt, A. Heger, E. John-
                    son, M. Klein, Z. Meisel, T. Rasucher, A. Sakharuk, H. Schatz,
                    F.-K. Thielemann, S. Warren, and M. Wiescher.
                    “Sensitivity of X-ray Burst Models to Uncertainties in Nuclear
                    Processes”
                    In preparation

                    Zachary Meisel, Richard Cyburt, A.M. Amthor, R. Ferguson,
                    J. Fisker, A. Heger, E. Johnson, T. Rauscher, A. Sakharuk, H.
                    Schatz, K. Smith, F.-K. Thielemann, S. Warren, and M. Wi-
                    escher.
                    “The rp-process in Type-I X-ray Bursts with REACLIB V1.0”
                    Proceedings for Nuclei in the Cosmos X Symposium. (7/2008)

Posters and Talks
                    Zachary Meisel, H. Crawford, G. Lorusso, P. Mantica, A. Morton,
                    J. Periera, J. Priscindaro, M. del Santo, and H. Schatz
                    “Simulations for Silicon Strip Detector Calibration and Code
                    Comparison”
                    Poster presented at the American Physical Society/Japan Physi-
                    cal Society Joint Meeting of the Division of Nuclear Physics, Big
                    Island, Hawaii. (10/2009)

                    Zachary Meisel
                    “Detector Response Simulations Using MCNPX and GEANT4”
                    Talk given at the Nuc-Astro Graduate Student Conference, Chapel
                    Hill, North Carolina. (9/2009)

                    Zachary Meisel, R. Cyburt, A. Estrade, R. Ferguson, A. Sakharuk,


                                   90
H. Schatz, K. Smith, F.-K. Thielemann, S. Warren, and M. Wi-
                         escher.
                         “REACLIB: A Reaction Rate Library for the Era of Collabora-
                         tive Science”
                         Poster presented at the American Physical Society Division of
                         Nuclear Physics Annual Meeting, Oakland, California. (10/2008)

                         Zachary Meisel, Richard Cyburt, A.M. Amthor, R. Ferguson,
                         A. Heger, R. Hoffman, T. Rauscher, A. Sakharuk, H. Schatz,
                         K. Smith, S. Warren, F.-K. Thielemann, M. Wiescher, and S.E.
                         Woosley.
                         “The rp-process in Type-I X-ray Bursts with REACLIB V1.0”
                         Poster presented at the 10th Symposium on Nuclei in the Cosmos,
                         Mackinaw Island, Michigan. (7/2008)

Memberships/Affiliations
                         Joint Institute for Nuclear Astrophysics

                         Sigma Pi Sigma, National Physics Honor Society

                         American Physical Society

                         Society of Physics Students of the American Institute of Physics

                         Mortar Board National College Honor Society, Michigan State
                         Chapter




                                        91

BachelorsThesis

  • 1.
    c Copyright byZachary Paul Meisel, 2010
  • 2.
    Simulation of SiliconDetector Response for 69 Kr β-Delayed Proton Emission by Zachary Paul Meisel THESIS Submitted in partial fulfillment of the requirements for the degree of Bachelors of Science of Astrophysics in the College of Natural Science of Michigan State University, 2010 East Lansing, Michigan
  • 3.
    Simulation of SiliconDetector Response for 69 Kr β-Delayed Proton Emission Zachary Paul Meisel Department of Physics and Astronomy Michigan State University, 2010 Hendrik Schatz, Director of Thesis Research Modern nuclear astrophysics experiments rely on simulations to ensure accurate and efficient data interpretation. Here Monte Carlo simulations have been performed using the simulation packages MCNPX, GEANT4, and CASINO to aid in the identification of 69 decay branches in the β-delayed proton emission of Kr. Information regarding these 68 branches will be used to determine a proton-capture Q-value for Se to determine its impact as a waiting point in the astrophysical rapid proton-capture (rp-)process. It is well known that waiting points in the rp-process, the dominant mechanism of nucleosynthesis in type-I x-ray bursts, dominate many of the features of the burst’s light curves. Thus 68 information on Se will help advance our understanding of this cosmic phenomenon. iii
  • 4.
  • 5.
    Acknowledgments This work wascompleted with support from the Physics and Astronomy department at Michigan State University, and from the National Science Foundation grants PHY02- 16783(JINA) and PHY01-10253(NSCL). Much thanks to my research advisor Hendrik Schatz. He has provided me with many unique opportunities to present and discuss my research and has also connected me with a superior group of research scientists. I am also greatly indebted to Richard Cyburt and Karl Smith, each of whom have provided much needed mentoring over the last two years. Additional thanks are certainly due to Marcelo del Santo, Heather Crawford, and Giuseppe Lorusso for helping me with difficulties I encountered in creating my simulations and to Ana Becerril, Fernando Montes, and Sebastian George for useful discussions. v
  • 6.
  • 7.
    Contents Acknowledgments v Foreward xiii 1 Introduction to the Study of Nuclear Reactions 1 1.1 The Study of Proton-Rich Nuclei . . . . . . . . . . . . . . . . . . . . . . 3 1.2 The Study of 69 Kr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 Importance of Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 Astrophysical Motivation 9 2.1 X-Ray Bursts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.2 RP-Process and Its Waiting Points . . . . . . . . . . . . . . . . . . . . . 13 3 Simulation Packages 15 3.1 MCNPX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.2 GEANT4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.3 CASINO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4 Verification and Validation of Simulations 25 4.1 Verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.2 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.2.1 Validation Experiment: 207 Bi Calibration Source . . . . . . . . . . 28 4.2.2 Replication via Simulation . . . . . . . . . . . . . . . . . . . . . . 29 4.2.3 Comparison Between Simulation and Experiment . . . . . . . . . 30 4.3 Potential Further Verification and Validation . . . . . . . . . . . . . . . . 31 5 Prediction of Experimental Results 35 5.1 69 Kr Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 5.2 Simulation and Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.3 Future Use of Simulations for Data Analysis . . . . . . . . . . . . . . . . 38 vii
  • 8.
    Bibliography 41 Appendix: Code 45 5.4 MCNPX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 5.5 GEANT4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 5.5.1 Driver and Compact Macro . . . . . . . . . . . . . . . . . . . . . 47 5.5.2 Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.5.3 EventAction.hh . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.5.4 experimentalHall.hh . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.5.5 experimentalhall Messenger.hh . . . . . . . . . . . . . . . . . . . . 49 5.5.6 Materials.hh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 5.5.7 ME2bDetectorConstruction.hh . . . . . . . . . . . . . . . . . . . . 51 5.5.8 ME2bPhysicsList.hh . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.5.9 ME2bPrimaryGeneratorAction.hh . . . . . . . . . . . . . . . . . . 52 5.5.10 PixelParameterisation.hh . . . . . . . . . . . . . . . . . . . . . . . 53 5.5.11 Results.hh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 5.5.12 RunAction.hh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.5.13 SiBlock.hh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 5.5.14 SiBlock Messenger.hh . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.5.15 SourceData.hh . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 5.5.16 SteppingAction.hh . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.5.17 SteppingVerbose.hh . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.5.18 TrackerIonHit.hh . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 5.5.19 TrackerIonSD.hh . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 5.5.20 TrackerIonSD Messenger.hh . . . . . . . . . . . . . . . . . . . . . 59 5.5.21 VisManager.hh . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 5.5.22 Source Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 5.5.23 EventAction.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 5.5.24 experimentalHall.cc . . . . . . . . . . . . . . . . . . . . . . . . . . 61 5.5.25 exerimentalHall Messenger.cc . . . . . . . . . . . . . . . . . . . . 61 5.5.26 Materials.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 5.5.27 ME2bDetectorConstruction.cc . . . . . . . . . . . . . . . . . . . . 62 5.5.28 ME2bPhysicsList.cc . . . . . . . . . . . . . . . . . . . . . . . . . . 64 5.5.29 ME2bPrimaryGeneratorAction.cc . . . . . . . . . . . . . . . . . . 66 5.5.30 PixelParameterisation.cc . . . . . . . . . . . . . . . . . . . . . . . 69 5.5.31 Results.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 5.5.32 RunAction.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 5.5.33 SiBlock.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 5.5.34 SiBlock Messenger.cc . . . . . . . . . . . . . . . . . . . . . . . . . 74 5.5.35 SteppingAction.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 viii
  • 9.
    5.5.36 SteppingVerbose.cc . . . . . . . . . . . . . . . . . . . . . . . . . . 75 5.5.37 TrackerIonHit.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 5.5.38 TrackerIonSD.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 5.5.39 TrackerIonSD Messenger.cc . . . . . . . . . . . . . . . . . . . . . 79 5.5.40 VisManager.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 5.5.41 Sort to Root . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Curriculum Vitae 89 ix
  • 10.
  • 11.
    List of Figures 1.1 Chart of nuclides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Proposed level scheme 69 Br. . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 NSCL Cyclotrons and A1900 Fragment Separator. . . . . . . . . . . . . . 6 1.4 Produced nuclei expected to reach the detector setup. . . . . . . . . . . . 7 2.1 The Crab Nebula as seen from the Hubble Space Telescope. . . . . . . . 10 2.2 Stellar evolution possibilities. . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3 Artist’s conception of an accreting binary system. . . . . . . . . . . . . . 12 3.1 A minimalistic MCNPX simulation input file. . . . . . . . . . . . . . . . 16 4.1 Near identical initial conditions used for verification simulations. . . . . . 27 4.2 General agreement between MCNPX and GEANT4 verification simulations. 28 4.3 Evidence 976MeV e− can be stopped in 500µm of Si. . . . . . . . . . . . 29 4.4 Engineering drawing of Beta Counting Station[52] . . . . . . . . . . . . . . 30 4.5 Formula and schematic for Compton scattering. . . . . . . . . . . . . . . 31 4.6 Experimental data and GEANT4 simulation comparison for validation. . 32 4.7 Unphysical behavior by MCNPX when simulating an e− in a single Si strip. 33 5.1 Experimental set up for experiment 07025 at the NSCL. . . . . . . . . . 36 5.2 Characteristics of a 14MeV Q-value β + -decay. . . . . . . . . . . . . . . . 38 69 5.3 Summing effect for IAS and proposed ground state decay branch for Kr β-delayed proton emission (blue=proton, red=sum). . . . . . . . . . . . . 39 5.4 Closeup of the summing effect for simulated decay branches. . . . . . . . 40 xi
  • 12.
  • 13.
    Foreward This paper is likely to have readers with various backgrounds in nuclear astrophysics, thus some of the following chapters may be of more interest to a given reader than others. It is the author’s belief that these readers will be of three types: the non-physicist looking for an example of an undergraduate’s contribution to the field of nuclear astrophysics, the undergraduate or early graduate student in physics whose task it may be to simulate silicon detector response, and the specialist who requires information on the simulations performed for the NSCL’s experiment 07025. Chapters 1 and 2 are aimed at the first class of reader, though the remaining chapters should still be comprehensible. The second class of reader may use the first two chapters as a refresher and pay more attention to the remaining text, where the most valuable sections will likely be chapter 3 and the appendix. The third class of reader will most likely be interested only in chapters 4 and 5 as well as the appendix. However these are only suggestions and each section should hopefully be comprehensible and perhaps enlightening to the majority of readers. xiii
  • 14.
  • 15.
    Chapter 1 Introduction tothe Study of Nuclear Reactions Nuclear physics strives to understand the nuclei of the elements that make up our uni- verse. The study of nuclear reactions strives to understand how these nuclei interact. A convenient context in which we speak of nuclei is the chart of nuclides, also known as a Segr` chart, which is shown in Figure 1.1[1] . The x-axis denotes neutron number e N , the y-axis denotes proton number Z, and the combination of these two gives us the atomic mass A = Z + N . Using these numbers we refer to a nucleus with a given symbol S with the notation A SN . For example, the ultimate nucleus of interest in this study, Z Selenium-68 (A = 68, Z = 34, N = 34), is denoted by 68 Se34 . 34 To describe nuclear reactions, or interactions between nuclei and leptons, we incorpo- rate our notation for individual nuclei. In a nuclear reaction, the participating particles that interact are the reactants and the resultant particles after the reaction are the products. A convenient way to write the reaction is reactants −→ products. For this study we’ll deal with one or two reactants and two or three products, so instead the reaction looks something like A + B −→ C + D. Then, to save space, we condense this notation by placing the heavier reactant and the heavier product, i.e. the nuclei, on the outside of a set of parentheses and place the lighter reactant and product on the inside of these parentheses, separated by a comma. So, our fictitious equation above now looks like, A(B, C)D. Often times we will refer to the outside reactant as the target and the inside reactant as the beam, but in the context 1
  • 16.
    Figure 1.1: Chartof nuclides of a stellar environment it does not really matter which reactant gets which label. In the physical process that occurs in an astrophysical environment, all that matters is that the reactants interact to produce the products. The main factors which control whether or not a nuclear reaction will occur are the temperature of the environment and the density of reactants in the environment. A multitude of nuclear reactions are often possible in similar conditions, meaning that they can occur simultaneously. Thus, we could imagine a situation where our fictitious reactants A and B can interact along side product C interacting with some other reactant E. A + B −→ C + D C + E −→ F + G It doesn’t take much of an extension of this idea to realize that whole networks can form, depleting nuclei of lower mass to build nuclei of higher mass, absorbing and re- leasing energy along the way. Many such networks exist in astrophysical environments. The reaction network of interest in this study is the rapid proton-capture (rp-)process. In the rp-process successively heavier nuclei capture protons (p), releasing energy in the form of photons (γ). Whenever a nucleus is created that deviates too much from stability (N = Z for light nuclei), indicated by the black squares in Figure 1.1, this nucleus undergoes β + decay, where one of its protons changes to a neutron, a positron (e+ ), and an electron neutrino (νe ). One such piece of the rp-reaction chain looks like [33] 2
  • 17.
    34 Cl + p −→ 35 Ar + γ 35 Ar + p −→ 36 K + γ 36 K + p −→ 37 Ca + γ 37 Ca −→ 37 K + e+ + νe . If the above proton capture reactions are faster than decays on the respective nuclei then the process can create so called neutron deficient (a.k.a. proton-rich nuclei). Hence the name “rapid” proton-capture process. 1.1 The Study of Proton-Rich Nuclei When classifying nuclei each falls into one of three general classes: stable, proton-rich, or neutron-rich. As you might expect, proton-rich nuclei have more protons than a stable nucleus of the same mass A and neutron-rich nuclei have more neutrons than a stable nucleus of mass A. This begs the question, what makes a nucleus stable? While the nature of stability is much too complicated to be discussed here, it is worthwhile to briefly consider the simple model for a nucleus. In this model protons and neutrons, generically known as nucleons, are bound together via the strong force, which is roughly 100 times stronger than the Coulomb force that causes protons to repel each other. The bound nucleons must obey the Pauli principle. That is, since they have half-integer quantum spin, they cannot simultaneously occupy the same spatial and spin state[3] . Then if space were at a premium, as in a nucleus, it makes sense that it would be highly efficient, i.e. energetically favorable, to pair protons and neutrons. This pairing is observed as a tendency for the line of nuclear stability to stay near N = Z [4] . Keeping in mind that charged protons repel each other due to the Coulomb force, it would be expected that at large A more neutrons are added. As a consequence of the previously stated criterion for a bound nucleus, there are far fewer proton-rich nuclei than neutron-rich nuclei. But this does not mean proton-rich nuclei are not interesting. Proton-rich nuclei are the nuclei which are created in explosive hydrogen burning events, as will be explained in Chapter 2. Hence, it is these nuclei that we must study if we are to understand the astrophysical events in which explosive hydrogen burning occurs. While many proton-rich nuclei are created and participate in the rp-process, it would be incredibly time consuming to study them all. So, given guidance from theoretical nuclear astrophysicists, experimental nuclear astrophysicists set out to measure the nuclei of particular importance. More information will be given in Chapter 2 as to which nuclei are important in the rp-process, but for the moment we can just refer to these as waiting points. Waiting points, as the name indicates, are nuclei that delay the flow of the rp-process. This study will contribute information to the task of finding out how slow one of these waiting points, that of 68 Se, is. Though there are theoretical predictions, experiment is needed 3
  • 18.
    69 Figure 1.2: Proposed level scheme Br. to verify or falsify the theory. The experiment which this study simulates will add one piece of the required experimental input. 69 1.2 The Study of Kr 69 Kr (Kr is the symbol for Krypton) is not itself a waiting point nucleus for the rp- process, but it is key in studying the proton capture of 68 Se. It might then be surprising that a quick reference of the chart of nuclides, or the periodic table, reveals that the nucleus one unit of Z greater than Selenium’s Z = 34 is Bromine (Br) with Z = 35, and not Krypton (Z = 36). However, recalling that proton capture is a process which transforms nuclei as A SN −→ A+1 TN , it becomes apparent that proton-capture on 68 Se Z Z+1 creates the (likely) proton-unbound 69 Br[5] . Note that proton capture by 68 Se is still of interest because reaction rate timescales are short enough in the explosive astrophysical environments in which the rp-process occurs to allow 69 Br to capture a proton before it expels the initially captured proton. Being that 69 Br is too short-lived to allow for study in the lab[6] , we instead exploit a fortuitous characteristic of 69 Kr. To the advantage of experimental nuclear astrophysi- cists, 69 Kr undergoes β + -decay to become 69 Br. The decay product is so short-lived, that the entire decay chain, 69 Kr−→ e+ + νe + 69 Br−→ 68 Se+p is referred to as the β-delayed proton emission of 69 Kr. In a way that will be outlined in Chapter 5, the light charged products of this decay chain, e+ and p, are detected with relative ease. When 69 Kr undergoes β + -decay, it does not necessarily populate the ground state of 69 Br. The “state” refers to the total energy of nucleons within the nucleus. A higher state has more energy. The binding energy, or energy per nucleon, varies from nucleus to nucleus. We can determine this energy from a level scheme and, consequently, determine possible relevant decays. One possible level scheme for 69 Br is shown in Figure 1.2 [7] . Here the arrows from 69 Kr to levels in 69 Br represent positron emissions of different 4
  • 19.
    energies and thearrows from 69 Br levels to 68 Se represent proton emissions of different energies. It should be noted that of the shown 69 Br levels, only that labeled IAS is confirmed to exist[5] . In the experiment which this study (described in more detail in Chapter 5) simulates, the goal is to identify other levels in 69 Br. Due to experimental limitations, Xu et al. were only able to identify β-delayed proton emission involving 69 Br’s isobaric analog state (IAS). As the study was forced to look at a small range in proton energy, they chose to look at energies that corresponded to the IAS. This is because the majority of β-decays tend to populate the IAS due to its similar level structure [8] , and indeed Xu et al. were able to determine 83% of 69 Kr decays populated the IAS. Therefore, other β-decay branches, and consequently other proton emission branches, can be expected to occur in the β-delayed proton emission of 69 Kr. Why not be satisfied with the known decay branch, since it is so dominant? This is answered simply by relating the excitation energy E of the IAS to its respective tempera- ture T using the well known relation E ∼ kT , where k is Boltzmann’s constant. Inserting the IAS energy of 4.07MeV (MeV = 1 million electron-volts) provides the rough astro- physical temperature necessary to populate this state: T ∼ 1 × 1010 Kelvin. This over 10 times the typical temperature associated with expected rp-process sites[9] , as shown in Chapter 2. Given the previously stated information about the levels in 69 Br it is appar- ent that the levels of interest will be at energies below the IAS and that these levels will scarcely be populated. More details on the experimental set-up are given in Chapter 5. 1.3 Importance of Simulations If we could isolate a single 69 Kr nucleus, observe it decay to 69 Br, and then collect the proton with our detector system, and repeat this process many times over, then identifying new proton branches would be somewhat trivial. However this simple picture is far from reality. The first detail to be considered is the time between 69 Kr decaying to 69 Br and 69 Br emitting a proton. The second concerns the process by which 69 Kr is produced and delivered to the detector system. As was stated in the previous subsection, 69 Br is proton-unbound. This means that, upon coming into existence, it almost immediately expels a proton. The only information on the lifetime of 69 Br is its non-observation, so that its half-life has an upper limit of t 1 < 24 nanoseconds[10] . This means that a positron is emitted and detected in our 2 detector system and, on average, less than 24ns later a proton is emitted and detected. However, the time for the electronics to process information on particles detected so that the information (e.g. the energy they deposited) can be recorded is of the order of microseconds[11] . So we must instead gather the information on the positron and the proton at the same time. This leads to a summing effect that effectively shifts the proton 5
  • 20.
    Figure 1.3: NSCLCyclotrons and A1900 Fragment Separator. energy peak to higher energies. In order to correct for the β summing effect, simulations are required to evaluate its impact. Once the shift in the energy distribution peak is determined, we will be able to more accurately determine the energy of protons emitted in various decay branches. Further complications arise due to the 69 Kr production process. Since 69 Kr has a half- life of 32ms[10] , it must be produced just prior to implantation in the detector system. The process in which it is produced is called fragmentation. In fragmentation a heavy isotope, here 72 Kr, is accelerated as the primary beam and collided into a production target, here Beryllium. These collisions produce many different kinds of isotopes, occa- sionally producing our nucleus of interest. A series of magnets, here the A1900 Fragment Separator (See Figure 1.3[30] ) then separates out the nucleus of interest, but often the process is imperfect and other nuclei make it to the detector system. The simulation will only simulate the processes of interest, i.e. β-delayed proton emission, thus it should help in discerning relevant data from the whole. One may wonder how it can be known that simulations are accurately reproducing the physical conditions of the experiment. This subject is discussed some in Chapter 3 and at length in Chapter 4. The main simulation of this project and the experiment it simulates are detailed in Chapter 5. How this simulation will be used to aid in the interpretation of the experimental results follows this in Chapter 6. 6
  • 21.
    Figure 1.4: Producednuclei expected to reach the detector setup. 7
  • 22.
  • 23.
    Chapter 2 Astrophysical Motivation Sinceancient times humans have been intrigued by the lights that illuminate their night’s sky. For those observing before the invention of telescope, these objects were simply unchanging points that were static with respect to each other. Once in a very long while a new light would appear, often shining throughout the day, and then slowly fade out of existence. The Crab Nebula (see Figure 2.1[15] ) is a well known example of one of these transient lights in the night sky that the Chinese observed in 1054AD. These occurrences offered the first clues that these lights were much more than decorations on the ceiling of the celestial sphere. With the invention of the telescope astronomers were able to analyze the lights of our night sky more detail. The introduction of the fields of spectroscopy, the study of light’s interaction with matter as a function of wavelength, and spectrometry, the study of the creation and absorption of light due to atomic and nuclear structure, empowered astronomers with the quantitative capabilities they have today. Applying these two disciplines, Suess and Urey [16] were able to determine the relative abundances of the nuclei in our solar system. One year later Burbidge, Burbidge, Fowler, and Hoyle[17] , and separately Cameron[18] , used this information and that from the then 20 year old field of nuclear physics to propose how all of the nuclei in the universe were synthesized. Thus nuclear astrophysicists were provided one of the major foundations of the field. Nuclear astrophysics studies the synthesis of elements in stars and stellar environ- ments and their dispersion into the interstellar medium. It provides us with unique insight into the building blocks of nature, allowing us to study nuclei in environments that are only marginally reproducible on earth. Volumes could be (and have been) filled on the many nucleosynthesis sites extant in our universe, but the remaining discussion will focus on the main site that is pertinent to this study. This is the astrophysical site known as a type-I x-ray burst. 9
  • 24.
    Figure 2.1: TheCrab Nebula as seen from the Hubble Space Telescope. 2.1 X-Ray Bursts Type-I x-ray bursts are frequently recurring thermonuclear (driven by temperature de- pendent nuclear reactions) explosions on the surface of an accreting neutron star’s crust[19] . They were first observed in the early to mid-1970s [20][21] , characterized by a steady peak flux of light in the x-ray region (0.01nm ≤ λ ≤ 10nm) with an occasional sharp rise in luminosity followed by an exponential decay. Astrophysics theorist produced sugges- tions as to their underlying cause shortly after a multitude of these observations were published[22][23][24] . The essence of these models involves a binary star system in which a neutron star and a main sequence or giant star revolve around each other, as in Figure 2.3. A neutron star is an extremely dense body, mostly composed of neutrons, left behind from a massive star’s core-collapse explosion, known a type-II supernova. Main sequence stars synthesize helium from hydrogen in their cores, but are mostly hydrogen. Giant stars have evolved off the main sequence, having burned through most of their core hydrogen, and have an outer envelope made mostly of hydrogen and helium. All stars begin as main sequence stars and evolve into giant stars. Those that are roughly 8 times the mass of the sun (8M⊙ ) and above eventually become type-II supernova. The main paths taken in stellar evolution are shown in Figure 2.2[25] . For a typical x-ray bursting system the neutron star is a roughly 1.4M⊙ supernova remnant and its companion is a giant star of order 1M⊙ or less. In an x-ray binary system giant star is transferring gas to the neutron star in a process called “accretion”. Mass transfer is possible because the giant star has expanded so that 10
  • 25.
    Figure 2.2: Stellarevolution possibilities. its gas fills its Roche lobe while overlapping the neutron star’s Roche lobe. The Roche lobe is essentially sphere in which a star’s mass is gravitationally bound [26] . Once mass transfer is initiated gas flows freely from the surface of the giant star to the surface of the neutron star, as shown in Figure 2.3[27] . As a result of accretion, gas rich in hydrogen and helium builds up on the crust of the neutron star. This results in the emission of x-rays due to the gravitational energy released during accretion in all of these systems and nearly half also undergo in type-I x-ray bursts [28] . Due to the system’s steady emission of light which peaks in the x-ray portion of the spectrum, astrophysicists can infer the temperature of the environment via the well known relations hc E= ∼ kT λ (4.1 × 10−21 M eV ∗ s)(3. × 108 m/s) T ∼ −9 −11 ∼ 1. × 108 K, (0.1 × 10 m)(8.6 × 10 M eV /K) where k is Boltzmann’s constant, h is Planck’s constant, and c is the speed of light. A 6 6 more realistic approach utilizes Wien’s displacement law, T = 2.9×10λnm∗K = 2.9×10 nm∗K = 0.1nm 2.9 × 107 K. While this allows us to calculate the temperature at the surface of the burst- ing site, this temperature must be related to the temperature of the bursting zone via models. In general models infer the thickness of a burning layer by calculating how many nuclei, each releasing roughly 5MeV of energy in a given fusion reaction, it would take to create the observed energy of ∼1038 erg . Observational indications that the site is a sec 11
  • 26.
    Figure 2.3: Artist’sconception of an accreting binary system. neutron star, which are beyond the scope of this paper, can be included to arrive at the general conditions for an x-ray burst that can be included in simulations. Why study x-ray bursts? From a statistical point of view x-ray bursts are unique astronomical objects in that over 1,000 have been observed from over 40 separate sites [29] . We are thus able to see how bursts vary between binary systems and how the bursts vary within a single system’s recorded bursting history. This allows for the identification of common features and dependencies of the bursts on things such as the giant star’s mass, the giant star’s composition, and the rate of accretion. In astronomy such a robust data set is very rare, meaning that x-ray bursts are invaluable sources of information. X-ray bursts have the potential to be a wealth of physics information, though much work must still be put into understanding them before that wealth can be exploited. Of particular interest is the nuclear physics of x-ray bursts that provides input regarding the neutron star’s radius and its crustal composition. Each of these allows us to learn about the neutron star structure, which provides information about the equation of state of dense nuclear matter and consequently about the strong nuclear force [30] . Observing the effects gravitational redshift has on the thermal emission spectrum of matter being accreted onto the neutron star provides information on its mass to radius ratio and studying the final abundances of nuclei produced by the rp-process indicates what the crustal composition neutron star would be[19] . However, we will not be able to extract these parameters with the necessary level of confidence until we have improved our models of x-ray bursts[31] , which are very sensitive to nuclear physics data [32] . Currently one of the main ways to determine which nuclear physics data is of particular importance in x-ray bursts is to determine which data are important in the rp-process. 12
  • 27.
    2.2 RP-Process and Its Waiting Points The rp-process is a mechanism of nucleosynthesis in which protons are captured on nuclei to create successively heavier proton-rich nuclei. Proton capture can be stalled when a nucleus is reached whose proton capture rate is prohibitively small so that it must undergo β + -decay for the process to continue[33] . The nuclei that cause this occasional stalling are especially interesting because differences in the time the rp-process waits there can cause a large difference in the final abundance of nuclei produced [19] . These nuclei are called “waiting points”. Nuclear physics data combined with nuclear astrophysical models allow us to determine which nuclei are waiting points. Before the rp-process is initiated, the x-ray burst begins due to thermonuclear run- away, a process in which a reaction that is highly sensitive to temperature releases energy, increasing the temperature, thereby increasing the reaction rate and providing positive feedback [26] . Here runaway is triggered due to the highly temperature sensitive triple- alpha reaction, which ultimately synthesizes 12 C from three 4 He (a.k.a. α). Temperatures then rise to initiate α-capture which then provides the energy and seed nuclei necessary to initiate hydrogen burning for the rp-process [34] . The exact path of the rp-process is highly dependent on temperature and density, particularly regarding capture on light nuclei due to competition with α-capture induced reactions, but above calcium the rp- process is only determined by proton captures and β-decays[33] . For nuclei in this region along the proton drip line, the rp-process is dominated by β-decay lifetime of waiting point nuclei [33] . Thus if the process were able to bypass a waiting point nucleus via a proton capture, the path of the rp-process, and consequently the light curve and final composition of the x-ray burst, could be significantly altered[35] . Of the high A nuclei on the rp-process, one that has been identified as a waiting point, from β-decay measurements, is 68 Se. However, uncertainties remain in calculating the proton capture reaction rate, so it is possible that successive capture of two protons could allow the rp-process to bypass 68 Se [19] . The issue then is to determine these proton capture rates on earth. When studying nuclei that are proton-rich we have seen that are short-lived. Being that they do not maintain their current proton-rich state for very long, it is apparent that adding a proton to one of these nuclei is not a simple task. So, to circumvent this issue, we instead study the opposite process. Here this means we study the proton emission of 69 Be instead of the proton capture by 68 Se. Though the rates for these processes are far from equivalent, the nuclear structure is the same. As the mass difference, given from nuclear structure, between 69 Br and 68 Se is the most important variable in determining the proton-capture Q-value, we attempt to determine 69 Br’s ground state mass. We de- termine this mass by detecting the energy of protons resulting from 69 Br proton emission, which we study by necessity via the β-delayed proton emission of 69 Kr. The method of determining this structure is detailed in Chapter 5. 13
  • 28.
  • 29.
    Chapter 3 Simulation Packages Thephysics of charged particle interactions in detector systems involves many processes that are highly sensitive to incident energies, occur on small timescales, and involve small spatial scales. As a result, modeling this physics requires a simulation code that is able to take into account large and varied data and implement this data with the smallest possible spatial and temporal resolution. While creating a personal simulation package for such physics is not out of the question, the process would require years of effort to ensure a properly working code. Thus, to avoid reinventing the wheel, it is often more practical to employ previously tested and developed simulation packages. The simulation packages used here were Monte Carlo N-Particle X (MCNPX)[36] , Geometry and Tracking 4 (GEANT)[37] , and Monte Carlo Simulation of Electron Tra- jectory in Solids (CASINO)[38] . Each of these packages is the result of over a decade of development and testing. Also, each is relatively easy to acquire, though MCNPX takes some extra effort. GEANT4 was the primary simulation package used and MCNPX and CASINO were used to verify its results. The following sections will attempt to briefly explain the uses and methods of simulation for each package. 3.1 MCNPX MCNPX is a simulation package developed by Los Alamos National Laboratory which has major updates roughly every 3 years [36] . The version used in this study was MCNPX 2.6.0 (package ID:C00740MNYCP02), originally released in April 2008. A copy of this software can be obtained by contacting the Radiation Safety Information Computational Center (RSICC)[39] . However, as MCNPX is a product of the United States Department of Energy, it requires paperwork to be submitted and it is advisable that contact with RSICC is initiated by a laboratory or university software representative. The entire process can take anywhere between two weeks and one month before the software is in hand. 15
  • 30.
    Figure 3.1: Aminimalistic MCNPX simulation input file. Additionally, it must be noted that once the MCNPX package has been approved for use, the source code is likely to be unavailable for viewing. A user’s manual that describes every aspect of the physics and algorithms employed in the code is provided in addition to the simulation package. It is generally sufficient in describing what the code can do and how one can make the code perform specific tasks. It is important to note that this manual cannot be shown to anyone who does not also have permission to use MCNPX from RSICC under penalty of imprisonment. However, input and output of the simulations are free to share amongst research colleagues. Regarding input, the simulations in MCNPX are coded in a unique, single-document environment separated by an empty line into three sections: cell, surface, and data. The input in each section generally devotes one line of code to specify a given aspect of the simulation, where each line is referred to as a “card”. Thus a simulation is coded card by card, where the simplest of simulations could contain as few as 10 cards (A very simple example is shown in Figure 3.1). In the author’s opinion, a marked advantage here is simplicity, however the accompanying disadvantage is a general obfuscation of the simulation’s inner workings. 16
  • 31.
    As it iseasiest to describe the input cards with an example, Figure 3.1 will be de- scribed beginning at the first line and continuing to the bottom, with some mention of cards and options for cards that are not shown. While this example fills only 26 lines, including comments, some simulations in this study were over four times this length, un- derlining the importance of ample comments (See Appendix). The example shown fires a neutron 1 × 105 times with an initial direction selected from an isotropic distribution inside the center of a sphere of Oxygen located near a sphere of Iron, all inside a cube of Carbon, which itself is located inside an infinite vacuum. Data is only recorded regarding the flux of the neutrons and distance traveled by neutrons within the iron sphere. A given cell card, of which there are four, lists the assigned cell number, number assigned to a desired material that is defined below, the density of said material, and the volume of the cell as defined by the surface cards. Negative signs for density indicate units g of cm3 and negative signs for cell surfaces indicate a cell is located within that surface. g Thus cell one is Oxygen with a density of 0.0014 cm3 bounded within the spherical surface g number seven. Similarly cell two is Iron of density 7.86 cm3 bounded by the spherical g surface eight. Cell three is Carbon of density 1.6 cm3 bounded within the cube defined by planar surfaces one through six. Finally, cell four is the vacuum that surrounds cell three. Much more complicated cell volumes could be defined, however these will not be described here as this work consisted solely of rectangular, spherical, and cylindrical cells. Surface cards, as is evident in the preceding paragraph, describe surfaces that can be used to construct cells. Unused surfaces will register a warning upon running the simulation. Surface cards list the assigned surface number, the area type with a label defined in the MCNPX user manual, and a sequence of numbers describing coordinates within the entire volume required to fully define said surface, also detailed in the user manual. Surface one is a plane with its normal oriented along the z-axis, as indicated by “PZ”, at z = −5cm. Here one may be bothered by the introduction of arbitrary axes, but it is necessary that one make a choice of orientation with the beginning surface cards and stick to that convention to assure consistency in defining cell cards. Surfaces two through six are defined in a similar manner to surface one. As a general note, one could instead define the surfaces of a rectangular prism in one card. Surface seven is a sphere, as indicated by “S” with a centroid located at (x,y,z)=(0.cm,−4.0cm,−2.5cm) and a radius r = 0.5cm. Surface eight is similarly defined but with centroid coordinates (0.cm,4.cm,4.5cm). As with the cell cards, much more complicated surfaces are possible, where many examples of these are given in the MCNPX user manual. Whereas the previous cards describe the geometry of the simulation, the data cards primarily describe the physics input and output. The importance card, denoted by “IMP” specifies what particle type, here “N” for neutron, to track in which cells. By default MCNPX includes all known physical processes relevant to the tracked particle. Physics relevant to other particle types could be additionally specified by using the “PHY:” card 17
  • 32.
    and its respectiveoptions, followed by the symbol for the desired particle, on the line beneath the “IMP” card. Cell importances are assigned in the order they are defined with a 1 indicating important and a 0 indicating not important. Note that if the particle of interest must traverse a cell that may be of no interest in order to get to one that is of interest, the traversed cell must still be assigned a 1 so that the particle “makes it” to the interesting cell. “SDEF” is the source definition card that specifies all of the characteristics of the simulated source. The source shown here is as simple as it could possible be. In general this card will be used with many more options which additionally specify things such as initial direction, initial energy, and particle type. Directions and energies can be selected from self-defined or predefined functional or discrete distributions. The source here is taken to b a neutron by default since it is the only particle assigned any importance by the “IMP” card, located at the coordinate (0.cm,−4.0cm,−2.5cm). As an additional check, one can specify the cell of the origin to ensure the chosen position is correct, or nearly so. If left undefined, the default directional distribution is isotropic and the default initial energy is particle specific and defined in the MCNPX user manual. The following sets of cards, beginning with “F” and “E” always appear in conjunction and are referred to as “tallies”. The cards with “F” followed by some number specify the physics of the source particle to be recorded for output. The letter-number combinations that correspond to given data are listed in the MCNPX user manual. Following “F#:” is the particle type and the cell(s) for which to record this data, as is evident in Figure 3.1. The “E” card indicates how to bin the data that is specified to record, with the number following “E” denoting which type of recorded data it is binning and the units of said binning (usually energy in MeV) being defined for each data type in the MCNPX user manual. If a given data type as already been binned, the number listed is increased by an increment of ten from the previous “E” card that pertains to this data type (e.g. for F2 one could have cards E2, E12, E22, etc). If one wishes to use the same binning for all “F” cards then the “E0” card is used. The “M” cards specify the materials used to fill various cells in the simulation. If a material is specified, but not used a warning will be issued upon running the simulation. The card contains “M” followed by an assigned material number, then the isotope(s) the material is composed, followed by the relative amount of that isotope in the given material. The elements are specified with six or less numbers were the first three denote the element and the last three the atomic mass A. If the numbers for A are all zero, the average mass of a particular element on earth is used. The total amount of isotopes in a given material should add up to some multiple of 10, so as to mimic percentages, however if they do not the simulation will normalize the total fractional amount to one and issue a warning. Thus material one is fully 16 O, two is mostly 56 Fe with some 54,57,58 Fe, and three is mostly 12 C with some 13 C. Finally the “NPS” card indicates how many times the Monte Carlo simulation will run. Recall that much more complex data cards are 18
  • 33.
    possible, however oneshould consult the MCNPX user manual for such cards. To produce output, one must first source the MCNPX package software with the command “source /filepath/”. The simulation is then run with the command “mcnpx i=InputFilename o=OutputFilename. Additional commands can be appended to this line for a more customized output. Of particular use in the debugging phases is the option “PRINT”, however this should not be used for long (> 1e4) simulations as it creates a large output and consequently slows runtime. Visual output, also invaluable in debugging, can be created by loading input files into the VISED[40] software, however this too must be obtained from RSICC. The output of the MCNPX simulation contains many pieces of information, most are of little interest here, so an attempt will be made to briefly highlight important output quantities. The basic structure of the output is as follows: restate the input, describe the input geometry, describe the specified source, list physical characteristics of initial group of Monte Carlo simulations, list results of “F” tallies as binned by “E” tallies, list statistical qualities of recorded tallies, and list the total simulation time in human units (e.g. actual minutes). A sample output is not pictured here due to its excessive length, e.g. 300 lines for the simple input shown. As was stated,a more verbose output can be printed, and should be during debugging phases, using the “PRINT” option. Additionally, warnings will be listed after the listed physics input or output that MCNPX developers think generally require special attention. In practice the output initially requires a close reading with the MCNPX manual in hand, so no effort will be made to describe it any further. Output from simulations performed in this study is not listed in the appendix due to size, however the author can be contacted if one wishes to consult a full output file of a simulation presented. 3.2 GEANT4 GEANT4 is a simulation package developed by users of the CERN facility[41],[42] and is maintained by the its user community. The installation used here was version 9.1.0, which was released in January 2008. GEANT4 software is freely available online, provided one is able to download a roughly 0.5Gigabyte file. As the code is open source, one is freely available to inspect and alter source code with the caution that the software has been developed and inspected by hundreds of professionals. GEANT4 simulations are coded modularly in a C++ style language, where hundreds of pre-made classes contained in the original software are available for use. General knowledge of C++ syntax is not required to create GEANT4 simulations, but it is highly recommended. An attempt will be made here to describe the general make-up of a simple GEANT4 simulation, however due to the modularity of the code the following description will certainly lack the clarity of that given in the section on MCNPX. All codes described 19
  • 34.
    will be locatedin the appendix. Regarding general modules of the simulation, a main code is run that contains ref- erences to the header files of the primary components of the simulation. These primary components are main geometry, materials used, physics processes included, method in which a single simulation iteration is generated, and method in which desired data is recorded. Each header file contains definitions of included classes as well as references to minor components of the simulation that specify things such as an individual detector’s geometry or a special method of tracking data in a particular component of the simu- lation. Header files have a corresponding source file which contains instances of classes defined in the headers. Generally the main code exists in a directory above two sepa- rate directories, include which has the header files and src which has the source files. Throughout the code references are often made to predefined classes that contain infor- mation such as a method of specifying a given geometry or an algorithm to sample a Gaussian distribution. Other than this, no pieces of physics, input, or output are pro- vided for the user. As such, the author advises that one begin by working by inspecting and imitating working examples, using references such as the GEANT4 User Support [43] and the doxygen GEANT4 documentation [44] . The main code is the driver for all other codes. It initializes the conditions of the simulation by calling the main modules of the simulation. The driver constructs the simulation volume, initializes the method of outputting the results, initializes the physics to be included, initialize the visualization method, initialize the method of generating a given simulation event, and finally the simulation event is run. The simulation is compiled such that it handles a single event. The compiled code is iterated over for a user-specified number of events by a compact macro that will be described after main code components. Construction of the volumes within the simulation is generally done by a code called DetectorConstruction, or something similar to this. Within this code each physical com- ponent of the desired simulation is constructed and oriented within an arbitrarily defined “world volume”. It is generally more convenient to reference the components of the sys- tem via separate modules so that one could swap, say, a cylinder made of aluminum with a rectangle made of lead, by changing a few lines of code. For each component constructed, a material is specified to fill the volume, the volume itself is specified via some shape and central coordinates, and an associated “messenger” class is called. A messenger class is necessary for any volume through which the particle of interest might pass on its way to a volume of interest, much like the “IMP” card in MCNPX. Ad- ditionally, for volumes that are detectors which will ultimately “detect” your particle, as the double-sided silicon strip detector in this study, the volume must be specified as “sensitive”. Sensitive volumes require an additional code that specifies what and how to track in said volume. The method of recording and outputting of results is varied and very loosely defined in 20
  • 35.
    GEANT4 documentation. Theresults code must interface with the code that generates the initial source particles as well as the code for the sensitive detector. (The code used here, Results, was based on work by Ron Fox.) In this code a hexadecimal value is assigned to variables that indicate the type and initial energy of source particles and the type and energy of particles that impact a sensitive detector. Prior to printing the string of assigned variables for an event to an output file, a variable is written indicating the beginning of an event and, after the string of variables, a variable is written indicating the end of an event. This data is sorted into a ROOT readable format by a code that will be described after the description of the macro that runs the simulation. Note that one does not necessarily need to output results in the same manner as described here, but some method must be employed if one is to go beyond simply visualizing the simulation results. The physical processes to be included in a simulation are contained in the code called something like PhysicsList. Here the processes in which a source particle can interact with a detector system are individually listed for each potential particle of interest. For certain particle types, like the electron, special “low energy” (< 1MeV) processes can be employed. The processes are assigned an order to be evaluated and some are executed only once a particle has dropped below a given kinetic energy. For example, when simu- lating a positron in this study, included are scattering, ionization, bremsstrahlung, and, only once the positron is “at rest”, annihilation. During a single event of a simulation the particle will move along in steps with the direction of motion being decided in a proba- bilistic (but physical) manner and whose length are specified in GEANT4 documentation (but are changeable). Certain types of processes, e.g. scattering and ionization, can hap- pen at substeps of a given step, while others, e.g. bremsstrahlung, only occur after a step. Additionally, one can specify here at what energy to effectively stop a given par- ticle or simply choose to accept default values. (Here default values were used because a positron is stopped at 1keV, however the detector thresholds in the actual experiment are no lower than 70keV.) As with simulation results, the method of visualization varies widely amongst GEANT4 codes. Here the package VRMLview[45] version 1.0 was used. This package is not nec- essarily recommended, particularly as it is from 1997, however it was used in this study because it was available. Regardless of the package employed, a code generally named VisManager initializes the graphics system and allows it to communicate with the simu- lation as it runs. Creation of a visualization can be turned on or off in the compact macro that runs the simulation. It is advisable to not create visualizations for simulations of more than 1,000 events unless a computer with considerable processor power is employed. Source particles are emitted (“fired”) by a code generally named something like Pri- maryGeneratorAction. This code specifies all of the characteristics of the source. Here a source can be as simple as a monoenergetic electron fired in a single direction, or it can be made to fully replicate an actual radiation source. If the latter is chosen, one must 21
  • 36.
    code all sourceparticles, energies, and their respective probabilities of emission. When choosing this option it is wise to consult the National Nuclear Data Center (NNDC)[46] and to be sure to include only decay branches that have a statistically significant proba- bility of occurring during the total number of simulations run. Regardless of the source chosen, one can specify the initial position of the source as well as the direction in which to fire the source particle, where each could be chosen probabilistically. To compile the code, one must first source the GEANT4 library with the command “source env.sh”. evn.sh and env.csh are two files which exist in the same directory as the driver. These files contain information on how to compile the GEANT4 code. Before the code is executed one must ensure that their .bashrc file contains the command “export G4WORKDIR=/filepath.” One then runs “make clean”, “make”, and finally “./ExecutableName”. At this point a compact code for a single simulation as been created which typically shares the name of the executable file, but lacks the file extension. The full simulation is finally run using a compact macro, here my vis.mac. This is a short code, typically 10s of lines long, in which it is specified how verbose the output of the simulation should be, whether or not to create a visualization, and how many simulation events to perform. The full Monte Carlo simulation is then run with the command “./ExecutableName CompactMacro OutputFile”. The contents of the output file are specified by the results code. For analysis it is desirable to convert the output into a ROOT[47] -readable format. (There are likely many ways to do this, however the author simply followed an example created by Ron Fox.) This code, generically called something like Sort2Root, initializes a ROOT Tree, its Branches, and their Leafs to bin the data from the OutputFile into histograms that can be used in analysis. Additionally, this code can be used to apply detector-like resolution by effectively smearing out data bins with some desired distribu- tion. Here this was done by taking each event energy as the centroid of a Gaussian and using the weighted probability of the Gaussian to select a new energy, finally putting the event into the corresponding new energy bin. Prior to writing such a code it is advisable that one gain some familiarity with the ROOT software. Examples of all of the previously described code will be included in the appendix as they looked for the final performed simulations. Source code for simpler versions are also available if one wishes to contact the author. 3.3 CASINO CASINO is software created to model the trajectory of electrons in solids, particularly for situations involving Scanning Electron Microscopoes (SEM)[48] . The code was developed by the research teams at the Universit´ de Sherbrooke[38] and is freely available for e download online, provided one register for permission on their website. The full source 22
  • 37.
    code is availablefor download, however only the executable graphical user interface (GUI) was used in this study. A simulation in CASINO consists of firing an electron given some initial positional distribution with some initial angular distribution directly into a volume of specified size and composition. Results from the simulation are given in graphical form and include information such as the energy of backscattered electrons, depth to which electrons pen- etrated, paths electrons followed, and x-rays emitted due to electron interactions. In studies such as the one performed, CASINO is useful for verifying simulation results by checking quantities such as the required thickness of a given material to stop an electron of a given energy. One begins creating a simulation by specifying the material composition and thickness through which the electron is to be fired. Multiple layers can be created, however here a single layer of Silicon was used. The range of electron energies, the positional and angular distributions of fired electrons, as well as the total number of electron firing events to simulate are then specified. One then chooses which data to output in graphical form. Next the physics models for different electron energy loss processes and random number generator are chosen. Finally one chooses how many electron trajectories to display and the simulation is started. The entire process is quite simple to learn and, in the author’s opinion, this simplicity justifies CASINO’s use though its output is limited. 23
  • 38.
  • 39.
    Chapter 4 Verification andValidation of Simulations In order to properly interpret the results of any experiment in nuclear physics, it is often necessary to have an accompanying simulation. Simulations provide insight into the involved physical processes and they provide a laboratory in which one can freely change experimental conditions and visualized their impact on the results. Here the simulation is required to correct the observed particle energy for β-summing to extract the correct proton energy. However, before a simulation can be used it must be extensively tested to ensure it provides results that replicate the system of interest. The processes of testing a simulation are known as verification and validation. Verification is ensuring that a code accurately reproduces the desired theoretical model being used to describe a physical situation. Validation is ensuring that the cho- sen physical model accurately represents the physics of the situation of interest[49] . In verifying a code one uses methods such as plausibility checks, back of the envelope calcu- lations, rigorous examination of output for known cases, echoing of input upon output, and comparison with codes made for a similar purpose. In validating a code one per- forms a controlled, usually simple, experiment whose results are robust and compares the experimental results to those of a simulation replicating that experiment. The actions taken to verify and validate the simulations presented in this study are given below. 4.1 Verification Verification has two main classes: internal verification and external verification. Internal verification checks the output of a given code against its input to ensure the desired model was properly simulated. External verification, or benchmarking, compares the results of simulations performed with separate codes that have identical, or as identical as possible, conditions. Internal verification was performed here for the MCNPX and 25
  • 40.
    GEANT4 simulators andbenchmarking was performed for GEANT4 using MCNPX and CASINO. MCNPX prints a multitude of information in its output files that can be used in verifying a simulation. The first set of information described aids in determining if the simulation setup is correct. The input file used to generate a given output file is included at the beginning of the output so that it is very clear which simulation led to which results. Warnings are sometimes listed here when errors are made in constructing the geometry, though errors that elicit these warnings often stop the simulation from running. The volume, material, and importance of each cell is listed in Print Table 60 so that one can be sure their geometry is as intended. Print Table 126 provides the user with information on the total number of particle interactions occurring in a given cell. While this information doesn’t necessarily indicate the simulation was correct, it can provide a quick confirmation that something is very wrong, e.g. if a given cell has an anomalously high relative number of interactions. Arguably the most important check on the simulation setup is the visualization, where the general orientation of objects in the simulation can be quickly confirmed. A second set of MCNPX output information that can be used for verification indicates that statistical validity of the entire Monte Carlo simulation as a whole. While these checks do not guarantee statistical validity, they do provide supporting evidence that an ample amount of events have been run to ensure convergence. The tally information √ given includes a statistical error assigned to each bin as N , where N is the number of counts in a bin. The MCNPX manual suggests that no bin have an error greater than 10% and provides near assurance of convergence if no bin has an error greater than 1%. These errors are used to provide information following the tallies on the validity of the simulation using 10 statistical checks, which are described in the MCNPX user manual. In practice final simulations should be run to satisfy all suggested statistical conditions, however such simulations are computationally expensive. Thus a practical solution during development is to reduce the number of events by a factor of 10 for the initially working simulation until the results no loner agree. Subsequent simulations run during development should be run with a much smaller number of events, though occasional checks should be made to ensure these results are convergent with a longer simulation. For example, simulations performed in this study often satisfied all statistical checks for 1 × 107 events, but they provided the same results for 1 × 105 events. So many of the simulations during development were run with the shorter number of events, but those for final results were run with the greater number of events. While equally thorough verification output is possible with GEANT4, it was not implemented in this study in order to simplify coding of the output. Internal verification consisted mainly of checks with the visualization as well as ensuring the output was reasonable. An example of reasonable output being roughly even total energy depositions for all detector strips in a given hemisphere when the source is isotropic. Another more 26
  • 41.
    (a) MCNPX VerificationSetup (b) GEANT4 Verification Setup Figure 4.1: Near identical initial conditions used for verification simulations. rigid check is ensuring the energy deposited in a detector is never greater than the initial energy of the source particle. Once MCNPX and GEANT4 were separately internally verified, GEANT4 was bench- marked with MCNPX. With as identical conditions as possible, several simulations were performed. The physical setup of the simulations consisted of an Aluminum cylinder sur- rounding a double-sided Silicon strip detector (DSSD), with a vacuum in the open space. The cylinder has a length l = 16.32cm, inner radius RI = 7.5cm and outer radius RO = 7.62cm and the DSSD has dimensions length × width × height = 4cm×4cm×0.05cm, where the long axis of the cylinder and the height of the DSSD are oriented along the z-direction. The plane of the closest cylinder end is 8.27cm from the closest DSSD surface and the centroid of the DSSD is at (x,y)=(0,0) with respect to the cylinder’s coordinates. The source is located at the center, (x,y,z)=(0,0,0), of the cylinder emitting monoener- getic electrons isotropically. (See Figure 4.1.) Each verification simulation was carried out with a single electron energy. Energies chosen were 0.481, 0.553, 0.565, 0.975, 1.000, 1.047, 1.059,and 1.682MeV. 1.000MeV was chosen arbitrarily, while the other energies were chosen because they are each included in the source for the validation experiment. No detector resolution was included in the simulations. For all energies the simulations had excellent agreement, except for the marked divergence below 0.17MeV, where MCNPX generally had twice the counts of GEANT4. As an example the counts vs deposited energy are shown for the low, middle, and high initial source energies simulated in Figure 4.2, where each simulation had 1×106 initial source events with an overall isotropic distribution. GEANT4 was verified in a very general way with CASINO. As identical simulation conditions could not be reproduced, instead CASINO was used to check if it was plausible 27
  • 42.
    (a) 0.481MeV e− (b) 1.000MeV e− (c) 1.682MeV e− Figure 4.2: General agreement between MCNPX and GEANT4 verification simulations. that electrons of a given energy could be stopped in Silicon of a given thickness. To mimic the DSSD, the material chosen in the CASINO verification simulation was 500µm of Silicon. The initial electron energy was chosen to be 975keV, as this is the energy of primary importance in the validation experiment, and the initial angle was chosen to be 50◦ , admittedly an extreme case. This simulation confirms that some of these electrons can and are stopped in the Silicon, as is shown by the energy deposited by depth in Figure 4.3. Here it is shown that 90% of the electron’s energy are deposited within the red contour when an electron enters the Silicon at an angle of 50◦ , well within a depth of 500µm, the thickness of the DSSD. (A useful paper for interpreting CASINO plots is [50].) 4.2 Validation 207 4.2.1 Validation Experiment: Bi Calibration Source Validation was performed using an experiment whose basic setup was identical to that described for the verification simulations. The source used was 207 Bi which predominantly emits electrons with energies 0.481, 0.553, 0.565, 0.976, 1.048, 1.059, and 1.682MeV with probabilities 13.1, 3.8, 1.3, 60.9, 16.0, 4.7, and 0.2%, respectively[46] , where probabilities are normalized to only include these electrons. Electron energies which 207 Bi also emits were not included due to their small probability of emission. For example, the most frequent electron energy that was not simulated is MeV, which is emitted once in every 2 × 103 times the 976keV electron is emitted. (See [46] for a full characterization of the source). The DSSD, a type “BB1” purchased from MicronSemiconductor[51] , was held up by four aluminum rods which extended from one of the cylinder end caps. The data collected was relative energy deposited by electrons in the DSSD, which was recorded 28
  • 43.
    Figure 4.3: Evidence976MeV e− can be stopped in 500µm of Si. by collecting electron-hole pairs created as the electron passed through the Silicon. A voltage of 50V was applied across the detector so that charges from all parts of the detector could be collected. An engineering drawing of the actual setup, without the surrounding cylinder, is shown in Figure 4.4. 4.2.2 Replication via Simulation In the simulation many simplifications were made, however it seems they are justified. Source energies mentioned in the previous subsection are not all of the electron energies emitted by 207 Bi, however other physical energies are emitted with a relatively low proba- bility. Additionally 207 Bi emits photons, but it was found these do not significantly affect the energy spectra. A full characterization of 207 Bi can be found at [46]. As is apparent from comparing Figure 4.4 and 4.1, numerous approximations were made in creating the simulation geometry. Ultimately only the Aluminum cylinder and the DSSD were in- cluded because it was found that backscattering of electrons off the Aluminum chamber had little impact on simulation results. So it was then assumed that the aluminum rods supporting the DSSD would have an even smaller effect. 29
  • 44.
    Figure 4.4: Engineeringdrawing of Beta Counting Station[52] . 4.2.3 Comparison Between Simulation and Experiment In order to compare data from the validation experiment and simulations of that ex- periment, a calibration had to be performed to the DSSD. This was necessary because the energy that is recorded is relative and is binned into “channels”. Channel to energy calibration was performed by M. del Santo by recording the channels the recorded energy deposition for several sources of known energy. M. del Santo additionally performed a calibration using Compton scattering. Here photons from a source that mainly emits a photon of a given energy is allowed to pass through the DSSD and is detected afterward by a germanium detector. The change in the photon’s angle and energy is sufficient to obtain the energy imparted to the detector, as is shown schematically in Figure 4.5. The channel to energy calibration ultimately resulted in a 4th order polynomial func- tion that could be applied to the data. Adjustments were also made to the gain applied to the data and the total number of simulation events was designed such that the total number of recorded events would match the data. The resulting calibration function applied to the data in the presented results was Energy(x = Channel) = G ∗ (p0 + p1 ∗ x + p2 ∗ x2 + p3 ∗ x3 + p4 ∗ x4 ), (4.1) where, to two decimal places, G = 8.6 × 102 and p0,1,2,3,4 = 0.0, 4.90 × 10−3 , 2.02 × 10−4 , −6.94 × 10−7 , and 8.15 × 10−10 , respectively. The GEANT4 simulation used for comparison had 1 × 105 source events, but the resulting data bins were multiplied by a factor of 25 to have the same overall counts. The resulting comparison is shown in Figure 4.6. 30
  • 45.
    Figure 4.5: Formulaand schematic for Compton scattering. Note the general agreement between the GEANT4 simulation and the experimental data. Relative count peak heights are reproduced very well as are their profiles. It is apparent that the relative spacing between the two most prominent peaks is not consistent between simulation and experiment. This suggests that perhaps adjustments need to be made to the calibration function or maybe more calibration data is required in the energy range of interest. 4.3 Potential Further Verification and Validation Ideally more verification and validation checks will be performed to ensure the accuracy of the code. Regarding additional verification of the GEANT4 simulations, there are many options. The first, and perhaps most obvious, would be to upgrade the output so that it includes information on the volume and coordinates of simulation components. It would also be beneficial to add statistical errors to the output, as it is done in MCNPX, so that the statistical validity of a simulation will be more apparent. Arguably the most useful additional verification would be benchmarking for more situations and with other codes. Ideally benchmarking would have been performed for a dual positron and proton emission as well, as for β-delayed proton emission, which is the focus of this study. However, it was found that non-physical behaviour occurs for MCNPX when positrons are emitted within a detector of small volume. As an example of nonphysical behavior, note the double-peaked mean energy deposition for a 1MeV isotropic electron emitting source 31
  • 46.
    Figure 4.6: Experimentaldata and GEANT4 simulation comparison for validation. centrally located within in a DSSD shown in Figure 4.7. These simulations could not be performed with CASINO as it only simulates the trajectory of electrons in materials. For benchmarking this type of physics, the author has recently become aware of the FLUKA[55],[56] simulation package, which seems well suited due to its versatility and well developed user support. Regarding additional validation, any number of experiments could be performed. The most useful experiments would use another discrete electron source or an alpha source or a proton beam. An alpha source was not simulated in this study. Being that the proton, for which the alpha calibrates, is generally fully stopped within the DSSD, it was assumed here that the centroid of its energy distribution would be centered around its full energy with a full width half maximum of the detector’s resolution. As experimental information provided this full width half maximum, it seemed unnecessary to perform a simulation to confirm this result as the full width half maximum of detector response is given to the simulation as input. A proton beam was not simulated because it seems unlikely that the DSSD will be taken to a facility with a proton beam in the near future. 32
  • 47.
    1MeV e- centrallyemitted from 0.5 X 1 X 40mm Si strip 600000 1e7 runs, perfect resolution 500000 400000 Counts (total: 1e7) 300000 200000 100000 0 0 0.2 0.4 0.6 0.8 1 Pulse Height (MeV), 10keV bins Figure 4.7: Unphysical behavior by MCNPX when simulating an e− in a single Si strip. 33
  • 48.
  • 49.
    Chapter 5 Prediction ofExperimental Results Prior to describing the experiment and simulation that were the focus of this study, the purpose will be briefly rehashed. Recall that the goal is to identify levels in 69 Br, particularly the ground state, that lay below its isobaric analogs state (IAS). The proton emitted from the ground state of 69 Br is of particular interest because it will allow us to determine a ground state mass for the nucleus, which can be used to experimentally assign a proton capture Q-value to the rp-process waiting point nucleus 68 Se. The method which will be used to measure the proton’s energy is the detection of β-delayed proton emission by 69 Kr, which will inherently sum the energy of the emitted positron with the energy of the proton, upon detection. The experiment being described to accomplish this task is scheduled to be performed by Marcelo del Santo, accompanied by the research group of Hendrik Schatz, from May 10 to May 18 (roughly one week from this writing) as experiment 07025 at the National Superconducting Cyclotron Laboratory (NSCL). 69 5.1 Kr Experiment As 69 Kr has a half-life of t 1 = 32ms[46] , it must be produced on site at the NSCL. An ion 2 source produces 78 Kr, which is accelerated by the coupled K500 and K1200 cyclotrons[57] , schematically shown in Figure 1.3, to an energy of 150 Mu (MeV per Nucleon). At 25 eV particle-nanoamps (pnA), the beam will be fragmented by a Beryllium target to produce 69 Kr and along with some contaminants. Most of the contaminants will then be removed as the beam passes through the A1900 fragment separator[30] and the Radio Frequency Fragment Separator[58] (RF Kicker). Finally the beam will pass through three single sided PIN Silicon detectors and one DSSD, implanting 69 Kr in a second DSSD which has behind it a third DSSD and a fourth PIN detector. Collectively these Silicon detectors are the Beta Counting Station (BCS)[52] . This is shown schematically in Figure 5.1. Not shown is the Segmented Germanium Array (SeGA)[59] which will surround the BCS. 35
  • 50.
    Figure 5.1: Experimentalset up for experiment 07025 at the NSCL. The data of primary interest in the experiment is the energy deposited in the BCS and SeGA. The BCS will collect energy from positrons and protons resultant from 69 Kr β-delayed proton emission and SeGA will collect energy from photons emitted in the de-excitation of 69 Br. As each system will also detect radiation from background and contaminants, gates have been devised so that events having decay signals in the BCS and SeGA in coincidence can be isolated so as to effectively remove the majority of contaminants and background for decay branches that pass through an excited state of 69 Br. For the ground state decay branch one would not expect a photon. Working from the assumption that said gating will be effective, the simulation in this study only examines the effects of radiation from β-delayed proton emission in the BCS. 5.2 Simulation and Results As was the case for the validation experiment, simplifications were made to approximate the system of interest. Indeed the setup simulated here is identical to that described in section 4.2.2 and shown in Figure 4.1, with the only difference being the source and its location. Here the source is located within the DSSD and emits a positron and then a proton, so as to replicate β-delayed proton emission of 69 Kr. A time delay between the positron and proton emission is not included, as this time in reality will be undetectable using the given experimental setup. Any number of decay branches could have been simulated, however here we only examined the decay through the IAS and the lower limit for the ground state of 69 Br. The IAS branch was chosen because it has been previously observed[5] . The ground 36
  • 51.
    state decay branchwas simulated because extracting its energy is the main goal of the experiment and the lower limit was chosen because it provides the lowest energy signature, closest to detector threshold, we expect to detect. The simulation goes through the IAS branch 83% of the time, as this was the branch- ing ratio assigned by [5]. Upon selecting the decay branch, the rejection method[53] is used to select the energy of the emitted positron according to its β-spectrum, which is defined by the decay’s Q-value. Recall that the positrons can have different energies for a decay of a given Q-value because β-decay is a three-body reaction and thus the positron and electron neutrino may divide the total available kinetic energy differently each time (see Figure 5.2). The β-spectrum was calculated using the simple relation[4] dPE dp dE = ξ ∗ dP ∗ dE dp dPE dE = ξ ∗ p2 ∗ (Q − E)2 ∗ dE dp dPE 2 dE = ξ ∗ p ∗ (Q − E) ∗ (E + me ) where PE is the probability of emitting a positron of a given kinetic energy, E is an energy selected randomly from E = 0 to E = Q, Q is the Q-value of the decay, p is the momentum, me is the mass of a positron, and ξ is a normalization constant[4] that contains cancelling units and brings the maximum probability to 1. If PE is greater than a random number selected from 0 to a number greater than Pmaximum then the positron is fired with energy E. A Coulomb correction factor[54] could have been added, however this would require integration of the probability distribution each event and, upon comparison, the distribution was negligibly different for the purposes of this study. Following positron emission, a proton is emitted with an energy in accordance to the decay branch chosen. Thus, roughly 83% of the time a positron will be emitted with with an energy defined by a 10.069MeV Q-value, followed by a 4.07MeV proton, and the rest of the time a positron will be emitted with an energy defined by a 14.019MeV Q-value, followed by a 0.50MeV proton. The simulation result that was primarily investigated was the total energy deposited in the DSSD in a decay event compared to the energy deposited only by the event’s proton. More specifically, the comparison made was the difference between the centroids of the peaks for these energy deposition distributions, as this is the information used to correct for the summing effect. For the results shown (see Figures 5.3 and 5.4) the energy deposited was segmented into 0.035MeV bins and a detector resolution of 0.175MeV, experimentally determined by M. del Santo, was applied at all energies. One can see that the shift in the centroid of the energy deposition distribution due to β + summing is 0.215MeV for both decay branches. This result indicates that this shift will apply to all detected protons. Consequently, it seems unnecessary to simulate additional decay branches until the experiment is performed. Once peaks in energy deposition from β-delayed proton emission are identified in data analysis, subtracting 37
  • 52.
    Figure 5.2: Characteristicsof a 14MeV Q-value β + -decay. 0.215MeV from the peak’s mean value should yield a more accurate proton energy and, in the case of the ground state decay branch, a more accurate ground state mass of 69 Br that can be used to help determine 68 Se’s proton capture Q-value. Note the asymmetric shape of the summed energy peak. This asymmetry will allow for the disentanglement of the summing effect from detector resolution, which spreads the energy peak symmetrically, in the analysis of the experimental data. 5.3 Future Use of Simulations for Data Analysis More simulations will be performed to ensure a swift and accurate data analysis. Regard- ing the 69 Kr simulations, it will be important to simulate various combinations of decay branches with different energies and ratios until the experimental results are reproduced. Of primary importance is the reproduction of the IAS decay branch, as the energy of these protons is known. Additionally, simulations of 22 Si and 23 Si could be performed, as these β-delayed proton emitters have recently been measured at the NSCL. Regarding all simulations, a significant improvement would be to make the simulation setup more realistic with the addition of the surrounding DSSDs. It will then be possible to find correlations between the implantation location in the central DSSD and the location of positron detection in the surrounding DSSDs. Should the results find some group of strips in a surrounding DSSD detects a positron more often than others, this information can be used to gate on the more relevant strips and consequently speed the analysis 38
  • 53.
    69 Figure 5.3: Summingeffect for IAS and proposed ground state decay branch for Kr β-delayed proton emission (blue=proton, red=sum). process. Ultimately many more simulations may be performed, however this depends on the needs of the team involved in data analysis. 39
  • 54.
    (a) Ground statedecay branch (b) IAS decay branch Figure 5.4: Closeup of the summing effect for simulated decay branches. 40
  • 55.
    Bibliography [1] http://www.phy.ornl.gov/hribf/science/abc/ [2] VanWormer, L. et al. Astrophysical Journal. 432 (1994), 326 [3] Gottfried, K. & Yan, T. Quantum Mechanics: Fundamentals. New York: Springer- Verlag, 2003 [4] Martin, B. Introduction to Nuclear Physics. West Sussex, United Kingdom: Wiley & Sons, 2009 [5] Xu, X.J. et al. Physical Review C. 55 (1997), 2, R553 [6] Lima, G.F. et al. Physical Review C. 65 (2002), 044618 [7] Schatz, H. et al. Private Communication [8] Kramer, K. Introductory Nuclear Physics. Hoboken, New Jersey: Wiley & Sons, 1988 [9] Schatz, H. et al. Physics Reports. 294 (1998), 167 [10] Tuli, J. NNDC 2007 Nuclear Wallet Cards http:://www.nndc.bnl.gov/wallet [11] Smith, K. Private Communication [12] Stolz, A. et al. Nuclear Instruments & Methods B. 241 (2005), 1, 858 [13] Nunes, F. & Thompson, I. Nuclear Reactions for Astrophysics. New York: Cam- bridge University Press, 2009 [14] del Santo, M. Private Communication [15] Hester, J. & Scowen, P. (Arizona State University) & NASA. http://hubblesite.org/newscenter/archive/releases/1996/22/ [16] Suess, H. & Urey, H. Reviews of Modern Physics 28 (1956), 1, 53 41
  • 56.
    [17] Burbidge, E.et al. Reviews of Modern Physics 29 (1957), 4, 547 [18] Cameron, A. Publications of the Astronomical Society of the Pacific 69 (1957), 201 [19] Schatz, H. & Rehm, K. Nuclear Physics A 777 (2006), 601 [20] Grindlay, J. Comments on Astrophysics 6 (1976), 165 [21] Evans, W. et al. Astrophysical Journal 206 (1976), L135 [22] Hansen, C. & van Horn, H. Astrophysical Journal 195 (1975), 735 [23] Woosley, S. & Taam, R. Nature 263 (1976), 101 [24] Joss, P. & Rappaport, S. Nature 265 (1977), 222 [25] http://essayweb.net/astronomy/blackhole.shtml [26] Iliadis, C. Nuclear Physics of Stars Berlin: Wiley-VCH, 2007. [27] Weiss, M. & NASA Chandra X-ray Space Telescope. http://chandra.harvard.edu/photo/2001v1494aql/index.html [28] Maurer, I. & Watts, A. Monthly Notices of the Royal Astronomical Society 383 (2008), 387 [29] Galloway, D. et al. Astrophysical Journal Supplement Series 179 (2008), 360 [30] Steiner, A. et al. Physics Reports 411 (2005), 6, 325 [31] Cyburt, R. et al. Currently under review by Astrophysical Journal Supplements Series [32] Meisel, Z. et al. Proceedings of the 10th Symposium on Nuclei in the Cosmos (2008), 173 [33] Van Wormer, L. et al. Astrophysical Journal 432 (1994), 326 [34] Schatz, H. et al. Proceedings of the American Chemical Society symposium: Origins of Elements in the Solar System: Implications of Post 1957 Observations (2000), 153 [35] Smith, K. et al. Proceedings of the 10th Symposium on Nuclei in the Cosmos (2008), 178 [36] https://mcnpx.lanl.gov/ [37] http://www.geant4.org/geant4/ 42
  • 57.
    [38] http://www.gel.usherbrooke.ca/casino/index.html [39] http://www-rsicc.ornl.gov/ [40]http://www.mcnpvised.com/ [41] Agostinelli, S. et al. Nuclear Instruments and Methods in Physics Research A 506 (2003), 3, 250 [42] Allison, J. et al. IEEE Transactions on Nuclear Science 53 (2006), 1, 270 [43] http://geant4.web.cern.ch/geant4/support/index.shtml [44] http://www.lcsim.org/software/geant4/doxygen/html/index.html [45] http://www.vias.org/pngguide/chapter06 08.html [46] http://www.nndc.bnl.gov/ [47] http://root.cern.ch/drupal/ [48] Drouin, D. Microscopy and Microanalysis 12 (2006), S02, 1512 [49] Post, D. & Votta, L. Physics Today Jan. 2005, 35 [50] Drouin, D. et al. Scanning 29 (2007), 92 [51] http://www.micronsemiconductor.co.uk/pdf/bb.pdf [52] Prisciandaro, J. et al. Nuclear Instruments & Methods A 505 (2003), 1, 140 [53] Press, W. et al. Numerical Recipes in C, 2nd Ed. New York: Cambridge University Press, 1992. (p.290) [54] Blatt, J. & Weisskopf V. Theoretical Nuclear Physics. New York: Springer-Verlag, 1979. [55] http://www.fluka.org/fluka.php [56] Fass`, A. et al. CERN-2005-10 (2005), INFN/TC 05/11 SLAC-R-773 o [57] http://www.nscl.msu.edu/tech/accelerators [58] Bazin, D. et al. Nuclear Instruments & Methods A 606 (2009), 3, 314 43
  • 58.
    [59] http://www.nscl.msu.edu/files/sega sld2007.pdf This thesis was prepared using the L TEX typesetting language [60, 61]. A [60] L. Lamport, 1985 Addison-Wesley, Boston, “LTEX: A Document preparation Sys- A tem” [61] D. E. Knuth, 1985 Addison-Wesley, Boston, “The TEXbook” 44
  • 59.
    Appendix: Code The following Code is for final simulations performed in this study. Code for MCNPX simulates the validation experiment described in chapter 4. The file path for this work is: /projects/jina/jinalib/meisel/Thesis69Br/MCNP/Comp2Geant/. Code for GEANT4 simulates the experiment described in chapter 5. The file path for this work is: /project- s/jina/jinalib/meisel/Thesis69Br/GEANT/SimpleSetup/. Code for all simulations are available and one can contact the author for access to these. 5.4 MCNPX 1 207 Bi t o w a r d s 40 s t r i p DSSD 2 c cells 3 c 4 c Exterior void 5 1 0 2 6 c 7 c DSSD s t r i p s 8 2 1 −2.329 −1 −4 9 3 1 −2.329 −1 4 −5 10 4 1 −2.329 −1 5 −6 11 5 1 −2.329 −1 6 −7 12 6 1 −2.329 −1 7 −8 13 7 1 −2.329 −1 8 −9 14 8 1 −2.329 −1 9 −10 15 9 1 −2.329 −1 10 −11 16 10 1 −2.329 −1 11 −12 17 11 1 −2.329 −1 12 −13 18 12 1 −2.329 −1 13 −14 19 13 1 −2.329 −1 14 −15 20 14 1 −2.329 −1 15 −16 21 15 1 −2.329 −1 16 −17 22 16 1 −2.329 −1 17 −18 23 17 1 −2.329 −1 18 −19 24 18 1 −2.329 −1 19 −20 25 19 1 −2.329 −1 20 −21 26 20 1 −2.329 −1 21 −22 27 21 1 −2.329 −1 22 −23 28 22 1 −2.329 −1 23 −24 29 23 1 −2.329 −1 24 −25 30 24 1 −2.329 −1 25 −26 31 25 1 −2.329 −1 26 −27 45
  • 60.
    32 26 1 −2.329 −1 27 −28 33 27 1 −2.329 −1 28 −29 34 28 1 −2.329 −1 29 −30 35 29 1 −2.329 −1 30 −31 36 30 1 −2.329 −1 31 −32 37 31 1 −2.329 −1 32 −33 38 32 1 −2.329 −1 33 −34 39 33 1 −2.329 −1 34 −35 40 34 1 −2.329 −1 35 −36 41 35 1 −2.329 −1 36 −37 42 36 1 −2.329 −1 37 −38 43 37 1 −2.329 −1 38 −39 44 38 1 −2.329 −1 39 −40 45 39 1 −2.329 −1 40 −41 46 40 1 −2.329 −1 41 −42 47 41 1 −2.329 −1 42 48 c 49 c Aluminum C y l i n d e r 50 42 2 −2.7 43 −44 51 c 52 c v o i d between s p h e r e and DSSD 53 43 0 −2 #2 #3 #4 #5 #6 #7 #8 #9 #10 #11 #12 #13 #14 #15 #16 #17 #18 #19 & 54 #20 #21 #22 #23 #24 #25 #26 #27 #28 #29 #30 #31 #32 #33 #34 #35& 55 #36 #37 #38 #39 #40 #41 #42 56 57 c surfaces 80 CHAR| 58 c 1 RPP −2. 2 . −0.025 0 . 0 2 5 −2. 2 . $ Main block 59 c d e t e c t o r i s 525um t h i c k f o r Expt H a l l Apr 2010 cal . runs 60 1 RPP −2. 2 . −0.02625 0 . 0 2 6 2 5 −2. 2 . 61 c xmin xmax y z 62 c 63 c Sphere 64 2 SO 1 4 . 0 5 65 c 66 c S l i c e s i n DSSD 67 4 PX −1.9 68 5 PX −1.8 69 6 PX −1.7 70 7 PX −1.6 71 8 PX −1.5 72 9 PX −1.4 73 10 PX −1.3 74 11 PX −1.2 75 12 PX −1.1 76 13 PX −1.0 77 14 PX −0.9 78 15 PX −0.8 79 16 PX −0.7 80 17 PX −0.6 81 18 PX −0.5 82 19 PX −0.4 83 20 PX −0.3 84 21 PX −0.2 85 22 PX −0.1 86 23 PX 0 . 87 24 PX 0 . 1 88 25 PX 0 . 2 89 26 PX 0 . 3 90 27 PX 0 . 4 91 28 PX 0 . 5 92 29 PX 0 . 6 93 30 PX 0 . 7 94 31 PX 0 . 8 95 32 PX 0 . 9 96 33 PX 1 . 0 97 34 PX 1 . 1 98 35 PX 1 . 2 99 36 PX 1 . 3 100 37 PX 1 . 4 101 38 PX 1 . 5 102 39 PX 1 . 6 103 40 PX 1 . 7 104 41 PX 1 . 8 105 42 PX 1 . 9 106 c 107 c Aluminium c y l i n d e r 108 43 RCC 0 −8.05 0 0 1 6 . 0 7 . 5 109 c base vector radius 110 44 RCC 0 −8.062 0 0 1 6 . 6 2 0 7 . 6 2 111 112 c D T CARDS A A 80 CHAR| 113 MODE E P 46
  • 61.
    114 IMP : E 0 1 41R 115 IMP : P 0 1 41R 116 c 117 c S o u r c e ( 7 e n e r g i e s w i t h i n . 2 5 cm r a d i u s , 7cm away , a n g u l a r e m i s s i o n ) 118 c SDEF POS= 0 −7.05 0 CEL=43 ERG =D1 PAR=3$ i s o t r o p i c point source 119 c S o u r c e was moved to 2 . 2 5 cm away f o r Apr 2010 r u n s 120 SDEF POS= 0 −2.25 0 CEL=43 ERG =D1 PAR=3 121 c 122 c d e f a u l t DIR s e n d s p a r t i c l e anywhere i n f o r w a r d h e m i s p h e r e 123 c 124 c E n e r g i e s and p r o b a b i l i t i e s 125 SI1 L 0.48169 0.55383 0.56584 0.97565 1.04779 1.05981 1.68222 126 SP1 D 131 38 13 609 160 47 2 127 c 128 c Tally 129 F8 : E 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 & 130 28 29 30 31 32 33 34 35 36 37 38 39 40 41 T 131 E8 0 . 1 . e−5 1 . e−3 0 . 0 1 84 I 1 . 6 9 $ 20 keV b i n s ( T r i a l Run f o r peak m a t c h i n g ) 132 F18 : E 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 & 133 28 29 30 31 32 33 34 35 36 37 38 39 40 41 T 134 E18 0 . 1 . e−5 1 . e−3 0 . 0 1 84 I 1 . 6 9 135 ∗F28 : E 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 & 136 28 29 30 31 32 33 34 35 36 37 38 39 40 41 T 137 E28 0 . 1 . e−5 1 . e−3 0 . 0 1 84 I 1 . 6 9 138 c 139 FT8 GEB 0 . 1 7 5 0 0 $175keV r e s o l u t i o n a t a l l E 140 PHYS : E 1 . 6 8 2 2 2 141 c 142 c material 143 M1 1 4 0 0 0 1 COND=1 $ n a t u r a l s i l i c o n , s e t to c o n d u c t o r 144 M2 1 3 0 0 0 1 COND=1 $ n a t u r a l aluminium , s e t to c o n d u c t o r 145 c 146 c s e t e n e r g y i n d e x i n g to ITS 3 . 0 147 DBCN 17 J 1 148 c 149 c c u t o f f c a r d (number o f h i s t o r i e s to t r a c k ) 150 NPS 1 e 6 5.5 GEANT4 5.5.1 Driver and Compact Macro Driver 1 /∗ MonoE2block . c c : a line in C++ can be 80 c h a r | 2 3 Purpose : 4 T h i s i s t h e main program i n a s i m p l e GEANT s i m u l a t i o n . 5 I t s h o u l d run an e n t i r e GEANT s c e n a r i o . Zach M e i s e l 6 began b u i l d i n g t h i s f i l e from s c r a t c h on Aug−4−09 7 u s i n g t h e e x a m p l e s from t h e User ’ s A p p l i c a t i o n Guide 8 a s w e l l a s H e a t h e r Crawford ’ s Geant s i m u l a t i o n s f o r 9 e x p t s 0 8 0 0 8 and 0 7 0 2 5 , which a r e l o c a t e d i n my 10 T h e s i s 6 9 B r /GEANT/BCS/ d i r e c t o r y . 11 ∗/ 12 /# # # # # # # # # # # # # # # # # # / # # # # # # # # # # # # # # # # # # 13 // To be i n c l u d e d e v e n t u a l l y ( some s o o n e r than o t h e r s ) 14 /# # # # # # # # # # # # # # # # # # ∗ # # # # # # # # # # # # # # # # # # 15 #include ” S t e p p i n g V e r b o s e . hh” 16 # # # # # # # # # # # # # # # # # # #/ # # # # # # # # # # # # # # # # # # ∗ 17 // ANYTHING INVOLVING RESUTLTS OR RANDOMIZE 18 // WAS ADDED 9 / 2 9 / 0 9 19 20 #include ”G4RunManager . hh” 21 #include ” G4UImanager . hh” 22 #include ” G 4 U I t e r m i n a l . hh” 23 #include ” G4UItcsh . hh” 24 25 #i f d e f G4UI USE XM 26 #include ”G4UIXm . hh ” 27 #e n d i f 28 29 #i f d e f G4VIS USE // ZM 1 0 / 1 9 / 0 9 30 #include ” VisManager . hh” 31 #e n d i f 32 47
  • 62.
    33 #include ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh” 34 #include ” M E 2 b P h y s i c s L i s t . hh” 35 #include ” ME2bPrimaryGeneratorAction . hh” 36 #include ” RunAction . hh” 37 #include ” E v e n t A c t i o n . hh” 38 #include ” S t e p p i n g A c t i o n . hh” 39 #include ” S t e p p i n g V e r b o s e . hh” 40 #include ” Randomize . hh” 41 #include ” R e s u l t s . hh” 42 43 i n t main ( i n t , c h a r ∗∗ a r g v ) 44 { 45 46 //Random E n g i n e ZM 9 / 2 9 / 0 9 47 CLHEP : : HepRandom : : s e t T h e E n g i n e ( new CLHEP : : RanecuEngine ) ; 48 49 // V e r b o s e o u t p u t c l a s s 50 G4VSteppingVerbose ∗ v e r b o s i t y = new S t e p p i n g V e r b o s e ; 51 G4VSteppingVerbose : : S e t I n s t a n c e ( v e r b o s i t y ) ; 52 53 // s e t o u t p u t f i l e 54 G4String o u t p u t f i l e n a m e = argv [ 2 ] ; 55 56 // s e t mandatory i n i t i a l i z a t i o n c l a s s e s 57 M E 2 b D e t e c t o r C o n s t r u c t i o n ∗ d e t e c t o r = new M E 2 b D e t e c t o r C o n s t r u c t i o n ( ) ; 58 R e s u l t s ∗ r e s u l t s = new R e s u l t s ( d e t e c t o r , o u t p u t f i l e n a m e ) ; 59 60 if ( r e s u l t s − i l e a t t a c h e d f l a g == f a l s e ) >f 61 { 62 exit ( 1 ) ; 63 } 64 65 // c o n s t r u c t t h e d e f a u l t run manager 66 G4RunManager∗ runManager = new G4RunManager ; 67 runManager− >S e t U s e r I n i t i a l i z a t i o n ( d e t e c t o r ) ; 68 69 // s e t a n o t h e r mandatory i n i t i a l i z a t i o n c l a s s 70 G 4 V U s e r P h y s i c s L i s t ∗ p h y s i c s = new M E 2 b P h y s i c s L i s t ; 71 runManager− >S e t U s e r I n i t i a l i z a t i o n ( p h y s i c s ) ; 72 73 // v i s u a l i z a t i o n manager ZM 1 0 / 1 9 / 0 9 74 #i f d e f G4VIS USE 75 G4VisManager ∗ v i s M a n a g e r = new VisManager ( ) ; 76 v i s M a n a g e r− I n i t i a l i z e ( ) ; > 77 #e n d i f 78 79 // s e t mandatory u s e r a c t i o n c l a s s 80 G 4 V U s e r P r i m a r y G e n e r a t o r A c t i o n ∗ g e n a c t i o n = new ME2bPrimaryGeneratorAction ( r e s u l t s ) ; 81 runManager− >S e t U s e r A c t i o n ( g e n a c t i o n ) ; 82 G4UserRunAction ∗ r u n a c t i o n = new RunAction ( d e t e c t o r ) ; 83 runManager− >S e t U s e r A c t i o n ( r u n a c t i o n ) ; 84 G4UserEventAction ∗ e v e n t a c t i o n = new E v e n t A c t i o n ( r e s u l t s ) ; 85 runManager− >S e t U s e r A c t i o n ( e v e n t a c t i o n ) ; 86 G 4 U s e r S t e p p i n g A c t i o n ∗ s t e p p i n g a c t i o n = new S t e p p i n g A c t i o n ; 87 runManager− >S e t U s e r A c t i o n ( s t e p p i n g a c t i o n ) ; 88 89 // I n i t i a l i z e G4 k e r n e l 90 runManager− I n i t i a l i z e ( ) ; > 91 92 // s e t v e r b o s i t i e s 93 // UI− >ApplyCommand ( ” / run / v e r b o s e 1 ” ) ; 94 // UI− >ApplyCommand ( ” / e v e n t / v e r b o s e 1 ” ) ; 95 // UI− >ApplyCommand ( ” / t r a c k i n g / v e r b o s e 1 ” ) ; 96 97 //Read macro ( n e c e s s a r y f o r VRMLview ) 98 G4UImanager ∗ UI = G4UImanager : : G e t U I p o i n t e r ( ) ; 99 G 4 S t r i n g command = ” / c o n t r o l / e x e c u t e ” ; 100 G4String fileName = argv [ 1 ] ; 101 UI− >ApplyCommand ( command+f i l e N a m e ) ; 102 / / / / / i n s t e a d ( f o r now ) s t a r t t h e run i n t h i s f i l e 103 // i n t numberOfEvent = 1 0 0 0 0 ; 104 // runManager− >BeamOn( numberOfEvent ) ; 105 ///// 106 // j o b t e r m i n a t i o n 107 108 #i f d e f G4VIS USE 109 d e l e t e visManager ; 110 #e n d i f 111 112 d e l e t e runManager ; 113 delete verbosity ; 114 48
  • 63.
    115 // g o o f y c++ return number to let t h e program know t h i n g s r a n fine 116 return 0 ; 117 } 1 2 # 3 # # # ONCE FIXED COMMENT ALL EXCEPT / c o n t r o l s a v e H i s t o r y t h r o u g h l i n e 8 # # 4 #/ c o n t r o l / v e r b o s e 0 5 / control / saveHistory 6 #/run / v e r b o s e 2 7 #/e v e n t / v e r b o s e 0 8 #/ t r a c k i n g / v e r b o s e 1 9 # 4 g i v e s VERY d e t a i l e d t r a c k p o s i t i o n i n f o r m a t i o n ˆˆˆˆ 10 # 11 # Create a s c e n e h a n d l e r f o r a s p e c i f i c g r a p h i c s system 12 # ( E d i t t h e n e x t l i n e ( s ) to c h o o s e a n o t h e r g r a p h i c s y s t e m ) 13 # 14 # Open a v i e w e r and o u t p u t to i t 15 #/ v i s /open VRML2FILE 16 # C r e a t e an empty s c e n e 17 #/ v i s / s c e n e / c r e a t e 18 #/ v i s / s c e n e H a n d l e r / a t t a c h 19 # Output an empty d e t e c t o r 20 #/ v i s / v i e w e r / f l u s h 21 # 22 # f o r drawing the t r a c k s 23 # ( i f t o o many t r a c k s c a u s e c o r e dump = > s t o r e T r a j e c t o r y 0) 24 # 25 #/ t r a c k i n g / s t o r e T r a j e c t o r y 1 26 #/ v i s / s c e n e / e n d O f E v e n t A c t i o n a c c u m u l a t e −1#number added by ZM 8 / 0 4 / 0 9 27 #/ v i s / s c e n e / add / t r a j e c t o r i e s 28 29 / run /beamOn 1 0 0 0 0 0 0 30 31 #/ v i s / s c e n e / endOfRunAction a c c u m u l a t e 5.5.2 Header Files 5.5.3 EventAction.hh 1 #i f n d e f EventAction h 2 #d e f i n e EventAction h 1 3 4 #include ” G4UserEventAction . hh” 5 #include ” TrackerIonSD . hh” 6 //#include ”TrackerGammaSD . hh” 7 #include ” G4Event . hh” 8 #include ” G 4 T r a j e c t o r y C o n t a i n e r . hh ” 9 #include ” G 4 T r a j e c t o r y . hh” 10 #include ” G 4 i o s . hh ” 11 #include ” g l o b a l s . hh” 12 #include ” G4UnitsTable . hh” 13 #include ” R e s u l t s . hh” 14 15 c l a s s E v e n t A c t i o n : public G4UserEventAction 16 { 17 public : 18 EventAction ( R e s u l t s ∗ ) ; 19 ˜ EventAction ( ) ; 20 21 v o i d B e g i n O f E v e n t A c t i o n ( c o n s t G4Event ∗ ) ; 22 v o i d EndOfEventAction ( c o n s t G4Event ∗ ) ; 23 24 private : 25 Results ∗ r e s u l t s ; 26 G4int i o n C o l l e c t i o n I D ; 27 // G 4 i n t g a m m a C o l l e c t i o n I D ; 28 }; 29 30 #e n d i f //EVENTACTION H 5.5.4 experimentalHall.hh 5.5.5 experimentalhall Messenger.hh 49
  • 64.
    1 #i f n d e f experimentalHall Messenger h 2 #d e f i n e experimentalHall Messenger h 1 3 4 #include ” e x p e r i m e n t a l H a l l . hh” 5 #include ” g l o b a l s . hh” 6 #include ” G4UImessenger . hh” 7 #include ” G 4 U I d i r e c t o r y . hh” 8 #include ” G4UIcmdWithAString . hh ” 9 #include ” G4UIcmdWithADoubleAndUnit . hh” 10 #include ” G4UIcmdWithoutParameter . hh” 11 12 c l a s s e x p e r i m e n t a l H a l l M e s s e n g e r : public G4UImessenger { 13 public : 14 experimentalHall Messenger ( experimentalHall ∗); 15 ˜ experimentalHall Messenger ( ) ; 16 17 // v o i d SetNewValue ( G4UIcommand ∗ , G 4 S t r i n g ) ; / / p r o b a b l y n o t n e e d e d 18 19 private : 20 experimentalHall ∗ expHall ; 21 22 G4UIdirectory ∗ expHallDIR ; 23 G4UIcmdWithAString ∗ MatCmd ; 24 G4UIcmdWithADoubleAndUnit∗ XCmd; 25 G4UIcmdWithADoubleAndUnit∗ YCmd; 26 G4UIcmdWithADoubleAndUnit∗ ZCmd ; 27 G4UIcmdWithoutParameter ∗ RepCmd ; 28 }; 29 30 #e n d i f 5.5.6 Materials.hh 1 #i f n d e f Materials H 2 #d e f i n e Materials H 1 3 4 #include ” G 4 M a t e r i a l . hh” 5 6 class Materials 7 { 8 public : 9 10 11 Materials ( ) ; 12 ˜ Materials ( ) ; 13 14 G4Material ∗ FindMaterial ( G4String ); 15 16 private : 17 // E l e m e n t s 18 19 G4Element ∗ elementH ; 20 G4Element ∗ elementC ; 21 G4Element ∗ elementN ; 22 G4Element ∗ elementO ; 23 G4Element ∗ elementMg ; 24 G4Element ∗ elementAl ; 25 G4Element ∗ elementSi ; 26 G4Element ∗ elementTi ; 27 G4Element ∗ elementV ; 28 G4Element ∗ elementFe ; 29 G4Element ∗ elementMo ; 30 G4Element ∗ elementPt ; 31 G4Element ∗ elementAu ; 32 33 /∗Ta and I r added by P h i l and L u c i a on 1 / 2 0 / 0 9 ∗ / 34 G4Element ∗ e l e m e n t I r ; 35 G4Element ∗ elementTa ; 36 G4Element ∗ elementW ; 37 38 // M a t e r i a l s 39 40 G4Material ∗ vacuum ; 41 G4Material ∗ Al ; 42 G4Material ∗ Nb ; 43 G4Material ∗ C; 44 G4Material ∗ Au ; 45 G4Material ∗ Si ; 46 G4Material ∗ Be ; 47 G4Material ∗ nylon6 ; 50
  • 65.
    48 49 /∗Ta and I r added by P h i l and L u c i a on 1 / 2 0 / 0 9 ∗ / 50 51 G4Material ∗ I r ; 52 G 4 M a t e r i a l ∗ Ta ; 53 G 4 M a t e r i a l ∗ W; 54 }; 55 56 #e n d i f 5.5.7 ME2bDetectorConstruction.hh 1 #i f n d e f ME2bDetectorConstruction H 2 #d e f i n e ME2bDetectorConstruction H 1 3 4 #include ” M a t e r i a l s . hh” 5 #include ”G4SDManager . hh” 6 //#include ”G4RunManager . hh” 7 //#include ” G 4 M a t e r i a l . hh” 8 //#include ”G4Box . hh” 9 //#include ” G4ThreeVector . hh” 10 //#include ” G4PVPlacement . hh” 11 //#include ” G 4 V i s A t t r i b u t e s . hh” 12 #include ” G4LogicalVolume . hh” 13 #include ” G4VPhysicalVolume . hh” 14 //#include ” g l o b a l s . hh” // I S THIS NECESSARY? 15 #include ” G 4 V U s e r D e t e c t o r C o n s t r u c t i o n . hh” 16 #include ” TrackerIonSD . hh” 17 #include ” T r a c k e r I o n S D M e s s e n g e r . hh ” 18 #include ”G4SDManager . hh” 19 #include ” S i B l o c k M e s s e n g e r . hh” 20 #include ” S i B l o c k . hh” 21 #include ” e x p e r i m e n t a l H a l l . hh” 22 #include ” e x p e r i m e n t a l H a l l M e s s e n g e r . hh” 23 24 // i t seems a s i f t h e s e 4 might be r e p l a c e d by #include s t a t e m e n t s 25 // c l a s s G4Box ; 26 // c l a s s G4LogicalVolume ; 27 // c l a s s G4VPhysicalVolume ; 28 // c l a s s G 4 M a t e r i a l ; 29 30 c l a s s M E 2 b D e t e c t o r C o n s t r u c t i o n : public G 4 V U s e r D e t e c t o r C o n s t r u c t i o n 31 { 32 // public c l a s s members a r e a c c e s s i b l e from anywhere t h e o b j e c t i s v i s i b l e 33 public : 34 ME2bDetectorConstruction ( ) ; 35 ˜ ME2bDetectorConstruction ( ) ; 36 37 G4VPhysicalVolume ∗ C o n s t r u c t ( ) ; 38 39 // t h e s e a r e r e a l l y q u e s t i o n a b l e ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ ˜ 40 // S i B l o c k ( G4LogicalVolume ∗ , G 4 M a t e r i a l ∗ ) ; 41 //˜ S i B l o c k ( ) ; 42 43 // p r i v a t e c l a s s members a r e accessible only from w i t h i n o t h e r members o f 44 // t h e same c l a s s 45 private : 46 47 SiBlock ∗ theSiBlock ; 48 49 // L o g i c a l Volumes 50 G4LogicalVolume ∗ e x p e r i m e n t a l H a l l l o g ; 51 G4LogicalVolume ∗ aluminumChamber log ; 52 // G4LogicalVolume ∗ S i B l o c k l o g ; 53 54 // P h y s i c a l Volumes 55 G4VPhysicalVolume ∗ e x p e r i m e n t a l H a l l p h y s ; 56 G4VPhysicalVolume ∗ aluminumChamber phys ; 57 // G4VPhysicalVolume ∗ S i B l o c k p h y s ; 58 59 private : 60 TrackerIonSD ∗ T r a c k e r I o n ; 61 TrackerIonSD Messenger ∗ TrackerIonSDMessenger ; 62 SiBlock Messenger ∗ SiBlockMessenger ; 63 experimentalHall Messenger ∗ experimentalHallMessenger ; 64 }; 65 66 #e n d i f 51
  • 66.
    5.5.8 ME2bPhysicsList.hh 1 #i f n d e f ME2bPhysicsList h 2 #d e f i n e ME2bPhysicsList h 1 3 4 #include ” G 4 V U s e r P h y s i c s L i s t . hh ” 5 #include ” g l o b a l s . hh” 6 7 c l a s s ME2bPhysicsList : public G 4 V U s e r P h y s i c s L i s t 8 { 9 public : 10 ME2bPhysicsList ( ) ; 11 ˜ ME2bPhysicsList ( ) ; 12 13 protected : 14 // c o n s t r u c t p a r t i c l e and p h y s i c s process 15 void ConstructParticle ( ) ; 16 void ConstructProcess ( ) ; 17 v o i d ConstructEM ( ) ; 18 void SetCuts ( ) ; 19 }; 20 21 #e n d i f 5.5.9 ME2bPrimaryGeneratorAction.hh 1 #i f n d e f ME2bPrimaryGeneratorAction h 2 #d e f i n e ME2bPrimaryGeneratorAction h 1 3 4 #include ” G 4 V U s e r P r i m a r y G e n e r a t o r A c t i o n . hh” 5 #include ” G4RandomDirection . hh” 6 #include <v e c t o r >//< v e c t o r > ! ! ! a l s o w o r k s w/ d e p r e c a t e d h e a d e r < v e c t o r . h >!? w/ o u t Nolley ’ s changes 7 #include ” R e s u l t s . hh” 8 //#include ” Randomize . hh” 9 #include ” S o u r c e D a t a . hh” 10 11 c l a s s G4ParticleGun ; 12 c l a s s G4Event ; 13 14 c l a s s ME2bPrimaryGeneratorAction : public G 4 V U s e r P r i m a r y G e n e r a t o r A c t i o n 15 { 16 public : 17 ME2bPrimaryGeneratorAction ( R e s u l t s ∗ ) ; 18 ˜ ME2bPrimaryGeneratorAction ( ) ; 19 20 public : 21 v o i d G e n e r a t e P r i m a r i e s ( G4Event ∗ anEvent ) ; 22 23 // S e t S o u r c e function d e f i n e d h e r e 24 //// I ’m p r e t t y s u r e t h e s e 5 l i n e s a r e n ’ t n e c e s s a r y 25 v o i d S e t S o u r c e ( ) { gamma source = t r u e ; } ; 26 v o i d SetInBeam ( ) { 27 gamma source = f a l s e ; 28 alpha source = f a l s e ; 29 beta source = f a l s e ; 30 kr69decay = f a l s e ; 31 }; 32 //// I ’m a l s o u n s u r e a s to n e c e s s i t y o f t h e s o u r c e p o s i t i o n 33 v o i d S e t S o u r c e X ( G4double x ) { s o u r c e P o s i t i o n . s e t X ( x ) ; } ; 34 v o i d S e t S o u r c e Y ( G4double y ) { s o u r c e P o s i t i o n . s e t Y ( y ) ; } ; 35 v o i d S e t s o u r c e Z ( G4double z ) { s o u r c e P o s i t i o n . s e t Z ( z ) ; } ; 36 37 void SetSourceBi207 ( ) ; 38 G4double G e t S o u r c e E n e r g y ( ) ; 39 40 private : 41 G4ParticleGun ∗ p a r t i c l e G u n ; 42 Results ∗ r e s u l t s ; 43 G4int n p a r t i c l e ; 44 // E x t r a d e f i n i t i o n s h e r e i f s o u r c e function d e f i n e d above 45 G4ParticleTable ∗ particleTable ; 46 G4bool gamma source ; 47 G4bool a l p h a s o u r c e ; 48 G4bool b e t a s o u r c e ; 49 G4bool k r 6 9 d e c a y ; 50 // G4bool d e c a y s i m u l a t i o n ; 51 G4ThreeVector s o u r c e P o s i t i o n ; 52 //// was : 53 / / / / / v e c t o r <S o u r c e D a t a∗> TheSource ; 52
  • 67.
    54 //// now , upon n o l l e y ’ s s u g g e s t i o n : 55 s t d : : v e c t o r <S o u r c e D a t a∗> TheSource ; 56 /// end a d d i t i o n s due to n o l l e y 57 G4double s o u r c e B r a n c h i n g S u m ; 58 }; 59 60 #e n d i f 5.5.10 PixelParameterisation.hh 1 #i f n d e f PixelParameterisation H 2 #d e f i n e PixelParameterisation H 1 3 4 #include ” g l o b a l s . hh” 5 #include ” G4VPVParameterisation . hh ” 6 7 c l a s s G4VPhysicalVolume ; 8 c l a s s G4Box ; 9 10 // Dummy d e c l a r a t i o n s to g e t rid of warnings ... 11 c l a s s G4Trd ; 12 c l a s s G4Trap ; 13 c l a s s G4Cons ; 14 c l a s s G4Orb ; 15 c l a s s G4Sphere ; 16 c l a s s G4Torus ; 17 c l a s s G4Para ; 18 c l a s s G4Hype ; 19 c l a s s G4Tubs ; 20 c l a s s G4Polycone ; 21 c l a s s G4Polyhedra ; 22 23 class PixelParameterisation : public G4VPVParameterisation 24 { 25 public : 26 27 P i x e l P a r a m e t e r i s a t i o n ( G4int NoPixels , 28 G4double w i d t h P i x e l ) ; 29 30 virtual 31 ˜ PixelParameterisation ( ) ; 32 33 v o i d C o m p u t e T r a n s f o r m a t i o n ( c o n s t G4int , G4VPhysicalVolume ∗ ) c o n s t ; 34 35 v o i d ComputeDimensions ( G4Box& , c o n s t G4int , 36 c o n s t G4VPhysicalVolume ∗ ) c o n s t { } ; 37 38 private : // Dummy d e c l a r a t i o n s to g e t rid of warnings ... 39 40 v o i d ComputeDimensions ( G4Trd&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 41 v o i d ComputeDimensions ( G4Trap&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 42 v o i d ComputeDimensions ( G4Cons&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 43 v o i d ComputeDimensions ( G4Sphere &, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 44 v o i d ComputeDimensions ( G4Orb&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 45 v o i d ComputeDimensions ( G4Torus&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 46 v o i d ComputeDimensions ( G4Para&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 47 v o i d ComputeDimensions ( G4Hype&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 48 v o i d ComputeDimensions ( G4Tubs&, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 49 v o i d ComputeDimensions ( G4Polycone &, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 50 v o i d ComputeDimensions ( G4Polyhedra &, c o n s t G4int , c o n s t G4VPhysicalVolume ∗ ) c o n s t {} 51 private : 52 53 G4int fNoPixels ; 54 G4double f H a l f W i d t h ; // The h a l f −w i d t h o f each t r a c k e r chamber 55 56 }; 57 58 #e n d i f 5.5.11 Results.hh 1 #i f n d e f R e s u l t s h 2 #d e f i n e R e s u l t s h 1 3 #include ” g l o b a l s . hh” 4 #include ” T r a c k e r I o n H i t . hh” 5 //#include ” TrackerGammaHit . hh” 6 #include ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh” 7 #include <s t d i o . h> 53
  • 68.
    8 #include < s t d l i b . h> 9 #include < s t r i n g . h> 10 #include <f s t r e a m >//ZM 1 0 / 2 0 / 0 9 11 12 cl ass Results 13 { 14 public : 15 R e s u l t s ( ME2bDetectorConstruction ∗ , G4String ) ; 16 ˜ Results ( ) ; 17 18 public : 19 G4bool file attached flag ; 20 21 public : 22 // d e l e t e d s e c o n d i n p u t i n t o f u n c t i o n s , b e c a u s e n o t u s i n g gamma h i t s 23 void Print2Screen ( TrackerIonHitsCollection ∗ ) ; 24 v o i d SaveData ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ ) ; 25 void ExtractData ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ ) ; 26 v o i d S e t P o s i t r o n I E ( G4double en ) { p o s i t r o n I E = en ; } ; 27 v o i d S e t E l e c t r o n I E ( G4double en ) { e l e c t r o n I E = en ; } ; 28 v o i d SetProtonOneIE ( G4double en ) { protonOneIE = en ; } ; 29 v o i d SetProtonTwoIE ( G4double en ) { protonTwoIE = en ; } ; 30 v o i d S e t P r o t o n T h r e e I E ( G4double en ) { p r o t o n T h r e e I E = en ; } ; 31 v o i d S e t A l p h a I E ( G4double en ) { a l p h a I E = en ; } ; 32 v o i d SetGammaOneIE ( G4double en ) { gammaOneIE = en ; } ; 33 v o i d SetGammaTwoIE ( G4double en ) { gammaTwoIE = en ; } ; 34 v o i d SetGammaThreeIE ( G4double en ) { gammaThreeIE = en ; } ; 35 v o i d SetGammaFourIE ( G4double en ) { gammaFourIE = en ; } ; 36 37 private : 38 39 G4double positronIE ; 40 G4double electronIE ; 41 G4double protonOneIE ; 42 G4double protonTwoIE ; 43 G4double protonThreeIE ; 44 G4double alphaIE ; 45 G4double gammaOneIE ; 46 G4double gammaTwoIE ; 47 G4double gammaThreeIE ; 48 G4double gammaFourIE ; 49 50 G4bool print ; 51 G4String o u t p u t f i l e n a m e ; 52 53 struct ion event t { 54 bool hit ; 55 double trackID ; 56 double particleID ; 57 double beta ; 58 double theta ; 59 double phi ; 60 double time ; 61 double labtime ; 62 double globaltime ; 63 double KE; 64 double Edep ; 65 double pos x ; 66 double pos y ; 67 double pos z ; 68 double pixelID ; 69 }; 70 71 //4 p a r t i c l e t y p e s ( i n R e s u l t s . c c ) , 1600 pixels 72 i o n e v e n t t monoblock ev [ 4 ] [ 1 6 0 0 ] ; 73 74 // g a m m a e v e n t t gamma ev [ 4 ] [ 1 7 ] ; 75 76 ME2bDetectorConstruction∗ d e t e c t o r ; 77 78 }; 79 80 #e n d i f 5.5.12 RunAction.hh 1 #i f n d e f RunAction h 2 #d e f i n e RunAction h 1 3 4 #include ” G4UserRunAction . hh” 54
  • 69.
    5 #include ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh” 6 #include ”G4Run . hh ” 7 #include ” g l o b a l s . hh” 8 #include ” G4UnitsTable . hh” 9 10 c l a s s RunAction : public G4UserRunAction 11 { 12 public : 13 RunAction ( M E 2 b D e t e c t o r C o n s t r u c t i o n ∗ ) ; 14 ˜ RunAction ( ) ; 15 16 public : 17 v o i d BeginOfRunAction ( c o n s t G4Run ∗ ) ; 18 v o i d EndOfRunAction ( c o n s t G4Run ∗ ) ; 19 20 private : 21 M E 2 b D e t e c t o r C o n s t r u c t i o n ∗ myDetector ; 22 23 }; 24 25 26 27 28 #e n d i f 5.5.13 SiBlock.hh 1 #i f n d e f SiBlock H 2 #d e f i n e SiBlock H 1 3 4 //#include ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh” 5 #include ”G4RunManager . hh” 6 #include ” G 4 M a t e r i a l . hh” 7 #include ” M a t e r i a l s . hh” 8 #include ”G4Box . hh ” 9 //#include ” G 4 S u b t r a c t i o n S o l i d . hh ” 10 #include ” G4LogicalVolume . hh” 11 #include ” G4VPhysicalVolume . hh” 12 #include ” G4ThreeVector . hh” 13 #include ” G4PVPlacement . hh” 14 #include ” G 4 V i s A t t r i b u t e s . hh” 15 #include ” G4Colour . hh” 16 #include ” G 4 R o t a t i o n M a t r i x . hh” 17 #include ” G4Transform3D . hh” 18 #include ” G4UnitsTable . hh” 19 #include ” G 4 U s e r L i m i t s . hh” 20 #include ” G4PVParameterised . hh” 21 #include ” P i x e l P a r a m e t e r i s a t i o n . hh ” 22 23 24 c l a s s SiBlock { 25 public : 26 G4LogicalVolume ∗ e x p e r i m e n t a l H a l l l o g ; 27 28 S i B l o c k ( G4LogicalVolume ∗ , Materials ∗); 29 ˜ SiBlock ( ) ; 30 31 void Construct ( ) ; 32 v o i d S e t S i B l o c k X ( G4double ) ; 33 v o i d S e t S i B l o c k Y ( G4double ) ; 34 v o i d S e t S i B l o c k Z ( G4double ) ; 35 v o i d S e t S i B l o c k T h i c k n e s s ( G4double ) ; 36 v o i d S e t S i B l o c k P o s X ( G4double ) ; 37 v o i d S e t S i B l o c k P o s Y ( G4double ) ; 38 v o i d S e t S i B l o c k P o s Z ( G4double ) ; 39 G4LogicalVolume ∗ G e t S i B l o c k L o g ( ) { return p i x e l l o g ; } / / was S i B l o c k l o g 40 41 private : 42 // C o n s t r u c t i o n f l a g s 43 G4bool BUILD SiBlock ; 44 45 // D i m e n s i o n s 46 G4double S i B l o c k x ; / / = 4 . 0 ∗ cm ; / / s i d e x , dx 47 G4double S i B l o c k y ; / / = 4 . 0 ∗ cm ; / / s i d e y , dy 48 G4double S i B l o c k z ; / / = 0 . 0 5 ∗ cm ; // t h i c k n e s s , dz 49 50 G4double pixel x ; 51 G4double pixel y ; 52 53 // P o s i t i o n s 55
  • 70.
    54 G4double b l o c k P o s x ; / / = 0∗m; / / x−p o s i t i o n o f S i B l o c k 55 G4double b l o c k P o s y ; / / = 0∗m; / / y−p o s i t i o n o f S i B l o c k 56 G4double b l o c k P o s z ; / / = 7 . 5 ∗ cm ; / / z−p o s i t i o n o f S i B l o c k 57 58 // M a t e r i a l s 59 Materials ∗ materials ; 60 G4Material ∗ D e t e c t o r M a t e r i a l ; 61 G 4 M a t e r i a l ∗ VacuumMaterial ; 62 // G 4 M a t e r i a l ∗ P l a s t i c M a t e r i a l ; add if i add t h e plastic blocks 63 64 // s h a p e 65 G4Box∗ S i B l o c k b o x ; 66 67 G4Box∗ p i x e l b o x ; 68 69 // G 4 S u b t r a c t i o n S o l i d ∗ S i B l o c k s u r r o u n d b o x ; 70 71 // L o g i c a l volume 72 G4LogicalVolume ∗ S i B l o c k l o g ; 73 G4LogicalVolume ∗ p i x e l l o g ; 74 75 // P h y s i c a l volume 76 G4VPhysicalVolume ∗ S i B l o c k p h y s ; 77 G4VPhysicalVolume ∗ p i x e l p h y s ; 78 }; 79 #e n d i f 5.5.14 SiBlock Messenger.hh 1 #i f n d e f SiBlock Messenger h 2 #d e f i n e SiBlock Messenger h 1 3 4 //#include ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh” 5 #include ” S i B l o c k . hh” 6 #include ” g l o b a l s . hh” 7 #include ” G4UImessenger . hh” 8 #include ” G 4 U I d i r e c t o r y . hh” 9 #include ” G4UIcmdWithAString . hh ” 10 #include ” G4UIcmdWithADoubleAndUnit . hh” 11 #include ”G4UIcmdWithADouble . hh ” 12 #include ” G4UIcmdWithoutParameter . hh” 13 #include ” G4UIcmdWithAnInteger . hh ” 14 15 c l a s s S i B l o c k M e s s e n g e r : public G4UImessenger 16 { 17 public : 18 SiBlock Messenger ( SiBlock ∗ ) ; 19 ˜ SiBlock Messenger ( ) ; 20 21 // v o i d SetNewValue ( G4UIcommand ∗ , G 4 S t r i n g ) ; 22 23 private : 24 SiBlock ∗ theSiBlock ; 25 G4UIdirectory ∗ SiBlockDIR ; 26 G4UIcmdWithADoubleAndUnit∗ XSiBlockCmd ; 27 G4UIcmdWithADoubleAndUnit∗ YSiBlockCmd ; 28 G4UIcmdWithADoubleAndUnit∗ ZSiBlockCmd ; 29 G4UIcmdWithADoubleAndUnit∗ XPosSiBlockCmd ; 30 G4UIcmdWithADoubleAndUnit∗ YPosSiBlockCmd ; 31 G4UIcmdWithADoubleAndUnit∗ ZPosSiBlockCmd ; 32 }; 33 34 #e n d i f 5.5.15 SourceData.hh 1 #i f n d e f SourceData h 2 #d e f i n e SourceData h 1 3 4 c l a s s SourceData 5 { 6 public : 7 S o u r c e D a t a ( ) {} 8 S o u r c e D a t a ( G4double d e f e , G4double d e f b ) : e n e r g y ( d e f e ) , b r a n c h ( d e f b ) {} 9 v i r t u a l ˜ S o u r c e D a t a ( ) {} 10 11 G4double e n e r g y , branch ; 12 }; 56
  • 71.
    13 #e n d i f 5.5.16 SteppingAction.hh 1 #i f n d e f SteppingAction h 2 #d e f i n e SteppingAction h 1 3 4 #include ” G 4 U s e r S t e p p i n g A c t i o n . hh ” 5 6 class SteppingAction : public G 4 U s e r S t e p p i n g A c t i o n 7 { 8 9 public : 10 11 SteppingAction ( ) ; 12 ˜ SteppingAction ( ) { } ; 13 14 v o i d U s e r S t e p p i n g A c t i o n ( c o n s t G4Step ∗ ) ; 15 16 }; 17 18 #e n d i f 5.5.17 SteppingVerbose.hh 1 class SteppingVerbose ; 2 3 #i f n d e f SteppingVerbose h 4 #d e f i n e SteppingVerbose h 1 5 6 #include ” G 4 S t e p p i n g V e r b o s e . hh” 7 8 class SteppingVerbose : public G 4 S t e p p i n g V e r b o s e 9 { 10 11 public : 12 13 SteppingVerbose ( ) ; 14 ˜ SteppingVerbose ( ) ; 15 16 void StepInfo ( ) ; 17 void TrackingStarted ( ) ; 18 19 }; 20 21 #e n d i f 5.5.18 TrackerIonHit.hh 1 #i f n d e f TrackerIonHit h 2 #d e f i n e TrackerIonHit h 1 3 4 #d e f i n e GUN FLAG 1 5 #d e f i n e TARGET FACE FLAG 2// was t a r g e t =2 , d e g r a d e r =3 6 #d e f i n e TARGET BACK FLAG 3// rxn =4 , d e c a y =5 ,max=6 7 #d e f i n e DEGRADER FACE FLAG 4 8 #d e f i n e DEGRADER BACK FLAG 5 9 #d e f i n e REACTION FLAG 6 10 #d e f i n e DECAY FLAG 7 11 #d e f i n e MAX FLAGS 8 12 13 #include ”G4VHit . hh ” 14 #include ” G 4 T H i t s C o l l e c t i o n . hh” 15 #include ” G 4 A l l o c a t o r . hh” 16 #include ” G4ThreeVector . hh” 17 #include ” G4UnitsTable . hh” 18 #include ” G4VVisManager . hh” 19 #include ” G 4 C i r c l e . hh” 20 #include ” G4Colour . hh” 21 #include ” G 4 V i s A t t r i b u t e s . hh” 22 #include <iomanip> 23 24 c l a s s TrackerIonHit : public G4VHit 25 { 26 public : 57
  • 72.
    27 28 TrackerIonHit ( ) ; 29 ˜ TrackerIonHit ( ) ; 30 TrackerIonHit ( c o n s t TrackerIonHit &); 31 c o n s t T r a c k e r I o n H i t& operator=( c o n s t T r a c k e r I o n H i t & ) ; 32 G 4 i n t operator==( c o n s t T r a c k e r I o n H i t &) c o n s t ; 33 34 inline v o i d ∗ operator new ( s i z e t ) ; 35 inline void operator d e l e t e ( v o i d ∗ ) ; 36 37 v o i d Draw ( ) ; 38 v o i d Print ( ) ; 39 40 public : 41 42 void SetTrackID ( G4int t r a c k ) { trackID = t r a c k ; } ; 43 void S e t P a r t i c l e I D ( G4String p a r t i c l e ) { p a r t i c l e I D = p a r t i c l e ; }; 44 void S e t B e t a ( G4double b ) { b e t a = b ; } ; 45 void S e t T h e t a ( G4double t h ) { t h e t a = t h ; } ; 46 void S e t P h i ( G4double ph ) { p h i = ph ; } ; 47 void SetTime ( G4double p t ) { t i m e = p t ; } ; 48 void SetLabTime ( G4double l t ) { l a b t i m e = l t ; } ; 49 void SetGlobTime ( G4double g t ) { g l o b a l t i m e = g t ; } ; 50 void SetKE ( G4double k ) { KE = k ; } ; 51 void SetEdep ( G4double E) { Edep = E ; } ; 52 void S e t P o s ( G4ThreeVector xyz ) { p o s = xyz ; } ; 53 void SetGunFlag ( ) { f l a g = GUN FLAG ; } 54 void S e t D e c a y F l a g ( ) { f l a g = DECAY FLAG ; } 55 void S e t R e a c t i o n F l a g ( ) { f l a g = REACTION FLAG ; } 56 void S e t T a r g e t F a c e F l a g ( ) { f l a g = TARGET FACE FLAG ; } 57 void S e t T a r g e t B a c k F l a g ( ) { f l a g = TARGET BACK FLAG ; } 58 void S e t D e g r a d e r F a c e F l a g ( ) { f l a g = DEGRADER FACE FLAG ; } 59 void S e t D e g r a d e r B a c k F l a g ( ) { f l a g = DEGRADER BACK FLAG ; } 60 void SetVolName ( G 4 S t r i n g vn ) { volname = vn ; } 61 void S e t L e n g t h ( G4double l e n ) { l e n g t h = l e n ; } 62 void S e t P i x e l ( G4int p i x e l ) { p i x e l I D = p i x e l ; } 63 64 G 4 i n t GetTrackID ( ) { return t r a c k I D ; } ; 65 G 4 S t r i n g G e t P a r t i c l e I D ( ) { return p a r t i c l e I D ; } ; 66 G4double GetBeta ( ) { return b e t a ; } ; 67 G4double GetTheta ( ) { return t h e t a ; } ; 68 G4double GetPhi ( ) { return p h i ; } ; 69 G4double GetTime ( ) { return t i m e ; } ; 70 G4double GetLabTime ( ) { return l a b t i m e ; } ; 71 G4double GetGlobTime ( ) { return g l o b a l t i m e ; } ; 72 G4double GetKE ( ) { return KE; } ; 73 G4double GetEdep ( ) { return Edep ; } ; 74 G4ThreeVector GetPos ( ) { return p o s ; } ; 75 G 4 S t r i n g GetVolName ( ) { return volname ; } ; 76 G4int G e t P i x e l ( ) { return p i x e l I D ; } ; 77 G4int G e t F l a g ( ) { return f l a g ; } 78 G4double GetLength ( ) { return l e n g t h ; } 79 private : 80 81 G4int trackID ; 82 G4String particleID ; 83 G4double beta ; 84 G4double theta ; 85 G4double phi ; 86 G4double time ; 87 G4double labtime ; 88 G4double globaltime ; 89 G4double KE; 90 G4double Edep ; 91 G4ThreeVector pos ; 92 G4String volname ; 93 G4int pixelID ; 94 G4int flag ; 95 G4double length ; 96 }; 97 98 typedef G 4 T H i t s C o l l e c t i o n <T r a c k e r I o n H i t > T r a c k e r I o n H i t s C o l l e c t i o n ; 99 100 extern G 4 A l l o c a t o r <T r a c k e r I o n H i t > T r a c k e r I o n H i t A l l o c a t o r ; 101 102 i n l i n e v o i d ∗ T r a c k e r I o n H i t : : operator new ( s i z e t ) 103 { 104 void ∗ aHit ; 105 aHit = ( void ∗) T r a c k e r I o n H i t A l l o c a t o r . M a l l o c S i n g l e ( ) ; 106 return a H i t ; 107 } 108 58
  • 73.
    109 i n l i n e v o i d T r a c k e r I o n H i t : : operator d e l e t e ( v o i d ∗ a H i t ) 110 { 111 T r a c k e r I o n H i t A l l o c a t o r . F r e e S i n g l e ( ( TrackerIonHit ∗) aHit ) ; 112 } 113 114 #e n d i f 5.5.19 TrackerIonSD.hh 1 #i f n d e f TrackerIonSD h 2 #d e f i n e TrackerIonSD h 1 3 4 #include ” G 4 V S e n s i t i v e D e t e c t o r . hh ” 5 #include ” T r a c k e r I o n H i t . hh” 6 #include ” G4HCofThisEvent . hh” 7 #include ” G4Step . hh ” 8 #include ” G4ThreeVector . hh” 9 #include ”G4SDManager . hh” 10 #include ” G 4 i o s . hh ” 11 #include ” G4UnitsTable . hh” 12 #include ” G4VTouchable . hh” 13 #include ” G4VProcess . hh” 14 #include ” G 4 S t e p S t a t u s . hh” 15 #include ” G 4 T r a c k S t a t u s . hh” 16 17 c l a s s TrackerIonSD : public G 4 V S e n s i t i v e D e t e c t o r 18 { 19 public : 20 TrackerIonSD ( G 4 S t r i n g ) ; 21 ˜ TrackerIonSD ( ) ; 22 23 void SetPrint ( ) { 24 G4cout << ”− − − > Ion t r a c k data set to print a t t h e end o f e v e n t ”<<G4endl ; 25 print = t r u e ; 26 } 27 void UnSetPrint ( ) { 28 G4cout << ”− − − > Ion t r a c k data set not to print a t t h e end o f e v e n t ”<<G4endl ; 29 print = f a l s e ; 30 } 31 32 v o i d I n i t i a l i z e ( G4HCofThisEvent ∗ ) ; 33 G4bool P r o c e s s H i t s ( G4Step ∗ , G 4 T o u c h a b l e H i s t o r y ∗ ) ; 34 v o i d EndOfEvent ( G4HCofThisEvent ∗ ) ; 35 36 private : 37 TrackerIonHitsCollection ∗ ionCollection ; 38 G4bool p r i n t ; 39 40 }; 41 42 43 #e n d i f 5.5.20 TrackerIonSD Messenger.hh 1 #i f n d e f TrackerIonSD Messenger h 2 #d e f i n e TrackerIonSD Messenger h 1 3 4 #include ” TrackerIonSD . hh” 5 #include ” g l o b a l s . hh” 6 #include ” G4UImessenger . hh” 7 #include ” G 4 U I d i r e c t o r y . hh” 8 #include ” G4UIcmdWithAString . hh ” 9 #include ” G4UIcmdWithADoubleAndUnit . hh” 10 #include ”G4UIcmdWithADouble . hh ” 11 #include ” G4UIcmdWithoutParameter . hh” 12 #include ” G4UIcmdWithAnInteger . hh ” 13 14 15 c l a s s T r a c k e r I o n S D M e s s e n g e r : public G4UImessenger 16 { 17 public : 18 T r a c k e r I o n S D M e s s e n g e r ( TrackerIonSD ∗ ) ; 19 ˜ TrackerIonSD Messenger ( ) ; 20 21 v o i d SetNewValue ( G4UIcommand ∗ , G 4 S t r i n g ) ; 22 23 private : 59
  • 74.
    24 TrackerIonSD ∗ t r a c k e r ; 25 G4UIdirectory ∗ PrtDir ; 26 G4UIcmdWithoutParameter ∗ PrtSCmd ; 27 G4UIcmdWithoutParameter ∗ PrtUCmd ; 28 29 }; 30 31 32 #e n d i f 5.5.21 VisManager.hh 1 // V i s u a l i z a t i o n Manager 2 // Updated November 1 0 , 2008 3 4 #i f n d e f VisManager h 5 #d e f i n e VisManager h 1 6 7 #i f d e f G4VIS USE 8 9 #include ” G4VisManager . hh” 10 11 class VisManager : public G4VisManager 12 { 13 14 public : 15 16 VisManager ( ) ; 17 18 private : 19 20 void RegisterGraphicsSystems ( ) ; 21 22 }; 23 24 #e n d i f 25 #e n d i f 5.5.22 Source Files 5.5.23 EventAction.cc 1 #include ” E v e n t A c t i o n . hh” 2 3 4 E v e n t A c t i o n : : E v e n t A c t i o n ( R e s u l t s ∗ RE ) : r e s u l t s (RE) 5 { 6 i o n C o l l e c t i o n I D =−1; 7 // g a m m a C o l l e c t i o n I D =−1; 8 } 9 10 11 EventAction : : ˜ EventAction ( ) 12 { 13 ; 14 } 15 16 v o i d E v e n t A c t i o n : : B e g i n O f E v e n t A c t i o n ( c o n s t G4Event ∗ ) 17 { 18 19 G4SDManager ∗ SDman = G4SDManager : : GetSDMpointer ( ) ; 20 21 i f ( i o nCo l l e c t i o nID < 0) 22 { 23 // g a m m a C o l l e c t i o n I D=SDman− >G e t C o l l e c t i o n I D ( ” g a m m a C o l l e c t i o n ” ) ; 24 i o n C o l l e c t i o n I D=SDman− >G e t C o l l e c t i o n I D ( ” i o n C o l l e c t i o n ” ) ; 25 } 26 27 } 28 29 30 31 v o i d E v e n t A c t i o n : : EndOfEventAction ( c o n s t G4Event ∗ e v t ) 32 { 33 // G4cout << ”+++++ End o f e v e n t ” << e v t− >GetEventID ( ) << G4endl ; 34 60
  • 75.
    35 G4int e v e n t i d = e v t−>GetEventID ( ) ; 36 37 i f ( e v e n t i d % 10000==0) { 38 G4cout << ” Number o f p r o c e s s e d e v e n t s ” << e v e n t i d << G4endl ; 39 } 40 41 i f ( i o n C o l l e c t i o n I D < 0 ) return ; 42 43 G4TrajectoryContainer ∗ t r a j e c t o r y C o n t a i n e r = evt− >G e t T r a j e c t o r y C o n t a i n e r ( ) ; 44 G4int n t r a j e c t o r i e s = 0 ; 45 if ( trajectoryContainer ) 46 { 47 n t r a j e c t o r i e s = trajectoryContainer − >e n t r i e s ( ) ; 48 } 49 50 G4HCofThisEvent ∗ HCE = e v t−>GetHCofThisEvent ( ) ; 51 52 i f (HCE) { 53 // results −>P r i n t 2 S c r e e n ( ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ ) (HCE >GetHC ( i o n C o l l e c t i o n I D ) ) , − ( TrackerGammaHitsCollectio 54 results −>SaveData ( ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ ) (HCE >GetHC ( i o n C o l l e c t i o n I D ) ) ) ; − 55 } 56 } 5.5.24 experimentalHall.cc 1 #include ” e x p e r i m e n t a l H a l l . hh” 2 3 e x p e r i m e n t a l H a l l : : e x p e r i m e n t a l H a l l ( M a t e r i a l s ∗ mat ) { 4 m a t e r i a l s = mat ; 5 e x p H a l l x = 1 5 . 0 ∗ cm ; 6 e x p H a l l y = 1 8 . 0 ∗ cm ; 7 e x p H a l l z = 1 5 . 0 ∗ cm ; 8 9 e x p e r i m e n t a l H a l l M a t e r i a l = m a t e r i a l s −>F i n d M a t e r i a l ( ”vacuum” ) ; 10 } 11 12 experimentalHall : : ˜ experimentalHall (){;} 13 14 G4VPhysicalVolume ∗ e x p e r i m e n t a l H a l l : : C o n s t r u c t ( ) { 15 e x p H a l l = new G4Box ( ” e x p H a l l b o x ” , e x p H a l l x , e x p H a l l y , e x p H a l l z ) ; 16 e x p e r i m e n t a l H a l l l o g = new G4LogicalVolume ( e x p H a l l , 17 experimentalHallMaterial , ” expHall log ” ,0 ,0 ,0); 18 e x p e r i m e n t a l H a l l p h y s = new G4PVPlacement ( 0 , G4ThreeVector ( ) , 19 experimentalHall log , ” expHall ” ,0 , f a l s e , 0 ) ; 20 21 // v i s i b i l i t y business here , if added 22 23 return e x p e r i m e n t a l H a l l p h y s ; 24 } 5.5.25 exerimentalHall Messenger.cc 1 #include ” e x p e r i m e n t a l H a l l M e s s e n g e r . hh” 2 3 e x p e r i m e n t a l H a l l M e s s e n g e r : : e x p e r i m e n t a l H a l l M e s s e n g e r ( e x p e r i m e n t a l H a l l ∗){ 4 expHallDIR = new G 4 U I d i r e c t o r y ( ” / e x p H a l l / ” ) ; 5 expHallDIR− >S e t G u i d a n c e ( ” exp . H a l l c o n t r o l ” ) ; 6 7 MatCmd = new G4UIcmdWithAString ( ” / e x p H a l l / M a t e r i a l ” , t h i s ) ; 8 MatCmd−>S e t G u i d a n c e ( ” S e l e c t m a t e r i a l f o r t h e exp . h a l l ” ) ; 9 MatCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ; 10 MatCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ; 11 12 XCmd = new G4UIcmdWithADoubleAndUnit ( ” / e x p H a l l / X l e n g t h ” , t h i s ) ; 13 XCmd >S e t G u i d a n c e ( ” S e l e c t t h e X l e n g t h f o r t h e exp . h a l l ” ) ; − 14 XCmd >SetParameterName ( ” c h o i c e ” , f a l s e ) ; − 15 XCmd >A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ; − 16 17 YCmd = new G4UIcmdWithADoubleAndUnit ( ” / e x p H a l l / Y l e n g t h ” , t h i s ) ; 18 YCmd >S e t G u i d a n c e ( ” S e l e c t t h e Y l e n g t h f o r t h e exp . h a l l ” ) ; − 19 YCmd >SetParameterName ( ” c h o i c e ” , f a l s e ) ; − 20 YCmd >A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ; − 21 22 ZCmd = new G4UIcmdWithADoubleAndUnit ( ” / e x p H a l l / Z l e n g t h ” , t h i s ) ; 23 ZCmd >S e t G u i d a n c e ( ” S e l e c t t h e Z l e n g t h f o r t h e exp . h a l l ” ) ; − 24 ZCmd >SetParameterName ( ” c h o i c e ” , f a l s e ) ; − 25 ZCmd >A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ; − 61
  • 76.
    26 } 27 28 experimentalHall Messenger : : ˜ experimentalHall Messenger (){ 29 d e l e t e XCmd; 30 d e l e t e YCmd; 31 d e l e t e ZCmd ; 32 d e l e t e MatCmd ; 33 d e l e t e expHallDIR ; 34 } 5.5.26 Materials.cc 1 #include ” M a t e r i a l s . hh” 2 3 Materials : : Materials () 4 { 5 6 // E l e m e n t s 7 8 elementH = new G4Element ( ” Hydrogen ” , ”H” , 1. , 1 . 0 0 7 9 ∗ g / mole ) ; 9 elementC = new G4Element ( ” Carbon ” , ”C” , 6. , 1 2 . 0 1 1 ∗ g / mole ) ; 10 elementN = new G4Element ( ” N i t r o g e n ” , ”N” , 7. , 1 4 . 0 0 7 ∗ g / mole ) ; 11 elementO = new G4Element ( ” Oxygen ” , ”O” , 8. , 1 5 . 9 9 9 4 ∗ g / mole ) ; 12 elementMg = new G4Element ( ” Magnesium ” , ”Mg” , 1 2 . , 2 4 . 3 0 5 0 ∗ g / mole ) ; 13 elementAl = new G4Element ( ” Aluminium ” , ” Al ” , 1 3 . , 2 6 . 9 8 1 5 ∗ g / mole ) ; 14 elementSi = new G4Element ( ” S i l i c o n ” , ” Si ” ,14. , 2 8 . 0 8 5 5 ∗ g / mole ) ; 15 elementTi = new G4Element ( ” Titanium ” , ” Ti ” , 2 2 . , 4 7 . 9 0 ∗ g / mole ) ; 16 elementV = new G4Element ( ” Vanadium ” , ”V” , 2 3 . , 5 0 . 9 4 1 5 ∗ g / mole ) ; 17 elementFe = new G4Element ( ” I r o n ” , ” Fe ” , 2 6 . , 5 5 . 8 4 5 ∗ g / mole ) ; 18 elementMo = new G4Element ( ”Molybdenum ” , ”Mo” , 4 2 . , 9 5 . 9 4 ∗ g / mole ) ; 19 elementPt = new G4Element ( ” Platinum ” , ” Pt ” , 7 8 . , 1 9 5 . 0 8 ∗ g / mole ) ; 20 elementAu = new G4Element ( ” Gold ” , ”Au” , 7 9 . , 1 9 6 . 9 7 ∗ g / mole ) ; 21 elementIr = new G4Element ( ” I r i d i u m ” , ” Ir ” ,77. , 1 9 2 . 2 1 7 ∗ g / mole ) ; 22 elementTa = new G4Element ( ” Tantalum ” , ”Ta” , 7 3 . , 1 8 0 . 9 4 8 ∗ g / mole ) ; 23 elementW = new G4Element ( ” Tungsten ” , ”W” , 7 4 . , 1 8 3 . 8 5 ∗ g / mole ) ; 24 25 // M a t e r i a l s 26 27 vacuum = new G 4 M a t e r i a l ( ”vacuum ” , 1 , 1 . 0 0 7 9 4 ∗ g / mole , 28 1 . 0 E−25∗g /cm3 , k S t a t e G a s , 0 . 1 ∗ k e l v i n , 1 . 0 E−19∗ p a s c a l ) ; 29 30 Al = new G 4 M a t e r i a l ( ” Al ” , 1 3 , 2 6 . 9 8 1 5 3 ∗ g / mole , 2 . 7 0 ∗ g /cm3 ) ; 31 Nb = new G 4 M a t e r i a l ( ”Nb” , 4 1 , 9 2 . 9 0 6 3 8 ∗ g / mole , 8 . 5 7 ∗ g /cm3 ) ; 32 C = new G 4 M a t e r i a l ( ”C” , 6 , 1 2 . 0 1 1 ∗ g / mole , 2 . 1 5 ∗ g /cm3 ) ; 33 Au = new G 4 M a t e r i a l ( ”Au” , 7 9 . , 1 9 6 . 9 ∗ g / mole , 1 9 . 3 2 ∗ g /cm3 ) ; 34 Be = new G 4 M a t e r i a l ( ”Be” , 4 , 9 . 0 1 2 1 8 2 ∗ g / mole , 1 . 8 4 ∗ g /cm3 ) ; 35 Si = new G4Material ( ” Si ” , 1 4 . , 2 8 . 0 8 5 5 ∗ g / mole , 2 . 3 3 ∗ g /cm3 ) ; 36 Ir = new G4Material ( ” I r ” , 7 7 . , 1 9 2 . 2 1 7 ∗ g / mole , 2 2 . 5 6 ∗ g /cm3 ) ; 37 Ta = new G 4 M a t e r i a l ( ”Ta” , 7 3 . , 1 8 0 . 9 4 8 ∗ g / mole , 1 6 . 6 9 ∗ g /cm3 ) ; 38 W = new G 4 M a t e r i a l ( ”W” , 7 4 . , 1 8 3 . 8 5 ∗ g / mole , 1 9 . 3 ∗ g /cm3 ) ; 39 40 n y l o n 6 = new G 4 M a t e r i a l ( ” n y l o n 6 ” , 1 . 1 4 ∗ g /cm3 , 4 ) ; 41 n y l o n 6−>AddElement ( elementH , 9 . 7 9 7 6 ∗ p e r C e n t ) ; 42 n y l o n 6−>AddElement ( elementC , 6 3 . 6 8 5 6 ∗ p e r C e n t ) ; 43 n y l o n 6−>AddElement ( elementN , 1 2 . 3 7 7 9 ∗ p e r C e n t ) ; 44 n y l o n 6−>AddElement ( elementO , 1 4 . 1 3 8 9 ∗ p e r C e n t ) ; 45 } 46 47 Materials : : ˜ Materials () 48 {;} 49 50 51 G4Material ∗ M a t e r i a l s : : F i n d M a t e r i a l ( G4String materialName ) 52 { 53 // s e a r c h t h e m a t e r i a l by i t s name 54 G4Material ∗ p t t o M a t e r i a l = G4Material : : Ge t Ma t e r i a l ( materialName ) ; 55 return p t t o M a t e r i a l ; 56 57 } 5.5.27 ME2bDetectorConstruction.cc 1 /∗ l i k e l y l a t e r a d d i t i o n s : 2 #include ” G4PVReplica . hh” 3 ∗/ 4 #include ” M E 2 b D e t e c t o r C o n s t r u c t i o n . hh” 5 #include ” P i x e l P a r a m e t e r i s a t i o n . hh ” 6 #include ”G4SDManager . hh” 62
  • 77.
    7 #include ” G 4 M a t e r i a l . hh” 8 #include ”G4Box . hh ” 9 #include ”G4Tubs . hh ” 10 #include ”G4Cons . hh ” 11 #include ” G4LogicalVolume . hh” 12 #include ” G4ThreeVector . hh” 13 #include ” G4PVPlacement . hh” 14 #include ” G4Colour . hh” 15 #include ” G 4 i o s . hh ” 16 #include ” G 4 V i s A t t r i b u t e s . hh” 17 #include ” G4PVReplica . hh” 18 //#include ” G4VPhysicalVolume . hh ” 19 //#include ” G 4 V U s e r D e t e c t o r C o n s t r u c t i o n . hh” 20 #include ” g l o b a l s . hh” 21 // − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − 22 // c a l l t h e c o n s t r u c t e r function o f t h e d e t e c t o r c l a s s 23 //( d e f i n e d in the header f i l e ) 24 ME2bDetectorConstruction : : ME2bDetectorConstruction ( ) 25 {;} 26 27 // c a l l t h e d e s t r u c t o r o f t h e same c l a s s 28 ME2bDetectorConstruction : : ˜ ME2bDetectorConstruction ( ) 29 { 30 d e l e t e TrackerIonSDMessenger ; 31 d e l e t e SiBlockMessenger ; 32 delete experimentalHallMessenger ; 33 } 34 35 // c o n s t r u c t t h e p h y s i c a l volume 36 G4VPhysicalVolume ∗ M E 2 b D e t e c t o r C o n s t r u c t i o n : : C o n s t r u c t ( ) 37 { 38 39 // d e f i n e t h e m a t e r i a l s to be used− − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − 40 G4double a ; // Atomic mass 41 G4double z ; // Atomic number 42 G4double density ; 43 44 M a t e r i a l s ∗ m a t e r i a l s = new M a t e r i a l s ( ) ; 45 46 // G 4 M a t e r i a l ∗ S i = 47 // new G 4 M a t e r i a l ( ” S i l i c o n ” , z = 1 4 . , a = 2 8 . 0 8 5 5 ∗ g / mole , d e n s i t y= 2 . 3 2 9 ∗ g /cm3 ) ; 48 49 G 4 M a t e r i a l ∗ Al= 50 new G 4 M a t e r i a l ( ” Aluminium ” , z = 1 3 . , a = 2 6 . 9 8 1 5 ∗ g / mole , d e n s i t y =2.7∗ g /cm3 ) ; 51 52 // G 4 M a t e r i a l ∗ Vac = 53 // new G 4 M a t e r i a l ( ”Vacuum” , z = 1 . , a = 1 . 0 0 7 9 4 ∗ g / mole , 54 // d e n s i t y =1.0E−13∗g /cm3 , k S t a t e G a s , 0 . 1 ∗ k e l v i n , 1 . 3 3 0 E−3∗ p a s c a l ) ; 55 56 e x p e r i m e n t a l H a l l ∗ e x p H a l l = new e x p e r i m e n t a l H a l l ( m a t e r i a l s ) ; 57 e xp e r i me n t a l Ha l l p h ys = expHall− >C o n s t r u c t ( ) ; 58 e x p e r i m e n t a l H a l l l o g = expHall− >GetLogVolume ( ) ; 59 e x p e r i m e n t a l H a l l M e s s e n g e r = new e x p e r i m e n t a l H a l l M e s s e n g e r ( e x p H a l l ) ; 60 61 // d e f i n e t h e volumes− − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − 62 63 // added to s e p a r a t e module 64 // w o r l d volume 65 / / ( ” e x p e r i m e n t a l h a l l ” w/ b e a m l i n e a l o n g y−a x i s ) 66 // G4double e x p H a l l x = 1 5 . 0 ∗ cm ; 67 // G4double e x p H a l l y = 1 8 . 0 ∗ cm ; 68 // G4double e x p H a l l z = 1 5 . 0 ∗ cm ; 69 70 //G4Box∗ e x p e r i m e n t a l H a l l b o x 71 // = new G4Box ( ” e x p H a l l b o x ” , e x p H a l l x , e x p H a l l y , e x p H a l l z ) ; 72 73 // e x p e r i m e n t a l H a l l l o g = new G4LogicalVolume ( e x p e r i m e n t a l H a l l b o x , 74 // Vac , ” e x p H a l l l o g ” , 0 , 0 , 0 ) ; 75 76 // e x p e r i m e n t a l H a l l p h y s = new G4PVPlacement ( 0 , G4ThreeVector ( ) , 77 // experimentalHall log , ” expHall ” ,0 , f a l s e , 0 ) ; 78 79 // Aluminium Chamber ( a l o n g z−a x i s ) 80 G4double T u b e I n n e r R a d i u s = 7 . 5 ∗ cm ; 81 G4double TubeOuterRadius = 7 . 6 2 ∗ cm ; 82 G4double T u b e h a l f H e i g h t D Z = 8 . 3 1 ∗ cm ; / / ∗ ∗HALF t h e t u b e l e n g t h 83 G4double T u b e S t a r t A n g l e = 0 . ∗ deg ; // a n g l e i s i n p l a n e o f c i r c u l a r f a c e 84 G4double TubeSpanAngle = 3 6 0 . ∗ deg ; // t h i s p l u s t h e above a n g l e <=2∗ p i 85 G4Tubs∗ aluminumChamber = new G4Tubs ( ” AlChamber ” , T u b e I n n e r R a d i u s , 86 TubeOuterRadius , TubehalfHeightDZ , 87 T u b e S t a r t A n g l e , TubeSpanAngle ) ; 88 63
  • 78.
    89 aluminumChamber log = new G4LogicalVolume ( aluminumChamber , Al , 90 ” AlChamber log ” , 0 , 0 , 0 ) ; 91 92 G4double ChamberPos x = 0∗m; / / p o s i t o n s w/ r e s p e c t to w o r l d volume 93 G4double ChamberPos y = 0∗m ; / / . . . t h e s e might be way wrong 94 G4double ChamberPos z = 0∗m; 95 aluminumChamber phys = new G4PVPlacement ( 0 , 96 G4ThreeVector ( ChamberPos x , ChamberPos y , ChamberPos z ) , 97 aluminumChamber log , ” chamber ” , e x p e r i m e n t a l H a l l l o g , f a l s e , 0 ) ; 98 99 // ADDED TO M D L S i B l o c k . c c O UE 100 ///////////////////////////////////////////////////// 101 // S i l i c o n Block ( l i k e a s o l i d DSSD) 102 // G4double S i B l o c k x = 4 . 0 ∗ cm ; // h o p e f u l l y t h i s means s i d e l e n g t h 103 // G4double S i B l o c k y = 4 . 0 ∗ cm ; 104 // G4double S i B l o c k z = 0 . 0 5 ∗ cm ; 105 //G4Box∗ S i B l o c k b o x = new G4Box ( ” s i l i c o n B l o c k b o x ” , S i B l o c k x , 106 // SiBlock y , SiBlock z ) ; 107 108 // S i B l o c k l o g = new G4LogicalVolume ( S i B l o c k b o x , S i , ” s i l i c o n B l o c k l o g ” , 109 // 0 ,0 ,0); 110 111 // G4double b l o c k P o s x = 0∗m; 112 // G4double b l o c k P o s y = 0∗m; 113 // G4double b l o c k P o s z = 7 . 5 ∗ cm ; 114 // S i B l o c k p h y s = new G4PVPlacement ( 0 , 115 // G4ThreeVector ( b l o c k P o s x , b l o c k P o s y , b l o c k P o s z ) , 116 // SiBlock log , ” SiBlock ” , experimentalHall log , f a l s e , 0 ) ; 117 118 t h e S i B l o c k = new S i B l o c k ( e x p e r i m e n t a l H a l l l o g , m a t e r i a l s ) ; / / was S i B l o c k ( aluminumChamber log , materials ) 119 theSiBlock− >C o n s t r u c t ( ) ; 120 S i B l o c k M e s s e n g e r = new S i B l o c k M e s s e n g e r ( t h e S i B l o c k ) ; 121 122 //SENSITIVE DETECTOR 123 G4SDManager∗ SDman = G4SDManager : : GetSDMpointer ( ) ; 124 T r a c k e r I o n = new TrackerIonSD ( ” I o n T r a c k e r ” ) ; 125 T r a c k e r I o n S D M e s s e n g e r = new T r a c k e r I o n S D M e s s e n g e r ( T r a c k e r I o n ) ; 126 SDman− >AddNewDetector ( T r a c k e r I o n ) ; 127 128 // I b e l i e v e t h e l o g i c a l volume must be u s e d f o r s e n s i t i v i t y . . . . . . . ? 129 theSiBlock− >G e t S i B l o c k L o g ()−> S e t S e n s i t i v e D e t e c t o r ( T r a c k e r I o n ) ; 130 131 return e x p e r i m e n t a l H a l l p h y s ; 132 } 5.5.28 ME2bPhysicsList.cc 1 // M E 2 b P h y s i c s L i s t . c c for the simple s e t −up 2 3 //CODE ALTERATIONS : 4 // ZM 9 / 2 5 / 0 9 : 5 // WHAT: 1 ) a t t e m p t e d to f i x i n d i c e s f o r e+ p r o c e s s e s 6 // 2 ) a t t e m p t e d to f i x p r o c e s s manager f o r p 7 // W Y: 1 ) e r r o r thrown s a y i n g i n d e x out o f r a n g e H 8 // f o r G4ProcessManager : : G e t A t t r i b u t e ( ) : p a r t i c l e [ e +] 9 // and i r e a l i z e d e+ had no i n d i c e s f o r p r o c e s s e s 10 // 2 ) e r r o r thrown s a y i n g No P r o c e s s Manager f o r p r o t o n 11 // p r o t o n s h o u l d be c r e a t e d i n y o u r P h y s i c s L i s t 12 // WORKED? : 1 ) No , but I t h i n k t h e i n d i c e s were n e e d e d 13 // 2 ) Yes 14 // ZM 9 / 2 9 / 0 9 : 15 // WHAT: 1 ) swapped lowE i o n i z a t i o n and b r e m s s t r a h l u n g o f 16 // e+ to r e g u l a r i o n i z a t i o n and b r e m s s t r a h l u n g 17 // W Y: H 1 ) b e c a u s e t h e o t h e r s didn ’ t work 18 // WORKED? : 1 ) Yes 19 20 21 #include ” M E 2 b P h y s i c s L i s t . hh” 22 #include ” G 4 P a r t i c l e T y p e s . hh” 23 #include ” G4ComptonScattering . hh ” 24 #include ” G4GammaConversion . hh” 25 #include ” G 4 P h o t o E l e c t r i c E f f e c t . hh ” 26 #include ” G 4 e p l u s A n n i h i l a t i o n . hh ” 27 #include ” G 4 e B r e m s s t r a h l u n g . hh” 28 #include ” G4LowEnergyBremsstrahlung . hh” 29 #include ” G 4 e I o n i s a t i o n . hh” 30 #include ” G 4 M u l t i p l e S c a t t e r i n g . hh ” 31 #include ” G4ProcessManager . hh” 32 #include ” G 4 h M u l t i p l e S c a t t e r i n g . hh ” 33 #include ” G 4 h I o n i s a t i o n . hh” 64
  • 79.
    34 #include ” G 4 L o w E n e r g y I o n i s a t i o n . hh ” 35 36 // c a l l t h e c o n s t r u c t o r 37 ME2bPhysicsList : : ME2bPhysicsList ( ) 38 {;} 39 40 // c a l l t h e d e s t r u c t o r 41 ME2bPhysicsList : : ˜ ME2bPhysicsList ( ) 42 {;} 43 44 // d e f i n e t h e p a r t i c l e s 45 void ME2bPhysicsList : : C o n s t r u c t P a r t i c l e ( ) 46 { 47 // must c o n s t r u c t ALL p a r t i c l e s which w i l l be t r a n s p o r t e d / c r e a t e d 48 G4Electron : : E l e c t r o n D e f i n i t i o n ( ) ; 49 G4Positron : : P o s i t r o n D e f i n i t i o n ( ) ; 50 G4Gamma : : GammaDefinition ( ) ; 51 G4Alpha : : A l p h a D e f i n i t i o n ( ) ; 52 G4Proton : : P r o t o n D e f i n i t i o n ( ) ; / / added ZM 9 / 2 5 / 0 9 53 } 54 55 // d e f i n e p r o c e s s e s 56 void ME2bPhysicsList : : C o n s t r u c t P r o c e s s ( ) 57 { 58 // t r a n s p o r t a t i o n 59 AddTransportation ( ) ; 60 61 // e l e c t r o m a g n e t i c processes 62 ConstructEM ( ) ; 63 } 64 65 // d e f i n e t h e a l l o w e d e l e c t r o m a g n e t i c i n t e r a c t i o n s 66 v o i d M E 2 b P h y s i c s L i s t : : ConstructEM ( ) 67 { 68 //NOTE: t h i s p a r t o f t h e c o d e i s a DIRECT COPY o f Heather ’ s c o d e 69 // I ’m u n s u r e a s to w h e t h e r i t i s c o m p a t i b l e w i t h what I have 70 71 // c a l l r e s e t , t h e member o f t h e data s t r u c t which t P I p o i n t s to 72 theParticleIterator − eset (); >r 73 74 // while t h e v a l u e p o i n t e d to by t h e p a r t i c l e i t e r a t o r i s t r u e 75 while ( ( ∗ t h e P a r t i c l e I t e r a t o r ) ( ) ) 76 { 77 // Get t h e p r o c e s s manager f o r t h e p a r t i c l e 78 G4ParticleDefinition∗ particle = theParticleIterator − >v a l u e ( ) ; 79 G4ProcessManager ∗ pmanager = p a r t i c l e − >G e t P r o c e s s M a n a g e r ( ) ; 80 G4String particleName = p a r t i c l e − >G e t P a r t i c l e N a m e ( ) ; 81 82 // C o n s t r u c t p r o c e s s e s f o r G M A r a y s A M 83 i f ( p a r t i c l e N a m e == ”gamma” ) 84 { 85 G 4 P h o t o E l e c t r i c E f f e c t ∗ t h e P h o t o E l e c t r i c E f f e c t=new G 4 P h o t o E l e c t r i c E f f e c t ( ) ; 86 G4ComptonScattering ∗ t h e C o m p t o n S c a t t e r i n g = new G4ComptonScattering ( ) ; 87 G4GammaConversion∗ theGammaConversion = new G4GammaConversion ( ) ; 88 89 // r e g i s t e r p r o c e s s e s to gamma p r o c e s s manager 90 pmanager− >A d d D i s c r e t e P r o c e s s ( t h e P h o t o E l e c t r i c E f f e c t ) ; 91 pmanager− >A d d D i s c r e t e P r o c e s s ( t h e C o m p t o n S c a t t e r i n g ) ; 92 pmanager− >A d d D i s c r e t e P r o c e s s ( theGammaConversion ) ; 93 } 94 95 // c o n s t r u c t t h e p r o c e s s e s f o r PROTONS and ALPHAS 96 i f ( p a r t i c l e N a m e == ” p r o t o n ” | | p a r t i c l e N a m e == ” a l p h a ” ) 97 { 98 99 // r e g i s t e r p r o c e s s e s to p r o t o n p r o c e s s manager 100 pmanager− >A d d P r o c e s s ( new G 4 h M u l t i p l e S c a t t e r i n g , − 1 , 1 , 1 ) ; 101 pmanager− >A d d P r o c e s s ( new G 4 h I o n i s a t i o n , − 1 , 2 , 2 ) ; 102 } 103 104 // c o n s t r u c t t h e p r o c e s s e s f o r ELECTRONS 105 e l s e i f ( p a r t i c l e N a m e == ” e−” ) 106 { 107 G4VProcess ∗ t h e e m i n u s M u l t i p l e S c a t t e r i n g = new G 4 M u l t i p l e S c a t t e r i n g ( ) ; 108 G4VProcess ∗ t h e e m i n u s I o n i s a t i o n = new G 4 L o w E n e r g y I o n i s a t i o n ( ) ; 109 G4VProcess ∗ t h e e m i n u s B r e m s s t r a h l u n g = new G4LowEnergyBremsstrahlung ( ) ; 110 111 // r e g i s t e r p r o c e s s e s to e l e c t r o n p r o c e s s manager 112 pmanager− >A d d P r o c e s s ( t h e e m i n u s M u l t i p l e S c a t t e r i n g , − 1 , 1 , 1 ) ; 113 pmanager− >A d d P r o c e s s ( t h e e m i n u s I o n i s a t i o n , − 1 , 2 , 2 ) ; 114 pmanager− >A d d P r o c e s s ( t h e e m i n u s B r e m s s t r a h l u n g , − 1 , − 1 , 3 ) ; / / mid i n d x −1, NOT 3 115 // Energy n o t d e p o s i t e d c o r r e c t l y i f m i d d l e i n d e x i s a n o t h e r number 65
  • 80.
    116 // VERY DIFFERENT BEHAVIOR 117 118 // s e t o r d e r i n g f o r A l o n g S t e p D o I t 119 pmanager− >S e t P r o c e s s O r d e r i n g ( t h e e m i n u s M u l t i p l e S c a t t e r i n g , i d x A l o n g S t e p , 1 ) ; 120 pmanager− >S e t P r o c e s s O r d e r i n g ( t h e e m i n u s I o n i s a t i o n , i d x A l o n g S t e p , 2 ) ; 121 122 // s e t o r d e r i n g f o r P o s t S t e p D o I t 123 pmanager− >S e t P r o c e s s O r d e r i n g ( t h e e m i n u s M u l t i p l e S c a t t e r i n g , i d x P o s t S t e p , 1 ) ; 124 pmanager− >S e t P r o c e s s O r d e r i n g ( t h e e m i n u s I o n i s a t i o n , i d x P o s t S t e p , 2 ) ; 125 pmanager− >S e t P r o c e s s O r d e r i n g ( t h e e m i n u s B r e m s s t r a h l u n g , i d x P o s t S t e p , 3 ) ; 126 127 } 128 // c o n s t r u c e t h e p r o c e s s e s f o r POSITRONS 129 e l s e i f ( p a r t i c l e N a m e == ” e+” ) 130 { 131 G4VProcess ∗ t h e e p l u s M u l t i p l e S c a t t e r i n g = new G 4 M u l t i p l e S c a t t e r i n g ( ) ; 132 //Low e n e r g y p r o c e s s e s don ’ t work f o r p o s i t r o n s ! ! ! 133 G4VProcess ∗ t h e e p l u s I o n i s a t i o n = new G 4 e I o n i s a t i o n ( ) ; 134 G4VProcess ∗ t h e e p l u s B r e m s s t r a h l u n g = new G 4 e B r e m s s t r a h l u n g ( ) ; 135 // G4VProcess ∗ t h e e p l u s I o n i s a t i o n = new G 4 L o w E n e r g y I o n i s a t i o n ( ) ; 136 // G4VProcess ∗ t h e e p l u s B r e m s s t r a h l u n g = new G4LowEnergyBremsstrahlung ( ) ; 137 G4VProcess ∗ t h e e p l u s A n n i h i l a t i o n = new G 4 e p l u s A n n i h i l a t i o n ( ) ; 138 139 // r e g i s t e r p r o c e s s e s to p o s i t r o n p r o c e s s manager 140 // t h e numbers I add h e r e copy t h o s e f o r t h e e −. They 141 // c o r r e s p o n d to which s t e p s t h e p r o c e s s e s a p p l y ( i . e . 142 // a t r e s t , a l o n g s t e p , p o s t s t e p ) and t h e i r r e s p e c t i v e 143 // o r d e r . A minus s i g n means i t doesn ’ t happen a t t h a t s t e p 144 / / (REALLY I COPIED THE VALUES FROM an EX . i n manual S e c 5 . 2 ) ZM 9 / 2 5 / 0 9 145 pmanager− >A d d P r o c e s s ( t h e e p l u s M u l t i p l e S c a t t e r i n g , − 1 , 1 , 1 ) ; 146 pmanager− >A d d P r o c e s s ( t h e e p l u s I o n i s a t i o n , − 1 , 2 , 2 ) ; 147 pmanager− >A d d P r o c e s s ( t h e e p l u s B r e m s s t r a h l u n g , − 1 , 3 , 3 ) ; / / mid i n d x −1−−>3, 9 / 2 5 / 0 9 148 pmanager− >A d d P r o c e s s ( t h e e p l u s A n n i h i l a t i o n , 0 , − 1 , 4 ) ; 149 150 // s e t o r d e r i n g f o r A t R e s t D o I t 151 pmanager− >S e t P r o c e s s O r d e r i n g T o F i r s t ( t h e e p l u s A n n i h i l a t i o n , i d x A t R e s t ) ; 152 153 // s e t o r d e r i n g f o r A l o n g S t e p D o I t 154 pmanager− >S e t P r o c e s s O r d e r i n g ( t h e e p l u s M u l t i p l e S c a t t e r i n g , i d x A l o n g S t e p , 1 ) ; 155 pmanager− >S e t P r o c e s s O r d e r i n g ( t h e e p l u s I o n i s a t i o n , i d x A l o n g S t e p , 2 ) ; 156 157 // s e t o r d e r i n g f o r P o s t S t e p D o I t 158 pmanager− >S e t P r o c e s s O r d e r i n g ( t h e e p l u s M u l t i p l e S c a t t e r i n g , i d x P o s t S t e p , 1 ) ; 159 pmanager− >S e t P r o c e s s O r d e r i n g ( t h e e p l u s I o n i s a t i o n , i d x P o s t S t e p , 2 ) ; 160 pmanager− >S e t P r o c e s s O r d e r i n g ( t h e e p l u s B r e m s s t r a h l u n g , i d x P o s t S t e p , 3 ) ; 161 //WHAT ABOUT . . . O r d e r i n g ( t h e e p l u s A n n i h i l a t i o n , i d x P o s t S t e p , 4 ) ; ? ? ? ? 162 } 163 } 164 } 165 166 void ME2bPhysicsList : : SetCuts ( ) 167 { 168 // s u p p r e s s e r r o r m e s s a g e s e v e n i n case e /gamma/ p r o t o n do n o t e x i s t 169 // ? ? ? ? ? ? ? ? ? ? ? ? ? REALLY ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? why? 170 G 4 i n t temp = G e t V e r b o s e L e v e l ( ) ; 171 SetVerboseLevel ( 0 ) ; 172 173 // ” G 4 V U s e r P h y s i c s L i s t : : S e t C u t s W i t h D e f a u l t ” method s e t s the default 174 // c u t v a l u e f o r a l l p a r t i c l e t y p e s 175 SetCutsWithDefault ( ) ; 176 177 // R e t r i e v e v e r b o s e l e v e l 178 S e t V e r b o s e L e v e l ( temp ) ; 179 } 5.5.29 ME2bPrimaryGeneratorAction.cc 1 #include ” ME2bPrimaryGeneratorAction . hh” 2 3 #include ” G4Event . hh” 4 #include ” G 4 P a r t i c l e G u n . hh” 5 #include ” G 4 P a r t i c l e T a b l e . hh” 6 #include ” G 4 P a r t i c l e D e f i n i t i o n . hh ” 7 #include ” g l o b a l s . hh” 8 //#include ” Randomize . hh” 9 //#include ” G4ThreeVector . hh” 10 11 #include <math . h> 12 #include <t i m e . h> 13 66
  • 81.
    14 // added due to n o l l e y : 15 u s i n g namespace s t d ; 16 /// end a d d i t i o n s due to n o l l e y 17 18 19 ME2bPrimaryGeneratorAction : : ME2bPrimaryGeneratorAction ( R e s u l t s ∗ RE ) : r e s u l t s (RE) 20 { 21 // s o u r c e p a r t i c l e ( s t y l e l i k e h e a t h e r ’ s c o d e ) 22 23 gamma source = f a l s e ; 24 alpha source = f a l s e ; 25 beta source = f a l s e ; 26 kr69decay = true ; 27 i f ( b e t a s o u r c e ){ 28 s o u r c e P o s i t i o n . setX ( 0 ) ; 29 s o u r c e P o s i t i o n . setY ( 0 ) ; 30 s o u r c e P o s i t i o n . s e t Z ( 0 . 0 0 1 ∗ cm ) ; 31 SetSourceBi207 ( ) ; 32 } 33 else i f ( kr69decay ){ 34 s o u r c e P o s i t i o n . s e t X ( 0 . 0 5 ∗ cm ) ; 35 s o u r c e P o s i t i o n . s e t Y ( 0 . 0 5 ∗ cm ) ; 36 s o u r c e P o s i t i o n . s e t Z ( 7 . 0 1 2 5 ∗ cm ) ; 37 } 38 39 // S e t S o u r c e E u 1 5 2 ( ) ; 40 // S e t S o u r c e T h 2 2 8 ( ) ; 41 // S e t S o u r c e S r 9 0 ( ) ; 42 // S e t S o u r c e B i 2 0 7 ( ) ; 43 // SetSourceSRM ( ) ; 44 45 n particle = 1; 46 p a r t i c l e G u n = new G 4 P a r t i c l e G u n ( n p a r t i c l e ) ; 47 48 // t h i n g s i n c l u d e d i n EXN01 , but n o t i n h e a t h e r ’ s g e n e r a t o r a c t i o n 49 // vvv THIS I S USED FOR JUST A MONOENERGETIC ELECTRON SOURCE vvv 50 ////// G4P ar t i c l e Tabl e ∗ p a r t i c l e T a b l e = G4P ar t i c l e Tabl e : : G e t P a r t i c l e T a b l e ( ) ; 51 ////// G4String particleName ; 52 ////// particleGun − >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e −>F i n d P a r t i c l e ( p a r t i c l e N a m e=” e−” ) ) ; 53 //////// I n d i v i d u a l Bi207 E’ s 54 ///////// particleGun − >S e t P a r t i c l e E n e r g y ( 0 . 9 7 5 6 5 1 ∗MeV ) ; 55 ////// particleGun − >S e t P a r t i c l e E n e r g y ( 0 . 4 8 1 6 9 ∗MeV );//############# CHECK TO MAKE SURE THIS I S CORRECT 56 ////// particleGun − >S e t P a r t i c l e P o s i t i o n ( G4ThreeVector ( 0 . 0 , 0 . 0 , 0 . 0 0 1 ∗ cm ) ) ; 57 } 58 59 ME2bPrimaryGeneratorAction : : ˜ ME2bPrimaryGeneratorAction ( ) 60 { 61 delete particleGun ; 62 } 63 64 v o i d ME2bPrimaryGeneratorAction : : G e n e r a t e P r i m a r i e s ( G4Event ∗ anEvent ) 65 { 66 67 particleTable = G4ParticleTable : : GetParticleTable ( ) ; 68 69 //// T h i s s e c t i o n was u s e d f o r monoE s o u r c e 70 // Here I w i l l c r e a t e an i s o t r o p i c s o u r c e d i s t r i b u t i o n 71 // //W Y PREVIOUSLY USED(NOT o v e r 4 p i ) A 72 // // G4double d i r e c t i o n x = 2 . ∗ ( G4UniformRand ( ) − 0 . 5 ) ; 73 // // G4double d i r e c t i o n y = 2 . ∗ ( G4UniformRand ( ) − 0 . 5 ) ; 74 // // G4double d i r e c t i o n z = 2 . ∗ ( G4UniformRand ( ) − 0 . 5 ) ; 75 // // p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4ThreeVector ( d i r e c t i o n x , d i r e c t i o n y , d i r e c t i o n z ) ) ; 76 // 77 // //2 nd way to do i t ( d e f i n i t e l y i s o t r o p i c ) 78 // // p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ; 79 // 80 /∗ i f you d e f i n e d ” s o u r c e P o s i t i o n ” above , h e r e you would put : 81 ∗ particleGun− >S e t P a r t i c l e P o s i t i o n ( s o u r c e P o s i t i o n ) ; ∗ / 82 // 83 ////FIRE THE PARTICLE GUN! 84 // p a r t i c l e G u n − >G e n e r a t e P r i m a r y V e r t e x ( anEvent ) ; 85 86 // B e g i n newly added b u s i n e s s to s i m u l a t e S o u r c e s 87 i f ( gamma source ) { 88 particleGun− >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e − >F i n d P a r t i c l e ( ”gamma” ) ) ; 89 particleGun− >S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ; 90 particleGun− >S e t P a r t i c l e P o s i t i o n ( s o u r c e P o s i t i o n ) ; 91 particleGun− >S e t P a r t i c l e E n e r g y ( G e t S o u r c e E n e r g y ( ) ) ; } 92 else i f ( a l p h a s o u r c e ){ 93 particleGun− >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e − >F i n d P a r t i c l e ( ” a l p h a ” ) ) ; 94 // d i s t r i b u t e s s o u r c e o v e r cone , i f d e s i r e d 95 /// G4double t h e t a = G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ; 67
  • 82.
    96 /// G4double p h i − G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ; / / v a r y t h i s to make c o n e s m a l l e r ( now f u l l s p h e r e ) 97 /// p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4ThreeVector ( 1 ∗ c o s ( t h e t a ) ∗ s i n ( p h i ) , 1 ∗ s i n ( t h e t a ) ∗ s i n ( p h i ) , −1∗ c o s ( p 98 // i s o t r o p i c d i s t r i b u t i o n 99 particleGun− >S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ; 100 particleGun− >S e t P a r t i c l e P o s i t i o n ( s o u r c e P o s i t i o n ) ; 101 particleGun− >S e t P a r t i c l e E n e r g y ( G e t S o u r c e E n e r g y ( ) ) ; 102 particleGun− >G e n e r a t e P r i m a r y V e r t e x ( anEvent ) ; } 103 else i f ( beta source ) { 104 particleGun− >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e − >F i n d P a r t i c l e ( ” e−” ) ) ; 105 // d i s t r i b u t e s s o u r c e o v e r cone , i f d e s i r e d 106 /// G4double t h e t a = G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ; 107 /// G4double p h i − G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ; / / v a r y t h i s to make c o n e s m a l l e r ( now f u l l s p h e r e ) 108 /// p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4ThreeVector ( 1 ∗ c o s ( t h e t a ) ∗ s i n ( p h i ) , 1 ∗ s i n ( t h e t a ) ∗ s i n ( p h i ) , −1∗ c o s ( p 109 // i s o t r o p i c d i s t r i b u t i o n 110 particleGun− >S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ; 111 particleGun− >S e t P a r t i c l e P o s i t i o n ( s o u r c e P o s i t i o n ) ; 112 particleGun− >S e t P a r t i c l e E n e r g y ( G e t S o u r c e E n e r g y ( ) ) ; 113 particleGun− >G e n e r a t e P r i m a r y V e r t e x ( anEvent ) ; 114 } 115 else i f ( kr69decay ){ 116 // f o r now , t h e d e c a y w i l l be l o c a t e d a t a s i n g l e p l a c e 117 particleGun− >S e t P a r t i c l e P o s i t i o n ( G4ThreeVector ( 0 . 0 5 ∗ cm , 0 . 0 5 ∗ cm , 7 . 0 1 2 5 ∗ cm ) ) ; 118 119 //now we ’ l l p r o d u c e t h e p o s i t r o n from k r 6 9 120 G4String particleName ; 121 particleGun− >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e −>F i n d P a r t i c l e ( p a r t i c l e N a m e=” e+” ) ) ; 122 123 // s e l e c t the p o s i t r o n randomly o v e r t h e b e t a s p e c t r u m 124 125 // f i r s t p i c k which s t a t e you ’ r e g o i n g from and to 126 // g . s . to g . s (Q=14.53 −−> Ee+max = 1 4 . 5 3 −0.511 MeV) 127 G4double Qvalue ; 128 i f ( G4UniformRand ( ) < 0 . 8 3 ) { 129 Qvalue = 1 4 0 1 9 ; / / keV 130 } 131 else { 132 Qvalue = 1 0 0 6 9 ; / / keV 69 Kr g . s . − Me − ( 6 9 B r x . s . − 69 B r g . s . ) 133 } 134 // G4double Qvalue ; 135 // Qvalue = 1 0 . 0 6 9 ; 136 //now s a m p l e t h e d i s t r i b u t i o n 137 G4double randombase =1; 138 G4double randomE =0; 139 G4double c a l c P r o b =0; 140 G4double MomentPos =0; 141 142 while ( c a l c P r o b < randombase ) { 143 randombase = G4UniformRand ( ) ∗ 7 0 0 0 ; / / max P from c a l c u l a t e d s p e c t r u m i s ˜ 6 7 0 0 144 // randomE = G4UniformRand ( ) ∗ Qvalue ; 145 randomE = G4UniformRand ( ) ∗ Qvalue ; 146 // add coulomb c o r r e c t i o n F ( Z , Ee ) i f d e s i r e d , but s e e from B e t a S p e c C a l c t h a t i t ’ s minimal 147 MomentPos =(( randomE∗randomE ) + 2 . ∗ randomE ∗ 5 1 1 . 0 0 3 ) ; 148 149 c a l c P r o b= MomentPos ∗ ( Qvalue−randomE ) ∗ ( Qvalue−randomE ) ∗ ( 0 . 5 ∗ ( 1 / s q r t ( MomentPos ) ) ∗ 2 . ∗ ( randomE + 5 1 1 . 0 0 3 ) ) ; / / c o u l d a 150 } 151 152 particleGun−>S e t P a r t i c l e E n e r g y ( randomE∗keV ) ; 153 154 results −>S e t P o s i t r o n I E ( randomE / 1 0 0 0 . ) ; 155 156 //// r a n d o m i z e e over 4 pi 157 // p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ; 158 //// d i s t r i b u t e s s o u r c e o v e r cone , i f d e s i r e d 159 G4double t h e t a = G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ; / / a l w a y s 2∗ p i 160 G4double p h i = G4UniformRand ( ) ∗ ( 3 . 1 4 1 5 9 2 6 5 / 2 . ) ∗ r a d ; / / v a r y t h i s to make c o n e s m a l l e r ( now f u l l s p h e r e ) 161 particleGun− >S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4ThreeVector ( 1 ∗ c o s ( t h e t a ) ∗ s i n ( p h i ) , 1 ∗ s i n ( t h e t a ) ∗ s i n ( p h i ) , 1∗ c o s ( p h i ) ) 162 163 // F i r e t h e p o s i t r o n ! 164 particleGun− >G e n e r a t e P r i m a r y V e r t e x ( anEvent ) ; 165 166 //Now do t h e p r o t o n , e n e r g y d e p e n d s on which Q −v a l u e you u s e d 167 particleGun− >S e t P a r t i c l e P o s i t i o n ( G4ThreeVector ( 0 . 0 5 ∗ cm , 0 . 0 5 ∗ cm , 7 . 0 1 2 5 ∗ cm ) ) ; 168 particleGun− >S e t P a r t i c l e D e f i n i t i o n ( p a r t i c l e T a b l e −>F i n d P a r t i c l e ( p a r t i c l e N a m e=” p r o t o n ” ) ) ; 169 // p a r t i c l e G u n −>S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4RandomDirection ( ) ) ; 170 //// d i s t r i b u t e s s o u r c e o v e r cone , i f d e s i r e d 171 t h e t a = G4UniformRand ( ) ∗ ( 6 . 2 8 3 1 8 5 3 ) ∗ r a d ; / / a l w a y s 2∗ p i 172 p h i = G4UniformRand ( ) ∗ ( 3 . 1 4 1 5 9 2 6 5 / 2 . ) ∗ r a d ; / / v a r y t h i s to make c o n e s m a l l e r ( now f u l l s p h e r e ) 173 particleGun− >S e t P a r t i c l e M o m e n t u m D i r e c t i o n ( G4ThreeVector ( 1 ∗ c o s ( t h e t a ) ∗ s i n ( p h i ) , 1 ∗ s i n ( t h e t a ) ∗ s i n ( p h i ) , 1∗ c o s ( p h i ) ) 174 175 if ( Qvalue ==10069) 176 { 177 // G4cout<<”Q v a l u e = 4 . 0 7 Mev”<<G4endl ; 68
  • 83.
    178 particleGun− >S e t P a r t i c l e E n e r g y ( 4 . 0 7 ∗MeV ) ; 179 results −>SetProtonOneIE ( 4 . 0 7 ) ; 180 } 181 e l s e i f ( Qvalue ==14019) 182 { 183 // G4cout< <”Q v a l u e = 0 . 5MeV”<<G4endl ; 184 particleGun− >S e t P a r t i c l e E n e r g y ( 0 . 5 ∗MeV ) ; 185 results − >SetProtonOneIE ( 0 . 5 ) ; 186 } 187 else { 188 G4cout< I don ’ t know what y o u r Qvalue i s ”<<G4endl ; <” 189 } 190 191 // f i r e t h e p r o t o n 192 particleGun− >G e n e r a t e P r i m a r y V e r t e x ( anEvent ) ; 193 194 } 195 else { 196 G4cout< I don ’ t know what you ’ r e t r y i n g t o s i m u l a t e ; <” i n PrimGenAct ”<<G4endl ; 197 } 198 // add d e c a y s i m u l a t i o n h e r e i n w i t h t h e e l s e s 199 200 //EVENT COMPLETED 201 } 202 203 // new w/ B i 2 0 7 S o u r c e 204 v o i d ME2bPrimaryGeneratorAction : : S e t S o u r c e B i 2 0 7 ( ) 205 { 206 G4double e ; 207 s o u r c e B r a n c h i n g S u m =0; 208 209 // s t a r t from t h e b e g i n n i n g o f the array 210 v e c t o r <S o u r c e D a t a ∗ > : : i t e r a t o r i t P o s = TheSource . b e g i n ( ) ; 211 212 // c l e a r a l l e l e m e n t s from t h e a r r a y 213 f o r ( ; i t P o s < TheSource . end ( ) ; i t P o s ++){ 214 d e l e t e ∗ i t P o s ; // f r e e t h e e l e m e n t from memory 215 } 216 217 // c l e a r a l l e l e m e n t s from t h e a r r a y ( f o r real this time ) 218 TheSource . c l e a r ( ) ; 219 220 // e l e c t r o n e n e r g i e s and b r a n c h i n g r a t i o s 221 // t h i s i s s l i g h t l y d i f f e r e n t from Heather ’ s ( e x c l u d e 57 keV , include 1682 keV e ’ s ) 222 // r a t i o s computed from NNDC data 223 e = 4 8 1 . 6 9 ∗ keV ; s o u r c e B r a n c h i n g S u m +=2155; 224 TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ; 225 e = 5 5 3 . 8 3 ∗ keV ; s o u r c e B r a n c h i n g S u m +=623; 226 TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ; 227 e = 5 6 5 . 8 4 ∗ keV ; s o u r c e B r a n c h i n g S u m +=209; 228 TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ; 229 e = 9 7 5 . 6 5 ∗ keV ; s o u r c e B r a n c h i n g S u m +=10000; 230 TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ; 231 e = 1 0 4 7 . 7 9 ∗ keV ; s o u r c e B r a n c h i n g S u m +=2617; 232 TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ; 233 e = 1 0 5 9 . 8 1 ∗ keV ; s o u r c e B r a n c h i n g S u m +=768; 234 TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ; 235 e = 1 6 8 2 . 2 2 ∗ keV ; s o u r c e B r a n c h i n g S u m +=34; 236 TheSource . p u s h b a c k ( new S o u r c e D a t a ( e , s o u r c e B r a n c h i n g S u m ) ) ; 237 } 238 239 G4double ME2bPrimaryGeneratorAction : : G e t S o u r c e E n e r g y ( ) 240 { 241 G4double rand ; 242 243 rand = G4UniformRand ( ) ∗ s o u r c e B r a n c h i n g S u m ; 244 245 v e c t o r <S o u r c e D a t a ∗ > : : i t e r a t o r i t P o s = TheSource . b e g i n ( ) ; 246 247 for (; i t P o s < TheSource . end ( ) ; i t P o s ++) 248 { 249 if ( rand < ( ( ∗ i t P o s )−>b r a n c h ) ) { 250 return ( ∗ i t P o s )−>e n e r g y ; 251 } 252 } 253 return −1∗keV ; 254 } 5.5.30 PixelParameterisation.cc 69
  • 84.
    1 #include ” P i x e l P a r a m e t e r i s a t i o n . hh ” 2 3 #include ” G4VPhysicalVolume . hh” 4 #include ” G4ThreeVector . hh” 5 #include ”G4Box . hh ” 6 7 P i x e l P a r a m e t e r i s a t i o n : : P i x e l P a r a m e t e r i s a t i o n ( G4int NoPixels , G4double w i d t h P i x e l ) 8 { 9 fNoPixels = NoPixels ; 10 fHalfWidth = widthPixel ∗0.5; 11 } 12 13 PixelParameterisation : : ˜ PixelParameterisation () 14 {} 15 16 void P i x e l P a r a m e t e r i s a t i o n : : ComputeTransformation 17 ( c o n s t G 4 i n t copyNo , G4VPhysicalVolume ∗ physVol ) c o n s t 18 { 19 // p o s i t i o n s walk a l o n g x−y g r i d o f 1600 p i x e l s 20 // t h i s i s c h e c k e d i n DivVsModulus . f 9 0 i n my ( Z .M. ) Home D i r e c t o r y 21 u n s i g n e d s h o r t x = s t a t i c c a s t <u n s i g n e d s h o r t >(copyNo / 4 0 ) + 1 ; / / why a b s o l u t e and 22 u n s i g n e d s h o r t y = s t a t i c c a s t <u n s i g n e d s h o r t >(copyNo %40) + 1 ; / / why modulus ? 23 24 // p i x e l p o s i t i o n i s ( p i x e l w i d t h ) ∗ ( p i x e l n u m b e r +1) − ( h a l f w i d t h+p i x e l w i d t h / 2 ) o f d e t e c t o r 25 // s i n c e t h e r e a r e p i x e l n u m b e r −1 s t r i p s b e f o r e t h e p i x e l n u m b e r s t r i p 26 // and e a c h have a w i d t h o f ( p i x e l w i d t h =0.1cm ) . and then x i s a p p a r e n t l y 27 // t h e f a r s i d e o f new p i x e l a s compared to t h e a l r e a d y i n p l a c e p i x e l s u n t i l 28 // you s u b s t r a c t ( p i x e l w i d t h / 2 ) [ b e c a u s e t h e o r i g i n o f t h e p i x e l i s i n i t ’ s m i d d l e ] 29 // h a l f w i d t h i s s u b t r a c t e d to c e n t e r t h e DSSD . 30 G4double p i x e l X = ( −2.05 + 0 . 1 ∗ x ) ∗cm ; 31 G4double p i x e l Y = ( −2.05 + 0 . 1 ∗ y ) ∗cm ; 32 G4ThreeVector o r i g i n ( p i x e l X , p i x e l Y , 0 . 0 2 5 ∗ cm ) ; / / o r i g i n w/ r e s p e c t to S i B l o c k l o g 33 physVol− >S e t T r a n s l a t i o n ( o r i g i n ) ; 34 physVol− >S e t R o t a t i o n ( 0 ) ; 35 } 5.5.31 Results.cc 1 // E d i t e d from H . Crawford ’ s R e s u l t s . c c 2 //EDITS : 3 // 1 0 / 2 0 / 0 9 : d e l e t e d PIN , SEGA, DSSD(# o t h e r than 1 ) things 4 // 1 0 / 2 6 : began c o n v e r t i n g from s t r i p s to 1 block 5 6 #include ” R e s u l t s . hh” 7 8 R e s u l t s : : R e s u l t s ( M E 2 b D e t e c t o r C o n s t r u c t i o n ∗ DE, 9 G 4 S t r i n g f i l e n a m e ) : d e t e c t o r (DE) 10 { 11 // Try to open a new f i l e called ’ file name ’ , for o t h e r methods to use t o o . 12 13 std : : ofstream output file pointer ; 14 15 // Open t h e f i l e a s a new f i l e −− o v e r w r i t e any p r e v i o u s data . 16 o u t p u t f i l e p o i n t e r . open ( f i l e n a m e , s t d : : i o s : : b i n a r y ) ; / / / / / ( f i l e n a m e , std : : i o s : : binary ) ; 17 18 if ( ! output file pointer . is open ()) 19 { 20 G 4 c e r r << ” E r r o r : Could n o t open d a t a file s p e c i f i e d . ” << G4endl ; 21 this− f i l e a t t a c h e d f l a g = f a l s e ; > 22 this− >o u t p u t f i l e n a m e = ” s t d o u t ” ; 23 } 24 else i f ( o u t p u t f i l e p o i n t e r . is open ( ) ) 25 { 26 this − f i l e a t t a c h e d f l a g = true ; > 27 this− >o u t p u t f i l e n a m e = f i l e n a m e ; 28 } 29 else 30 { 31 G 4 c e r r << ” E r r o r : Could n o t open d a t a file s p e c i f i e d . ” << G4endl ; 32 this− f i l e a t t a c h e d f l a g = f a l s e ; > 33 this− >o u t p u t f i l e n a m e = ” s t d o u t ” ; 34 } 35 36 o u t p u t f i l e p o i n t e r . close ( ) ; 37 p r i n t= f a l s e ; 38 } 39 40 Results : : ˜ Results () 41 {;} 42 70
  • 85.
    43 void Results : : Print2Screen ( TrackerIonHitsCollectio n ∗ i o n C o l l e c t i o n ) 44 { 45 G4cout << ” P r i n t i n g r e s u l t s r e p o r t t o s c r e e n f o r c u r r e n t e v e n t ” << G4endl ; 46 G4cout << ” I n i t i a l e v e n t p a r a m e t e r s . . . ” << G4endl ; 47 G4cout << ” I n i t i a l p o s i t r o n e n e r g y : ” << p o s i t r o n I E 48 << ” I n i t i a l e l e c t r o n e n e r g y : ” << e l e c t r o n I E 49 << ” I n i t i a l p r o t o n 1 e n e r g y : ” << protonOneIE 50 << ” I n i t i a l p r o t o n 2 e n e r g y : ” << protonTwoIE 51 << ” I n i t i a l p r o t o n 3 e n e r g y : ” << p r o t o n T h r e e I E 52 << ” I n i t i a l a l p h a e n e r g y : ” << a l p h a I E << G4endl ; 53 G4cout << ” I n i t i a l gamma1 e n e r g y : ” << gammaOneIE 54 << ” I n i t i a l gamma2 e n e r g y : ” << gammaTwoIE 55 << ” I n i t i a l gamma3 e n e r g y : ” << gammaThreeIE 56 << ” I n i t i a l gamma4 e n e r g y : ” << gammaFourIE << G4endl ; 57 ExtractData ( i o n C o l l e c t i o n ) ; 58 G4cout << ” I o n i n f o r m a t i o n f i r s t . . . ” << G4endl ; 59 60 for ( i n t j =0; j <4; j ++){ 61 f o r ( i n t k =0; k <1600; k++){ 62 i f ( m o n o b l o c k e v [ j ] [ k ] . h i t == t r u e ) { 63 G4cout << ” P a r t i c l e : ” << m o n o b l o c k e v [ j ] [ k ] . p a r t i c l e I D << ”Time : ” 64 << m o n o b l o c k e v [ j ] [ k ] . g l o b a l t i m e << ” Edep : ” << m o n o b l o c k e v [ j ] [ j ] . Edep 65 //<<” i n d e t e c t o r ” << m o n o b l o c k e v [ j ] [ k ] . d e t e c t o r I D 66 <<” i n p i x e l ”<<m o n o b l o c k e v [ j ] [ k ] . p i x e l I D 67 << G4endl ; 68 } 69 } 70 } 71 G4cout << ”End o f r e p o r t . OR I S IT ? ? ? ? . . . it i s ” << G4endl ; 72 } 73 74 v o i d R e s u l t s : : SaveData ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ i o n C o l l e c t i o n ) 75 { 76 ExtractData ( i o n C o l l e c t i o n ) ; 77 78 std : : ofstream o u t p u t f i l e p o i n t e r ; 79 o u t p u t f i l e p o i n t e r . open ( t h i s −>o u t p u t f i l e n a m e , s t d : : i o s : : app ) ; 80 81 if ( ! output file pointer . is open ()) { 82 return ; 83 } 84 85 unsigned s h o r t i o n s = 0xFFF0 ; 86 unsigned s h o r t b e g i n = 0xEEEE ; 87 unsigned s h o r t end = 0xFFFF ; 88 unsigned s h o r t output ; 89 90 // Write h e a d e r to b e g i n e v e n t . . . 91 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& b e g i n ) , 92 s i z e o f ( unsigned short ) ) ; 93 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& b e g i n ) , 94 s i z e o f ( unsigned short ) ) ; 95 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( p o s i t r o n I E /keV + 0 . 5 ) ; 96 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 97 s i z e o f ( unsigned short ) ) ; 98 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( e l e c t r o n I E /keV + 0 . 5 ) ; 99 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 100 s i z e o f ( unsigned short ) ) ; 101 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( protonOneIE /keV + 0 . 5 ) ; 102 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 103 s i z e o f ( unsigned short ) ) ; 104 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( protonTwoIE /keV + 0 . 5 ) ; 105 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 106 s i z e o f ( unsigned short ) ) ; 107 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( p r o t o n T h r e e I E /keV + 0 . 5 ) ; 108 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 109 s i z e o f ( unsigned short ) ) ; 110 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( a l p h a I E /keV + 0 . 5 ) ; 111 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 112 s i z e o f ( unsigned short ) ) ; 113 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( gammaOneIE/keV + 0 . 5 ) ; 114 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 115 s i z e o f ( unsigned short ) ) ; 116 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( gammaTwoIE/keV + 0 . 5 ) ; 117 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 118 s i z e o f ( unsigned short ) ) ; 119 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( gammaThreeIE /keV + 0 . 5 ) ; 120 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 121 s i z e o f ( unsigned short ) ) ; 122 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( gammaFourIE/keV + 0 . 5 ) ; 123 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 124 s i z e o f ( unsigned short ) ) ; 71
  • 86.
    125 126 // Write i o n data 127 128 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& i o n s ) , 129 s i z e o f ( unsigned short ) ) ; 130 131 for ( i n t j =0; j <4; j ++){ 132 f o r ( i n t k =0; k <1600; k++){ 133 i f ( m o n o b l o c k e v [ j ] [ k ] . h i t == t r u e ) { 134 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( m o n o b l o c k e v [ j ] [ k ] . p i x e l I D ) ; 135 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 136 s i z e o f ( unsigned short ) ) ; 137 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( m o n o b l o c k e v [ j ] [ k ] . p a r t i c l e I D ) ; 138 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 139 s i z e o f ( unsigned short ) ) ; 140 o u t p u t = s t a t i c c a s t <u n s i g n e d s h o r t > ( m o n o b l o c k e v [ j ] [ k ] . Edep /keV + 0 . 5 ) ; / / t h i s Edep i s a sum o f Edeps i n T 141 // G4cout< P i x e l I D : ”<<m o n o b l o c k e v [ j ] [ k ] . p i x e l I D < <” <” P a r t i c l e I D : ”<<m o n o b l o c k e v [ j ] [ k ] . p a r t i c l e I D <<G4endl ; 142 // G4cout< Edep /keV + 0 . 5 : ”<<m o n o b l o c k e v [ j ] [ k ] . Edep /keV + 0.5<< G4endl ; <” 143 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (& o u t p u t ) , 144 s i z e o f ( unsigned short ) ) ; 145 146 } 147 } 148 } 149 150 // Write gamma data . . . psych ! 151 152 // Write end o f e v e n t marker 153 154 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (&end ) , 155 s i z e o f ( unsigned short ) ) ; 156 o u t p u t f i l e p o i n t e r . write ( r e i n t e r p r e t c a s t <c h a r∗> (&end ) , 157 s i z e o f ( unsigned short ) ) ; 158 159 o u t p u t f i l e p o i n t e r . close ( ) ; 160 161 // G4cout << ” Data s a v e d t o ” << o u t p u t f i l e n a m e << G4endl ; 162 } 163 164 void R e s u l t s : : ExtractData ( T r a c k e r I o n H i t s C o l l e c t i o n ∗ i o n C o l l e c t i o n ) 165 { 166 // G4cout << ” E x t r a c t i n g d a t a from h i t c o l l e c t i o n s . . . ” << G4endl ; 167 168 /∗ First extract the p a r t i c l e data .... ∗/ 169 170 G4int Nion = i o n C o l l e c t i o n −>e n t r i e s ( ) ; // Get # o f particle entries 171 int i; 172 173 // Initialize i o n data c o n t a i n e r s . . . 174 175 for ( i n t j =0; j <4; j ++){ 176 f o r ( i n t k =0; k <1600; k++){ 177 178 monoblock ev [ j ] [ k ] . hit = false ; 179 monoblock ev [ j ] [ k ] . p a r t i c l e I D = −1; 180 monoblock ev [ j ] [ k ] . g l o b a l t i m e = −1; 181 monoblock ev [ j ] [ k ] . Edep = 0 ; 182 monoblock ev [ j ] [ k ] . p i x e l I D =−1; 183 } 184 } 185 186 // E x t r a c t i o n data b e l o w 187 // G4cout< Nion : ”<<Nion< <” <G4endl ; 188 / / ( ∗ i o n C o l l e c t i o n )[0] − > GetVolName()<< 189 / / ( ∗ i o n C o l l e c t i o n )[1] − > GetVolName()<< 190 / / ( ∗ i o n C o l l e c t i o n )[2] − > GetVolName()<< 191 / / ( ∗ i o n C o l l e c t i o n ) [ Nion −1]−>GetVolName()<< 192 f o r ( i =0; i <Nion ; i ++){ 193 G 4 i n t p a r t i c l e I D = −1; 194 G 4 i n t p i x e l = −1; 195 G 4 S t r i n g p a r t i c l e = ( ∗ i o n C o l l e c t i o n ) [ i ]−> G e t P a r t i c l e I D ( ) ; 196 G 4 S t r i n g d e t e c t o r = ( ∗ i o n C o l l e c t i o n ) [ i ]−>GetVolName ( ) ; 197 i f ( p a r t i c l e == ” p r o t o n ” ) { 198 particleID = 0; 199 } e l s e i f ( p a r t i c l e == ” e+” ) { 200 particleID = 1; 201 } e l s e i f ( p a r t i c l e == ” e−” ) { 202 particleID = 2; 203 } e l s e i f ( p a r t i c l e == ”gamma” ) { 204 particleID = 3; 205 } 206 i f ( d e t e c t o r == ” monoblock ” ) { 72
  • 87.
    207 p i x e l = (∗ i o n C o l l e c t i o n )[ i ]−> G e t P i x e l ( ) ; 208 monoblock ev [ p a r t i c l e I D ][ pixel ] . hit = true ; 209 monoblock ev [ p a r t i c l e I D ][ pixel ] . particleID = particleID ; 210 monoblock ev [ p a r t i c l e I D ][ p i x e l ] . g l o b a l t i m e = ( ∗ i o n C o l l e c t i o n ) [ i ]−>GetGlobTime ( ) ; 211 monoblock ev [ p a r t i c l e I D ][ p i x e l ] . Edep += ( ∗ i o n C o l l e c t i o n ) [ i ]−>GetEdep ( ) /MeV ; 212 monoblock ev [ p a r t i c l e I D ][ pixel ] . pixelID = pixel ; 213 } 214 } 215 //−−−−−−−−−−−−− E x t r a c t gamma data b e l o w . . . NOT 216 217 } 5.5.32 RunAction.cc 1 #include ” RunAction . hh” 2 3 RunAction : : RunAction ( M E 2 b D e t e c t o r C o n s t r u c t i o n ∗ d e t e c t o r ) : myDetector ( d e t e c t o r ) 4 { 5 6 } 7 8 9 RunAction : : ˜ RunAction ( ) 10 { 11 12 } 13 14 v o i d RunAction : : BeginOfRunAction ( c o n s t G4Run∗ aRun ) 15 { 16 G4cout << ” B e g i n n i n g o f run ” << aRun− >GetRunID ( ) << G4endl ; 17 } 18 19 v o i d RunAction : : EndOfRunAction ( c o n s t G4Run∗ aRun ) 20 { 21 G4cout << G4endl ; 22 G4cout << ” End o f run ” << aRun− >GetRunID ( ) << G4endl ; 23 24 // G4cout<<” Average e n e r g y d e p o s i t i n t h e t a r g e t ”<<G4endl ; 25 // G4cout<<” s i m u l a t e d : ”<<s t d : : s e t w (9)<< s t d : : s e t p r e c i s i o n (3)<< r e s u l t s −>getTarDepAverage ( ) /MeV <” +/− ”< < 26 27 // G4cout<<” Average K i n e t i c Energy b e h i n d t h e t a r g e t ”<<G4endl ; 28 // G4cout<<” s i m u l a t e d : ”<<s t d : : s e t w (9)<< s t d : : s e t p r e c i s i o n (7)<< r e s u l t s −>getKEAverage ( ) / GeV<<” +/− ”<<s t d 29 30 } 5.5.33 SiBlock.cc 1 #include ” S i B l o c k . hh” 2 //#include ” G 4 M a t e r i a l . hh” 3 //#include ” M a t e r i a l s . hh” 4 5 // i ’m n o t s u r e t h i s l i n e i s r i g h t 6 S i B l o c k : : S i B l o c k ( G4LogicalVolume ∗ e x p e r i m e n t H a l l l o g , M a t e r i a l s ∗ mat ) 7 { 8 9 BUILD SiBlock = t r u e ; 10 // G4double a ; // a t o m i c mass 11 // G4double z ; // a t o m i c number 12 // G4double d e n s i t y ; 13 14 15 // G 4 M a t e r i a l ∗ S i = 16 // new G 4 M a t e r i a l ( ” S i l i c o n ” , z = 1 4 . , a = 2 8 . 0 5 5 5 ∗ g / mole , d e n s i t y =2.329∗ g /cm3 ) ; 17 18 e x p e r i m e n t a l H a l l l o g=e x p e r i m e n t H a l l l o g ; 19 m a t e r i a l s = mat ; 20 // aluminumChamber log = aluminumChamberVac log ; 21 //THESE ARE HALF LENGTHS! ! ! SO MAKE THEM HALF OF THE DESIRED VALUE ! ! ! − 22 S i B l o c k x = 2 . 0 ∗ cm ; //HALF OF x−s i d e l e n g t h 23 S i B l o c k y = 2 . 0 ∗ cm ; //HALF OF y−s i d e l e n g t h 24 S i B l o c k z = 0 . 0 2 5 ∗ cm ; / /HALF OF z−s i d e l e n g t h 25 b l o c k P o s x = 0∗m; // x−c e n t r o i d p o s i t i o n o f d e t e c t o r 26 b l o c k P o s y = 0∗m; // y−” ” ” ” 27 b l o c k P o s z = 7 . 0 2 5 ∗ cm ; / / z−” ” ” ” 28 29 pixel x = SiBlock x /40; 30 p i x e l y = SiBlock y /40;// half the width o f a p i x e l 31 73
  • 88.
    32 33 DetectorMaterial = materials− >F i n d M a t e r i a l ( ” S i ” ) ; 34 VacuumMaterial = m a t e r i a l s −>F i n d M a t e r i a l ( ”vacuum ” ) ; 35 } 36 37 SiBlock : : ˜ SiBlock () 38 {} 39 40 void SiBlock : : Construct () 41 { 42 //G4Box∗ S i B l o c k b o x = new G4Box ( ” S i B l o c k b o x ” , S i B l o c k x , S i B l o c k y , S i B l o c k z ) ; a l t e r n a t e way? 43 S i B l o c k b o x = new G4Box ( ” S i B l o c k b o x ” , S i B l o c k x , S i B l o c k y , S i B l o c k z ) ; 44 S i B l o c k l o g = new G4LogicalVolume ( S i B l o c k b o x , VacuumMaterial , ” S i B l o c k l o g ” , 0 , 0 , 0 ) ; 45 b l o c k P o s x =0.∗cm ; 46 b l o c k P o s y =0∗cm ; 47 b l o c k P o s z =7.025∗cm ; 48 S i B l o c k p h y s = new G4PVPlacement ( 0 , 49 G4ThreeVector ( b l o c k P o s x , b l o c k P o s y , b l o c k P o s z ) , 50 S i B l o c k l o g , ” monoblock ” , e x p e r i m e n t a l H a l l l o g , f a l s e , 0 ) ; 51 52 // S i B l o c k p i x e l : 53 G4VPVParameterisation ∗ p i x e l P a r a m = new P i x e l P a r a m e t e r i s a t i o n ( 54 1 6 0 0 , // # o f p i x e l s 55 0 . 1 ∗ cm ) ; / / w i d t h o f p i x e l 56 //∗∗ numbers ( e g . p i x e l x ) n o t d i v i d e d by 2 b e c a u s e h a l f −l e n g t h s a r e a l r e a d y t a k e n into account 57 p i x e l b o x = new G4Box ( ” p i x e l S i b o x ” , p i x e l x , p i x e l y , S i B l o c k z ) ; 58 p i x e l l o g = new G4LogicalVolume ( p i x e l b o x , D e t e c t o r M a t e r i a l , ” p i x e l l o g ” , 0 , 0 , 0 ) ; 59 60 // p l a c e 1600 p i x e l s i n S i B l o c k Volume : 61 p i x e l p h y s = new G4PVParameterised ( ” S i B l o c k p a r a m e t e r i s e d P i x e l s ” , 62 pixel log , 63 SiBlock log , 64 kUndefined , 65 1600 , 66 pixelParam ) ; 67 } 5.5.34 SiBlock Messenger.cc 1 #include ” S i B l o c k M e s s e n g e r . hh” 2 3 SiBlock Messenger : : SiBlock Messenger ( SiBlock ∗ SiBlock ) 4 : theSiBlock ( SiBlock ) 5 { 6 SiBlockDIR = new G 4 U I d i r e c t o r y ( ” / S i B l o c k / ” ) ; 7 SiBlockDIR− >S e t G u i d a n c e ( ” S i B l o c k c o n t r o l ” ) ; 8 9 XSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / X l e n g t h ” , this ); 10 XSiBlockCmd−>S e t G u i d a n c e ( ” S e l e c t t h e X l e n g t h f o r S i B l o c k ” ) ; 11 XSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ; 12 XSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ; 13 14 YSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / Y l e n g t h ” , this ); 15 YSiBlockCmd−>S e t G u i d a n c e ( ” S e l e c t t h e Y l e n g t h f o r S i B l o c k ” ) ; 16 YSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ; 17 YSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ; 18 19 ZSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / Z l e n g t h ” , this ); 20 ZSiBlockCmd−>S e t G u i d a n c e ( ” S e l e c t t h e Z l e n g t h f o r S i B l o c k ” ) ; 21 ZSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ; 22 ZSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ; 23 24 XPosSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / X pos ” , t h i s ) ; 25 XPosSiBlockCmd−>S e t G u i d a n c e ( ” S e t t h e X p o s i t i o n f o r t h e S i B l o c k ” ) ; 26 XPosSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ; 27 XPosSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ; 28 29 YPosSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / Y pos ” , t h i s ) ; 30 YPosSiBlockCmd−>S e t G u i d a n c e ( ” S e t t h e Y p o s i t i o n f o r t h e S i B l o c k ” ) ; 31 YPosSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ; 32 YPosSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ; 33 34 ZPosSiBlockCmd = new G4UIcmdWithADoubleAndUnit ( ” / S i B l o c k / Z p o s ” , t h i s ) ; 35 ZPosSiBlockCmd−>S e t G u i d a n c e ( ” S e t t h e Z p o s i t i o n f o r t h e S i B l o c k ” ) ; 36 ZPosSiBlockCmd−>SetParameterName ( ” c h o i c e ” , f a l s e ) ; 37 ZPosSiBlockCmd−>A v a i l a b l e F o r S t a t e s ( G 4 S t a t e P r e I n i t , G 4 S t a t e I d l e ) ; 38 } 39 40 SiBlock Messenger : : ˜ SiBlock Messenger () 41 { 74
  • 89.
    42 delete XSiBlockCmd ; 43 delete YSiBlockCmd ; 44 delete ZSiBlockCmd ; 45 delete XPosSiBlockCmd ; 46 delete YPosSiBlockCmd ; 47 delete ZPosSiBlockCmd ; 48 delete SiBlockDIR ; 49 } 5.5.35 SteppingAction.cc 1 #include ” S t e p p i n g A c t i o n . hh” 2 #include ” G4SteppingManager . hh” 3 4 SteppingAction : : SteppingAction () 5 { 6 } 7 8 v o i d S t e p p i n g A c t i o n : : U s e r S t e p p i n g A c t i o n ( c o n s t G4Step ∗ ) 9 { 10 } 5.5.36 SteppingVerbose.cc 1 #include ” S t e p p i n g V e r b o s e . hh” 2 3 #include ” G4SteppingManager . hh” 4 #include ” G4UnitsTable . hh” 5 6 SteppingVerbose : : SteppingVerbose ( ) 7 { 8 } 9 10 SteppingVerbose : : ˜ SteppingVerbose () 11 { 12 } 13 14 void SteppingVerbose : : StepInfo ( ) 15 { 16 17 CopyState ( ) ; 18 19 G 4 i n t p r e c = G4cout . p r e c i s i o n ( 3 ) ; 20 21 if ( v e r b o s e L e v e l >= 1 ) { 22 i f ( v e r b o s e L e v e l >= 4 ) { 23 VerboseTrack ( ) ; 24 } 25 i f ( v e r b o s e L e v e l >= 3 ) { 26 G4cout << G4endl ; 27 G4cout << s t d : : s e t w ( 5 ) << ”#S t e p#” << ” ” 28 << s t d : : s e t w ( 6 ) << ”X” << ” ” 29 << s t d : : s e t w ( 6 ) << ”Y” << ” ” 30 << s t d : : s e t w ( 6 ) << ”Z” << ” ” 31 << s t d : : s e t w ( 9 ) << ” KineE ” << ” ” 32 << s t d : : s e t w ( 9 ) << ” dEStep ” << ” ” 33 << s t d : : s e t w ( 1 0 ) << ” StepL eng ” 34 << s t d : : s e t w ( 1 0 ) << ” TrakLeng ” 35 << s t d : : s e t w ( 1 0 ) << ” Volume ” << ” ” 36 << s t d : : s e t w ( 1 0 ) << ” P r o c e s s ” << G4endl ; 37 } 38 39 G4cout << s t d : : s e t w ( 5 ) << f T r a c k−>GetCurrentStepNumber ( ) << ” ” 40 << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k− >G e t P o s i t i o n ( ) . x ( ) , ” Length ” ) 41 << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k− >G e t P o s i t i o n ( ) . y ( ) , ” Length ” ) 42 << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k− >G e t P o s i t i o n ( ) . z ( ) , ” Length ” ) 43 << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k− >G e t K i n e t i c E n e r g y ( ) , ” Energy ” ) 44 << s t d : : s e t w ( 6 ) << G4BestUnit ( f S t e p − >G e t T o t a l E n e r g y D e p o s i t ( ) , ” Energy ” ) 45 << s t d : : s e t w ( 6 ) << G4BestUnit ( f S t e p − >G e t S t e p L e n g t h ( ) , ” Length ” ) 46 << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k− >GetTrackLength ( ) , ” Length ” ) 47 << ” ” ; 48 49 if ( fTrack−>GetNextVolume ( ) ! = 0 ) { 50 G4cout << s t d : : s e t w ( 1 0 ) << f T r a c k−>GetVolume()−>GetName ( ) ; 51 } else { 52 G4cout << s t d : : s e t w ( 1 0 ) << ” OutOfWorld ” ; 53 } 75
  • 90.
    54 55 if ( fStep− >G e t P o s t S t e p P o i n t ()−> G e t P r o c e s s D e f i n e d S t e p ( ) != NULL) { 56 G4cout << ” ” << s t d : : s e t w ( 1 0 ) 57 << f S t e p −>G e t P o s t S t e p P o i n t ()−> G e t P r o c e s s D e f i n e d S t e p ( ) 58 −>GetProcessName ( ) ; 59 } else { 60 G4cout << ” UserLimit ” ; 61 } 62 63 G4cout << G4endl ; 64 65 ( v e r b o s e L e v e l == 2 ) { if 66 G4int tN2ndariesTot = fN2ndariesAtRestDoIt + 67 fN2ndariesAlongStepDoIt + 68 fN2ndariesPostStepDoIt ; 69 i f ( tN2ndariesTot > 0) { 70 G4cout << ” :−−−−− L i s t o f 2 n d a r i e s − ” 71 << ”#SpawnInStep=” << s t d : : s e t w ( 3 ) << t N 2 n d a r i e s T o t 72 << ” ( R e s t=” << s t d : : s e t w ( 2 ) << f N 2 n d a r i e s A t R e s t D o I t 73 << ” , Along=” << s t d : : s e t w ( 2 ) << f N 2 n d a r i e s A l o n g S t e p D o I t 74 << ” , P o s t=” << s t d : : s e t w ( 2 ) << f N 2 n d a r i e s P o s t S t e p D o I t 75 << ” ) , ” 76 << ”#SpawnTotal=” << s t d : : s e t w ( 3 ) << ( ∗ f S e c o n d a r y ) . s i z e ( ) 77 << ” − − − − − − − −” − − − − − − − 78 << G4endl ; 79 80 for ( s i z e t l p l =(∗ f S e c o n d a r y ) . s i z e () − t N 2 n d a r i e s T o t ; 81 l p l < ( ∗ f S e c o n d a r y ) . s i z e ( ) ; l p l ++) { 82 G4cout << ” : ” 83 << s t d : : s e t w ( 6 ) 84 << G4BestUnit ( ( ∗ f S e c o n d a r y ) [ l p l ]−> G e t P o s i t i o n ( ) . x ( ) , ” Length ” ) 85 << s t d : : s e t w ( 6 ) 86 << G4BestUnit ( ( ∗ f S e c o n d a r y ) [ l p l ]−> G e t P o s i t i o n ( ) . y ( ) , ” Length ” ) 87 << s t d : : s e t w ( 6 ) 88 << G4BestUnit ( ( ∗ f S e c o n d a r y ) [ l p l ]−> G e t P o s i t i o n ( ) . z ( ) , ” Length ” ) 89 << s t d : : s e t w ( 6 ) 90 << G4BestUnit ( ( ∗ f S e c o n d a r y ) [ l p l ]−> G e t K i n e t i c E n e r g y ( ) , ” Energy ” ) 91 << s t d : : s e t w ( 1 0 ) 92 << ( ∗ f S e c o n d a r y ) [ l p l ]−> G e t D e f i n i t i o n ()−> G e t P a r t i c l e N a m e ( ) ; 93 G4cout << G4endl ; 94 } 95 96 G4cout << ” : − − − − − − − − − − − − − − − − − − − − − − − − − − − − −” 97 << ”− − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − −” 98 << ”−− End o f 2 n d a r i e s I n f o − − − − − − − − − −” 99 << G4endl ; 100 } 101 } 102 103 } 104 G4cout . p r e c i s i o n ( p r e c ) ; 105 } 106 107 void SteppingVerbose : : TrackingStarted () 108 { 109 110 CopyState ( ) ; 111 G 4 i n t p r e c = G4cout . p r e c i s i o n ( 3 ) ; 112 i f ( verboseLevel > 0) { 113 G4cout << s t d : : s e t w ( 5 ) << ” S t e p#” << ” ” 114 << s t d : : s e t w ( 6 ) << ”X” << ” ” 115 << s t d : : s e t w ( 6 ) << ”Y” << ” ” 116 << s t d : : s e t w ( 6 ) << ”Z” << ” ” 117 << s t d : : s e t w ( 9 ) << ” KineE ” << ” ” 118 << s t d : : s e t w ( 9 ) << ” dEStep ” << ” ” 119 << s t d : : s e t w ( 1 0 ) << ” StepL eng ” 120 << s t d : : s e t w ( 1 0 ) << ” TrakLeng ” 121 << s t d : : s e t w ( 1 0 ) << ” Volume ” << ” ” 122 << s t d : : s e t w ( 1 0 ) << ” P r o c e s s ” << G4endl ; 123 124 G4cout << s t d : : s e t w ( 5 ) << f T r a c k−>GetCurrentStepNumber ( ) << ” ” 125 << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k−>G e t P o s i t i o n ( ) . x ( ) , ” Length ” ) 126 << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k−>G e t P o s i t i o n ( ) . y ( ) , ” Length ” ) 127 << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k−>G e t P o s i t i o n ( ) . z ( ) , ” Length ” ) 128 << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k−>G e t K i n e t i c E n e r g y ( ) , ” Energy ” ) 129 << s t d : : s e t w ( 6 ) << G4BestUnit ( f S t e p − >G e t T o t a l E n e r g y D e p o s i t ( ) , ” Energy ” ) 130 << s t d : : s e t w ( 6 ) << G4BestUnit ( f S t e p −>G e t S t e p L e n g t h ( ) , ” Length ” ) 131 << s t d : : s e t w ( 6 ) << G4BestUnit ( f T r a c k−>GetTrackLength ( ) , ” Length ” ) 132 << ” ” ; 133 134 if ( fTrack−>GetNextVolume ( ) ) { 135 G4cout << s t d : : s e t w ( 1 0 ) << f T r a c k−>GetVolume()−>GetName ( ) ; 76
  • 91.
    136 } else { 137 G4cout << s t d : : s e t w ( 1 0 ) << ” OutOfWorld ” ; 138 } 139 G4cout << ” i n i t S t e p ” << G4endl ; 140 141 } 142 G4cout . p r e c i s i o n ( p r e c ) ; 143 } 5.5.37 TrackerIonHit.cc 1 #include ” T r a c k e r I o n H i t . hh” 2 3 G 4 A l l o c a t o r <T r a c k e r I o n H i t > T r a c k e r I o n H i t A l l o c a t o r ; 4 5 6 TrackerIonHit : : TrackerIonHit () { 7 f l a g =0; 8 } 9 10 T r a c k e r I o n H i t : : ˜ T r a c k e r I o n H i t ( ) {} 11 12 TrackerIonHit : : TrackerIonHit ( const T r a c k e r I o n H i t &r i g h t ) 13 : G4VHit ( ) 14 { 15 trackID = r i g h t . trackID ; 16 p a r t i c l e I D= r i g h t . p a r t i c l e I D ; 17 pos = r i g h t . pos ; 18 } 19 20 c o n s t T r a c k e r I o n H i t& T r a c k e r I o n H i t : : operator=( c o n s t T r a c k e r I o n H i t &r i g h t ) 21 { 22 trackID = r i g h t . trackID ; 23 p a r t i c l e I D= r i g h t . p a r t i c l e I D ; 24 pos = r i g h t . pos ; 25 return ∗ t h i s ; 26 } 27 28 G 4 i n t T r a c k e r I o n H i t : : operator==( c o n s t T r a c k e r I o n H i t& r i g h t ) const 29 { 30 return ( t h i s==&r i g h t ) ? 1 : 0 ; 31 } 32 33 // draws y e l l o w s p h e r e s f o r i o n h i t s 34 v o i d T r a c k e r I o n H i t : : Draw ( ) 35 { 36 G4VVisManager ∗ pVVisManager = G4VVisManager : : G e t C o n c r e t e I n s t a n c e ( ) ; 37 i f ( pVVisManager ) 38 { 39 G4Circle c i r c l e ( pos ) ; 40 c i r c l e . SetScreenSize (4); 41 c i r c l e . S e t F i l l S t y l e ( G4Circle : : f i l l e d ) ; 42 G4Colour c o l o u r ( 1 . , 1 . , 0 . ) ; 43 G4VisAttributes a t t r i b s ( colour ) ; 44 c i r c l e . SetVisAttributes ( attribs ) ; 45 pVVisManager− >Draw ( c i r c l e ) ; 46 } 47 } 48 49 // ” Edep ” h e r e i s one e n e r g y d e p o s i t i o n o f many t h a t makes up a y e l l o w b l o b 50 // i . e . a sum o f t h e s e ” Edep ” s r e s u l t s i n t h e ” Edep ” p r i n t e d i n R e s u l t s . c c 51 52 void T r a c k e r I o n H i t : : Print ( ) 53 { 54 55 G4cout << s t d : : s e t w (2)<< s t d : : r i g h t << t r a c k I D << ” ” << f l a g << ” ” 56 << s t d : : s e t w (13)<< p a r t i c l e I D << ” ” 57 << s t d : : s e t p r e c i s i o n ( 4 ) << s t d : : f i x e d 58 << KE/GeV< ” ” << s t d : : s e t p r e c i s i o n ( 6 ) < 59 << b e t a< ” ” < 60 << s t d : : s e t p r e c i s i o n ( 4 ) << s t d : : s e t w ( 7 ) << s t d : : r i g h t 61 << t h e t a ∗1000.<< ” ” << s t d : : s e t w ( 1 0 ) << s t d : : r i g h t 62 << p h i ∗1000.<< ” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t 63 << p o s . getX()<<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t // r e p o r t s o u r c e p o s i t i o n . . . but I don ’ t have this coded 64 << p o s . getY()<<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t // ” 65 << p o s . g e t Z ()<<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t // ” 66 << t i m e ∗1000.<< ” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t 67 << l a b t i m e ∗ 1 0 0 0 . << ” ” << s t d : : s e t w ( 1 0 ) << s t d : : r i g h t 68 << g l o b a l t i m e ∗ 1 0 0 0 . << ” ” << s t d : : s e t w ( 8 ) << s t d : : r i g h t 69 << Edep /MeV << ” ” << l e n g t h /mm 77
  • 92.
    70 << G4endl ; 71 72 } 5.5.38 TrackerIonSD.cc 1 #include ” TrackerIonSD . hh” 2 3 TrackerIonSD : : TrackerIonSD ( G 4 S t r i n g name) 4 : G 4 V S e n s i t i v e D e t e c t o r (name) 5 { 6 G 4 S t r i n g HCname ; 7 c o l l e c t i o n N a m e . i n s e r t (HCname=” i o n C o l l e c t i o n ” ) ; 8 9 } 10 11 TrackerIonSD : : ˜ TrackerIonSD ( ) 12 { 13 14 } 15 16 v o i d TrackerIonSD : : I n i t i a l i z e ( G4HCofThisEvent ∗ ) 17 { 18 i o n C o l l e c t i o n = new T r a c k e r I o n H i t s C o l l e c t i o n 19 ( SensitiveDetectorName , collectionName [ 0 ] ) ; 20 21 } 22 23 G4bool TrackerIonSD : : P r o c e s s H i t s ( G4Step ∗ aStep , G4TouchableHistory ∗) 24 { 25 26 G4StepPoint ∗ vi ; 27 28 c o n s t G 4 D y n a m i c P a r t i c l e ∗ a P a r t i c l e= aStep− >GetTrack()−> G e t D y n a m i c P a r t i c l e ( ) ; 29 c o n s t G 4 S t r i n g type = aParticle− >G e t D e f i n i t i o n ()−> G e t P a r t i c l e T y p e ( ) ; 30 c o n s t G 4 i n t t r a c k I D = aStep− >GetTrack()−>GetTrackID ( ) ; 31 c o n s t G 4 S t r i n g name = aParticle− >G e t D e f i n i t i o n ()−> G e t P a r t i c l e N a m e ( ) ; 32 c o n s t G4double l e n = aStep− >G e t S t e p L e n g t h ( ) ; 33 34 // G4cout << ” P r o c e s s i n g hit f o r ” << name << ” , t r a c k ” << t r a c k I D << G4endl ; 35 36 G4int p i x e l I D = 1 9 0 0 ; 37 38 39 i f (name == ” p r o t o n ” | | name == ” e+” | | name == ” e−” | | 40 name == ” a l p h a ” ) 41 { 42 // G4cout << ” P r o c e s s i n g ” << name << ” h i t ” << G4endl ; 43 v i = aStep− >G e t P r e S t e p P o i n t ( ) ; 44 G 4 S t r i n g vname = v i − >G e t P h y s i c a l V o l u m e ()−>GetName ( ) ; 45 i f ( vname ==” S i B l o c k p a r a m e t e r i s e d P i x e l s ” ) { 46 c o n s t G4TouchableHistory ∗ SiBlockTouchable = ( G4TouchableHistory ∗ ) ( vi− >GetTouchable ( ) ) ; 47 c o n s t G4VPhysicalVolume ∗ S i B l o c k P h y s i c a l = S i B l o c k T o u c h a b l e − >GetVolume ( ) ; 48 p i x e l I D= S i B l o c k P h y s i c a l − >GetCopyNo ( ) ; 49 i f ( ( p i x e l I D >= 1 6 0 0 ) | | ( p i x e l I D < 0 ) ) { 50 G4cout< E r r o r : I n v a l i d p i x e l I D w h i l e p r o c e s s i n g i o n h i t s : ” <” 51 <<p i x e l I D <<G4endl ; 52 return f a l s e ; 53 } 54 } 55 56 57 i f ( len > 0 . ) 58 { 59 T r a c k e r I o n H i t ∗ n e w I o n H i t I= new T r a c k e r I o n H i t ( ) ; 60 newIonHitI− etTrackID ( trackID ) ; >S 61 newIonHitI− >S e t P a r t i c l e I D (name ) ; 62 newIonHitI− >SetTime ( v i − >GetProperTime ( ) ) ; 63 newIonHitI− >SetLabTime ( v i − >GetLocalTime ( ) ) ; 64 newIonHitI− >SetGlobTime ( v i − >GetGlobalTime ( ) ) ; 65 newIonHitI− >SetKE ( v i − >G e t K i n e t i c E n e r g y ( ) ) ; / / T h i s i s t h e k i n e t i c e n e r g y o f t h e e l e c t r o n at a step 66 // G4cout< I n TrackerIonSD . cc , Kin . E . : ”<<v i − <” >G e t K i n e t i c E n e r g y ()<<G4endl ; 67 newIonHitI− >S e t P o s ( v i − >G e t P o s i t i o n ( ) ) ; 68 i f ( vname == ” S i B l o c k p a r a m e t e r i s e d P i x e l s ” ) { 69 newIonHitI− >SetVolName ( ” monoblock ” ) ; / / s a i d ”vname” i n s t e a d o f monoblock 70 newIonHitI− >S e t P i x e l ( p i x e l I D ) ; 71 } 72 else { 73 G4cout< Your volume name i s ”<<vname< <” <”NOT WHAT YOU EXPECTED (OR WANT) ”<<G4endl ; 74 } 78
  • 93.
    75 newIonHitI− >SetEdep ( aStep− >G e t T o t a l E n e r g y D e p o s i t ( ) ) ; 76 // G4cout< I n TrackerIonSD . cc , Edep : ”<<aStep− <” >G e t T o t a l E n e r g y D e p o s i t ()<<G4endl ; 77 newIonHitI− >S e t L e n g t h ( l e n ) ; 78 newIonHitI− >Draw ( ) ; 79 i o n C o l l e c t i o n − n s e r t ( newIonHitI ) ; >i 80 } 81 82 G4TrackStatus TrackStatus ; 83 T r a c k S t a t u s=aStep−>GetTrack()−> G e t T r a c k S t a t u s ( ) ; 84 } 85 return t r u e ; 86 } 87 88 v o i d TrackerIonSD : : EndOfEvent ( G4HCofThisEvent ∗ HCE) 89 { 90 G4int i ; 91 G 4 i n t NbHits = i o n C o l l e c t i o n −>e n t r i e s ( ) ; 92 93 i f ( NbHits >0) 94 { 95 ( ∗ i o n C o l l e c t i o n )[0] − > SetGunFlag ( ) ; 96 97 if ( print ) 98 { 99 G4cout<<G4endl ; 100 G4cout << ”− − − − >H i t s C o l l e c t i o n : i n t h i s − − − − event there a r e ” << NbHits 101 << ” h i t s f o r i o n t r a c k i n g : ” << G4endl ; 102 103 G4cout << s t d : : s e t w ( 2 ) << ”ID” << ” ” 104 << s t d : : s e t w ( 1 2 ) << ” PID” << ” ” 105 << s t d : : s e t p r e c i s i o n ( 4 ) << s t d : : f i x e d 106 << ”KE [ GeV ] ” <<” ” << s t d : : s e t p r e c i s i o n ( 6 ) 107 << ” b e t a ” << ” ” 108 << s t d : : s e t p r e c i s i o n ( 4 ) << s t d : : s e t w ( 7 ) << s t d : : r i g h t 109 << ” t h [ mrad ] ” <<” ” << s t d : : s e t w ( 1 0 ) << s t d : : r i g h t 110 << ” p h i [ mrad ] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t 111 << ”X [mm] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t 112 << ”Y [mm] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t 113 << ”Z [mm] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t 114 << ” t a u [ p s ] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t 115 << ” t [ p s ] ” <<” ” << s t d : : s e t w ( 9 ) << s t d : : r i g h t 116 << ”T [ p s ] ” <<” ” << s t d : : s e t w ( 8 ) << s t d : : r i g h t 117 << ” Ed [ MeV ] ” << ” S t e p Length [mm] ” << G4endl ; 118 119 f o r ( i =0; i <NbHits ; i ++) { 120 ( ∗ i o n C o l l e c t i o n ) [ i ]−>Print ( ) ; 121 } 122 123 } 124 125 } 126 127 s t a t i c G 4 i n t HCID = −1; 128 i f (HCID<0) 129 { 130 HCID = G4SDManager : : GetSDMpointer()−> G e t C o l l e c t i o n I D ( c o l l e c t i o n N a m e [ 0 ] ) ; / / i don ’ t t h i n k [0] s h o u l d be h e r e 131 } 132 HCE >A d d H i t s C o l l e c t i o n ( HCID , i o n C o l l e c t i o n ) ; − 133 } 5.5.39 TrackerIonSD Messenger.cc 1 #include ” T r a c k e r I o n S D M e s s e n g e r . hh ” 2 3 T r a c k e r I o n S D M e s s e n g e r : : T r a c k e r I o n S D M e s s e n g e r ( TrackerIonSD ∗ TISD ) 4 : t r a c k e r ( TISD ) 5 { 6 P r t D i r = new G 4 U I d i r e c t o r y ( ” / P r i n t / ” ) ; 7 PrtDir− >S e t G u i d a n c e ( ” Event by e v e n t p r i n t c o n t r o l f o r ” ) ; 8 9 PrtSCmd = new G4UIcmdWithoutParameter ( ” / P r i n t / T r a c k S e t ” , t h i s ) ; 10 PrtSCmd−>S e t G u i d a n c e ( ” S e t s p r i n t i n g o f t r a c k i o n r e s u l t s ” ) ; 11 12 PrtUCmd = new G4UIcmdWithoutParameter ( ” / P r i n t / Track UnSet ” , t h i s ) ; 13 PrtUCmd−>S e t G u i d a n c e ( ”Un s e t s p r i n t i n g o f t r a c k i o n r e s u l t s ” ) ; 14 } 15 16 TrackerIonSD Messenger : : ˜ TrackerIonSD Messenger ( ) 17 { 18 d e l e t e PrtDir ; 79
  • 94.
    19 d e l e t e PrtSCmd ; 20 d e l e t e PrtUCmd ; 21 } 22 23 v o i d T r a c k e r I o n S D M e s s e n g e r : : SetNewValue ( G4UIcommand∗ command , G 4 S t r i n g ) 24 { 25 i f ( command == PrtSCmd ) { 26 t r a c k e r −>S e t P r i n t ( ) ; 27 } 28 29 30 i f ( command == PrtUCmd ) { 31 t r a c k e r −>U n S e t P r i n t ( ) ; 32 } 33 } 5.5.40 VisManager.cc 1 #i f d e f G4VIS USE 2 3 #include ” VisManager . hh” 4 5 // S u p p o r t e d drivers . . . 6 7 // Not n e e d i n g e x t e r n a l p a c k a g e s o r libraries ... 8 #include ” G4ASCIITree . hh” 9 #include ”G4DAWNFILE . hh” 10 #include ” G4HepRepFile . hh” 11 #include ” G4RayTracer . hh” 12 #include ”G4VRML1File . hh” 13 #include ”G4VRML2File . hh” 14 15 // N e e d i n g e x t e r n a l p a c k a g e s o r libraries ... 16 17 #i f d e f G4VIS USE DAWN 18 #include ” G4FukuiRenderer . hh” 19 #e n d i f 20 21 #i f d e f G4VIS USE OPACS 22 #include ”G4Wo . hh ” 23 #include ”G4Xo . hh ” 24 #e n d i f 25 26 #i f d e f G4VIS USE OPENGLX 27 #include ”G4OpenGLImmediateX . hh ” 28 #include ”G4OpenGLStoredX . hh” 29 #e n d i f 30 31 #i f d e f G4VIS USE OPENGLWIN32 32 #include ” G4OpenGLImmediateWin32 . hh ” 33 #include ” G4OpenGLStoredWin32 . hh ” 34 #e n d i f 35 36 #i f d e f G4VIS USE OPENGLXM 37 #include ”G4OpenGLImmediateXm . hh ” 38 #include ”G4OpenGLStoredXm . hh” 39 #e n d i f 40 41 #i f d e f G4VIS USE OIX 42 #include ” G4OpenInventorX . hh” 43 #e n d i f 44 45 #i f d e f G4VIS USE OIWIN32 46 #include ” G4OpenInventorWin32 . hh ” 47 #e n d i f 48 49 #i f d e f G4VIS USE VRML 50 #include ”G4VRML1 . hh” 51 #include ”G4VRML2 . hh” 52 #e n d i f 53 54 VisManager : : VisManager ( ) {} 55 56 v o i d VisManager : : R e g i s t e r G r a p h i c s S y s t e m s ( ) 57 { 58 // G r a p h i c s S y s t e m s n o t n e e d i n g e x t e r n a l p a c k a g e s o r libraries ... 59 R e g i s t e r G r a p h i c s S y s t e m ( new G4ASCIITree ) ; 60 R e g i s t e r G r a p h i c s S y s t e m ( new G4DAWNFILE ) ; 61 // R e g i s t e r G r a p h i c s S y s t e m ( new G4GAGTree ) ; 62 R e g i s t e r G r a p h i c s S y s t e m ( new G4HepRepFile ) ; 80
  • 95.
    63 R e g i s t e r G r a p h i c s S y s t e m ( new G4RayTracer ) ; 64 R e g i s t e r G r a p h i c s S y s t e m ( new G4VRML1File ) ; 65 R e g i s t e r G r a p h i c s S y s t e m ( new G4VRML2File ) ; 66 67 // G r a p h i c s s y s t e m s n e e d i n g e x t e r n a l p a c k a g e s o r libraries ... 68 69 #i f d e f G4VIS USE DAWN 70 R e g i s t e r G r a p h i c s S y s t e m ( new G4FukuiRenderer ) ; 71 #e n d i f 72 73 #i f d e f G4VIS USE OPACS 74 R e g i s t e r G r a p h i c s S y s t e m ( new G4Wo ) ; 75 R e g i s t e r G r a p h i c s S y s t e m ( new G4Xo ) ; 76 #e n d i f 77 78 #i f d e f G4VIS USE OPENGLX 79 R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLImmediateX ) ; 80 R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLStoredX ) ; 81 #e n d i f 82 83 #i f d e f G4VIS USE OPENGLWIN32 84 R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLImmediateWin32 ) ; 85 R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLStoredWin32 ) ; 86 #e n d i f 87 88 #i f d e f G4VIS USE OPENGLXM 89 R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLImmediateXm ) ; 90 R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenGLStoredXm ) ; 91 #e n d i f 92 93 #i f d e f G4VIS USE OIX 94 R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenInventorX ) ; 95 #e n d i f 96 97 #i f d e f G4VIS USE OIWIN32 98 R e g i s t e r G r a p h i c s S y s t e m ( new G4OpenInventorWin32 ) ; 99 #e n d i f 100 101 #i f d e f G4VIS USE VRML 102 R e g i s t e r G r a p h i c s S y s t e m ( new G4VRML1 ) ; 103 R e g i s t e r G r a p h i c s S y s t e m ( new G4VRML2 ) ; 104 #e n d i f 105 106 if ( fVerbose > 0) 107 { 108 G4cout << 109 ” nYou have s u c c e s s f u l l y c h o s e n t o u s e t h e following graphics systems . ” 110 << G4endl ; 111 PrintAvailableGraphicsSystems ( ) ; 112 } 113 114 } 115 116 #e n d i f 5.5.41 Sort to Root 1 // T h i s w i l l s o r t GEANT4 o u t p u t from t h e s i n g l e −block s i l i c o n 2 // d e t e c t o r s i m u l a t i o n b e i n g u s e d f o r t h e 69Kr e x p e r i m e n t . 3 // I t w i l l be b a s e d on m o n o b l o c k 2 r o o t . cpp , but i t won ’ t have 4 // the s t r i p s b u s i n e s s . −ZM 1 0 / 2 2 / 0 9 5 6 //C++ h e a d e r f i l e s ( note : t h e s e might n o t all be n e c e s s a r y ) 7 #include <i o s t r e a m > 8 #include <f s t r e a m > 9 #include <c s t r i n g > 10 #include <b i t s e t > 11 12 //ROOT h e a d e r f i l e s ( n o t e : t h e s e might n o t all be n e c e s s a r y ) 13 #include ” T F i l e . h” 14 #include ” TTree . h” 15 #include ”TMath . h” 16 #include ”TRandom . h” 17 18 // v a r i a b l e s for t h r e s h o l d and w i d t h ( s e e m o n o b l o c k 2 r o o t . cpp f o r description ) 19 20 double DSSD THRESH = 8 0 ; 21 double DSSD WIDTH = 5 0 ; 22 double DSSD F = 3 ; 23 double DSSD G = 2 ; 81
  • 96.
    24 double DSSD H = 0 ; 25 26 // d e f i n e namespace 27 u s i n g namespace s t d ; 28 29 // data c l a s s e s 30 class Initial conditions { 31 public : I n i t i a l c o n d i t i o n s ( ) { } ; // d e f a u l t constructor 32 Double t PositronE ; 33 Double t ElectronE ; 34 D o u b l e t Proton1E ; 35 D o u b l e t Proton2E ; 36 D o u b l e t Proton3E ; 37 D o u b l e t AlphaE ; 38 D o u b l e t Gamma1E ; 39 D o u b l e t Gamma2E ; 40 D o u b l e t Gamma3E ; 41 D o u b l e t Gamma4E ; 42 }; 43 44 c l a s s DSSD{ 45 public : DSSD ( ) { } ; // d e f a u l t c o n s t r u c t o r 46 I n t t f r o n t H i t [ 4 1 ] ; // t a l l y o f a l l h i t s f o r f r o n t s t r i p s 47 I n t t b a c k H i t [ 4 1 ] ; // t a l l y a l l h i t s f o r back s t r i p s 48 D o u b l e t f r o n t d E [ 4 1 ] ; // t a l l y o f t o t a l dE f o r f r o n t s t r i p s 49 D o u b l e t backdE [ 4 1 ] ; / / t a l l y o f t o t a l dE f o r back s t r i p s 50 51 I n t t f r o n t H i t P r o t o n [ 4 1 ] ; // p r o t o n f r o n t h i t s t a l l y 52 I n t t b a c k H i t P r o t o n [ 4 1 ] ; // ” back 53 D o u b l e t f r o n t p r o t o n d E [ 4 1 ] ; // p r o t o n f r o n t dE t a l l y 54 D o u b l e t backprotondE [ 4 1 ] ; // ” back 55 56 I n t t f r o n t H i t A l p h a [ 4 1 ] ; // a l p h a s 57 I n t t backHitAlpha [ 4 1 ] ; 58 Double t frontalphadE [ 4 1 ] ; 59 D o u b l e t backalphadE [ 4 1 ] ; 60 61 I n t t f r o n t H i t P o s i t r o n [ 4 1 ] ; // p o s i t r o n s 62 I n t t backHitPositron [ 4 1 ] ; 63 Double t frontpositrondE [ 4 1 ] ; 64 Double t backpositrondE [ 4 1 ] ; 65 66 67 I n t t f r o n t H i t E l e c t r o n [ 4 1 ] ; // e l e c t r o n s 68 I n t t backHitElectron [ 4 1 ] ; 69 Double t frontelectrondE [ 4 1 ] ; 70 Double t backelectrondE [ 4 1 ] ; 71 72 I n t t frontHitGamma [ 4 1 ] ; //gammas 73 I n t t backHitGamma [ 4 1 ] ; 74 D o u b l e t frontgammadE [ 4 1 ] ; 75 D o u b l e t backgammadE [ 4 1 ] ; 76 77 // h i t m u l t i p l i c i t y c o u n t e r s 78 I n t t frontMult ; 79 I n t t frontMultProton ; 80 I n t t frontMultAlpha ; 81 Int t frontMultPositron ; 82 Int t frontMultElectron ; 83 I n t t frontMultGamma ; 84 I n t t backMult ; 85 I n t t backMultProton ; 86 I n t t backMultAlpha ; 87 I n t t backMultPositron ; 88 I n t t backMultElectron ; 89 I n t t backMultGamma ; 90 91 // t o t a l d e t e c t o r sums 92 Double t sumFront ; 93 Double t sumFrontProton ; 94 Double t sumFrontAlpha ; 95 Double t sumFrontPositron ; 96 Double t sumFrontElectron ; 97 Double t sumFrontGamma ; 98 Double t sumBack ; 99 Double t sumBackProton ; 100 Double t sumBackAlpha ; 101 Double t sumBackPositron ; 102 Double t sumBackElectron ; 103 Double t sumBackGamma ; 104 105 Int t frontStrip ; 82
  • 97.
    106 I n t t backStrip ; 107 D o u b l e t maxFront ; 108 D o u b l e t maxBack ; 109 }; 110 111 // f u n c t i o n s to a p p l y d e t e c t o r r e s o l u t i o n , threshold , 112 D o u b l e t DSSD FWHM ( D o u b l e t e n e r g y ) { 113 Double t e out ; 114 D o u b l e t fwhm , s i g m a ; 115 116 //fwhm = 0 . 0 1 ∗ e n e r g y ; // s e t F H W M e q u a l to 25 keV 117 // b e s t match i n MCNP:F H =#∗s q r t (E) W M 118 // need to t a k e e n e r g y , c o n v e r t to MeV, t a k e s q r t , and c o n v e r t back 119 //fwhm = 0 . 2 4 3 ∗ ( s q r t ( e n e r g y / 1 0 0 0 ) ) ∗ 1 0 0 0 ; 120 fwhm =176;// keV 121 s i g m a = fwhm / 2 . 3 5 4 8 2 ; 122 e o u t = gRandom− >Gaus ( e n e r g y , s i g m a ) ; 123 124 return e o u t ; 125 } 126 127 D o u b l e t DSSD Threshold ( D o u b l e t e n e r g y ) { 128 return 0 . 5 ∗ ( 1 + tanh ( ( e n e r g y −DSSD THRESH) /DSSD WIDTH ) ); 129 } 130 131 //MAIN P O R M R G A 132 i n t main ( i n t a r g c , char ∗ argv [ ] ) { 133 int events = 0; 134 135 // d e f i n e c l a s s e s t h a t w i l l h o l d data i n r o o t t r e e s 136 I n i t i a l c o n d i t i o n s ∗ i n i t i a l = new I n i t i a l c o n d i t i o n s ( ) ; 137 DSSD ∗ monoblock = new DSSD ( ) ; 138 DSSD ∗ m o n o b l o c k r a w = new DSSD ( ) ; 139 140 fstream input ; 141 142 T F i l e ∗ f = new T F i l e ( ”GEANT4 . r o o t ” , ”RECREATE” ) ; / / maybe t r y c h a n g i n g t h e name 143 TTree ∗ t r e e = new TTree ( ”T” , ” G e a n t 4 s i m u l a t i o n ” ) ; / / ” ” ” ” ” 144 145 146 ///∗∗∗∗ t o look at a s i n g l e strip , i n ROOT e . g : T >Draw ( ” m o n o b l o c k r a w . f r o n t e l e c t r o n d E [ 2 1 ] ” ) ; − 147 148 // T r e e s f o r S t r i p p e d D e t e c t o r : 149 tree−>Branch ( ” m o n o b l o c k r a w ” , monoblock raw , ” f r o n t H i t [ 4 1 ] / I : b a c k H i t [ 4 1 ] / I : f r o n t d E [ 4 1 ] /D: backdE [ 4 1 ] /D: f r o n t H i t P r o t o n 150 tree−>Branch ( ” monoblock ” , monoblock , ” f r o n t H i t [ 4 1 ] / I : b a c k H i t [ 4 1 ] / I : f r o n t d E [ 4 1 ] /D : backdE [ 4 1 ] /D: f r o n t H i t P r o t o n [ 4 1 ] / I : b 151 tree− >Branch ( ” i n i t i a l ” , i n i t i a l , ” P o s i t r o n E /D : E l e c t r o n E /D: Proton1E /D: Proton2E /D : Proton3E /D: AlphaE /D: Gamma1E/D : Gamm 152 153 154 155 // v a r i a b l e s t o mark p r o g r e s s i n the file 156 unsigned long p o s i t i o n =0; 157 unsigned long f i l e l e n g t h =0; 158 unsigned long s t a r t p o s =0; 159 160 i n p u t . open ( a r g v [ 1 ] , i o s : : binary | i o s : : in ) ; 161 162 if ( input . f a i l ()){ 163 c o u t< Couldn ’ t open t h e data <” file ”<<a r g v [1] < < ” . . . bummer , dude . ”<<e n d l ; 164 } 165 166 // f i g u r e o u t t h e l e n g t h o f the file 167 i n p u t . s e e k g ( 0 , i o s : : end ) ; 168 f i l e l e n g t h =i n p u t . t e l l g ( ) ; 169 170 // r e t u r n t o b e g i n n i n g t o l o o k at file 171 i n p u t . s e e k g ( 0 , i o s : : beg ) ; 172 p o s i t i o n = input . t e l l g ( ) ; 173 174 // T h i s way f o r t h e s i n g l e S i Block , i n s i d e l o o p f o r S t r i p D e t e c t o r 175 // u n s i g n e d s h o r t p a r t i c l e I D =9999; 176 // u n s i g n e d s h o r t eDep =0;// e n e r g y d e p o s i t e d w i t h o u t r e s o l u t i o n a p p l i e d 177 // u n s i g n e d s h o r t temp =0; 178 // D o u b l e t e fwhm =0;// e n e r g y d e p o s i t e d t a k i n g i n t o a c c o u n t g a u s s i n a d i s t r i b u t i o n 179 // D o u b l e t e t h r e s h =0;//? t h r e s h o l d energy ? 180 // D o u b l e t random =0; 181 // D o u b l e t randomNUM=0; 182 183 // go t h r o u g h program , p u l l i m p o r t a n t data , write to tree structure 184 w h i l e ( p o s i t i o n <f i l e l e n g t h ){ 185 s t a r t p o s=p o s i t i o n ; 186 187 unsigned short p a r t i c l e I D =9999; 83
  • 98.
    188 unsigned short pixelID = 1700; 189 unsigned short f r o n t S t r i p = 100; 190 unsigned short backStrip = 100; 191 D o u b l e t maxF =0; 192 D o u b l e t maxB =0; 193 u n s i g n e d s h o r t s t r i p F =100; 194 unsigned short stripB = 100; 195 // eDep i s ” s h o r t ” b e c a u s e . . . . run w i t h i t . i t h i n k b e c a u s e i t was b i n a r y ? 196 u n s i g n e d s h o r t eDep =0;// e n e r g y d e p o s i t e d w i t h o u t r e s o l u t i o n a p p l i e d 197 D o u b l e t e fwhm =0;// e n e r g y d e p o s i t e d t a k i n g i n t o a c c o u n t g a u s s i a n d i s t r i b u t i o n 198 Double t e t h r e s h =0;//? t h r e s h o l d energy ? 199 D o u b l e t random =0; 200 D o u b l e t randomF =0; 201 D o u b l e t randomB =0; 202 203 204 205 unsigned s h o r t temp =0; 206 207 initial −>P o s i t r o n E =0; 208 initial −>E l e c t r o n E =0; 209 initial −>Proton1E =0; 210 initial −>Proton2E =0; 211 initial −>Proton3E =0; 212 initial −>AlphaE =0; 213 initial −>Gamma1E=0; 214 initial −>Gamma2E=0; 215 initial −>Gamma3E=0; 216 initial −>Gamma4E=0; 217 218 for ( i n t i =0; i <41; i ++){ 219 monoblock raw− r o n t H i t [ i ] = 0 ; >f monoblock− r o n t H i t [ i ] = 0 ; >f 220 monoblock raw− >b a c k H i t [ i ] = 0 ; monoblock−>b a c k H i t [ i ] = 0 ; 221 monoblock raw− r o n t d E [ i ] = 0 ; >f monoblock− r o n t d E [ i ] = 0 ; >f 222 monoblock raw− >backdE [ i ] = 0 ; monoblock−>backdE [ i ] = 0 ; 223 monoblock raw− r o n t H i t P r o t o n [ i ] = 0 ; >f monoblock− r o n t H i t P r o t o n [ i ] = 0 ; >f 224 monoblock raw− >b a c k H i t P r o t o n [ i ] = 0 ; monoblock−>b a c k H i t P r o t o n [ i ] = 0 ; 225 monoblock raw− r o n t p r o t o n d E [ i ] = 0 ; >f monoblock− r o n t p r o t o n d E [ i ] = 0 ; >f 226 monoblock raw− >backprotondE [ i ] = 0 ; monoblock−>backprotondE [ i ] = 0 ; 227 monoblock raw− r o n t H i t A l p h a [ i ] = 0 ; >f monoblock− r o n t H i t A l p h a [ i ] = 0 ; >f 228 monoblock raw− >b a c k H i t A l p h a [ i ] = 0 ; monoblock−>b a c k H i t A l p h a [ i ] = 0 ; 229 monoblock raw− r o n t a l p h a d E [ i ] = 0 ; >f monoblock− r o n t a l p h a d E [ i ] = 0 ; >f 230 monoblock raw− >backalphadE [ i ] = 0 ; monoblock−>backalphadE [ i ] = 0 ; 231 monoblock raw− >frontHitGamma [ i ] = 0 ; monoblock−>frontHitGamma [ i ] = 0 ; 232 monoblock raw− >backHitGamma [ i ] = 0 ; monoblock−>backHitGamma [ i ] = 0 ; 233 monoblock raw− >frontgammadE [ i ] = 0 ; monoblock−>frontgammadE [ i ] = 0 ; 234 monoblock raw− >backgammadE [ i ] = 0 ; monoblock−>backgammadE [ i ] = 0 ; 235 monoblock raw− r o n t H i t E l e c t r o n [ i ] = 0 ; >f monoblock− r o n t H i t E l e c t r o n [ i ] = 0 ; >f 236 monoblock raw− >b a c k H i t E l e c t r o n [ i ] = 0 ; monoblock−>b a c k H i t E l e c t r o n [ i ] = 0 ; 237 monoblock raw− r o n t e l e c t r o n d E [ i ] = 0 ; >f monoblock− r o n t e l e c t r o n d E [ i ] = 0 ; >f 238 monoblock raw− >b a c k e l e c t r o n d E [ i ] = 0 ; monoblock−>b a c k e l e c t r o n d E [ i ] = 0 ; 239 monoblock raw− r o n t H i t P o s i t r o n [ i ] = 0 ; >f monoblock− r o n t H i t P o s i t r o n [ i ] = 0 ; >f 240 monoblock raw− >b a c k H i t P o s i t r o n [ i ] = 0 ; monoblock−>b a c k H i t P o s i t r o n [ i ] = 0 ; 241 monoblock raw− r o n t p o s i t r o n d E [ i ] = 0 ; >f monoblock− r o n t p o s i t r o n d E [ i ] = 0 ; >f 242 monoblock raw− >b a c k p o s i t r o n d E [ i ] = 0 ; monoblock−>b a c k p o s i t r o n d E [ i ] = 0 ; 243 } 244 245 monoblock raw− r o n t M u l t =0; >f monoblock− r o n t M u l t =0; >f 246 monoblock raw−>backMult =0; monoblock−>backMult =0; 247 monoblock raw− r o n t M u l t P r o t o n =0; >f monoblock− r o n t M u l t P r o t o n =0; >f 248 monoblock raw− a c k M u l t P r o t o n =0; >b monoblock− a c k M u l t P r o t o n =0; >b 249 monoblock raw− r o n t M u l t A l p h a =0; >f monoblock− r o n t M u l t A l p h a =0; >f 250 monoblock raw−>backMultAlpha =0; monoblock−>backMultAlpha =0; 251 monoblock raw− r o n t M u l t E l e c t r o n =0; >f monoblock− r o n t M u l t E l e c t r o n =0; >f 252 monoblock raw−>b a c k M u l t E l e c t r o n =0; monoblock−>b a c k M u l t E l e c t r o n =0; 253 monoblock raw− r o n t M u l t P o s i t r o n =0; >f monoblock− r o n t M u l t P o s i t r o n =0; >f 254 monoblock raw−>b a c k M u l t P o s i t r o n =0; monoblock−>b a c k M u l t P o s i t r o n =0; 255 monoblock raw−>frontMultGamma =0; monoblock−>frontMultGamma =0; 256 monoblock raw−>backMultGamma=0; monoblock−>backMultGamma=0; 257 258 monoblock raw−>sumFront =0; monoblock−>sumFront =0; 259 monoblock raw−>sumBack =0; monoblock−>sumBack =0; 260 monoblock raw−>sumFrontProton =0; monoblock−>sumFrontProton =0; 261 monoblock raw−>sumBackProton =0; monoblock−>sumBackProton =0; 262 monoblock raw−>sumFrontAlpha =0; monoblock−>sumFrontAlpha =0; 263 monoblock raw−>sumBackAlpha =0; monoblock−>sumBackAlpha =0; 264 monoblock raw− u m F r o n t P o s i t r o n =0; >s monoblock− u m F r o n t P o s i t r o n =0; >s 265 monoblock raw− u m B a c k P o s i t r o n =0; >s monoblock− u m B a c k P o s i t r o n =0; >s 266 monoblock raw− u m F r o n t E l e c t r o n =0; >s monoblock− u m F r o n t E l e c t r o n =0; >s 267 monoblock raw− u m B a c k E l e c t r o n =0; >s monoblock− u m B a c k E l e c t r o n =0; >s 268 monoblock raw−>sumFrontGamma=0; monoblock−>sumFrontGamma=0; 269 monoblock raw−>sumBackGamma=0; monoblock−>sumBackGamma=0; 84
  • 99.
    270 271 monoblock raw− r o n t S t r i p =100; >f monoblock raw−>b a c k S t r i p =100; 272 monoblock raw−>maxFront =0; monoblock raw−>maxBack =0; 273 274 monoblock− r o n t S t r i p =100; >f monoblock−>b a c k S t r i p =100; 275 monoblock−>maxFront =0; monoblock−>maxBack =0; 276 277 i n p u t . r e a d ( r e i n t e r p r e t c a s t <c h a r ∗ > (&temp ) , s i z e o f ( unsigned short ) ) ; 278 279 // c h e c k f o r b e g i n n i n g o f e v e n t 280 i f ( temp == 0xEEEE) { 281 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 282 // d o u b l e c h e c k f o r b e g i n n i n g o f e v e n t 283 i f ( temp == 0xEEEE) { 284 // r e a d t h e i n i t i a l e n e r g i e s o f p o t e n t i a l s o u r c e p a r t i c l e s 285 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 286 initial − >P o s i t r o n E=temp ; 287 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 288 initial − >E l e c t r o n E=temp ; 289 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 290 initial − >Proton1E=temp ; 291 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 292 initial − >Proton2E=temp ; 293 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 294 initial − >Proton3E=temp ; 295 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 296 initial − >AlphaE=temp ; 297 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 298 initial − >Gamma1E=temp ; 299 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 300 initial − >Gamma2E=temp ; 301 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 302 initial − >Gamma3E=temp ; 303 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 304 initial − >Gamma4E=temp ; 305 306 // c h e c k f o r i o n h i t 307 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; / / 308 i f ( temp == 0xFFF0 ) { 309 // unpack i o n d a t a ( p a r t i c l e I D and Energy d e p o s i t e d ) 310 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 311 // c o u t< temp i s : ”<<temp< n d l ; <” <e 312 313 // was u s e d f o r s i n g l e S i b l o c k , but n o t f o r s t r i p s 314 // need t o add s o m e t h i n g f a n c y i n h e r e t o e x t r a c t t h e a c t u a l p a r t i c l e I D 315 // i f ( temp ! = 6 5 5 3 5 ) { / / i f n o t FFFF( i n HEX) / End o f Event 316 // p a r t i c l e I D=temp ; / / temp i s a c t u a l l y t h e p a r t i c l e number i n t h i s c a s e 317 // // c o u t< <”&p a r t i c l e I D i s : ”<<&p a r t i c l e I D < n d l ; <e 318 // } 319 320 // r e a d u n t i l you h i t t h e end o f t h e e v e n t (FFFF) 321 w h i l e ( temp != 6 5 5 3 5 ) { / / e q u i v : 0xFFFF 322 // A l l r e a d v a r i a b l e s a r e ” u n s i g n e d s h o r t ” b e c a u s e r e a d d a t a i s i n b i n a r y f o r m a t 323 // f i r s t r e a d i s P i x e l I D , t h e n p a r t i c l e I D , t h e n . . . s e e R e s u l t s . c c ( ˜ l i n e 1 3 3 ) 324 // i n p u t . r e a d ( r e i n t e r p r e t c a s t <c h a r∗> (& p i x e l I D ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 325 p i x e l I D=temp ; 326 i n p u t . r e a d ( r e i n t e r p r e t c a s t <c h a r∗> (& p a r t i c l e I D ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 327 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&eDep ) , s i z e o f ( u n s i g n e d s h o r t ) ) ; 328 329 f r o n t S t r i p = s t a t i c c a s t <u n s i g n e d s h o r t >( p i x e l I D / 4 0 ) +1; 330 b a c k S t r i p = s t a t i c c a s t <u n s i g n e d s h o r t >( p i x e l I D %40) +1; 331 332 // c o u t<<” p i x e l I D : ”<<p i x e l I D <<” p a r t i c l e I D : ”<<p a r t i c l e I D < eDep : ”<<eDep< n d l ; <” <e 333 // c o u t<<” f r o n t S t r i p : ”<<f r o n t S t r i p < b a c k S t r i p ”<<b a c k S t r i p < n d l ; <” <e 334 335 monoblock raw− r o n t H i t [ f r o n t S t r i p ] = 1 ; >f 336 monoblock raw−>b a c k H i t [ b a c k S t r i p ] = 1 ; 337 monoblock raw− r o n t d E [ f r o n t S t r i p ] +=eDep ; >f 338 monoblock raw−>backdE [ b a c k S t r i p ] +=eDep ; 339 340 e fwhm= DSSD FWHM( eDep ) ; 341 e t h r e s h= DSSD Threshold ( e fwhm ) ; 342 randomF = gRandom− >Rndm ( ) ; 343 randomB = gRandom− >Rndm ( ) ; 344 345 if ( e t h r e s h > randomF ) { 346 monoblock− r o n t H i t [ f r o n t S t r i p ] =1; >f 347 monoblock− r o n t d E [ f r o n t S t r i p ] += e fwhm ; >f 348 } 349 350 if ( e t h r e s h > randomB ) { 351 monoblock− >b a c k H i t [ b a c k S t r i p ] = 1 ; 85
  • 100.
    352 monoblock− >backdE [ b a c k S t r i p ] += e fwhm ; 353 } 354 //Now r e a d t h e p a r t i c l e t y p e 355 i f ( p a r t i c l e I D ==0){ 356 // c o u t< I m p l a n t i n g an p i n S t r i p : ”<<f r o n t S t r i p < w i t h E : ”<<eDep< n d l ; / / / <” <” <e 357 monoblock raw− r o n t H i t P r o t o n [ f r o n t S t r i p ] = 1 ; >f 358 monoblock raw− >b a c k H i t P r o t o n [ b a c k S t r i p ] = 1 ; 359 monoblock raw− r o n t p r o t o n d E [ f r o n t S t r i p ] += eDep ; >f 360 monoblock raw− >backprotondE [ b a c k S t r i p ] += eDep ; 361 362 if ( e t h r e s h > randomF ) { 363 monoblock− r o n t H i t P r o t o n [ f r o n t S t r i p ] = 1 ; >f 364 monoblock− r o n t p r o t o n d E [ f r o n t S t r i p ] += e fwhm ; >f 365 } 366 if ( e t h r e s h > randomB ) { 367 monoblock− >b a c k H i t P r o t o n [ b a c k S t r i p ] = 1 ; 368 monoblock− >backprotondE [ b a c k S t r i p ] += e fwhm ; 369 } 370 } e l s e i f ( p a r t i c l e I D ==1){ 371 // c o u t< I m p l a n t i n g an e+ i n S t r i p : ”<<f r o n t S t r i p < w i t h E : ”<<eDep< n d l ; / / / <” <” <e 372 monoblock raw− r o n t H i t P o s i t r o n [ f r o n t S t r i p ] =1; >f 373 monoblock raw− >b a c k H i t P o s i t r o n [ b a c k S t r i p ] = 1 ; 374 monoblock raw− r o n t p o s i t r o n d E [ f r o n t S t r i p ] +=eDep ; >f 375 monoblock raw− >b a c k p o s i t r o n d E [ b a c k S t r i p ] += eDep ; 376 377 if ( e t h r e s h > randomF ) { 378 monoblock− r o n t H i t P o s i t r o n [ f r o n t S t r i p ] =1; >f 379 monoblock− r o n t p o s i t r o n d E [ f r o n t S t r i p ] += e fwhm ; >f 380 } 381 if ( e t h r e s h > randomB ) { 382 monoblock− >b a c k H i t P o s i t r o n [ b a c k S t r i p ] = 1 ; 383 monoblock− >b a c k p o s i t r o n d E [ b a c k S t r i p ] += e fwhm ; 384 } 385 } 386 e l s e i f ( p a r t i c l e I D ==2){ 387 // c o u t< I m p l a n t i n g an e− i n S t r i p : ”<<f r o n t S t r i p < w i t h E : ”<<eDep< n d l ; / / / <” <” <e 388 monoblock raw− r o n t H i t E l e c t r o n [ f r o n t S t r i p ] = 1 ; >f 389 monoblock raw− >b a c k H i t E l e c t r o n [ b a c k S t r i p ] = 1 ; 390 monoblock raw− r o n t e l e c t r o n d E [ f r o n t S t r i p ] += eDep ; >f 391 monoblock raw− >b a c k e l e c t r o n d E [ b a c k S t r i p ] += eDep ; 392 393 if ( e t h r e s h > randomF ) { 394 monoblock− r o n t H i t E l e c t r o n [ f r o n t S t r i p ] = 1 ; >f 395 monoblock− r o n t e l e c t r o n d E [ f r o n t S t r i p ] += e fwhm ; >f 396 } 397 if ( e t h r e s h > randomB ) { 398 monoblock− >b a c k H i t E l e c t r o n [ b a c k S t r i p ] = 1 ; 399 monoblock− >b a c k e l e c t r o n d E [ b a c k S t r i p ] +=e fwhm ; 400 } 401 } 402 e l s e i f ( p a r t i c l e I D ==3){/∗ 403 c o u t< I m p l a n t i n g an g i n S t r i p : ”<<f r o n t S t r i p < w i t h E : ”<<eDep< n d l ; / / / <” <” <e 404 monoblock raw− >frontHitGamma [ f r o n t S t r i p ] = 1 ; 405 monoblock raw− >backHitGamma [ b a c k S t r i p ] = 1 ; 406 monoblock raw− >frontgammadE [ f r o n t S t r i p ] += eDep ; 407 monoblock raw− >backgammadE [ b a c k S t r i p ] += eDep ; 408 409 if ( e t h r e s h > randomF ) { 410 monoblock− >frontHitGamma [ f r o n t S t r i p ] = 1 ; 411 monoblock− >frontgammadE [ f r o n t S t r i p ] += e fwhm ; 412 } 413 if ( e t h r e s h > randomB ) { 414 monoblock− >backHitGamma [ b a c k S t r i p ] = 1 ; 415 monoblock− >backgammadE [ b a c k S t r i p ] += e fwhm ; 416 }∗/ 417 } 418 e l s e i f ( p a r t i c l e I D ==4){ 419 // c o u t< I m p l a n t i n g an a i n S t r i p : ”<<f r o n t S t r i p < w i t h E : ”<<eDep< n d l ; / / / <” <” <e 420 monoblock raw− r o n t H i t A l p h a [ f r o n t S t r i p ] = 1 ; >f 421 monoblock raw− >b a c k H i t A l p h a [ b a c k S t r i p ] = 1 ; 422 monoblock raw− r o n t a l p h a d E [ f r o n t S t r i p ] += eDep ; >f 423 monoblock raw− >backalphadE [ b a c k S t r i p ] += eDep ; 424 425 if ( e t h r e s h > randomF ) { 426 monoblock− r o n t H i t A l p h a [ f r o n t S t r i p ] = 1 ; >f 427 monoblock− r o n t a l p h a d E [ f r o n t S t r i p ] += e fwhm ; >f 428 } 429 if ( e t h r e s h > randomB ) { 430 monoblock− >b a c k H i t A l p h a [ b a c k S t r i p ] = 1 ; 431 monoblock− >backalphadE [ b a c k S t r i p ] += eDep ; 432 } 433 } 86
  • 101.
    434 435 //now add t o m u l t i p l i c i t i e s and sums f o r DSSD ’ s 40 s t r i p s 436 f o r ( i n t i =0; i <41; i ++){ 437 monoblock raw− r o n t M u l t += monoblock raw− r o n t H i t [ i ] ; >f >f 438 monoblock raw− >backMult += monoblock raw− >b a c k H i t [ i ] ; 439 monoblock raw− >sumFront += monoblock raw− r o n t d E [ i ] ; >f 440 monoblock raw− >sumBack += monoblock raw− >backdE [ i ] ; 441 442 e fwhm = DSSD FWHM( monoblock raw− r o n t d E [ i ] ) ; >f 443 e t h r e s h = DSSD Threshold ( e fwhm ) ; 444 random = gRandom− >Rndm ( ) ; 445 i f ( e t h r e s h > random ) { 446 monoblock− r o n t M u l t += monoblock raw− r o n t H i t [ i ] ; >f >f 447 monoblock− >sumFront += e fwhm ; 448 } 449 e fwhm = DSSD FWHM( monoblock raw− >backdE [ i ] ) ; 450 e t h r e s h = DSSD Threshold ( e fwhm ) ; 451 random = gRandom− >Rndm ( ) ; 452 i f ( e t h r e s h > random ) { 453 monoblock− >backMult += monoblock raw− >b a c k H i t [ i ] ; 454 monoblock− >sumBack += e fwhm ; 455 } 456 457 monoblock raw− r o n t M u l t P r o t o n += monoblock raw− r o n t H i t P r o t o n [ i ] ; >f >f 458 monoblock raw− a c k M u l t P r o t o n += monoblock raw− >b >b a c k H i t P r o t o n [ i ] ; 459 monoblock raw−>sumFrontProton += monoblock raw− r o n t p r o t o n d E [ i ] ; >f 460 monoblock raw−>sumBackProton += monoblock raw− >backprotondE [ i ] ; 461 462 monoblock raw− r o n t M u l t P o s i t r o n += monoblock raw− r o n t H i t P o s i t r o n [ i ] ; >f >f 463 monoblock raw−>b a c k M u l t P o s i t r o n += monoblock raw−>b a c k H i t P o s i t r o n [ i ] ; 464 monoblock raw− u m F r o n t P o s i t r o n += monoblock raw− r o n t p o s i t r o n d E [ i ] ; >s >f 465 monoblock raw− u m B a c k P o s i t r o n += monoblock raw− >s >b a c k p o s i t r o n d E [ i ] ; 466 467 monoblock raw− r o n t M u l t E l e c t r o n += monoblock raw− r o n t H i t E l e c t r o n [ i ] ; >f >f 468 monoblock raw−>b a c k M u l t E l e c t r o n += monoblock raw−>b a c k H i t E l e c t r o n [ i ] ; 469 monoblock raw− u m F r o n t E l e c t r o n += monoblock raw− r o n t e l e c t r o n d E [ i ] ; >s >f 470 monoblock raw− u m B a c k E l e c t r o n += monoblock raw− >s >b a c k e l e c t r o n d E [ i ] ; 471 472 monoblock raw− r o n t M u l t A l p h a += monoblock raw− r o n t H i t A l p h a [ i ] ; >f >f 473 monoblock raw−>backMultAlpha += monoblock raw− >b a c k H i t A l p h a [ i ] ; 474 monoblock raw−>sumFrontAlpha += monoblock raw− r o n t a l p h a d E [ i ] ; >f 475 monoblock raw−>sumBackAlpha += monoblock raw− >backalphadE [ i ] ; 476 477 monoblock raw−>frontMultGamma += monoblock raw−>frontHitGamma [ i ] ; 478 monoblock raw−>backMultGamma += monoblock raw−>backHitGamma [ i ] ; 479 monoblock raw−>sumFrontGamma += monoblock raw−>frontgammadE [ i ] ; 480 monoblock raw−>sumBackGamma += monoblock raw−>backgammadE [ i ] ; 481 482 483 monoblock− r o n t M u l t P r o t o n += monoblock− r o n t H i t P r o t o n [ i ] ; >f >f 484 monoblock− a c k M u l t P r o t o n += monoblock− >b >b a c k H i t P r o t o n [ i ] ; 485 monoblock−>sumFrontProton += monoblock− r o n t p r o t o n d E [ i ] ; >f 486 monoblock−>sumBackProton += monoblock− >backprotondE [ i ] ; 487 488 monoblock− r o n t M u l t P o s i t r o n += monoblock− r o n t H i t P o s i t r o n [ i ] ; >f >f 489 monoblock−>b a c k M u l t P o s i t r o n += monoblock−>b a c k H i t P o s i t r o n [ i ] ; 490 monoblock− u m F r o n t P o s i t r o n += monoblock− r o n t p o s i t r o n d E [ i ] ; >s >f 491 monoblock− u m B a c k P o s i t r o n += monoblock− >s >b a c k p o s i t r o n d E [ i ] ; 492 493 monoblock− r o n t M u l t E l e c t r o n += monoblock− r o n t H i t E l e c t r o n [ i ] ; >f >f 494 monoblock−>b a c k M u l t E l e c t r o n += monoblock−>b a c k H i t E l e c t r o n [ i ] ; 495 monoblock− u m F r o n t E l e c t r o n += monoblock− r o n t e l e c t r o n d E [ i ] ; >s >f 496 monoblock− u m B a c k E l e c t r o n += monoblock− >s >b a c k e l e c t r o n d E [ i ] ; 497 498 monoblock− r o n t M u l t A l p h a += monoblock− r o n t H i t A l p h a [ i ] ; >f >f 499 monoblock−>backMultAlpha += monoblock− >b a c k H i t A l p h a [ i ] ; 500 monoblock−>sumFrontAlpha += monoblock− r o n t a l p h a d E [ i ] ; >f 501 monoblock−>sumBackAlpha += monoblock− >backalphadE [ i ] ; 502 503 monoblock−>frontMultGamma += monoblock−>frontHitGamma [ i ] ; 504 monoblock−>backMultGamma += monoblock−>backHitGamma [ i ] ; 505 monoblock−>sumFrontGamma += monoblock−>frontgammadE [ i ] ; 506 monoblock−>sumBackGamma += monoblock−>backgammadE [ i ] ; 507 508 }// end l o o p for multiplicities and sums 509 510 // l o o p o v e r s t r i p s t o s e e where t h e most e n e g e r y was d e p o s i t e d 511 // − − > p r e s u m a b l y t h i s would h e l p f i n d t h e p o i n t o f an i m p l a n t − − 512 f o r ( i n t i =0; i <41; i ++){ 513 i f ( monoblock− r o n t d E [ i ] > maxF) { >f 514 maxF = monoblock− r o n t d E [ i ] ; >f 515 stripF = i ; 87
  • 102.
    516 } 517 if ( monoblock− >backdE [ i ] > maxB) { 518 maxB = monoblock− >backdE [ i ] ; 519 s t r i p B= i ; 520 } 521 } 522 523 monoblock raw− r o n t S t r i p = s t r i p F ; >f 524 monoblock raw−>b a c k S t r i p= s t r i p B ; 525 monoblock raw−>maxFront=maxF ; 526 monoblock raw−>maxBack =maxB ; 527 528 monoblock− r o n t S t r i p = s t r i p F ; >f 529 monoblock−>b a c k S t r i p = s t r i p B ; 530 monoblock−>maxFront = maxF ; 531 monoblock−>maxBack = maxB ; 532 533 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( unsigned short ) ) ; 534 } 535 }// end I f temp=0xFFF0 536 537 // r e a d end o f e v e n t marker and add t o e v e n t c o u n t s 538 i f ( temp == 0xFFFF) { 539 e v e n t s ++; 540 i f ( e v e n t s %10000 == 0 ) { 541 // c o u t << ” P r o c e s s e d ” << e v e n t s <<” e v e n t s . ”<<e n d l ; 542 } 543 // r e a d s e c o n d end o f e v e n t marker 544 i n p u t . r e a d ( r e i n t e r p r e t c a s t < c h a r ∗ > (&temp ) , s i z e o f ( u n s i g n e d short ) ) ; 545 } 546 } 547 } 548 // i f ( p a r t i c l e I D != 9 9 9 9 ) { 549 // c o u t<<”# # # # # # # # # # # # # # # # # # # # # ECHO # # # # # # # # # # # # # # # # # # # # # # # # # # #”<<e n d l ; 550 // c o u t<<” p i x e l I D : ”<<p i x e l I D <<” p a r t i c l e I D : ”<<p a r t i c l e I D < eDep : ”<<eDep< n d l ; <” <e 551 // c o u t<<” f r o n t S t r i p : ”<<f r o n t S t r i p < b a c k S t r i p ”<<b a c k S t r i p < n d l ; <” <e 552 // c o u t<<”# # # # # # # # # N ECHO # # # # # # # # # # # # #”<<e n d l ; # # # # # # # #E D # # # # # # # # # # # # # 553 //} 554 // i f ( monoblock− r o n t H i t E l e c t r o n [ 2 1 ] != 0 ) { >f 555 // c o u t< Here f o r s t r i p 2 0 , F r o n t e− h i t : ”<<monoblock− r o n t H i t E l e c t r o n [21] < < ” f r o n t d E e−”<<monoblock− <” >f 556 //} 557 558 tree− F i l l ( ) ; > 559 p o s i t i o n = input . t e l l g ( ) ; 560 } 561 562 // c l o s e i n p u t and o u t p u t f i l e s ; d e l e t e headers 563 c o u t << ”TaDa ! f i n i s h e d . ” << e n d l ; 564 565 tree−>Print ( ) ; 566 input . close ( ) ; 567 f−>Write ( ) ; 568 delete tree ; 569 delete f ; 570 }; 88
  • 103.
    Curriculum Vitae National SuperconductingCyclotron Laboratory Phone: (440) 242-5034 Michigan State University email: meiselza@msu.edu 1 Cyclotron Lab East Lansing, MI 48824 Education Michigan State University (8/2006-Present) Astrophysics Bachelor of Science Director of Thesis Research: Dr. Hendrik Schatz Current G.P.A.: 3.79/4.00 Fellowships and Awards DOE Office of Science Graduate Student Fellowship Finalist (4/2010) Carl L. Foiles Award, Michigan State University Physics & As- tronomy Department (4/2010) Travel and Lodging Grant, Division of Nuclear Physics Annual Meeting (9/2009) Lawrence W. Hantel Endowed Fellowship, Michigan State Uni- versity Physics & Astronomy Department (11/2008) Travel and Lodging Grant, Division of Nuclear Physics Annual Meeting (9/2008) Honors College National Scholarship, Michigan State University (2006-2010) Research Experience Research Assistant, National Superconducting Cyclotron Labo- ratory (12/2007-Present) Studied nucleosynthesis, explosive stellar environments, and re- action rate measurement under the guidance of Dr. Hendrik Schatz. Studied nuclear reaction rate parameterization under the guidance of Dr. Richard Cyburt. 89
  • 104.
    Research Assistant, LymanBriggs College at Michigan State Uni- versity (12/2006-7/2007) Studied the history of invisible ink under the guidance of Dr. Kristie Macrakis. Publications Richard Cyburt, A.M. Amthor, R. Ferguson, A. Heger, R. Hoff- man, Z. Meisel, T. Rauscher, A. Sakharuk, H. Schatz, K. Smith, S. Warren, F.-K. Thielemann, M. Wiescher, and S.E. Woosley. “THE JINA REACLIB Database, its recent updates and impact on Type-I X-ray Bursts” Under review by the Astrophysical Journal Supplement Series A. Matthew Amthor, Karl Smith, R. Cyburt, A. Heger, E. John- son, M. Klein, Z. Meisel, T. Rasucher, A. Sakharuk, H. Schatz, F.-K. Thielemann, S. Warren, and M. Wiescher. “Sensitivity of X-ray Burst Models to Uncertainties in Nuclear Processes” In preparation Zachary Meisel, Richard Cyburt, A.M. Amthor, R. Ferguson, J. Fisker, A. Heger, E. Johnson, T. Rauscher, A. Sakharuk, H. Schatz, K. Smith, F.-K. Thielemann, S. Warren, and M. Wi- escher. “The rp-process in Type-I X-ray Bursts with REACLIB V1.0” Proceedings for Nuclei in the Cosmos X Symposium. (7/2008) Posters and Talks Zachary Meisel, H. Crawford, G. Lorusso, P. Mantica, A. Morton, J. Periera, J. Priscindaro, M. del Santo, and H. Schatz “Simulations for Silicon Strip Detector Calibration and Code Comparison” Poster presented at the American Physical Society/Japan Physi- cal Society Joint Meeting of the Division of Nuclear Physics, Big Island, Hawaii. (10/2009) Zachary Meisel “Detector Response Simulations Using MCNPX and GEANT4” Talk given at the Nuc-Astro Graduate Student Conference, Chapel Hill, North Carolina. (9/2009) Zachary Meisel, R. Cyburt, A. Estrade, R. Ferguson, A. Sakharuk, 90
  • 105.
    H. Schatz, K.Smith, F.-K. Thielemann, S. Warren, and M. Wi- escher. “REACLIB: A Reaction Rate Library for the Era of Collabora- tive Science” Poster presented at the American Physical Society Division of Nuclear Physics Annual Meeting, Oakland, California. (10/2008) Zachary Meisel, Richard Cyburt, A.M. Amthor, R. Ferguson, A. Heger, R. Hoffman, T. Rauscher, A. Sakharuk, H. Schatz, K. Smith, S. Warren, F.-K. Thielemann, M. Wiescher, and S.E. Woosley. “The rp-process in Type-I X-ray Bursts with REACLIB V1.0” Poster presented at the 10th Symposium on Nuclei in the Cosmos, Mackinaw Island, Michigan. (7/2008) Memberships/Affiliations Joint Institute for Nuclear Astrophysics Sigma Pi Sigma, National Physics Honor Society American Physical Society Society of Physics Students of the American Institute of Physics Mortar Board National College Honor Society, Michigan State Chapter 91