CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
gatherBH_cfg.py
Go to the documentation of this file.
1 import os
2 import FWCore.ParameterSet.Config as cms
3 
4 inputfiles = os.environ["ALIGNMENT_INPUTFILES"].split(" ")
5 iteration = int(os.environ["ALIGNMENT_ITERATION"])
6 jobnumber = int(os.environ["ALIGNMENT_JOBNUMBER"])
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("GATHER")
31 process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring(*inputfiles))
32 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
33 
34 process.MessageLogger = cms.Service("MessageLogger",
35  destinations = cms.untracked.vstring("cout"),
36  cout = cms.untracked.PSet(threshold = cms.untracked.string("ERROR")))
37 
38 process.load("Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_cff")
39 
40 process.looper.algoConfig.mode = mode
41 
42 if disks:
43  import Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff
44  process.looper.algoConfig.fitters = Alignment.MuonAlignmentAlgorithms.CSCOverlapsAlignmentAlgorithm_diskfitters_cff.fitters
45 
46 execfile("constraints_cff.py")
47 
48 # Let's not have the PGFrame forced as a fixed reference frame
49 # if photogrammetry and mode != "phipos":
50 # for f in process.looper.algoConfig.fitters:
51 # if "PGFrame" in f.alignables:
52 # f.fixed = cms.string("PGFrame")
53 
54 if slm and mode in ("phipos", "phiz"):
55  for f in process.looper.algoConfig.fitters:
56  if "SLMFrame" in f.alignables:
57  f.fixed = cms.string("SLMFrame")
58 
59 process.looper.algoConfig.writeTemporaryFile = "alignment%03d.tmp" % jobnumber
60 process.looper.algoConfig.readTemporaryFiles = cms.vstring()
61 process.looper.algoConfig.doAlignment = False
62 
63 process.looper.algoConfig.minP = minP
64 process.looper.algoConfig.minHitsPerChamber = minHitsPerChamber
65 process.looper.algoConfig.maxdrdz = maxdrdz
66 process.looper.algoConfig.maxRedChi2 = maxRedChi2
67 process.looper.algoConfig.fiducial = fiducial
68 process.looper.algoConfig.useHitWeights = useHitWeights
69 process.looper.algoConfig.truncateSlopeResid = truncateSlopeResid
70 process.looper.algoConfig.truncateOffsetResid = truncateOffsetResid
71 process.looper.algoConfig.combineME11 = combineME11
72 process.looper.algoConfig.useTrackWeights = useTrackWeights
73 process.looper.algoConfig.errorFromRMS = errorFromRMS
74 process.looper.algoConfig.minTracksPerOverlap = minTracksPerOverlap
75 process.looper.algoConfig.slopeFromTrackRefit = slopeFromTrackRefit
76 process.looper.algoConfig.minStationsInTrackRefits = minStationsInTrackRefits
77 
78 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
79 process.GlobalTag.globaltag = cms.string(globaltag)
80 
81 process.muonAlignment.connect = cms.string("sqlite_file:%s" % inputdb)
82 
83 process.looper.saveToDB = False
84 process.looper.saveApeToDB = False
85 del process.PoolDBOutputService
86 
87 process.TFileService = cms.Service("TFileService", fileName = cms.string("plotting%03d.root" % jobnumber))
double split
Definition: MVATrainer.cc:139