Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,16 @@ bin/

configs/
events/

data/background_spectra/

.idea/

cluster-submit.py
states/

run-local.sh
simlocal_log.txt
gdb_commands

craysim.egg-info/
70 changes: 70 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
FROM ubuntu:16.04

ENV TERM XTerm

RUN apt-get update
RUN apt-get install -y wget


### ROOT
WORKDIR /usr/opt/

RUN wget https://root.cern.ch/download/root_v6.12.06.Linux-ubuntu16-x86_64-gcc5.4.tar.gz
RUN tar xvfz root_v6.12.06.Linux-ubuntu16-x86_64-gcc5.4.tar.gz
WORKDIR /usr/opt/root

RUN apt-get install -y apt-utils cmake
RUN apt-get install -y libtbb2 g++ gcc
RUN apt-get install -y python
RUN apt-get install -y make
RUN apt-get install -y python-dev

RUN apt-get update
RUN apt-get upgrade -y binutils

### GEANT
WORKDIR /usr/opt

RUN wget http://geant4.web.cern.ch/geant4/support/source/geant4.10.01.p03.tar.gz
RUN tar -xzf geant4.10.01.p03.tar.gz

WORKDIR /usr/opt/geant_build

RUN cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/opt/geant -DGEANT4_INSTALL_DATA=ON -DBUILD_SHARED_LIBS=ON /usr/opt/geant4.10.01.p03/
RUN make -j8
RUN make install
RUN rm -rf /usr/opt/geant_build

### Python

RUN apt-get update
RUN apt-get install -y python-pip

RUN pip install numpy

RUN apt-get install -y gdb
RUN apt-get install -y valgrind

### CRAYFIS-SIM

COPY data /usr/app/data
COPY include /usr/app/include
COPY src /usr/app/src
COPY pycraysim/pycraysim/utils /usr/app/scripts
COPY GNUmakefile /usr/app/
COPY TestEm1.cc /usr/app/

COPY gdb_commands /usr/app/
COPY seg_wrapper.sh /usr/app/

WORKDIR /usr/app/

RUN bash -c "export G4INSTALL=/usr/opt/geant/ && source /usr/opt/root/bin/thisroot.sh && source /usr/opt/geant/share/Geant4-10.1.3/geant4make/geant4make.sh && export G4G4WORKDIR=/usr/geant_workdir && make -j9"

WORKDIR /usr/app/
RUN bash -c "source /usr/opt/root/bin/thisroot.sh && python scripts/configs.py 10000 -n 3000 -j10 -o /output"

COPY run.sh /usr/app/
COPY run.py /usr/app/

CMD sh run.sh
25 changes: 13 additions & 12 deletions data/config/run.mac.template → config/run.mac.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# example driver macro

# beam energy in keV
/control/alias beamEnergy $beamEnergy
/control/alias beamEnergy 0
# beam particle (gamma, mu-, e-, etc)
/control/alias bParticle $particle

Expand All @@ -27,11 +27,6 @@
/control/alias seed2 $seed2
/random/setSeeds {seed1} {seed2}

# set this to 1 if you want the beam
# angle to be randomly distributed
/control/alias doRandom 1



/control/verbose 2
/run/verbose 2
Expand All @@ -44,22 +39,28 @@
/testem/det/setDepth {pixDepth} um
/testem/det/setNPix {npix}

# set this if you want to use cuts different from the default (0.5um)
#/testem/phys/setCuts 0.5 um

/run/initialize


/gun/particle {bParticle}
#/gun/energy {beamEnergy} keV
/testem/gun/rndm {doRandom}
/gun/energy -1 keV


# uncomment the following line if you want the energy
# to be sampled from a histogram.
# the file should contain a TH1F named "particleEnergy",
# with the desired distribution in units of keV.
# the file should contain a TH1F named "energy",
# with the desired distribution in units of MeV.

/testem/gun/energy/hist $energyHisto

/testem/gun/energyHisto $energyHisto
# uncomment the following if you want the angle theta to be sampled
# from a histogram. When sampling theta, the angle phi will be uniformly
# distributed. The file should contain a TH1F named "theta" in units of radians.

/testem/gun/theta/hist data/theta_cos2.root


# how often to print progress
Expand All @@ -69,4 +70,4 @@
/analysis/setFileName $output

# run the specified number of events
/run/beamOn {ngen}
/run/beamOn {ngen}
2 changes: 0 additions & 2 deletions data/background_spectra/README

This file was deleted.

