-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Directory with scripts for processing at CERN added
- Loading branch information
1 parent
9bd54ab
commit 5f8da87
Showing
5 changed files
with
108 additions
and
2 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
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
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,21 @@ | ||
#!/bin/bash | ||
|
||
# Load CMS environment | ||
source ${HOME}/setup_cmsenv.sh | ||
|
||
# Add path to the PDF sets | ||
|
||
# Where the executable and the library are stored | ||
EXEC_PATH=${HOME}/soft/jetAnalysis/processing | ||
cd $EXEC_PATH | ||
|
||
input_file_list=$1 | ||
output_file_name=$2 | ||
|
||
echo -e "Input file list: ${input_file_list}" | ||
echo -e "Output file name: ${output_file_name}" | ||
|
||
# Run jetAna | ||
../build/jetAna ${input_file_list} ${output_file_name} | ||
|
||
echo -e "Data processing of thes ${input_file_list} is finished" |
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,36 @@ | ||
#!/bin/bash | ||
|
||
# Check if the correct number of arguments is provided | ||
if [ $# -ne 2 ]; then | ||
echo "Usage: $0 <input_file> <N>" | ||
exit 1 | ||
fi | ||
|
||
input_file="$1" # Input file name | ||
N="$2" # Number of entries for each sublist | ||
|
||
# Check if the input file exists | ||
if [ ! -f "$input_file" ]; then | ||
echo "Input file '$input_file' not found." | ||
exit 1 | ||
fi | ||
|
||
# Count the total number of lines in the input file | ||
total_lines=$(wc -l < "$input_file") | ||
|
||
# Calculate the number of sublists needed | ||
num_sublists=$((total_lines / N)) | ||
if [ $((total_lines % N)) -ne 0 ]; then | ||
((num_sublists++)) | ||
fi | ||
|
||
# Create sublists | ||
for ((i = 0; i < num_sublists; i++)); do | ||
start=$((i * N + 1)) # Calculate start line number for current sublist | ||
end=$((start + N - 1)) # Calculate end line number for current sublist | ||
sublist_file="inputfile_$((i+1)).list" # Name of sublist file | ||
sed -n "${start},${end}p" "$input_file" > "$PWD/input/$sublist_file" # Extract sublist | ||
done | ||
|
||
echo $num_sublists | ||
|
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,42 @@ | ||
#!/bin/bash | ||
|
||
# Set path to CMSSW | ||
source $HOME/setup_cmsenv.sh | ||
|
||
# Initial parameters to run | ||
EXEC_PATH=${HOME}/soft/jetAnalysis/processing | ||
cd $EXEC_PATH | ||
|
||
files_per_job=2 | ||
#input_file_list=$HOME/filelists/pythiaHydjet2018_miniAODforest.txt | ||
input_file_list=$HOME/filelists/test_list.txt | ||
|
||
echo -e "Splitting input file list: ${input_file_list}" | ||
n_sublists=$(./split_input_2_sublists.sh ${input_file_list} ${files_per_job}) | ||
echo -e "Input file list is splitted into ${n_sublists}" | ||
|
||
for ((jobId = 1; jobId <= $n_sublists; jobId++)); do | ||
cat <<EOF >condor/sub/job_jetAna_$jobId.sub | ||
universe = vanilla | ||
executable = run_jetAna.sh | ||
+JobFlavour = "longlunch" | ||
getenv = True | ||
requirements =((OpSysAndVer =?= "AlmaLinux9") && (CERNEnvironment =?= "qa")) | ||
RequestCpus = 1 | ||
transfer_input_files = voms_proxy.txt | ||
environment = "X509_USER_PROXY=voms_proxy.txt" | ||
arguments = input/inputfile_$jobId.list output/jetAna/oJetAna_$jobId.root | ||
output = condor/log/jetAna.${jobId}.out | ||
error = condor/log/jetAna.${jobId}.err | ||
log = condor/log/jetAna.${jobId}.log | ||
queue | ||
EOF | ||
|
||
condor_submit condor/sub/job_jetAna_$jobId.sub | ||
done | ||
|