CMS 3D CMS Logo

List of all members | Public Member Functions
AlphaTAnalyzer.AlphaTAnalyzer Class Reference
Inheritance diagram for AlphaTAnalyzer.AlphaTAnalyzer:

Public Member Functions

def __init__ (self, cfg_ana, cfg_comp, looperName)
 
def beginLoop (self, setup)
 
def declareHandles (self)
 
def makeAlphaT (self, jets)
 
def process (self, event)
 

Detailed Description

Definition at line 27 of file AlphaTAnalyzer.py.

Constructor & Destructor Documentation

def AlphaTAnalyzer.AlphaTAnalyzer.__init__ (   self,
  cfg_ana,
  cfg_comp,
  looperName 
)

Definition at line 28 of file AlphaTAnalyzer.py.

28  def __init__(self, cfg_ana, cfg_comp, looperName ):
29  super(AlphaTAnalyzer,self).__init__(cfg_ana,cfg_comp,looperName)
30 
def __init__(self, cfg_ana, cfg_comp, looperName)

Member Function Documentation

def AlphaTAnalyzer.AlphaTAnalyzer.beginLoop (   self,
  setup 
)

Definition at line 36 of file AlphaTAnalyzer.py.

36  def beginLoop(self,setup):
37  super(AlphaTAnalyzer,self).beginLoop(setup)
38  self.counters.addCounter('pairs')
39  count = self.counters.counter('pairs')
40  count.register('all events')
41 
42 
def AlphaTAnalyzer.AlphaTAnalyzer.declareHandles (   self)

Definition at line 31 of file AlphaTAnalyzer.py.

References core.AutoHandle.AutoHandle.handles, core.Analyzer.Analyzer.handles, and HTTP.RequestManager.handles.

31  def declareHandles(self):
32  super(AlphaTAnalyzer, self).declareHandles()
33  #genJets
34  self.handles['genJets'] = AutoHandle( 'slimmedGenJets','std::vector<reco::GenJet>')
35 
def AlphaTAnalyzer.AlphaTAnalyzer.makeAlphaT (   self,
  jets 
)

Definition at line 44 of file AlphaTAnalyzer.py.

Referenced by AlphaTAnalyzer.AlphaTAnalyzer.process().

44  def makeAlphaT(self, jets):
45 
46  if len(jets) == 0:
47  return 0.
48 
49  px = ROOT.std.vector('double')()
50  py = ROOT.std.vector('double')()
51  et = ROOT.std.vector('double')()
52 
53  #Make alphaT from lead 10 jets
54  for jet in jets[:10]:
55  px.push_back(jet.px())
56  py.push_back(jet.py())
57  et.push_back(jet.et())
58 
59  alphaTCalc = AlphaT()
60  return alphaTCalc.getAlphaT( et, px, py )
61 
def AlphaTAnalyzer.AlphaTAnalyzer.process (   self,
  event 
)

Definition at line 62 of file AlphaTAnalyzer.py.

References AlphaTAnalyzer.AlphaTAnalyzer.makeAlphaT(), and core.Analyzer.Analyzer.readCollections().

62  def process(self, event):
63  self.readCollections( event.input )
64 
65  event.alphaT = self.makeAlphaT(event.cleanJets)
66 
67  #Do the same with gen jets for MC
68  if self.cfg_comp.isMC:
69  event.genAlphaT = self.makeAlphaT(event.cleanGenJets)
70 
71  return True
72