From 39e0ce0df87001465b09faae611281d5d7b7c36b Mon Sep 17 00:00:00 2001 From: Jim Pivarski Date: Sun, 30 Aug 2009 20:36:08 +0000 Subject: [PATCH] --- yaml --- r: 72701 b: "refs/heads/CMSSW_7_1_X" c: fd97a97dc24cd3c17a3642e0633fc1b516deba40 h: "refs/heads/CMSSW_7_1_X" i: 72699: 8c07281ec5ec536e3b4b14540d66620fd8d7e18f v: v3 --- [refs] | 2 +- .../python/createJobs.py | 37 ++++++++++++++++--- .../python/gather_cfg.py | 13 ++++++- 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 09ae072ce1437..afaee762670bc 100644 --- a/[refs] +++ b/[refs] @@ -1,3 +1,3 @@ --- refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e -"refs/heads/CMSSW_7_1_X": b5b5d6e00d19886bd3e4d85c87ca0806a6dad398 +"refs/heads/CMSSW_7_1_X": fd97a97dc24cd3c17a3642e0633fc1b516deba40 diff --git a/trunk/Alignment/MuonAlignmentAlgorithms/python/createJobs.py b/trunk/Alignment/MuonAlignmentAlgorithms/python/createJobs.py index f28b7fc4def10..8dbc57bbadf6b 100755 --- a/trunk/Alignment/MuonAlignmentAlgorithms/python/createJobs.py +++ b/trunk/Alignment/MuonAlignmentAlgorithms/python/createJobs.py @@ -2,6 +2,8 @@ import os, sys, optparse, math +commandline = " ".join(sys.argv) + usage = """%prog DIRNAME ITERATIONS INITIALGEOM INPUTFILES [options] Creates (overwrites) a directory for each of the iterations and creates (overwrites) submitJobs.sh with the submission sequence and dependencies. @@ -26,6 +28,19 @@ type="int", default=50, dest="subjobs") +parser.add_option("-s", "--submitJobs", + help="Alternate name of submitJobs.sh script (please include .sh extension)", + type="string", + default="submitJobs.sh", + dest="submitJobs") +parser.add_option("-b", "--big", + help="If invoked, even subjobs are so big that they must be run on cmscaf1nd", + action="store_true", + dest="big") +parser.add_option("--mapplots", + help="Make map plots", + action="store_true", + dest="mapplots") parser.add_option("--globalTag", help="GlobalTag for conditions not otherwise overridden", type="string", @@ -100,6 +115,7 @@ dest="minAlignmentHits") options, args = parser.parse_args(sys.argv[5:]) +mapplots = options.mapplots globaltag = options.globaltag trackerconnect = options.trackerconnect trackeralignment = options.trackeralignment @@ -145,8 +161,13 @@ gather_fileName = "%sgather%03d.sh" % (directory, jobnumber) inputfiles = " ".join(fileNames[jobnumber*stepsize:(jobnumber+1)*stepsize]) + if mapplots == True: copyplots = "plotting*.root" + else: copyplots = "" + if len(inputfiles) > 0: file(gather_fileName, "w").write("""#/bin/sh +# %(commandline)s + export ALIGNMENT_CAFDIR=`pwd` cd %(pwd)s @@ -156,6 +177,7 @@ export ALIGNMENT_INPUTFILES='%(inputfiles)s' export ALIGNMENT_ITERATION=%(iteration)d export ALIGNMENT_JOBNUMBER=%(jobnumber)d +export ALIGNMENT_MAPPLOTS=%(mapplots)s export ALIGNMENT_GLOBALTAG=%(globaltag)s export ALIGNMENT_INPUTDB=%(inputdb)s export ALIGNMENT_TRACKERCONNECT=%(trackerconnect)s @@ -178,18 +200,23 @@ ls -l cmsRun gather_cfg.py ls -l -cp -f *.tmp $ALIGNMENT_AFSDIR/%(directory)s +cp -f *.tmp %(copyplots)s $ALIGNMENT_AFSDIR/%(directory)s """ % vars()) os.system("chmod +x %s" % gather_fileName) bsubfile.append("echo %sgather%03d.sh" % (directory, jobnumber)) if last_align is None: waiter = "" - else: waiter = "-w \"ended(%s)\"" % last_align - bsubfile.append("bsub -q cmscaf1nh -J \"%s_gather%03d\" %s gather%03d.sh" % (director, jobnumber, waiter, jobnumber)) + else: waiter = "-w \"ended(%s)\"" % last_align + if options.big: queue = "cmscaf1nd" + else: queue = "cmscaf1nh" + + bsubfile.append("bsub -q %s -J \"%s_gather%03d\" %s gather%03d.sh" % (queue, director, jobnumber, waiter, jobnumber)) bsubnames.append("ended(%s_gather%03d)" % (director, jobnumber)) file("%salign.sh" % directory, "w").write("""#!/bin/sh +# %(commandline)s + export ALIGNMENT_CAFDIR=`pwd` cd %(pwd)s @@ -233,5 +260,5 @@ bsubnames = [] last_align = "%s_align" % director -file("submitJobs.sh", "w").write("\n".join(bsubfile)) -os.system("chmod +x submitJobs.sh") +file(options.submitJobs, "w").write("\n".join(bsubfile)) +os.system("chmod +x %s" % options.submitJobs) diff --git a/trunk/Alignment/MuonAlignmentAlgorithms/python/gather_cfg.py b/trunk/Alignment/MuonAlignmentAlgorithms/python/gather_cfg.py index 813ebaf31b581..c7f355535dd9a 100644 --- a/trunk/Alignment/MuonAlignmentAlgorithms/python/gather_cfg.py +++ b/trunk/Alignment/MuonAlignmentAlgorithms/python/gather_cfg.py @@ -4,6 +4,7 @@ inputfiles = os.environ["ALIGNMENT_INPUTFILES"].split(" ") iteration = int(os.environ["ALIGNMENT_ITERATION"]) jobnumber = int(os.environ["ALIGNMENT_JOBNUMBER"]) +mapplots = (os.environ["ALIGNMENT_MAPPLOTS"] == "True") globaltag = os.environ["ALIGNMENT_GLOBALTAG"] inputdb = os.environ["ALIGNMENT_INPUTDB"] trackerconnect = os.environ["ALIGNMENT_TRACKERCONNECT"] @@ -43,16 +44,24 @@ process.looper.algoConfig.twoBin = twoBin process.looper.algoConfig.minAlignmentHits = minAlignmentHits +if mapplots: + process.load("Alignment.CommonAlignmentMonitor.AlignmentMonitorMuonSystemMap1D_cfi") + process.looper.monitorConfig = cms.PSet(monitors = cms.untracked.vstring("AlignmentMonitorMuonSystemMap1D"), + AlignmentMonitorMuonSystemMap1D = process.AlignmentMonitorMuonSystemMap1D) + process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.GlobalTag.globaltag = cms.string(globaltag) process.looper.applyDbAlignment = True process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi") +process.OnlyGlobalCSCs = cms.EDFilter("OnlyGlobalCSCs") +process.MuonAlignmentFromReferenceGlobalCosmicRefit.Tracks = cms.InputTag("globalCosmicMuons") + if iscosmics: - process.Path = cms.Path(process.offlineBeamSpot * process.MuonAlignmentFromReferenceGlobalCosmicRefit) + process.Path = cms.Path(process.offlineBeamSpot * process.OnlyGlobalCSCs * process.MuonAlignmentFromReferenceGlobalCosmicRefit) process.looper.tjTkAssociationMapTag = cms.InputTag("MuonAlignmentFromReferenceGlobalCosmicRefit:Refitted") else: - process.Path = cms.Path(process.offlineBeamSpot * process.MuonAlignmentFromReferenceGlobalMuonRefit) + process.Path = cms.Path(process.offlineBeamSpot * process.OnlyGlobalCSCs * process.MuonAlignmentFromReferenceGlobalMuonRefit) process.looper.tjTkAssociationMapTag = cms.InputTag("MuonAlignmentFromReferenceGlobalMuonRefit:Refitted") process.MuonAlignmentFromReferenceInputDB.connect = cms.string("sqlite_file:%s" % inputdb)