Пример #1
0
    for dataFilter in goodDataFiltersMiniAOD:
        #setattr(process,dataFilter
        process.p *= dataFilter
else:
    process.leptons = process.leptons.clone()
    process.p = cms.Path(
        process.goodDataFilter * process.muonPhotonMatch * process.leptons *
        reduce(lambda x, y: x * y, [getattr(process, x) for x in alldimus]))

# For all the allDimuons producers, make dimuons producers, and
# analyzers to make the histograms.
for alld in alldimus:
    dimu = process.dimuons.clone(src=alld)
    name = alld.replace('allD', 'd')
    setattr(process, name, dimu)
    hists = HistosFromPAT.clone(dilepton_src=name, leptonsFromDileptons=True)
    setattr(process, name.replace('dimuons', ''), hists)
    process.p *= dimu * hists

# Handle the cuts that have to be applied at the
# Zprime2muCompositeCandidatePicker level.
process.allDimuonsBASE = allDimuons.clone(
    cut='daughter(0).pdgId() + daughter(1).pdgId() == 0')
process.p *= process.allDimuonsBASE
process.dimuonsNoB2B = process.dimuons.clone(src='allDimuonsBASE')
process.dimuonsNoVtxProb = process.dimuons.clone(src='allDimuonsBASE')
process.dimuonsNoDptPt = process.dimuons.clone(src='allDimuonsBASE')
#process.dimuonsNoB2B     = process.dimuons.clone(src = 'allDimuonsN2')#N-2
#process.dimuonsNoVtxProb = process.dimuons.clone(src = 'allDimuonsN2')#N-2
#process.dimuonsNoDptPt   = process.dimuons.clone(src = 'allDimuonsN2')#N-2
delattr(process.dimuonsNoB2B, 'back_to_back_cos_angle_min')
            if hasattr(dil, 'dpt_over_pt_max'):
                delattr(dil, 'dpt_over_pt_max')
        elif cut_name == 'OurNoIso':
            alldil.loose_cut = alldil.loose_cut.value().replace(
                ' && isolationR03.sumPt / innerTrack.pt < 0.10', '')
        elif 'MuPrescaled' in cut_name:
            alldil.loose_cut = alldil.loose_cut.value().replace(
                'pt > %s' % offline_pt_threshold,
                'pt > %s' % prescaled_offline_pt_threshold)
            assert alldil.tight_cut == trigger_match
            alldil.tight_cut = prescaled_trigger_match

        # Histos now just needs to know which leptons and dileptons to use.

        histos = HistosFromPAT.clone(lepton_src=cms.InputTag(
            leptons_name, 'muons'),
                                     dilepton_src=cms.InputTag(name))
        res = ResolutionAtZ.clone(lepton_src=cms.InputTag(
            leptons_name, 'muons'),
                                  dilepton_src=cms.InputTag(name))

        # Add all these modules to the process and the path list.
        setattr(process, allname, alldil)
        setattr(process, name, dil)
        setattr(process, name + 'Histos', histos)
        setattr(process, name + 'Resolution', res)
        path_list.append(alldil * dil * histos * res)

    #define the list of MC samples to be read here. be careful that if WWinclusive or tautau sample are not commented it will apply the filters when running locally.

    samples = [