-
Notifications
You must be signed in to change notification settings - Fork 3
5 ‐ Scripts description
We will present the scripts from functionalities point of view. All the scripts are in the directory https://github.com/hgc-tpg/HGCTPGValidation/tree/master/scripts
The script extractReleaseName.sh is called in the stage Set CMSSW environment variables
of the pipeline. It takes the target branch $CHANGE_TARGET
as argument and returns the CMSSW release version $REF_RELEASE
:
/HGCTPGValidation/scripts/extractReleaseName.sh $CHANGE_TARGET
The target branch name in hgc-tpg/cmssw.git always has the form *-CMSSW_*
The script performs three main tasks:
- splits the branch target name using the Internal Field Separator (IFS) (-),
- loops over all elements and split them using the IFS (_)
- if the element has “CMSSW” string then this element is the name release
CMSSW is based on SCRAM configuration management tool which is available for a given architecture. SCRAM_ARCH is the variable that should be set in order to use the right architecture for our CMSSW release.
After getting the name release, we use the following script to extract the $SCRAM_ARCH
for the most recent gcc version (if there are more than one arches)
/HGCTPGValidation/scripts/getScramArch.sh $REF_RELEASE
The main idea is to use scram list
command and grep
to select the lines corresponding to the CMSSW release version we want to use and get its SCRAM_ARCH.
The main steps are described bellow:
- scram list -c display the result in a simple lines
Every line has the form
CMSSW CMSSW_12_2_0 /cvmfs/cms.cern.ch/slc7_amd64_gcc10/cms/cmssw/CMSSW_12_2_0
-
grep -w shows the lines that match exactly to the release name # for ex. we'll see the lines only for CMSSW_12_2_0, not for the pre-releases
-
Write all lines into a text file
-
Loop over all the lines in the file
For more information, please check the introductory part of the script.
The script installCMSSW.sh is called in the stage Install
of the pipeline. The aim is to install a working directory for the reference and the test CMSSW code.
/HGCTPGValidation/scripts/installCMSSW.sh $SCRAM_ARCH $REF_RELEASE $REMOTE $CHANGE_TARGET $CHANGE_TARGET $LABEL
The script takes as arguments the $SCRAM_ARCH
, the release $REF_RELEASE
extracted from the reference branch, the remote name $REMOTE
, the change branch name $CHANGE_TARGET
, the target branch name $CHANGE_TARGET
and the label $LABEL
(ref or test).
The data are produced in the stage Produce
of the pipeline. It is done separately for the reference and the test branches (${LABEL_TEST}
) for a given configuration sets (${CONFIG_SUBSET}
) by running the script produceData_multiconfiguration.py
.
/HGCTPGValidation/scripts/produceData_multiconfiguration.py --subsetconfig ${CONFIG_SUBSET} --label ${LABEL_TEST}
The produce process has two parts:
- the HGCal TPG simulation run in the CMSSW working directory previously created,
and
- the validation that creates relevent histograms from the HGCal TPG simulation data.
The list of the histograms is given in the file HGCALTriggerPrimitivesHistos.txt.
displayHistos.py script is called in the last stage Display
of the pipeline. It takes several arguments relative to the reference and the test branches validation. The aim is to compare the histograms from both validations.
/HGCTPGValidation/scripts/displayHistos.py --subsetconfig ${CONFIG_SUBSET}
--refdir ${REF_RELEASE}_HGCalTPGValidation_${LABEL_REF}/src
--testdir ${REF_RELEASE}_HGCalTPGValidation_${LABEL_TEST}/src
--datadir ${DATA_DIR} --prnumber $CHANGE_ID
--prtitle "$CHANGE_TITLE (from $CHANGE_AUTHOR, $CHANGE_URL)"
The validation can be run in standalone mode. The relevent script is: standalone_hgctpg_validation.sh
More details about how to run it are given at the beginning of the script.