CMS 3D CMS Logo

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

Public Member Functions

def __init__
 
def beginLoop
 
def computeMT2
 
def declareHandles
 
def getMT2AKT
 
def getMT2Hemi
 
def makeMT2
 

Static Public Attributes

tuple groupingViaAKt = hemisphereViaAKt.getGroupingExclusive(2)
 
tuple groupingViaKt = hemisphereViaKt.getGroupingExclusive(2)
 
tuple hemisphereViaAKt = ReclusterJets(objects, -1.,50.0)
 
tuple hemisphereViaKt = ReclusterJets(objects, 1.,50.0)
 
tuple objects = ROOT.std.vector(ROOT.reco.Particle.LorentzVector)
 get hemispheres via AntiKT -1 antikt, 1 kt, 0 CA More...
 

Detailed Description

Definition at line 32 of file MT2Analyzer.py.

Constructor & Destructor Documentation

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

Definition at line 33 of file MT2Analyzer.py.

33 
34  def __init__(self, cfg_ana, cfg_comp, looperName ):
35  super(MT2Analyzer,self).__init__(cfg_ana,cfg_comp,looperName)

Member Function Documentation

def MT2Analyzer.MT2Analyzer.beginLoop (   self,
  setup 
)

Definition at line 41 of file MT2Analyzer.py.

41 
42  def beginLoop(self, setup):
43  super(MT2Analyzer,self).beginLoop(setup)
44  self.counters.addCounter('pairs')
45  count = self.counters.counter('pairs')
46  count.register('all events')
def MT2Analyzer.MT2Analyzer.computeMT2 (   self,
  visaVec,
  visbVec,
  metVec 
)

Definition at line 47 of file MT2Analyzer.py.

Referenced by MT2Analyzer.MT2Analyzer.getMT2Hemi().

47 
48  def computeMT2(self, visaVec, visbVec, metVec):
49 
50  import array
51  import numpy
52 
53  metVector = array.array('d',[0.,metVec.px(), metVec.py()])
54  visaVector = array.array('d',[0.,visaVec.px(), visaVec.py()])
55  visbVector = array.array('d',[0.,visbVec.px(), visbVec.py()])
56 
57  davismt2.set_momenta(visaVector,visbVector,metVector);
58  davismt2.set_mn(0);
59 
60  return davismt2.get_mt2()
def MT2Analyzer.MT2Analyzer.declareHandles (   self)

Definition at line 36 of file MT2Analyzer.py.

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

36 
37  def declareHandles(self):
38  super(MT2Analyzer, self).declareHandles()
39  #genJets
40  self.handles['genJets'] = AutoHandle( 'slimmedGenJets','std::vector<reco::GenJet>')
def MT2Analyzer.MT2Analyzer.getMT2AKT (   self,
  event,
  TMPobjects40jc,
  met,
  postFix 
)

Definition at line 61 of file MT2Analyzer.py.

Referenced by MT2Analyzer.MT2Analyzer.makeMT2().

61 
62  def getMT2AKT(self, event, TMPobjects40jc, met , postFix):
def MT2Analyzer.MT2Analyzer.getMT2Hemi (   self,
  event,
  TMPobjects40jc,
  met,
  postFix 
)

Definition at line 87 of file MT2Analyzer.py.

References MT2Analyzer.MT2Analyzer.computeMT2(), and if().

Referenced by MT2Analyzer.MT2Analyzer.makeMT2().

