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
if mode == "data39": sig.AddJetFilter("PreCC",JetCorrections) if met_syst: pfmet_jecunc = PSet( #the location of the JECUncertainty txt file jecuncfile = "/vols/cms01/as1604/SUSY-svn/WPol2/scripts/GR_R_38X_V15_AK5PF_Uncertainty.txt", #either Muon or Electron lepton = "Muon", #the jet threshold to consider for the JEC Uncertainties pfjetthresh = 10.0, #the percentage/100 to shift the unclustered energy by unclusteredshift = 0.05, #whether or not to apply the shift upwards (True) or downwards (False) shiftup = False ) pfmetjecunc = wpol.pfMETJECUnc(pfmet_jecunc.ps()) sig.AddMETFilter("pfMET", pfmetjecunc) mu_jet_dr = MuonJetDRFilter(0.1, Mus.ps()) sig.AddJetFilter("PreCC", mu_jet_dr) if vertexReweight == "Yes": vertex_reweight = VertexReweighting( PSet( VertexWeights = [0.0, 0.169, 0.511, 1.276, 1.688, 1.564, 1.715, 1.135, 1.042, 0.476, 0.469, 0.385, 0.359, 0.37, 0.502, 0.489, 0.0, 0.0, 0.0, 0.0] ).ps() ) sig.AddWeightFilter("Weight", vertex_reweight) tree = Tree("Main")