def mAnalysis(photons, electrons, muons, nu_es, nu_ms, h2M3M4, suffix): # Leading/Sub-leading Photon Analysis leptons = electrons + muons nus = nu_es + nu_ms leadPhoton = selectLead(photons) subPhoton = selectSub(photons) lepton = selectLead(leptons) # Let signal lepton be the one w/ highest PT nu = selectLead(nus) if leadPhoton != None : histogramBuilder.fillPtHistograms([leadPhoton], 'Photon(Leading)_Pt_' + suffix) histogramBuilder.fillEtaHistograms([leadPhoton], 'Photon(Leading)_Eta_' + suffix) # Near-Z-Mass checks if(leadPhoton != None and subPhoton != None and lepton != None): m2_L = (leadPhoton + lepton).M() m2_S = (subPhoton + lepton).M() m3 = (leadPhoton + subPhoton + lepton).M() histogramBuilder.fillMHistograms(m2_L, 'Z2M(A_Lead+L)_' + suffix) histogramBuilder.fillMHistograms(m2_S, 'Z2M(A_Sub+L)_' + suffix) histogramBuilder.fillMHistograms(m3, 'Z3M(A+A+L)_' + suffix) # Near-W-Mass checks if(leadPhoton != None and subPhoton != None and lepton != None and nu != None): m3 = (leadPhoton + lepton + nu).M() # no sub leading lepton m4 = (leadPhoton + subPhoton + lepton + nu).M() histogramBuilder.fillMHistograms(m3, '3M(A+L+Nu)_' + suffix) histogramBuilder.fillMHistograms(m4, '4M(A+A+L+Nu)_' + suffix) h2M3M4.Fill(m3, m4)
def selectOnElectronKinematics(electrons): #if electrons != None: electrons = filter(lambda electron: electron.Pt() > minElectronPt, electrons) histogramBuilder.fillPtHistograms(electrons, 'Electron_Pt_PostElectronPtCut') electrons = filter(lambda electron: abs(electron.Eta()) < maxElectronEta, electrons) histogramBuilder.fillEtaHistograms(electrons, 'Electron_Eta_PostElectronEtaCut') return electrons
def MakeParticleTypeHistograms(prefix, particles, particleType): histogramBuilder.fillMultiplicityHistograms(prefix+"_"+particleType, len(particles)) for particle in particles: histogramBuilder.fillPtHistograms(prefix+"_"+particleType,particle.Pt()) histogramBuilder.fillEtaHistograms(prefix+"_"+particleType, particle.Eta()) histogramBuilder.fillStatusHistograms(prefix+"_" + particleType, particle.Status()) histogramBuilder.fillPDGIDHistograms(prefix+"_"+particleType, particle.PID()) histogramBuilder.fillPDGIDHistograms(prefix+"_"+particleType+"Mother", particle.MomPID())
def selectOnPhotonKinematics(photons): #if photons != None: # Post Cut Histograms photons = filter(lambda photon: photon.Pt() > minPhotonPt, photons) histogramBuilder.fillPtHistograms(photons, 'Photon_Pt_PostPhotonPtCut') photons = filter(lambda photon: abs(photon.Eta()) < maxPhotonEta, photons) #photons = filter(lambda photon: abs(photon.Eta()) < minPhotonEndCapEta # or abs(photon.Eta()) > maxPhotonEndCapEta, photons) histogramBuilder.fillEtaHistograms(photons, 'Photon_Eta_PostPhotonEtaCut') return photons
def selectOnMuonParent(muons): #if muons != None: muons = filter(lambda muon: abs(muon.MomPID()) == 24, muons) histogramBuilder.fillPtHistograms(muons, 'Muon_Pt_PostWParentCut') histogramBuilder.fillEtaHistograms(muons, 'Muon_Eta_PostWParentCut') return muons
def selectOnElectronParent(electrons): #if electrons != None: electrons = filter(lambda electron: abs(electron.MomPID()) == 24, electrons) histogramBuilder.fillPtHistograms(electrons, 'Electron_Pt_PostWParentCut') histogramBuilder.fillEtaHistograms(electrons, 'Electron_Eta_PostWParentCut') return electrons
def selectOnPhotonParent(photons): #if photons != None: filter_photons = filter(lambda photon: abs(photon.MomPID()) < 25, photons) histogramBuilder.fillPtHistograms(filter_photons, 'Photon_Pt_PostParentCut') histogramBuilder.fillEtaHistograms(filter_photons, 'Photon_Eta_PostParentCut') return filter_photons
def selectOnMuonKinematics(muons): muons = filter(lambda muon: muon.Pt() > minMuonPt, muons) histogramBuilder.fillPtHistograms(muons, 'Muon_Pt_PostMuonPtCut') muons = filter(lambda muon: abs(muon.Eta()) < maxMuonEta, muons) histogramBuilder.fillEtaHistograms(muons, 'Muon_Eta_PostMuonEtaCut') return muons