Skip to content

Commit

Permalink
Merge branch 'devuttiya' of github.com:uttiyasarkar/BTVNanoCommission…
Browse files Browse the repository at this point in the history
…ing into devuttiya
  • Loading branch information
uttiyasarkar committed Dec 1, 2023
2 parents adc2852 + 97db788 commit 2f4257b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 65 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

# BTVNanoCommissioning
[![Linting](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/python_linting.yml/badge.svg)](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/python_linting.yml)
[![TTbar DL](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ttbar_DL_workflow.yml/badge.svg)](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ttbar_DL_workflow.yml)
[![TTbar SL](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ttbar_SL_workflow.yml/badge.svg)](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ttbar_SL_workflow.yml)
[![btag ttbar](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ttbar_workflow.yml/badge.svg)](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ttbar_workflow.yml)
[![ctag ttbar](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ctag_ttbar_workflow.yml/badge.svg)](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ctag_ttbar_workflow.yml)
[![ctag DY+jets Workflow](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ctag_DY_workflow.yml/badge.svg)](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ctag_DY_workflow.yml)
[![ctag W+c Workflow](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ctag_Wc_workflow.yml/badge.svg)](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/ctag_Wc_workflow.yml)
[![BTA Workflow](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/BTA_workflow.yml/badge.svg)](https://github.com/cms-btv-pog/BTVNanoCommissioning/actions/workflows/BTA_workflow.yml)
Expand Down
10 changes: 4 additions & 6 deletions metadata/test_bta_run3.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"JetMETRun2022D-27Jun2023-v2": [
"root://eoscms.cern.ch//eos/cms/store/group/cmst3/group/deepjet/PFNano_Run3_v12/data_2022CDE_rereco_JetMET/JetMET/Run2022D-27Jun2023-v2_BTV_Run3_2022_Comm_v2_NanoV12/230927_120318/0000/nano_data2022CDE_135.root"
],
"QCD_PT-120to170_MuEnrichedPt5_TuneCP5_13p6TeV_pythia8":[
"root://eoscms.cern.ch//store/group/phys_btag/PFNano_Run3/mc_summer22EE/QCD_PT-120to170_MuEnrichedPt5_TuneCP5_13p6TeV_pythia8/Run3Summer22EEMiniAODv3-124X_mcRun3_2022_realistic_postEE_v1-v1_BTV_Run3_2022_Comm_v2_NanoV12/231001_184438/0000/nano_mcRun3_EE_1-1.root"
]
"JetMETRun2022D-22Sep2023-v1": [
"root://eoscms.cern.ch//eos/cms/store/group/cmst3/group/deepjet//PFNano_Run3/data_2022_MINIAODv4/JetMET/Run2022D-22Sep2023-v1_BTV_Run3_2022_Comm_MINIAODv4/231125_161517/0000/data_defaultAK4_1.root"],
"QCD_PT-15to20_MuEnrichedPt5_TuneCP5_13p6TeV_pythia8": [
"root://grid-cms-xrootd.physik.rwth-aachen.de:1094//store/user/milee/PFNano_Run3/mc_summer22_MINIAODv4/QCD_PT-15to20_MuEnrichedPt5_TuneCP5_13p6TeV_pythia8/Run3Summer22MiniAODv4-130X_mcRun3_2022_realistic_v5-v2_BTV_Run3_2022_Comm_MINIAODv4/231124_225033/0000/MC_defaultAK4_preEE_20.root"]
}
Binary file not shown.
Binary file not shown.
50 changes: 2 additions & 48 deletions src/BTVNanoCommissioning/helpers/update_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ def missing_branch(events):
events.Jet,
{"btagDeepFlavC": jets.btagDeepFlavC},
)
if hasattr(events.Jet, "btagDeepCvL") and not hasattr(events.Jet, "btagDeepC"):
jets["btagDeepC"] = (
events.Jet.btagDeepCvL / (1.0 - events.Jet.btagDeepCvL)
) * events.Jet.btagDeepB
events.Jet = update(
events.Jet,
{"btagDeepC": jets.btagDeepC},
)

if hasattr(events.Jet, "btagDeepFlavC") and not hasattr(
events.Jet, "btagDeepFlavCvL"
):
Expand Down Expand Up @@ -83,46 +76,7 @@ def missing_branch(events):
"btagDeepFlavCvB": jets.btagDeepFlavCvB,
},
)
if not hasattr(events.Jet, "btagDeepB"):
jets = events.Jet
jets["btagDeepB"] = events.Jet.btagDeepB_b + events.Jet.btagDeepB_bb
events.Jet = update(
events.Jet,
{"btagDeepB": jets.btagDeepB},
)
if hasattr(events.Jet, "btagDeepC") and not hasattr(events.Jet, "btagDeepCvL"):
jets["btagDeepCvL"] = np.maximum(
np.minimum(
np.where(
(events.Jet.btagDeepC > 0) & (events.Jet.pt > 15),
(events.Jet.btagDeepC / (1.0 - events.Jet.btagDeepB)),
-1,
),
0.999999,
),
-1,
)
jets["btagDeepCvB"] = np.maximum(
np.minimum(
np.where(
(events.Jet.btagDeepC > 0) & (events.Jet.pt > 15),
(
events.Jet.btagDeepC
/ (events.Jet.btagDeepC + events.Jet.btagDeepB)
),
-1,
),
0.999999,
),
-1,
)
events.Jet = update(
events.Jet,
{
"btagDeepCvL": jets.btagDeepCvL,
"btagDeepCvB": jets.btagDeepCvB,
},
)

if hasattr(events, "METFixEE2017"):
events.MET = events.METFixEE2017
if not hasattr(events.PuppiMET, "MetUnclustEnUpDeltaX"):
Expand Down
6 changes: 3 additions & 3 deletions src/BTVNanoCommissioning/utils/AK4_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
},
"Summer22Run3": {
"lumiMask": "Cert_Collisions2022_355100_362760_Golden.json",
"PU": "puweight_Winter22Run3-69p2mb.histo.root", # use same 80.0mb for Summer22
"JME": "winter_jec_compiled.pkl.gz", # not this is from Winter22Run3 since this is not yet finished
"PU": "puwei_2022_preEE.histo.root", # new PU files, based on preEE
"JME": "jec_compiled.pkl.gz", # update to latest JEC
"LSF": {
"mu_json": "ScaleFactors_Muon_trackerMuons_Z_2022_Prompt_ID_ISO_schemaV2.json",
"mu_ID": "NUM_TightID_DEN_TrackerMuons",
Expand All @@ -56,7 +56,7 @@
},
"Summer22EERun3": {
"lumiMask": "Cert_Collisions2022_355100_362760_Golden.json",
"PU": "puweight_Summer22EERun3-80p0mb.histo.root", # 69.2mb
"PU": "puwei_2022_postEE.histo.root", # new PU file, post EE
"JME": "jec_compiled.pkl.gz",
"LSF": {
"ele_json": "electron.json.gz",
Expand Down
6 changes: 0 additions & 6 deletions src/BTVNanoCommissioning/utils/histogrammer.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,6 @@ def histogrammer(events, workflow):
)
### discriminators
disc_list = [
"btagDeepB",
"btagDeepC",
"btagDeepB_b",
"btagDeepB_bb",
"btagDeepCvL",
"btagDeepCvB",
"btagDeepFlavB",
"btagDeepFlavC",
"btagTransDeepFlavB",
Expand Down

0 comments on commit 2f4257b

Please sign in to comment.