-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:cipriangal/prexSim
- Loading branch information
Showing
2 changed files
with
128 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# PREX simulation package | ||
|
||
## Getting the code | ||
`git clone git@github.com:cipriangal/prexSim` | ||
|
||
### Workflow | ||
If you intend to make changes to the code and contribute it is suggested that you fork this repository into your own github account. (There is a button for that on the top right of the page). You will then have a backup for your local repository on github. To get your own repository run the same line as above but change "cipriangal" to your username. | ||
|
||
Before you start working on the code make sure you update your local repository from the remote: | ||
``` | ||
git pull | ||
``` | ||
After you are done editing a file (or at the end of the day) you should: | ||
``` | ||
git commit -m "clear message of changes" changedFile1.ext ... changedFileN.ext | ||
``` | ||
(this saves the instance of these files into your local copy of the repository) | ||
``` | ||
git push | ||
``` | ||
(this takes all the saved instances you have in your local repository and send them to the remote repository) | ||
|
||
If you have a feature in your fork and you would like to make it available to other you can create a pull request. https://help.github.com/articles/creating-a-pull-request/ | ||
|
||
This repository contains multiple branches for working on different issues. You can see the list of branches at the top of the file list. If you want to create your own branch follow instrucations at https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging | ||
|
||
### Compiling the code | ||
This code has been known to compile with G4 version up to 4.10.2.3. | ||
``` | ||
mkdir build | ||
cd build | ||
cmake ../ | ||
make | ||
cd - | ||
``` | ||
### Running the code | ||
`build/prexsim macros/prex_prerunCiprian.mac` (to visualize) | ||
|
||
`build/prexsim macros/prex_prerunCiprian.mac macros/myRun.mac` (for batch mode) | ||
|
||
These two .mac files need to be modified in order to run exactly what you want. Make sure you change the number of detectors when changing from prex1 to prex2 configurations. | ||
|
||
### Analyzing output | ||
|
||
#### anaRad | ||
``` | ||
mkdir output | ||
build/anaRad | ||
``` | ||
|
||
The last line will give you instructions on what is needed as input for the executable. This will produce tables of flux and power in each detector separated by energy. The output rootfile will have additional granularity. | ||
|
||
#### Dose estimates | ||
`build/hallRad` | ||
|
||
The last line will give you instructions on what is needed as input for the executable. | ||
|
||
This analysis executable will run over sensitive detectors and will calculate a 1MeV neutron equivalent and a radiation dose rate measured in mili-rem. A series of detectors are hardcoded as being kryptonite ( [10008,100013], 10101, 10102 ) while the rest are assumed to be vacuum. This is important because the energy being used in the routine to estimate the radiation damage/dose will be either the deposited energy (kryptonite) or the kinetic energy (vacuum). | ||
|
||
## Package contents | ||
This folder contains: | ||
|
||
* **prex_sim.cc:** Main Routine for Simulation. | ||
* **CMakeLists.txt** cmake contruct for Makefile | ||
* **vis.mac:** Can be called from the simulation prompt in order to run visualization. WARNING: Analysis and visualization cannot run concurrently. | ||
* **include/:** Header files for Simulation Classes. | ||
* **src/:** Source files for Simulation Classes. | ||
* **scripts/:** Folder with scripts to submit large number of jobs to farms. | ||
* **rootScripts/:** Folder for small analysis scripts that can be run from the root prompt. | ||
|
||
##Output tree | ||
|
||
The data structure of the NTuple is as follows: | ||
|
||
`ion:x:y:z:x0:y0:z0:kineE:px:py:pz:kineE0:px0:py0:pz0:kineE1:px1:py1:pz1:kineE2:px2:py2:pz2:type:volume:theta0:theta1:theta2:ev_num:process:event:creator:hit:kineE_org:theta_org:track:diffXS:totXS:rate` | ||
|
||
During an event, very time that a particle hits a Sensitive | ||
Detector, it creates a Hit with the following data: | ||
|
||
* **ion** -if using Geant, ion is 1 if the particle was created by the process of "eIoni", which is how Geant defines Moller Scattering. Using this as a cut will give you only the Moller2 particles, as defined above. | ||
* **x** -x-position where the particle hit the Sensitive Detector | ||
* **y** -y-position where the particle hit the Sensitive Detector | ||
* **z** -z-position where the particle hit the Sensitive Detector | ||
* **x0** -x-position where the Moller interaction occurred | ||
* **y0** -y-position where the Moller interaction occurred | ||
* **z0** -z-position where the Moller interaction occurred | ||
* **kineE** -Energy of the particle when it hit the Sensitive Detector | ||
* **px** -Unit vector of momentum in x-direction at the Sensitive Detector | ||
* **py** -Unit vector of momentum in y-direction at the Sensitive Detector | ||
* **pz** -Unit vector of momentum in z-direction at the Sensitive Detector | ||
* **kineE0** -Kinetic Energy of the original electron which interacted inside the target and created particle Moller1 and Moller2 at the interaction point (x0,y0,z0) | ||
* **px0** -Unit vector of momentum in x-direction of Moller0 right before interacting | ||
* **py0** -Unit vector of momentum in y-direction of Moller0 right before interacting | ||
* **pz0** -Unit vector of momentum in z-direction of Moller0 right before interacting | ||
* **kineE1** -Kinetic Energy of the original electron which interacted inside the target and created particle Moller1 and Moller2 at the interaction point (x1,y1,z1) | ||
* **px1** -Unit vector of momentum in x-direction of Moller1 right after interacting | ||
* **py1** -Unit vector of momentum in y-direction of Moller1 right after interacting | ||
* **pz1** -Unit vector of momentum in z-direction of Moller1 right after interacting | ||
* **kineE2** -Kinetic Energy of the original electron which interacted inside the target and created particle Moller1 and Moller2 at the interaction point (x2,y2,z2) | ||
* **px2** -Unit vector of momentum in x-direction of Moller2 right after interacting. | ||
* **py2** -Unit vector of momentum in y-direction of Moller2 right after interacting. | ||
* **pz2** -Unit vector of momentum in z-direction of Moller2 right after interacting. | ||
* **type** -Particle type( electron=0, positron=1, proton=2, antiproton=3, gamma=4, other=5 ) | ||
* **volume** -Volume number of the Sensitive Detector that recorded this Hit. | ||
* **theta0** -Angle with respect to the beam axis of Moller0 right before interacting. | ||
* **theta1** -Angle with respect to the beam axis of Moller1 right after interacting. | ||
* **theta2** -Angle with respect to the beam axis of Moller2 right after interacting. | ||
* **ev_num** -Event number, as assigned by Geant. An event is defined as the set of particles and interactions that happen after the Particle Genarator 'throws' a particle into the spectrometer. | ||
* **process** -Not properly defined at the moment | ||
* **event** -Not properly defined at the moment. | ||
* **creator** -Process that created this particle, as assigned by G4 | ||
* eIoni-> 0 | ||
* conv-> 1 | ||
* Decay-> 2 | ||
* annihil-> 3 | ||
* Brem-> 4 | ||
* phot-> 5 | ||
* compt-> 6 | ||
* Transportation->7 | ||
* msc-> 8 | ||
* All Others-> 9 | ||
* **hit** -Same as trackID (see below). | ||
* **kineE_org** - Vertex energy of THIS particle. | ||
* **theta_org** - Scattering Angle of THIS particle. | ||
* **track** -Track number as assigned by GEANT. Each particle created in an Event is given an incremental trackID number. In this case, Moller1 has track=1 and Moller2 has track=2. | ||
* **diffXS** -Differential cross-section calculated in generator. | ||
* **totXS** -Total cross-section calculated in generator. | ||
* **rate** -Rate calculated in generator. |