CMS 3D CMS Logo

GCP_tree_cfg.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 #import FWCore.PythonUtilities.LumiList as LumiList
3 
4 from FWCore.ParameterSet.VarParsing import VarParsing
5 
6 import json
7 import os
8 
9 
10 process = cms.Process("validation")
11 
12 
13 options = VarParsing()
14 options.register("config", "", VarParsing.multiplicity.singleton, VarParsing.varType.string , "AllInOne config")
15 
16 options.parseArguments()
17 
18 
20 
21 
22 with open(options.config, "r") as configFile: config = json.load(configFile)
23 
24 
25 if 'empty_modules' in config["validation"]["GCP"]:
26  if config["validation"]["GCP"]["empty_modules"].startswith('/store'):
27  os.system('xrdcp root://eoscms//eos/'+config["validation"]["GCP"]["empty_modules"])
28  elif config["validation"]["GCP"]["empty_modules"].startswith('root://'):
29  os.system('xrdcp '+config["validation"]["GCP"]["empty_modules"])
30  else:
31  os.system('cp '+config["validation"]["GCP"]["empty_modules"])
32 else: os.system('touch emptyModuleList.txt')
33 
34 #Global tag
35 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
36 from Configuration.AlCa.GlobalTag import GlobalTag
37 process.GlobalTag = GlobalTag(process.GlobalTag,config["alignments"]["comp"]["globaltag"])
38 
39 
40 process.load("Configuration.Geometry.GeometryRecoDB_cff")
41 
42 process.load("CondCore.CondDB.CondDB_cfi")
43 
44 process.MessageLogger = cms.Service("MessageLogger",
45  #destinations = cms.untracked.vstring('detailedInfo', 'cout')
46  destinations = cms.untracked.vstring('warnings'),
47  warnings = cms.untracked.PSet(
48  threshold = cms.untracked.string('WARNING')
49  )
50 )
51 
52 process.source = cms.Source("EmptySource",
53  firstRun=cms.untracked.uint32(config["validation"]["IOVcomp"])
54  )
55 
56 process.maxEvents = cms.untracked.PSet(
57  input = cms.untracked.int32(1)
58 )
59 
60 process.siStripQualityESProducer.ListOfRecordToMerge=cms.VPSet(
61  cms.PSet(record = cms.string('SiStripDetCablingRcd'),
62  tag = cms.string('')),
63  cms.PSet(record = cms.string('RunInfoRcd'),
64  tag = cms.string('')),
65  cms.PSet(record = cms.string('SiStripBadChannelRcd'),
66  tag = cms.string('')),
67  cms.PSet(record = cms.string('SiStripBadFiberRcd'),
68  tag = cms.string('')),
69  cms.PSet(record = cms.string('SiStripBadModuleRcd'),
70  tag = cms.string('')),
71  cms.PSet(record = cms.string('SiStripBadStripRcd'),
72  tag = cms.string(''))
73 )
74 
75 process.load("DQM.SiStripCommon.TkHistoMap_cff")
76 
77  # configuration of the Tracker Geometry Comparison Tool
78  # Tracker Geometry Comparison
79 process.load("Alignment.OfflineValidation.TrackerGeometryCompare_cfi")
80  # the input "IDEAL" is special indicating to use the ideal geometry of the release
81 
82 process.TrackerGeometryCompare.inputROOTFile1 = str(config['input_ref']+'/Ntuples.root')
83 process.TrackerGeometryCompare.inputROOTFile2 = str(config['input_comp']+'/Ntuples.root')
84 process.TrackerGeometryCompare.moduleList = 'emptyModuleList.txt'
85 process.TrackerGeometryCompare.outputFile = str(config['output'])+'/GCPtree.root'
86 process.TrackerGeometryCompare.levels = [ str(config['validation']['GCP']['levels']) ]
87 
88 surf_dir = str(config['output'])+'/SurfDeform'
89 if not os.path.isdir(surf_dir):
90  os.mkdir(surf_dir)
91 process.TrackerGeometryCompare.surfDir = surf_dir
92 
93 process.load("CommonTools.UtilAlgos.TFileService_cfi")
94 process.TFileService.fileName = cms.string("TkSurfDeform.root")
95 
96 
99 
100 process.p = cms.Path(process.TrackerGeometryCompare)
102 
#define str(s)