87 
88  def getMT2Hemi(self, event, TMPobjects40jc, met, postFix):
89 
90  if len(TMPobjects40jc)>=2:
91 
92  pxvec = ROOT.std.vector(float)()
93  pyvec = ROOT.std.vector(float)()
94  pzvec = ROOT.std.vector(float)()
95  Evec = ROOT.std.vector(float)()
96  grouping = ROOT.std.vector(int)()
97 
98  for jet in TMPobjects40jc:
99  pxvec.push_back(jet.px())
100  pyvec.push_back(jet.py())
101  pzvec.push_back(jet.pz())
102  Evec.push_back(jet.energy())
103 
104  hemisphere = Hemisphere(pxvec, pyvec, pzvec, Evec, 2, 3)
105  grouping=hemisphere.getGrouping()
106 
107  pseudoJet1px = 0
108  pseudoJet1py = 0
109  pseudoJet1pz = 0
110  pseudoJet1energy = 0
111  multPSJ1 = 0
112 
113  pseudoJet2px = 0
114  pseudoJet2py = 0
115  pseudoJet2pz = 0
116  pseudoJet2energy = 0
117  multPSJ2 = 0
118 
119  for index in range(0, len(pxvec)):
120  if(grouping[index]==1):
121  pseudoJet1px += pxvec[index]
122  pseudoJet1py += pyvec[index]
123  pseudoJet1pz += pzvec[index]
124  pseudoJet1energy += Evec[index]
125  multPSJ1 += 1
126  if(grouping[index]==2):
127  pseudoJet2px += pxvec[index]
128  pseudoJet2py += pyvec[index]
129  pseudoJet2pz += pzvec[index]
130  pseudoJet2energy += Evec[index]
131  multPSJ2 += 1
132 
133  pseudoJet1pt2 = pseudoJet1px*pseudoJet1px + pseudoJet1py*pseudoJet1py
134  pseudoJet2pt2 = pseudoJet2px*pseudoJet2px + pseudoJet2py*pseudoJet2py
135 
136  if pseudoJet1pt2 >= pseudoJet2pt2:
137  setattr(event, "pseudoJet1"+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet1px, pseudoJet1py, pseudoJet1pz, pseudoJet1energy ))
138  setattr(event, "pseudoJet2"+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet2px, pseudoJet2py, pseudoJet2pz, pseudoJet2energy ))
139  setattr(event, "multPseudoJet1"+postFix, multPSJ1 )
140  setattr(event, "multPseudoJet2"+postFix, multPSJ2 )
141  else:
142  setattr(event, "pseudoJet2"+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet1px, pseudoJet1py, pseudoJet1pz, pseudoJet1energy ))
143  setattr(event, "pseudoJet1"+postFix, ROOT.reco.Particle.LorentzVector( pseudoJet2px, pseudoJet2py, pseudoJet2pz, pseudoJet2energy ))
144  setattr(event, "multPseudoJet1"+postFix, multPSJ2 )
145  setattr(event, "multPseudoJet2"+postFix, multPSJ1 )
146 
147  return self.computeMT2(getattr(event,'pseudoJet1'+postFix), getattr(event,'pseudoJet2'+postFix), met)
148 
if(conf.exists("allCellsPositionCalc"))
def MT2Analyzer.MT2Analyzer.makeMT2 (   self,
  event 
)

Definition at line 149 of file MT2Analyzer.py.

References funct.abs(), MT2Analyzer.MT2Analyzer.getMT2AKT(), and MT2Analyzer.MT2Analyzer.getMT2Hemi().

150  def makeMT2(self, event):
151 # print '==> INSIDE THE PRINT MT2'
152 # print 'MET=',event.met.pt()
153 
154  import array
155  import numpy
156 
157 
158  objects40jc = [ j for j in event.cleanJets if j.pt() > 40 and abs(j.eta())<2.5 ]
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

tuple MT2Analyzer.MT2Analyzer.groupingViaAKt = hemisphereViaAKt.getGroupingExclusive(2)
static

Definition at line 80 of file MT2Analyzer.py.

tuple MT2Analyzer.MT2Analyzer.groupingViaKt = hemisphereViaKt.getGroupingExclusive(2)
static

Definition at line 71 of file MT2Analyzer.py.

tuple MT2Analyzer.MT2Analyzer.hemisphereViaAKt = ReclusterJets(objects, -1.,50.0)
static

Definition at line 79 of file MT2Analyzer.py.

tuple MT2Analyzer.MT2Analyzer.hemisphereViaKt = ReclusterJets(objects, 1.,50.0)
static

Definition at line 70 of file MT2Analyzer.py.

tuple MT2Analyzer.MT2Analyzer.objects = ROOT.std.vector(ROOT.reco.Particle.LorentzVector)
static

get hemispheres via AntiKT -1 antikt, 1 kt, 0 CA

Definition at line 66 of file MT2Analyzer.py.