CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
gen.LHEAnalyzer.LHEAnalyzer Class Reference
Inheritance diagram for gen.LHEAnalyzer.LHEAnalyzer:

Public Member Functions

def __init__
 
def beginLoop
 
def declareHandles
 
def process
 

Public Attributes

 lheh
 

Detailed Description

 

Definition at line 7 of file LHEAnalyzer.py.

Constructor & Destructor Documentation

def gen.LHEAnalyzer.LHEAnalyzer.__init__ (   self,
  cfg_ana,
  cfg_comp,
  looperName 
)

Definition at line 9 of file LHEAnalyzer.py.

9 
10  def __init__(self, cfg_ana, cfg_comp, looperName ):
11  super(LHEAnalyzer,self).__init__(cfg_ana,cfg_comp,looperName)
12  self.lheh=Handle('LHEEventProduct')

Member Function Documentation

def gen.LHEAnalyzer.LHEAnalyzer.beginLoop (   self,
  setup 
)

Definition at line 17 of file LHEAnalyzer.py.

17 
18  def beginLoop(self, setup):
19  super(LHEAnalyzer,self).beginLoop(setup)
def gen.LHEAnalyzer.LHEAnalyzer.declareHandles (   self)

Definition at line 13 of file LHEAnalyzer.py.

13 
14  def declareHandles(self):
15  super(LHEAnalyzer, self).declareHandles()
16 # self.mchandles['lhestuff'] = AutoHandle( 'externalLHEProducer','LHEEventProduct')
def gen.LHEAnalyzer.LHEAnalyzer.process (   self,
  event 
)

Definition at line 20 of file LHEAnalyzer.py.

References funct.abs(), gen.LHEAnalyzer.LHEAnalyzer.lheh, core.Analyzer.Analyzer.readCollections(), and mathSSE.sqrt().

Referenced by ConfigBuilder.ConfigBuilder.__init__(), ConfigBuilder.ConfigBuilder.addExtraStream(), ConfigBuilder.ConfigBuilder.anyOf(), ConfigBuilder.ConfigBuilder.completeInputCommand(), ConfigBuilder.ConfigBuilder.doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules.leave(), ConfigBuilder.ConfigBuilder.prepare(), ConfigBuilder.ConfigBuilder.prepare_ALCA(), ConfigBuilder.ConfigBuilder.prepare_DQM(), ConfigBuilder.ConfigBuilder.prepare_FASTSIM(), ConfigBuilder.ConfigBuilder.prepare_HARVESTING(), ConfigBuilder.ConfigBuilder.prepare_HLT(), ConfigBuilder.ConfigBuilder.prepare_LHE(), ConfigBuilder.ConfigBuilder.prepare_VALIDATION(), ConfigBuilder.ConfigBuilder.renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder.renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder.scheduleSequence().

20 
21  def process(self, event):
22 
23  # if not MC, nothing to do
24  if not self.cfg_comp.isMC:
25  return True
26  event.lheHT=0
27  event.lheNj=0
28  event.lheNb=0
29  event.lheNc=0
30  event.lheNl=0
31  event.lheNg=0
32  event.lheV_pt = 0
33  try:
34  event.input.getByLabel( 'externalLHEProducer',self.lheh)
35  except :
36  return True
37  if not self.lheh.isValid() :
38  return True
39  self.readCollections( event.input )
40  hepeup=self.lheh.product().hepeup()
41  pup=hepeup.PUP
42  l=None
43  lBar=None
44  nu=None
45  nuBar=None
46  for i in xrange(0,len(pup)):
47  id=hepeup.IDUP[i]
48  status = hepeup.ISTUP[i]
49  idabs=abs(id)
50 
51  if status == 1 and ( ( idabs == 21 ) or (idabs > 0 and idabs < 7) ) : # gluons and quarks
52  event.lheHT += sqrt( pup[i][0]**2 + pup[i][1]**2 ) # first entry is px, second py
53  event.lheNj +=1
54  if idabs==5:
55  event.lheNb += 1
56  if idabs==4:
57  event.lheNc += 1
58  if idabs in [1,2,3]:
59  event.lheNl += 1
60  if idabs==21:
61  event.lheNg += 1
62  if idabs in [12,14,16] :
63  if id > 0 :
64  nu = i
65  else :
66  nuBar = i
67  if idabs in [11,13,15] :
68  if id > 0 :
69  l = i
70  else :
71  lBar = i
72  v=None
73  if l and lBar : #Z to LL
74  v=(l,lBar)
75  elif l and nuBar : #W
76  v=(l,nuBar)
77  elif lBar and nu : #W
78  v=(nu,lBar)
79  elif nu and nuBar : #Z to nn
80  v=(nu,nuBar)
81  if v :
82  event.lheV_pt = sqrt( (pup[v[0]][0]+pup[v[1]][0])**2 + (pup[v[0]][1]+pup[v[1]][1])**2 )
83 
84  return True
85 
setattr(LHEAnalyzer,"defaultConfig",
T sqrt(T t)
Definition: SSEVec.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

gen.LHEAnalyzer.LHEAnalyzer.lheh

Definition at line 11 of file LHEAnalyzer.py.

Referenced by gen.LHEAnalyzer.LHEAnalyzer.process().