Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fea: Merge mu/ele workflows and several updates #96

Merged
merged 36 commits into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3fa956f
fix : remove bad files & add cross-sections
Ming-Yan Oct 12, 2023
7c5005d
feat: add features for plotting scripts
Ming-Yan Oct 17, 2023
1282411
Merge branch 'div' into btv_upstream
Ming-Yan Oct 17, 2023
dcb4254
fix: add only for standalone condor& plot code
Ming-Yan Oct 26, 2023
44435c9
[run array] ci: customize ci , fix bugs in workflow
Ming-Yan Oct 27, 2023
32f6ec8
Fix compatibility with Nanov12, changes to --only
mondalspandan Nov 6, 2023
a2c1d2e
[run array] ci: customize ci , fix bugs in workflow
Ming-Yan Oct 27, 2023
af51af0
Fixing Summer22/EE PU files
mondalspandan Nov 6, 2023
dc1a473
Merge branch 'master' into master
mondalspandan Nov 6, 2023
f3517a1
Fixing file handling
mondalspandan Nov 7, 2023
10ee3a0
Fixing file handling
mondalspandan Nov 7, 2023
3132d96
Switch back PU files
mondalspandan Nov 7, 2023
f420b68
Fix output dir
mondalspandan Nov 7, 2023
ca11c36
Fix xrdcp
mondalspandan Nov 7, 2023
b98aa19
Merge pull request #3 from mondalspandan/master
Ming-Yan Nov 7, 2023
c40d26a
fix: merge Spandan's dev ci:skip syst
Ming-Yan Nov 7, 2023
2e2d36c
Unify Wc mu, elec and ttbarsemi mu, elec workflows; new common arrayw…
mondalspandan Nov 14, 2023
bc667ba
Merge branch 'master' into master
mondalspandan Nov 14, 2023
e7d7e1b
Add back soft mu iso cut
mondalspandan Nov 14, 2023
ff69e01
Merge branch 'master' of github.com:mondalspandan/BTVNanoCommissioning
mondalspandan Nov 14, 2023
25cc257
Sync variable names
mondalspandan Nov 14, 2023
9e6e9cd
Merge branch 'master' into BTVbranch
mondalspandan Nov 14, 2023
8a05e0a
Compatibility with missing DeepCSV info in inputs
mondalspandan Nov 14, 2023
9c7e5b1
Lint
mondalspandan Nov 14, 2023
17370a9
Merge pull request #1 from mondalspandan/master
mondalspandan Nov 14, 2023
f794f3b
Lint
mondalspandan Nov 14, 2023
965df29
Merge DY mu and DY e workflows
mondalspandan Nov 16, 2023
8978fba
Lint
mondalspandan Nov 16, 2023
ae9ca15
Merge branch 'master' of github.com:cms-btv-pog/BTVNanoCommissioning
mondalspandan Nov 28, 2023
84ceba8
Update to latest 2022pre-EE recommendations; sync W+c selections
mondalspandan Nov 29, 2023
6381f3c
feat: add jr in Summer23 and minor fixes
Ming-Yan May 10, 2024
c4d2210
add jec
Ming-Yan May 11, 2024
25bee05
Merge branch 'master' into master
mondalspandan May 19, 2024
7276ffd
fix: fix black and correct MET[skip ci]
Ming-Yan Jul 18, 2024
87ce535
fix: Merge with new JEC/jet map features
mondalspandan May 20, 2024
1e7fc4b
fix: merge changes
Ming-Yan Jul 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,12 +494,15 @@ You can specify `-v all` to plot all the variables in the `coffea` file, or use

:new: non-uniform rebinning is possible, specify the bins with list of edges `--autorebin 50,80,81,82,83,100.5`

```bash
python scripts/plotdataMC.py -i a.coffea,b.coffea --lumi 41500 -p ttdilep_sf -v z_mass,z_pt
python scripts/plotdataMC.py -i "test*.coffea" --lumi 41500 -p ttdilep_sf -v z_mass,z_pt # with wildcard option need ""
```

<details><summary>more arguments</summary>
<p>

```
python plotdataMC.py -i a.coffea,b.coffea --lumi 41500 -p ttdilep_sf -v z_mass,z_pt
python plotdataMC.py -i "test*.coffea" --lumi 41500 -p ttdilep_sf -v z_mass,z_pt

options:
-h, --help show this help message and exit
Expand Down Expand Up @@ -537,13 +540,18 @@ options:
You can specify `-v all` to plot all the variables in the `coffea` file, or use wildcard options (e.g. `-v "*DeepJet*"` for the input variables containing `DeepJet`)
:exclamation_mark: If using wildcard for input, do not forget the quoatation marks! (see 2nd example below)

<details><summary>more arguments</summary>
<p>
```bash
# with merge map, compare ttbar with data
python scripts/comparison.py -i "*.coffea" --mergemap '{"ttbar": ["TTto2L2Nu_TuneCP5_13p6TeV_powheg-pythia8","TTto4Q_TuneCP5_13p6TeV_powheg-pythia8","TTtoLNu2Q_TuneCP5_13p6TeV_powheg-pythia8],"data":["MuonRun2022C-27Jun2023-v1","MuonRun2022D-27Jun2023-v1"]}' -r ttbar -c data -v mu_pt -p ttdilep_sf
# if no mergemap, take the key name directly
python scripts/comparison.py -i datac.coffea,datad.coffea -r MuonRun2022C-27Jun2023-v1 -c MuonRun2022D-27Jun2023-v1 -v mu_pt -p ttdilep_sf

