Skip to content

Commit

Permalink
added scripts to run workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
uttiyasarkar committed Apr 10, 2024
1 parent 5a6eb14 commit 5d42dec
Show file tree
Hide file tree
Showing 8 changed files with 222 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arguments.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Summer23
2023
parsl/condor
17650
48 changes: 48 additions & 0 deletions createremotedir.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
#####Based on Ming-Yan's createdir.py script#######
#!/bin/bash
DATE=$(date +%y_%m_%d)
echo "running on $DATE"
# Check if the arguments file exists
if [ ! -f "arguments.txt" ]; then
echo "Error: arguments.txt not found."
exit 1
fi

# Read arguments from the file
args=$(<arguments.txt)
# Split the arguments into an array
IFS=$'\n' read -d '' -r -a arg_array <<< "$args"

# Check if enough arguments are provided
if [ "${#arg_array[@]}" -lt 4 ]; then
echo "Error: Insufficient arguments provided in arguments.txt."
exit 1
fi

# Assign arguments to variables
campaign="${arg_array[0]}"

# Define workflows and campaigns
workflows=("ctag_Wc_sf" "ctag_DY_sf" "ttdilep_sf" "ttsemilep_sf")
campaigns=("Winter22" "Summer22" "Summer22EE" "Summer23" "Summer23BPix" "all")

# Check if campaign is provided and valid
if [[ -z "$campaign" ]]; then
echo "Campaign name is required."
exit 1
elif [[ ! " ${campaigns[@]} " =~ " ${campaign} " ]]; then
echo "Invalid campaign name."
exit 1
fi

# Create directories
for wf in "${workflows[@]}"; do
if [[ ! -d "dataMC/$DATE/$campaign/$wf" ]]; then
mkdir -p "dataMC/$DATE/$campaign/$wf"
xrdcp root://eosuser.cern.ch//eos/user/b/btvweb/www/Commissioning/index.php "dataMC/$DATE/$campaign/$wf/"
fi
done

# Sending the dir structure to BTV web
xrdcp -r -f dataMC/"$DATE"/ root://eosuser.cern.ch//eos/user/b/btvweb/www/Commissioning/dataMC/
34 changes: 34 additions & 0 deletions ctag_DY.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
DATE=$(date +%y_%m_%d)
echo "running on $DATE"
# Check if the arguments file exists
if [ ! -f "arguments.txt" ]; then
echo "Error: arguments.txt not found."
exit 1
fi

# Read arguments from the file
args=$(<arguments.txt)
# Split the arguments into an array
IFS=$'\n' read -d '' -r -a arg_array <<< "$args"

# Check if enough arguments are provided
if [ "${#arg_array[@]}" -lt 4 ]; then
echo "Error: Insufficient arguments provided in arguments.txt."
exit 1
fi

# Assign arguments to variables
arg1="${arg_array[0]}"
arg2="${arg_array[1]}"
arg3="${arg_array[2]}"
arg4="${arg_array[3]}"

