1 from PhysicsTools.Heppy.analyzers.core.Analyzer
import Analyzer
2 from PhysicsTools.Heppy.analyzers.core.AutoHandle
import AutoHandle
3 import PhysicsTools.HeppyCore.framework.config
as cfg
5 from DataFormats.FWLite
import Events, Handle
9 def __init__(self, cfg_ana, cfg_comp, looperName ):
10 super(LHEAnalyzer,self).
__init__(cfg_ana,cfg_comp,looperName)
11 self.
lheh=Handle(
'LHEEventProduct')
23 if not self.cfg_comp.isMC:
33 event.input.getByLabel(
'externalLHEProducer',self.
lheh)
36 if not self.lheh.isValid() :
38 self.readCollections( event.input )
39 hepeup=self.lheh.product().hepeup()
45 for i
in xrange(0,len(pup)):
47 status = hepeup.ISTUP[i]
50 if status == 1
and ( ( idabs == 21 )
or (idabs > 0
and idabs < 7) ) :
51 event.lheHT +=
sqrt( pup[i][0]**2 + pup[i][1]**2 )
61 if idabs
in [12,14,16] :
66 if idabs
in [11,13,15] :
81 event.lheV_pt =
sqrt( (pup[v[0]][0]+pup[v[1]][0])**2 + (pup[v[0]][1]+pup[v[1]][1])**2 )
85 setattr(LHEAnalyzer,
"defaultConfig",
86 cfg.Analyzer(LHEAnalyzer,
Abs< T >::type abs(const T &t)