CMS 3D CMS Logo

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