Skip to content

Commit 0f85497

Browse files
authored
change CR variable to be m4l (#128)
* change CR variable to be m4l * stupid typo * fix WVZReport CR histogram name
1 parent 02d350b commit 0f85497

File tree

9 files changed

+566
-304
lines changed

9 files changed

+566
-304
lines changed

LocalPreferences.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
precompile_workload = false
33

44
[WVZAnalysis]
5-
BDT_MODEL_DIR = "/data/jiling/WVZ/v2.4.1-2023_07_03_hists/"
5+
BDT_MODEL_DIR = "/data/jiling/WVZ/v2.4.1-2023_08_07/"
66
MINITREE_DIR = "/data/grabanal/WVZ/v2.4.1/"

Manifest.toml

Lines changed: 532 additions & 265 deletions
Large diffs are not rendered by default.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ XGBoost = "009559a3-9522-5dbb-924b-0b6ed2b22bb9"
3333
ClusterManagers = "0.4"
3434
FHist = "0.10"
3535
Measurements = "2"
36-
UnROOT = "^0.10.12"
36+
UnROOT = "^0.10.17"
3737

3838
[extras]
3939
CUDA_Runtime_jll = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"

WVZReportExt/src/WVZReportExt.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ function significance_matrix(Ms)
7878
res = mapreduce(vcat, Ms) do M
7979
N = nbins(M[:DF__BDT__NOMINAL])
8080
hists = rebin.([M[:SFinZ__BDT__NOMINAL], M[:SFnoZ__BDT__NOMINAL], M[:DF__BDT__NOMINAL]], N)
81-
N = nbins(M[:ZZCR__Njet__NOMINAL])
82-
push!(hists, rebin(M[:ZZCR__Njet__NOMINAL], N))
83-
N = nbins(M[:ttZCR__Njet__NOMINAL])
84-
push!(hists, rebin(M[:ttZCR__Njet__NOMINAL], N))
81+
N = nbins(M[:ZZCR__m4l__NOMINAL])
82+
push!(hists, rebin(M[:ZZCR__m4l__NOMINAL], N))
83+
N = nbins(M[:ttZCR__m4l__NOMINAL])
84+
push!(hists, rebin(M[:ttZCR__m4l__NOMINAL], N))
8585

8686
permutedims(hists)
8787
end

config/file_list.json

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -357,18 +357,6 @@
357357
"mc16_13TeV.342285.Pythia8EvtGen_A14NNPDF23LO_ZH125_inc.deriv.DAOD_STDM3.e4246_s3126_r9364_p4434"
358358
],
359359
"Others": [
360-
"mc16_13TeV.364254.Sherpa_222_NNPDF30NNLO_llvv.deriv.DAOD_STDM3.e5916_s3126_r9364_p4434",
361-
"mc16_13TeV.364254.Sherpa_222_NNPDF30NNLO_llvv.deriv.DAOD_STDM3.e5916_s3126_r10201_p4434",
362-
"mc16_13TeV.364254.Sherpa_222_NNPDF30NNLO_llvv.deriv.DAOD_STDM3.e5916_s3126_r10724_p4434",
363-
"mc16_13TeV.364290.Sherpa_222_NNPDF30NNLO_llvv_lowMllPtComplement.deriv.DAOD_STDM3.e6096_s3126_r9364_p4434",
364-
"mc16_13TeV.364290.Sherpa_222_NNPDF30NNLO_llvv_lowMllPtComplement.deriv.DAOD_STDM3.e6096_s3126_r10724_p4434",
365-
"mc16_13TeV.364290.Sherpa_222_NNPDF30NNLO_llvv_lowMllPtComplement.deriv.DAOD_STDM3.e6096_s3126_r10201_p4434 ",
366-
"mc16_13TeV.364285.Sherpa_222_NNPDF30NNLO_llvvjj_EW6.deriv.DAOD_STDM3.e6055_s3126_r10201_p4434",
367-
"mc16_13TeV.364285.Sherpa_222_NNPDF30NNLO_llvvjj_EW6.deriv.DAOD_STDM3.e6055_s3126_r9364_p4434",
368-
"mc16_13TeV.364285.Sherpa_222_NNPDF30NNLO_llvvjj_EW6.deriv.DAOD_STDM3.e6055_s3126_r10724_p4434",
369-
"mc16_13TeV.364287.Sherpa_222_NNPDF30NNLO_llvvjj_ss_EW6.deriv.DAOD_STDM3.e6055_s3126_r9364_p4434",
370-
"mc16_13TeV.364287.Sherpa_222_NNPDF30NNLO_llvvjj_ss_EW6.deriv.DAOD_STDM3.e6055_s3126_r10201_p4434",
371-
"mc16_13TeV.364287.Sherpa_222_NNPDF30NNLO_llvvjj_ss_EW6.deriv.DAOD_STDM3.e6055_s3126_r10724_p4434",
372360
"mc16_13TeV.346343.PhPy8EG_A14NNPDF23_NNPDF30ME_ttH125_allhad.deriv.DAOD_STDM3.e7148_s3126_r9364_p4434",
373361
"mc16_13TeV.346343.PhPy8EG_A14NNPDF23_NNPDF30ME_ttH125_allhad.deriv.DAOD_STDM3.e7148_s3126_r10201_p4434",
374362
"mc16_13TeV.346343.PhPy8EG_A14NNPDF23_NNPDF30ME_ttH125_allhad.deriv.DAOD_STDM3.e7148_s3126_r10724_p4434",
@@ -378,9 +366,6 @@
378366
"mc16_13TeV.346345.PhPy8EG_A14NNPDF23_NNPDF30ME_ttH125_dilep.deriv.DAOD_STDM3.e7148_s3126_r10724_p4434",
379367
"mc16_13TeV.346345.PhPy8EG_A14NNPDF23_NNPDF30ME_ttH125_dilep.deriv.DAOD_STDM3.e7148_s3126_r9364_p4434",
380368
"mc16_13TeV.346345.PhPy8EG_A14NNPDF23_NNPDF30ME_ttH125_dilep.deriv.DAOD_STDM3.e7148_s3126_r10201_p4434",
381-
"mc16_13TeV.410155.aMcAtNloPythia8EvtGen_MEN30NLO_A14N23LO_ttW.deriv.DAOD_STDM3.e5070_s3126_r9364_p4434",
382-
"mc16_13TeV.410155.aMcAtNloPythia8EvtGen_MEN30NLO_A14N23LO_ttW.deriv.DAOD_STDM3.e5070_s3126_r10201_p4434",
383-
"mc16_13TeV.410155.aMcAtNloPythia8EvtGen_MEN30NLO_A14N23LO_ttW.deriv.DAOD_STDM3.e5070_s3126_r10724_p4434",
384369
"mc16_13TeV.410389.MadGraphPythia8EvtGen_A14NNPDF23_ttgamma_nonallhadronic.deriv.DAOD_STDM3.e6155_s3126_r9364_p4434",
385370
"mc16_13TeV.410389.MadGraphPythia8EvtGen_A14NNPDF23_ttgamma_nonallhadronic.deriv.DAOD_STDM3.e6155_s3126_r10724_p4434",
386371
"mc16_13TeV.410389.MadGraphPythia8EvtGen_A14NNPDF23_ttgamma_nonallhadronic.deriv.DAOD_STDM3.e6155_s3126_r10201_p4434",
@@ -407,10 +392,7 @@
407392
"mc16_13TeV.410658.PhPy8EG_A14_tchan_BW50_lept_top.deriv.DAOD_STDM3.e6671_s3126_r10724_p4434",
408393
"mc16_13TeV.410659.PhPy8EG_A14_tchan_BW50_lept_antitop.deriv.DAOD_STDM3.e6671_s3126_r9364_p4434",
409394
"mc16_13TeV.410659.PhPy8EG_A14_tchan_BW50_lept_antitop.deriv.DAOD_STDM3.e6671_s3126_r10201_p4434",
410-
"mc16_13TeV.410659.PhPy8EG_A14_tchan_BW50_lept_antitop.deriv.DAOD_STDM3.e6671_s3126_r10724_p4434",
411-
"mc16_13TeV:mc16_13TeV.364242.Sherpa_222_NNPDF30NNLO_WWW_3l3v_EW6.deriv.DAOD_STDM3.e5887_s3126_r9364_p4434",
412-
"mc16_13TeV.364242.Sherpa_222_NNPDF30NNLO_WWW_3l3v_EW6.deriv.DAOD_STDM3.e5887_s3126_r10201_p4434",
413-
"mc16_13TeV.364242.Sherpa_222_NNPDF30NNLO_WWW_3l3v_EW6.deriv.DAOD_STDM3.e5887_s3126_r10724_p4434"
395+
"mc16_13TeV.410659.PhPy8EG_A14_tchan_BW50_lept_antitop.deriv.DAOD_STDM3.e6671_s3126_r10724_p4434"
414396
],
415397
"githubtest":[
416398
"mc16_13TeV.342284.Pythia8EvtGen_A14NNPDF23LO_WH125_inc.deriv.DAOD_STDM3.e4246_s3126_r9364_p4434"

docs/src/walkthrough.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Finally, instantiate the exact Julia versions we used for this analysis:
3434
```bash
3535
# this is generally the command we need to use to start a Julia REPL
3636
# `.` here is the root directory of this git repo
37-
JULIA_CPU_TARGET=generic JULIA_CONDAPKG_BACKEND=Null julia --project=.
37+
JULIA_CPU_TARGET="generic;znver2,clone_all" JULIA_CONDAPKG_BACKEND=Null julia --project=.
3838

3939
]instantiate # when you press `]` the prompt should switch to `(WVZAnalysis) pkg>`
4040
```
@@ -77,7 +77,7 @@ source /cvmfs/sft.cern.ch/lcg/views/dev4/latest/x86_64-centos7-gcc11-opt/setup.s
7777
7878
cd <where you cloned WVZAnalysis.jl>
7979
80-
LD_LIBRARY_PATH='' JULIA_CPU_TARGET=generic julia --project=./WVZXGBoostExt
80+
LD_LIBRARY_PATH='' julia --project=./WVZXGBoostExt
8181
```
8282

8383
Then, we need to instantiate on this node because hardware has changed (we have a GPU now):
@@ -102,19 +102,19 @@ In this step, we use the cluster (HTCondor in this case) to run through all syst
102102

103103
But first, you need to point our package to the new location that stores the XGBoost models:
104104
```bash
105-
$ JULIA_CPU_TARGET=generic JULIA_CONDAPKG_BACKEND=Null julia --project=. -e 'using WVZAnalysis; WVZAnalysis.set_bdt_model_dir("/data/jiling/WVZ/v2.3-2023_06_15_hists/")'
105+
$ JULIA_CPU_TARGET="generic;znver2,clone_all" JULIA_CONDAPKG_BACKEND=Null julia --project=. -e 'using WVZAnalysis; WVZAnalysis.set_bdt_model_dir("/data/jiling/WVZ/v2.3-2023_06_15_hists/")'
106106
```
107107

108108
Then start a new Julia session:
109109
```
110-
$ JULIA_CPU_TARGET=generic JULIA_CONDAPKG_BACKEND=Null julia --project=.
110+
$ JULIA_CPU_TARGET="generic;znver2,clone_all" JULIA_CONDAPKG_BACKEND=Null julia --project=.
111111
```
112112

113113
Then, we can schedule all the histogram making jobs:
114114
```julia
115115
using ClusterManagers, Distributed, WVZAnalysis
116116

