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

Adding getProcessNorms() to CMSHistErrorPropagator #994

Merged
merged 3 commits into from
Jul 25, 2024

Conversation

nucleosynthesis
Copy link
Contributor

Added function to CMSHistErrorPropagator to return process norm name and values. This is now used in the test/printWorkspaceNormalisations.py script so that it works when using autoMCStats (no longer just reports 1 for the normalisation value)

Currently there are not a lot of warnings when compiling. Attached warnings below

In member function 'add',
    inlined from 'processArg' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:138:46,
    inlined from 'processArgs' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:135:35,
    inlined from '__ct ' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:55:16,
    inlined from 'getProcessNorms' at src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc:579:55:
/cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooCollectionProxy.h:114:40: warning: array subscript 'struct RooCollectionProxy[0]' is partly outside array bounds of 'struct RooArgList[1]' [-Warray-bounds]
  114 |       return add(var, _defValueServer, _defShapeServer, silent);
      |                                        ^
src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc: In member function 'getProcessNorms':
src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc:579:83: note: object '<anonymous>' of size 128
  579 |           normProd = new RooProduct(normProdName, "", RooArgList(*integral, *coeff));
      |                                                                                   ^
In member function 'add',
    inlined from 'processArg' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:138:46,
    inlined from 'processArgs' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:135:35,
    inlined from '__ct ' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:55:16,
    inlined from 'getProcessNorms' at src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc:579:55:
/cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooCollectionProxy.h:114:23: warning: array subscript 'struct RooCollectionProxy[0]' is partly outside array bounds of 'struct RooArgList[1]' [-Warray-bounds]
  114 |       return add(var, _defValueServer, _defShapeServer, silent);
      |                       ^
src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc: In member function 'getProcessNorms':
src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc:579:83: note: object '<anonymous>' of size 128
  579 |           normProd = new RooProduct(normProdName, "", RooArgList(*integral, *coeff));
      |                                                                                   ^
In member function 'add',
    inlined from 'processArg' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:144:8,
    inlined from 'processArgs' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:135:35,
    inlined from '__ct ' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:55:16,
    inlined from 'getProcessNorms' at src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc:579:55:
/cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooCollectionProxy.h:114:40: warning: array subscript 'struct RooCollectionProxy[0]' is partly outside array bounds of 'struct RooArgList[1]' [-Warray-bounds]
  114 |       return add(var, _defValueServer, _defShapeServer, silent);
      |                                        ^
src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc: In member function 'getProcessNorms':
src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc:579:83: note: object '<anonymous>' of size 128
  579 |           normProd = new RooProduct(normProdName, "", RooArgList(*integral, *coeff));
      |                                                                                   ^
In member function 'add',
    inlined from 'processArg' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:144:8,
    inlined from 'processArgs' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:135:35,
    inlined from '__ct ' at /cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooArgList.h:55:16,
    inlined from 'getProcessNorms' at src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc:579:55:
/cvmfs/cms.cern.ch/el9_amd64_gcc12/lcg/root/6.30.07-8b1a11e1ef0e074fdfd44e162b27e71c/include/RooCollectionProxy.h:114:23: warning: array subscript 'struct RooCollectionProxy[0]' is partly outside array bounds of 'struct RooArgList[1]' [-Warray-bounds]
  114 |       return add(var, _defValueServer, _defShapeServer, silent);
      |                       ^
src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc: In member function 'getProcessNorms':
src/HiggsAnalysis/CombinedLimit/src/CMSHistErrorPropagator.cc:579:83: note: object '<anonymous>' of size 128
  579 |           normProd = new RooProduct(normProdName, "", RooArgList(*integral, *coeff));
      |                                                                                   ^

}
if (!normProd) {
RooAbsReal* integral = shape->createIntegral(*myobs);
normProd = new RooProduct(normProdName, "", RooArgList(*integral, *coeff));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nucleosynthesis
I think similar warnings were fixed with the following previously :

          RooArgList normProdInputs;
          normProdInputs.add(*integral);
          normProdInputs.add(*coeff);
          normProd = new RooProduct(normProdName, "", normProdInputs);
          normProd->addOwnedComponents(normProdInputs);

@anigamova
Copy link
Collaborator

Fixed the warnings in ROOT v6.30 compilation and ready to merge

@anigamova anigamova merged commit caf347d into main Jul 25, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants