vhbb / cmssw

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

Add spring16 el mva v2 #640

Closed capalmer85 closed 7 years ago

capalmer85 commented 7 years ago

Unfortunately, this still doesn't work. I have included the updates in the PR from Ilya and I followed the implementation of Spring15 ids as closely as I could (they should be basically the same). I edited these four files:

PhysicsTools/Heppy/python/analyzers/objects/LeptonAnalyzer.py PhysicsTools/Heppy/python/physicsobjects/Electron.py VHbbAnalysis/Heppy/python/vhbbobj.py VHbbAnalysis/Heppy/test/vhbb.py

When trying to run this code with "python vhbb_combined.py" I have the following error (that I don't understand). There is probably another file I need to edit but I don't know which one.

[ZllKinematicFit]: resolutions successfully loaded Using outputfile given in PhysicsTools.HeppyCore.framework.services.tfile.TFileService_outputfile Disabling as there is no fallback egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp80 edm::ValueMap at first failure Traceback (most recent call last): File "vhbb_combined.py", line 164, in p.runcall(looper.loop) File "/cvmfs/cms.cern.ch/slc6_amd64_gcc530/external/python/2.7.11-ikhhed2/lib/python2.7/cProfile.py", line 149, in runcall return func(*args, **kw) File "/afs/cern.ch/work/c/capalmer/private/hbb/2017/Q1/heppy/CMSSW_8_0_25/python/PhysicsTools/HeppyCore/framework/looper.py", line 226, in loop self.process( iEv ) File "/afs/cern.ch/work/c/capalmer/private/hbb/2017/Q1/heppy/CMSSW_8_0_25/python/PhysicsTools/HeppyCore/framework/looper.py", line 313, in process return self._run_analyzers_on_event() File "/afs/cern.ch/work/c/capalmer/private/hbb/2017/Q1/heppy/CMSSW_8_0_25/python/PhysicsTools/HeppyCore/framework/looper.py", line 328, in _run_analyzers_on_event ret = analyzer.process( self.event ) File "/afs/cern.ch/work/c/capalmer/private/hbb/2017/Q1/heppy/CMSSW_8_0_25/python/PhysicsTools/Heppy/analyzers/objects/LeptonAnalyzer.py", line 708, in process self.makeLeptons(event) File "/afs/cern.ch/work/c/capalmer/private/hbb/2017/Q1/heppy/CMSSW_8_0_25/python/PhysicsTools/Heppy/analyzers/objects/LeptonAnalyzer.py", line 187, in makeLeptons allelectrons = self.makeAllElectrons(event) File "/afs/cern.ch/work/c/capalmer/private/hbb/2017/Q1/heppy/CMSSW_8_0_25/python/PhysicsTools/Heppy/analyzers/objects/LeptonAnalyzer.py", line 468, in makeAllElectrons eleMVAIdSpring16GeneralPurposePOG80 = self.handles['eleMVAIdSpring16GeneralPurposePOG80'].product() File "/afs/cern.ch/work/c/capalmer/private/hbb/2017/Q1/heppy/CMSSW_8_0_25/python/PhysicsTools/Heppy/analyzers/core/AutoHandle.py", line 23, in product self.ReallyLoad(self.event) File "/afs/cern.ch/work/c/capalmer/private/hbb/2017/Q1/heppy/CMSSW_8_0_25/python/PhysicsTools/Heppy/analyzers/core/AutoHandle.py", line 52, in ReallyLoad raise Exception(errstr) Exception: Cannot find collection with: type = edm::ValueMap label = egmGsfElectronIDs:mvaEleID-Spring16-GeneralPurpose-V1-wp80

arizzi commented 7 years ago

mmhhh it seems that is trying to load something that is not in the input file. Are you sure we do not have to add a producer in the cmsRun config?

capalmer85 commented 7 years ago

That's an idea. Can you point out the config file in VHbbAnalysis that you guess I should mend? (I'll look in the meantime.)

arizzi commented 7 years ago

combined_cmssw.py

capalmer85 commented 7 years ago

There was something to be added there. Trying again now.

capalmer85 commented 7 years ago

ok, this works now. I'm reviewing for typos, etc.

capalmer85 commented 7 years ago

From my side this is good to go. I compared the number of events selected (out of 1000) in WH signal with previous MVA/WP and this is a little looser... although it was not too many events (150 vs 167). The MVA outputs look highly correlated so everything looks fine. This can be merged unless there are any further comments.

arizzi commented 7 years ago

testing it now

arizzi commented 7 years ago

what is that supposed to do? max(x.mvaIdSpring16GeneralPurposePOG90+ 2*x.mvaIdSpring16GeneralPurposePOG80) should it be a comma rather than plus?

File "/scratch/arizzi/Hbb/V25deep/CMSSW_8_0_25/python/VHbbAnalysis/Heppy/vhbbobj.py", line 35, in NTupleVariable("eleMVAIdSppring16GenPurp", lambda x : max(x.mvaIdSpring16GeneralPurposePOG90+ 2*x.mvaIdSpring16GeneralPurposePOG80) if abs(x.pdgId()) == 11 and hasattr(x,"mvaIdSpring16GeneralPurposePOG90") else -1, int, help="EGamma POG MVA ID for non-triggering electrons (0=none, 1=WP90, 2=WP80, Spring15 training); 1 for muons"), TypeError: 'int' object is not iterable

capalmer85 commented 7 years ago

Looking now.

capalmer85 commented 7 years ago

That should fix it. I forgot to re-push this last week... sorry.