# Main running scripts
python runner.py --json metadata/MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.json --workflow ctag_DY_sf --campaign $arg1 --year $arg2 --executor $arg3 --retries 1 -s 5 --limit 1 --max 1
python runner.py --json metadata/data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.json --workflow ctag_DY_sf --campaign $arg1 --year $arg2 --executor $arg3 --retries 1 -s 5 --limit 1 --max 1
python scripts/plotdataMC.py -i hists_ctag_DY_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ctag_DY_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea,hists_ctag_DY_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ctag_DY_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea --lumi $arg4 -p ctag_DY_sf --ext $arg1 -v all
mv hists_ctag_DY_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ctag_DY_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea plot/BTV/ctag_DY_sf_"$arg1"_"$DATE"/hists_ctag_DY_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea
mv hists_ctag_DY_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ctag_DY_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea plot/BTV/ctag_DY_sf_"$arg1"_"$DATE"/hists_ctag_DY_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea
mv plot/BTV/ctag_DY_sf_"$arg1"_"$DATE"/ BTV_Run3_"$arg2"_Comm_MinoAODv4_"$DATE"/"$arg1"/
xrdcp plot/BTV/ctag_DY_sf_"$arg1"_"$DATE"/* root://eosuser.cern.ch//eos/user/b/btvweb/www/Commissioning/dataMC/"$DATE"/"$arg1"/ctag_DY_sf/
33 changes: 33 additions & 0 deletions ctag_wc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash
DATE=$(date +%y_%m_%d)
echo "running on $DATE"
# Check if the arguments file exists
if [ ! -f "arguments.txt" ]; then
echo "Error: arguments.txt not found."
exit 1
fi

# Read arguments from the file
args=$(<arguments.txt)
# Split the arguments into an array
IFS=$'\n' read -d '' -r -a arg_array <<< "$args"

# Check if enough arguments are provided
if [ "${#arg_array[@]}" -lt 4 ]; then
echo "Error: Insufficient arguments provided in arguments.txt."
exit 1
fi

# Assign arguments to variables
arg1="${arg_array[0]}"
arg2="${arg_array[1]}"
arg3="${arg_array[2]}"
arg4="${arg_array[3]}"

# Main running scripts
python runner.py --json metadata/MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.json --workflow ctag_Wc_sf --campaign $arg1 --year $arg2 --executor $arg3 --retries 1 -s 5 --limit 1 --max 1
python runner.py --json metadata/data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.json --workflow ctag_Wc_sf --campaign $arg1 --year $arg2 --executor $arg3 --retries 1 -s 5 --limit 1 --max 1
python scripts/plotdataMC.py -i hists_ctag_Wc_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ctag_Wc_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea,hists_ctag_Wc_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ctag_Wc_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea --lumi $arg4 -p ctag_Wc_sf --ext $arg1 -v njet,mujet_eta,mujet_phi,mujet_pt,soft_l_pt,soft_l_eta,soft_l_phi,hl_pt,hl_eta,hl_phi,MET_pt,MET_phi,DeepCSV_trackSip3dSigAboveCharm,DeepCSV_trackSip3dValAboveCharm,DeepCSV_trackSip2dSigAboveCharm,DeepCSV_trackSip2dValAboveCharm,DeepJet_sv_d3dsig_0,DeepJet_sv_d3d_0,DeepJet_sv_ntracks_0,DeepJet_sv_mass_0,DeepJet_sv_normchi2_0,DeepJet_Cpfcan_BtagPf_trackSip2dSig_0,DeepJet_Cpfcan_BtagPf_trackSip2dVal_0,DeepJet_Cpfcan_BtagPf_trackSip3dSig_0,DeepJet_Cpfcan_BtagPf_trackSip3dVal_0,btagDeepFlavCvL_0,btagDeepFlavCvB_0,btagPNetCvL_0,btagPNetCvB_0,btagRobustParTAK4CvL_0,btagRobustParTAK4CvB_0,btagNegDeepFlavCvL_0,btagNegDeepFlavCvB_0,btagNegPNetCvL_0,btagNegPNetCvB_0,btagNegRobustParTAK4CvL_0,btagNegRobustParTAK4CvB_0
mv hists_ctag_Wc_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ctag_Wc_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea plot/BTV/ctag_Wc_sf_"$arg1"_"$DATE"/hists_ctag_Wc_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea
mv hists_ctag_Wc_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ctag_Wc_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea plot/BTV/ctag_Wc_sf_"$arg1"_"$DATE"/hists_ctag_Wc_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea
xrdcp plot/BTV/ctag_Wc_sf_"$arg1"_"$DATE"/* root://eosuser.cern.ch//eos/user/b/btvweb/www/Commissioning/dataMC/"$DATE"/"$arg1"/ctag_Wc_sf/
5 changes: 5 additions & 0 deletions master.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
./createremotedir.sh arguments.txt
./ctag_wc.sh arguments.txt
./ctag_DY.sh arguments.txt
./ttdilep.sh arguments.txt
./ttsemilep.sh arguments.txt
30 changes: 30 additions & 0 deletions src/BTVNanoCommissioning/helpers/xsection.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
"energy": "13.6",
"comment": "from TOP-22-012",
},

{
"process_name": "ZZ_TuneCP5_13p6TeV-pythia8",
"cross_section": "12.17",
Expand All @@ -254,6 +255,35 @@
"energy": "13.6",
"comment": "from TOP-22-012",
},
{
"process_name": "ZZ_TuneCP5_13p6TeV_pythia8",
"cross_section": "12.75",
"total_uncertainty": "0.0649",
"accuracy": "unknown",
"DAS": "/ZZ_TuneCP5_13p6TeV_pythia8/Run3Summer22EEMiniAODv3-124X_mcRun3_2022_realistic_postEE_v1-v3/MINIAODSIM",
"equivalent_lumi": "78.42",
"fraction_negative_weight": "0.0"
},
{
"id": "6420507829461764a903c1ec",
"process_name": "WW_TuneCP5_13p6TeV_pythia8",
"cross_section": "80.23",
"total_uncertainty": "0.3733",
"accuracy": "unknown",
"DAS": "/WW_TuneCP5_13p6TeV_pythia8/Run3Summer22EEMiniAODv3-124X_mcRun3_2022_realistic_postEE_v1-v3/MINIAODSIM",
"equivalent_lumi": "12.46",
"fraction_negative_weight": "0.0"
},
{
"id": "6420507a29461764a903c1ee",
"process_name": "WZ_TuneCP5_13p6TeV_pythia8",
"cross_section": "29.1",
"total_uncertainty": "0.1318",
"accuracy": "unknown",
"DAS": "/WZ_TuneCP5_13p6TeV_pythia8/Run3Summer22EEMiniAODv3-124X_mcRun3_2022_realistic_postEE_v1-v3/MINIAODSIM",
"equivalent_lumi": "34.36",
"fraction_negative_weight": "0.0"
},
{
"DAS": "/QCD_PT-1000to1400_TuneCP5_13p6TeV_pythia8/Run3Summer22MiniAODv3-124X_mcRun3_2022_realistic_v12-v2/MINIAODSIM",
"comments": "Automatically computed",
Expand Down
34 changes: 34 additions & 0 deletions ttdilep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
DATE=$(date +%y_%m_%d)
echo "running on $DATE"
# Check if the arguments file exists
if [ ! -f "arguments.txt" ]; then
echo "Error: arguments.txt not found."
exit 1
fi

# Read arguments from the file
args=$(<arguments.txt)
# Split the arguments into an array
IFS=$'\n' read -d '' -r -a arg_array <<< "$args"

# Check if enough arguments are provided
if [ "${#arg_array[@]}" -lt 4 ]; then
echo "Error: Insufficient arguments provided in arguments.txt."
exit 1
fi

# Assign arguments to variables
arg1="${arg_array[0]}"
arg2="${arg_array[1]}"
arg3="${arg_array[2]}"
arg4="${arg_array[3]}"

# Main running scripts
python runner.py --json metadata/MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.json --workflow ttdilep_sf --campaign $arg1 --year $arg2 --executor $arg3 --retries 1 -s 5 --limit 1 --max 1
python runner.py --json metadata/data_"$arg1"_"$arg2"_em_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.json --workflow ttdilep_sf --campaign $arg1 --year $arg2 --executor $arg3 --retries 1 -s 5 --limit 1 --max 1
python scripts/plotdataMC.py -i hists_ttdilep_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ttdilep_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea,hists_ttdilep_sf_data_"$arg1"_"$arg2"_em_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ttdilep_sf_data_"$arg1"_"$arg2"_em_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea --lumi $arg4 -p ttdilep_sf --ext $arg1 -v all
mv hists_ttdilep_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ttdilep_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea plot/BTV/ttdilep_sf_"$arg1"_"$DATE"/hists_ttdilep_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea
mv hists_ttdilep_sf_data_"$arg1"_"$arg2"_em_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ttdilep_sf_data_"$arg1"_"$arg2"_em_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea plot/BTV/ttdilep_sf_"$arg1"_"$DATE"/hists_ttdilep_sf_data_"$arg1"_"$arg2"_em_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea
mv plot/BTV/ttdilep_sf_"$arg1"_"$DATE"/ BTV_Run3_"$arg2"_Comm_MinoAODv4_"$DATE"/"$arg1"/
xrdcp plot/BTV/ttdilep_sf_"$arg1"_"$DATE"/* root://eosuser.cern.ch//eos/user/b/btvweb/www/Commissioning/dataMC/"$DATE"/"$arg1"/ttdilep_sf/
34 changes: 34 additions & 0 deletions ttsemilep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
DATE=$(date +%y_%m_%d)
echo "running on $DATE"
# Check if the arguments file exists
if [ ! -f "arguments.txt" ]; then
echo "Error: arguments.txt not found."
exit 1
fi

# Read arguments from the file
args=$(<arguments.txt)
# Split the arguments into an array
IFS=$'\n' read -d '' -r -a arg_array <<< "$args"

# Check if enough arguments are provided
if [ "${#arg_array[@]}" -lt 4 ]; then
echo "Error: Insufficient arguments provided in arguments.txt."
exit 1
fi

# Assign arguments to variables
arg1="${arg_array[0]}"
arg2="${arg_array[1]}"
arg3="${arg_array[2]}"
arg4="${arg_array[3]}"

# Main running scripts
python runner.py --json metadata/MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.json --workflow ttsemilep_sf --campaign $arg1 --year $arg2 --executor $arg3 --retries 1 -s 5 --limit 1 --max 1
python runner.py --json metadata/data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.json --workflow ttsemilep_sf --campaign $arg1 --year $arg2 --executor $arg3 --retries 1 -s 5 --limit 1 --max 1
python scripts/plotdataMC.py -i hists_ttsemilep_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ttsemilep_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea,hists_ttsemilep_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ttsemilep_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea --lumi $arg4 -p ttsemilep_sf --ext $arg1 -v njet,mujet_eta,mujet_phi,mujet_pt,soft_l_pt,soft_l_eta,soft_l_phi,hl_pt,hl_eta,hl_phi,MET_pt,MET_phi,DeepCSV_trackSip3dSigAboveCharm,DeepCSV_trackSip3dValAboveCharm,DeepCSV_trackSip2dSigAboveCharm,DeepCSV_trackSip2dValAboveCharm,DeepJet_sv_d3dsig_0,DeepJet_sv_d3d_0,DeepJet_sv_ntracks_0,DeepJet_sv_mass_0,DeepJet_sv_normchi2_0,DeepJet_Cpfcan_BtagPf_trackSip2dSig_0,DeepJet_Cpfcan_BtagPf_trackSip2dVal_0,DeepJet_Cpfcan_BtagPf_trackSip3dSig_0,DeepJet_Cpfcan_BtagPf_trackSip3dVal_0,btagDeepFlavCvL_0,btagDeepFlavCvB_0,btagPNetCvL_0,btagPNetCvB_0,btagRobustParTAK4CvL_0,btagRobustParTAK4CvB_0,btagNegDeepFlavCvL_0,btagNegDeepFlavCvB_0,btagNegPNetCvL_0,btagNegPNetCvB_0,btagNegRobustParTAK4CvL_0,btagNegRobustParTAK4CvB_0
mv hists_ttsemilep_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ttsemilep_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea plot/BTV/ttsemilep_sf_"$arg1"_"$DATE"/hists_ttsemilep_sf_MC_"$arg1"_"$arg2"_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea
mv hists_ttsemilep_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12/hists_ttsemilep_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea plot/BTV/ttsemilep_sf_"$arg1"_"$DATE"/hists_ttsemilep_sf_data_"$arg1"_"$arg2"_mu_BTV_Run3_"$arg2"_Comm_MINIAODv4_NanoV12.coffea
mv plot/BTV/ttsemilep_sf_"$arg1"_"$DATE"/ BTV_Run3_"$arg2"_Comm_MinoAODv4_"$DATE"/"$arg1"/
xrdcp plot/BTV/ttsemilep_sf_"$arg1"_"$DATE"/* root://eosuser.cern.ch//eos/user/b/btvweb/www/Commissioning/dataMC/"$DATE"/"$arg1"/ttsemilep_sf/

0 comments on commit 5d42dec

Please sign in to comment.