2 import FWCore.ParameterSet.Config
as cms
4 alignmenttmp = os.environ[
"ALIGNMENT_ALIGNMENTTMP"].
split(
"\n")
5 iteration =
int(os.environ[
"ALIGNMENT_ITERATION"])
7 globaltag = os.environ[
"ALIGNMENT_GLOBALTAG"]
8 inputdb = os.environ[
"ALIGNMENT_INPUTDB"]
9 trackerconnect = os.environ[
"ALIGNMENT_TRACKERCONNECT"]
10 trackeralignment = os.environ[
"ALIGNMENT_TRACKERALIGNMENT"]
11 trackerAPEconnect = os.environ[
"ALIGNMENT_TRACKERAPECONNECT"]
12 trackerAPE = os.environ[
"ALIGNMENT_TRACKERAPE"]
13 trackerBowsconnect = os.environ[
"ALIGNMENT_TRACKERBOWSCONNECT"]
14 trackerBows = os.environ[
"ALIGNMENT_TRACKERBOWS"]
15 gprcdconnect = os.environ[
"ALIGNMENT_GPRCDCONNECT"]
16 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 minTrackP =
float(os.environ[
"ALIGNMENT_MINTRACKP"])
25 maxTrackP =
float(os.environ[
"ALIGNMENT_MAXTRACKP"])
26 minTrackerHits =
int(os.environ[
"ALIGNMENT_MINTRACKERHITS"])
27 maxTrackerRedChi2 =
float(os.environ[
"ALIGNMENT_MAXTRACKERREDCHI2"])
28 allowTIDTEC = (os.environ[
"ALIGNMENT_ALLOWTIDTEC"] ==
"True")
29 twoBin = (os.environ[
"ALIGNMENT_TWOBIN"] ==
"True")
30 weightAlignment = (os.environ[
"ALIGNMENT_WEIGHTALIGNMENT"] ==
"True")
31 minAlignmentHits =
int(os.environ[
"ALIGNMENT_MINALIGNMENTHITS"])
32 combineME11 = (os.environ[
"ALIGNMENT_COMBINEME11"] ==
"True")
33 maxResSlopeY =
float(os.environ[
"ALIGNMENT_MAXRESSLOPEY"])
34 residualsModel = os.environ[
"ALIGNMENT_RESIDUALSMODEL"]
35 peakNSigma =
float(os.environ[
"ALIGNMENT_PEAKNSIGMA"])
36 useResiduals = os.environ[
"ALIGNMENT_USERESIDUALS"]
41 envDT = os.getenv(
"ALIGNMENT_DO_DT")
42 envCSC = os.getenv(
"ALIGNMENT_DO_CSC")
43 if envDT
is not None and envCSC
is not None:
44 if envDT==
'True' and envCSC==
'False':
47 if envDT==
'False' and envCSC==
'True':
52 createAlignNtuple =
False 53 envNtuple = os.getenv(
"ALIGNMENT_CREATEALIGNNTUPLE")
54 if envNtuple
is not None:
55 if envNtuple==
'True': createAlignNtuple =
True 58 process = cms.Process(
"ALIGN")
59 process.source = cms.Source(
"EmptySource")
60 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
62 process.load(
"Configuration.StandardSequences.Reconstruction_cff")
64 process.MuonNumberingInitialization = cms.ESProducer(
"MuonNumberingInitialization")
65 process.MuonNumberingRecord = cms.ESSource(
"EmptyESSource",
66 recordName = cms.string(
"MuonNumberingRecord" ),
67 iovIsRunNotTime = cms.bool(
True ),
68 firstValid = cms.vuint32( 1 )
71 process.load(
"Configuration.Geometry.GeometryIdeal_cff")
72 process.load(
"Configuration.StandardSequences.MagneticField_cff")
74 process.load(
"Alignment.MuonAlignmentAlgorithms.MuonAlignmentFromReference_cff")
75 process.looper.algoConfig.readTemporaryFiles = cms.vstring(*alignmenttmp)
76 process.looper.algoConfig.reportFileName = cms.string(
"MuonAlignmentFromReference_report.py")
78 process.looper.ParameterBuilder.Selector.alignParams = cms.vstring(
"MuonDTChambers,%s,stations123" % station123params,
"MuonDTChambers,%s,station4" % station4params,
"MuonCSCChambers,%s" % cscparams)
79 process.looper.algoConfig.minTrackPt = minTrackPt
80 process.looper.algoConfig.maxTrackPt = maxTrackPt
81 process.looper.algoConfig.minTrackP = minTrackP
82 process.looper.algoConfig.maxTrackP = maxTrackP
83 process.looper.algoConfig.minTrackerHits = minTrackerHits
84 process.looper.algoConfig.maxTrackerRedChi2 = maxTrackerRedChi2
85 process.looper.algoConfig.allowTIDTEC = allowTIDTEC
86 process.looper.algoConfig.twoBin = twoBin
87 process.looper.algoConfig.weightAlignment = weightAlignment
88 process.looper.algoConfig.minAlignmentHits = minAlignmentHits
89 process.looper.algoConfig.combineME11 = combineME11
90 process.looper.algoConfig.maxResSlopeY = maxResSlopeY
91 process.looper.algoConfig.residualsModel = cms.string(residualsModel)
92 process.looper.algoConfig.peakNSigma = peakNSigma
93 process.looper.algoConfig.createNtuple = createAlignNtuple
94 process.looper.algoConfig.doDT = doDT
95 process.looper.algoConfig.doCSC = doCSC
96 process.looper.algoConfig.useResiduals = cms.string(useResiduals)
99 process.load(
"Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
100 process.GlobalTag.globaltag = cms.string(globaltag)
101 process.looper.applyDbAlignment =
True 103 process.MuonAlignmentFromReferenceInputDB.connect = cms.string(
"sqlite_file:%s" % inputdb)
104 process.MuonAlignmentFromReferenceInputDB.toGet = cms.VPSet(cms.PSet(record = cms.string(
"DTAlignmentRcd"), tag = cms.string(
"DTAlignmentRcd")),
105 cms.PSet(record = cms.string(
"CSCAlignmentRcd"), tag = cms.string(
"CSCAlignmentRcd")))
107 if trackerconnect !=
"":
109 process.TrackerAlignmentInputDB = cms.ESSource(
"PoolDBESSource",
111 connect = cms.string(trackerconnect),
112 toGet = cms.VPSet(cms.PSet(record = cms.string(
"TrackerAlignmentRcd"), tag = cms.string(trackeralignment))))
113 process.es_prefer_TrackerAlignmentInputDB = cms.ESPrefer(
"PoolDBESSource",
"TrackerAlignmentInputDB")
115 if trackerAPEconnect !=
"":
117 process.TrackerAlignmentErrorInputDB = cms.ESSource(
"PoolDBESSource",
119 connect = cms.string(trackerAPEconnect),
120 toGet = cms.VPSet(cms.PSet(cms.PSet(record = cms.string(
"TrackerAlignmentErrorExtendedRcd"), tag = cms.string(trackerAPE)))))
121 process.es_prefer_TrackerAlignmentErrorInputDB = cms.ESPrefer(
"PoolDBESSource",
"TrackerAlignmentErrorInputDB")
123 if trackerBowsconnect !=
"":
125 process.TrackerSurfaceDeformationInputDB = cms.ESSource(
"PoolDBESSource",
127 connect = cms.string(trackerBowsconnect),
128 toGet = cms.VPSet(cms.PSet(cms.PSet(record = cms.string(
"TrackerSurfaceDeformationRcd"), tag = cms.string(trackerBows)))))
129 process.es_prefer_TrackerSurfaceDeformationInputDB = cms.ESPrefer(
"PoolDBESSource",
"TrackerSurfaceDeformationInputDB")
131 if gprcdconnect !=
"":
133 process.GlobalPositionInputDB = cms.ESSource(
"PoolDBESSource",
135 connect = cms.string(gprcdconnect),
136 toGet = cms.VPSet(cms.PSet(record = cms.string(
"GlobalPositionRcd"), tag = cms.string(gprcd))))
137 process.es_prefer_GlobalPositionInputDB = cms.ESPrefer(
"PoolDBESSource",
"GlobalPositionInputDB")
139 process.looper.saveToDB =
True 140 process.looper.saveApeToDB =
True 141 process.PoolDBOutputService.connect = cms.string(
"sqlite_file:MuonAlignmentFromReference_outputdb.db")
143 process.TFileService = cms.Service(
"TFileService", fileName = cms.string(
"MuonAlignmentFromReference_plotting.root"))
def split(sequence, size)