CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/Alignment/MuonAlignmentAlgorithms/python/align_cfg.py

Go to the documentation of this file.
00001 import os
00002 import FWCore.ParameterSet.Config as cms
00003 
00004 alignmenttmp = os.environ["ALIGNMENT_ALIGNMENTTMP"].split("\n")
00005 iteration = int(os.environ["ALIGNMENT_ITERATION"])
00006 globaltag = os.environ["ALIGNMENT_GLOBALTAG"]
00007 inputdb = os.environ["ALIGNMENT_INPUTDB"]
00008 trackerconnect = os.environ["ALIGNMENT_TRACKERCONNECT"]
00009 trackeralignment = os.environ["ALIGNMENT_TRACKERALIGNMENT"]
00010 trackerAPEconnect = os.environ["ALIGNMENT_TRACKERAPECONNECT"]
00011 trackerAPE = os.environ["ALIGNMENT_TRACKERAPE"]
00012 gprcdconnect = os.environ["ALIGNMENT_GPRCDCONNECT"]
00013 gprcd = os.environ["ALIGNMENT_GPRCD"]
00014 iscosmics = (os.environ["ALIGNMENT_ISCOSMICS"] == "True")
00015 station123params = os.environ["ALIGNMENT_STATION123PARAMS"]
00016 station4params = os.environ["ALIGNMENT_STATION4PARAMS"]
00017 cscparams = os.environ["ALIGNMENT_CSCPARAMS"]
00018 minTrackPt = float(os.environ["ALIGNMENT_MINTRACKPT"])
00019 maxTrackPt = float(os.environ["ALIGNMENT_MAXTRACKPT"])
00020 minTrackerHits = int(os.environ["ALIGNMENT_MINTRACKERHITS"])
00021 maxTrackerRedChi2 = float(os.environ["ALIGNMENT_MAXTRACKERREDCHI2"])
00022 allowTIDTEC = (os.environ["ALIGNMENT_ALLOWTIDTEC"] == "True")
00023 twoBin = (os.environ["ALIGNMENT_TWOBIN"] == "True")
00024 weightAlignment = (os.environ["ALIGNMENT_WEIGHTALIGNMENT"] == "True")
00025 minAlignmentHits = int(os.environ["ALIGNMENT_MINALIGNMENTHITS"])
00026 combineME11 = (os.environ["ALIGNMENT_COMBINEME11"] == "True")
00027 maxResSlopeY = float(os.environ["ALIGNMENT_MAXRESSLOPEY"])
00028 
00029 process = cms.Process("ALIGN")
00030 process.source = cms.Source("EmptySource")
00031 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
00032 
00033 process.load("Alignment.MuonAlignmentAlgorithms.MuonAlignmentFromReference_cff")
00034 process.looper.algoConfig.readTemporaryFiles = cms.vstring(*alignmenttmp)
00035 process.looper.algoConfig.reportFileName = cms.string("MuonAlignmentFromReference_report.py")
00036 
00037 process.looper.ParameterBuilder.Selector.alignParams = cms.vstring("MuonDTChambers,%s,stations123" % station123params, "MuonDTChambers,%s,station4" % station4params, "MuonCSCChambers,%s" % cscparams)
00038 process.looper.algoConfig.minTrackPt = minTrackPt
00039 process.looper.algoConfig.maxTrackPt = maxTrackPt
00040 process.looper.algoConfig.minTrackerHits = minTrackerHits
00041 process.looper.algoConfig.maxTrackerRedChi2 = maxTrackerRedChi2
00042 process.looper.algoConfig.allowTIDTEC = allowTIDTEC
00043 process.looper.algoConfig.twoBin = twoBin
00044 process.looper.algoConfig.weightAlignment = weightAlignment
00045 process.looper.algoConfig.minAlignmentHits = minAlignmentHits
00046 process.looper.algoConfig.combineME11 = combineME11
00047 process.looper.algoConfig.maxResSlopeY = maxResSlopeY
00048 process.looper.algoConfig.residualsModel = cms.string("GaussPowerTails")
00049 
00050 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
00051 process.GlobalTag.globaltag = cms.string(globaltag)
00052 process.looper.applyDbAlignment = True
00053 
00054 process.MuonAlignmentFromReferenceInputDB.connect = cms.string("sqlite_file:%s" % inputdb)
00055 process.MuonAlignmentFromReferenceInputDB.toGet = cms.VPSet(cms.PSet(record = cms.string("DTAlignmentRcd"), tag = cms.string("DTAlignmentRcd")),
00056                                                             cms.PSet(record = cms.string("CSCAlignmentRcd"), tag = cms.string("CSCAlignmentRcd")))
00057 
00058 if trackerconnect != "":
00059     from CondCore.DBCommon.CondDBSetup_cfi import *
00060     process.TrackerAlignmentInputDB = cms.ESSource("PoolDBESSource",
00061                                                    CondDBSetup,
00062                                                    connect = cms.string(trackerconnect),
00063                                                    toGet = cms.VPSet(cms.PSet(record = cms.string("TrackerAlignmentRcd"), tag = cms.string(trackeralignment))))
00064     process.es_prefer_TrackerAlignmentInputDB = cms.ESPrefer("PoolDBESSource", "TrackerAlignmentInputDB")
00065 
00066 if trackerAPEconnect != "":
00067     from CondCore.DBCommon.CondDBSetup_cfi import *
00068     process.TrackerAlignmentErrorInputDB = cms.ESSource("PoolDBESSource",
00069                                                    CondDBSetup,
00070                                                    connect = cms.string(trackerAPEconnect),
00071                                                    toGet = cms.VPSet(cms.PSet(cms.PSet(record = cms.string("TrackerAlignmentErrorRcd"), tag = cms.string(trackerAPE)))))
00072     process.es_prefer_TrackerAlignmentErrorInputDB = cms.ESPrefer("PoolDBESSource", "TrackerAlignmentErrorInputDB")
00073 
00074 if gprcdconnect != "":
00075     from CondCore.DBCommon.CondDBSetup_cfi import *
00076     process.GlobalPositionInputDB = cms.ESSource("PoolDBESSource",
00077                                                    CondDBSetup,
00078                                                    connect = cms.string(gprcdconnect),
00079                                                    toGet = cms.VPSet(cms.PSet(record = cms.string("GlobalPositionRcd"), tag = cms.string(gprcd))))
00080     process.es_prefer_GlobalPositionInputDB = cms.ESPrefer("PoolDBESSource", "GlobalPositionInputDB")
00081 
00082 process.looper.saveToDB = True
00083 process.looper.saveApeToDB = True
00084 process.PoolDBOutputService.connect = cms.string("sqlite_file:MuonAlignmentFromReference_outputdb.db")
00085 
00086 process.TFileService = cms.Service("TFileService", fileName = cms.string("MuonAlignmentFromReference_plotting.root"))