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
VBF.VBF Class Reference
Inheritance diagram for VBF.VBF:

Public Member Functions

def __init__
 
def __str__
 
def calcP4
 
def findCentralJets
 

Public Attributes

 centralJets
 
 cjvPtCut
 
 deta
 
 dijetphi
 
 dijetpt
 
 dphi
 
 dphidijethiggs
 
 higgsp4
 
 jets
 
 leadJets
 
 met
 
 mjj
 
 mva
 self.ptvis = diLepton.pt() new VBF MVA, based on 4 variables More...
 
 otherJets
 
 ptvis
 
 vbfMvaCalc
 
 visjeteta
 

Detailed Description

Computes and holds VBF quantities

Definition at line 5 of file VBF.py.

Constructor & Destructor Documentation

def VBF.VBF.__init__ (   self,
  jets,
  diLepton,
  vbfMvaCalc,
  cjvPtCut 
)
jets: jets cleaned from the diLepton legs.
diLepton: the di-tau, for example. Necessary to compute input variables for MVA selection

Definition at line 7 of file VBF.py.

7 
8  def __init__(self, jets, diLepton, vbfMvaCalc, cjvPtCut):
9  '''jets: jets cleaned from the diLepton legs.
10  diLepton: the di-tau, for example. Necessary to compute input variables for MVA selection
11  '''
12  self.cjvPtCut = cjvPtCut
13  self.vbfMvaCalc = vbfMvaCalc
14  self.jets = jets
15  # the MET is taken from the di-lepton, because it can depend on it
16  # e.g. recoil corrections, mva met
17  self.met = diLepton.met()
18  self.leadJets = jets[:2] # taking first 2 jets (leading ones)
19  self.otherJets = jets[2:]
20  self.centralJets = self.findCentralJets( self.leadJets, self.otherJets )
21 
22  # delta eta
23  self.deta = self.leadJets[0].eta() - self.leadJets[1].eta()
24 
25  # below, the variables for the MVA selection
26  # delta phi
27  self.dphi = deltaPhi(self.leadJets[0].phi(), self.leadJets[1].phi())
28  dijetp4 = self.leadJets[0].p4() + self.leadJets[1].p4()
29  # mass of the di-jet system
30  self.mjj = dijetp4.M()
31  # pt of di-jet system
32  self.dijetpt = dijetp4.pt()
33  # phi of di-jet system
34  self.dijetphi = dijetp4.phi()
35  # higgs momentum (defined as the di-lepton momentum + the met momentum)
36  # don't access longitudinal quantities!
37  self.higgsp4 = diLepton.p4() + self.met.p4()
38  # delta phi between dijet system and higgs system
39  self.dphidijethiggs = deltaPhi( self.dijetphi, self.higgsp4.phi() )
40  # ?
41  visDiLepton = diLepton.leg1 ().p4 () + diLepton.leg2 ().p4 ()
42  self.visjeteta = min (
43  abs (self.leadJets[0].eta () - visDiLepton.eta ()),
44  abs (self.leadJets[1].eta () - visDiLepton.eta ()))
45  # visible higgs pt = di-lepton pt
46  self.ptvis = visDiLepton.pt()
47  ## self.ptvis = diLepton.pt()
48  # new VBF MVA, based on 4 variables
49  if self.vbfMvaCalc is not None:
50  self.mva = self.vbfMvaCalc.val( self.mjj,
51  abs(self.deta),
52  self.visjeteta,
53  self.ptvis )
54  else:
55  self.mva = -99.
56 
57 # double mjj , // the invariant mass of the two tag jets
58 # double dEta , // the pseudorapidity difference between the two tag jets
59 # double dPhi , // the phi difference between the two tag jets
60 # double ditau_pt , // the vector sum of the pT of the tau + electron/muon + MET
61 # double dijet_pt , // the vector sum of the pT of the two tag jets
62 # double dPhi_hj , // the phi difference between the di-tau vector and the di-jet vector
63 # double C1 , // the pseudorapidity difference between the *visible* di-tau vector and the closest tag jet
64 # double C2 // the *visible* pT of the di-tau
65 
dijetphi
Definition: VBF.py:33
jets
Definition: VBF.py:13
T eta() const
def __init__
Definition: VBF.py:7
higgsp4
Definition: VBF.py:36
dijetpt
Definition: VBF.py:31
dphi
Definition: VBF.py:26
cjvPtCut
Definition: VBF.py:11
def findCentralJets
Definition: VBF.py:66
deta
Definition: VBF.py:22
double p4[4]
Definition: TauolaWrapper.h:92
otherJets
Definition: VBF.py:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
vbfMvaCalc
Definition: VBF.py:12
ptvis
Definition: VBF.py:45
leadJets
Definition: VBF.py:17
mjj
Definition: VBF.py:29
centralJets
Definition: VBF.py:19
mva
self.ptvis = diLepton.pt() new VBF MVA, based on 4 variables
Definition: VBF.py:49
dphidijethiggs
Definition: VBF.py:38
met
Definition: VBF.py:16
visjeteta
Definition: VBF.py:41
Definition: DDAxes.h:10

Member Function Documentation

def VBF.VBF.__str__ (   self)

Definition at line 94 of file VBF.py.

