Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
ZX_PostProcessingPlotter
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christian Weber
ZX_PostProcessingPlotter
Commits
bd3c82d9
Commit
bd3c82d9
authored
4 years ago
by
jingjing
Browse files
Options
Downloads
Patches
Plain Diff
Implement check on input hists of no entry or trivial value
parent
b14ddfcd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
limitSetting/limitSettingHistPrep.py
+17
-11
17 additions, 11 deletions
limitSetting/limitSettingHistPrep.py
with
17 additions
and
11 deletions
limitSetting/limitSettingHistPrep.py
+
17
−
11
View file @
bd3c82d9
...
...
@@ -413,12 +413,18 @@ if __name__ == '__main__':
if
args
.
makeTheoryShapeVariations
and
"
PMG_
"
in
path
or
"
Nominal
"
in
path
:
pmgWeightDict
=
makeHistDict
.
fillHistDict
(
path
,
myTObject
,
args
.
mcCampaign
,
myDSIDHelper
,
channelMap
=
channelMapping
,
masterHistDict
=
pmgWeightDict
,
customMapping
=
myDSIDHelper
.
DSIDtoDSIDMapping
)
if
args
.
checkTrivialHists
:
# Check for any hists of zero integral and/or mean value in the input
bmin
=
myTObject
.
FindBin
(
xmin
)
bmax
=
myTObject
.
FindBin
(
xmax
)
histTitle
=
myTObject
.
GetName
if
myTObject
.
Integral
(
bmin
,
bmax
)
==
0
or
myTObject
.
GetMean
(
axis
=
1
)
==
0
:
raise
ValueError
(
'
Hist
'
,
histTitle
,
'
has no content!
'
)
import
pdb
;
pdb
.
set_trace
()
bmin
=
myTObject
.
GetXaxis
().
FindBin
(
myTObject
.
GetMinimum
())
bmax
=
myTObject
.
GetXaxis
().
FindBin
(
myTObject
.
GetMaximum
())
#print(path, myTObject.Integral(bmin, bmax))
#import pdb; pdb.set_trace()
#if myTObject.Integral(bmin, bmax) == 0:
if
myTObject
.
GetEntries
()
==
0
:
raise
ValueError
(
'
Hist
'
,
path
,
'
has no entry!
'
)
if
myTObject
.
GetMean
()
==
0
:
raise
ValueError
(
'
Hist
'
,
path
,
'
has zero mean value!
'
)
#import pdb; pdb.set_trace()
nRelevantHistsProcessed
+=
1
...
...
@@ -441,18 +447,18 @@ if __name__ == '__main__':
# import pdb; pdb.set_trace()
# print(masspointDictBeforeInterpolation)
if
args
.
interpolateSamples
:
addInterpolatedSignalSamples
(
masterHistDict
,
channels
=
"
ZXSR
"
)
import
pdb
;
pdb
.
set_trace
()
#
import pdb; pdb.set_trace()
##############################################################################
# add 'expectedData' hists, i.e. hist constructed from background samples
##############################################################################
addExpectedData
(
masterHistDict
)
import
pdb
;
pdb
.
set_trace
()
#
import pdb; pdb.set_trace()
###############################################################################################################
# sum up 4e + 2mu2e hists to 2l2e and 4mu + 2e2mu hists to 2l2mu hists, and include them in the masterHistDict
###############################################################################################################
makeHistDict
.
add2l2eAnd2l2muHists
(
masterHistDict
)
import
pdb
;
pdb
.
set_trace
()
#
import pdb; pdb.set_trace()
###############################################################################################################
...
...
@@ -461,14 +467,14 @@ if __name__ == '__main__':
if
args
.
rebin
>
1
:
for
anyHist
in
loopOverRecursiveDict
(
masterHistDict
):
anyHist
.
Rebin
(
args
.
rebin
)
reportMemUsage
.
reportMemUsage
(
startTime
=
startTimeInterp
)
import
pdb
;
pdb
.
set_trace
()
#
import pdb; pdb.set_trace()
##############################################################################
# write the histograms in the masterHistDict to file for the limit setting
##############################################################################
rootDictAndTDirTools
.
writeDictTreeToRootFile
(
masterHistDict
,
targetFilename
=
args
.
outputTo
)
reportMemUsage
.
reportMemUsage
(
startTime
=
startTime
)
import
pdb
;
pdb
.
set_trace
()
#
import pdb; pdb.set_trace()
##############################################################################
# create an overview of the signal samples (regular and interpolated)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment