vhbb / cmssw

CMS Offline Software
cms-sw.github.io/cmssw
4 stars 5 forks source link

add testPDFWeightsProducer from testPDFWeightsTest #580

Closed perrozzi closed 7 years ago

perrozzi commented 7 years ago

to transform the NNPDF replicas to hessian and properly allow for 30 nuisances in the datacards.

arizzi commented 7 years ago

asking @perrozzi can we merge?

perrozzi commented 7 years ago

the eigenvectors are correctly stored in the intermediate pre-processor output, I am testing now the propagation to the final ntuple

perrozzi commented 7 years ago

ready to go

arizzi commented 7 years ago

File "./vhbb.py", line 623, in p.runcall(looper.loop) File "/cvmfs/cms.cern.ch/slc6_amd64_gcc530/external/python/2.7.11-giojec2/lib/python2.7/cProfile.py", line 149, in runcall return func(*args, **kw) File "/scratch/arizzi/Hbb/sync/clean/CMSSW_8_0_21/python/PhysicsTools/HeppyCore/framework/looper.py", line 226, in loop self.process( iEv ) File "/scratch/arizzi/Hbb/sync/clean/CMSSW_8_0_21/python/PhysicsTools/HeppyCore/framework/looper.py", line 313, in process return self._run_analyzers_on_event() File "/scratch/arizzi/Hbb/sync/clean/CMSSW_8_0_21/python/PhysicsTools/HeppyCore/framework/looper.py", line 328, in _run_analyzers_on_event ret = analyzer.process( self.event ) File "/scratch/arizzi/Hbb/sync/clean/CMSSW_8_0_21/python/VHbbAnalysis/Heppy/VHbbAnalyzer.py", line 497, in process event.LHE_weights_pdf_eigen = self.handles['PDFWeightsProducer'].product() File "/scratch/arizzi/Hbb/sync/clean/CMSSW_8_0_21/python/PhysicsTools/Heppy/analyzers/core/AutoHandle.py", line 23, in product self.ReallyLoad(self.event) File "/scratch/arizzi/Hbb/sync/clean/CMSSW_8_0_21/python/PhysicsTools/Heppy/analyzers/core/AutoHandle.py", line 52, in ReallyLoad raise Exception(errstr) Exception: Cannot find collection with: type = std::vector label = ('PDFWeightsProducer', 'outputHessianWeights', 'EX')

on ttbar... perhaps missing protecetion for non LHE?

perrozzi commented 7 years ago

can you please point me to the exact file/dataset?

perrozzi commented 7 years ago

in the meanwhile I added this https://github.com/vhbb/cmssw/pull/580/commits/247907c0e728ecbdb4cca80c871373625070dd3d don't know if is sufficient

arizzi commented 7 years ago

From phone now... Ttbar madgraph IIRC.

Il 10 gen 2017 23:38, "perrozzi" notifications@github.com ha scritto:

can you please point me to the exact file/dataset?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vhbb/cmssw/pull/580#issuecomment-271720698, or mute the thread https://github.com/notifications/unsubscribe-auth/AEyilrdCV_lQrZLvdHPmg63Me5LcKxhrks5rRAhLgaJpZM4LOQXU .

perrozzi commented 7 years ago

so, the fix is sufficient to let the program run, but madgraph has a "funny" way to label the pdf weights so the code doesn't find the dataset (working on it)... I made another commit to comply with aMC@NLO way of naming pdf

arizzi commented 7 years ago

this doesn't work with ./vhbb.py ... I guess some stuff come from the preprocessor? if so add the relevant analyzer/variables only in vhbb_combined.py so that ./vhbb.py (i.e. without preprocessor) can still work

perrozzi commented 7 years ago

like this? https://github.com/perrozzi/cmssw/compare/962811e...5e63232 (I also updated the list of files in vhbb.py

arizzi commented 7 years ago

yes

On Thu, Jan 12, 2017 at 7:25 PM, perrozzi notifications@github.com wrote:

like this? perrozzi@962811e...5e63232 https://github.com/perrozzi/cmssw/compare/962811e...5e63232 (I also updated the list of files in vhbb.py

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vhbb/cmssw/pull/580#issuecomment-272241532, or mute the thread https://github.com/notifications/unsubscribe-auth/AEyilsi5f83XvM5i4_9ks5uaIgml7zHfks5rRnAggaJpZM4LOQXU .

arizzi commented 7 years ago

but it seems you need to protect also VHbbAnalyzer.py

On Thu, Jan 12, 2017 at 7:28 PM, Andrea Rizzi andrea.rizzi@cern.ch wrote:

yes

On Thu, Jan 12, 2017 at 7:25 PM, perrozzi notifications@github.com wrote:

like this? perrozzi@962811e...5e63232 https://github.com/perrozzi/cmssw/compare/962811e...5e63232 (I also updated the list of files in vhbb.py

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vhbb/cmssw/pull/580#issuecomment-272241532, or mute the thread https://github.com/notifications/unsubscribe-auth/AEyilsi5f83XvM5i4_9ks5uaIgml7zHfks5rRnAggaJpZM4LOQXU .

