Ejemplo n.º 1
0
def minitree_only(process, mode, settings, output_commands):
    if mode:
        mode = str(mode)

        if 'both' not in mode:
            del process.out
            del process.outp

        if '2' in mode:
            from JMTucker.Tools.NtupleFiller_cff import jmtNtupleFiller_pset
            process.load('JMTucker.MFVNeutralino.VertexSelector_cfi')
            process.load('JMTucker.MFVNeutralino.AnalysisCuts_cfi')
            from JMTucker.MFVNeutralino.Vertexer_cfi import kvr_params
            process.mfvMiniTree2 = cms.EDAnalyzer(
                'MFVMiniTreer2',
                jmtNtupleFiller_pset(settings.is_miniaod, True),
                kvr_params=kvr_params,
                vertices_src=cms.InputTag('mfvVertices'),
                auxes_src=cms.InputTag('mfvVerticesAuxPresel'),
                vertex_sel=cms.string('tight' if 'tight' in mode else 'loose'),
            )
            weight_obj = process.jmtWeightMiniAOD if settings.is_miniaod else process.jmtWeight
            process.p *= weight_obj * process.mfvMiniTree2
        else:
            process.load('JMTucker.MFVNeutralino.MiniTree_cff')
            process.mfvWeight.throw_if_no_mcstat = False
            for p in process.pMiniTree, process.pMiniTreeNtk3, process.pMiniTreeNtk4, process.pMiniTreeNtk3or4:
                p.insert(0, process.pmcStat._seq)
                p.insert(0, process.p._seq)

        process.TFileService.fileName = 'minintuple.root'
Ejemplo n.º 2
0
####

process = ntuple_process(settings)
remove_output_module(process)
tfileservice(process, 'splitpv.root')
dataset = 'miniaod' if settings.is_miniaod else 'main'
sample_files(process, 'qcdht1500_2017' if settings.is_mc else 'JetHT2017F', dataset, 1)
cmssw_from_argv(process)

####

from JMTucker.Tools.NtupleFiller_cff import jmtNtupleFiller_pset

from JMTucker.MFVNeutralino.Vertexer_cfi import kvr_params
process.mfvSplitPVs = cms.EDAnalyzer('MFVSplitPV',
                                     jmtNtupleFiller_pset(settings.is_miniaod),
                                     kvr_params = kvr_params,
                                     debug = cms.untracked.bool(debug),
                                     )

process.p = cms.Path(process.mfvEventFilterSequence * process.goodOfflinePrimaryVertices * process.mfvSplitPVs)

ReferencedTagsTaskAdder(process)('p')


if __name__ == '__main__' and hasattr(sys, 'argv') and 'submit' in sys.argv:
    from JMTucker.Tools.MetaSubmitter import *
    from JMTucker.Tools import Samples

    if year == 2017:
        samples = Samples.data_samples_2017 + Samples.qcd_samples_2017