Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:28

0001 import os
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 alignmenttmp = os.environ["ALIGNMENT_ALIGNMENTTMP"].split("\n")
0005 if alignmenttmp == [""]: alignmenttmp = []
0006 iteration = int(os.environ["ALIGNMENT_ITERATION"])
0007 mode = os.environ["ALIGNMENT_MODE"]
0008 inputdb = os.environ["ALIGNMENT_INPUTDB"]
0009 globaltag = os.environ["ALIGNMENT_GLOBALTAG"]
0010 photogrammetry = eval(os.environ["ALIGNMENT_PHOTOGRAMMETRY"])
0011 slm = eval(os.environ["ALIGNMENT_SLM"])
0012 fillME11holes = eval(os.environ["ALIGNMENT_FILLME11HOLES"])
0013 disks = (os.environ["ALIGNMENT_DISKS"] == "True")
0014 
0015 minP = float(os.environ["ALIGNMENT_minP"])
0016 minHitsPerChamber = int(os.environ["ALIGNMENT_minHitsPerChamber"])
0017 maxdrdz = float(os.environ["ALIGNMENT_maxdrdz"])
0018 maxRedChi2 = float(os.environ["ALIGNMENT_maxRedChi2"])
0019 fiducial = (os.environ["ALIGNMENT_fiducial"] == "True")
0020 useHitWeights = (os.environ["ALIGNMENT_useHitWeights"] == "True")
0021 truncateSlopeResid = float(os.environ["ALIGNMENT_truncateSlopeResid"])
0022 truncateOffsetResid = float(os.environ["ALIGNMENT_truncateOffsetResid"])
0023 combineME11 = (os.environ["ALIGNMENT_combineME11"] == "True")
0024 useTrackWeights = (os.environ["ALIGNMENT_useTrackWeights"] == "True")
0025 errorFromRMS = (os.environ["ALIGNMENT_errorFromRMS"] == "True")
0026 minTracksPerOverlap = int(os.environ["ALIGNMENT_minTracksPerOverlap"])
0027 slopeFromTrackRefit = (os.environ["ALIGNMENT_slopeFromTrackRefit"] == "True")
0028 minStationsInTrackRefits = int(os.environ["ALIGNMENT_minStationsInTrackRefits"])
0029 
0030 process = cms.Process("ALIGN")
0031 process.source = cms.Source("EmptySource")
0032 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
0033 
0034 process.load("Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_cff")
0035 del process.Path
0036 
0037 process.looper.algoConfig.mode = mode
0038 
0039 if disks:
0040     import Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff
0041     process.looper.algoConfig.fitters = Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff.fitters
0042 
0043 execfile("constraints_cff.py")
0044 
0045 # Let's not have the PGFrame forced as a fixed reference frame
0046 # if photogrammetry and mode != "phipos":
0047 #     for f in process.looper.algoConfig.fitters:
0048 #         if "PGFrame" in f.alignables:
0049 #             f.fixed = cms.string("PGFrame")
0050 
0051 if slm and mode in ("phipos", "phiz"):
0052     for f in process.looper.algoConfig.fitters:
0053         if "SLMFrame" in f.alignables:
0054             f.fixed = cms.string("SLMFrame")
0055 
0056 process.looper.algoConfig.writeTemporaryFile = ""
0057 process.looper.algoConfig.readTemporaryFiles = cms.vstring(*alignmenttmp)
0058 process.looper.algoConfig.doAlignment = True
0059 
0060 process.looper.algoConfig.minP = minP
0061 process.looper.algoConfig.minHitsPerChamber = minHitsPerChamber
0062 process.looper.algoConfig.maxdrdz = maxdrdz
0063 process.looper.algoConfig.maxRedChi2 = maxRedChi2
0064 process.looper.algoConfig.fiducial = fiducial
0065 process.looper.algoConfig.useHitWeights = useHitWeights
0066 process.looper.algoConfig.truncateSlopeResid = truncateSlopeResid
0067 process.looper.algoConfig.truncateOffsetResid = truncateOffsetResid
0068 process.looper.algoConfig.combineME11 = combineME11
0069 process.looper.algoConfig.useTrackWeights = useTrackWeights
0070 process.looper.algoConfig.errorFromRMS = errorFromRMS
0071 process.looper.algoConfig.minTracksPerOverlap = minTracksPerOverlap
0072 process.looper.algoConfig.slopeFromTrackRefit = slopeFromTrackRefit
0073 process.looper.algoConfig.minStationsInTrackRefits = minStationsInTrackRefits
0074 
0075 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0076 process.GlobalTag.globaltag = cms.string(globaltag)
0077 
0078 process.muonAlignment.connect = cms.string("sqlite_file:%s" % inputdb)
0079 
0080 process.TFileService = cms.Service("TFileService", fileName = cms.string("plotting.root"))