CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, jets, diLepton, vbfMvaCalc, cjvPtCut)
 
def __str__ (self)
 
def calcP4 (self, jets)
 
def findCentralJets (self, leadJets, otherJets)
 

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

◆ __init__()

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

Member Function Documentation

◆ __str__()

def VBF.VBF.__str__ (   self)

Definition at line 94 of file VBF.py.

References VBF.VBF.centralJets, HcalCellType::HcalCell.deta, VBF.VBF.deta, RectangularEtaPhiRegion.deta, VBF.VBF.dijetphi, VBF.VBF.dijetpt, HcalCellType::HcalCell.dphi, VBF.VBF.dphi, RectangularEtaPhiRegion.dphi, HcalDDDRecConstants::HcalEtaBin.dphi, LMapRow.dphi, DDBHMAngular.dphi, HcalHardcodeGeometryLoader::HBHOCellParameters.dphi, HcalFlexiHardcodeGeometryLoader::HBHOCellParameters.dphi, XMLProcessor::_LMapRowHBEF.dphi, HcalHardcodeGeometryLoader::HECellParameters.dphi, HcalFlexiHardcodeGeometryLoader::HECellParameters.dphi, HcalHardcodeGeometryLoader::HFCellParameters.dphi, HcalFlexiHardcodeGeometryLoader::HFCellParameters.dphi, MuonGeometryArrange::MGACollection.dphi, trklet::IMATH_TrackletCalculatorDisk.dphi, trklet::IMATH_TrackletCalculatorOverlap.dphi, trklet::IMATH_TrackletCalculator.dphi, VBF.VBF.dphidijethiggs, join(), VBF.VBF.leadJets, genParticles_cff.map, VBF.VBF.mjj, SMPDQM.mjj, VBF.VBF.ptvis, and VBF.VBF.visjeteta.

94  def __str__(self):
95  header = 'VBF : deta={deta:4.2f}, Mjj={mjj:4.2f}, #centjets={ncentjets}'
96  header = header.format( deta=self.deta, mjj=self.mjj, ncentjets=len(self.centralJets))
97  leadJets = map( str, self.leadJets )
98  centralJets = map( str, self.centralJets)
99  tmp = [header]
100  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(
101  dphi = self.dphi,
102  dijetpt = self.dijetpt,
103  dijetphi = self.dijetphi,
104  dphidijethiggs = self.dphidijethiggs,
105  visjeteta = self.visjeteta,
106  ptvis = self.ptvis
107  ))
108  tmp.append('Leading Jets:')
109  tmp.extend( leadJets )
110  tmp.append('Central Jets:')
111  tmp.extend( centralJets )
112  return '\n'.join( tmp )
113 
static std::string join(char **cmd)
Definition: RemoteFile.cc:19

◆ calcP4()

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  def calcP4(self, jets):
86  '''returns the sum p4 of a collection of objects.
87  FIXME: remove this function, which is a bit stupid
88  '''
89  p4 = TLorentzVector()
90  for jet in jets:
91  p4 += TLorentzVector(jet.px(), jet.py(), jet.pz(), jet.energy())
92  return p4
93 

◆ findCentralJets()

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, PVValHelper.eta, and ALCARECOTkAlBeamHalo_cff.filter.

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

Member Data Documentation

◆ centralJets

VBF.VBF.centralJets

Definition at line 19 of file VBF.py.

Referenced by VBF.VBF.__str__().

◆ cjvPtCut

VBF.VBF.cjvPtCut

Definition at line 11 of file VBF.py.

Referenced by VBF.VBF.findCentralJets().

◆ deta

VBF.VBF.deta

Definition at line 22 of file VBF.py.

Referenced by VBF.VBF.__str__().

◆ dijetphi

VBF.VBF.dijetphi

Definition at line 33 of file VBF.py.

Referenced by VBF.VBF.__str__().

◆ dijetpt

VBF.VBF.dijetpt

Definition at line 31 of file VBF.py.

Referenced by VBF.VBF.__str__().

◆ dphi

VBF.VBF.dphi

Definition at line 26 of file VBF.py.

Referenced by VBF.VBF.__str__().

◆ dphidijethiggs

VBF.VBF.dphidijethiggs

Definition at line 38 of file VBF.py.

Referenced by VBF.VBF.__str__().

◆ higgsp4

VBF.VBF.higgsp4

Definition at line 36 of file VBF.py.

◆ jets

VBF.VBF.jets

Definition at line 13 of file VBF.py.

◆ leadJets

VBF.VBF.leadJets

Definition at line 17 of file VBF.py.

Referenced by VBF.VBF.__str__().

◆ met

VBF.VBF.met

Definition at line 16 of file VBF.py.

Referenced by objects.METAnalyzer.METAnalyzer.applyDeltaMet().

◆ mjj

VBF.VBF.mjj

Definition at line 29 of file VBF.py.

Referenced by VBF.VBF.__str__().

◆ mva

VBF.VBF.mva

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

Definition at line 49 of file VBF.py.

◆ otherJets

VBF.VBF.otherJets

Definition at line 18 of file VBF.py.

◆ ptvis

VBF.VBF.ptvis

Definition at line 45 of file VBF.py.

Referenced by VBF.VBF.__str__().

◆ vbfMvaCalc

VBF.VBF.vbfMvaCalc

Definition at line 12 of file VBF.py.

◆ visjeteta

VBF.VBF.visjeteta

Definition at line 41 of file VBF.py.

Referenced by VBF.VBF.__str__().