Skip to content
Snippets Groups Projects
Commit 66a56ff1 authored by MANZANILLAS Luis's avatar MANZANILLAS Luis
Browse files

add cmake file

parent fbd6e4c3
No related branches found
No related tags found
No related merge requests found
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(Ge2SOS)
#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
# You can set WITH_GEANT4_UIVIS to OFF via the command line or ccmake/cmake-gui
# to build a batch mode only executable
#
option(WITH_GEANT4_UIVIS "Build example with Geant4 UI and Vis drivers" ON)
if(WITH_GEANT4_UIVIS)
find_package(Geant4 REQUIRED ui_all vis_all)
else()
find_package(Geant4 REQUIRED)
endif()
#----------------------------------------------------------------------------
# Setup Geant4 include directories and compile definitions
#
include(${Geant4_USE_FILE})
#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)
#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(Ge2SOS Ge2SOS.cc ${sources} ${headers})
target_link_libraries(Ge2SOS ${Geant4_LIBRARIES} )
#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
# build OpNovice. This is so that we can run the executable directly because it
# relies on these scripts being in the current working directory.
#
set(Ge2SOS_SCRIPTS
vis.mac
gui.mac
)
foreach(_script ${Ge2SOS_SCRIPTS})
configure_file(
${PROJECT_SOURCE_DIR}/${_script}
${PROJECT_BINARY_DIR}/${_script}
COPYONLY
)
endforeach()
#----------------------------------------------------------------------------
# Install the executable to 'bin' directory under CMAKE_INSTALL_PREFIX
#
install(TARGETS Ge2SOS DESTINATION bin)
#!/bin/sh
for thick in {1..1..1}
do
echo $thick
for job in {1..5..1}
do
for energy in {1..10..1}
do
FILE="run_E_${energy}_collimator_thickness_${thick}mm_job_${job}.mac"
/bin/cat <<EOM >$FILE
/process/em/fluo true
/process/em/auger true
/process/em/augerCascade true
/process/em/pixe true
/Ge2SOS/det/setOutputDirectory /nfs/tegile/work/experiences/detecteurs/manzanillas/LEAPS_INNOV/Geant4_output/
#select detector type: options are 0: detector without collimator and direct beam, 1 detector with collimator and direct beam, 2 and 3 same as 0 and 1 but with sample and beam on sample
/Ge2SOS/det/setDetectorType 0
/Ge2SOS/det/setSetupName run_${job}
#select output format, options are: csv root hdf5
/Ge2SOS/det/setDataType csv
/Ge2SOS/det/setNTargetSamples 1
/Ge2SOS/det/setGeDetectorThickness 4. mm
/Ge2SOS/det/setCollimatorThickness ${thick}. mm
#select material of the collimator, recomended options: titanium_grade1, titanium_grade2, tungsten_alloy, G4_BRASS, G4_Pb
/Ge2SOS/det/setCollimatorMat G4_Pb
/Ge2SOS/det/setBeWindowRadius 16.0 mm
#Set the position of the collimator, a values between -37 and 37 mm (size of samples)
#Choise of source type: 0 gamma,1 Fe-55,2 Cs-137; 1 Bi-207; 2 Sr-90; 3 e-
/run/initialize
/Ge2SOS/gun/sourceType 0
/Ge2SOS/gun/sourceDiameter 16.0 mm
/Ge2SOS/gun/sourceEnergy ${energy}.0 keV
/run/beamOn 500000
EOM
FILEJOB="job_E_${energy}_${thick}mm_job_${job}.sh"
/bin/cat <<EOM >$FILEJOB
#!/bin/bash
#SBATCH -n 1
#SBATCH --qos=parallel
#SBATCH --partition=sumo
#SBATCH --time=2:00:00
#SBATCH --cpus-per-task=2
#
source ~/environment_GeSOS.sh
./Ge2SOS -m run_E_${energy}_collimator_thickness_${thick}mm_job_${job}.mac
exit 0
EOM
sbatch $FILEJOB
done
done
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment