def fill(the_histos, row, fillNtuple=False): weight = 1 if row.run == 1: weight = self.pucorrector(row.nTruePU) *\ mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * \ mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta) the_histos['ePt'].Fill(row.ePt) the_histos['eJetPt'].Fill(max(row.eJetPt, row.ePt)) the_histos['eAbsEta'].Fill(row.eAbsEta) #the_histos['metSignificance'].Fill(row.metSignificance) the_histos['mMtToMET'].Fill(row.mMtToMET) the_histos['eJetptD'].Fill(row.mJetptD) the_histos['eJetmult'].Fill(row.mJetmult) the_histos['eJetmultvseJetPt'].Fill(max(row.eJetPt, row.ePt), row.eJetmult) the_histos['eJetptDvseJetPt'].Fill(max(row.eJetPt, row.ePt), row.eJetptD) if fillNtuple: id_iso_vals = [ float(selections.lepton_id_iso(row, 'e', label)) for label in self.lepIds ] the_histos['electronInfo'].Fill( array("f", [row.ePt, row.eJetPt, weight] + id_iso_vals))
def fill_muon(the_histos, row, fillNtuple=False): weight = 1 if row.run == 1: weight = self.pucorrector(row.nTruePU) *\ mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * \ mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta) the_histos['muonPt'].Fill(row.mPt, weight) the_histos['muonJetPt'].Fill(max(row.mJetPt, row.mPt), weight) the_histos['muonAbsEta'].Fill(row.mAbsEta, weight) the_histos['muonPtRatio'].Fill(row.mPt / max(row.mJetPt, row.mPt), weight) the_histos['muonPtDiff'].Fill( max(row.mJetPt, row.mPt) - row.mPt, weight) if fillNtuple: pfidiso02 = float(row.mPFIDTight and row.mRelPFIsoDB < 0.2) h2taucuts = float( row.mPFIDTight and ((row.mRelPFIsoDB < 0.15 and row.mAbsEta < 1.479) or row.mRelPFIsoDB < 0.1)) h2taucuts020 = float( row.mPFIDTight and ((row.mRelPFIsoDB < 0.20 and row.mAbsEta < 1.479) or row.mRelPFIsoDB < 0.15)) the_histos['muonInfo'].Fill( array("f", [ row.mPt, row.mJetPt, row.mJetBtag, weight, pfidiso02, h2taucuts, h2taucuts020 ]))
def fill(the_histos, row, fillNtuple=False): weight = 1 if row.run == 1: weight = self.pucorrector(row.nTruePU) *\ mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * \ mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta) the_histos['ePt'].Fill(row.ePt) the_histos['eJetPt'].Fill(max(row.eJetPt, row.ePt)) the_histos['eAbsEta'].Fill(row.eAbsEta) #the_histos['metSignificance'].Fill(row.metSignificance) the_histos['mMtToMET'].Fill(row.mMtToMET) the_histos['eJetptD'].Fill(row.mJetptD) the_histos['eJetmult'].Fill(row.mJetmult) the_histos['eJetmultvseJetPt'].Fill(max(row.eJetPt, row.ePt), row.eJetmult) the_histos['eJetptDvseJetPt'].Fill(max(row.eJetPt, row.ePt), row.eJetptD) if fillNtuple: id_iso_vals = [ float(selections.lepton_id_iso(row, 'e', label)) for label in self.lepIds ] electron_jet_mass = -1. #inv_mass(row.ePt, row.eEta, row.ePhi, row.leadingJetPt, row.leadingJetEta, row.leadingJetPhi) the_histos['electronInfo'].Fill( array("f", [ row.ePt, max(row.eJetPt, row.ePt), max(0, row.eJetCSVBtag), electron_jet_mass, row.jetVeto20, row.jetVeto40_DR05, weight ] + id_iso_vals)) the_histos['evtInfo'].Fill(row)
def fill_folder(x, w): histos[x + '/weight'].Fill(w) histos[x + '/rho'].Fill(row.rho, w) histos[x + '/nvtx'].Fill(row.nvtx, w) histos[x + '/prescale'].Fill(row.mu17ele8Prescale, w) histos[x + '/group'].Fill(row.mu17ele8Group, w) histos[x + '/ePt'].Fill(row.ePt, w) histos[x + '/mPt'].Fill(row.mPt, w) histos[x + '/eAbsEta'].Fill(row.eAbsEta, w) histos[x + '/mAbsEta'].Fill(row.mAbsEta, w) histos[x + '/mPixHits'].Fill(row.mPixHits, w) histos[x + '/eJetBtag'].Fill(row.eJetBtag, w) histos[x + '/mJetBtag'].Fill(row.mJetBtag, w) histos[x + '/emMass'].Fill(row.e_m_Mass, w) histos[x + '/emMass_noweight'].Fill(row.e_m_Mass) histos[x + '/bjetVeto'].Fill(row.bjetVeto, w) histos[x + '/bjetCSVVeto'].Fill(row.bjetCSVVeto, w) histos[x + '/muVetoPt5'].Fill(row.muVetoPt5, w) histos[x + '/tauVetoPt20'].Fill(row.tauVetoPt20, w) histos[x + '/eVetoCicTightIso'].Fill(row.eVetoCicTightIso, w) if row.run < 2: histos[x + "/trig_weight"].Fill( mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta)) histos[x + "/PU_weight"].Fill(self.pucorrector(row.nTruePU)) histos[x + "/idIso_weight"].Fill( mcCorrectors.get_muon_corrections(row, 'm') * mcCorrectors.get_electron_corrections(row, 'e'))
def fill_folder(x, w): histos[x + '/weight'].Fill(w) histos[x + '/rho'].Fill(row.rho, w) histos[x + '/nvtx'].Fill(row.nvtx, w) histos[x + '/prescale'].Fill(row.mu17ele8Prescale, w) histos[x + '/group'].Fill(row.mu17ele8Group, w) histos[x + '/ePt'].Fill(row.ePt, w) histos[x + '/mPt'].Fill(row.mPt, w) histos[x + '/eAbsEta'].Fill(row.eAbsEta, w) histos[x + '/mAbsEta'].Fill(row.mAbsEta, w) histos[x + '/mPixHits'].Fill(row.mPixHits, w) histos[x + '/eJetBtag'].Fill(row.eJetBtag, w) histos[x + '/mJetBtag'].Fill(row.mJetBtag, w) histos[x + '/emMass'].Fill(row.e_m_Mass, w) histos[x + '/emMass_noweight'].Fill(row.e_m_Mass) histos[x + '/bjetVeto'].Fill(row.bjetVeto, w) histos[x + '/bjetCSVVeto'].Fill(row.bjetCSVVeto, w) histos[x + '/muVetoPt5'].Fill(row.muVetoPt5, w) histos[x + '/tauVetoPt20'].Fill(row.tauVetoPt20, w) histos[x + '/eVetoCicTightIso'].Fill(row.eVetoCicTightIso, w) if row.run < 2: histos[x + "/trig_weight" ].Fill(mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta)* mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta) ) histos[x + "/PU_weight" ].Fill(self.pucorrector(row.nTruePU)) histos[x + "/idIso_weight"].Fill(mcCorrectors.get_muon_corrections(row,'m') * mcCorrectors.get_electron_corrections(row,'e') )
def event_weight(self, row): if row.run > 2: return 1. return self.pucorrector(row.nTruePU) * \ mcCorrectors.get_muon_corrections(row,'m') * \ mcCorrectors.get_electron_corrections(row,'e') * \ mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * \ mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta)
def fill_muon(the_histos, row, fillNtuple=False): weight = 1 if row.run == 1: weight = self.pucorrector(row.nTruePU) *\ mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * \ mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta) the_histos['muonPt'].Fill(row.mPt, weight) the_histos['muonJetPt'].Fill(max(row.mJetPt, row.mPt), weight) the_histos['muonAbsEta'].Fill(row.mAbsEta, weight) the_histos['muonPtRatio'].Fill(row.mPt/max(row.mJetPt, row.mPt), weight) the_histos['muonPtDiff'].Fill(max(row.mJetPt, row.mPt) - row.mPt, weight) if fillNtuple: pfidiso02 = float( row.mPFIDTight and row.mRelPFIsoDB < 0.2) h2taucuts = float( row.mPFIDTight and ((row.mRelPFIsoDB < 0.15 and row.mAbsEta < 1.479) or row.mRelPFIsoDB < 0.1 )) h2taucuts020 = float( row.mPFIDTight and ((row.mRelPFIsoDB < 0.20 and row.mAbsEta < 1.479) or row.mRelPFIsoDB < 0.15)) the_histos['muonInfo'].Fill( array("f", [row.mPt, row.mJetPt, row.mJetBtag, weight, pfidiso02, h2taucuts, h2taucuts020] ) )
def fill(the_histos, row, fillNtuple=False): weight = 1 if row.run == 1: weight = self.pucorrector(row.nTruePU) *\ mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * \ mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta) the_histos['ePt'].Fill(row.ePt) the_histos['eJetPt'].Fill(max(row.eJetPt, row.ePt)) the_histos['eAbsEta'].Fill(row.eAbsEta) #the_histos['metSignificance'].Fill(row.metSignificance) the_histos['mMtToMET'].Fill(row.mMtToMET) the_histos['eJetptD'].Fill(row.mJetptD) the_histos['eJetmult'].Fill(row.mJetmult) the_histos['eJetmultvseJetPt'].Fill(max(row.eJetPt, row.ePt),row.eJetmult) the_histos['eJetptDvseJetPt'].Fill(max(row.eJetPt, row.ePt),row.eJetptD) if fillNtuple: id_iso_vals = [ float( selections.lepton_id_iso(row, 'e', label) ) for label in self.lepIds] the_histos['electronInfo'].Fill( array("f", [row.ePt, row.eJetPt, weight]+id_iso_vals) )
def fill_muon(the_histos, row, fillNtuple=False): weight = 1. if row.run == 1: weight = self.pucorrector(row.nTruePU) *\ mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * \ mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta) the_histos['muonPt'].Fill(row.mPt, weight) the_histos['eMtToMET'].Fill(row.eMtToMET) the_histos['muonJetPt'].Fill(max(row.mJetPt, row.mPt), weight) the_histos['muonAbsEta'].Fill(row.mAbsEta, weight) the_histos['muonPtRatio'].Fill(row.mPt / max(row.mJetPt, row.mPt), weight) the_histos['muonPtDiff'].Fill( max(row.mJetPt, row.mPt) - row.mPt, weight) if fillNtuple: pfidiso02 = float(row.mPFIDTight and row.mRelPFIsoDB < 0.2) h2taucuts = float( row.mPFIDTight and ((row.mRelPFIsoDB < 0.15 and row.mAbsEta < 1.479) or row.mRelPFIsoDB < 0.1)) h2taucuts020 = float( row.mPFIDTight and ((row.mRelPFIsoDB < 0.20 and row.mAbsEta < 1.479) or row.mRelPFIsoDB < 0.15)) muon_jet_mass = -1. #inv_mass(row.mPt, row.mEta, row.mPhi, row.leadingJetPt, row.leadingJetEta, row.leadingJetPhi) the_histos['muonInfo'].Fill( array("f", [ row.mPt, max(row.mJetPt, row.mPt), max(0, row.mJetCSVBtag), muon_jet_mass, row.jetVeto20, row.jetVeto40_DR05, weight, pfidiso02, h2taucuts, h2taucuts020 ])) the_histos['evtInfo'].Fill(row)
def fill_muon(the_histos, row, fillNtuple=False): weight = 1. if row.run == 1: weight = self.pucorrector(row.nTruePU) *\ mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * \ mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta) the_histos['muonPt'].Fill(row.mPt, weight) the_histos['eMtToMET'].Fill(row.eMtToMET) the_histos['muonJetPt'].Fill(max(row.mJetPt, row.mPt), weight) the_histos['muonAbsEta'].Fill(row.mAbsEta, weight) the_histos['muonPtRatio'].Fill(row.mPt/max(row.mJetPt, row.mPt), weight) the_histos['muonPtDiff'].Fill(max(row.mJetPt, row.mPt) - row.mPt, weight) if fillNtuple: pfidiso02 = float( row.mPFIDTight and row.mRelPFIsoDB < 0.2) h2taucuts = float( row.mPFIDTight and ((row.mRelPFIsoDB < 0.15 and row.mAbsEta < 1.479) or row.mRelPFIsoDB < 0.1 )) h2taucuts020 = float( row.mPFIDTight and ((row.mRelPFIsoDB < 0.20 and row.mAbsEta < 1.479) or row.mRelPFIsoDB < 0.15)) muon_jet_mass = -1. #inv_mass(row.mPt, row.mEta, row.mPhi, row.leadingJetPt, row.leadingJetEta, row.leadingJetPhi) the_histos['muonInfo'].Fill( array("f", [row.mPt, max(row.mJetPt, row.mPt), max(0, row.mJetCSVBtag), muon_jet_mass, row.jetVeto20, row.jetVeto40_DR05, weight, pfidiso02, h2taucuts, h2taucuts020] ) ) the_histos['evtInfo'].Fill(row)
def fill(the_histos, row, fillNtuple=False): weight = 1 if row.run == 1: weight = self.pucorrector(row.nTruePU) *\ mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * \ mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta) the_histos['ePt'].Fill(row.ePt) the_histos['eJetPt'].Fill(max(row.eJetPt, row.ePt)) the_histos['eAbsEta'].Fill(row.eAbsEta) #the_histos['metSignificance'].Fill(row.metSignificance) the_histos['mMtToMET'].Fill(row.mMtToMET) the_histos['eJetptD'].Fill(row.mJetptD) the_histos['eJetmult'].Fill(row.mJetmult) the_histos['eJetmultvseJetPt'].Fill(max(row.eJetPt, row.ePt),row.eJetmult) the_histos['eJetptDvseJetPt'].Fill(max(row.eJetPt, row.ePt),row.eJetptD) if fillNtuple: id_iso_vals = [ float( selections.lepton_id_iso(row, 'e', label) ) for label in self.lepIds] electron_jet_mass = -1. #inv_mass(row.ePt, row.eEta, row.ePhi, row.leadingJetPt, row.leadingJetEta, row.leadingJetPhi) the_histos['electronInfo'].Fill( array("f", [row.ePt, max(row.eJetPt, row.ePt), max(0, row.eJetCSVBtag), electron_jet_mass, row.jetVeto20, row.jetVeto40_DR05, weight]+id_iso_vals) ) the_histos['evtInfo'].Fill(row)
def correction(self, row): return self.pucorrector(row.nTruePU) * \ mcCorrectors.get_muon_corrections(row,'m') * \ mcCorrectors.get_electron_corrections(row,'e') * \ mcCorrectors.correct_mueg_mu(row.mPt, row.mAbsEta) * \ mcCorrectors.correct_mueg_e(row.ePt, row.eAbsEta)