CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
align_cfg.py
Go to the documentation of this file.
1 import os
2 import FWCore.ParameterSet.Config as cms
3 
4 alignmenttmp = os.environ["ALIGNMENT_ALIGNMENTTMP"].split("\n")
5 iteration = int(os.environ["ALIGNMENT_ITERATION"])
6 globaltag = os.environ["ALIGNMENT_GLOBALTAG"]
7 inputdb = os.environ["ALIGNMENT_INPUTDB"]
8 trackerconnect = os.environ["ALIGNMENT_TRACKERCONNECT"]
9 trackeralignment = os.environ["ALIGNMENT_TRACKERALIGNMENT"]
10 trackerAPEconnect = os.environ["ALIGNMENT_TRACKERAPECONNECT"]
11 trackerAPE = os.environ["ALIGNMENT_TRACKERAPE"]
12 gprcdconnect = os.environ["ALIGNMENT_GPRCDCONNECT"]
13 gprcd = os.environ["ALIGNMENT_GPRCD"]
14 iscosmics = (os.environ["ALIGNMENT_ISCOSMICS"] == "True")
15 station123params = os.environ["ALIGNMENT_STATION123PARAMS"]
16 station4params = os.environ["ALIGNMENT_STATION4PARAMS"]
17 cscparams = os.environ["ALIGNMENT_CSCPARAMS"]
18 minTrackPt = float(os.environ["ALIGNMENT_MINTRACKPT"])
19 maxTrackPt = float(os.environ["ALIGNMENT_MAXTRACKPT"])
20 minTrackerHits = int(os.environ["ALIGNMENT_MINTRACKERHITS"])
21 maxTrackerRedChi2 = float(os.environ["ALIGNMENT_MAXTRACKERREDCHI2"])
22 allowTIDTEC = (os.environ["ALIGNMENT_ALLOWTIDTEC"] == "True")
23 twoBin = (os.environ["ALIGNMENT_TWOBIN"] == "True")
24 weightAlignment = (os.environ["ALIGNMENT_WEIGHTALIGNMENT"] == "True")
25 minAlignmentHits = int(os.environ["ALIGNMENT_MINALIGNMENTHITS"])
26 combineME11 = (os.environ["ALIGNMENT_COMBINEME11"] == "True")
27 maxResSlopeY = float(os.environ["ALIGNMENT_MAXRESSLOPEY"])
28 
29 process = cms.Process("ALIGN")
30 process.source = cms.Source("EmptySource")
31 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
32 
33 process.load("Alignment.MuonAlignmentAlgorithms.MuonAlignmentFromReference_cff")
34 process.looper.algoConfig.readTemporaryFiles = cms.vstring(*alignmenttmp)
35 process.looper.algoConfig.reportFileName = cms.string("MuonAlignmentFromReference_report.py")
36 
37 process.looper.ParameterBuilder.Selector.alignParams = cms.vstring("MuonDTChambers,%s,stations123" % station123params, "MuonDTChambers,%s,station4" % station4params, "MuonCSCChambers,%s" % cscparams)
38 process.looper.algoConfig.minTrackPt = minTrackPt
39 process.looper.algoConfig.maxTrackPt = maxTrackPt
40 process.looper.algoConfig.minTrackerHits = minTrackerHits
41 process.looper.algoConfig.maxTrackerRedChi2 = maxTrackerRedChi2
42 process.looper.algoConfig.allowTIDTEC = allowTIDTEC
43 process.looper.algoConfig.twoBin = twoBin
44 process.looper.algoConfig.weightAlignment = weightAlignment
45 process.looper.algoConfig.minAlignmentHits = minAlignmentHits
46 process.looper.algoConfig.combineME11 = combineME11
47 process.looper.algoConfig.maxResSlopeY = maxResSlopeY
48 process.looper.algoConfig.residualsModel = cms.string("GaussPowerTails")
49 
50 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
51 process.GlobalTag.globaltag = cms.string(globaltag)
52 process.looper.applyDbAlignment = True
53 
54 process.MuonAlignmentFromReferenceInputDB.connect = cms.string("sqlite_file:%s" % inputdb)
55 process.MuonAlignmentFromReferenceInputDB.toGet = cms.VPSet(cms.PSet(record = cms.string("DTAlignmentRcd"), tag = cms.string("DTAlignmentRcd")),
56  cms.PSet(record = cms.string("CSCAlignmentRcd"), tag = cms.string("CSCAlignmentRcd")))
57 
58 if trackerconnect != "":
60  process.TrackerAlignmentInputDB = cms.ESSource("PoolDBESSource",
61  CondDBSetup,
62  connect = cms.string(trackerconnect),
63  toGet = cms.VPSet(cms.PSet(record = cms.string("TrackerAlignmentRcd"), tag = cms.string(trackeralignment))))
64  process.es_prefer_TrackerAlignmentInputDB = cms.ESPrefer("PoolDBESSource", "TrackerAlignmentInputDB")
65 
66 if trackerAPEconnect != "":
68  process.TrackerAlignmentErrorInputDB = cms.ESSource("PoolDBESSource",
69  CondDBSetup,
70  connect = cms.string(trackerAPEconnect),
71  toGet = cms.VPSet(cms.PSet(cms.PSet(record = cms.string("TrackerAlignmentErrorRcd"), tag = cms.string(trackerAPE)))))
72  process.es_prefer_TrackerAlignmentErrorInputDB = cms.ESPrefer("PoolDBESSource", "TrackerAlignmentErrorInputDB")
73 
74 if gprcdconnect != "":
76  process.GlobalPositionInputDB = cms.ESSource("PoolDBESSource",
77  CondDBSetup,
78  connect = cms.string(gprcdconnect),
79  toGet = cms.VPSet(cms.PSet(record = cms.string("GlobalPositionRcd"), tag = cms.string(gprcd))))
80  process.es_prefer_GlobalPositionInputDB = cms.ESPrefer("PoolDBESSource", "GlobalPositionInputDB")
81 
82 process.looper.saveToDB = True
83 process.looper.saveApeToDB = True
84 process.PoolDBOutputService.connect = cms.string("sqlite_file:MuonAlignmentFromReference_outputdb.db")
85 
86 process.TFileService = cms.Service("TFileService", fileName = cms.string("MuonAlignmentFromReference_plotting.root"))
double split
Definition: MVATrainer.cc:139