117-
addprocs(HTCManager(100); extrajdl=["+queue=\"short\""], extraenv=["export JULIA_CPU_TARGET=generic"], exeflags = `--project=$(Base.active_project()) -e 'include("/data/jiling/WVZ/init.jl")'`);
117+
addprocs(HTCManager(80); extrajdl=["+queue=\"short\""], exeflags = `--project=$(Base.active_project()) -e 'include("/data/jiling/WVZ/init.jl")'`);
118118

119119
@everywhere using WVZAnalysis
120120
```
@@ -138,7 +138,7 @@ You want to exit this Julia session after you're finished, which will also kill
138138
In this last step, we will convert the output from last step into `.root` files, start a new Julia session if
139139
you exit the last one:
140140
```bash
141-
$ JULIA_CPU_TARGET=generic JULIA_CONDAPKG_BACKEND=Null julia --project=.
141+
$ JULIA_CPU_TARGET="generic;znver2,clone_all" JULIA_CONDAPKG_BACKEND=Null julia --project=.
142142
```
143143

144144
and simply use the little Python "extention" package we wrote:

src/alltags.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
const SIG_TAGS = ("Signal_WWZ", "Signal_WZZ", "Signal_ZZZ", "Signal_ZH_ZWW", "Signal_WH_WZZ", "Signal_ZH_ZZZ")
2-
const BKG_TAGS = ("ZZ", "Zjets", "ttbar", "WZ", "tZ", "ttZ", "tWZ", "VBS", "WH_Bkg", "ZH_Bkg", "Others")
2+
const BKG_TAGS = ("ZZ",
3+
# "Zjets",
4+
# "ttbar",
5+
# "WZ",
6+
# "tZ",
7+
"ttZ",
8+
"tWZ",
9+
"VBS",
10+
"WH_Bkg",
11+
"ZH_Bkg",
12+
"Others")
313
const ALL_TAGS = [SIG_TAGS...; BKG_TAGS...]

src/analysis_utils.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,10 @@ function BDT_hist_init(; sfsys, shape_variation)
446446
populate_hist!(_dict, shape_variation, (:SFinZ__MET, :SFnoZ__MET, :DF__MET), bins, sfsys)
447447

448448
bins = 0:5
449-
populate_hist!(_dict, shape_variation, (:SFinZ__Njet, :SFnoZ__Njet, :DF__Njet, :ZZCR__Njet, :ttZCR__Njet), bins, sfsys)
449+
populate_hist!(_dict, shape_variation, (:SFinZ__Njet, :SFnoZ__Njet, :DF__Njet), bins, sfsys)
450+
451+
bins = 0:10:1000
452+
populate_hist!(_dict, shape_variation, (:ZZCR__m4l, :ttZCR__m4l), bins, sfsys)
450453

451454
_dict[:CutFlow] = Hist1D(Int; bins=1:20)
452455
_dict[:CutFlowWgt] = Hist1D(Float64; bins=1:20)

src/mainlooper.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ function main_looper(mytree, sumWeight, dict, models,
192192
!pass_dR && continue
193193
cutflow_SRs!(cutflow_ptr, dict, wgt_dict; BDT_hist, SR, shape_variation)
194194

195-
has_b = any(@view evt.v_j_btag77[j_eta_mask])
195+
NBjets = count(@view evt.v_j_btag77[j_eta_mask])
196196

197197
(; MET, METSig, METPhi) = evt
198198
MET /= 1000
@@ -259,9 +259,9 @@ function main_looper(mytree, sumWeight, dict, models,
259259
end
260260

261261
wgt = wgt_dict[:NOMINAL]
262-
cr_ZZ = sr_SF_inZ && MET < 10 && !has_b
263-
cr_ttZ = has_b
264-
if MET < 10 || cr_ZZ || cr_ttZ
262+
cr_ZZ = sr_SF_inZ && MET < 10 && iszero(NBjets)
263+
cr_ttZ = NBjets > 1
264+
if MET < 10 || cr_ZZ || cr_ttZ || (NBjets>0)
265265
SR = -1
266266
end
267267
if BDT_hist && !arrow_making
@@ -287,9 +287,9 @@ function main_looper(mytree, sumWeight, dict, models,
287287
k = shape_variation
288288
end
289289
if cr_ZZ
290-
push!(dict[Symbol(:ZZCR, :__Njet, :__, k)], Njet, v)
290+
push!(dict[Symbol(:ZZCR, :__m4l, :__, k)], mass_4l, v)
291291
elseif cr_ttZ
292-
push!(dict[Symbol(:ttZCR, :__Njet, :__, k)], Njet, v)
292+
push!(dict[Symbol(:ttZCR, :__m4l, :__, k)], mass_4l, v)
293293
elseif SR >= 0
294294
push!(dict[Symbol(region_prefix, :__BDT, :__, k)], NN_score, v)
295295
push!(dict[Symbol(region_prefix, :__MET, :__, k)], MET, v)

0 commit comments

Comments
 (0)