test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
alignBH_cfg.py
Go to the documentation of this file.
1 import os
2 import FWCore.ParameterSet.Config as cms
3 
4 alignmenttmp = os.environ["ALIGNMENT_ALIGNMENTTMP"].split("\n")
5 if alignmenttmp == [""]: alignmenttmp = []
6 iteration = int(os.environ["ALIGNMENT_ITERATION"])
7 mode = os.environ["ALIGNMENT_MODE"]
8 inputdb = os.environ["ALIGNMENT_INPUTDB"]
9 globaltag = os.environ["ALIGNMENT_GLOBALTAG"]
10 photogrammetry = eval(os.environ["ALIGNMENT_PHOTOGRAMMETRY"])
11 slm = eval(os.environ["ALIGNMENT_SLM"])
12 fillME11holes = eval(os.environ["ALIGNMENT_FILLME11HOLES"])
13 disks = (os.environ["ALIGNMENT_DISKS"] == "True")
14 
15 minP = float(os.environ["ALIGNMENT_minP"])
16 minHitsPerChamber = int(os.environ["ALIGNMENT_minHitsPerChamber"])
17 maxdrdz = float(os.environ["ALIGNMENT_maxdrdz"])
18 maxRedChi2 = float(os.environ["ALIGNMENT_maxRedChi2"])
19 fiducial = (os.environ["ALIGNMENT_fiducial"] == "True")
20 useHitWeights = (os.environ["ALIGNMENT_useHitWeights"] == "True")
21 truncateSlopeResid = float(os.environ["ALIGNMENT_truncateSlopeResid"])
22 truncateOffsetResid = float(os.environ["ALIGNMENT_truncateOffsetResid"])
23 combineME11 = (os.environ["ALIGNMENT_combineME11"] == "True")
24 useTrackWeights = (os.environ["ALIGNMENT_useTrackWeights"] == "True")
25 errorFromRMS = (os.environ["ALIGNMENT_errorFromRMS"] == "True")
26 minTracksPerOverlap = int(os.environ["ALIGNMENT_minTracksPerOverlap"])
27 slopeFromTrackRefit = (os.environ["ALIGNMENT_slopeFromTrackRefit"] == "True")
28 minStationsInTrackRefits = int(os.environ["ALIGNMENT_minStationsInTrackRefits"])
29 
30 process = cms.Process("ALIGN")
31 process.source = cms.Source("EmptySource")
32 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
33 
34 process.load("Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_cff")
35 del process.Path
36 
37 process.looper.algoConfig.mode = mode
38 
39 if disks:
40  import Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff
41  process.looper.algoConfig.fitters = Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff.fitters
42 
43 execfile("constraints_cff.py")
44 
45 # Let's not have the PGFrame forced as a fixed reference frame
46 # if photogrammetry and mode != "phipos":
47 # for f in process.looper.algoConfig.fitters:
48 # if "PGFrame" in f.alignables:
49 # f.fixed = cms.string("PGFrame")
50 
51 if slm and mode in ("phipos", "phiz"):
52  for f in process.looper.algoConfig.fitters:
53  if "SLMFrame" in f.alignables:
54  f.fixed = cms.string("SLMFrame")
55 
56 process.looper.algoConfig.writeTemporaryFile = ""
57 process.looper.algoConfig.readTemporaryFiles = cms.vstring(*alignmenttmp)
58 process.looper.algoConfig.doAlignment = True
59 
60 process.looper.algoConfig.minP = minP
61 process.looper.algoConfig.minHitsPerChamber = minHitsPerChamber
62 process.looper.algoConfig.maxdrdz = maxdrdz
63 process.looper.algoConfig.maxRedChi2 = maxRedChi2
64 process.looper.algoConfig.fiducial = fiducial
65 process.looper.algoConfig.useHitWeights = useHitWeights
66 process.looper.algoConfig.truncateSlopeResid = truncateSlopeResid
67 process.looper.algoConfig.truncateOffsetResid = truncateOffsetResid
68 process.looper.algoConfig.combineME11 = combineME11
69 process.looper.algoConfig.useTrackWeights = useTrackWeights
70 process.looper.algoConfig.errorFromRMS = errorFromRMS
71 process.looper.algoConfig.minTracksPerOverlap = minTracksPerOverlap
72 process.looper.algoConfig.slopeFromTrackRefit = slopeFromTrackRefit
73 process.looper.algoConfig.minStationsInTrackRefits = minStationsInTrackRefits
74 
75 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
76 process.GlobalTag.globaltag = cms.string(globaltag)
77 
78 process.muonAlignment.connect = cms.string("sqlite_file:%s" % inputdb)
79 
80 process.TFileService = cms.Service("TFileService", fileName = cms.string("plotting.root"))
double split
Definition: MVATrainer.cc:139