示例#1
0
def getit(fn):
    f = ROOT.TFile(fn)
    t = f.Get('mfvMiniTree/t')
    hr = draw_hist_register(t, True)
    h,n = hr.draw('weight', 'nvtx>=2', binning='1,0,1', get_n=True, goff=True)
    i = get_integral(h)[0]
    d = Samples.norm_from_file(f)
    e,l,u = clopper_pearson(i, d)
    ee = (u-l)/2
    return e,ee,i,d
示例#2
0
def getit(fn):
    f = ROOT.TFile(fn)
    t = f.Get('mfvMiniTree/t')
    hr = draw_hist_register(t, True)
    h, n = hr.draw('weight',
                   'nvtx>=2' +
                   ('&& genmatch0 && genmatch1' if req_genmatch else ''),
                   binning='1,0,1',
                   get_n=True,
                   goff=True)
    #i = get_integral(h)[0]
    #c = i/n
    d = Samples.norm_from_file(f)
    e, l, u = clopper_pearson(n, d)
    ee = (u - l) / 2
    return e, ee, n, d
示例#3
0
                                   'drop *',
                                   'keep MFVEvent_mfvEvent__*',
                                   'keep MFVVertexAuxs_mfvSelectedVerticesTight__*',
                                   'keep *_mfvSampleInfo_*_*',
                                   )
                               )
process.outp = cms.EndPath(process.out)

process.options.emptyRunLumiMode = cms.untracked.string('doNotHandleEmptyRunsAndLumis')
process.source.inputCommands = cms.untracked.vstring('keep *', 'drop *_MEtoEDMConverter_*_*')
process.out.outputCommands += ['drop LumiDetails_lumiProducer_*_*', 'drop LumiSummary_lumiProducer_*_*', 'drop RunSummary_lumiProducer_*_*']
process.out.dropMetaData = cms.untracked.string('ALL')

if __name__ == '__main__' and hasattr(sys, 'argv') and 'submit' in sys.argv:
    samples = Samples.from_argv([Samples.mfv_neutralino_tau0100um_M0400,
                                 Samples.mfv_neutralino_tau1000um_M0400,
                                 Samples.mfv_neutralino_tau0300um_M0400,
                                 Samples.mfv_neutralino_tau9900um_M0400] + Samples.ttbar_samples + Samples.qcd_samples)

    run_half = True

    def modify(sample):
        to_add = []
        to_replace = []

        to_add.append('''
process.mfvSampleInfo.sample = '%s'
process.mfvSampleInfo.num_events = %s
process.mfvSampleInfo.cross_section = %g
''' % (sample.name,
       'int(%i*0.5)' % sample.nevents if (run_half and sample in Samples.ttbar_samples + Samples.qcd_samples) else sample.nevents,
       sample.cross_section)
示例#4
0
#!/usr/bin/env python

import sys
from JMTucker.Tools.Merge_cfg import cms, process

if __name__ == '__main__' and hasattr(sys, 'argv') and 'submit' in sys.argv:
    import JMTucker.Tools.Samples as Samples
    samples = Samples.from_argv(Samples.mfv_signal_samples + [Samples.qcdht0100])

    from JMTucker.Tools.CRABSubmitter import CRABSubmitter
    cs = CRABSubmitter('MergeNtupleV18_2',
                       use_ana_dataset = True,
                       total_number_of_events = -1,
                       events_per_job = 50000,
                       get_edm_output = True,
                       data_retrieval = 'fnal',
                       max_threads = 3,
                       publish_data_name = 'mfvmergentuple_v18',
                       )

    cs.submit_all(samples)
示例#5
0
                size=(600, 600),
                pdf=True,
                log=False)

multijet = Samples.mfv_signal_samples_2017
dijet = Samples.mfv_stopdbardbar_samples_2017

for sample in multijet + dijet:
    fn = os.path.join('/uscms_data/d2/tucker/crab_dirs/MiniTree%s' % version,
                      sample.name + '.root')
    if not os.path.exists(fn):
        print 'no', sample.name
        continue
    f = ROOT.TFile(fn)
    t = f.Get('mfvMiniTree/t')
    hr = draw_hist_register(t, True)
    cut = 'nvtx>=2'  # && svdist > 0.04'
    h = hr.draw('weight', cut, binning='1,0,1', goff=True)
    num, _ = get_integral(h)
    den = Samples.norm_from_file(f)
    sample.y, sample.yl, sample.yh = clopper_pearson(
        num, den)  # ignore integral != entries, just get central value right
    print '%26s: efficiency = %.3f (%.3f, %.3f)' % (sample.name, sample.y,
                                                    sample.yl, sample.yh)

