Standalone framework for fiducial differential cross section measurements using CJLST TTrees for Run 2 data.
A CMSSW working area with the latest version of combine is required:
# cmssw-el7 (maybe needed)
cmsrel CMSSW_10_2_13
cd CMSSW_10_2_13/src
cmsenv
git clone https://github.com/cms-analysis/HiggsAnalysis-CombinedLimit.git HiggsAnalysis/CombinedLimit
cd HiggsAnalysis/CombinedLimit
git fetch origin
git checkout v8.2.0
scramv1 b clean; scramv1 b
cd ../..
Once that is done, combine is properly installed. The fiducial framework should be properly set up:
git clone https://github.com/AlessandroTarabini/FiducialXSFWK.git
cd FiducialXSFWK
source ./env
The PhysicsModel(s) used in this analysis (cf. fit/createDatacard.py) can be found in the models folder and are copied automatically when source ./env.sh is called to $CMSSW_VERSION/src/HiggsAnalysis/CombinedLimit/python.
If when running fit/RunFiducialXS.py the fit crashes because the physics model is not found, you should check that the HZZ4L_Fiducial*.py files are present in your $CMSSW_VERSION/src/HiggsAnalysis/CombinedLimit/python folder.
For all the imports in the various scripts to work properly, set up the working environment with:
cmsenv
export PYTHONPATH="${PYTHONPATH}:<PATH_TO>/FiducialXSFWK/inputs"
export PYTHONPATH="${PYTHONPATH}:<PATH_TO>/FiducialXSFWK/helperstuff"
A schematic representation of the framework's workflow is given in the two following sketches:
The input files of the analysis workflow are the HZZ4L ntuples generated with the CJLST framework. This framework starts from those files and:
config: Starting from CJLST TTrees, only relevant branches are selected and stored byskim_MC_tree.Candskim_data_tree.Cmacros.
Having created these skimmed TTrees, the next steps of the analysis involve the caluclation of the different coefficients needed for the pdf parameterisations and unfolding, as well as the creation of background templates. To do so:
templates: Templates and normalization coefficients for the backgrounds' pdf are extracted from MC (ggZZ and qqZZ) and data (ZX) usingRunTemplates.pycoefficients: All the coefficients of the signal parameterization are calculated withRunCoefficients.pyand stored ininputsfolder.fit: The maximum likelihood fit is performed. This step relies on theRunFiducialXS.pyscript and it can be run either as part of the entire framework, creating the datacards and workspaces from scratch, or using pre-existing datacars as input. Datacards are produced and stored in adatacarddirectory, while fit results (combine.rootfiles) are stored incombine_filesfolder.
Additional scripts are provided to plot negative log-likelihood scans and to produce the usual differential xsec plots:
LHScans: Likelihood scans are plotted, best-fit values and the corresponding uncertainties are calculated usingplotLHScans_compare.py.producePlots.py: Plot of unfolded differential xsec distributions.
The frameworks picks up the variables to be used in a measurement and the binning to be used in the fit thanks to the dictionaries available in helperstuff.
More in detail, to define a new measurement (or to understand what is used in a current measurement):
- Define the variable name and the reco- and gen-level observables modifying the
observablesdictinhelperstuff/observables.py. The syntax is:observables = {NAME: {"obs_reco": TBranch name, "obs_gen": TBranch name}} - Define the binning in
helperstuff/binning.pyfollowing the conventions defined here for 2D measurements (for 1D measurements the binning definition is intuitive).
-
Skimming of the
TTrees: TODO. Usually provided centrally -
Creation of the templates: in
templatesrun (the framework detects automatically the binning and the observables to use):python RunTemplates.py --obsName NAME (str) --year YEAR (str) -
Computation of the coefficients: in
coefficientsrun (the framework detects automatically the binning and the observables to use):python RunCoefficients.py --obsName NAME (str) --year YEAR (str) -
Run the fits: in
fitrun:python RunFiducialXS.py --obsName NAME (str) --year YEAR (str) -
Plot the NLL scans: in
LHScans:python plot_LLScan.py --obsName NAME (str) --year YEAR (str)
The full analysis pipeline can be executed in batch mode using HTCondor with the provided submission script sub_pipeline_22_23.sub.
This submission script runs run_pipeline_22_23.py, which performs the complete workflow including template and coefficient generation, datacard creation, fitting, plotting, and optional upload to a web area. Input options such as observable name, binning, and year are specified in a separate input_args.txt file, avoiding hardcoded arguments in the scripts.
Before submitting jobs, source the environment setup script, source ./env.sh, to configure necessary environment variables
Submit the job to HTCondor using the following command:
condor_submit sub_pipeline.sub

