Ricochet: Difference between revisions

Jump to navigation Jump to search
6,691 bytes added ,  20 May 2020
no edit summary
No edit summary
No edit summary
 
(11 intermediate revisions by one other user not shown)
Joseph A. Formaggio, E. Figueroa-Feliciano, A.J. Anderson (MIT, LNS). Jul 2011. 14 pp.
Published in Phys.Rev. D85 (2012) 013009.
e-Print: arXiv:1107.3512 [hep-ph] https://arxiv.org/abspdf/1107.3512.pdf
 
**DEPRECATED: Updated Twiki in progress.**
== RAT for Ricochet ==
1. '''Install Prerequisites''' - Before downloading RAT, make sure you [https://github.com/rat-pac/rat-pac/blob/master/doc/installation.rst '''install the software packages in this order'''].
 
2. '''Download RAT''' - Run git clone in your working directory. This puts RAT in a new directory called rat.
 
3. '''Set up ROOT and GEANT4'''
::* By sourcing their '''respective''' environment scripts: '''$ROOTSYS/bin/thisroot.sh''' and '''$G4INSTALL/geant4.10.01.p02-build/InstallTreeFiles/geant4.sh''' <br>
 
4. '''Run the following commands (in the rat directory) to build RAT'''
# Run configure script<br>./configure
# Setup Environment<br>source env.sh
# Compile<br>scons
 
===SUMMARY OF STEPS FOR EVERY LOGIN SESSION===
== Before Downloading ==
cd /afs/hep.wisc.edu/ddm/ratcage
Before downloading RAT from GitHub, make sure that you have the following software packages installed and it is done in this order
source env.sh
#
Note: The sourcing of env.sh only has to be done '''once per login session'''.
== Set up Environment ==
 
== Download ==
 
Download RAT from GitHub
=== Example testCfneutrons.mac ===
# Set environment variables with<br>source /afs/hep.wisc.edu/ddm/ratcage/env.sh
# The neutron detector at the MIT reactor geometry is at<br>cd /afs/hep.wisc.edu/ddm/ratcage/rat/data/Ricochet/NCD_MITR.geo<br>
# and other info is in the /data directory (MATERIALS, SPECTRUM, ELEMENTS)
# Run the macro example by typing<br>rat testCfneutrons.mac<br>
# You will see an output root file and it is useful to make a ROOT program to make histograms from it
# To see the outcome plots, you need to execute makeNeutronPlotsNCD.C
# Follow these commands
root -l
root[0] .L makeNeutronPlotsNCD.C+
root[1] makeNeutronPlotsNCD("testNeutronCf.root","histTestneutronCfNew.root")
 
You can learn a lot about a ROOT file with the TBrowser() but it's all listed in https://deapclean.org/rat/trac/wiki/UserGuide/DataStructure/MC
 
==Useful RAT info==
* https://deapclean.org/rat/trac/wiki/UserGuide/Simulation/Generators/Top
* https://deapclean.org/rat/trac/wiki/RATDB_GEO
 
 
 
 
 
 
 
== New ==
 
GitLab: https://git.ipnl.in2p3.fr/ricochet/
 
The following is a work in progress.
 
 
# Research Notes
 
## Installation
 
Sourcing environment for ROOT and RicochetSim
 
```bash
source /afs/hep.wisc.edu/ddm/Ricochet/env.sh; source /cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0-cb1ee/x86_64-centos7/setup.sh
```
 
make a `build` directory in `/SimuAnalysis/`
 
from `/SimuAnalysis/build` directory
 
**CMake Step**
 
Run the following
 
```bash
cmake -DCMAKE_INSTALL_PREFIX=/afs/hep.wisc.edu/users/decheine/myapps -DCMAKE_CXX_FLAGS=-isystem\ /afs/hep.wisc.edu/ddm/Ricochet/CLHEP_dir/build ..
```
 
or whatever install directory you'd want, the default is /usr/local.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
== Installation ==
 
Sourcing environment for ROOT and RicochetSim
 
```bash
source /afs/hep.wisc.edu/ddm/Ricochet/env.sh; source /cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0-cb1ee/x86_64-centos7/setup.sh
```
 
make a `build` directory in `/SimuAnalysis/`
 
from `/SimuAnalysis/build` directory
 
**CMake Step**
 
Run the following
 
```bash
cmake -DCMAKE_INSTALL_PREFIX=/afs/hep.wisc.edu/users/decheine/myapps -DCMAKE_CXX_FLAGS=-isystem\ /afs/hep.wisc.edu/ddm/Ricochet/CLHEP_dir/build ..
```
 
or whatever install directory you'd want, the default is /usr/local.
 
 
 
 
 
 
 
### Notes on Installation
 
#### Misc. Util commands
 
List the sizes and sort directories
 
> du -h --max-depth=1 | sort -hr
 
 
 
```bash
source /afs/hep.wisc.edu/ddm/Ricochet/env.sh; source /cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0-cb1ee/x86_64-centos7/setup.sh
```
 
#### Workaround Commands
 
These three are run after cmake is run. With new branch, these might not be needed
 
```bash
find CMakeFiles/*.dir/link.txt -type f -exec grep -l "/builds/deployment/deploy-externals/build/lib" {} \; | xargs sed -i 's/\/builds\/deployment\/deploy\-externals\/build\/lib/\/cvmfs\/lz.opensciencegrid.org\/external\/ROOT\/6.16.00\/x86_64-centos7-gcc7-opt\/lib/g'; find CMakeFiles/*.dir/build.make -type f -exec grep -l "/builds/deployment/deploy-externals/build/lib" {} \; | xargs sed -i 's/\/builds\/deployment\/deploy\-externals\/build\/lib/\/cvmfs\/lz.opensciencegrid.org\/external\/ROOT\/6.16.00\/x86_64-centos7-gcc7-opt\/lib/g'; find CMakeFiles/*.dir/flags.make -type f -exec grep -l "++1z" {} \; | xargs sed -i 's/++1z/++17/g'; find CMakeFiles/*.dir/flags.make -type f -exec grep -l "++14" {} \; | xargs sed -i 's/++14/++17/g'
```
 
and for RicochetSim
 
 
 
```bash
find */CMakeFiles/*.dir/link.txt -type f -exec grep -l "/builds/deployment/deploy-externals/build/lib" {} \; | xargs sed -i 's/\/builds\/deployment\/deploy\-externals\/build\/lib/\/cvmfs\/lz.opensciencegrid.org\/external\/ROOT\/6.16.00\/x86_64-centos7-gcc7-opt\/lib/g'; find */CMakeFiles/*.dir/build.make -type f -exec grep -l "/builds/deployment/deploy-externals/build/lib" {} \; | xargs sed -i 's/\/builds\/deployment\/deploy\-externals\/build\/lib/\/cvmfs\/lz.opensciencegrid.org\/external\/ROOT\/6.16.00\/x86_64-centos7-gcc7-opt\/lib/g'; find CMakeFiles/*.dir/flags.make -type f -exec grep -l "++1z" {} \; | xargs sed -i 's/++1z/++17/g'; find CMakeFiles/*.dir/flags.make -type f -exec grep -l "++14" {} \; | xargs sed -i 's/++14/++17/g'
```
 
 
 
**CLHEP Fix**
 
add `-DCMAKE_CXX_FLAGS=-isystem\ /afs/hep.wisc.edu/ddm/Ricochet/CLHEP_dir/build` flag to the cmake call
 
 
 
 
 
In SimuEventDisplay.dir/build.make, line 82 has
 
``` d
SimuEventDisplay: /cvmfs/sft.cern.ch/lcg/releases/gcc/7.3.0-cb1ee/x86_64-centos7/include/TEveManager.h
```
 
Maybe this should be
 
**WORKING** Added "ROOT::Eve" to both include statements
 
Two header files that are misbehaving are Counter.h and SimuHisto.h
 
GOT IT. NEED TO PUT `${PROJECT_NAME}$` at the end of the second 'target_link_libraries(...)'
 
 
 
rule to replace /builds/deployment/deploy-externals/build/lib/ with /cvmfs/lz.opensciencegrid.org/external/ROOT/6.16.00/x86_64-centos7-gcc7-opt/
 
 
 
 
 
#### Directories
 
<u>Cmake binary</u>
 
/afs/hep.wisc.edu/ddm/Ricochet/cmake-3.12.1/bin
 
<u>CXX Compiler</u>
 
/cvmfs/cms.cern.ch/slc6_amd64_gcc530/external/gcc/5.3.0/bin/c++
Using
 
```bash
cmake -DCMAKE_CXX_FLAGS=-isystem\ /afs/hep.wisc.edu/ddm/Ricochet/CLHEP_dir/build -DCMAKE_CXX_COMPILER=/cvmfs/cms.cern.ch/slc6_amd64_gcc530/external/gcc/5.3.0/bin/c++ ..
```
 
Fixes the "string_view" problem and makes it compile with c++ 17. or not i guess
 
**String_view problem** just delete build folder, and make sure to include
 
```cmake
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
```
 
do cmake again
 
<u>ROOT</u>
 
/cvmfs/lz.opensciencegrid.org/external/ROOT/6.16.00/x86_64-centos7-gcc7-opt/
 
 
This needs to be in the include directory: /cvmfs/lz.opensciencegrid.org/external/ROOT/6.16.00/x86_64-centos7-gcc7-opt/include/
 
 
 
#### Procedures
Listed here are some miscellaneous commands and tricks that may be useful.
 
 
In root, get the include path with `root[] .I`
 
To search a directory `path `in linux for files that contain text `"string"`,
 
``` bash
grep -rl "string" /path
```
 
List the ROOT LIBRARIES
 
```bash
root-config --glibs
```
3

edits

Navigation menu