Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import os
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 inputfiles = os.environ["ALIGNMENT_INPUTFILES"].split(" ")
0005 iteration = int(os.environ["ALIGNMENT_ITERATION"])
0006 jobnumber = int(os.environ["ALIGNMENT_JOBNUMBER"])
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("GATHER")
0031 process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(*inputfiles))
0032 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
0033 
0034 process.MessageLogger = cms.Service("MessageLogger",
0035                                     destinations = cms.untracked.vstring("cout"),
0036                                     cout = cms.untracked.PSet(threshold = cms.untracked.string("ERROR")))
0037 
0038 process.load("Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_cff")
0039 
0040 process.looper.algoConfig.mode = mode
0041 
0042 if disks:
0043     import Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff
0044     process.looper.algoConfig.fitters = Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff.fitters
0045 
0046 execfile("constraints_cff.py")
0047 
0048 # Let's not have the PGFrame forced as a fixed reference frame
0049 # if photogrammetry and mode != "phipos":
0050 #     for f in process.looper.algoConfig.fitters:
0051 #         if "PGFrame" in f.alignables:
0052 #             f.fixed = cms.string("PGFrame")
0053 
0054 if slm and mode in ("phipos", "phiz"):
0055     for f in process.looper.algoConfig.fitters:
0056         if "SLMFrame" in f.alignables:
0057             f.fixed = cms.string("SLMFrame")
0058 
0059 process.looper.algoConfig.writeTemporaryFile = "alignment%03d.tmp" % jobnumber
0060 process.looper.algoConfig.readTemporaryFiles = cms.vstring()
0061 process.looper.algoConfig.doAlignment = False
0062 
0063 process.looper.algoConfig.minP = minP
0064 process.looper.algoConfig.minHitsPerChamber = minHitsPerChamber
0065 process.looper.algoConfig.maxdrdz = maxdrdz
0066 process.looper.algoConfig.maxRedChi2 = maxRedChi2
0067 process.looper.algoConfig.fiducial = fiducial
0068 process.looper.algoConfig.useHitWeights = useHitWeights
0069 process.looper.algoConfig.truncateSlopeResid = truncateSlopeResid
0070 process.looper.algoConfig.truncateOffsetResid = truncateOffsetResid
0071 process.looper.algoConfig.combineME11 = combineME11
0072 process.looper.algoConfig.useTrackWeights = useTrackWeights
0073 process.looper.algoConfig.errorFromRMS = errorFromRMS
0074 process.looper.algoConfig.minTracksPerOverlap = minTracksPerOverlap
0075 process.looper.algoConfig.slopeFromTrackRefit = slopeFromTrackRefit
0076 process.looper.algoConfig.minStationsInTrackRefits = minStationsInTrackRefits
0077 
0078 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0079 process.GlobalTag.globaltag = cms.string(globaltag)
0080 
0081 process.muonAlignment.connect = cms.string("sqlite_file:%s" % inputdb)
0082 
0083 process.looper.saveToDB = False
0084 process.looper.saveApeToDB = False
0085 del process.PoolDBOutputService
0086 
0087 process.TFileService = cms.Service("TFileService", fileName = cms.string("plotting%03d.root" % jobnumber))