Binary file removed data/background_spectra/e+.root
Binary file not shown.
Binary file removed data/background_spectra/e-.root
Binary file not shown.
Binary file removed data/background_spectra/gamma.root
Binary file not shown.
Binary file removed data/background_spectra/mu+.root
Binary file not shown.
Binary file removed data/background_spectra/mu-.root
Binary file not shown.
Binary file removed data/background_spectra/neutron.root
Binary file not shown.
Binary file removed data/background_spectra/proton.root
Binary file not shown.
2 changes: 2 additions & 0 deletions data/diff_spectra/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Source: https://github.com/swaneyjr/AirplaneCosmicSpectrum
This is DIFFERENTIAL spectra at sea level.
81 changes: 81 additions & 0 deletions data/diff_spectra/e+.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
0.011294 6.912754113714E-06
0.014219 8.21569988483745E-06
0.017901 9.75536350688826E-06
0.022536 1.15698910449686E-05
0.028371 1.37008769139771E-05
0.035717 1.61919015498089E-05
0.044965 1.90857935076182E-05
0.056607 2.24204923660206E-05
0.071264 2.62230479522847E-05
0.089717 3.04998153580735E-05
0.11294 3.52230304776175E-05
0.14219 4.03244964991915E-05
0.17901 4.56701327863593E-05
0.22536 5.10618981723173E-05
0.28371 5.62379659303892E-05
0.35717 6.08918423374971E-05
0.44965 6.47096595742407E-05
0.56608 6.74204824678977E-05
0.71264 6.88439516065054E-05
0.89717 6.8922031920449E-05
1.1294 6.77214152675347E-05
1.4219 6.54077624829588E-05
1.7901 6.22089785794004E-05
2.2536 5.83699105710532E-05
2.8371 5.41190466647287E-05
3.5717 4.96485573764971E-05
4.4965 4.51069203985617E-05
5.6607 4.0600046230926E-05
7.1265 3.61973079903103E-05
8.9717 3.19431779815502E-05
11.295 2.78641433794673E-05
14.219 2.39824989441335E-05
17.901 2.03182078019703E-05
22.536 1.69015092585623E-05
28.371 1.3769141542965E-05
35.717 1.09620569797416E-05
44.965 8.51689202252719E-06
56.607 6.45545551391666E-06
71.265 4.77695221341802E-06
89.716 3.45751280111317E-06
112.94 2.45396751323077E-06
142.19 1.71249579881554E-06
179.01 1.17869822915547E-06
225.36 8.02354861555871E-07
283.71 5.41433332065681E-07
357.17 3.62906731850952E-07
449.65 2.42002279868683E-07
566.08 1.60753006108832E-07
712.65 1.06476055954714E-07
897.16 7.0375311497041E-08
1129.4 4.64436475294839E-08
1421.9 3.06086385371354E-08
1790.1 2.01562560943039E-08
2253.6 1.32652567241597E-08
2837.1 8.72613961725299E-09
3571.7 5.73819923819996E-09
4496.5 3.77243353674064E-09
5660.8 2.47959846906465E-09
7126.5 1.62963905260313E-09
8971.7 1.07092446820664E-09
11294 7.03787203225651E-10
14219 4.62394936118268E-10
17901 3.03802828656652E-10
22536 1.99606272630061E-10
28371 1.31144706355964E-10
35717 8.61620850615325E-11
44965 5.66080420262388E-11
56608 3.71903285443165E-11
71264 2.44342543952498E-11
89716 1.60528790245929E-11
112940 1.05473953266337E-11
142190 6.92878919698013E-12
179010 4.55189794598097E-12
225360 2.99049455162931E-12
283710 1.96470016335954E-12
357170 1.29075751310548E-12
449650 8.47996617880111E-13
566080 5.57104768588322E-13
712640 3.66015331637543E-13
897160 2.40462986334895E-13

81 changes: 81 additions & 0 deletions data/diff_spectra/e-.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
0.011294 0.002689187394332
0.014219 0.002579048978592
0.017901 0.002467476429373
0.022536 0.002354051775208
0.028371 0.002238402116545
0.035717 0.00212023832646
0.044965 0.001999400281882
0.056607 0.00187589217173
0.071264 0.001749910781723
0.089717 0.00162190868036
0.11294 0.001492654913588
0.14219 0.001363040557935
0.17901 0.001234384293589
0.22536 0.001108104910314
0.28371 0.000985713600424
0.35717 0.000868711425533
0.44965 0.000758478774442
0.56608 0.000656154217899
0.71264 0.000562584564949
0.89717 0.000478232275623
1.1294 0.000403265867032
1.4219 0.000337446547504
1.7901 0.000280379533019
2.2536 0.000231429945562
2.8371 0.000189843772937
3.5717 0.000154812831942
4.4965 0.000125525825465
5.6607 0.000101202540635
7.1265 8.11159983538443E-05
8.9717 6.46177235973272E-05
11.295 5.11296864248236E-05
14.219 4.01596232582779E-05
17.901 3.12774113726374E-05
22.536 2.41290066381283E-05
28.371 1.84142984652614E-05
35.717 1.38832606679915E-05
44.965 1.03272751735292E-05
56.607 7.57083177578504E-06
71.265 5.46470621078735E-06
89.716 3.88220981178845E-06
112.94 2.71441697341347E-06
142.19 1.86834677874852E-06
179.01 1.26732441647693E-06
225.36 8.48174358283652E-07
283.71 5.60861635094641E-07
357.17 3.66988279909981E-07
449.65 2.37978852527483E-07
566.08 1.53153816272833E-07
712.65 9.79490766465823E-08
897.16 6.23234400034651E-08
1129.4 3.94935618006647E-08
1421.9 2.49380335616817E-08
1790.1 1.57059476488079E-08
2253.6 9.87103224260283E-09
2837.1 6.19350083057176E-09
3571.7 3.88088380776872E-09
4496.5 2.4292664525271E-09
5660.8 1.51935125275659E-09
7126.5 9.49671541644838E-10
8971.7 5.93296269893906E-10
11294 3.70554491999807E-10
14219 2.31313680482007E-10
17901 1.44368910374307E-10
22536 9.00913405951646E-11
28371 5.62125043564442E-11
35717 3.50694120677042E-11
44965 2.18769679710806E-11
56608 1.36460987201958E-11
71264 8.51194404628308E-12
89716 5.30903770775794E-12
112940 3.31156606446165E-12
142190 2.0651471837211E-12
179010 1.28791346960435E-12
225360 8.03218055899891E-13
283710 5.00931728152928E-13
357170 3.12402393643133E-13
449650 1.9482667420574E-13
566080 1.21498978209913E-13
712640 7.57734559007221E-14
897160 4.72547019216388E-14

Loading