Skip to content

Commit

Permalink
Dump narf; fixes on previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwalter2 committed Dec 17, 2024
1 parent 1e97755 commit 77b80c0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 31 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/unfolding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ jobs:
- name: wmass combine unfolded xsec
run: >-
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh narf/scripts/fitting/combinetf2.py
$WREMNANTS_OUTDIR/WMass_qGen_ptGen_absEtaGen_unfolding/Combination.hdf5 -o $WREMNANTS_OUTDIR/WMass_qGen_ptGen_absEtaGen_unfolding/fitresults.hdf5
$WREMNANTS_OUTDIR/WMass_qGen_ptGen_absEtaGen_unfolding/WMass.hdf5 -o $WREMNANTS_OUTDIR/WMass_qGen_ptGen_absEtaGen_unfolding/fitresults.hdf5
--externalPostfit $WREMNANTS_OUTDIR/WMass_eta_pt_charge_unfolding/fitresults.hdf5
--saveHists --computeHistErrors --project ch0 ptGen --project ch0 absEtaGen
Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:
run: >-
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh narf/scripts/fitting/combinetf2.py
$WREMNANTS_OUTDIR/WMass_qGen_ptGen_absEtaGen_theoryfit/WMass.hdf5 -o $WREMNANTS_OUTDIR/WMass_qGen_ptGen_absEtaGen_theoryfit/fitresults.hdf5
--doImpacts --globalImpacts --saveHists --saveHistErrors --chisqFit --externalCovariance -t 0
--doImpacts --globalImpacts --saveHists --computeHistErrors --chisqFit --externalCovariance -t 0
- name: wmass theoryfit impacts
run: >-
Expand Down Expand Up @@ -391,8 +391,8 @@ jobs:
- name: wlike combine unfolding setup
run: >-
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh scripts/combine/setupCombine.py
--analysisMode unfolding --poiAsNoi -i $HIST_FILE --lumiScale $LUMI_SCALE -o $WREMNANTS_OUTDIR --postfix unfolding
--scaleNormXsecHistYields '0.01' --genAxes qGen-ptGen-absEtaGen
--analysisMode unfolding -i $HIST_FILE --lumiScale $LUMI_SCALE -o $WREMNANTS_OUTDIR --postfix unfolding
--genAxes qGen-ptGen-absEtaGen --sparse
- name: wlike combine unfolding fit
run: >-
Expand All @@ -403,14 +403,14 @@ jobs:
- name: wlike combine xsec setup
run: >-
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh scripts/combine/setupCombine.py
--analysisMode unfolding --poiAsNoi -i $HIST_FILE --lumiScale $LUMI_SCALE -o $WREMNANTS_OUTDIR --postfix unfolding
--analysisMode unfolding -i $HIST_FILE --lumiScale $LUMI_SCALE -o $WREMNANTS_OUTDIR --postfix unfolding
--baseName xnorm --filterProcGroups Zmumu
--scaleNormXsecHistYields '0.01' --fitvar qGen-ptGen-absEtaGen --genAxes qGen-ptGen-absEtaGen
--fitvar qGen-ptGen-absEtaGen --genAxes qGen-ptGen-absEtaGen
- name: wlike combine unfolded xsec
run: >-
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh narf/scripts/fitting/combinetf2.py
$WREMNANTS_OUTDIR/ZMassWLike_qGen_ptGen_absEtaGen_unfolding/Combination.hdf5 -o $WREMNANTS_OUTDIR/ZMassWLike_qGen_ptGen_absEtaGen_unfolding/fitresults.hdf5
$WREMNANTS_OUTDIR/ZMassWLike_qGen_ptGen_absEtaGen_unfolding/ZMassWLike.hdf5 -o $WREMNANTS_OUTDIR/ZMassWLike_qGen_ptGen_absEtaGen_unfolding/fitresults.hdf5
--externalPostfit $WREMNANTS_OUTDIR/ZMassWLike_eta_pt_charge_unfolding/fitresults.hdf5
--saveHists --computeHistErrors --project ch0 ptGen --project ch0 absEtaGen
Expand Down Expand Up @@ -456,7 +456,7 @@ jobs:
run: >-
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh narf/scripts/fitting/combinetf2.py
$WREMNANTS_OUTDIR/ZMassWLike_qGen_ptGen_absEtaGen_theoryfit/WMass.hdf5 -o $WREMNANTS_OUTDIR/ZMassWLike_qGen_ptGen_absEtaGen_theoryfit/fitresults.hdf5
--doImpacts --globalImpacts --saveHists --saveHistErrors --chisqFit --externalCovariance -t 0
--doImpacts --globalImpacts --saveHists --computeHistErrors --chisqFit --externalCovariance -t 0
- name: wlike theoryfit impacts
run: >-
Expand Down Expand Up @@ -546,25 +546,25 @@ jobs:
- name: dilepton combine ptll unfolding setup
run: >-
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh scripts/combine/setupCombine.py
--analysisMode unfolding -i $HIST_FILE --fitvar ptll-yll --genAxes ptVGen-absYVGen --lumiScale $LUMI_SCALE -o $WREMNANTS_OUTDIR --postfix unfolding
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh scripts/combine/setupCombine.py -i $HIST_FILE --sparse
--analysisMode unfolding --fitvar ptll-yll --genAxes ptVGen-absYVGen --lumiScale $LUMI_SCALE -o $WREMNANTS_OUTDIR --postfix unfolding
- name: dilepton combine ptll unfolding fit
run: >-
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh narf/scripts/fitting/combinetf2.py
$WREMNANTS_OUTDIR/ZMassDilepton_ptll_yll_unfolding/ZMassDilepton.hdf5 -o $WREMNANTS_OUTDIR/ZMassDilepton_ptll_yll_unfolding/fitresults.hdf5
--binByBinStat --doImpacts --globalImpacts --saveHists --saveHistErrors
--binByBinStat --doImpacts --globalImpacts --saveHists --computeHistErrors
- name: dilepton combine ptll xsec setup
run: >-
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh scripts/combine/setupCombine.py
--analysisMode unfolding -i $HIST_FILE --lumiScale $LUMI_SCALE -o $WREMNANTS_OUTDIR --postfix unfolding
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh scripts/combine/setupCombine.py -i $HIST_FILE
--analysisMode unfolding --lumiScale $LUMI_SCALE -o $WREMNANTS_OUTDIR --postfix unfolding
--fitvar ptVGen-absYVGen --genAxes ptVGen-absYVGen --baseName xnorm --filterProcGroups Zmumu
- name: dilepton combine ptll unfolded xsec
run: >-
scripts/ci/run_with_singularity.sh scripts/ci/setup_and_run_python.sh narf/scripts/fitting/combinetf2.py
$WREMNANTS_OUTDIR/ZMassDilepton_ptVGen_absYVGen_unfolding/Combination.hdf5 -o $WREMNANTS_OUTDIR/ZMassDilepton_ptVGen_absYVGen_unfolding/fitresults.hdf5
$WREMNANTS_OUTDIR/ZMassDilepton_ptVGen_absYVGen_unfolding/ZMassDilepton.hdf5 -o $WREMNANTS_OUTDIR/ZMassDilepton_ptVGen_absYVGen_unfolding/fitresults.hdf5
--externalPostfit $WREMNANTS_OUTDIR/ZMassDilepton_ptll_yll_unfolding/fitresults.hdf5
--saveHists --computeHistErrors
Expand Down
2 changes: 1 addition & 1 deletion narf
Submodule narf updated 1 files
+37 −45 narf/combineutils.py
2 changes: 1 addition & 1 deletion scripts/combine/setupCombine.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ def setup(

if xnorm or (isUnfolding and not isPoiAsNoi):
# adding charge axis
if wmass and "qGen" in fitvar or (genvar is not None and "qGen" in genvar):
if wmass and ("qGen" in fitvar or (genvar is not None and "qGen" in genvar)):
# add gen charge as additional axis
datagroups.groups[base_group].memberOp = [
(
Expand Down
17 changes: 2 additions & 15 deletions wremnants/HDF5Writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,6 @@ def get_flat_values(
else:
return h.values(flow=flow).flatten().astype(self.dtype)

def get_flat_cov(self, h, flow=False):
h = h.values(flow=flow).astype(self.dtype)
naxes = int(len(h.shape) / 2)
nbins = np.product(h.shape[:naxes])
h = h.reshape(nbins, nbins)
return h

def write(
self,
args,
Expand Down Expand Up @@ -584,13 +577,7 @@ def get_logk(histname, var_type=""):
if self.sparse:
logger.info(f"Write out sparse array")

idxdtype = "int32"
maxsparseidx = max(nbinsfull * nproc, 2 * nsyst)
if maxsparseidx > np.iinfo(idxdtype).max:
logger.info(
"sparse array shapes are too large for index datatype, switching to int64"
)
idxdtype = "int64"
idxdtype = "int64"

norm_sparse_size = 0
norm_sparse_indices = np.zeros([norm_sparse_size, 2], idxdtype)
Expand Down Expand Up @@ -881,7 +868,7 @@ def create_dataset(
pseudodata = None

if self.theoryFitDataCov is not None:
data_cov = self.get_flat_cov(self.theoryFitDataCov.get())
data_cov = self.theoryFitDataCov.get().values()

if data_cov.shape != (nbins, nbins):
raise RuntimeError(
Expand Down

0 comments on commit 77b80c0

Please sign in to comment.