per = PerSignal('efficiency', y_range=(0., 1.05))
per.add(multijet, title='#tilde{N} #rightarrow tbs')
per.add(dijet, title='#tilde{t} #rightarrow #bar{d}#bar{d}', color=ROOT.kBlue)
per.draw(canvas=ps.c)
ps.save('sigeff')
示例#6
0
import FWCore.ParameterSet.Config as cms

process = cms.Process("PVAnalyzer")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger.cerr.INFO = cms.untracked.PSet(limit = cms.untracked.int32(-1))
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
process.source = cms.Source("PoolSource",
                            fileNames = cms.untracked.vstring('file:/store/mc/Summer12_DR53X/QCD_HT-1000ToInf_TuneZ2star_8TeV-madgraph-pythia6/AODSIM/PU_S10_START53_V7A-v1/00000/16716FE6-440E-E211-A50B-0024E8767D86.root'))
process.Analyzer = cms.EDAnalyzer('PVAnalyzer',primary_vertices_src = cms.InputTag('offlinePrimaryVertices'),
                                  track_src = cms.InputTag('generalTracks'),
                                  beamspot_src = cms.InputTag('offlineBeamSpot'),
                                  use_only_pv_tracks = cms.bool(True),
                                  use_only_pvs_tracks = cms.bool(True),
                                  maxNormChi2 = cms.double(20.0),
                                  minPxLayer = cms.int32(2),
                                  minSilLayer = cms.int32(5)
                                  )
process.TFileService = cms.Service("TFileService", fileName = cms.string('PVAnalyzer_histo.root'))
process.p = cms.Path(process.Analyzer)

if __name__ == '__main__' and hasattr(sys, 'argv') and 'submit' in sys.argv:
    import JMTucker.Tools.Samples as Samples
    samples = Samples.from_argv([Samples.qcdht1000, Samples.mfv_neutralino_tau1000um_M0400, Samples.mfv_neutralino_tau0100um_M0400])

    from JMTucker.Tools.CRABSubmitter import CRABSubmitter
    cs = CRABSubmitter('PVAnalyzer',
                       total_number_of_events = -1,
                       events_per_job = 100000,
                       )
    cs.submit_all(samples)
示例#7
0
import sys
from JMTucker.Tools.BasicAnalyzer_cfg import *

file_event_from_argv(process)

process.TFileService.fileName = cms.string('evids.root')

process.evids = cms.EDAnalyzer('EventIdRecorder')
process.p = cms.Path(process.evids)

process.source.duplicateCheckMode = cms.untracked.string('noDuplicateCheck')

if __name__ == '__main__' and hasattr(sys, 'argv') and 'submit' in sys.argv:
    import JMTucker.Tools.Samples as Samples
    samples = Samples.from_argv(Samples.ttbar_samples + Samples.qcd_samples + Samples.mfv_signal_samples)

    from JMTucker.Tools.CRABSubmitter import CRABSubmitter
    cs = CRABSubmitter('EventIdsV18',
                       total_number_of_events = -1,
                       events_per_job = 1000000,
                       use_ana_dataset = True,
                       )
    cs.submit_all(samples)
示例#8
0
process.source.secondaryFileNames = cms.untracked.vstring(*'''/store/mc/Summer12_DR53X/TTJets_HadronicMGDecays_8TeV-madgraph/AODSIM/PU_S10_START53_V7A-v1/00000/0E9DCF01-0216-E211-934F-20CF3019DF0F.root
/store/mc/Summer12_DR53X/TTJets_HadronicMGDecays_8TeV-madgraph/AODSIM/PU_S10_START53_V7A-v1/00000/E0F2FA59-1016-E211-A573-00259073E3A8.root
/store/mc/Summer12_DR53X/TTJets_HadronicMGDecays_8TeV-madgraph/AODSIM/PU_S10_START53_V7A-v1/00000/5205EEA5-1016-E211-BBE1-90E6BA442F2B.root'''.split('\n'))

