Esempio n. 1
0
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)
Esempio n. 2
0
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 MakeHistograms(tree, channel, weight):
    
    histogramBuilder.fillPtHistograms(channel, tree.pt_leadph12, weight)
    histogramBuilder.fillPtCategoryHistograms(channel, tree.pt_leadph12, weight)
    # Hack to Change Selection to Photon Pt > 40
    if(tree.pt_leadph12 > 40):
        histogramBuilder.fillCountHistograms(channel, weight)
Esempio n. 4
0
def MakeHistograms(tree, channel, aqgc_weight_index, aqgc_weight, sm_weight):
    histogramBuilder.fillCountHistograms(
        channel + "_All_aQGC_Weight_" + str(aqgc_weight_index), aqgc_weight)

    histogramBuilder.fillPtHistograms(
        channel + "_All_LeadPhoton_aQGC_Weight_" + str(aqgc_weight_index),
        tree.pt_leadph12, aqgc_weight)
    histogramBuilder.fillPtHistograms(
        channel + "_All_SublPhoton_aQGC_Weight_" + str(aqgc_weight_index),
        tree.pt_sublph12, aqgc_weight)
    histogramBuilder.fill2DPtHistograms(
        channel + "_All_LeadAndSublPhoton_aQGC_Weight_" +
        str(aqgc_weight_index), tree.pt_leadph12, tree.pt_sublph12,
        aqgc_weight)

    histogramBuilder.fillPtCategoryHistograms(
        channel + "All_LeadPhoton_aQGC_Weight_" + str(aqgc_weight_index),
        tree.pt_leadph12, aqgc_weight)
    MakeCovarianceHistograms(tree, channel + "_All", aqgc_weight_index,
                             aqgc_weight, sm_weight)

    # Make Separate Histograms for EBEB, EB EE, and EE EB Cateogries
    MakePhotonLocationHistograms(tree, channel, aqgc_weight_index, aqgc_weight,
                                 sm_weight)

    # Make Histograms for Different Cuts on the SubLeading Photon Pt
    MakeSubPhotonCutHistograms(tree, channel, aqgc_weight_index, aqgc_weight,
                               sm_weight)
def MakeHistograms(prefix, photons, weight):
    leadPhoton = selectLead(photons)
    
    histogramBuilder.fillPtHistograms(prefix, leadPhoton.Pt(), weight)
    histogramBuilder.fillPtCategoryHistograms(prefix, leadPhoton.Pt(), weight)

    if(leadPhoton.Pt() > 40):
        histogramBuilder.fillCountHistograms(prefix, weight)
Esempio n. 6
0
def MakeCovarianceHistograms(tree, channel, aqgc_weight_index, aqgc_weight,
                             sm_weight):
    histogramBuilder.fillPtCategoryHistograms(
        channel + "_aQGC_Covariance_" + str(aqgc_weight_index),
        tree.pt_leadph12, aqgc_weight * sm_weight)
    histogramBuilder.fillPtHistograms(
        channel + "_aQGC_Covariance_" + str(aqgc_weight_index),
        tree.pt_leadph12, aqgc_weight * sm_weight)
    """
Esempio n. 7
0
def MakeMtHistograms(prefix, leptons, neutrinos):
    summed_nu=TLorentzVector()
    for nu in neutrinos:
        summed_nu += nu
    histogramBuilder.fillPtHistograms(prefix+"Summed_Nu", summed_nu.Pt())
    for lepton in leptons:
        Mt2 = 2*lepton.Et()*summed_nu.Et()*(1-cos(lepton.DeltaPhi(summed_nu)))
        Mt = sqrt(Mt2)
        histogramBuilder.fillMtHistograms(prefix, Mt)
Esempio n. 8
0
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())
Esempio n. 9
0
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
Esempio n. 10
0
def MakePhotonLocationHistograms(tree, channel, aqgc_weight_index, aqgc_weight,
                                 sm_weight):
    if (tree.isEB_leadph12 and tree.isEB_sublph12):
        histogramBuilder.fillPtHistograms(
            channel + "_EBEB_aQGC_Weight_" + str(aqgc_weight_index),
            tree.pt_leadph12, aqgc_weight)
        MakeCovarianceHistograms(tree, channel + "_EBEB", aqgc_weight_index,
                                 aqgc_weight, sm_weight)
    if (tree.isEB_leadph12 and tree.isEE_sublph12):
        histogramBuilder.fillPtHistograms(
            channel + "_EBEE_aQGC_Weight_" + str(aqgc_weight_index),
            tree.pt_leadph12, aqgc_weight)
        MakeCovarianceHistograms(tree, channel + "_EBEE", aqgc_weight_index,
                                 aqgc_weight, sm_weight)
        #histogramBuilder.fillPtHistograms(channel+"_EBEEandEEEB_aQGC_Weight_"+str(aqgc_weight_index), tree.pt_leadph12, aqgc_weight)
    if (tree.isEE_leadph12 and tree.isEB_sublph12):
        histogramBuilder.fillPtHistograms(
            channel + "_EEEB_aQGC_Weight_" + str(aqgc_weight_index),
            tree.pt_leadph12, aqgc_weight)
        MakeCovarianceHistograms(tree, channel + "_EEEB", aqgc_weight_index,
                                 aqgc_weight, sm_weight)
Esempio n. 11
0
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
Esempio n. 12
0
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
Esempio n. 13
0
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
Esempio n. 14
0
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