Skip to content

Commit

Permalink
cms-2013-collision-datasets-hi: initial implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tiborsimko committed Sep 15, 2023
1 parent b243e59 commit 5efa3a8
Show file tree
Hide file tree
Showing 50 changed files with 269,789 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ cms-2013-simulated-datasets-hi/inputs/das-json-store
cms-2013-simulated-datasets-hi/inputs/mcm-store
cms-2013-simulated-datasets-hi/inputs/config-store
cms-2013-simulated-datasets-hi/outputs/
cms-2013-collision-datasets-hi/inputs/config-store
cms-2013-collision-datasets-hi/inputs/das-json-config-store
cms-2013-collision-datasets-hi/inputs/das-json-store
cms-2013-collision-datasets-hi/outputs/*.json
cms-2015-collision-datasets/inputs/das-json-store
cms-2015-collision-datasets/inputs/das-json-config-store
cms-2015-collision-datasets/outputs/*.json
Expand Down
6 changes: 6 additions & 0 deletions cms-2013-collision-datasets-hi/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
================================
cms-2013-collision-datasets-hi
================================

This directory contains helper scripts used to prepare CMS 2013 HI collision
data release.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
#
# Note: to be run as cernapcms on lxplus8. Example:
#
# cernapcms@lxplus8> mkdir xxx
# cernapcms@lxplus8> cd xxx
# cernapcms@lxplus8> voms-proxy-init --voms cms
# cernapcms@lxplus8> ./create-das-json-config-store.sh
#
# The resulting `*.json` files are to be copied to ../inputs/das-json-config-store/
# directory on the working laptop.

# get dataset configuration info
mkdir -p ./inputs/das-json-config-store
while IFS= read -r dataset; do
dataset_result_file=$(echo $dataset | tr '/' '@')
okay=0
while [ $okay -lt 1 ]; do
echo "==> DAS config dataset=$dataset"
dasgoclient -query "config dataset=$dataset" -json > ./inputs/das-json-config-store/"${dataset_result_file}.json"
if [ $? -eq 0 ]; then
okay=1
fi
done
done < ./inputs/cms-2013-collision-datasets-hi.txt

# extract configuration file URLs
rm -f temp_urls
for file in $(ls -1 inputs/das-json-config-store/*.json); do
cat $file | jq -S '.[].config [] | .urls' | grep https >> temp_urls
done
sed -i -e 's,",,g' temp_urls
sed -i -e 's,configFile\,,configFile,g' temp_urls
cat temp_urls | sort -u > urls

# download configuration files
mkdir -p ./inputs/config-store
cat urls | awk -F/ '{print "curl -o ./inputs/config-store/"$6".configFile -k --key /tmp/x509up_u102955 --cert /tmp/x509up_u102955 " $0}' | bash
17 changes: 17 additions & 0 deletions cms-2013-collision-datasets-hi/code/create-das-json-store.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Note: to be run as cernapcms on lxplus8. Example:
#
# cernapcms@lxplus031> mkdir xxx
# cernapcms@lxplus031> cd xxx
# cernapcms@lxplus031> voms-proxy-init --voms cms
# cernapcms@lxplus031> ./create-das-json-store.sh
#
# The resulting `*.json` files are to be copied to ../inputs/das-json-store/
# directory on the working laptop.

mkdir -p ./inputs/das-json-store
while IFS= read -r dataset; do
dataset_result_file=$(echo $dataset | tr '/' '@')
dasgoclient -query "dataset=$dataset" -json > ./inputs/das-json-store/"${dataset_result_file}.json"
done < ./inputs/cms-2013-collision-datasets-hi.txt
Loading

0 comments on commit 5efa3a8

Please sign in to comment.