References VBF.VBF.centralJets, HcalCellType::HcalCell.deta, VBF.VBF.deta, VBF.VBF.dijetphi, VBF.VBF.dijetpt, DBlmapWriter::_LMapRowHBEF.dphi, HcalCellType::HcalCell.dphi, VBF.VBF.dphi, DDBHMAngular.dphi, HcalFlexiHardcodeGeometryLoader::HBHOCellParameters.dphi, LMapRow.dphi, LMapLoader::_LMapRowHBEF.dphi, HcalFlexiHardcodeGeometryLoader::HECellParameters.dphi, HcalFlexiHardcodeGeometryLoader::HFCellParameters.dphi, XMLProcessor::_LMapRowHBEF.dphi, MuonGeometryArrange::MGACollection.dphi, VBF.VBF.dphidijethiggs, join(), VBF.VBF.leadJets, python.multivaluedict.map(), VBF.VBF.mjj, VBF.VBF.ptvis, and VBF.VBF.visjeteta.

94 
95  def __str__(self):
96  header = 'VBF : deta={deta:4.2f}, Mjj={mjj:4.2f}, #centjets={ncentjets}'
97  header = header.format( deta=self.deta, mjj=self.mjj, ncentjets=len(self.centralJets))
98  leadJets = map( str, self.leadJets )
99  centralJets = map( str, self.centralJets)
100  tmp = [header]
101  tmp.append('MVA input variables: dphi={dphi:4.2f}, dijetpt={dijetpt:4.2f}, dijetphi={dijetphi:4.2f}, dphidijethiggs={dphidijethiggs:4.2f}, visjeteta={visjeteta:4.2f}, ptvis={ptvis:4.2f}'.format(
102  dphi = self.dphi,
103  dijetpt = self.dijetpt,
104  dijetphi = self.dijetphi,
105  dphidijethiggs = self.dphidijethiggs,
106  visjeteta = self.visjeteta,
107  ptvis = self.ptvis
108  ))
109  tmp.append('Leading Jets:')
110  tmp.extend( leadJets )
111  tmp.append('Central Jets:')
112  tmp.extend( centralJets )
113  return '\n'.join( tmp )
dijetphi
Definition: VBF.py:33
dijetpt
Definition: VBF.py:31
dphi
Definition: VBF.py:26
def __str__
Definition: VBF.py:94
deta
Definition: VBF.py:22
ptvis
Definition: VBF.py:45
leadJets
Definition: VBF.py:17
mjj
Definition: VBF.py:29
centralJets
Definition: VBF.py:19
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
dphidijethiggs
Definition: VBF.py:38
visjeteta
Definition: VBF.py:41
def VBF.VBF.calcP4 (   self,
  jets 
)
returns the sum p4 of a collection of objects.
FIXME: remove this function, which is a bit stupid

Definition at line 85 of file VBF.py.

85 
86  def calcP4(self, jets):
87  '''returns the sum p4 of a collection of objects.
88  FIXME: remove this function, which is a bit stupid
89  '''
90  p4 = TLorentzVector()
91  for jet in jets:
92  p4 += TLorentzVector(jet.px(), jet.py(), jet.pz(), jet.energy())
93  return p4
def calcP4
Definition: VBF.py:85
def VBF.VBF.findCentralJets (   self,
  leadJets,
  otherJets 
)
Finds all jets between the 2 leading jets, for central jet veto.

Definition at line 66 of file VBF.py.

References VBF.VBF.cjvPtCut, eta(), and alcazmumu_cfi.filter.

66 
67  def findCentralJets( self, leadJets, otherJets ):
68  '''Finds all jets between the 2 leading jets, for central jet veto.'''
69  if not len(otherJets):
70  return []
71  etamin = leadJets[0].eta()
72  etamax = leadJets[1].eta()
73  if etamin > etamax:
74  etamin, etamax = etamax, etamin
75  def isCentral( jet ):
76  if jet.pt()<self.cjvPtCut:
77  return False
78  eta = jet.eta()
79  if etamin < eta and eta < etamax:
80  return True
81  else:
82  return False
83  centralJets = filter( isCentral, otherJets )
84  return centralJets
T eta() const
cjvPtCut
Definition: VBF.py:11
def findCentralJets
Definition: VBF.py:66

Member Data Documentation

VBF.VBF.centralJets

Definition at line 19 of file VBF.py.

Referenced by VBF.VBF.__str__().

VBF.VBF.cjvPtCut

Definition at line 11 of file VBF.py.

Referenced by VBF.VBF.findCentralJets().

VBF.VBF.deta

Definition at line 22 of file VBF.py.

Referenced by VBF.VBF.__str__().

VBF.VBF.dijetphi

Definition at line 33 of file VBF.py.

Referenced by VBF.VBF.__str__().

VBF.VBF.dijetpt

Definition at line 31 of file VBF.py.

Referenced by VBF.VBF.__str__().

VBF.VBF.dphi

Definition at line 26 of file VBF.py.

Referenced by VBF.VBF.__str__().

VBF.VBF.dphidijethiggs

Definition at line 38 of file VBF.py.

Referenced by VBF.VBF.__str__().

VBF.VBF.higgsp4

Definition at line 36 of file VBF.py.

VBF.VBF.jets

Definition at line 13 of file VBF.py.

VBF.VBF.leadJets

Definition at line 17 of file VBF.py.

Referenced by VBF.VBF.__str__().

VBF.VBF.met

Definition at line 16 of file VBF.py.

VBF.VBF.mjj

Definition at line 29 of file VBF.py.

Referenced by VBF.VBF.__str__().

VBF.VBF.mva

self.ptvis = diLepton.pt() new VBF MVA, based on 4 variables

Definition at line 49 of file VBF.py.

VBF.VBF.otherJets

Definition at line 18 of file VBF.py.

VBF.VBF.ptvis

Definition at line 45 of file VBF.py.

Referenced by VBF.VBF.__str__().

VBF.VBF.vbfMvaCalc

Definition at line 12 of file VBF.py.

VBF.VBF.visjeteta

Definition at line 41 of file VBF.py.

Referenced by VBF.VBF.__str__().