Beispiel #1
0
import copy
import PhysicsTools.Heppy.loadlibs
from ROOT import heppy
from PhysicsTools.Heppy.utils.cmsswRelease import isNewerThan

is2012 = isNewerThan('CMSSW_5_2_0')

class RochesterCorrections(object):
    
    def __init__(self):
        self.cor = heppy.RochCor()
        self.cor2012 = heppy.RochCor2012()

    def corrected_p4( self, particle, run ):
        '''Returns the corrected p4 for a particle.

        The particle remains unchanged. 
        '''
        ptc = particle
        p4 = ptc.p4()
        tlp4 = TLorentzVector( p4.px(), p4.py(), p4.pz(), p4.energy() )
        cortlp4 = copy.copy(tlp4)
        if run<100:
            if is2012:
                self.cor2012.momcor_mc( cortlp4, ptc.charge(), 0.0, 0 )
            else:
                self.cor.momcor_mc( cortlp4, ptc.charge(), 0.0, 0 )
        else: # data
            if is2012:
                self.cor2012.momcor_data( cortlp4, ptc.charge(), 0.0, 0 )
            else:
Beispiel #2
0
 def __init__(self, cfg_ana, cfg_comp, looperName):
     super(JetAnalyzer, self).__init__(cfg_ana, cfg_comp, looperName)
     self.btagSF = BTagSF(cfg_ana.btagSFseed)
     self.is2012 = isNewerThan('CMSSW_5_2_0')
Beispiel #3
0
 def __init__(self, cfg_ana, cfg_comp, looperName):
     super(JetAnalyzer, self).__init__(cfg_ana, cfg_comp, looperName)
     self.btagSF = BTagSF(0)
     self.is2012 = isNewerThan('CMSSW_5_2_0')
Beispiel #4
0
import copy

from CMGTools.H2TauTau.proto.plotter.categories_common import *
from CMGTools.H2TauTau.proto.plotter.cut import *

from PhysicsTools.Heppy.utils.cmsswRelease import cmsswIs44X, cmsswIs52X
from PhysicsTools.Heppy.utils.cmsswRelease import isNewerThan

pt1 = 30
pt2 = 20  # 2011
if isNewerThan('CMSSW_5_2_0'):
    pt2 = 24  #2012

# ELECTRON = lepton 1
# TAU      = lepton 2

# this has to be in sync with:
# - H2TauTau/python/proto/analyzers/TauEleAnalyzer.py
# - H2TauTau/Colin/tauEle_2012_cfg.py
# - H2TauTau/python/objects/eleCuts_cff.py
# - H2TauTau/python/objects/tauCuts_cff.py
# - H2TauTau/python/objects/tauEleCuts_cff.py

# inc_sig_tau = Cut('l1_looseMvaIso>0.5 && l1_againstElectronMVA > 0.5 && l1_againstElectronTightMVA2 > 0.5 && l1_againstElectronMedium > 0.5 && l1_againstMuonLoose > 0.5 && l1_dxy<0.045 && l1_dz<0.2 && l1_pt>{pt1}'.format(pt1=pt1))

inc_sig_tau = Cut(
    'leptonAccept && thirdLeptonVeto && l1_threeHitIso<1.5 && l1_againstElectronMVA3Medium > 0.5 && l1_againstMuonLoose > 0.5 && l1_dxy<0.045 && l1_dz<0.2 && l1_pt>{pt1}'
    .format(pt1=pt1))

