How To Update PueoSim For GENETIS:
First, whoever updates pueoSim needs access to pueoBuilder, pueoSim, and niceMC on GitHub (ask Will for permissions).
Once you do, go into the peuoSim directory at /fs/ess/PAS1960/buildingPueoSim/
and source set_env.sh
`source set_env.sh`
Then, we want to make copies of the files we are currently modifying for the GENETIS loop.
For PueoSim v1.1.0 these are:
-
nicemc/src/EventGenerator.cc # Modified to create custom output root files to calculate errors
-
pueosim/test/simulatePueo.cc # Modified to stop the simulation of the LF antenna which is not needed for GENETIS
-
pueosim/src/Seavey.cc # Modified to read in custom gain files
-
pueosim/src/pueo.cc # Modified to read in custom gain files
-
pueosim/include/Seavey.hh # Modifies to read in custom gain files
Currently, I store copies of these in the `/fs/ess/PAS1960/buildingPueoSim/backups` directory in case somebody accidentally overwrites the files in pueoBuilder.
Once you’ve made the copies, you can run `./pueoBuilder.sh` from the `/fs/ess/PAS1960/buildingPueoSim/pueoBuiler` directory. This will rebuild pueoSim and niceMC, pulling the latest updates from GitHub.
You may need to delete the pueoSim and niceMC directories in order for the builder to pull the latest version from GitHub. Or, if it’s being really stubborn, move the whole pueoBuilder directory to a temporary location and run the builder from scratch with
`git clone git@github.com:PUEOCollaboration/pueoBuilder` and then `./pueoBuilder.sh`
Then, you will need to reference the copies of the changed files to make changes to the new version of pueoSim. Hope this doesn’t cause too much of a headache, and when you’re done, return to the /fs/ess/PAS1960/buildingPueoSim/pueoBuiler directory.
Then you simply type
`make install`
then
`make`
And now, pueoSim should be ready to run!
EventGeneratior.cc Changes and Rationale:
PueoSim’s default output ROOT files are very large and therefore time-consuming to parse through to get the information we need to calculate effective volume and errors. So, we want to create a custom ROOT file with only the variables we want, greatly increasing the speed of the analysis.
To do this, we want to create a new TFile with corresponding TTree and TBranches that will store the loop.positionWeight, loop.directionWeight, and neutrino.path.weight. Then, we want to fill the Tree when a detector is triggered and write the results to the file at the end of the loop.
Sample code for initializing the TFile:

simulatePueo.cc Changes and Rationale:
By default, pueoSim v1.1.0 runs a simulation for the normal antenna and a low-frequency (LF) antenna. As GENETIS is evolving for the main antenna, we are not interested in using computation time to simulate the LF antenna. So, we comment out the lines that initialize the LF detector in this file.
Seavey.cc, Seavey.hh, and pueo.cc Changes and Rationale:
As of pueoSim v1.1.0, the simulation software only has the ability to read in one antenna. This is a problem, as we want it to be able to read in files for any antenna we make. So, we need to change these scripts to be able to read in whatever gain files we want.
The convention the loop uses is to input gain files in the format of
vv_0_Toyon{runNum}
hh_0_Toyon{runNum}
…
In the ./pueoBuilder/components/pueosim/data/antennas/simulated directory
So, the main change is getting the runNum variable into Seavey.cc file where the gains are read. Currently, we define a global variable at the stary of pueo.cc and pass it into where Seavey is called. This means we have to add runNum as a parameter in Seavey.cc as well as Seavey.hh. Finally, we change the name of the read-in files to be in the above format AFTER dividing runNum by 1000 (this is because pueoSim uses the run number as a random number generating seed, so we divide runNum by 1000 to be able to read in the same gain patterns for multiple seeds of the same individual).
Note: We used to change pueoSim to output a veff.csv file. We now handle this calculation by analyzing ROOT files, so this change is no longer necessary. |