CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Alignment/MuonAlignmentAlgorithms/python/gatherBH_cfg.py

Go to the documentation of this file.
00001 import os
00002 import FWCore.ParameterSet.Config as cms
00003 
00004 inputfiles = os.environ["ALIGNMENT_INPUTFILES"].split(" ")
00005 iteration = int(os.environ["ALIGNMENT_ITERATION"])
00006 jobnumber = int(os.environ["ALIGNMENT_JOBNUMBER"])
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("GATHER")
00031 process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(*inputfiles))
00032 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
00033 
00034 process.MessageLogger = cms.Service("MessageLogger",
00035                                     destinations = cms.untracked.vstring("cout"),
00036                                     cout = cms.untracked.PSet(threshold = cms.untracked.string("ERROR")))
00037 
00038 process.load("Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_cff")
00039 
00040 process.looper.algoConfig.mode = mode
00041 
00042 if disks:
00043     import Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff
00044     process.looper.algoConfig.fitters = Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff.fitters
00045 
00046 execfile("constraints_cff.py")
00047 
00048 # Let's not have the PGFrame forced as a fixed reference frame
00049 # if photogrammetry and mode != "phipos":
00050 #     for f in process.looper.algoConfig.fitters:
00051 #         if "PGFrame" in f.alignables:
00052 #             f.fixed = cms.string("PGFrame")
00053 
00054 if slm and mode in ("phipos", "phiz"):
00055     for f in process.looper.algoConfig.fitters:
00056         if "SLMFrame" in f.alignables:
00057             f.fixed = cms.string("SLMFrame")
00058 
00059 process.looper.algoConfig.writeTemporaryFile = "Alignment%03d.tmp" % jobnumber
00060 process.looper.algoConfig.readTemporaryFiles = cms.vstring()
00061 process.looper.algoConfig.doAlignment = False
00062 
00063 process.looper.algoConfig.minP = minP
00064 process.looper.algoConfig.minHitsPerChamber = minHitsPerChamber
00065 process.looper.algoConfig.maxdrdz = maxdrdz
00066 process.looper.algoConfig.maxRedChi2 = maxRedChi2
00067 process.looper.algoConfig.fiducial = fiducial
00068 process.looper.algoConfig.useHitWeights = useHitWeights
00069 process.looper.algoConfig.truncateSlopeResid = truncateSlopeResid
00070 process.looper.algoConfig.truncateOffsetResid = truncateOffsetResid
00071 process.looper.algoConfig.combineME11 = combineME11
00072 process.looper.algoConfig.useTrackWeights = useTrackWeights
00073 process.looper.algoConfig.errorFromRMS = errorFromRMS
00074 process.looper.algoConfig.minTracksPerOverlap = minTracksPerOverlap
00075 process.looper.algoConfig.slopeFromTrackRefit = slopeFromTrackRefit
00076 process.looper.algoConfig.minStationsInTrackRefits = minStationsInTrackRefits
00077 
00078 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
00079 process.GlobalTag.globaltag = cms.string(globaltag)
00080 
00081 process.muonAlignment.connect = cms.string("sqlite_file:%s" % inputdb)
00082 
00083 process.looper.saveToDB = False
00084 process.looper.saveApeToDB = False
00085 del process.PoolDBOutputService
00086 
00087 process.TFileService = cms.Service("TFileService", fileName = cms.string("plotting%03d.root" % jobnumber))