CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/Alignment/MuonAlignmentAlgorithms/python/alignBH_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 if alignmenttmp == [""]: alignmenttmp = []
00006 iteration = int(os.environ["ALIGNMENT_ITERATION"])
00007 mode = os.environ["ALIGNMENT_MODE"]
00008 inputdb = os.environ["ALIGNMENT_INPUTDB"]
00009 globaltag = os.environ["ALIGNMENT_GLOBALTAG"]
00010 photogrammetry = eval(os.environ["ALIGNMENT_PHOTOGRAMMETRY"])
00011 slm = eval(os.environ["ALIGNMENT_SLM"])
00012 fillME11holes = eval(os.environ["ALIGNMENT_FILLME11HOLES"])
00013 disks = (os.environ["ALIGNMENT_DISKS"] == "True")
00014 
00015 minP = float(os.environ["ALIGNMENT_minP"])
00016 minHitsPerChamber = int(os.environ["ALIGNMENT_minHitsPerChamber"])
00017 maxdrdz = float(os.environ["ALIGNMENT_maxdrdz"])
00018 maxRedChi2 = float(os.environ["ALIGNMENT_maxRedChi2"])
00019 fiducial = (os.environ["ALIGNMENT_fiducial"] == "True")
00020 useHitWeights = (os.environ["ALIGNMENT_useHitWeights"] == "True")
00021 truncateSlopeResid = float(os.environ["ALIGNMENT_truncateSlopeResid"])
00022 truncateOffsetResid = float(os.environ["ALIGNMENT_truncateOffsetResid"])
00023 combineME11 = (os.environ["ALIGNMENT_combineME11"] == "True")
00024 useTrackWeights = (os.environ["ALIGNMENT_useTrackWeights"] == "True")
00025 errorFromRMS = (os.environ["ALIGNMENT_errorFromRMS"] == "True")
00026 minTracksPerOverlap = int(os.environ["ALIGNMENT_minTracksPerOverlap"])
00027 slopeFromTrackRefit = (os.environ["ALIGNMENT_slopeFromTrackRefit"] == "True")
00028 minStationsInTrackRefits = int(os.environ["ALIGNMENT_minStationsInTrackRefits"])
00029 
00030 process = cms.Process("ALIGN")
00031 process.source = cms.Source("EmptySource")
00032 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
00033 
00034 process.load("Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_cff")
00035 del process.Path
00036 
00037 process.looper.algoConfig.mode = mode
00038 
00039 if disks:
00040     import Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff
00041     process.looper.algoConfig.fitters = Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff.fitters
00042 
00043 execfile("constraints_cff.py")
00044 
00045 # Let's not have the PGFrame forced as a fixed reference frame
00046 # if photogrammetry and mode != "phipos":
00047 #     for f in process.looper.algoConfig.fitters:
00048 #         if "PGFrame" in f.alignables:
00049 #             f.fixed = cms.string("PGFrame")
00050 
00051 if slm and mode in ("phipos", "phiz"):
00052     for f in process.looper.algoConfig.fitters:
00053         if "SLMFrame" in f.alignables:
00054             f.fixed = cms.string("SLMFrame")
00055 
00056 process.looper.algoConfig.writeTemporaryFile = ""
00057 process.looper.algoConfig.readTemporaryFiles = cms.vstring(*alignmenttmp)
00058 process.looper.algoConfig.doAlignment = True
00059 
00060 process.looper.algoConfig.minP = minP
00061 process.looper.algoConfig.minHitsPerChamber = minHitsPerChamber
00062 process.looper.algoConfig.maxdrdz = maxdrdz
00063 process.looper.algoConfig.maxRedChi2 = maxRedChi2
00064 process.looper.algoConfig.fiducial = fiducial
00065 process.looper.algoConfig.useHitWeights = useHitWeights
00066 process.looper.algoConfig.truncateSlopeResid = truncateSlopeResid
00067 process.looper.algoConfig.truncateOffsetResid = truncateOffsetResid
00068 process.looper.algoConfig.combineME11 = combineME11
00069 process.looper.algoConfig.useTrackWeights = useTrackWeights
00070 process.looper.algoConfig.errorFromRMS = errorFromRMS
00071 process.looper.algoConfig.minTracksPerOverlap = minTracksPerOverlap
00072 process.looper.algoConfig.slopeFromTrackRefit = slopeFromTrackRefit
00073 process.looper.algoConfig.minStationsInTrackRefits = minStationsInTrackRefits
00074 
00075 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
00076 process.GlobalTag.globaltag = cms.string(globaltag)
00077 
00078 process.muonAlignment.connect = cms.string("sqlite_file:%s" % inputdb)
00079 
00080 process.TFileService = cms.Service("TFileService", fileName = cms.string("plotting.root"))