This repository contains tools for testing and validating CTPPS optics.
To set up the environment for running the optics test, you need to source the CMSSW release and set up the necessary environment variables. Here’s how you can do it:
source /cvmfs/cms.cern.ch/cmsset_default.sh
scram project CMSSW CMSSW_15_1_0_pre1
cd CMSSW_15_1_0_pre1
cmsenv
Get the code from the repository:
git clone https://github.com/CTPPS/ctpps-optics-test.git
cd ctpps-optics-testThe optics test can be run with data from three different sources:
- Directly from CondDB:
cmsRun optics_test.py opticssource="frontier://FrontierProd/CMS_CONDITIONS" opticstag="PPSOpticalFunctions_prompt_v9" runnumber=391514 xangle=150- From local SQLite file:
cmsRun optics_test.py opticssource="sqlite_file:/afs/cern.ch/user/w/wcarvalh/public/CTPPS/optical_functions/PPSOpticalFunctions_2025_v1.db" opticstag="PPSOpticalFunctions_test" runnumber=391514 xangle=150- From ROOT files (as defined in
ctppsOpticalFunctions_non_DB_cff.py):
cmsRun optics_test.py opticssource="nonDB" opticstag="PPSOpticalFunctions_test" xangle=150 runnumber=1Alternatively, you can use the provided shell script run_optics_test.sh.
The optics_test.py script accepts the following options:
-
opticstag: The optics tag to use (e.g., "PPSOpticalFunctions_test")- Default: "PPSOpticalFunctions_test"
-
opticssource: The source of optics data- Can be a CondDB: use "frontier://FrontierProd/CMS_CONDITIONS"
- Can be a local SQLite file: use "sqlite_file:/path/to/file.db"
- Can also be "nonDB" to read optics from ROOT files hardcoded in CMSSW
- Default: "nonDB"
-
runnumber: The run number to use- Default: 1
-
xangle: Crossing angle value in μrad- Default: 150.0
The script generates two types of output files:
- LHC Info:
lhcinfo_<run_number>_<xangle>.root - Optics data:
optics_<source>_<run_number>_<xangle>.root
Where <source> is either "DB" or "nonDB" depending on the optics data source used.