def AddHistPairWithL1(cutTree = None,cut = None, RefTrig = None, TestTrig = None, L1ListRef = None,L1ListTest = None): """docstring for AddBinedHist""" out = [] refTrigs = None if "Mu" in RefTrig: refTrigs = [TestTrig,RefTrig] else: refTrigs = [TestTrig] refPlots = PL_TriggerTurnOns( PSet(DirName = RefTrig+"_For_"+TestTrig,MinObjects =0 , MaxObjects = 15,Plots = True, ReWeight = True if "Mu" not in RefTrig else False, TriggerReWeight = refTrigs, Verbose = False, ReWeightL1 = False, L1TriggerReWeight = [L1ListRef]).ps()) testTrigPlots = PL_TriggerTurnOns( PSet(DirName = TestTrig+"_From_"+RefTrig,MinObjects = 0, MaxObjects = 15,Plots = True, ReWeight = True, TriggerReWeight = [TestTrig], Verbose = False, ReWeightL1 = True, L1TriggerReWeight = [L1ListTest]).ps()) refTrigPS = PSet(Verbose = False,UsePreScaledTriggers = True,Triggers = [] ) refTrigPS.Triggers = [RefTrig] refTrigOP = OP_MultiTrigger( refTrigPS.ps() ) testTrigPS = PSet(Verbose = False,UsePreScaledTriggers = True,Triggers = [] ) testTrigPS.Triggers = [TestTrig] print "RefTrig = %s, testTrig = %s"%(refTrigPS.Triggers[0],testTrigPS.Triggers[0]) testTrigOP = OP_MultiTrigger( testTrigPS.ps() ) cutTree.TAttach(cut,refTrigOP) cutTree.TAttach(refTrigOP,refPlots) cutTree.TAttach(refTrigOP,testTrigOP) cutTree.TAttach(testTrigOP,testTrigPlots) out.append(refTrigOP) out.append(refPlots) out.append(testTrigPlots) out.append(testTrigOP) return out pass
def makePlotOp(OP = (), cutTree = None, cut = None, label = ""): """docstring for makePlotOp""" out = [] if OP[1] != None: plotpset = deepcopy(OP[1]) plotpset.DirName = label print plotpset.DirName op = eval(OP[0]+"(plotpset.ps())") else: op = eval(OP[0]) out.append(op) cutTree.TAttach(cut,op) alpha = OP_CommonAlphaTCut(0.55) dump = EventDump() skim_ps=PSet( SkimName = "myskim", DropBranches = False, Branches = [ " keep * " ] ) skim = SkimOp(skim_ps.ps()) # out.append(skim) # out.append(skim_ps) cutTree.TAttach(cut,alpha) #cutTree.TAttach(cut,dump) #cutTree.TAttach(cut,skim) #cutTree.TAttach(alpha,dump) #cutTree.TAttach(alpha,skim) out.append(skim) out.append(alpha) out.append(dump) return out pass
def makePlotOp(OP=(), cutTree=None, cut=None, label=""): """docstring for makePlotOp""" out = [] if OP[1] != None: plotpset = deepcopy(OP[1]) plotpset.DirName = label print plotpset.DirName op = eval(OP[0] + "(plotpset.ps())") else: op = eval(OP[0]) out.append(op) cutTree.TAttach(cut, op) alpha = OP_CommonAlphaTCut(0.55) dump = EventDump() skim_ps = PSet(SkimName="myskim", DropBranches=False, Branches=[" keep * "]) skim = SkimOp(skim_ps.ps()) # out.append(skim) # out.append(skim_ps) cutTree.TAttach(cut, alpha) cutTree.TAttach(alpha, dump) # cutTree.TAttach(alpha,skim) out.append(alpha) out.append(dump) return out pass
def evList_to_pset(fname, debug=False): """ Takes an input event list file and converts to a PSet suitable for use in analysis code.""" """NOTE: made for txt file format 'Run:LS:Event' """ import sys from icf.core import PSet with open(fname, "r") as f: p = PSet() runList = [] lumiSList = [] evList = [] for line in f: lineTmp = line.split(":") #fill each list runList.append(int(lineTmp[0])) lumiSList.append(int(lineTmp[1])) evList.append(int(lineTmp[2])) #create new entry in the PSet for each list p._quiet_set("Run", runList) p._quiet_set("Lumi", lumiSList) p._quiet_set("Event", evList) return p.ps()
def AddBinedHist(cutTree=None, OP=(), cut=None, htBins=[], TriggerDict=None, lab=""): """docstring for AddBinedHist""" out = [] if TriggerDict is not None: for lower, upper in zip(htBins, htBins[1:] + [None]): # print "Lower , Upper =", lower , upper if int(lower) == 325 and upper is None: continue if int(lower) == 375 and upper is None: continue # print "continue should have happened now" lowerCut = eval("RECO_CommonHTCut(%d)" % lower) triggerps = PSet(Verbose=False, UsePreScaledTriggers=False, Triggers=[]) triggerps.Triggers = TriggerDict["%d%s" % (lower, "_%d" % upper if upper else "")] Trigger = OP_MultiTrigger(triggerps.ps()) out.append(triggerps) out.append(Trigger) out.append(lowerCut) cutTree.TAttach(cut, Trigger) cutTree.TAttach(Trigger, lowerCut) if upper: upperCut = eval("RECO_CommonHTLessThanCut(%d)" % upper) out.append(upperCut) cutTree.TAttach(lowerCut, upperCut) pOps = makePlotOp(cutTree=cutTree, OP=OP, cut=upperCut if upper else lowerCut, label="%s%d%s" % (lab, lower, "_%d" % upper if upper else "")) out.append(pOps) else: for lower, upper in zip(htBins, htBins[1:] + [None]): # print "Lower , Upper =", lower , upper if int(lower) == 325 and upper is None: continue if int(lower) == 375 and upper is None: continue # print "continue should have happened now" lowerCut = eval("RECO_CommonHTCut(%d)" % lower) out.append(lowerCut) cutTree.TAttach(cut, lowerCut) if upper: upperCut = eval("RECO_CommonHTLessThanCut(%d)" % upper) out.append(upperCut) cutTree.TAttach(lowerCut, upperCut) pOps = makePlotOp(cutTree=cutTree, OP=OP, cut=upperCut if upper else lowerCut, label="%s%d%s" % (lab, lower, "_%d" % upper if upper else "")) out.append(pOps) return out pass
def AddBinedHist(cutTree = None, OP = (), cut = None, htBins = [],TriggerDict = None,lab = ""): """docstring for AddBinedHist""" out = [] if TriggerDict is not None: for lower,upper in zip(htBins,htBins[1:]+[None]): # print "Lower , Upper =", lower , upper if int(lower) == 325 and upper is None: continue if int(lower) == 375 and upper is None: continue if int(lower) == 475 and upper is None: continue if int(lower) == 675 and upper is None: continue # print "continue should have happened now" lowerCut = eval("RECO_CommonHTCut(%d)"%lower) triggerps = PSet(Verbose = False, UsePreScaledTriggers = False, Triggers = []) triggerps.Triggers = TriggerDict["%d%s"%(lower, "_%d"%upper if upper else "")] Trigger = OP_MultiTrigger( triggerps.ps() ) out.append(triggerps) out.append(Trigger) out.append(lowerCut) cutTree.TAttach(cut,Trigger) cutTree.TAttach(Trigger,lowerCut) if upper: upperCut = eval("RECO_CommonHTLessThanCut(%d)"%upper) out.append(upperCut) cutTree.TAttach(lowerCut,upperCut) pOps = makePlotOp(cutTree = cutTree, OP = OP, cut = upperCut if upper else lowerCut, label = "%s%d%s"%(lab,lower, "_%d"%upper if upper else "")) out.append(pOps) else: for lower,upper in zip(htBins,htBins[1:]+[None]): # print "Lower , Upper =", lower , upper if int(lower) == 325 and upper is None: continue if int(lower) == 375 and upper is None: continue if int(lower) == 475 and upper is None: continue if int(lower) == 675 and upper is None: continue # print "continue should have happened now" lowerCut = eval("RECO_CommonHTCut(%d)"%lower) out.append(lowerCut) cutTree.TAttach(cut,lowerCut) if upper: upperCut = eval("RECO_CommonHTLessThanCut(%d)"%upper) out.append(upperCut) cutTree.TAttach(lowerCut,upperCut) pOps = makePlotOp(cutTree = cutTree, OP = OP, cut = upperCut if upper else lowerCut, label = "%s%d%s"%(lab,lower, "_%d"%upper if upper else "")) out.append(pOps) return out pass
def setup_light_tree(baton, main, data, dont_use_gen, trigger_info): import wpol.electron_id as electron_id import libAlex as alex tree_cfg = PSet( DoGen = not (data or dont_use_gen), TriggerInfo = trigger_info, ElectronCuts80 = electron_id.eff_80, ElectronCuts70 = electron_id.eff_70, ElectronCuts60 = electron_id.eff_60, Isolation = True, HoverE = True, DeltaEtaAtVtx = True, DeltaPhiAtVtx = True, SigmaIEtaIEta = True, Conversions = True, ConversionsExtra = True, SupressErrors = True ) baton.tree2 = alex.AlexTree("light_tree_lt4jets", tree_cfg.ps()) main.tree.TAttach(main.GetOp("lt4_jets"), baton.tree2) return baton
def metScaleSystematic(a, shiftdir, lepton): """ Apply the pfmet scale systematic as a MET filter. a : analysis object shiftdir : True (False) for upwards (downwards) shift lepton : 'Muon' or 'Electron' """ pfmet_jecunc = PSet( #the location of the JECUncertainty txt file jecuncfile = "GR_R_42_V19_AK5PF_Uncertainty.txt", jecuncfileresidual = "GR_R_42_V19_AK5PF_L2L3Residual.txt", #either Muon or Electron lepton = lepton, #the jet threshold to consider for the JEC Uncertainties pfjetthresh = 10.0, #the percentage/100 to shift the unclustered energy by unclusteredshift = 0.1, #whether or not to apply the shift upwards (True) or downwards (False) shiftup = shiftdir ) pfmetjecunc = wpol.pfMETJECUnc(pfmet_jecunc.ps()) a.AddMETFilter("pfMET", pfmetjecunc) return pfmetjecunc
evDump = EventDump() # htTriggerEmu = OP_TriggerHT_Emu(250.,40.) cutTreeData = Tree("Data") out = [] skim_ps=PSet( SkimName = "myskim", DropBranches = False, Branches = [ " keep * " ] ) badEvents =runLumiCutter(PSet(Run= [166033,162811, 163233, 163374, 163589, 163759, 163817, 165121, 165364, 165415, 165467, 165472, 165506, 165567, 165570, 165993, 166034, 166049, 166380, 166514, 166565, 166701, 166842, 166864, 166960, 167102, 167282, 167284, 167675, 167807, 167830, 167830, 167898, 167913, 167913, 170876, 170876, 171050, 171050, 171156, 171178, 171178, 171369, 171484, 171484, 171578, 171578, 171812, 171876, 171897, 172033, 172791, 172791, 172799, 172802, 172822, 172822, 172868, 172868, 172949, 172952, 173198, 173241, 173241, 173243, 173380, 173389, 173439, 173657, 173657, 173692, 173692, 173692, 175975, 175990, 176023, 176023, 176201, 176286, 176286, 176304, 176309, 176309, 176547, 176548, 176701, 176702, 176765, 176771, 176771, 176771, 176795, 176796, 176796, 176799, 176844, 176886, 176928, 176933, 176982, 177053, 177074, 177096, 177183, 177183, 177201, 177201, 177222, 177730, 177782, 177782, 177782, 177788, 177875, 178098, 178420, 178421, 178421, 178479, 178479, 178703, 178786, 178786, 178803, 178803, 178920, 178970, 179411, 179411, 179411, 179411, 179434, 179497, 179547, 179889, 180072, 180072, 180076, 180076, 180241, 180241, 180241],Lumi =[0,4, 274, 671, 46, 182, 118, 242, 1132, 812, 113, 493, 57, 540, 696, 778, 203, 57, 637, 12, 12, 79, 7, 318, 60, 6, 38, 891, 517, 1406, 171, 458, 1334, 12, 14, 180, 415, 53, 92, 211, 149, 731, 61, 358, 79, 347, 696, 323, 382, 295, 256, 664, 67, 203, 304, 1922, 616, 1755, 553, 933, 680, 665, 16, 759, 13, 199, 283, 307, 68, 90, 2250, 89, 927, 179, 56, 60, 65, 135, 166, 62, 186, 484, 696, 28, 624, 8, 399, 110, 148, 64, 78, 42, 10, 45, 153, 61, 378, 7, 82, 4, 530, 488, 129, 9, 98, 258, 63, 59, 213, 160, 73, 79, 22, 148, 183, 53, 111, 230, 189, 68, 177, 194, 67, 152, 55, 207, 157, 10, 23, 6, 96, 83, 192, 233, 169, 61, 80, 201, 229, 129, 65, 99]).ps()) skim = SkimOp(skim_ps.ps()) # cutTreeData.Attach(json) triggers = ["HLT_HT250_AlphaT0p55_v1","HLT_HT250_AlphaT0p55_v2","HLT_HT250_AlphaT0p53_v2","HLT_HT250_AlphaT0p53_v3","HLT_HT250_AlphaT0p53_v4","HLT_HT250_AlphaT0p53_v5","HLT_HT250_AlphaT0p53_v6","HLT_HT250_AlphaT0p55_v2","HLT_HT250_AlphaT0p58_v3","HLT_HT300_AlphaT0p52_v1","HLT_HT300_AlphaT0p52_v2","HLT_HT300_AlphaT0p52_v3","HLT_HT300_AlphaT0p52_v4","HLT_HT300_AlphaT0p52_v5","HLT_HT300_AlphaT0p53_v5","HLT_HT300_AlphaT0p53_v6","HLT_HT300_AlphaT0p53_v6","HLT_HT300_AlphaT0p54_v5","HLT_HT350_AlphaT0p51_v1","HLT_HT350_AlphaT0p51_v2","HLT_HT350_AlphaT0p51_v3","HLT_HT350_AlphaT0p51_v4","HLT_HT350_AlphaT0p51_v5","HLT_HT350_AlphaT0p52_v1","HLT_HT350_AlphaT0p52_v2","HLT_HT350_AlphaT0p52_v2","HLT_HT350_AlphaT0p53_v10","HLT_HT400_AlphaT0p51_v1","HLT_HT400_AlphaT0p51_v2","HLT_HT400_AlphaT0p51_v3","HLT_HT400_AlphaT0p51_v4","HLT_HT400_AlphaT0p51_v5","HLT_HT400_AlphaT0p51_v6","HLT_HT400_AlphaT0p51_v7","HLT_HT400_AlphaT0p51_v7","HLT_HT400_AlphaT0p51_v10"] triggers = ["HLT_HT250_v5"] CheckPreOverLapsOp = CheckPreOverLaps() # for trig in triggers: # op = JSONOutput("%s"%(trig)) # trigCut = CheckTrigExists( PSet(TrigExistsList = ["%s"%(trig)]).ps() ) # trigCut = OP_MultiTrigger( PSet(Verbose = True,UsePreScaledTriggers = True,Triggers = ["%s"%(trig)] ).ps() ) # cutTreeData.TAttach(json,trigCut) # cutTreeData.TAttach(trigCut,skim) # cutTreeData.TAttach(trigCut,op) # out.append(trigCut) # out.append(op) # cutTreeData.TAttach(json,badEvents) # cutTreeData.FAttach(badEvents,json_lost)
conf.Common.Jets.EtaCut = 5.0 conf.Common.Muons.EtaCut = 2.4 conf.Common.Muons.PtCut = 15.0 conf.Common.Muons.TrkIsoCut = -1. conf.Common.Muons.CombIsoCut = 0.1 conf.Common.Electrons.PtCut = 15.0 conf.Common.Electrons.EtaCut = 2.4 conf.Common.Photons.EtCut = 30. conf.Common.Electrons.ApplyID = False # Create the analysis a = Analysis("KinCorrection") tree = Tree("Main") Trigger = PSet(McAnal=False, MSugraScan=0., TriggerBits=PSet(bit1="")) ssdlTrigg = SSDLTrigger("Trigger", Trigger.ps()) ZeroMuons = OP_NumComMuons("==", 0) KinCorrParPlus = PSet( zMassMin=71., zMassMax=111., BarrelEtaMax=1.4442, EndCapEtaMin=1.56, EndCapEtaMax=2.5, MinElecRescaledPt=0., c_ErNu_pt=0., wID=+24., ##24 W+, -24 W- mW=80.398, mZ=90.188, ElecET=20.0,
StandardPlots = True, ) pset5 = PSet( DirName = "AllCutsTriggerFail", MinObjects = 0, MaxObjects = 15, StandardPlots = True, ) pset6 = PSet( DirName = "AllTriggerFail", MinObjects = 0, MaxObjects = 15, StandardPlots = True, ) AllNoTrigger = WeeklyUpdatePlots(pset1.ps()) AllWithTrigger =WeeklyUpdatePlots(pset2.ps()) AllCutsNoTrigger = WeeklyUpdatePlots(pset3.ps()) AllCutsAfterTrigger =WeeklyUpdatePlots( pset4.ps() ) AllCutsTriggerFail = WeeklyUpdatePlots(pset5.ps()) AllTriggerFail = WeeklyUpdatePlots(pset6.ps()) alphaTnumbers150 = TriggerEffPlots( PSet(DirName = "alphaTnumbers150",MinObjects =0 ,MaxObjects = 15,EffPlots = True).ps() ) alphaTnumbers200 = TriggerEffPlots( PSet(DirName = "alphaTnumbers200",MinObjects =0 ,MaxObjects = 15,EffPlots = True).ps() ) alphaTnumbers250 = TriggerEffPlots( PSet(DirName = "alphaTnumbers250",MinObjects =0 ,MaxObjects = 15,EffPlots = True).ps() ) alphaTnumbers300 = TriggerEffPlots( PSet(DirName = "alphaTnumbers300",MinObjects =0 ,MaxObjects = 15,EffPlots = True).ps() ) alphaTnumbers350 = TriggerEffPlots( PSet(DirName = "alphaTnumbers350",MinObjects =0 ,MaxObjects = 15,EffPlots = True).ps() ) alphaTnumbers400 = TriggerEffPlots( PSet(DirName = "alphaTnumbers400",MinObjects =0 ,MaxObjects = 15,EffPlots = True).ps() ) alphaTnumbers450 = TriggerEffPlots( PSet(DirName = "alphaTnumbers450",MinObjects =0 ,MaxObjects = 15,EffPlots = True).ps() ) alphaTnumbers500 = TriggerEffPlots( PSet(DirName = "alphaTnumbers500",MinObjects =0 ,MaxObjects = 15,EffPlots = True).ps() )
# ----------------------------------------------------------------------------- # User Variables SelectedJetCuts = PSet( Et = 80., DeltaR = 0.4 ) SelectedPhotonCuts = PSet( Et = 80., EtaEBMax = 1.4442, EtaEEMin = 1.56, EtaEEMax = 2.5, IDReq = 3 ) selected_jets = SelectedJets(SelectedJetCuts.ps()) selected_photons = SelectedPhotons(SelectedPhotonCuts.ps()) # ----------------------------------------------------------------------------- # Cut/Filter Operations Trigger_PSet = PSet( Triggers = [ "HLT_Photon70_CaloIdL_HT300_v1", "HLT_Photon70_CaloIdL_HT300_v2", "HLT_Photon70_CaloIdL_HT300_v3", "HLT_Photon70_CaloIdL_HT350_v3", "HLT_Photon70_CaloIdL_HT350_v4", "HLT_Photon70_CaloIdL_HT350_v5", "HLT_Photon70_CaloIdL_HT350_v6", "HLT_Photon70_CaloIdL_HT350_v7"
DalitzMT2 = False, Development = True, ) pset2 = PSet( DirName = "MET Plots N>2", MinObjects = 2, MaxObjects = 10, Mt2DiJet = False, Mt2Multi_Jet = False, Mt2Compare = False, MHT = False, DalitzMT2 = False, Development = True, ) PlotsMetG3 = BrynPlottingOps( pset2.ps() ) PlotsMetEq2 = BrynPlottingOps( pset1.ps() ) hadset = PSet( DirName = "Hadronic", MinObjects = 2, MaxObjects = 10, Verbose = False, Summary = False, CC = False, Dalitz = False, AlphaT = False, PtHat = False, MET = False, Kine = False, Response = False,
TauSource=conf.Ntuple.Taus.Prefix, tauIDbyIso = IsoTightTau, # tauIDbyDecay = True, AgainstElectron = True, AgainstMuon = True ) ele_id = PSet( Cuts = lepconf.ele_ptThres_vbtf80, ) muon_id = PSet(#we're missing the ecalvetoDep and hcalvetoDep in the ntuples (for MIP requirement) - AGB 22/10/10 Cuts = lepconf.muonCuts, ) elecSelFilter=CustomEleId(ele_id.ps()) muonSelFilter=CustomMuonId(muon_id.ps()) tauSelFilter=CustomTauId(tau_id.ps()) muelfilter=MuonElectronDrFilter(0.1) eletaufilter=ElectronTauDrFilter(0.1) mutaufilter=MuonTauDrFilter(0.1) elejetfilter=ElectronJetDrFilter(0.4) muonjetfilter=MuonJetDrFilter(0.4) taujetfilter=TauJetDrFilter(0.1) # Create the analysis a=Analysis("TauFR")
numComPhotons = OP_NumComPhotons("<=",0) # ----------------------------------------------------------------------------- # Test module from allhadronic.algorithms_cfi import * ps = PSet( Verbose = False, AlphaT = [0.55], DirName = "Test", nMax = 6, Algorithms = AlgorithmsPSet, ) test = Scaling(ps.ps()) # ----------------------------------------------------------------------------- # Cut flow cut_flow = Tree("MC") cut_flow.Attach(selection) cut_flow.TAttach(selection,numComPhotons) cut_flow.TAttach(numComPhotons,oddPhoton) cut_flow.TAttach(oddPhoton,numComElectrons) cut_flow.TAttach(numComElectrons,oddElectron) cut_flow.TAttach(oddElectron,numComMuons) cut_flow.TAttach(numComMuons,oddMuon) cut_flow.TAttach(oddMuon,test) # -----------------------------------------------------------------------------
"HLT_HT250_v3", "HLT_HT250_v4", "HLT_HT250_v5", "HLT_HT250_v6", ]) Cross_Trigger_PS = PSet(Verbose=False, Triggers=[ "HLT_HT250_AlphaT0p53_v1", "HLT_HT250_AlphaT0p53_v2", "HLT_HT250_AlphaT0p53_v3", "HLT_HT250_AlphaT0p53_v4", "HLT_HT250_AlphaT0p53_v5", ]) HT_Trigger_Filter = OP_MultiTrigger(HT_Trigger_PS.ps()) Cross_Trigger_Filter = OP_MultiTrigger(Cross_Trigger_PS.ps()) #Standard Event Selection LeadingJetEta = OP_FirstJetEta(2.5) unCorLeadJetCut = OP_UnCorLeadJetCut(0.) LeadingJetCut = OP_FirstJetPtCut(10.) oddMuon = OP_OddMuon() oddElectron = OP_OddElectron() oddPhoton = OP_OddPhoton() oddJet = OP_OddJet() secondJetET = OP_SecondJetEtCut(100.) badMuonInJet = OP_BadMuonInJet() numComLeptons = OP_NumComLeptons("<=", 0) numComPhotons = OP_NumComPhotons("<=", 0)
PSet( DirName="Dalitz_350", MinObjects=2, MaxObjects=10, Verbose=False, Summary=False, CC=False, Dalitz=True, AlphaT=False, PtHat=False, MET=False, Kine=False, Response=False, ).ps()) HadStandard250_350 = WeeklyUpdatePlots(pset1.ps()) HadStandard300 = WeeklyUpdatePlots(pset2.ps()) HadStandard350 = WeeklyUpdatePlots(pset3.ps()) HadStandard350_after_DeadEcal = WeeklyUpdatePlots(pset5.ps()) HadStandardAll = WeeklyUpdatePlots(pset4.ps()) nHadStandard250_350 = WeeklyUpdatePlots(Npset1.ps()) nHadStandard300 = WeeklyUpdatePlots(Npset2.ps()) nHadStandard350 = WeeklyUpdatePlots(Npset3.ps()) nHadStandardAll = WeeklyUpdatePlots(Npset4.ps()) nHadStandard350_after_DeadEcal = WeeklyUpdatePlots(Npset5.ps()) # Common cut definitions #Avaiable criteria for MC and for Data are at current slightly different Hence the making of two trees #DataOnly! from icf.JetCorrections import * corPset = CorrectionPset("ResidualJetEnergyCorrections.txt")
# PlotsCommonBasic pset1 = PSet( DirName="MT2", MinObjects=2, MaxObjects=10, Mt2DiJet=False, Mt2Multi_Jet=False, Mt2Compare=False, MHT=False, DalitzMT2=False, Development=False, TriggerStudies=True, ) TriggerPlots = BrynPlottingOps(pset1.ps()) # ----------------------------------------------------------------------------- # Cut flow #Cut flow for Data cutTreeData = Tree("Data") cutTreeData.Attach(NoiseFilt) cutTreeData.TAttach(NoiseFilt, selection) cutTreeData.TAttach(selection, HTCut) cutTreeData.TAttach(HTCut, TriggerPlots) def addCutMCFlow(a): a += cutTreeMC
# ----------------------------------------------------------------------------- # Test module from allhadronic.algorithms_cfi import * ps = PSet( Verbose=False, DirName="Triggers", nMin=2, nMax=4, Algorithms=AlgorithmsPSet, Filters=["HLT_HT???_v*", "HLT_HT???_MHT??_v*", "HLT_HT???_AlphaT*_v*"], Versus=2, ) test = Trigger(ps.ps()) # ----------------------------------------------------------------------------- # Cut flow #JsonFileOption = "/allhadronic/python/Cert_160404-166861_7TeV_PromptReco_Collisions11_JSON.txt" #JsonFileOption = "/allhadronic/python/Cert_160404-166502_7TeV_PromptReco_Collisions11_JSON.txt" JsonFileOption = "/allhadronic/python/Cert_160404-167151_7TeV_PromptReco_Collisions11_JSON.txt" json = JSONFilter("JSON", json_to_pset(pwd + JsonFileOption)) json_output = JSONOutput("_filtered") cut_flow = Tree("CutFlow") cut_flow.Attach(json) cut_flow.TAttach(json, json_output) cut_flow.TAttach(json_output, selection)
pseta = PSet( DirName = "FirTrig", MinObjects = 0, MaxObjects = 15, StandardPlots = True, ) psetb = PSet( DirName = "SecTrig", MinObjects = 0, MaxObjects = 15, StandardPlots = True, ) TriggerOnePlots = WeeklyUpdatePlots(pseta.ps()) TriggerTwoPlots = WeeklyUpdatePlots(psetb.ps()) StandardPlots = WeeklyUpdatePlots(pset2.ps()) # "HLT_HT360_v2", # "HLT_HT350_v2", # "HLT_HT350_v3", # "HLT_HT350_v2", # "HLT_HT350_v1", # "HLT_HT260_v2", # "HLT_HT240_v2", # "HLT_HT160_v2", # "HLT_HT250_MHT60_v2", # "HLT_HT200_AlphaT0p60_v1",
plots_objkin = OP_ObjKinPlots("ObjectKinePlots",100,6) plots_common = OP_CommonPlots("CommonPlots") plots_kinsuite = OP_KinSuiteComPlot("KinSuitePlots",6,2) pset1 = PSet( DirName = "MT2", MinObjects = 2, MaxObjects = 10, Mt2DiJet = False,#MT2 plots of Dijet system NOT USED HERE Mt2Multi_Jet = False,#As above for multiJet Mt2Compare = False,#Compares the above methods MHT = True, #Plots MHT Variables DalitzMT2 = False, # A testing/idea for putting MT2 in with Dalitz plots, also False Development = True, #Development area, here is where the JetMET PAS plots have been developed, Needs tidying, will be put in to a File of its own, for the moment everything you want will be in here ) plots_mt2 = BrynPlottingOps( pset1.ps() ) hadset = PSet( DirName = "Hadronic", MinObjects = 2, MaxObjects = 10, Verbose = False, Summary = False, CC = False, Dalitz = False, AlphaT = True, #Robs alphaT plots. PtHat = False, MET = False, Kine = False, Response = False,
ZeroPhotons = OP_NumComPhotons("<=", 0) OddPhot = OP_OddPhoton() GE2Jets = OP_NumComJets(">=", 2) OddJet = OP_OddJet() badMuonINJet = OP_BadMuonInJet() secondJetET = OP_SecondJetEtCut(30.) HTlep200 = RECO_LeptonicHTCut(200.) HTlep300 = RECO_LeptonicHTCut(300.) HTlep350 = RECO_LeptonicHTCut(350.) LepAlphaTCut = OP_LeptonicAlphaTCut(0.53) ed_all = OP_EventDisplay("ED_All", "all") #to draw all objects ed_com = OP_EventDisplay("ED_Com", "common") #to draw all objects eletree = AnalysisTree("eletree",tree_ele.ps()) mutree = AnalysisTree("mutree",tree_mu.ps()) mutree_iso = AnalysisTree("mutree_iso",tree_mu.ps()) tree = Tree("Main") # Main trunk of tree tree.Attach(MuonTreeReq) tree.TAttach(MuonTreeReq,mutree_iso) tree.TAttach(mutree_iso,OneMuon) tree.TAttach(OneMuon,MaxPtCut) tree.TAttach(MaxPtCut,HTlep200) tree.TAttach(HTlep200,LepAlphaTCut) tree.TAttach(LepAlphaTCut,ed_all) tree.TAttach(ed_all,ed_com) PF_MU_ID = PFMuId(pf_mu_id.ps())
OddMu = OP_OddMuon() MuJetVeto = OP_MuJetVeto(0.3) ZeroPhotons = OP_NumComPhotons("<=", 0) OddPhot = OP_OddPhoton() GE2Jets = OP_NumComJets(">=", 2) OddJet = OP_OddJet() badMuonINJet = OP_BadMuonInJet() secondJetET = OP_SecondJetEtCut(30.) HTlep200 = RECO_LeptonicHTCut(200.) HTlep300 = RECO_LeptonicHTCut(300.) HTlep350 = RECO_LeptonicHTCut(350.) LepAlphaTCut = OP_LeptonicAlphaTCut(0.55) eletree = AnalysisTree("eletree",tree_ele.ps()) mutree = AnalysisTree("mutree",tree_mu.ps()) #blah = Tree("Main") #blah.Attach(eletree) tree = Tree("Main") # Main trunk of tree tree.Attach(EleTreeReq) tree.TAttach(EleTreeReq,eletree) customMuID = CustomVBTFMuID(mu_id.ps()) #customMuID=CustomMuId(0.2, 11, 10) eleS=CustomEleId(sig_id.ps()) eleB=CustomEleId(bg_id.ps())
default_common.Photons.UseID = True # the photon cuts are NOT read anyway # default_common.Photons.TrkIsoRel=0. # default_common.Photons.TrkIsoCut=99999. # default_common.Photons.EcalIsoRel=0. # default_common.Photons.EcalIsoCut=99999. # default_common.Photons.HcalIsoRel=0. # default_common.Photons.HcalIsoCut=99999. # default_common.Photons.HadOverEmCut=0.5 # default_common.Photons.SigmaIetaIetaCut=0.5 ##default_common.Photons.CaloIsoCut=99999. default_common.Photons.IDReq = 3 default_common.Photons.RequireLooseForOdd = True skim_ps = PSet(SkimName="myskim", DropBranches=False, Branches=[" keep * "]) skim = SkimOp(skim_ps.ps()) #Plot the common plots! genericPSet = PSet( DirName="275_325Gev", MinObjects=1, MaxObjects=15, StandardPlots=True, minDR=0.4, mCut=2.0, ) def makePlotOp(OP=(), cutTree=None, cut=None, label=""): """docstring for makePlotOp"""
Verbose = False, UsePreScaledTriggers = False, Triggers = [ "HLT_HT250_AlphaT0p55_v1", "HLT_HT250_AlphaT0p55_v2", "HLT_HT250_AlphaT0p53_v2", "HLT_HT250_AlphaT0p53_v3", "HLT_HT250_AlphaT0p53_v4", "HLT_HT250_AlphaT0p53_v5", "HLT_HT250_AlphaT0p55_v2", "HLT_HT250_AlphaT0p58_v3", "HLT_HT250_AlphaT0p60_v3", ] ) MuTrigger = OP_MultiTrigger(mutriggerps.ps()) #=========================================== #============ Plotting Ops ======================= generic_pset = PSet( DirName = "MuonAnalysis", FolderName = "Muon275" ) skim_ps=PSet( SkimName = "myskim", DropBranches = False, Branches = [ " keep * " ] )
# default_common.Photons.HadOverEmCut=0.5 # default_common.Photons.SigmaIetaIetaCut=0.5 ##default_common.Photons.CaloIsoCut=99999. default_common.Photons.IDReq = 3 default_common.Photons.RequireLooseForOdd = True Events = PSet( Run =[160939,160955,160957,160957,162811,162811,162909,162909,163046,163069,163069,163069,163071,163071,163071,163078,163078,163235,163235,163235,163235,163235,163235,163235,163255,163255,163255,163255,163255,163261,163261,163270,163270,163270,163270,163270,163270,163270,163270,163270,163270,163270,163270,163270,163270,163270,163270,163270,163286,163286,163286,163286,163286,163296,163296,163296,163296,163297,163297,163297,163300,163300,163300,163300,163300,163300,163300,163301,163301,163302,163302,163302,163302,163302,163302,163332,163332,163332,163332,163332,163332,163333,163334,163334,163334,163334,163334,163337,163337,163337,163337,163337,163337,163338,163338,163339,163339,163339,163340,163340,163340,163340,163340,163369,163370,163370,163371,163371,163371,163374,163374,163374,163374,163374,163374,163374,163376,163376,163376,163376,163378,163378,163378,163378,163378,163385,163385,163385,163387,163402,163402,163402,163402,163402,163402,163402,163402,163402,163475,163475,163475,163475,163475,163476,163476,163476,163479,163480,163482,163483,163583,163583,163583,163583,163586,163586,163588,163588,163588,163588,163588,163589,163589,163630,163657,163657,163659,163659,163659,163659,163659,163659,163659,163659,163659,163659,163659,163659,163659,163659,163659,163660,163660,163660,163661,163662,163662,163662,163664,163668,163668,163738,163738,163738,163738,163738,163738,163738,163758,163758,163758,163758,163758,163758,163758,163758,163758,163759,163759,163759,163759,163759,163760,163760,163760,163760,163760,163760,163760,163765,163765,163765,163765,163765,163795,163796,163796,163796,163796,163796,163796,163796,163817,163817,163817,163817,163817,163817,163817,163817,163817,163817,163817,163817,163817,163817,163817,163817,163817,163817,163817,165121,165121,165121,165121,165205,165208,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165364,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165415,165472,165472,165472,165472,165472,165472,165472,165472,165472,165472,165472,165472,165472,165472,165472,165472,165472,165486,165486,165487,165487,165487,165506,165506,165506], Event = [24371951,18576870,96165671,491483557,91390314,125176731,48370161,65400245,119647477,107661306,265156983,25893970,56961763,38156147,48877189,6833339,4081021,63316951,17965714,183490182,220791530,228514066,28444848,33069964,95426489,101980751,239615748,304219363,400003395,55925035,60979586,133314497,200334760,205668936,215533223,255230619,259924803,282983988,293475492,305561898,342468785,348206909,394556047,399317868,418689254,50813748,489282865,505027103,93884489,97510916,108246660,161606268,162614748,104675948,189901294,333605114,52156625,22763918,56652154,4444230,57368030,5816503,107025374,138670755,191089040,219614010,228555655,5145145,86299370,89814612,92689113,15820394,18004679,22955850,48048119,182796843,229951639,290060361,310517723,334605324,453062228,21712494,116524826,169694364,182712860,263747194,269344428,61667010,73042788,111402754,130881024,146874823,4176096,19533169,41835038,4872222,76822473,40515999,4830513,60877125,16850617,200637251,29279251,7404160,89986633,48665006,161654590,166663172,52981357,67156409,177230370,242487385,349063851,375785727,378073345,381604121,80716296,23190414,35431342,35528644,56199361,58499014,126757726,166770991,1982546,136454635,213152538,41600744,25617613,65139186,113404298,186042589,294089105,348935564,359026121,402589263,35624459,479976713,83234226,88598161,150131089,193319870,44318680,110347959,3117371,57278411,4598210,5754166,4079087,9585045,126856305,165960555,21695548,41160080,10841564,36030982,137621860,162720793,168860940,185812235,293183271,55453063,63115578,76189444,12455810,5071047,99822371,104684639,110712786,185591256,194466360,218809820,24621131,256469811,27226115,300049345,375437326,380594303,399218272,419304899,496208715,20153888,2783995,40921027,693507,94830533,23177966,23950430,25050536,130748015,58368335,130926468,153349232,166379378,169183638,193537170,196931479,239901350,78306525,178588224,211524839,287243682,299874427,341969813,350570830,45063091,3354782,80917464,196972726,200893656,22548957,338699964,84895772,115506843,120288802,152683630,212944349,226711544,22637838,68673211,70541404,108574122,155024796,57070932,29194371,109508279,135236412,24000133,49641227,83624625,89854453,95897622,149299205,198315854,247061851,373312579,378084407,384623891,407058296,545248000,581734803,584317893,613490574,630579795,690340277,710876840,717817666,732789398,808113892,809391070,828622801,49191435,55002119,134938767,37485490,185695388,72542883,1184627074,1267860435,1358273514,1399958437,141284880,1477949824,1479075041,254428559,264185506,316591001,337725233,429993340,481026985,482153614,534253611,556171955,574817001,590583843,668793760,883140204,1291332300,1359273031,1410268779,113344188,1478044894,1485684156,1524657887,1573260343,251863772,450088973,479919143,504597781,516397079,542615397,556750519,667312880,708714244,751700331,39733972,774182048,816637188,955264961,133535097,173155335,14317087,18452039,305570274,436376807,468095459,483547880,717190088,841400997,879953987,885582991,897382077,902404476,941883006,957284610,98658826,35727889,79831820,136064858,76243949,77753094,141915838,146615579,50098607], Lumi = [47,57,181,915,201,277,105,130,202,220,481,93,104,70,90,14,9,122,35,363,441,457,55,64,136,146,355,457,613,104,113,212,321,329,346,414,422,461,483,503,567,577,660,668,705,80,836,865,245,252,274,388,390,174,303,532,99,40,97,9,105,12,197,257,357,413,431,11,165,178,184,32,36,46,95,276,342,428,457,493,673,36,198,292,315,458,468,116,138,211,248,279,9,41,86,11,147,78,11,120,34,402,58,12,135,73,275,284,84,123,330,458,675,726,730,737,164,48,73,73,119,124,270,358,5,236,365,85,47,107,176,283,449,537,553,625,65,756,124,131,213,272,73,160,6,82,8,10,8,18,165,217,29,53,16,50,201,238,247,273,437,81,91,154,16,8,128,135,142,242,254,286,32,338,35,400,512,519,546,576,693,32,5,64,2,125,31,32,39,209,92,159,186,202,206,236,240,294,104,240,285,403,421,483,495,61,6,123,285,290,35,476,121,167,174,221,309,330,33,112,115,177,255,94,32,113,140,25,51,86,93,99,168,216,264,392,397,404,427,584,624,627,658,677,744,772,780,797,883,885,907,128,143,351,97,213,82,1007,1088,1169,1202,121,1267,1268,206,213,254,270,344,385,386,428,446,461,474,540,725,1094,1149,1191,119,1247,1253,1286,1328,224,384,409,430,439,462,474,568,604,644,64,664,702,832,115,149,14,18,268,386,416,430,620,717,747,752,761,765,797,809,85,41,73,106,61,62,150,153,78] ) evFilter = OP_RunLumiEvSelector(Events.ps()) # ----------------------------------------------------------------------------- skim_ps=PSet( SkimName = "myskim", DropBranches = False, Branches = [ " keep * " ] ) skim = SkimOp(skim_ps.ps()) #Plot the common plots!
numComMuons = OP_NumComMuons("<=", 0) numComPhotons = OP_NumComPhotons("<=", 0) # ----------------------------------------------------------------------------- # Test module from allhadronic.algorithms_cfi import * ps = PSet( Verbose=False, AlphaT=[0.55], DirName="Test", nMax=6, Algorithms=AlgorithmsPSet, ) test = Scaling(ps.ps()) # ----------------------------------------------------------------------------- # Cut flow cut_flow = Tree("MC") cut_flow.Attach(selection) cut_flow.TAttach(selection, numComPhotons) cut_flow.TAttach(numComPhotons, oddPhoton) cut_flow.TAttach(oddPhoton, numComElectrons) cut_flow.TAttach(numComElectrons, oddElectron) cut_flow.TAttach(oddElectron, numComMuons) cut_flow.TAttach(numComMuons, oddMuon) cut_flow.TAttach(oddMuon, test) # -----------------------------------------------------------------------------
class eWPol: def __init__(self, data, loose_id, tight_id, trigger_bits = ( "HLT_Ele10_LW_L1R", # run < 140041 "HLT_Ele15_SW_L1R", # run <= 143962 "HLT_Ele15_SW_CaloEleId_L1R", # run <= 146427 "HLT_Ele17_SW_CaloEleId_L1R", # run <= 147116 "HLT_Ele17_SW_TightEleId_L1R", # run <= 148818 "HLT_Ele22_SW_TighterEleId_L1R_v2", # run <= 149180 "HLT_Ele22_SW_TighterEleId_L1R_v3" # run >= 149181 ), pf_mht = True, mht_cuts = [50, 75, 100 ], met_cuts = [10, 20, 30, 40], mt_cuts = [30, 50, 70], lepton_type = "Electron", ele_jet_dr = 0.3, lep_ptcut = 25., name = "eWPol", ignore_gen = False, event_no_dump = True ): self.name = name self.jet_dr = wpol.EleJetDRFilter(ele_jet_dr) self.loose_ele_id = wpol.CustomEleId(loose_id.ps()) self.tight_ele_id = wpol.CustomEleId(tight_id.ps()) self.lep_pt_cut = lep_ptcut self.pol_plots_cfg = PSet( DoGen = not (data or ignore_gen), LeptonType = lepton_type, METThreshold = 40., NLeptons = 1 ) self.ops = [] # Basic event selection triggers = PSet(Triggers=trigger_bits) self.ops.append(("basic_plots_pretrig", wpol.eWPolBasicPlots("eWPolBasicPlots_PreTrigger", self.pol_plots_cfg.ps()))) self.ops.append(("trigger", fwk.OP_MultiTrigger( triggers.ps() ))) self.ops.append(("basic_plots_posttrig", wpol.eWPolBasicPlots("eWPolBasicPlots_PostTrigger", self.pol_plots_cfg.ps()))) self.ops.append(("good_events", fwk.OP_GoodEventSelection())) # Basic object cuts self.ops.append(("datamc_one_ele", wpol.DataMCPlots("RECO_DataMCPlots_OneEle"))) self.ops.append(("one_ele", fwk.OP_NumComElectrons("==", 1))) self.ops.append(("basic_plots_gteqoneele", wpol.eWPolBasicPlots("eWPolBasicPlots_GTEQOneEle", self.pol_plots_cfg.ps()))) self.ops.append(("good_ele", wpol.ApplyLeptonCut(lepton_type, lep_ptcut, self.tight_ele_id, 1, True))) self.ops.append(("datamc_one_wp70_ele", wpol.DataMCPlots("RECO_DataMCPlots_OneWP70Ele"))) self.ops.append(("three_charge", wpol.ChargeAgreement())) self.ops.append(("basic_plots_oneele", wpol.eWPolBasicPlots("eWPolBasicPlots_OneEle", self.pol_plots_cfg.ps()))) # self.ops.append(("z_mass", wpol.MassWindowCut(lepton_type, # PSet( MassLower = 76., # MassUpper = 106., # MatchCharge = True, # NetCharge = 0).ps() ))) self.ops.append(("zero_mu", fwk.OP_NumComMuons("==", 0))) self.ops.append(("lt4_jets", fwk.OP_NumComJets("<", 4))) self.ops.append(("pol_plots_premht", wpol.RECO_ElPolPlots( "RECO_ElPolPlots_PreMHT", self.pol_plots_cfg.ps()))) # Pre MHT Cut self.ops.append(("basic_plots_premht", wpol.eWPolBasicPlots("eWPolBasicPlots_PreMHT", self.pol_plots_cfg.ps()))) # self.ops.append(("datamc_plots_premht", wpol.DataMCPlots( # "RECO_DataMCPlots_PreMHT2"))) # MHT Cuts and plots self.mht_cuts = {} self.pol_plots = {} self.datamc_plots = {} for mht in mht_cuts: if pf_mht: self.mht_cuts[mht] = wpol.OP_PFMHTCut(mht) else: self.mht_cuts[mht] = fwk.RECO_CommonMHTCut(mht) self.pol_plots["mht%d" % mht] = wpol.RECO_ElPolPlots( "RECO_ElPolPlots_PostMHT%d" % mht, self.pol_plots_cfg.ps()) self.datamc_plots["mht%d" % mht] = wpol.DataMCPlots( "RECO_DataMCPlots_PostMHT%d" % mht) # MET Cuts and plots self.met_cuts = {} for mht in mht_cuts: for met in met_cuts: self.met_cuts[(mht, met)] = fwk.OP_PFMETCut(met) self.pol_plots["mht%d_met%d" % (mht, met)] = wpol.RECO_ElPolPlots( "RECO_ElPolPlots_PostMHT%dMET%d" % (mht, met), self.pol_plots_cfg.ps()) # MT Cuts and plots self.mt_cuts = {} for mht in mht_cuts: for mt in mt_cuts: self.mt_cuts[(mht, mt)] = wpol.ePFMTCut(lepton_type, mt) self.pol_plots["mht%d_mt%d" % (mht, mt)] = wpol.RECO_ElPolPlots( "RECO_ElPolPlots_PostMHT%dMT%d" % (mht, mt), self.pol_plots_cfg.ps()) self.datamc_plots["mht%d_mt%d" % (mht, mt)] = wpol.DataMCPlots( "RECO_DataMCPlots_PostMHT%dMT%d" % (mht, mt)) self.cuts = {} self.tree = fwk.Tree(self.name) if event_no_dump: self.event_no_dump = wpol.EventNoDump("EventNoDump_MT50", "event_no") def buildTree(self, basic_plots=True, pol_plots=True, vetos = [], tree = None, root_op = None): if tree is None: tree = self.tree veto_list = vetos if not basic_plots: veto_list.append("basic_plots") if not pol_plots: veto_list.append("pol_plots") ops_ = [] for name, op in self.ops: veto = False print name for v in vetos: if name.startswith(v): print "Removing operation '%s' from tree" % name veto = True if not veto: ops_.append((name, op)) if root_op is None: tree.Attach(ops_[0][1]) else: tree.TAttach(root_op, ops_[0][1]) idx = 1 for name, op in ops_[1:]: tree.TAttach(ops_[idx-1][1], op) idx += 1 for mht, mht_op in self.mht_cuts.iteritems(): tree.TAttach(ops_[idx-1][1], mht_op) if pol_plots: tree.TAttach(mht_op, self.pol_plots["mht%d" % mht]) tree.TAttach(mht_op, self.datamc_plots["mht%d" % mht]) for (mht, met), met_op in self.met_cuts.iteritems(): tree.TAttach(self.mht_cuts[mht], met_op) if pol_plots: tree.TAttach(met_op, self.pol_plots["mht%d_met%d" % (mht, met)]) for(mht, mt), mt_op in self.mt_cuts.iteritems(): tree.TAttach(self.mht_cuts[mht], mt_op) if pol_plots: tree.TAttach(mt_op, self.pol_plots["mht%d_mt%d" % (mht, mt)]) tree.TAttach(mt_op, self.datamc_plots["mht%d_mt%d" % (mht, mt)]) # Fringe hack if mht == 50 and self.event_no_dump is not None: tree.TAttach(mt_op, self.event_no_dump) def installFilters(self, a): a.AddElectronFilter("PostCC", self.loose_ele_id) a.AddJetFilter("PostCC", self.jet_dr) def GetOp(self, name): for n, o in self.ops: if n == name: return o return None
numComPhotons = OP_NumComPhotons("<=", 0) # ----------------------------------------------------------------------------- # Test module from allhadronic.algorithms_cfi import * ps = PSet( Verbose=False, AlphaT=[0.55], DirName="QcdBkgdEst", nMin=2, nMax=10, Algorithms=AlgorithmsPSet, ) test = Validation(ps.ps()) # ----------------------------------------------------------------------------- # Cut flow cut_flow = Tree("CutFlow") cut_flow.Attach(selection) if (True): # Data only cut_flow.TAttach(selection, NoiseFilt) cut_flow.TAttach(NoiseFilt, numComPhotons) else: cut_flow.TAttach(selection, numComPhotons) cut_flow.TAttach(numComPhotons, oddPhoton) cut_flow.TAttach(oddPhoton, numComElectrons) cut_flow.TAttach(numComElectrons, oddElectron) cut_flow.TAttach(oddElectron, numComMuons)
mSuGraScanPlots_before_250_pset = PSet(DirectoryName = "mSuGraScan_before_250") mSuGraScanPlots_before_350_pset = PSet(DirectoryName = "mSuGraScan_before_350") mSuGraScanPlots_150_pset = PSet(DirectoryName = "mSuGraScan_150") mSuGraScanPlots_250_pset = PSet(DirectoryName = "mSuGraScan_250") mSuGraScanPlots_350_pset = PSet(DirectoryName = "mSuGraScan_350") #Bkgd Estimation Plots TanjaBkgdEstPlots_g1jets = PSet(DirectoryName = "BkgdEstPlots_g1jets", MinObjects=2, MaxObjects=9, m0_felder=0, m12_felder=0 ) plots_bkgdEstPlots_g1jets = OP_BkgdEstPlottingOps( TanjaBkgdEstPlots_g1jets.ps() ) TanjaBkgdEstPlots_2jets = PSet(DirectoryName = "BkgdEstPlots_2jets", MinObjects=2, MaxObjects=2, m0_felder=0, m12_felder=0 ) plots_bkgdEstPlots_2jets = OP_BkgdEstPlottingOps( TanjaBkgdEstPlots_2jets.ps() ) TanjaBkgdEstPlots_g2jets = PSet(DirectoryName = "BkgdEstPlots_g2jets", MinObjects=3, MaxObjects=7, m0_felder=0, m12_felder=0 )
StandardPlots=True, ) pset5 = PSet( DirName="AllCutsTriggerFail", MinObjects=0, MaxObjects=15, StandardPlots=True, ) pset6 = PSet( DirName="AllTriggerFail", MinObjects=0, MaxObjects=15, StandardPlots=True, ) AllNoTrigger = WeeklyUpdatePlots(pset1.ps()) AllWithTrigger = WeeklyUpdatePlots(pset2.ps()) AllCutsNoTrigger = WeeklyUpdatePlots(pset3.ps()) AllCutsAfterTrigger = WeeklyUpdatePlots(pset4.ps()) AllCutsTriggerFail = WeeklyUpdatePlots(pset5.ps()) AllTriggerFail = WeeklyUpdatePlots(pset6.ps()) alphaTnumbers150 = TriggerEffPlots( PSet(DirName="alphaTnumbers150", MinObjects=0, MaxObjects=15, EffPlots=True).ps()) alphaTnumbers200 = TriggerEffPlots( PSet(DirName="alphaTnumbers200", MinObjects=0, MaxObjects=15,
badMuonInJet = OP_BadMuonInJet() photonKilledJet = OP_PhotonKilledJet() secondJetET = OP_SecondJetEtCut(100) htCut = RECO_CommonHTCut(350) missedHT = OP_MissedHTCut(1.25) HadAlphaT = OP_HadronicAlphaT(0.55) HadronicPlottingOps = PSet( DirectoryName="Hadronic", MinObjects=2, MaxObjects=10, Dalitz=True, AlphaT=False, PtHat=False, ) myplots = OP_HadronicPlottingOps(HadronicPlottingOps.ps()) def addCutFlow(a): a += numComLeptons a += numComJets a += numComPhotons a += oddElectron a += oddMuon a += oddJet a += oddPhoton a += badMuonInJet a += photonKilledJet a += secondJetET a += htCut a += missedHT
pset350plus_afterDeadEcal_3om = deepcopy(pset_3om) pset350plus_afterDeadEcal_3om.DirName = "350GeV_afterDeadEcal_3om" #after all cuts pset350plus_afterAllCuts_2om = deepcopy(pset_2om) pset350plus_afterAllCuts_2om.DirName = "350GeV_afterAllCuts_2om" # pset350plus_afterAllCuts_2eq = deepcopy(pset_2eq) pset350plus_afterAllCuts_2eq.DirName = "350GeV_afterAllCuts_2eq" # pset350plus_afterAllCuts_3om = deepcopy(pset_3om) pset350plus_afterAllCuts_3om.DirName = "350GeV_afterAllCuts_3om" #plot operations #attach after >250GeV cut plotGtHT250_2om = WeeklyUpdatePlots(pset_2om.ps()) plotGtHT250_2eq = WeeklyUpdatePlots(pset_2eq.ps()) plotGtHT250_3om = WeeklyUpdatePlots(pset_3om.ps()) #attach after 250GeV < HT < 300GeV && dead ecal: plotHT250_300_deadECAL_2om = WeeklyUpdatePlots(pset250_300_2om.ps()) plotHT250_300_deadECAL_2eq = WeeklyUpdatePlots(pset250_300_2eq.ps()) plotHT250_300_deadECAL_3om = WeeklyUpdatePlots(pset250_300_3om.ps()) #attach after 300GeV < HT < 350GeV && dead ecal: plotHT300_350_deadECAL_2om = WeeklyUpdatePlots(pset300_350_2om.ps()) plotHT300_350_deadECAL_2eq = WeeklyUpdatePlots(pset300_350_2eq.ps()) plotHT300_350_deadECAL_3om = WeeklyUpdatePlots(pset300_350_3om.ps()) #attach after HT > 350GeV && dead ecal plotGtHT350_deadECAL_2om = WeeklyUpdatePlots(
numComJetsEq2 = OP_NumComJets("==", 2) numComJetsGeq = OP_NumComJets(">=", 3) #JetTrigger = OP_TriggerCut("HLT_HT100U") #new trigger operations (TW) #This will be changing in the new run to the HLT_HTXXX_AlphaT0pYY triggers datatriggerps = PSet(Verbose=False, Triggers=[ "HLT_HT100U", "HLT_HT120U", "HLT_HT140U", "HLT_HT150U_v3", "HLT_HT160U_v1", "HLT_HT160U_v3", ]) DataTrigger = OP_HadronicDataTrigger(datatriggerps.ps()) #MC trigger - uses second jet collection (IC5, uncorrected) to act as trigger emulator. mctriggerps = PSet( Verbose=False, JetPtCut=20., HTCut=140., ) mcTrigger = OP_HadronicMCTrigger(mctriggerps.ps()) #NoiseFilt = OP_HadronicHBHEnoiseFilter() NoiseFilt = OP_HadronicHBHEnoiseFilter() VertexPtOverHT = OP_SumVertexPtOverHT(0.1) #Standard Event Selection selection = OP_GoodEventSelection()
def __init__(self, data, loose_id, tight_id, trigger_bits = ( "HLT_Ele10_LW_L1R", # run < 140041 "HLT_Ele15_SW_L1R", # run <= 143962 "HLT_Ele15_SW_CaloEleId_L1R", # run <= 146427 "HLT_Ele17_SW_CaloEleId_L1R", # run <= 147116 "HLT_Ele17_SW_TightEleId_L1R", # run <= 148818 "HLT_Ele22_SW_TighterEleId_L1R_v2", # run <= 149180 "HLT_Ele22_SW_TighterEleId_L1R_v3" # run >= 149181 ), pf_mht = True, mht_cuts = [50, 75, 100 ], met_cuts = [10, 20, 30, 40], mt_cuts = [30, 50, 70], lepton_type = "Electron", ele_jet_dr = 0.3, lep_ptcut = 25., name = "eWPol", ignore_gen = False, event_no_dump = True ): self.name = name self.jet_dr = wpol.EleJetDRFilter(ele_jet_dr) self.loose_ele_id = wpol.CustomEleId(loose_id.ps()) self.tight_ele_id = wpol.CustomEleId(tight_id.ps()) self.lep_pt_cut = lep_ptcut self.pol_plots_cfg = PSet( DoGen = not (data or ignore_gen), LeptonType = lepton_type, METThreshold = 40., NLeptons = 1 ) self.ops = [] # Basic event selection triggers = PSet(Triggers=trigger_bits) self.ops.append(("basic_plots_pretrig", wpol.eWPolBasicPlots("eWPolBasicPlots_PreTrigger", self.pol_plots_cfg.ps()))) self.ops.append(("trigger", fwk.OP_MultiTrigger( triggers.ps() ))) self.ops.append(("basic_plots_posttrig", wpol.eWPolBasicPlots("eWPolBasicPlots_PostTrigger", self.pol_plots_cfg.ps()))) self.ops.append(("good_events", fwk.OP_GoodEventSelection())) # Basic object cuts self.ops.append(("datamc_one_ele", wpol.DataMCPlots("RECO_DataMCPlots_OneEle"))) self.ops.append(("one_ele", fwk.OP_NumComElectrons("==", 1))) self.ops.append(("basic_plots_gteqoneele", wpol.eWPolBasicPlots("eWPolBasicPlots_GTEQOneEle", self.pol_plots_cfg.ps()))) self.ops.append(("good_ele", wpol.ApplyLeptonCut(lepton_type, lep_ptcut, self.tight_ele_id, 1, True))) self.ops.append(("datamc_one_wp70_ele", wpol.DataMCPlots("RECO_DataMCPlots_OneWP70Ele"))) self.ops.append(("three_charge", wpol.ChargeAgreement())) self.ops.append(("basic_plots_oneele", wpol.eWPolBasicPlots("eWPolBasicPlots_OneEle", self.pol_plots_cfg.ps()))) # self.ops.append(("z_mass", wpol.MassWindowCut(lepton_type, # PSet( MassLower = 76., # MassUpper = 106., # MatchCharge = True, # NetCharge = 0).ps() ))) self.ops.append(("zero_mu", fwk.OP_NumComMuons("==", 0))) self.ops.append(("lt4_jets", fwk.OP_NumComJets("<", 4))) self.ops.append(("pol_plots_premht", wpol.RECO_ElPolPlots( "RECO_ElPolPlots_PreMHT", self.pol_plots_cfg.ps()))) # Pre MHT Cut self.ops.append(("basic_plots_premht", wpol.eWPolBasicPlots("eWPolBasicPlots_PreMHT", self.pol_plots_cfg.ps()))) # self.ops.append(("datamc_plots_premht", wpol.DataMCPlots( # "RECO_DataMCPlots_PreMHT2"))) # MHT Cuts and plots self.mht_cuts = {} self.pol_plots = {} self.datamc_plots = {} for mht in mht_cuts: if pf_mht: self.mht_cuts[mht] = wpol.OP_PFMHTCut(mht) else: self.mht_cuts[mht] = fwk.RECO_CommonMHTCut(mht) self.pol_plots["mht%d" % mht] = wpol.RECO_ElPolPlots( "RECO_ElPolPlots_PostMHT%d" % mht, self.pol_plots_cfg.ps()) self.datamc_plots["mht%d" % mht] = wpol.DataMCPlots( "RECO_DataMCPlots_PostMHT%d" % mht) # MET Cuts and plots self.met_cuts = {} for mht in mht_cuts: for met in met_cuts: self.met_cuts[(mht, met)] = fwk.OP_PFMETCut(met) self.pol_plots["mht%d_met%d" % (mht, met)] = wpol.RECO_ElPolPlots( "RECO_ElPolPlots_PostMHT%dMET%d" % (mht, met), self.pol_plots_cfg.ps()) # MT Cuts and plots self.mt_cuts = {} for mht in mht_cuts: for mt in mt_cuts: self.mt_cuts[(mht, mt)] = wpol.ePFMTCut(lepton_type, mt) self.pol_plots["mht%d_mt%d" % (mht, mt)] = wpol.RECO_ElPolPlots( "RECO_ElPolPlots_PostMHT%dMT%d" % (mht, mt), self.pol_plots_cfg.ps()) self.datamc_plots["mht%d_mt%d" % (mht, mt)] = wpol.DataMCPlots( "RECO_DataMCPlots_PostMHT%dMT%d" % (mht, mt)) self.cuts = {} self.tree = fwk.Tree(self.name) if event_no_dump: self.event_no_dump = wpol.EventNoDump("EventNoDump_MT50", "event_no")
pset_standard_hadronic_goodAlphaT = deepcopy( pset_standard_hadronic_smallPFMET_noLowerLimit) pset_standard_hadronic_goodAlphaT.DirName = "HadronicCommon_goodAlphaT" pset_standard_hadronic_largeAlphaT = deepcopy( pset_standard_hadronic_smallPFMET_noLowerLimit) pset_standard_hadronic_largeAlphaT.DirName = "HadronicCommon_largeAlphaT" pset_standard_hadronic_smallAlphaT = deepcopy( pset_standard_hadronic_smallPFMET_noLowerLimit) pset_standard_hadronic_smallAlphaT.DirName = "HadronicCommon_smallAlphaT" plots_standardHadronic_beforeAlphaT = HadronicCommonPlots( pset_standard_hadronic_beforeAlphaT.ps()) plots_standardHadronic_smallPFMET_noLowerLimit = HadronicCommonPlots( pset_standard_hadronic_smallPFMET_noLowerLimit.ps()) plots_standardHadronic_smallPFMET = HadronicCommonPlots( pset_standard_hadronic_smallPFMET.ps()) plots_standardHadronic_PFMET_babyMHT = HadronicCommonPlots( pset_standard_hadronic_PFMET_babyMHT.ps()) plots_standardHadronic_PFMET_antibabyMHT = HadronicCommonPlots( pset_standard_hadronic_PFMET_antibabyMHT.ps()) plots_standardHadronic_largePFMET = HadronicCommonPlots( pset_standard_hadronic_largePFMET.ps()) plots_standardHadronic_alphaT051 = HadronicCommonPlots( pset_standard_hadronic_alphaT051.ps()) plots_standardHadronic_alphaT052 = HadronicCommonPlots( pset_standard_hadronic_alphaT052.ps()) plots_standardHadronic_alphaT053 = HadronicCommonPlots( pset_standard_hadronic_alphaT053.ps())
pset1 = PSet( DirName="TriggerPlots", MinObjects=0, MaxObjects=15, StandardPlots=True, ) pset2 = PSet( DirName="Standard Plots", MinObjects=0, MaxObjects=15, StandardPlots=True, ) StandardPlots = WeeklyUpdatePlots(pset2.ps()) TriggerPlots = PL_TriggerPlots(pset1.ps()) cutTreeMC = Tree("MC") cutTreeMC.Attach(selection) cutTreeMC.TAttach(selection, oddMuon) cutTreeMC.TAttach(oddMuon, oddElectron) cutTreeMC.TAttach(oddElectron, oddPhoton) cutTreeMC.TAttach(oddPhoton, numComLeptons) cutTreeMC.TAttach(numComLeptons, numComPhotons) cutTreeMC.TAttach(numComPhotons, LeadingJetEta) cutTreeMC.TAttach(LeadingJetEta, badMuonInJet) cutTreeMC.TAttach(badMuonInJet, oddJet) cutTreeMC.TAttach(oddJet, LeadingJetCut) cutTreeMC.TAttach(LeadingJetCut, secondJetET)
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ], ) test = TurnOn(ps.ps()) # ----------------------------------------------------------------------------- # Cut flow pwd = commands.getoutput('echo $SUSY_WORKING_SW_DIR') json = JSONFilter( "JSON", json_to_pset( pwd + "/allhadronic/python/Cert_160404-163869_7TeV_PromptReco_Collisions11_JSON.txt" )) cut_flow = Tree("CutFlow") cut_flow.Attach(json) cut_flow.TAttach(json, selection)
MaxGlbTrkDxy = 0.02, MinGlbTrkNumOfValidHits = 11, SegMatch2GlbMu = 1, PixelHitsOnInrTrk = 1, MaxInrTrkDz = 1. ) """ #======== Filters =========== from wpol.muon_config import muon_id # ,conf from ra1objectid.vbtfMuonId_cff import * from ra1objectid.vbtfElectronId_cff import * from ra1objectid.ra3PhotonId_cff import * vbtfElectronIdFilter = Electron_IDFilter( vbtfelectronidWP95ps.ps() ) ra3PhotonIdFilter = Photon_IDFilter( ra3photonidps.ps() ) muonfilt2 = OL_CustomVBTFMuID(mu_id.ps()) #muonfilt=CustomMuonId(muon_id.ps()) vbtMuonIdFilter = Muon_IDFilter( vbtfmuonidps.ps() ) #Cuts with Selction,HBHE,MHTovHT,CommonMHT,AlphaT 0.51 vertex_reweight = GoodVertexReweighting( PSet(GoodVertexWeights = [1.0, 0.071182041228993354, 0.3788533298983548, 0.70212224756460717, 0.95912926863057879, 1.1063323506805849, 1.1826257455177471, 1.2297382718782017, 1.2772830447358376, 1.4266446590805815, 1.5732065775636328, 1.8401056375971667, 2.1784909215394999, 2.506266882602076, 3.3335988825191176, 4.687787057503483, 6.8602191807881647, 11.198474011060968, 14.883466002768214, 20.878255333866864, 1.0, 1.0, 1.0, 1.0, 1.0]).ps()) default_common.Jets.PtCut=50*(275./375.) # Change depending on Muon or Had selection #default_cc.Muons.CombIsoCut=0.15 # Had #default_common.Muons.CombIsoCut=0.15 default_cc.Muons.CombIsoCut= 0.10 # Muon
PSet( DirName="Dalitz_350", MinObjects=2, MaxObjects=10, Verbose=False, Summary=False, CC=False, Dalitz=True, AlphaT=False, PtHat=False, MET=False, Kine=False, Response=False, ).ps()) HadStandard250_300 = HadronicCommonPlots(pset1.ps()) HadStandard300_350 = HadronicCommonPlots(pset2.ps()) HadStandard350 = HadronicCommonPlots(pset3.ps()) HadStandardAll = HadronicCommonPlots(pset4.ps()) nHadStandard250_300 = HadronicCommonPlots(Npset1.ps()) nHadStandard300_350 = HadronicCommonPlots(Npset2.ps()) nHadStandard350 = HadronicCommonPlots(Npset3.ps()) nHadStandardAll = HadronicCommonPlots(Npset4.ps()) # Common cut definitions #Avaiable criteria for MC and for Data are at current slightly different Hence the making of two trees #DataOnly! from icf.JetCorrections import * corPset = CorrectionPset() JetCorrections = JESCorrections(corPset.ps()) NoiseFilt = OP_HadronicHBHEnoiseFilter()
MuonID = True, MuonIso = True, dxychoice = "beamspot" ) jet_id = PSet( MinConstituents=1, MaxEMFrac=0.99, MaxHadFrac=0.99, FWDMinCHConstituents=0, FWDMinCHHadFrac=0., FWDMaxCHEMFrac=0.99 ) elecSelFilter=CustomEleId(ele_id.ps()) muonSelFilter=CustomMuonId(muon_id.ps()) tauSelFilter=CustomTauId(tau_id.ps()) jetSelFilter=CustomJetId(jet_id.ps()) muelfilter=MuonElectronDrFilter(0.1) eletaufilter=ElectronTauDrFilter(0.1) mutaufilter=MuonTauDrFilter(0.1) elejetfilter=ElectronJetDrFilter(0.4) muonjetfilter=MuonJetDrFilter(0.4) taujetfilter=TauJetDrFilter(0.1) # Create the analysis a=Analysis("SusyScan")
Development = True, #Development area, here is where the JetMET PAS plots have been developed, Needs tidying, will be put in to a File of its own, for the moment everything you want will be in here ) pset2 = PSet( DirName = "MT2after", MinObjects = 2, MaxObjects = 10, Mt2DiJet = False,#MT2 plots of Dijet system NOT USED HERE Mt2Multi_Jet = False,#As above for multiJet Mt2Compare = False,#Compares the above methods MHT = True, #Plots MHT Variables DalitzMT2 = False, # A testing/idea for putting MT2 in with Dalitz plots, also False Development = True, #Development area, here is where the JetMET PAS plots have been developed, Needs tidying, will be put in to a File of its own, for the moment everything you want will be in here ) plots_mt2 = BrynPlottingOps( pset1.ps() ) plots_ANmt2 = BrynPlottingOps( pset2.ps() ) hadset = PSet( DirName = "Hadronic", MinObjects = 2, MaxObjects = 10, Verbose = False, Summary = False, CC = False, Dalitz = False, AlphaT = True, #Robs alphaT plots. PtHat = False, MET = False, Kine = False,
#!/usr/bin/env python # standard imports import setupSUSY from libFrameworkSUSY import * import libOneLepton as one import libWPol as wpol from copy import deepcopy from icf.core import PSet, Analysis # The leptonic specicif settings&files from onelepton_settings import * from onelepton_MC_samples import * from onelepton.filters import metScaleSystematic, vertexReweighting, metResolutionSystematic syst_ps = PSet(Polarisation=True, Lepton="Muon", METResolution=True) syst_plots = one.SystematicsPlots("Systematics", syst_ps.ps()) syst = Analysis("Systematics") tree = Tree("Main") syst += tree tree.Attach(syst_plots) syst.Run("./systematics", conf, samplesMC)
"HLT_Ele10_CaloIdL_CaloIsoVL_TrkIdVL_TrkIsoVL_HT200_v*", "HLT_HT200_Ele5_CaloIdVL_TrkIdVL_CaloIsoVL_TrkIsoVL_PFMHT35_v*", "HLT_HT250_Ele5_CaloIdVL_TrkIdVL_CaloIsoVL_TrkIsoVL_PFMHT35_v*", "HLT_HT300_Ele5_CaloIdVL_TrkIdVL_CaloIsoVL_TrkIsoVL_PFMHT40_v*", "HLT_HT350_Ele5_CaloIdVL_TrkIdVL_CaloIsoVL_TrkIsoVL_PFMHT45_v*", "HLT_HT300_Ele5_CaloIdVL_CaloIsoVL_TrkIdVL_TrkIsoVL_PFMHT40_v*", "HLT_HT350_Ele5_CaloIdVL_CaloIsoVL_TrkIdVL_TrkIsoVL_PFMHT45_v*", ], Verbose=False, UsePreScaledTriggers=False, ) json = JSONFilter("Cert_160404-165542", json_to_pset("%s/onelepton/json/RA4muonSync.txt" % susyDir())) triggerData4X = OP_MultiTrigger(trg_set2.ps()) triggerData4XCtrl = OP_MultiTrigger(trg_set4.ps()) triggerData42X_PromptReco = OP_MultiTrigger(trg_set5.ps()) triggerData42XCtrl_PromptReco = OP_MultiTrigger(trg_set6.ps()) triggerData42X_ReReco = OP_MultiTrigger(trg_set2.ps()) triggerData42XCtrl_ReReco = OP_MultiTrigger(trg_set4.ps()) etriggerData42X_ReReco = OP_MultiTrigger(etrg_set1.ps()) etriggerData42X_PromptReco = OP_MultiTrigger(etrg_set2.ps()) etriggerData42XCtrl_ReReco = OP_TriggerCut("HLT_Ele27_CaloIdVT_CaloIsoT_TrkIdT_TrkIsoT_v3") etriggerData42XCtrl_PromptReco = OP_MultiTrigger(etrg_set3.ps()) # lepton specific cuts
ttWPlottingOps100 = RECO_ttWPlotting("ttW_After250") ttWPlottingOps350 = RECO_ttWPlotting("ttW_After350") ttWPlottingOpsAT = RECO_ttWPlotting("ttW_AfterAT") psetS = PSet(DirName="After_350Gev", MinObjects=2, MaxObjects=9, StandardPlots=True, DeadECALPlots=False, CleaningControlPlots=False, MECPlots=False, DeadECALFile="./deadRegionList_START36_V9.txt", DeadECAL_MinJetPtCut=10., DeadECAL_MinBiasCut=0.5) HadStandard350 = HadronicCommonPlots(psetS.ps()) psetMHT = PSet( # DirName = "HadronicCommon_1", # MinObjects = 2, # MaxObjects = 6, # StandardPlots = False, # DeadECALPlots = True, # CleaningControlPlots = True, # MECPlots = True, # DeadECALFile = "./deadRegionList_START36_V9.txt", # DeadECAL_MinJetPtCut = 10., # DeadECAL_MinBiasCut = 0.5 DirName="After_MHTGev", MinObjects=2, MaxObjects=9, StandardPlots=True,
ZeroPhotons = OP_NumComPhotons("<=", 0) OddPhot = OP_OddPhoton() GE2Jets = OP_NumComJets(">=", 2) OddJet = OP_OddJet() badMuonINJet = OP_BadMuonInJet() secondJetET = OP_SecondJetEtCut(30.) HTlep200 = RECO_LeptonicHTCut(200.) HTlep300 = RECO_LeptonicHTCut(300.) HTlep350 = RECO_LeptonicHTCut(350.) LepAlphaTCut = OP_LeptonicAlphaTCut(0.53) ed_all = OP_EventDisplay("ED_All", "all") #to draw all objects ed_com = OP_EventDisplay("ED_Com", "common") #to draw all objects eletree = AnalysisTree("eletree",tree_ele.ps()) mutree = AnalysisTree("mutree",tree_mu.ps()) mutree_iso = AnalysisTree("mutree_iso",tree_mu.ps()) tree = Tree("Main") # Main trunk of tree tree.Attach(MuonTreeReq) tree.TAttach(MuonTreeReq,mutree_iso) tree.TAttach(mutree_iso,OneMuon) tree.TAttach(OneMuon,MaxPtCut) tree.TAttach(MaxPtCut,HTlep200) tree.TAttach(HTlep200,LepAlphaTCut) tree.TAttach(LepAlphaTCut,ed_all) tree.TAttach(ed_all,ed_com)
# ==================================== # trigger = OP_TriggerCut("HLT_Ele15_SW_L1R") trigger = OP_TriggerCut("HLT_Jet15U") selection = OP_GoodEventSelection() HBHE = OP_HadronicHBHEnoiseFilter() OneElectron = OP_NumComElectrons(">=", 1) odde = OP_OddElectron() ZeroMuons = OP_NumComMuons("==", 0) oddm = OP_OddMuon() ZeroPhotons = OP_NumComPhotons("==", 0) LT4Jets = OP_NumComJets(">=", 1) oddj = OP_OddJet() BasicPlotsPreMHT = ElectronTree("eTree_PreMHT", pol_plots_cfg.ps()) tree = Tree("Main") # Main trunk of tree tree.Attach(trigger) tree.TAttach(trigger, selection) tree.TAttach(selection, HBHE) tree.TAttach(HBHE, OneElectron) tree.TAttach(OneElectron, ZeroMuons) tree.TAttach(ZeroMuons, oddj) tree.TAttach(oddj, BasicPlotsPreMHT) # tree.TAttach(OneElectron,odde) # tree.TAttach(odde,ZeroMuons) # tree.TAttach(ZeroMuons,oddm)
ak5pfResCorrections = CorrectionPset( YourSusyDir, "/framework/python/icf/Spring10DataV2_L2L3Residual_AK5PF.txt") evDiagPs = PSet( LatexFilename="diagSlides.tex", Triggers=[ "HLT_HT100U", "HLT_HT120U", "HLT_HT140U", "HLT_HT150U_v3", "HLT_HT160U_v1", "HLT_HT160U_v3", ], # CaloJetCorrections = caloResCorrections.ps(), ) evDiag = OP_PFDiagnosticSlideMaker(evDiagPs.ps(), caloResCorrections.ps(), ak5pfResCorrections.ps()) #cutTreeData.TAttach(MHToverMET2om_350plus,evDisplay) cutTreeData.TAttach(MHToverMET2om_350plus, evId) cutTreeData.TAttach(MHToverMET2om_350plus, evDiag) # # # number of common jets = 2 cutTreeData.TAttach(count_total, numComJets2Please) cutTreeData.TAttach(numComJets2Please, count_numComJets2eq) cutTreeData.TAttach(numComJets2Please, dataTrigger2eq) cutTreeData.TAttach(dataTrigger2eq, count_Trigger2eq) cutTreeData.TAttach(dataTrigger2eq, NoiseFilt2eq) cutTreeData.TAttach(NoiseFilt2eq, count_NoiseFilt2eq) cutTreeData.TAttach(NoiseFilt2eq, selection2eq) cutTreeData.TAttach(selection2eq, count_selection2eq)
cut_flow.TAttach(oddMuon,qcdBkgdEst) elif ( VetoesOption == "NoVetoes" ) : cut_flow.TAttach(selection_duplicate,qcdBkgdEst) elif ( VetoesOption == "NoOddVetoes" ) : cut_flow.TAttach(selection_duplicate,numComPhotons) cut_flow.TAttach(numComPhotons,numComElectrons) cut_flow.TAttach(numComElectrons,numComMuons) cut_flow.TAttach(numComMuons,qcdBkgdEst) if ( True and FilterOption > -1 ) : skim_ps = PSet( SkimName = "Skim", Branches = ["keep *"], DropBranches = False, ) skim = SkimOp( skim_ps.ps() ) cut_flow.TAttach(qcdBkgdEst,skim) # ----------------------------------------------------------------------------- # dataset Darren=PSet( Name="Darren", Format=("ICF",3), File=[ "root://xrootd.grid.hep.ph.ic.ac.uk/store/user/henning/ICF/automated/2011_11_11_14_03_49/HT.Run2011A-May10ReReco-v1.AOD/SusyCAF_Tree_1000_2_5ze.root" , "root://xrootd.grid.hep.ph.ic.ac.uk/store/user/henning/ICF/automated/2011_11_11_14_03_49/HT.Run2011A-May10ReReco-v1.AOD/SusyCAF_Tree_1001_2_QRR.root" , "root://xrootd.grid.hep.ph.ic.ac.uk/store/user/henning/ICF/automated/2011_11_11_14_03_49/HT.Run2011A-May10ReReco-v1.AOD/SusyCAF_Tree_1002_2_56x.root" , "root://xrootd.grid.hep.ph.ic.ac.uk/store/user/henning/ICF/automated/2011_11_11_14_03_49/HT.Run2011A-May10ReReco-v1.AOD/SusyCAF_Tree_1003_2_Z7B.root" , "root://xrootd.grid.hep.ph.ic.ac.uk/store/user/henning/ICF/automated/2011_11_11_14_03_49/HT.Run2011A-May10ReReco-v1.AOD/SusyCAF_Tree_1004_2_jeP.root" , "root://xrootd.grid.hep.ph.ic.ac.uk/store/user/henning/ICF/automated/2011_11_11_14_03_49/HT.Run2011A-May10ReReco-v1.AOD/SusyCAF_Tree_1005_2_ObZ.root" ,
conf.Common.Electrons.EtaCut = 2.4 conf.Common.Photons.EtCut=30. conf.Common.Electrons.ApplyID=False # Create the analysis a = Analysis("KinCorrection") tree = Tree("Main") Trigger=PSet( McAnal =False, MSugraScan = 0., TriggerBits=PSet( bit1="" ) ) ssdlTrigg=SSDLTrigger("Trigger",Trigger.ps()) ZeroMuons = OP_NumComMuons("==", 0) KinCorrParPlus = PSet( zMassMin = 71., zMassMax = 111., BarrelEtaMax = 1.4442, EndCapEtaMin = 1.56, EndCapEtaMax = 2.5, c_ErNu_pt = 0., MinElecRescaledPt=0., wID=+24., ##24 W+, -24 W-
#conf.Common.Electrons.TightID = True #conf.Common.ApplyXCleaning=False #conf.Common.Electrons.ApplyID=False conf.XCleaning.Verbose=False conf.Common.ApplyXCleaning=False a=Analysis("ht300") ###FILTERS taujetfilter=TauJetDrFilter(0.05) muelfilter=MuonElectronDrFilter(0.05) muond0filter=LeptonD0Filter(0.2,0.0,0.0322) elecd0filter=LeptonD0Filter(0.2,0.0,0.0322) elecSelFilter=CustomEleId(ele_id.ps()) muonSelFilter=CustomMuonId(muon_id.ps()) #tauSelFilter=CustomTauId(tau_id.ps()) a.AddJetFilter("PreCC",taujetfilter) a.AddElectronFilter("PreCC",muelfilter) a.AddMuonFilter("PreCC",muond0filter) a.AddElectronFilter("PreCC",elecd0filter) a.AddElectronFilter("PreCC",elecSelFilter) a.AddMuonFilter("PreCC",muonSelFilter) #a.AddTauFilter("PreCC",tauSelFilter) # With the V2 code you can add linear sets of operations as before # Here we will use the Tree class to have branching operations # Create a Tree called Main tree = Tree("Main")
htBins = [275, 325] + [375+100*i for i in range(6)], label2 = "btag_%s_%i_NoAlphaT_"%(btags[0],btags[1]),extra = MChiCut)) return out from ra1objectid.vbtfElectronId_cff import * from ra1objectid.vbtfMuonId_cff import * from ra1objectid.ra3PhotonId_cff import * vbtfElectronIdFilter = Electron_IDFilter( vbtfelectronidWP95ps.ps() ) #vbtfElectronIdFilter = Electron_IDFilter( vbtfelectronidWP90ps.ps() ) ra3PhotonIdFilter = Photon_IDFilter( ra3photonidps.ps() ) muonfilt = CustomVBTFMuID(mu_id.ps()) if switches()["selection"]=="muon" else Muon_IDFilter( vbtfmuonidps.ps() ) # muonfilt = Muon_IDFilter(vbtfmuonidps.ps()) import os susydir = os.environ['SUSY_WORKING_SW_DIR'] + '/' if isCmssm(switches()["model"]) : if switches()["model"] == "tanB10": LOweights = SignalScanLOCrossSectionWeighting(xsToPSet( readLOXS(susydir+"SUSYSignalScan/textfiles/goodModelNames_10_0_1.txt") ).ps()) if switches()["model"] == "tanB40": LOweights = SignalScanLOCrossSectionWeighting(xsToPSet( readLOXS(susydir+"SUSYSignalScan/textfiles/goodModelNames_40_m500_1.txt") ).ps()) def addCutFlowMC(a,cutTreeMC) : if "tan" in switches()["model"]:a.AddWeightFilter("Weight",LOweights) if switches()["jes"] != "": a.AddJetFilter("PreCC",JESUncert) a.AddMuonFilter("PreCC",muonfilt); print "WARNING: should this be PreCC?" a.AddPhotonFilter("PreCC",ra3PhotonIdFilter) a.AddElectronFilter("PreCC",vbtfElectronIdFilter) a+=cutTreeMC
} # refTrigList = ["HLT_Mu40_HT200_v*","HLT_Mu40_HT200_v*"] # TestTrigList = ["HLT_HT250_AlphaT0p53_v6","HLT_HT250_AlphaT0p55_v*"] # trigList = [] sigList = [] for key,vals in alphatTesting.iteritems(): trigList+=vals[0] sigList.append(key) htCut = RECO_CommonHTCut(375.) alphaT055 = HadronicAlphaT(0.55) dump = EventDump() Cross_Trigger_PS.Triggers = trigList TriggersRef = OP_MultiTrigger(Cross_Trigger_PS.ps()) HT_Trigger_PS.Triggers = sigList TriggersSig = OP_MultiTrigger(HT_Trigger_PS.ps()) cutTreeData.TAttach(muDr,TriggersRef) cutTreeData.TAttach(TriggersRef,TriggersSig) cutTreeData.FAttach(TriggersSig,alphaT055) cutTreeData.TAttach(alphaT055,htCut) cutTreeData.TAttach(htCut,dump) skim_ps=PSet( SkimName = "myskim", DropBranches = False, Branches = [ " keep * " ]
default_common.Photons.UseID = True # the photon cuts are NOT read anyway # default_common.Photons.TrkIsoRel=0. # default_common.Photons.TrkIsoCut=99999. # default_common.Photons.EcalIsoRel=0. # default_common.Photons.EcalIsoCut=99999. # default_common.Photons.HcalIsoRel=0. # default_common.Photons.HcalIsoCut=99999. # default_common.Photons.HadOverEmCut=0.5 # default_common.Photons.SigmaIetaIetaCut=0.5 ##default_common.Photons.CaloIsoCut=99999. default_common.Photons.IDReq = 3 default_common.Photons.RequireLooseForOdd = True skim_ps = PSet(SkimName="myskim", DropBranches=False, Branches=[" keep * "]) skim = SkimOp(skim_ps.ps()) #Plot the common plots! genericPSet_mc = PSet( DirName="275_325Gev", MinObjects=2, MaxObjects=15, minDR=0.4, mCut=2.0, isData=False, StandardPlots=True, ) genericPSet_data = PSet( DirName="275_325Gev",
#conf.Common.ApplyXCleaning=False #conf.Common.Electrons.ApplyID=False conf.XCleaning.Verbose=False conf.Common.ApplyXCleaning=False a=Analysis("PFiso") ###FILTERS taujetfilter=TauJetDrFilter(0.1) muelfilter=MuonElectronDrFilter(0.1) muond0filter=LeptonD0Filter(0.2,0.0,0.0322) elecd0filter=LeptonD0Filter(0.2,0.0,0.0322) elecSelFilter=CustomEleId(ele_id.ps()) muonSelFilter=CustomMuonId(muon_id.ps()) tauSelFilter=CustomTauId(tau_id.ps()) eletaufilter=ElectronTauDrFilter(0.1) mutaufilter=MuonTauDrFilter(0.1) #a.AddMuonFilter("PreCC",muond0filter) a.AddMuonFilter("PreCC",muonSelFilter) #a.AddElectronFilter("PreCC",elecd0filter) #a.AddElectronFilter("PreCC",elecSelFilter) #a.AddElectronFilter("PreCC",muelfilter) #a.AddTauFilter("PreCC",tauSelFilter) #a.AddTauFilter("PreCC",mutaufilter) #a.AddTauFilter("PreCC",eletaufilter) #a.AddJetFilter("PreCC",taujetfilter)
default_common.Photons.UseID = True # the photon cuts are NOT read anyway # default_common.Photons.TrkIsoRel=0. # default_common.Photons.TrkIsoCut=99999. # default_common.Photons.EcalIsoRel=0. # default_common.Photons.EcalIsoCut=99999. # default_common.Photons.HcalIsoRel=0. # default_common.Photons.HcalIsoCut=99999. # default_common.Photons.HadOverEmCut=0.5 # default_common.Photons.SigmaIetaIetaCut=0.5 ##default_common.Photons.CaloIsoCut=99999. default_common.Photons.IDReq = 3 default_common.Photons.RequireLooseForOdd = True skim_ps = PSet(SkimName="myskim", DropBranches=False, Branches=[" keep * "]) skim = SkimOp(skim_ps.ps()) #Plot the common plots! genericPSet = PSet( DirName="275_325Gev", MinObjects=2, MaxObjects=15, StandardPlots=True, ) def makePlotOp(OP=(), cutTree=None, cut=None, label=""): """docstring for makePlotOp""" out = [] if OP[1] != None: