4 inputfiles = os.environ[
"ALIGNMENT_INPUTFILES"].
split(
" ")
5 iteration = int(os.environ[
"ALIGNMENT_ITERATION"])
6 jobnumber = int(os.environ[
"ALIGNMENT_JOBNUMBER"])
7 mapplots = (os.environ[
"ALIGNMENT_MAPPLOTS"] ==
"True")
8 segdiffplots = (os.environ[
"ALIGNMENT_SEGDIFFPLOTS"] ==
"True")
9 curvatureplots = (os.environ[
"ALIGNMENT_CURVATUREPLOTS"] ==
"True")
10 globaltag = os.environ[
"ALIGNMENT_GLOBALTAG"]
11 inputdb = os.environ[
"ALIGNMENT_INPUTDB"]
12 trackerconnect = os.environ[
"ALIGNMENT_TRACKERCONNECT"]
13 trackeralignment = os.environ[
"ALIGNMENT_TRACKERALIGNMENT"]
14 trackerAPEconnect = os.environ[
"ALIGNMENT_TRACKERAPECONNECT"]
15 trackerAPE = os.environ[
"ALIGNMENT_TRACKERAPE"]
16 gprcdconnect = os.environ[
"ALIGNMENT_GPRCDCONNECT"]
17 gprcd = os.environ[
"ALIGNMENT_GPRCD"]
18 iscosmics = (os.environ[
"ALIGNMENT_ISCOSMICS"] ==
"True")
19 station123params = os.environ[
"ALIGNMENT_STATION123PARAMS"]
20 station4params = os.environ[
"ALIGNMENT_STATION4PARAMS"]
21 cscparams = os.environ[
"ALIGNMENT_CSCPARAMS"]
22 minTrackPt = float(os.environ[
"ALIGNMENT_MINTRACKPT"])
23 maxTrackPt = float(os.environ[
"ALIGNMENT_MAXTRACKPT"])
24 minTrackerHits = int(os.environ[
"ALIGNMENT_MINTRACKERHITS"])
25 maxTrackerRedChi2 = float(os.environ[
"ALIGNMENT_MAXTRACKERREDCHI2"])
26 allowTIDTEC = (os.environ[
"ALIGNMENT_ALLOWTIDTEC"] ==
"True")
27 twoBin = (os.environ[
"ALIGNMENT_TWOBIN"] ==
"True")
28 weightAlignment = (os.environ[
"ALIGNMENT_WEIGHTALIGNMENT"] ==
"True")
29 minAlignmentHits = int(os.environ[
"ALIGNMENT_MINALIGNMENTHITS"])
30 combineME11 = (os.environ[
"ALIGNMENT_COMBINEME11"] ==
"True")
31 maxEvents = int(os.environ[
"ALIGNMENT_MAXEVENTS"])
32 skipEvents = int(os.environ[
"ALIGNMENT_SKIPEVENTS"])
33 maxResSlopeY = float(os.environ[
"ALIGNMENT_MAXRESSLOPEY"])
35 process = cms.Process(
"GATHER")
36 process.source = cms.Source(
"PoolSource", fileNames = cms.untracked.vstring(*inputfiles), skipEvents = cms.untracked.uint32(skipEvents))
37 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(maxEvents))
39 process.MessageLogger = cms.Service(
"MessageLogger",
40 destinations = cms.untracked.vstring(
"cout"),
41 cout = cms.untracked.PSet(threshold = cms.untracked.string(
"ERROR")))
43 process.load(
"Alignment.MuonAlignmentAlgorithms.MuonAlignmentFromReference_cff")
44 process.looper.algoConfig.writeTemporaryFile =
"alignment%03d.tmp" % jobnumber
45 process.looper.algoConfig.doAlignment =
False
47 process.looper.ParameterBuilder.Selector.alignParams = cms.vstring(
"MuonDTChambers,%s,stations123" % station123params,
"MuonDTChambers,%s,station4" % station4params,
"MuonCSCChambers,%s" % cscparams)
48 process.looper.algoConfig.minTrackPt = minTrackPt
49 process.looper.algoConfig.maxTrackPt = maxTrackPt
50 process.looper.algoConfig.minTrackerHits = minTrackerHits
51 process.looper.algoConfig.maxTrackerRedChi2 = maxTrackerRedChi2
52 process.looper.algoConfig.allowTIDTEC = allowTIDTEC
53 process.looper.algoConfig.twoBin = twoBin
54 process.looper.algoConfig.weightAlignment = weightAlignment
55 process.looper.algoConfig.minAlignmentHits = minAlignmentHits
56 process.looper.algoConfig.combineME11 = combineME11
57 process.looper.algoConfig.maxResSlopeY = maxResSlopeY
59 process.looper.monitorConfig = cms.PSet(monitors = cms.untracked.vstring())
62 process.load(
"Alignment.CommonAlignmentMonitor.AlignmentMonitorMuonSystemMap1D_cfi")
63 process.looper.monitorConfig.monitors.append(
"AlignmentMonitorMuonSystemMap1D")
64 process.looper.monitorConfig.AlignmentMonitorMuonSystemMap1D = process.AlignmentMonitorMuonSystemMap1D
65 process.looper.monitorConfig.AlignmentMonitorMuonSystemMap1D.minTrackPt = cms.double(minTrackPt)
66 process.looper.monitorConfig.AlignmentMonitorMuonSystemMap1D.maxTrackPt = cms.double(maxTrackPt)
67 process.looper.monitorConfig.AlignmentMonitorMuonSystemMap1D.minTrackerHits = cms.int32(minTrackerHits)
68 process.looper.monitorConfig.AlignmentMonitorMuonSystemMap1D.maxTrackerRedChi2 = cms.double(maxTrackerRedChi2)
69 process.looper.monitorConfig.AlignmentMonitorMuonSystemMap1D.allowTIDTEC = cms.bool(allowTIDTEC)
70 process.looper.monitorConfig.AlignmentMonitorMuonSystemMap1D.minDT13Hits = process.looper.algoConfig.minDT13Hits
71 process.looper.monitorConfig.AlignmentMonitorMuonSystemMap1D.minDT2Hits = process.looper.algoConfig.minDT2Hits
72 process.looper.monitorConfig.AlignmentMonitorMuonSystemMap1D.minCSCHits = process.looper.algoConfig.minCSCHits
75 process.load(
"Alignment.CommonAlignmentMonitor.AlignmentMonitorSegmentDifferences_cfi")
76 process.looper.monitorConfig.monitors.append(
"AlignmentMonitorSegmentDifferences")
77 process.looper.monitorConfig.AlignmentMonitorSegmentDifferences = process.AlignmentMonitorSegmentDifferences
80 process.looper.monitorConfig.AlignmentMonitorSegmentDifferences.minTrackerHits = cms.int32(minTrackerHits)
81 process.looper.monitorConfig.AlignmentMonitorSegmentDifferences.maxTrackerRedChi2 = cms.double(maxTrackerRedChi2)
82 process.looper.monitorConfig.AlignmentMonitorSegmentDifferences.allowTIDTEC = cms.bool(allowTIDTEC)
83 process.looper.monitorConfig.AlignmentMonitorSegmentDifferences.minDT13Hits = process.looper.algoConfig.minDT13Hits
84 process.looper.monitorConfig.AlignmentMonitorSegmentDifferences.minDT2Hits = process.looper.algoConfig.minDT2Hits
85 process.looper.monitorConfig.AlignmentMonitorSegmentDifferences.minCSCHits = process.looper.algoConfig.minCSCHits
88 process.load(
"Alignment.CommonAlignmentMonitor.AlignmentMonitorMuonVsCurvature_cfi")
89 process.looper.monitorConfig.monitors.append(
"AlignmentMonitorMuonVsCurvature")
90 process.looper.monitorConfig.AlignmentMonitorMuonVsCurvature = process.AlignmentMonitorMuonVsCurvature
91 process.looper.monitorConfig.AlignmentMonitorMuonVsCurvature.minTrackerHits = cms.int32(minTrackerHits)
92 process.looper.monitorConfig.AlignmentMonitorMuonVsCurvature.maxTrackerRedChi2 = cms.double(maxTrackerRedChi2)
93 process.looper.monitorConfig.AlignmentMonitorMuonVsCurvature.allowTIDTEC = cms.bool(allowTIDTEC)
94 process.looper.monitorConfig.AlignmentMonitorMuonVsCurvature.minDT13Hits = process.looper.algoConfig.minDT13Hits
95 process.looper.monitorConfig.AlignmentMonitorMuonVsCurvature.minDT2Hits = process.looper.algoConfig.minDT2Hits
96 process.looper.monitorConfig.AlignmentMonitorMuonVsCurvature.minCSCHits = process.looper.algoConfig.minCSCHits
98 process.load(
"Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
99 process.GlobalTag.globaltag = cms.string(globaltag)
100 process.looper.applyDbAlignment =
True
101 process.load(
"RecoVertex.BeamSpotProducer.BeamSpot_cfi")
104 process.Path = cms.Path(process.offlineBeamSpot * process.MuonAlignmentFromReferenceGlobalCosmicRefit)
105 process.looper.tjTkAssociationMapTag = cms.InputTag(
"MuonAlignmentFromReferenceGlobalCosmicRefit:Refitted")
107 process.Path = cms.Path(process.offlineBeamSpot * process.MuonAlignmentFromReferenceGlobalMuonRefit)
108 process.looper.tjTkAssociationMapTag = cms.InputTag(
"MuonAlignmentFromReferenceGlobalMuonRefit:Refitted")
110 process.MuonAlignmentFromReferenceInputDB.connect = cms.string(
"sqlite_file:%s" % inputdb)
111 process.MuonAlignmentFromReferenceInputDB.toGet = cms.VPSet(cms.PSet(record = cms.string(
"DTAlignmentRcd"), tag = cms.string(
"DTAlignmentRcd")),
112 cms.PSet(record = cms.string(
"CSCAlignmentRcd"), tag = cms.string(
"CSCAlignmentRcd")))
114 if trackerconnect !=
"":
116 process.TrackerAlignmentInputDB = cms.ESSource(
"PoolDBESSource",
118 connect = cms.string(trackerconnect),
119 toGet = cms.VPSet(cms.PSet(record = cms.string(
"TrackerAlignmentRcd"), tag = cms.string(trackeralignment))))
120 process.es_prefer_TrackerAlignmentInputDB = cms.ESPrefer(
"PoolDBESSource",
"TrackerAlignmentInputDB")
122 if trackerAPEconnect !=
"":
124 process.TrackerAlignmentErrorInputDB = cms.ESSource(
"PoolDBESSource",
126 connect = cms.string(trackerAPEconnect),
127 toGet = cms.VPSet(cms.PSet(cms.PSet(record = cms.string(
"TrackerAlignmentErrorRcd"), tag = cms.string(trackerAPE)))))
128 process.es_prefer_TrackerAlignmentErrorInputDB = cms.ESPrefer(
"PoolDBESSource",
"TrackerAlignmentErrorInputDB")
130 if gprcdconnect !=
"":
132 process.GlobalPositionInputDB = cms.ESSource(
"PoolDBESSource",
134 connect = cms.string(gprcdconnect),
135 toGet = cms.VPSet(cms.PSet(record = cms.string(
"GlobalPositionRcd"), tag = cms.string(gprcd))))
136 process.es_prefer_GlobalPositionInputDB = cms.ESPrefer(
"PoolDBESSource",
"GlobalPositionInputDB")
138 process.looper.saveToDB =
False
139 process.looper.saveApeToDB =
False
140 del process.PoolDBOutputService
142 process.TFileService = cms.Service(
"TFileService", fileName = cms.string(
"plotting%03d.root" % jobnumber))