コード例 #1
0
from JMTucker.Tools.general import typed_from_argv
from JMTucker.Tools.CMSSWTools import *
from JMTucker.Tools.BasicAnalyzer_cfg import cms, process

process.TFileService.fileName = 'mctruth.root'

process.load('JMTucker.MFVNeutralino.WeightProducer_cfi')
process.p = cms.Path(process.mfvWeight)

process.mfvMovedTree = cms.EDAnalyzer('MFVMovedTracksTreer',
                                      event_src = cms.InputTag('mfvEvent'),
                                      weight_src = cms.InputTag('mfvWeight'),
                                      mover_src = cms.string(''),
                                      vertices_src = cms.InputTag('mfvVerticesAux'),
                                      max_dist2move = cms.double(-1),
                                      apply_presel = cms.bool(False),
                                      njets_req = cms.uint32(0),
                                      nbjets_req = cms.uint32(0),
                                      for_mctruth = cms.bool(True),
                                      )

process.p *= process.mfvMovedTree
file_event_from_argv(process)

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

    cs = CRABSubmitter('TrackMoverMCTruthV6p1_76X',
                       dataset = 'ntuplev6p1_76x_nstlays3',
                       job_control_from_sample = True,
コード例 #2
0
ファイル: test_lists.py プロジェクト: mez34/cmssw-usercode
import sys
from JMTucker.Tools.BasicAnalyzer_cfg import cms, process
process.TFileService.fileName = cms.string('evids.root')

process.source.fileNames = ['/store/user/tucker/TTJets_HadronicMGDecays_8TeV-madgraph/mfvntuple_v17/f1615d49c4ae9d19e350601d059c4237/ntuple_600_1_BPu.root']
process.evids = cms.EDAnalyzer('EventIdRecorder')
process.veto = cms.EDFilter('EventIdVeto', list_fn = cms.string('ttbarhadronic.txt.gz'), use_run = cms.bool(False))
process.p = cms.Path(~process.veto * process.evids)

process.options.wantSummary = True

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

    bkg_samples = Samples.ttbar_samples + Samples.qcd_samples

    from JMTucker.Tools.CRABSubmitter import CRABSubmitter
    from JMTucker.Tools.SampleFiles import SampleFiles

    def pset_modifier(sample):
        to_add = []
        to_modify = []
        to_add.append("process.veto.list_fn = '%s.txt.gz'" % sample.name)
        return to_add, to_modify

    def crab_cfg_modifier(sample):
        return [('USER', 'additional_input_files', '/uscms/home/tucker/mfvrecipe/HalfMCLists/%s.txt.gz' % sample.name)]

    cs = CRABSubmitter('HalfMCLists_TestLists',
コード例 #3
0
#process.load('SimTracker.TrackAssociation.TrackAssociatorByHits_cfi')
#process.load('Configuration.Geometry.GeometryIdeal_cff')
#process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
#process.GlobalTag.globaltag = 'START53_V13::All'
#process.load('TrackingTools.TransientTrack.TransientTrackBuilder_cfi')

process.CheckGenParticleBarcodes = cms.EDAnalyzer('CheckGenParticleBarcodes',
                                                  gen_particles_src = cms.InputTag('genParticles'),
                                                  tracking_particles_src = cms.InputTag('mergedtruth','MergedTrackTruth'),
                                                  )

process.mfvGenParticles = cms.EDProducer('MFVGenParticles',
                                         gen_src = cms.InputTag('genParticles'),
                                         gen_jet_src = cms.InputTag('ak4GenJets'),
                                         gen_met_src = cms.InputTag('genMetTrue'),
                                         print_info = cms.bool(True),
                                         )

process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')

process.printList = cms.EDAnalyzer('ParticleListDrawer',
                                   maxEventsToPrint = cms.untracked.int32(100),
                                   src = cms.InputTag('genParticles'),
                                   printOnlyHardInteraction = cms.untracked.bool(False),
                                   useMessageLogger = cms.untracked.bool(False),
                                   printVertex = cms.untracked.bool(True),
                                   )

process.printList2 = process.printList.clone(src = cms.InputTag('mfvGenParticles', 'All'))
process.printList3 = process.printList.clone(src = cms.InputTag('mfvGenParticles', 'Visible'))
コード例 #4
0
ファイル: track_assoc.py プロジェクト: mez34/cmssw-usercode
process.MessageLogger.cerr.FwkReport.reportEvery = 1
geometry_etc(process, 'START53_V27::All')
process.source.fileNames = ['file:reco.root']
process.source.secondaryFileNames = cms.untracked.vstring('file:gensimhlt.root')
process.load('SimTracker.TrackAssociation.TrackAssociatorByHits_cfi')
process.TFileService.fileName = 'TrackAssociator.root'

process.TrackAssociator = cms.EDAnalyzer('MFVTrackAssociator',
                                         tracks_src = cms.InputTag('generalTracks'),
                                         sim_tracks_src = cms.InputTag('g4SimHits'),
                                         sim_vertices_src = cms.InputTag('g4SimHits'),
                                         tracking_particles_src = cms.InputTag('mergedtruth','MergedTrackTruth'),
                                         gen_particles_src = cms.InputTag('genParticles'),
                                         rec_vertices_src = cms.InputTag('mfvInclusiveVertexFinder'),
                                         do_checks = cms.bool(True),
                                         )

process.load('JMTucker.MFVNeutralino.GenParticles_cff')

process.load('JMTucker.Tools.ParticleListDrawer_cff')
process.ParticleListDrawer2 = process.ParticleListDrawer.clone(src = cms.InputTag('mfvGenParticles', 'All'))
process.ParticleListDrawer3 = process.ParticleListDrawer.clone(src = cms.InputTag('mfvGenParticles', 'Visible'))

process.load('CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi')
process.goodOfflinePrimaryVertices.filter = cms.bool(True)

process.load('JMTucker.MFVNeutralino.VertexReco_cff')

process.p2 = cms.Path(process.mfvGenParticles * process.ParticleListDrawer2 * process.ParticleListDrawer3 * process.ParticleListDrawer)
process.p = cms.Path(process.mfvVertexReco *  process.TrackAssociator)
コード例 #5
0
ファイル: track_play.py プロジェクト: mez34/cmssw-usercode
                                               )
process.p = cms.Path(process.mfvTrackingPlay)

cuts = [
    ('Qpt0p5eta2p4DRJet0p4',        'pt > 0.5 && abs(eta) < 2.4'),
    ('Qpt0p5eta2p4DRJet0p4JetPt80', 'pt > 0.5 && abs(eta) < 2.4'),
    ('Qpt5eta2p4',                  'pt > 5   && abs(eta) < 2.4'),
    ('Qpt5eta2p48hits',             'pt > 5   && abs(eta) < 2.4 && hitPattern.numberOfValidHits >= 8'),
    ('Qpt5eta2p48hitsdxy0p1',       'pt > 5   && abs(eta) < 2.4 && hitPattern.numberOfValidHits >= 8'),
    ('Qpt20eta2p48hitsdxy0p1',      'pt > 20  && abs(eta) < 2.4 && hitPattern.numberOfValidHits >= 8'),
    ]

for cut_name, cut in cuts:
    filt = cms.EDFilter('TrackSelector',
                        src = ana.track_src,
                        filter = cms.bool(False),
                        cut = cms.string(cut),
                        )
    setattr(process, cut_name, filt)
    cut_ana = ana.clone(track_src = cut_name)
    if 'dxy0p1' in cut_name:
        cut_ana.dxy_cut = 0.1
    if 'dxy0p5' in cut_name:
        cut_ana.dxy_cut = 0.5
    if 'highPur' in cut_name:
        cut_ana.quality_cut = 'highPurity'
    if 'JetDR0p4' in cut_name:
        cut_ana.delta_r_jet_cut = 0.4
    if 'JetPt80' in cut_name:
        cut_ana.jet_pt_cut = 80
    setattr(process, 'mfvTrackingPlay' + cut_name, cut_ana)
コード例 #6
0
process.options.wantSummary = True
process.source.fileNames = ['/store/user/jchu/mfv_neutralino_tau1000um_M0200/jtuple_v7/5d4c2a74c85834550d3f9609274e8548/pat_11_1_css.root']
process.source.secondaryFileNames = cms.untracked.vstring('/store/user/tucker/mfv_neutralino_tau1000um_M0200/mfv_neutralino_tau1000um_M0200/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_1048_1_yBl.root')
set_events_to_process(process, [(1,1048,26)])

process.TFileService.fileName = 'pileup_play.root'

add_analyzer('PileupRemovalPlay',
             pucands_src = cms.InputTag('pfPileUpPF'),
             nonpucands_src = cms.InputTag('pfNoPileUpPF'),
             pf_jets_src = cms.InputTag('ak4PFJets'),
             pat_jets_src = cms.InputTag('selectedPatJetsPF'),
             pv_src = cms.InputTag('goodOfflinePrimaryVertices'),
             ltmm_src = cms.InputTag('mfvTrackMatches'),
             pt_cut = cms.double(0),
             verbose = cms.bool(True),
             )

process.PileupRemovalPlayNoZCheck = process.PileupRemovalPlay.clone(pucands_src = 'pfPileUpNoClosestZVertexPF',
                                                                    nonpucands_src = 'pfNoPileUpNoClosestZVertexPF')
process.PileupRemovalPlayPt5 = process.PileupRemovalPlay.clone(pt_cut = 5)
process.PileupRemovalPlayNoZCheckPt5 = process.PileupRemovalPlayNoZCheck.clone(pt_cut = 5)
#process.pPileupRemovalPlay *= process.PileupRemovalPlayNoZCheck * process.PileupRemovalPlayPt5 * process.PileupRemovalPlayNoZCheckPt5

process.load('JMTucker.MFVNeutralino.RedoPURemoval_cff')
process.pPileupRemovalPlay.replace(process.PileupRemovalPlay, process.mfvRedoPURemoval * process.PileupRemovalPlay)

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

    mfv_neutralino_tau0000um_M0400.ana_dataset_override = '/mfv_neutralino_tau0000um_M0400/jchu-jtuple_pileupremovalstudies_v6-5c257295836d18fbf020b73449ad9b5f/USER'
コード例 #7
0
ファイル: nmx.py プロジェクト: jordantucker/cmssw-usercode
for i in xrange(len(cuts)+1):
    for cut_combs in combinations(all_cuts, i):
        name = ''.join(cut_combs)
        if name == '':
            name = 'none'
        cut = ', '.join(cuts[x] for x in cut_combs)
        obj = eval('vtx_sel.clone(vertex_src = "%s", %s)' % (name, cut))
        print name, cut
        setattr(process, name, obj)
        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'
コード例 #8
0
import os, sys
from JMTucker.Tools.BasicAnalyzer_cfg import cms, process

process.source.fileNames = ['/store/mc/Summer12_DR53X/TTJets_HadronicMGDecays_8TeV-madgraph/AODSIM/PU_S10_START53_V7A-v1/00000/002A756C-FA15-E211-9FA6-485B39800B75.root']
process.TFileService.fileName = 'tracker_mapper.root'

#process.source.fileNames = ['/store/user/tucker/RelValSingleMuPt1000_CMSSW_5_3_6-START53_V14-v2_GEN-SIM-RECO.7C1AEF1C-FF29-E211-BA60-003048678B20.root']

process.TrackerMapper = cms.EDAnalyzer('TrackerMapper',
                                       track_src = cms.InputTag('generalTracks'),
                                       use_rechits = cms.bool(False)
                                       )
process.p = cms.Path(process.TrackerMapper)

if 1:
    process.source.fileNames = ['file:/uscms/home/tucker/scratch/reco_1_2_L1S.root']
    process.TrackerMapper.use_rechits = True

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

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

    from JMTucker.Tools.CRABSubmitter import CRABSubmitter
    cs = CRABSubmitter('TrackerMapper',
                       total_number_of_events = -1,
                       events_per_job = 500000,
                       )
    cs.submit_all([Samples.myttbarpydesignnoputkex])
コード例 #9
0
import os, sys
from JMTucker.Tools.BasicAnalyzer_cfg import cms, process

process.source.fileNames = ['/store/user/jchu/mfv_neutralino_tau1000um_M0400/jtuple_v7/5d4c2a74c85834550d3f9609274e8548/pat_1_1_hdB.root']
process.source.secondaryFileNames = cms.untracked.vstring('/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_891_1_sZ9.root','/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/aodpat_948_2_lgB.root')
process.TFileService.fileName = 'leptonic_nb_analysis.root'

process.load('Configuration.Geometry.GeometryIdeal_cff')
process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.GlobalTag.globaltag = 'START53_V21::All'
process.load('TrackingTools.TransientTrack.TransientTrackBuilder_cfi')

process.load('CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi')
process.goodOfflinePrimaryVertices.filter = cms.bool(True)
process.load('JMTucker.MFVNeutralino.Vertexer_cff')

process.p = cms.EDAnalyzer('LeptonicNBAnalysis',
                           trigger_results_src = cms.InputTag('TriggerResults', '', 'HLT'),
                           primary_vertex_src = cms.InputTag('goodOfflinePrimaryVertices'),
                           secondary_vertex_src = cms.InputTag('mfvSelectedVerticesTight'),
                           muon_src = cms.InputTag('selectedPatMuonsPF'),
                           min_nmuons = cms.int32(1),
                           jet_src = cms.InputTag('selectedPatJetsPF'),
                           min_jet_pt = cms.double(30.0),
                           max_jet_eta = cms.double(2.4),
                           min_njets = cms.int32(6),
                           b_discriminator_name = cms.string('combinedSecondaryVertexBJetTags'),
                           bdisc_min = cms.double(0.679),
                           min_nbtags = cms.int32(1),
                           muon_stations_min = cms.bool(True),
コード例 #10
0
import sys, os
from JMTucker.Tools.BasicAnalyzer_cfg import cms, process
process.load('Configuration.Geometry.GeometryIdeal_cff')
process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.GlobalTag.globaltag = 'START53_V21::All'
process.load('TrackingTools.TransientTrack.TransientTrackBuilder_cfi')
process.load('CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi')
process.goodOfflinePrimaryVertices.filter = cms.bool(False)

process.load('JMTucker.MFVNeutralino.Vertexer_cff')
process.MessageLogger.cerr.FwkReport.reportEvery = 1

process.TFileService.fileName = 'ass_thrust.root'
process.maxEvents.input = 100
process.options.SkipEvent = cms.untracked.vstring('ProductNotFound')

file = open('files.txt', 'r')
myfilelist = cms.untracked.vstring()
for line in file:
	string = "/store/user/tucker/mfv_neutralino_tau1000um_M0400/mfv_neutralino_tau1000um_M0400/a6ab3419cb64660d6c68351b3cff9fb0/"+line
    # add as many files as you wish this way
	myfilelist.extend( [string] )

process.source = cms.Source('PoolSource', fileNames = myfilelist)

process.thrustNtuple = cms.EDAnalyzer('MFVThrustAnalysis',
                                      gen_particles_src = cms.InputTag('genParticles'),
                                      gen_jets_src = cms.InputTag('ak4GenJets'),
                                      gen_met_src = cms.InputTag('genMetTrue'),
                                      met_src = cms.InputTag('patMETsPF'),
コード例 #11
0
for i in xrange(len(cuts) + 1):
    for cut_combs in combinations(all_cuts, i):
        name = ''.join(cut_combs)
        if name == '':
            name = 'none'
        cut = ', '.join(cuts[x] for x in cut_combs)
        obj = eval('vtx_sel.clone(vertex_src = "%s", %s)' % (name, cut))
        print name, cut
        setattr(process, name, obj)
        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'