perrozzi commented 7 years ago

I need input: shall I add a if getattr(self.cfg_ana,"doPDFWeightsProducer", True) in VHbbAnalyzer.py that is False in vhbb.py and overwritten to True in vhbb_combined.py ? Is there an existing example, just in case?

arizzi commented 7 years ago

in other places I think we made a try except or similar and then disable at first failure... check the LHEAnalyzer

arizzi commented 7 years ago

well it seems is just try/except in other places...

perrozzi commented 7 years ago

done. for madgraph the situation is complicated. we can merge this PR whenever needed, I will continue working to solve the issue

arizzi commented 7 years ago

Can you test on this file?

== CMSSW: 12-Jan-2017 18:42:08 CST Initiating request to open file root://cms-xrd-global.cern.ch//store/mc/RunIISummer16MiniAODv2/DYJetsToLL_M-50_HT-200to400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/100000/7058283A-01D2-E611-B723-E0071B7A48A0.root == CMSSW: %MSG-w XrdAdaptor: file_open 12-Jan-2017 18:42:12 CST pre-events == CMSSW: Data is served from T2_US_Nebraska instead of original site CERN-PROD == CMSSW: %MSG == CMSSW: 12-Jan-2017 18:42:15 CST Successfully opened file root://cms-xrd-global.cern.ch//store/mc/RunIISummer16MiniAODv2/DYJetsToLL_M-50_HT-200to400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/100000/7058283A-01D2-E611-B723-E0071B7A48A0.root == CMSSW: %MSG-w LogicError: PDFWeightsProducer:PDFWeightsProducer@beginRun 12-Jan-2017 18:50:46 CST Run: 1 == CMSSW: ::getByLabel: An attempt was made to read a Run product before endRun() was called. == CMSSW: The product is of type 'LHERunInfoProduct'. == CMSSW: The specified ModuleLabel was 'externalLHEProducer'. == CMSSW: The specified productInstanceName was ''. == CMSSW: == CMSSW: %MSG == CMSSW: 10 WEIGHT - PDF SET CANDIDATE FOR REWEIGHTING IN THIS SAMPLE= 0 == CMSSW: 111 WEIGHT - PDF SET CANDIDATE FOR REWEIGHTING IN THIS SAMPLE= 0 == CMSSW: 213 WEIGHT - PDF SET CANDIDATE FOR REWEIGHTING IN THIS SAMPLE= 0 == CMSSW: 316 WEIGHT - PDF SET CANDIDATE FOR REWEIGHTING IN THIS SAMPLE= 0 == CMSSW: 367 WEIGHT - PDF SET CANDIDATE FOR REWEIGHTING IN THIS SAMPLE= 0 == CMSSW: 370 WEIGHT - PDF SET CANDIDATE FOR REWEIGHTING IN THIS SAMPLE= 0 == CMSSW: 393 WEIGHT - PDF SET CANDIDATE FOR REWEIGHTING IN THIS SAMPLE= 0 == CMSSW: NO SUITABLE SET FOUND FOR MC2HESSIAN PDF CONVERSION! == CMSSW: Begin processing the 1st record. Run 1, Event 62325, LumiSection 41 at 12-Jan-2017 18:50:47.023 CST == CMSSW: #-------------------------------------------------------------------------- == CMSSW: # HEPTopTaggerV2 - under construction == CMSSW: # == CMSSW: # Please cite JHEP 1010 (2010) 078 [arXiv:1006.2833 [hep-ph]]

arizzi commented 7 years ago

or is it just debug printout?

perrozzi commented 7 years ago

read only now, yes it is a normal message advertising no pdf found for the mc2hessian procedure

arizzi commented 7 years ago

This is now broken at cmsRun level on samples without LHE, e.g.

== CMSSW: 14-Jan-2017 06:00:52 EST Successfully opened file root://cms-xrd-global.cern.ch//store/mc/RunIISummer16MiniAODv2/WZToLNu2QorQQ2L_aTGC_13TeV-madgraph-pythia8/MINIAODSIM/PUMoriond17_80X_mcRun2_asymptotic_2016_TrancheIV_v6-v1/120000/24920A9C-47C8-E611-A8E5-A0000420FE80.root

== CMSSW: The product is of type 'LHERunInfoProduct'. == CMSSW: The specified ModuleLabel was 'externalLHEProducer'. == CMSSW: The specified productInstanceName was ''. == CMSSW: == CMSSW: %MSG == CMSSW: ----- Begin Fatal Exception 14-Jan-2017 06:16:41 EST----------------------- == CMSSW: An exception of category 'ProductNotFound' occurred while == CMSSW: [0] Processing run: 1 == CMSSW: [1] Calling global beginRun for module PDFWeightsProducer/'PDFWeightsProducer' == CMSSW: Exception Message: == CMSSW: Principal::getByLabel: Found zero products matching all criteria == CMSSW: Looking for type: LHERunInfoProduct == CMSSW: Looking for module label: externalLHEProducer == CMSSW: Looking for productInstanceName: