def gghgNoE(sample, rname): """ Full monophoton selection filtering out electron events. """ selector = gghgBase(sample, rname, selcls=ROOT.PartonSelector) selector.setRejectedPdgId(11) sp.setupPhotonSelection(selector.findOperator('PhotonSelection')) sp.addIDSFWeight(sample, selector) return selector
def gghg(sample, rname): """ GGH + photon candidate sample. """ selector = gghgBase(sample, rname) sp.setupPhotonSelection(selector.findOperator('PhotonSelection')) if not sample.data: sp.addIDSFWeight(sample, selector) return selector
def vbfzee(sample, rname): """ VBF + Zee sample for e-fake validation. """ selector = vbfgBase(sample, rname) sp.setupPhotonSelection(selector.findOperator('PhotonSelection')) if not sample.data: sp.addIDSFWeight(sample, selector) leptonSel = selector.findOperator('LeptonSelection') leptonSel.setN(1, 0) return selector
def vbfg(sample, rname): """ VBF + photon candidate sample. """ selector = vbfgBase(sample, rname) sp.setupPhotonSelection(selector.findOperator('PhotonSelection')) if not sample.data: digenjetSel = ROOT.DijetSelection('DigenjetSelection') digenjetSel.setMinDEta(0.) digenjetSel.setMinMjj(0.) digenjetSel.setJetType(ROOT.DijetSelection.jGen) selector.addOperator(digenjetSel) sp.addIDSFWeight(sample, selector) # if sample.name.startswith('gj'): # dijetSel = selector.findOperator('DijetSelection') # plots = ROOT.TFile.Open('/data/t3home000/yiiyama/monophoton/plots/vbfgloCtrl.root') # dijetSel.setDEtajjReweight(plots) return selector
def gghlBase(sample, rname, flavor, selcls=None): """ Base for n-lepton + photon selection. For MC, we could use PartonSelector, but for interest of clarity and comparing cut flow with the other groups, we let events with all flavors pass. """ if selcls is None: selector = ROOT.EventSelector(rname) else: selector = selcls(rname) selector.setPreskim( 'superClusters.rawPt > 210. && TMath::Abs(superClusters.eta) < 1.4442') if sample.data: selector.addOperator(ROOT.HLTFilter(selconf['sphTrigger'])) else: partons = ROOT.PartonFlavor() if flavor == ROOT.lElectron: partons.setRequiredPdgId(11) elif flavor == ROOT.lMuon: partons.setRequiredPdgId(13) partons.setIgnoreDecision(True) selector.addOperator(partons) operators = [ 'MetFilters', 'PhotonSelection', 'LeptonSelection', 'TauVeto', 'JetCleaning', 'DijetSelection', 'BjetVeto', 'CopyMet', 'CopySuperClusters', 'LeptonRecoil', ] if not sample.data: operators.append('MetVariations') operators += [ 'PhotonMetDPhi', 'JetMetDPhi', 'Met', 'PhotonPtOverMet', 'PhotonMt' ] for op in operators: selector.addOperator(getattr(ROOT, op)()) jetDPhi = selector.findOperator('JetMetDPhi') jetDPhi.setMetSource(ROOT.kInMet) photonSel = selector.findOperator('PhotonSelection') photonSel.setMinPt(220.) photonSel.setIDTune(selconf['photonIDTune']) photonSel.setWP(selconf['photonWP']) leptonSel = selector.findOperator('LeptonSelection') leptonSel.setRequireMedium(False) dijetSel = selector.findOperator('DijetSelection') dijetSel.setMinDEta(3.) dijetSel.setMinMjj(500.) dijetSel.setIgnoreDecision(True) sp.setupPhotonSelection(photonSel) selector.findOperator('LeptonRecoil').setFlavor(flavor) if not sample.data: metVar = selector.findOperator('MetVariations') metVar.setPhotonSelection(photonSel) realMetVar = ROOT.MetVariations('RealMetVar') realMetVar.setMetSource(ROOT.kInMet) realMetVar.setPhotonSelection(photonSel) selector.findOperator('PhotonMetDPhi').setMetVariations(metVar) jetDPhi.setMetVariations(realMetVar) selector.addOperator( ROOT.ConstantWeight(sample.crosssection / sample.sumw, 'crosssection')) sg.addPUWeight(sample, selector) sp.addIDSFWeight(sample, selector) sg.addPDFVariation(sample, selector) if flavor == ROOT.lElectron: sp.addElectronIDSFWeight(sample, selector) else: sp.addMuonIDSFWeight(sample, selector) selector.findOperator('TauVeto').setIgnoreDecision(True) selector.findOperator('BjetVeto').setIgnoreDecision(True) selector.findOperator('JetCleaning').setCleanAgainst(ROOT.cTaus, False) selector.findOperator('PhotonMetDPhi').setIgnoreDecision(True) selector.findOperator('JetMetDPhi').setIgnoreDecision(True) selector.findOperator('Met').setIgnoreDecision(True) selector.findOperator('Met').setThreshold(100.) selector.findOperator('PhotonPtOverMet').setIgnoreDecision(True) return selector