process.load('JMTucker.MFVNeutralino.VertexSelector_cfi')
process.load('JMTucker.MFVNeutralino.AnalysisCuts_cfi')
process.mfvAnalysisCutsOneVtx = process.mfvAnalysisCuts.clone(min_nvertex = 1)

process.WhichGenParticleOneVtx = cms.EDAnalyzer('MFVWhichGenParticle',
                                               gen_particles_src = cms.InputTag('genParticles'),
                                               mevent_src = cms.InputTag('mfvEvent'),
                                               vertices_src = cms.InputTag('mfvSelectedVerticesTight'),
                                               )
process.WhichGenParticleTwoVtx = process.WhichGenParticleOneVtx.clone()

process.p = cms.Path(process.mfvSelectedVerticesSeq * process.mfvAnalysisCutsOneVtx * process.WhichGenParticleOneVtx * process.mfvAnalysisCuts * process.WhichGenParticleTwoVtx)


if __name__ == '__main__' and hasattr(sys, 'argv') and 'submit' in sys.argv:
    import JMTucker.Tools.Samples as Samples
    samples = Samples.from_argv(Samples.ttbar_samples + Samples.qcd_samples)

    from JMTucker.Tools.CRABSubmitter import CRABSubmitter
    cs = CRABSubmitter('WhichGenParticle',
                       job_control_from_sample = True,
                       use_ana_dataset = True,
                       use_parent = True,
                       run_half_mc = True,
                       )
    cs.submit_all(samples)
示例#9
0
            err = 'trying to submit on data, and tuple template does not contain the magic string "%s"' % magic
            to_replace.append((magic, 'runOnMC = False', err))
            to_add.append('process.dummyToMakeDiffHash = cms.PSet(sampleName = cms.string("%s"))' % sample.name)
            to_add.append('process.patJetCorrFactors.levels.append("L2L3Residual")')

        return to_add, to_replace

    cs = CRABSubmitter('QuadJetTrigEff',
                       pset_modifier = modify,
                       job_control_from_sample = True,
                       max_threads = 2,
                       )

    mc_samples = [Samples.qcdmupt15] + Samples.ttbar_samples + Samples.leptonic_background_samples

    data_samples = [
        Samples.DataSample('SingleMu2012A', '/SingleMu/Run2012A-22Jan2013-v1/AOD'),
        Samples.DataSample('SingleMu2012B', '/SingleMu/Run2012B-22Jan2013-v1/AOD'),
        Samples.DataSample('SingleMu2012C', '/SingleMu/Run2012C-22Jan2013-v1/AOD'),
        Samples.DataSample('SingleMu2012D', '/SingleMu/Run2012D-22Jan2013-v1/AOD'),
        ]

    for sample in mc_samples:
        sample.events_per = 20000
    for sample in data_samples:
        sample.lumis_per = 50

    samples = Samples.from_argv(mc_samples + data_samples)

    cs.submit_all(samples)
示例#10
0
        process.p *= obj
        vtx_srcs.append(cms.InputTag(name))

process.nmx = cms.EDAnalyzer(
    'NmxHistos',
    weight_src=cms.InputTag('mfvWeight'),
    use_weight=cms.bool(False),
    vertex_srcs=cms.VInputTag(*vtx_srcs),
)

process.p *= process.nmx

if __name__ == '__main__' and hasattr(sys, 'argv') and 'submit' in sys.argv:
    import JMTucker.Tools.Samples as Samples
    samples = Samples.from_argv([
        Samples.mfv_neutralino_tau0100um_M0400, Samples.
        mfv_neutralino_tau1000um_M0400, Samples.mfv_neutralino_tau0300um_M0400,
        Samples.mfv_neutralino_tau9900um_M0400
    ] + Samples.ttbar_samples + Samples.qcd_samples + Samples.data_samples)

    for s in Samples.data_samples:
        s.json = 'ana_all.json'

    from JMTucker.Tools.CRABSubmitter import CRABSubmitter
    cs = CRABSubmitter(
        'NmxV20',
        job_control_from_sample=True,
        use_ana_dataset=True,
    )
    cs.submit_all(samples)