Skip to content

vukasinmilosevic/Fiducial_XS

 
 

Repository files navigation

FiducialXS README Page

Instructions to run the xBF team's framework for differential cross-section measurements for CMSSW_10_X releases.

Dependencies:

https://img.shields.io/static/v1?label=CMSSW%20version&message=10_2_X&color=brightgreen

https://img.shields.io/static/v1?label=Combine%20version&message=8_2_0&color=brightgreen

Framework/documentation:

https://readthedocs.org/projects/fiducialxs/badge/?version=latest

Detailed documentation regarding the framework can be found in the dedicated ReadTheDocs page. This README file and the official documentation are written in .rst (ReStructured Text Markup syntax) in order to better explore the options given by sphinx and ReadTheDocs. For more details about the Markup syntax, please consult the ReStructuredText Primer.

1. Setup the correct CMSSW and Combine releases

These are formed from from the official Combine framework instructions.

CC7 release CMSSW_10_2_X - recommended version Setting up the environment (once):

export SCRAM_ARCH=slc7_amd64_gcc700
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

Update to a recommended tag - currently the recommended tag is v8.2.0: see release notes:

cd $CMSSW_BASE/src/HiggsAnalysis/CombinedLimit
git fetch origin
git checkout v8.2.0
scramv1 b clean; scramv1 b # always make a clean build

Depending on where the data/mc is stored, one might need:

voms-proxy-init -voms cms

Final step is to clone the correct verison of the code. At the moment the working version can be found on the `CMSSW_10_X` branch, which can be cloned via the following command:

cd $CMSSW_BASE/src/
git clone -b CMSSW_10_X [email protected]:vukasinmilosevic/Fiducial_XS.git
cd Fiducial_XS
source setup.sh # mandatory to load necessary library
# or run following manually:
# export PYTHON27PATH=$PYTHON27PATH:python
# export PYTHON27PATH=$PYTHON27PATH:Inputs

2. Running the measurement

2.1 Using the RunEverything.py script:

Now, all steps can be run using script RunEverything.py. The available options are:

usage: RunEverything.py [-h] [-s {1,2,3,4,5}] [-c CHANNELS [CHANNELS ...]]
                      [-p NTUPLEDIR] [-m HIGGSMASS] [-r {0,1}]

Input arguments

optional arguments:
  -h, --help            show this help message and exit
  -s {1,2,3,4,5}        Which step to run
  -c CHANNELS [CHANNELS ...]
                        list of channels
  -p NTUPLEDIR          Path of ntuples
  -m HIGGSMASS          Higgs mass
  -r {0,1}              if 1 then it will run the commands else it will just
                        print the commands

Commands to run:

python RunEverything.py -r 1 -s 1 # step-1: Compute efficiencies
python RunEverything.py -r 1 -s 2 # step-2: collectInputs
python RunEverything.py -r 1 -s 3 # step-3: interpolation for powheg sample
python RunEverything.py -r 1 -s 4 # step-4: Run uncertainty step
python RunEverything.py -r 1 -s 5 # step-5: interpolation for the NNLOPS sample using powheg sample
python RunEverything.py -r 1 -s 6 # step-6: Run background template maker
python RunEverything.py -r 1 -s 7 # step-7: Final measurement and plotter

2.2 Detailed, step-by-step instructions

2.2.1 Running the efficiencies step

Current example running mass4l variable via nohup. For local testing remove nohup (and pipelining into a .log file if wanting terminal printout).

nohup python -u efficiencyFactors.py -l -q -b --obsName="mass4l" --obsBins="|105.0|140.0|" -c "4mu" >& effs_mass4l_4mu.log &
nohup python -u efficiencyFactors.py -l -q -b --obsName="mass4l" --obsBins="|105.0|140.0|" -c "4e" >& effs_mass4l_4e.log &
nohup python -u efficiencyFactors.py -l -q -b --obsName="mass4l" --obsBins="|105.0|140.0|" -c "2e2mu" >& effs_mass4l_2e2mu.log &
nohup python -u efficiencyFactors.py -l -q -b --obsName="mass4l" --obsBins="|105.0|140.0|" -c "4l" >& effs_mass4l_4l.log &

python collectInputs.py # currently only active for mass4l, calls be uncommented for the rest of variables

Running the plotter:

#skipping for mass4l
#python -u plot2dsigeffs.py -l -q -b --obsName="pT4l" --obsBins="|0|10|20|30|45|80|120|200|13000|"

2.2.2 Running the interpolation step

Run the interpolation step for powheg sample:

python python/interpolate_differential_full.py --obsName="mass4l" --obsBins="|105.0|140.0|" --year=2018 --debug 0

2.2.3. Running the uncertainties step

python -u getUnc_Unc.py --obsName="mass4l" --obsBins="|105.0|140.0|" >& unc_mass4l.log &

2.2.4 Running the interpolation step

Run the interpolation step for NNLOPS sample. For NNLOPS sample we don't have M124 and M126 MC samples. We assume that the the ratio for the acceptance for M125 and M125.38 is same for both NNLOPS and powheg. Then, we compute this ratio from powheg sample and get the values for NNLOPS sample.

NOTE: Run this step after the uncertainty step. As this will also update the pdf and QCD scale uncertainty for NNLOPS.

python python/interpolate_differential_full.py --obsName="mass4l" --obsBins="|105.0|140.0|" --year=2018 --debug 0

2.2.3 Running the background template maker

python -u runHZZFiducialXS.py --dir="/eos/home-v/vmilosev/Skim_2018_HZZ/WoW/" --obsName="mass4l" --obsBins="|105.0|140.0|" --redoTemplates --templatesOnly

2.2.4 Runing the final measurement and plotters

For the last step a data file is needed as input, even for the blinded step (!). I've stored the previous one in my public folder:

/afs/cern.ch/user/v/vmilosev/public/data_13TeV.root

or one can copy the data file from the data/mc folder and properly rename it. One additional set of models is needed in order to run the combine step. The HZZ4l specific modules stored here:

/afs/cern.ch/user/v/vmilosev/public/HZZ4l_models/

needs to be added to the corresponding $CMSSW_BASE/src/HiggsAnalysis/CombinedLimit/python collection of libraries.

The command to run the measurement and the plotters is:

nohup python -u runHZZFiducialXS.py --obsName="mass4l" --obsBins="|105.0|140.0|"  --calcSys --asimovMass 125.0  >& log_mass4l_Run2Fid.txt &

Things to fix

Specific

1. Hardcoded paths in LoadData.py 1. Currently, the framework will work if all samples exists in the same directory, including the Z+X files.

General

  1. Add the choices for argparser whereever its possible. So, that code won't run if we provide wrong arguments.

Hardcoded Informations

  1. obsList YAML file should follow the following format:

```YAML Observables:

1D_Observables:
mass4l:
2D_Observables:
mass4l:

```

In this YAML file the two names Observables, 1D_Observables and 2D_Observables should remain same, else the code will give error.

About

General framework for differential cross-section measurements for the H->4l signature (xBF group).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.5%
  • Other 0.5%