Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use updated poet repo configs #46

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
mkdir outputs
- name: Start CMS OD container
run: |
docker run -v $(pwd):/mnt/vol -v /cvmfs:/mountedcvmfs -w /home/cmsusr cmsopendata/cmssw_5_3_32-slc6_amd64_gcc472 /bin/bash /mnt/vol/workflow_test.sh PhysObjectExtractorTool 2011 PhysObjectExtractor/python/poet_cfg_mc_pat.py START53_LV6A1 katilp
docker run -v $(pwd):/mnt/vol -v /cvmfs:/mountedcvmfs -w /home/cmsusr cmsopendata/cmssw_5_3_32-slc6_amd64_gcc472 /bin/bash /mnt/vol/workflow_test.sh PhysObjectExtractorTool 2011 PhysObjectExtractor/python/poet_cfg.py FT_53_LV5_AN1 True
#cp -r /mnt/vol/products outputs
# upload output file
- name: Upload artifact
Expand Down
17 changes: 13 additions & 4 deletions find_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,33 @@
# docker run -it --name my_cvmfs --volume "/cvmfs/cms-opendata-conddb.cern.ch:/mountedcvmfs/cms-opendata-conddb.cern.ch" -P -p 5901:5901 cmsopendata/cmssw_5_3_32_vnc:latest /bin/bash
# Set up with prepare.sh

cd ~/CMSSW_5_3_32/src/
source /opt/cms/cmsset_default.sh
# cd ~/CMSSW_5_3_32/src/
# source /opt/cms/cmsset_default.sh

if [ -z "$1" ]; then package=TriggerInfoTool; else package=$1; fi
if [ -z "$2" ]; then branch=2011; else branch=$2; fi
if [ -z "$3" ]; then config=GeneralInfoAnalyzer/python/triggerinfoanalyzer_cfg.py; else config=$3; fi
if [ -z "$4" ]; then globaltag=FT_53_LV5_AN1; else globaltag=$4; fi
if [ -z "$5" ]; then isdata=False; else isdata=$5; fi

dbfile="$globaltag".db

cd $package
# fix this hack ... this is needed to find the cert file in data/ but if done in this way it does not make sense to pass the config as parameter...
if [ $package = PhysObjectExtractorTool ]
then
config=python/poet_cfg.py
cd PhysObjectExtractor
fi

exception=start
i=0
echo In $(pwd)
echo Going to run $config
echo Going to run $config with isData $isdata

while [ $exception != no ]
do
cmsRun $config > full.log 2>&1
cmsRun $config $isdata > full.log 2>&1

# find the exception from the cmsRun output
exceptionmessage="$(awk '/Exception Message:/{flag=1;next}/----- End Fatal Exception /{flag=0}flag' full.log)"
Expand Down
19 changes: 5 additions & 14 deletions workflow_test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# parameters: $1 package, $2 branch, $3 configuration file with path from package root
# $4 GlobalTag $ GitHub organization/owner
# $4 GlobalTag $5 isdata flag $6 GitHub organization/owner

sudo chown $USER /mnt/vol
#sudo mkdir /cvmfs
Expand All @@ -23,7 +23,8 @@ if [ -z "$1" ]; then package=TriggerInfoTool; else package=$1; fi
if [ -z "$2" ]; then branch=2011; else branch=$2; fi
if [ -z "$3" ]; then config=GeneralInfoAnalyzer/python/triggerinfoanalyzer_cfg.py; else config=$3; fi
if [ -z "$4" ]; then globaltag=FT_53_LV5_AN1; else globaltag=$4; fi
if [ -z "$5" ]; then gitdir=cms-opendata-analyses; else gitdir=$5; fi
if [ -z "$5" ]; then isdata=False; else isdata=$5; fi
if [ -z "$6" ]; then gitdir=cms-opendata-analyses; else gitdir=$6; fi

dbfile="$globaltag".db

Expand Down Expand Up @@ -57,25 +58,15 @@ cp /mnt/vol/dbline.py .
chmod +x dbline.py
#curl https://raw.githubusercontent.com/katilp/condition-data-test/main/find_db.sh > find_db.sh

#comment the label that is missing in 2011 data
if [ $branch = 2011 ]
then
sudo sed -i 's/softElectronByPtBJetTags/softPFElectronBJetTags/g' /cvmfs/cms.cern.ch/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_32/src/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py
# sudo sed -i '/softElectronByPtBJetTags/d' /cvmfs/cms.cern.ch/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_32/src/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py
sudo sed -i '/softElectronByIP3dBJetTags/d' /cvmfs/cms.cern.ch/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_32/src/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py
sudo sed -i '/softMuonByPtBJetTags/d' /cvmfs/cms.cern.ch/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_32/src/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py
sudo sed -i '/softMuonByIP3dBJetTags/d' /cvmfs/cms.cern.ch/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_32/src/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py
sudo sed -i 's/softMuonBJetTags/softPFMuonBJetTags/g' /cvmfs/cms.cern.ch/slc6_amd64_gcc472/cms/cmssw/CMSSW_5_3_32/src/PhysicsTools/PatAlgos/python/producersLayer1/jetProducer_cfi.py
fi

# FIXME: make this configurable, if cloning from the original repo's, take a local config with the needed modifications
if [ $package = TriggerInfoTool ] && [ $gitdir = cms-opendata-analyses ]; then cp /mnt/vol/trigger_2011_cfg.py $config; fi
if [ $package = PhysObjectExtractorTool ] && [ $gitdir = cms-legacydata-analyses ]; then config=/mnt/vol/jec_cfg.py; fi
# if [ $package = PhysObjectExtractorTool ] && [ $gitdir = cms-legacydata-analyses ]; then config=/mnt/vol/jec_cfg.py; fi

ls -l

# test run, add the second command to avoid exit on failure
# cmsRun $config || echo ignore
# cmsRun /mnt/vol/jec_cfg.py || echo ignore

./find_db.sh $package $branch $config $globaltag
./find_db.sh $package $branch $config $globaltag $isdata