First step is to generate ntuples.
- Follow instructions from https://github.com/tiwariPC/DMAnaRun2/tree/onlyAK4_80X_puppi_deepCSV (onlyAK4_80X_puppi_deepCSV branch) to setup DelPanj within CMSSW.
- Use MultiCrab to submit jobs for signal, backgrounds, and data separately. (Detailed instructions to be updated soon).
Clone this repository in a location from where HTCondor jobs can be submitted (login.uscms.org
for example). We shall refer to this location as the working directory for this section.
SkimTree can be run using:
python SkimTree.py path_to_ntuple_file
python SkimTree.py root://se01.indiacms.res.in:1094//dpm/indiacms.res.in/home/cms/store/user/zabai/t3store2/bbDM_bkg/WJetsToLNu_HT-100To200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/WJetsToLNu_HT-100To200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_MC25ns_LegacyMC_20170328/180202_114154/0001/NCUGlobalTuples_1009.root
SkimTree jobs are numerous is number, hence using a Condor network with large number of cores is recommended. Recommended submit node: uscms.
The T2ListMaker can be used to produce lists of ntuples (CRAB job outputs) that SkimTree takes as input. Since the CRAB job outputs are stored in T2, the ListMaker can be used from a T3 location which has read access to the T2 location (via rfdir
).
- Copy the T2ListMaker directory from your working directory to the T3 location (if different from your working directory), or run the following from a T3 location:
wget https://raw.githubusercontent.com/mondalspandan/bbMET/master/T2FileListMaker/ListMaker_T3.py
- Find the parent directory in T2 where the ntuples are stored.
Example:
can be used to view contents of the directory. Navigate to the parent directory where the ntuples are stored.
rfdir /dpm/indiacms.res.in/home/cms/store/user/username/t3store2
- Run
ListMaker_T3.py
usingExample:python ListMaker_T3.py crab path_to_parent_T2_directory_of_ntuples filelist_tag
python ListMaker_T3.py crab /dpm/indiacms.res.in/home/cms/store/user/spmondal/t3store2/bbDM_data 180321_data_ntuples
This produces one directory and one log file. In the example above, the directory and logfile will be named Filelist_180321_data_ntuples
and log_180321_data_ntuples.txt
respectively. The filelists are now available in your T3 location. Both the directory and the log files now have to be copied back to the working directory.
4. Repeat the above for each of signal, data and bkg. So in the end you will probably have 3 or more different directories (and corresponding log files).
5. Navigate to bbMET/bbMET/ST_Condor/
in the working directory.
6. mkdir Filelists
7. Now copy all directories and log files (such as Filelist_180321_data_ntuples
and log_180321_data_ntuples.txt
) to workingdir/bbMET/bbMET/ST_Condor/Filelists
using cp
(or scp
if the working directory is not in T3).
- Navigate to workingdir/
bbMET/bbMET/ST_Condor/
. - Open
runAnalysis.sh
to edit. - Line 19 contains an exemplar path to a T2 location. The SkimTree outputs (Skimmed Trees) will be stored in this location. Edit this path (remember to change the username) and specify where you wish to store the outputs. The directory does not necessarily have to exist, it will be created if non-existent. Make sure you have write access to the specified directory.
- Initiate your voms-proxy using
voms-proxy-init --voms cms --valid 192:00
. - Submit jobs using
. submitjobs.sh
- To monitor the job submission process, use:
tail -f logsubmit.txt
- To monitor status of jobs, use
condor_q username
.
The SkimTree outputs (Skimmed Trees) are saved to the location that was specified in the runAnalysis.sh
file. These will be used while running BranchReader (next section).
(SkimTree jobs for all data and background may take upto 1 day to finish.)
Clone this repository in a location from where HTCondor jobs can be submitted (ui.indiacms.res.in
for example). We shall refer to this location as the working directory for this section.
- BranchReader can be run using:
python bbMETBranchReader.py -a -i path_to_skimmed_tree -D . --csv
- The "farmout" mode can be used to combine multiple input root files in one go. If all the root files are listed in a text file named input.txt, one can use:
python bbMETBranchReader.py -a -F -i input.txt -D . --csv
The number of BranchReader jobs can be adjusted by combining suitable number of input files in the Farmout mode. Recommended submit node: ui.indiacms.
The T2ListMaker can be used to produce lists of skimmed trees (SkimTree outputs) that SkimTree takes as input. Since the skimmed trees are also stored in T2, the ListMaker can be used from a T3 location which has read access to the T2 location (via rfdir
). For Farmout mode of the BranchReader, it is necessary to use the "nolog" variant of the ListMaker.
- Copy the T2ListMaker directory from your working directory to the T3 location (if different from your working directory), or run the following from a T3 location:
wget https://raw.githubusercontent.com/mondalspandan/bbMET/master/T2FileListMaker/ListMaker_T3_nolog.py
- Find the parent directory in T2 where the skimmed trees are stored.
Example:
can be used to view contents of the directory. Navigate to the parent directory where the skimmed trees are stored.
rfdir /dpm/indiacms.res.in/home/cms/store/user/username/t3store2
- Run
ListMaker_T3_nolog.py
usingExample:python ListMaker_T3_nolog.py st path_to_parent_T2_directory_of_skimmed_trees filelist_tag
python ListMaker_T3_nolog.py st /dpm/indiacms.res.in/home/cms/store/user/spmondal/t3store2/bbDM_skimmed_trees 180322_skimmed_trees
This produces one directory. In the example above, the directory will be named Filelist_180322_skimmed_trees
, The filelists are now available in your T3 location. Both the contents of the directory now have to be copied back to the working directory.
4. Repeat the above for each of signal, data and bkg. So in the end you will probably have 3 or more different directories).
5. Navigate to bbMET/bbMET/BR_Condor_Farmout/
in the working directory.
6. mkdir Filelists
7. Now copy files inside all the directories (such as Filelist_180322_skimmed_trees/*.txt) to workingdir/
bbMET/bbMET/BR_Condor_Farmout/Filelistsusing
cp(or
scp` if the working directory is not in T3). This means there will be .txt files inside the Filelists folder, unlike in case of SkimTree jobs.
- Navigate to workingdir/
bbMET/bbMET/BR_Condor_Farmout/
. - This framework automatically combines multiple skimmed_tree root files in one job. The number of root files to be combined in each job can be specified by editing L4 of MultiSubmit.py (
maxfilesperjob=100
). - Initiate your voms-proxy using
voms-proxy-init --voms cms --valid 192:00
. - Submit jobs using
. submitjobs.sh
- To monitor the job submission process, use:
tail -f logsubmit.txt
- To monitor status of jobs, use
condor_q username
.
- Once all BranchReader Condor jobs are complete, one needs to combine the output .root files for each sample. This can be achieved by using the
hadd
command. If no CMSSW or ROOT instance is sourced by default in your working area, go to a CMSSW release base and runcmsenv
, otherwise thehadd
command may not work. - Navigate to
bbMET/bbMET/BR_Condor_Farmout/
and runThe outputs .root files are stitched on a per sample basis and one .root file per sample is produced insidepython HADD_multi_Farmout.py
bbMET/bbMET/BR_Condor_Farmout/hadd_outputs
. - These .root files inside
hadd_outputs
can be used directly as inputs to the plotting code.
- Copy all the outputs from BranchReader to a directory (or, optionally, segregate the files in separate directories named
data
,bkg
, andsignal
). - Open
bbMETplot/Scripts/bbMET_StackFactory.py
and edit L92 to suit the current working directory. Edit L160, L229, and L272 to the path(s) where the BranchReader outputs are stored. - Navigate to
bbMETplot/Scripts/test
and run
python ../bbMET_StackFactory.py -d MET -s -m -q
python ../bbMET_StackFactory.py -d SE -e
python ../bbMET_StackFactory.py -d SP -p
The boolean flags are explained as follows:
- s: Signal Regions (only MC plots)
- m: Muon Control Regions
- q: QCD Control Regions
- e: Electron Control Regions
- p: Photon Control Regions
- The
d
flag is used to select the appropriate primary dataset for each region.
The output plots are stored inside test/date/bbMETPng directory.
The idea is to make a combined .root file containing MET and Hadronic Recoil histograms of all regions with all systematics with suitable names.
- Open bbMETplot/Scripts/CombinedRootMaker.py and edit L36 if histograms for systematics are contained in a separate directory. Otherwise point this to read the same directory as next step.
- Run:
python CombinedRootMaker.py path_to_the_plot_script_output_dir
Example:
python CombinedRootMaker.py test/22022018
This creates a directory named DataCardRootFiles. The file AllMETHistos.root
inside this directory contains all histograms from all regions with all systematics. Besides this, a .root file for each region is also created. Depending on the signal model either the AllMETHistos.root
file or all the other files need to be used as input to the limit setting code.
- Copy all files from bbMETplot/Scripts/DataCardRootFiles directory to LimitsAndFitting/bbDM/data directory.
- Run:
This will create .txt files inside the bin/ directory. Navigate to the
python RunLimitOnAll.py create python RunLimitOnAll.py run
plotting
directory. - To make DMSimp plots:
python TextToTGraph.py python plotLimit.py ps python plotLimit.py s
- To make 2HDM+a plots with variable MH4:
python TextToTGraph_2HDMa.py plotLimit.py 2h
- To make 2HDM+a plots with fixed MH4 (50 or 100 GeV) but variable tanβ or variable sinθ:
python TextToTGraph_fixedMH4.py python plotLimit.py tanb50 python plotLimit.py tanb100 python plotLimit.py sinp50
- To plot overlapping cross section and limit plots for various tanβ and sinθ scans:
cd variableTanB python TextToGraph_tanB_allMH4.py python plotLimit_overlap.py tanb python plotLimit_overlap.py sinp