Skip to content

Commit

Permalink
Merge pull request cms-sw#117 from arizzi/moreV12fixesSpeedUp
Browse files Browse the repository at this point in the history
More v12fixes speed up
  • Loading branch information
arizzi committed Jul 18, 2015
2 parents 17d17e4 + 0d66e07 commit abdd720
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
17 changes: 11 additions & 6 deletions PhysicsTools/Heppy/python/analyzers/objects/METAnalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ def makeTkMETs(self, event):
chargedchs = []
chargedPVLoose = []
chargedPVTight = []

dochs=getattr(self.cfg_ana,"includeTkMetCHS",True)
dotight=getattr(self.cfg_ana,"includeTkMetPVTight",True)
doloose=getattr(self.cfg_ana,"includeTkMetPVLoose",True)
pfcands = self.handles['cmgCand'].product()

for i in xrange(pfcands.size()):
Expand All @@ -56,13 +58,13 @@ def makeTkMETs(self, event):
if abs(pfcands.at(i).dz())<=self.cfg_ana.dzMax:
charged.append(pfcands.at(i))

if pfcands.at(i).fromPV()>0:
if dochs and pfcands.at(i).fromPV()>0:
chargedchs.append(pfcands.at(i))

if pfcands.at(i).fromPV()>1:
if doloose and pfcands.at(i).fromPV()>1:
chargedPVLoose.append(pfcands.at(i))

if pfcands.at(i).fromPV()>2:
if dotight and pfcands.at(i).fromPV()>2:
chargedPVTight.append(pfcands.at(i))

import ROOT
Expand Down Expand Up @@ -216,8 +218,8 @@ def process(self, event):
if self.cfg_ana.doTkMet:
self.makeTkMETs(event);

if self.cfg_comp.isMC and hasattr(event, 'genParticles'):
self.makeGenTkMet(event)
if getattr(self.cfg_ana,"doTkGenMet",self.cfg_ana.doTkMet) and self.cfg_comp.isMC and hasattr(event, 'genParticles'):
self.makeGenTkMet(event)

return True

Expand All @@ -230,6 +232,9 @@ def process(self, event):
recalibrate = True,
jetAnalyzerCalibrationPostFix = "",
doTkMet = False,
includeTkMetCHS = True,
includeTkMetPVLoose = True,
includeTkMetPVTight = True,
doMetNoPU = True,
doMetNoMu = False,
doMetNoEle = False,
Expand Down
2 changes: 1 addition & 1 deletion VHbbAnalysis/Heppy/test/crab/heppy_crab_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ mv csv*root csv/

python heppy_crab_script.py $1
echo "======================== CMSRUN LOG ============================"
tail -n 200 Output/cmsRun.log
cat Output/cmsRun.log
7 changes: 6 additions & 1 deletion VHbbAnalysis/Heppy/test/vhbb.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,18 @@
METAna = METAnalyzer.defaultConfig
METAna.doTkMet = True
METAna.doMetNoPU = True
METAna.doTkGenMet = False
METAna.includeTkMetPVLoose = False
METAna.includeTkMetPVTight = False

METPuppiAna = copy.copy(METAna)
METPuppiAna.metCollection = "slimmedMETsPuppi"
METPuppiAna.doMetNoPU = False
METPuppiAna.recalibrate = False
METPuppiAna.collectionPostFix = "Puppi"
METPuppiAna.copyMETsByValue = True
METPuppiAna.doTkMet = False
METPuppiAna.doMetNoPU = False



Expand Down Expand Up @@ -279,7 +284,7 @@
# "/scratch/arizzi/0E132828-B218-E511-9983-3417EBE6453D.root"
#"root://xrootd.unl.edu//store/mc/Phys14DR/TTJets_MSDecaysCKM_central_Tune4C_13TeV-madgraph-tauola/MINIAODSIM/PU20bx25_PHYS14_25_V1-v1/00000/00C90EFC-3074-E411-A845-002590DB9262.root"
# "root://xrootd.unl.edu//store/mc/Phys14DR/TTbarH_M-125_13TeV_amcatnlo-pythia8-tauola/MINIAODSIM/PU20bx25_tsg_PHYS14_25_V1-v2/00000/FC4E6E16-5C7F-E411-8843-002590200AE4.root"
"root://xrootd.unl.edu//store/mc/RunIISpring15DR74/ZH_HToBB_ZToLL_M125_13TeV_amcatnloFXFX_madspin_pythia8/MINIAODSIM/Asympt25ns_MCRUN2_74_V9-v1/60000/0210194C-2F18-E511-9A70-A0369F3102F6.root"
"/scratch/arizzi/0E132828-B218-E511-9983-3417EBE6453D.root"
],

#files = ["226BB247-A565-E411-91CF-00266CFF0AF4.root"],
Expand Down

0 comments on commit abdd720

Please sign in to comment.