CMS 3D CMS Logo

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