Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72701
b: "refs/heads/CMSSW_7_1_X"
c: fd97a97
h: "refs/heads/CMSSW_7_1_X"
i:
  72699: 8c07281
v: v3
  • Loading branch information
Jim Pivarski committed Aug 30, 2009
1 parent 54f5121 commit 39e0ce0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 09c786f70121f131b3715aaf3464996502bbeb7e
"refs/heads/CMSSW_7_1_X": b5b5d6e00d19886bd3e4d85c87ca0806a6dad398
"refs/heads/CMSSW_7_1_X": fd97a97dc24cd3c17a3642e0633fc1b516deba40
37 changes: 32 additions & 5 deletions trunk/Alignment/MuonAlignmentAlgorithms/python/createJobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
13 changes: 11 additions & 2 deletions trunk/Alignment/MuonAlignmentAlgorithms/python/gather_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 39e0ce0

Please sign in to comment.