# HLT Dev Workflow
[TOC]
## Rate Measurement
### Getting the trigger menu
``` bash
set -x
#for slimed menu
hltGetConfiguration /users/athachay/HLT_11_3_0_bmmgDev_v0/V8 \
--setup /dev/CMSSW_11_3_0/GRun \
--globaltag 113X_dataRun3_HLT_v1 \
--input root://cms-xrd-global.cern.ch//eos/cms/store/data/Run2018A/HLTPhysics/RAW/v1/000/316/944/00000/E400BE7E-7E61-E811-BAA5-FA163E4E5866.root \
--data \
--process MYHLT \
--full \
--offline \
--type GRun\
> hltMenu.py
# --path HLTriggerFirstPath,HLTriggerFinalPath,HLT_MyTriggerPath_v1 \
```
----
### Adds the modification for the Menu and save it as hltMenuCustomized. py
```bash
athachay@lxplus780 Prod]$ edmConfigDump hltMenuCustomized.py > hlt_config.py
athachay@lxplus780 Prod]$ diff hltMenu.py hltMenuCustomized.py
20725a20726,20728
> from hltCustomizationForTriggerStudiesBMMG import *
> process=customizeForHLTdev_Bs2MMG(process)
>
20776,20789c20779,20792
< _customInfo = {}
< _customInfo['menuType' ]= "GRun"
< _customInfo['globalTags']= {}
< _customInfo['globalTags'][True ] = "auto:run3_hlt_GRun"
< _customInfo['globalTags'][False] = "auto:run3_mc_GRun"
< _customInfo['inputFiles']={}
< _customInfo['inputFiles'][True] = "file:RelVal_Raw_GRun_DATA.root"
< _customInfo['inputFiles'][False] = "file:RelVal_Raw_GRun_MC.root"
< _customInfo['maxEvents' ]= 100
< _customInfo['globalTag' ]= "113X_dataRun3_HLT_v1"
< _customInfo['inputFile' ]= ['root://cms-xrd-global.cern.ch//eos/cms/store/data/Run2018A/HLTPhysics/RAW/v1/000/316/944/00000/E400BE7E-7E61-E811-BAA5-FA163E4E5866.root']
< _customInfo['realData' ]= True
< from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
< process = customizeHLTforAll(process,"GRun",_customInfo)
---
> #_customInfo = {}
> #_customInfo['menuType' ]= "GRun"
> #_customInfo['globalTags']= {}
> #_customInfo['globalTags'][True ] = "auto:run3_hlt_GRun"
> #_customInfo['globalTags'][False] = "auto:run3_mc_GRun"
> #_customInfo['inputFiles']={}
> #_customInfo['inputFiles'][True] = "file:RelVal_Raw_GRun_DATA.root"
> #_customInfo['inputFiles'][False] = "file:RelVal_Raw_GRun_MC.root"
> #_customInfo['maxEvents' ]= 100
> #_customInfo['globalTag' ]= "113X_dataRun3_HLT_v1"
> #_customInfo['inputFile' ]= ['root://cms-xrd-global.cern.ch//eos/cms/store/data/Run2018A/HLTPhysics/RAW/v1/000/316/944/00000/E400BE7E-7E61-E811-BAA5-FA163E4E5866.root']
> #_customInfo['realData' ]= True
> #from HLTrigger.Configuration.customizeHLTforALL import customizeHLTforAll
> #process = customizeHLTforAll(process,"GRun",_customInfo)
20797a20801,20802
> from HLTrigger.Configuration.customizeHLTforCMSSW import customiseFor2018Input
> customiseFor2018Input(process)
```
----
### Running the condor job maker script
```bash
athachay@lxplus780 Prod]$ ./cmsCondorData.py run_steamflow_cfg.py /afs/cern.ch/work/a/athachay/private/bs2mumug/hltdev/CMSSW_11_3_0/src /afs/cern.ch/work/a/athachay/private/bs2mumug/hltdev/CMSSW_11_3_0/src/hltdev/SteamRatesEdmWorkflow/Prod/STEAMRootFiles/ -n 1 -q longlunch -p /afs/cern.ch/work/a/athachay/private/bs2mumug/hltdev/CMSSW_11_3_0/src/hltdev/SteamRatesEdmWorkflow/Prod/x509up_u134523
```
----
### For counting step
```py
'''
--------------------------OPTIONS TO BE FILLED OUT-----------------------------------------
'''
makeInputFilesList = False
#Directory where your input root files are located
inputFilesDir = '/afs/cern.ch/work/a/athachay/private/bs2mumug/hltdev/CMSSW_11_3_0/src/hltdev/SteamRatesEdmWorkflow/Prod/STEAMRootFiles'
#Were your input files produced by STEAM? If yes, file_type = "custom"
file_type = "custom"
#file_type = "RAW"
#file_type = "L1Accept"
#Directory where the top of your CMSSW release is located
cmsswDir = '/afs/cern.ch/work/a/athachay/private/bs2mumug/hltdev/CMSSW_11_3_0/src'
#Json file
json_file ="/afs/cern.ch/work/a/athachay/private/bs2mumug/hltdev/CMSSW_11_3_0/src/hltdev/SteamRatesEdmWorkflow/Rates/json_323775.txt"
#Do you wish to use the dataset/group/etc. maps? The maps are unnecessary if you're an HLT developer and you're just testing your new path rate.
#If you don't want to use any maps, set the variable below to "nomaps"
maps = "nomaps" #recommended if you're an HLT dev
#maps = "somemaps" #if you want dataset/group/etc. rates but no dataset merging study
#maps = "allmaps" #if you want to study dataset merging
#Do you wish to use any unusual (non-default) options for the job flavour, and the number of files processed per job?
#If you do, set the following boolean to True
isUnusual = True
#If you do, please also specify the following parameters:
#number of files processed per job
n = 1
#Job flavour
flavour = "espresso"
'''
--------------------------OPTIONS TO BE FILLED OUT-----------------------------------------
'''
```
---
### For merging step the file Rate/config_mergeOutputsData.py was modified as suggested
```py
'''
--------------------------OPTIONS TO BE FILLED OUT-----------------------------------------
'''
#Write the average instant lumi of the json you ran over
#Units: 1e34 /cm^2/s
lumi_in = 1.834
#Write the TARGET lumi for which you wish to calculate rates
#Units: 1e34 /cm^2/s
lumi_target = 1.834
#Write the HLT prescale used in the json you ran over
hlt_ps = 1100
#Maps option should be the same one you use to make the batch jobs
maps = "nomaps"
#maps = "somemaps"
#maps = "allmaps"
#Do you wish to draw the figures? If you have a slow connection, drawing might take a while
#This boolean will be set to False if you used the "nomaps" option
#makeFigures = False
makeFigures = True
#Do you wish to take input files from an unusual location (different from the default one)?
#If you do, set the following boolean to True
diffLoc = False
#If yes, please specify the directory where the job outputs are located
files_dir = "Results/Data/Raw"
'''
--------------------------OPTIONS TO BE FILLED OUT-----------------------------------------
'''
```