inc_sig_ele = Cut(
    'l2_relIso05<0.1 && l2_tightId>0.5 && l2_dxy<0.045 && l2_dz<0.2 && l2_pt>{pt2}'
Beispiel #5
0
import copy
from ROOT import heppy
from PhysicsTools.Heppy.utils.cmsswRelease import isNewerThan

is2012 = isNewerThan('CMSSW_5_2_0')


class RochesterCorrections(object):
    def __init__(self):
        self.cor = heppy.RochCor()
        self.cor2012 = heppy.RochCor2012()

    def corrected_p4(self, particle, run):
        '''Returns the corrected p4 for a particle.

        The particle remains unchanged. 
        '''
        ptc = particle
        p4 = ptc.p4()
        tlp4 = TLorentzVector(p4.px(), p4.py(), p4.pz(), p4.energy())
        cortlp4 = copy.copy(tlp4)
        if run < 100:
            if is2012:
                self.cor2012.momcor_mc(cortlp4, ptc.charge(), 0.0, 0)
            else:
                self.cor.momcor_mc(cortlp4, ptc.charge(), 0.0, 0)
        else:  # data
            if is2012:
                self.cor2012.momcor_data(cortlp4, ptc.charge(), 0.0, 0)
            else:
                self.cor.momcor_data(cortlp4, ptc.charge(), 0.0,
import copy

from CMGTools.H2TauTau.proto.plotter.categories_common import *
from CMGTools.H2TauTau.proto.plotter.cut import *

from PhysicsTools.Heppy.utils.cmsswRelease import cmsswIs44X,cmsswIs52X
from PhysicsTools.Heppy.utils.cmsswRelease import isNewerThan

pt1 = 30
pt2 = 20 # 2011
if isNewerThan('CMSSW_5_2_0'):
    pt2 = 24 #2012

# ELECTRON = lepton 1
# TAU      = lepton 2

# this has to be in sync with:
# - H2TauTau/python/proto/analyzers/TauEleAnalyzer.py
# - H2TauTau/Colin/tauEle_2012_cfg.py
# - H2TauTau/python/objects/eleCuts_cff.py
# - H2TauTau/python/objects/tauCuts_cff.py
# - H2TauTau/python/objects/tauEleCuts_cff.py

# inc_sig_tau = Cut('l1_looseMvaIso>0.5 && l1_againstElectronMVA > 0.5 && l1_againstElectronTightMVA2 > 0.5 && l1_againstElectronMedium > 0.5 && l1_againstMuonLoose > 0.5 && l1_dxy<0.045 && l1_dz<0.2 && l1_pt>{pt1}'.format(pt1=pt1))

inc_sig_tau = Cut('leptonAccept && thirdLeptonVeto && l1_threeHitIso<1.5 && l1_againstElectronMVA3Medium > 0.5 && l1_againstMuonLoose > 0.5 && l1_dxy<0.045 && l1_dz<0.2 && l1_pt>{pt1}'.format(pt1=pt1))

inc_sig_ele = Cut('l2_relIso05<0.1 && l2_tightId>0.5 && l2_dxy<0.045 && l2_dz<0.2 && l2_pt>{pt2}'.format(pt2=pt2))

passleptonvetoes = Cut('leptonAccept > 0.5 && thirdLeptonVeto > 0.5')
#inc_sig = inc_sig_ele & inc_sig_tau
            process.recoilCorMETDiTau.enable = True
            process.recoilCorMETDiTau.fileCorrectTo = correctFileName
            process.recoilCorMETDiTau.leptonLeg = leptonLeg
            process.recoilCorMETDiTau.fileZmmData = fileZmmData
            process.recoilCorMETDiTau.fileZmmMC = fileZmmMC
            process.recoilCorMETDiTau.correctionType = correctionType
    else:
        print '\tDISABLED'
        if runOnMC:
            process.metRecoilCorrectionInputSequence.remove(process.genWorZ)
        if hasattr(process, 'recoilCorMETTauMu'):
            process.recoilCorMETTauMu.enable = False
        if hasattr(process, 'recoilCorMETTauEle'):
            process.recoilCorMETTauEle.enable = False
        if hasattr(process, 'recoilCorMETDiTau'):
            process.recoilCorMETDiTau.enable = False


if __name__ == '__main__':

    import sys
    from PhysicsTools.Heppy.utils.cmsswRelease import isNewerThan

    data, mc, type = basicParameters(isNewerThan('CMSSW_5_2_X'))

    for line in sys.stdin:
        print
        line = line.rstrip()
        print line
        print fileAndLeg(line, True, None, 'di-tau')
            process.recoilCorMETDiTau.enable = True
            process.recoilCorMETDiTau.fileCorrectTo = correctFileName
            process.recoilCorMETDiTau.leptonLeg = leptonLeg 
            process.recoilCorMETDiTau.fileZmmData = fileZmmData
            process.recoilCorMETDiTau.fileZmmMC = fileZmmMC
            process.recoilCorMETDiTau.correctionType = correctionType
    else:
        print '\tDISABLED'
        if runOnMC:
            process.metRecoilCorrectionInputSequence.remove( process.genWorZ ) 
        if hasattr( process, 'recoilCorMETTauMu'):
            process.recoilCorMETTauMu.enable = False
        if hasattr( process, 'recoilCorMETTauEle'):
            process.recoilCorMETTauEle.enable = False
        if hasattr( process, 'recoilCorMETDiTau'):
            process.recoilCorMETDiTau.enable = False
            

if __name__ == '__main__':

    import sys
    from PhysicsTools.Heppy.utils.cmsswRelease import isNewerThan

    data, mc, type = basicParameters(isNewerThan('CMSSW_5_2_X'))
    
    for line in sys.stdin:
        print 
        line = line.rstrip()
        print line
        print fileAndLeg(line, True, None, 'di-tau')
Beispiel #9
0
 def __init__(self, cfg_ana, cfg_comp, looperName):
     super(VBFAnalyzer, self).__init__(cfg_ana, cfg_comp, looperName)
     self.btagSF = BTagSF(cfg_ana.btagSFseed)
     # import pdb; pdb.set_trace()
     self.is2012 = isNewerThan('CMSSW_5_2_0')