1 from PhysicsTools.Heppy.analyzers.core.Analyzer
import Analyzer
2 from PhysicsTools.Heppy.analyzers.core.AutoHandle
import AutoHandle
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)
22 if not self.cfg_comp.isMC:
27 h=Handle(
'LHEEventProduct')
28 event.input.getByLabel(
'externalLHEProducer',h)
31 self.readCollections( event.input )
32 hepeup=h.product().hepeup()
38 for i
in xrange(0,len(pup)):
40 status = hepeup.ISTUP[i]
43 if status == 1
and ( ( idabs == 21 )
or (idabs > 0
and idabs < 7) ) :
44 event.lheHT +=
sqrt( pup[i][0]**2 + pup[i][1]**2 )
46 if idabs
in [12,14,16] :
51 if idabs
in [11,13,15] :
66 event.lheV_pt =
sqrt( (pup[v[0]][0]+pup[v[1]][0])**2 + (pup[v[0]][1]+pup[v[1]][1])**2 )
70 setattr(LHEAnalyzer,
"defaultConfig",
71 cfg.Analyzer(LHEAnalyzer,
Abs< T >::type abs(const T &t)