Skip to content

Commit

Permalink
BGrate_calc only used if needed. Protections for DDOS. SQLITE support
Browse files Browse the repository at this point in the history
  • Loading branch information
T-Britton committed Nov 22, 2017
1 parent 1fecab4 commit aac01eb
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
18 changes: 10 additions & 8 deletions MCwrapper/MakeMC.csh
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,17 @@ set BGRATE_toUse=$BGRATE
if ( "$BGRATE" != "rcdb" || "$VERSION" != "mc" ) then
set BGRATE_toUse=$BGGATE
else
echo "Calculating BGRate. This process takes a minute..."
set BGRATE_toUse=`BGRate_calc --runNo $RUN_NUMBER --coherent_peak $COHERENT_PEAK --beam_on_current $beam_on_current --beam_energy $eBEAM_ENERGY --collimator_diameter 0.00$colsize --radiator_thickness $radthick --endpoint_energy_low $GEN_MIN_ENERGY --endpoint_energy_high $GEN_MAX_ENERGY`
if ( $BGTAGONLY_OPTION == "1" || $BKGFOLDSTR == "BeamPhotons" ) then
echo "Calculating BGRate. This process takes a minute..."
set BGRATE_toUse=`BGRate_calc --runNo $RUN_NUMBER --coherent_peak $COHERENT_PEAK --beam_on_current $beam_on_current --beam_energy $eBEAM_ENERGY --collimator_diameter 0.00$colsize --radiator_thickness $radthick --endpoint_energy_low $GEN_MIN_ENERGY --endpoint_energy_high $GEN_MAX_ENERGY`

if ( "$BGRATE_toUse" == "" ) then
echo "BGrate_calc is not built or inaccessible. Please check your build and/or specify a BGRate to be used."
exit 12
else
set BGRATE_list=($BGRATE_toUse:as/ / /)
set BGRATE_toUse=$BGRATE_list[$#BGRATE_list]
if ( "$BGRATE_toUse" == "" ) then
echo "BGrate_calc is not built or inaccessible. Please check your build and/or specify a BGRate to be used."
exit 12
else
set BGRATE_list=($BGRATE_toUse:as/ / /)
set BGRATE_toUse=$BGRATE_list[$#BGRATE_list]
endif
endif
endif

Expand Down
23 changes: 12 additions & 11 deletions MCwrapper/MakeMC.sh
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,18 @@ BGRATE_toUse=$BGRATE
if [[ "$BGRATE" != "rcdb" || "$VERSION" != "mc" ]]; then
BGRATE_toUse=$BGGATE
else
echo "Calculating BGRate. This process takes a minute..."
BGRATE_toUse=`BGRate_calc --runNo $RUN_NUMBER --coherent_peak $COHERENT_PEAK --beam_on_current $beam_on_current --beam_energy $eBEAM_ENERGY --collimator_diameter 0.00$colsize --radiator_thickness $radthick --endpoint_energy_low $GEN_MIN_ENERGY --endpoint_energy_high $GEN_MAX_ENERGY`
echo BGRATE Is: $BGRATE_toUse
if [[ $BGRATE_toUse == "" ]]; then
echo "BGrate_calc is not built or inaccessible. Please check your build and/or specify a BGRate to be used."
exit 12
else

BGRATE_list=(`echo ${BGRATE_toUse}`)
BGRATE_list_length=${#BGRATE_list[@]}
BGRATE_toUse=`echo ${BGRATE_list[$(($BGRATE_list_length-1))]}`
if [[ $BGTAGONLY_OPTION == "1" || $BKGFOLDSTR=="BeamPhotons" ]]; then
echo "Calculating BGRate. This process takes a minute..."
BGRATE_toUse=`BGRate_calc --runNo $RUN_NUMBER --coherent_peak $COHERENT_PEAK --beam_on_current $beam_on_current --beam_energy $eBEAM_ENERGY --collimator_diameter 0.00$colsize --radiator_thickness $radthick --endpoint_energy_low $GEN_MIN_ENERGY --endpoint_energy_high $GEN_MAX_ENERGY`
echo BGRATE Is: $BGRATE_toUse
if [[ $BGRATE_toUse == "" ]]; then
echo "BGrate_calc is not built or inaccessible. Please check your build and/or specify a BGRate to be used."
exit 12
else
BGRATE_list=(`echo ${BGRATE_toUse}`)
BGRATE_list_length=${#BGRATE_list[@]}
BGRATE_toUse=`echo ${BGRATE_list[$(($BGRATE_list_length-1))]}`
fi
fi

fi
Expand Down
6 changes: 3 additions & 3 deletions MCwrapper/examples/MC.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#RUNNING_DIRECTORY=/run/in/this/directory #where the code should run. This is defaulted to ./

#ccdbSQLITEPATH=/your/sqlite/path #if you use SQLITE and it is not part of the environment file that gets sourced
#rcdbSQLITEPATH=/your/sqlite/path #if you use SQLITE and it is not part of the environment file that gets sourced
#ccdbSQLITEPATH=/your/sqlite/path/ccdb.sqlite #if you use SQLITE and it is not part of the environment file that gets sourced
#rcdbSQLITEPATH=/your/sqlite/path/rcdb.sqlite #if you use SQLITE and it is not part of the environment file that gets sourced


#TAG=my-custom-prefix-tag
Expand All @@ -17,7 +17,7 @@ DATA_OUTPUT_BASE_DIR=OUTPUT-LOCATION#your desired output location

NCORES=4 # Number of CPU threads to use or nodes:node-id:ppn or nodes:ppn depending on your system

GENERATOR=generator-to-use #or you may specifile file:/.../file-to-use
GENERATOR=generator-to-use #or you may specifile file:/.../file-to-use.hddm
GENERATOR_CONFIG=config file for generator

#common parameters for generators
Expand Down
2 changes: 1 addition & 1 deletion MCwrapper/gluex_MC.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def main(argv):

print "*********************************"
print "Welcome to v1.10 of the MCwrapper"
print "Thomas Britton 11/21/17"
print "Thomas Britton 11/22/17"
print "*********************************"

#load all argument passed in and set default options
Expand Down

0 comments on commit aac01eb

Please sign in to comment.