```
python comparison.py -i a.coffea,b.coffea -p ttsemilep_sf -r SingleMuon_Run2017B-106X_PFNanov1 -c DYJetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8 -v DeepJet_Cpfcan_BtagPf_trackJetDistVal_0 --shortref Run2017B --shortcomp DYJets (--sepflav True/False)
python comparison.py -i "test*.coffea" -p ttsemilep_sf -r SingleMuon_Run2017B-106X_PFNanov1 -c DYJetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8 -v DeepJet_Cpfcan_BtagPf_trackJetDistVal_0 --shortref Run2017B --shortcomp DYJets (--sepflav True/False)

<details><summary>more arguments</summary>
<p>


options:
-h, --help show this help message and exit
-p {dilep_sf,ttsemilep_sf,ctag_Wc_sf,ctag_DY_sf,ctag_ttsemilep_sf,ctag_ttdilep_sf}, --phase {dilep_sf,ttsemilep_sf,ctag_Wc_sf,ctag_DY_sf,ctag_ttsemilep_sf,ctag_ttdilep_sf}
Expand All @@ -559,9 +567,8 @@ options:
variables to plot, splitted by ,. Wildcard option * available as well. Specifying `all` will run through all variables.
--ext EXT prefix name
--com COM sqrt(s) in TeV
--shortref SHORTREF short name for reference dataset for legend
--shortcomp SHORTCOMP
short names for compared datasets for legend, split by ','
--mergemap MERGEMAP
Group list of sample(keys in coffea) as reference/compare set as dictionary format. Keys would be the new lables of the group
--autorebin AUTOREBIN
Rebin the plotting variables, input `int` or `list`. int: merge N bins. list of number: rebin edges(non-uniform bin is possible)
--xlabel XLABEL rename the label for x-axis
Expand Down Expand Up @@ -654,4 +661,3 @@ Host *_f
jupyter notebook --ip=127.0.0.1 --port 8800 --no-browser
```
4. URL for notebook will be printed, copy and open in local browser

6 changes: 3 additions & 3 deletions condor/execute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi

# Get arguments
declare -A ARGS
for key in workflow output samplejson year campaign isCorr isSyst isJERC isArray noHist overwrite voms chunk retries outputXrootdDir remoteRepo; do
for key in workflow output samplejson year campaign isSyst isArray noHist overwrite voms chunk skipbadfiles outputXrootdDir remoteRepo; do
ARGS[$key]=$(jq -r ".$key" $WORKDIR/arguments.json)
done

Expand All @@ -58,11 +58,11 @@ pip install psutil
python -c "import json; json.dump(json.load(open('$WORKDIR/split_samples.json'))['$JOBID'], open('sample.json', 'w'), indent=4)"

# Unparse arguments and send to runner.py
OPTS="--wf ${ARGS[workflow]} --year ${ARGS[year]} --campaign ${ARGS[campaign]} --chunk ${ARGS[chunk]} --retries ${ARGS[retries]}"
OPTS="--wf ${ARGS[workflow]} --year ${ARGS[year]} --campaign ${ARGS[campaign]} --chunk ${ARGS[chunk]}"
if [ "${ARGS[voms]}" != "null" ]; then
OPTS="$OPTS --voms ${ARGS[voms]}"
fi
for key in isCorr isSyst isJERC isArray noHist overwrite; do
for key in isSyst isArray noHist overwrite skipbadfiles; do
if [ "${ARGS[$key]}" == true ]; then
OPTS="$OPTS --$key"
fi
Expand Down
12 changes: 1 addition & 11 deletions condor/submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,13 @@ def get_main_parser():
],
help="Dataset campaign, change the corresponding correction files",
)
parser.add_argument("--isCorr", action="store_true", help="Run with SFs")
parser.add_argument(
"--isSyst",
default=None,
type=str,
choices=[None, "all", "weight_only", "JERC_split"],
help="Run with systematics, all, weights_only(no JERC uncertainties included),JERC_split, None",
)
parser.add_argument(
"--isJERC", action="store_true", help="JER/JEC implemented to jet"
)
parser.add_argument("--isArray", action="store_true", help="Output root files")
parser.add_argument(
"--noHist", action="store_true", help="Not output coffea histogram"
Expand All @@ -114,13 +110,7 @@ def get_main_parser():
metavar="N",
help="Number of events per process chunk",
)
parser.add_argument(
"--retries",
type=int,
default=25,
metavar="N",
help="Number of retries for coffea processor",
)
parser.add_argument("--skipbadfiles", action="store_true", help="Skip bad files.")
parser = get_condor_submitter_parser(parser)
return parser

Expand Down
Loading
Loading