CMS 3D CMS Logo

geometryComparisonTemplates.py
Go to the documentation of this file.
1 
3 intoNTuplesTemplate="""
4 import FWCore.ParameterSet.Config as cms
5 
6 process = cms.Process("ValidationIntoNTuples")
7 
8 .oO[LoadGlobalTagTemplate]Oo.
9 
10 process.load("Configuration.Geometry.GeometryRecoDB_cff")
11 
12 process.load("CondCore.CondDB.CondDB_cfi")
13 
14 process.MessageLogger = cms.Service("MessageLogger",
15  destinations = cms.untracked.vstring('detailedInfo',
16  'cout')
17 )
18 
19 .oO[condLoad]Oo.
20 
21 process.source = cms.Source("EmptySource",
22  firstRun=cms.untracked.uint32(.oO[runGeomComp]Oo.)
23  )
24 
25 process.maxEvents = cms.untracked.PSet(
26  input = cms.untracked.int32(1)
27 )
28 process.dump = cms.EDAnalyzer("TrackerGeometryIntoNtuples",
29  outputFile = cms.untracked.string('.oO[alignmentName]Oo.ROOTGeometry.root'),
30  outputTreename = cms.untracked.string('alignTree')
31 )
32 
33 process.p = cms.Path(process.dump)
34 """
35 
36 
37 
39 compareTemplate="""
40 import FWCore.ParameterSet.Config as cms
41 
42 process = cms.Process("validation")
43 
44 .oO[LoadGlobalTagTemplate]Oo.
45 
46 process.load("Configuration.Geometry.GeometryRecoDB_cff")
47 
48 process.load("CondCore.CondDB.CondDB_cfi")
49 
50 process.MessageLogger = cms.Service("MessageLogger",
51  destinations = cms.untracked.vstring('detailedInfo',
52  'cout')
53 )
54 
55 process.source = cms.Source("EmptySource",
56  firstRun=cms.untracked.uint32(.oO[runGeomComp]Oo.)
57  )
58 
59 process.maxEvents = cms.untracked.PSet(
60  input = cms.untracked.int32(1)
61 )
62 
63 process.siStripQualityESProducer.ListOfRecordToMerge=cms.VPSet(
64  cms.PSet(record = cms.string('SiStripDetCablingRcd'),
65  tag = cms.string('')),
66  cms.PSet(record = cms.string('RunInfoRcd'),
67  tag = cms.string('')),
68  cms.PSet(record = cms.string('SiStripBadChannelRcd'),
69  tag = cms.string('')),
70  cms.PSet(record = cms.string('SiStripBadFiberRcd'),
71  tag = cms.string('')),
72  cms.PSet(record = cms.string('SiStripBadModuleRcd'),
73  tag = cms.string('')),
74  cms.PSet(record = cms.string('SiStripBadStripRcd'),
75  tag = cms.string(''))
76 )
77 
78 process.load("DQM.SiStripCommon.TkHistoMap_cff")
79 
80  # configuration of the Tracker Geometry Comparison Tool
81  # Tracker Geometry Comparison
82 process.load("Alignment.OfflineValidation.TrackerGeometryCompare_cfi")
83  # the input "IDEAL" is special indicating to use the ideal geometry of the release
84 
85 process.TrackerGeometryCompare.inputROOTFile1 = '.oO[referenceGeometry]Oo.'
86 process.TrackerGeometryCompare.inputROOTFile2 = '.oO[comparedGeometry]Oo.'
87 process.TrackerGeometryCompare.moduleList = '.oO[moduleListBase]Oo.'
88 process.TrackerGeometryCompare.outputFile = ".oO[name]Oo..Comparison_common.oO[common]Oo..root"
89 
90 process.load("CommonTools.UtilAlgos.TFileService_cfi")
91 process.TFileService.fileName = cms.string("TkSurfDeform_.oO[name]Oo..Comparison_common.oO[common]Oo..root")
92 
93 process.TrackerGeometryCompare.levels = [ .oO[levels]Oo. ]
94 
95  ##FIXME!!!!!!!!!
96  ##replace TrackerGeometryCompare.writeToDB = .oO[dbOutput]Oo.
97  ##removed: dbOutputService
98 
99 process.p = cms.Path(process.TrackerGeometryCompare)
100 """
101 
102 
103 
105 dbOutputTemplate= """
106 //_________________________ db Output ____________________________
107  # setup for writing out to DB
108  include "CondCore/DBCommon/CondDBSetup.cfi"
109 # include "CondCore/DBCommon/data/CondDBCommon.cfi"
110 
111  service = PoolDBOutputService {
112  using CondDBSetup
113  VPSet toPut = {
114  { string record = "TrackerAlignmentRcd" string tag = ".oO[tag]Oo." },
115  { string record = "TrackerAlignmentErrorExtendedRcd" string tag = ".oO[errortag]Oo." }
116  }
117  # string connect = "sqlite_file:.oO[workdir]Oo./.oO[name]Oo.Common.oO[common]Oo..db"
118  string connect = "sqlite_file:.oO[name]Oo.Common.oO[common]Oo..db"
119  # untracked string catalog = "file:alignments.xml"
120  untracked string timetype = "runnumber"
121  }
122 """
123 
124 
126 visualizationTrackerTemplate= """
127 #include "Alignment/OfflineValidation/scripts/visualizationTracker.C"
128 void TkAl3DVisualization_.oO[common]Oo._.oO[name]Oo.(){
129  //------------------------------ONLY NEEDED INPUTS-------------------------------//
130 //------Tree Read In--------
131  TString inputFileName = ".oO[outputFile]Oo.";
132  //output file name
133  string outputFileName = ".oO[common]Oo._.oO[name]Oo..Visualization";
134  //title
135  string line1 = ".oO[alignmentTitle]Oo.";
136  string line2 = "vs. .oO[referenceTitle]Oo.";
137  //set subdetectors to see
138  int subdetector1 = .oO[3DSubdetector1]Oo.;
139  int subdetector2 = .oO[3DSubdetector2]Oo.;
140  //translation scale factor
141  int sclftr = .oO[3DTranslationalScaleFactor]Oo.;
142  //rotation scale factor
143  int sclfrt = 1;
144  //module size scale factor
145  float sclfmodulesizex = 1;
146  float sclfmodulesizey = 1;
147  float sclfmodulesizez = 1;
148  //beam pipe radius
149  float piperadius = 2.25;
150  //beam pipe xy coordinates
151  float pipexcoord = 0;
152  float pipeycoord = 0;
153  //beam line xy coordinates
154  float linexcoord = 0;
155  float lineycoord = 0;
156 //------------------------------End of ONLY NEEDED INPUTS-------------------------------//
157  cout << "running visualizer" << endl;
158  runVisualizer(inputFileName,
159  outputFileName,
160  line1,
161  line2,
162  subdetector1,
163  subdetector2,
164  sclftr,
165  sclfrt,
166  sclfmodulesizex,
167  sclfmodulesizey,
168  sclfmodulesizez,
169  piperadius,
170  pipexcoord,
171  pipeycoord,
172  linexcoord,
173  lineycoord );
174 }
175 """