Skip to content

Commit 8cb60b7

Browse files
authored
Merge pull request #45866 from mmusich/mm_dev_autoGeom_TrackerGeometryBuilder
add few more default geometry tests in `Geometry/TrackerGeometryBuilder`
2 parents 62a1f50 + 9441ccf commit 8cb60b7

File tree

3 files changed

+92
-5
lines changed

3 files changed

+92
-5
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import FWCore.ParameterSet.Config as cms
2+
import FWCore.ParameterSet.VarParsing as VarParsing
3+
4+
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
5+
###################################################################
6+
# Setup 'standard' options
7+
###################################################################
8+
options = VarParsing.VarParsing()
9+
options.register('Scenario',
10+
_settings.DEFAULT_VERSION, # default value
11+
VarParsing.VarParsing.multiplicity.singleton, # singleton or list
12+
VarParsing.VarParsing.varType.string, # string, int, or float
13+
"geometry version to use: 2026DXXX")
14+
options.parseArguments()
15+
16+
###################################################################
17+
# get Global Tag and ERA
18+
###################################################################
19+
GLOBAL_TAG, ERA = _settings.get_era_and_conditions(options.Scenario)
20+
21+
process = cms.Process("GeometryTest",ERA)
22+
process.load("FWCore.MessageLogger.MessageLogger_cfi")
23+
24+
# Choose Tracker Geometry
25+
if(options.Scenario == _settings.DEFAULT_VERSION):
26+
print("Loading default scenario: ", _settings.DEFAULT_VERSION)
27+
process.load('Configuration.Geometry.GeometryExtended2026DefaultReco_cff')
28+
else:
29+
process.load('Configuration.Geometry.GeometryExtended'+options.Scenario+'Reco_cff')
30+
31+
process.source = cms.Source("EmptySource")
32+
33+
process.maxEvents = cms.untracked.PSet(
34+
input = cms.untracked.int32(1)
35+
)
36+
process.prod = cms.EDAnalyzer("GeoHierarchy",
37+
fromDDD = cms.bool(True)
38+
)
39+
40+
process.load("Alignment.CommonAlignmentProducer.FakeAlignmentSource_cfi")
41+
process.preferFakeAlign = cms.ESPrefer("FakeAlignmentSource")
42+
43+
process.p1 = cms.Path(process.prod)

Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDD4hep_cfg.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
import FWCore.ParameterSet.Config as cms
2+
import FWCore.ParameterSet.VarParsing as VarParsing
23

3-
from Configuration.Eras.Era_Run3_dd4hep_cff import Run3_dd4hep
4+
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
5+
###################################################################
6+
# Setup 'standard' options
7+
###################################################################
8+
options = VarParsing.VarParsing()
9+
options.register('Scenario',
10+
_settings.DEFAULT_VERSION, # default value
11+
VarParsing.VarParsing.multiplicity.singleton, # singleton or list
12+
VarParsing.VarParsing.varType.string, # string, int, or float
13+
"geometry version to use: 2026DXXX")
14+
options.parseArguments()
415

5-
process = cms.Process("GeometryTest", Run3_dd4hep)
16+
###################################################################
17+
# get Global Tag and ERA
18+
###################################################################
19+
GLOBAL_TAG, ERA = _settings.get_era_and_conditions(options.Scenario)
20+
21+
from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
22+
process = cms.Process("GeometryTest", ERA, dd4hep)
623
process.load("FWCore.MessageLogger.MessageLogger_cfi")
724

825
# Choose Tracker Geometry
9-
process.load('Configuration.Geometry.GeometryDD4hepExtended2026D100Reco_cff')
26+
if(options.Scenario == _settings.DEFAULT_VERSION):
27+
print("Loading default scenario: ", _settings.DEFAULT_VERSION)
28+
process.load('Configuration.Geometry.GeometryDD4hepExtended2026DefaultReco_cff')
29+
else:
30+
process.load('Configuration.Geometry.GeometryDD4hepExtended'+options.Scenario+'Reco_cff')
1031

1132
process.TrackerGeometricDetESModule = cms.ESProducer( "TrackerGeometricDetESModule",
1233
fromDDD = cms.bool( False ),

Geometry/TrackerGeometryBuilder/test/python/testTrackerModuleInfoDDD_cfg.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
11
import FWCore.ParameterSet.Config as cms
2+
import FWCore.ParameterSet.VarParsing as VarParsing
23

3-
process = cms.Process("GeometryTest")
4+
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
5+
###################################################################
6+
# Setup 'standard' options
7+
###################################################################
8+
options = VarParsing.VarParsing()
9+
options.register('Scenario',
10+
_settings.DEFAULT_VERSION, # default value
11+
VarParsing.VarParsing.multiplicity.singleton, # singleton or list
12+
VarParsing.VarParsing.varType.string, # string, int, or float
13+
"geometry version to use: 2026DXXX")
14+
options.parseArguments()
15+
16+
###################################################################
17+
# get Global Tag and ERA
18+
###################################################################
19+
GLOBAL_TAG, ERA = _settings.get_era_and_conditions(options.Scenario)
20+
21+
process = cms.Process("GeometryTest",ERA)
422
# empty input service, fire 10 events
523
process.load("FWCore.MessageLogger.MessageLogger_cfi")
624

725
# Choose Tracker Geometry
8-
process.load('Configuration.Geometry.GeometryExtended2026D100_cff')
26+
if(options.Scenario == _settings.DEFAULT_VERSION):
27+
print("Loading default scenario: ", _settings.DEFAULT_VERSION)
28+
process.load('Configuration.Geometry.GeometryExtended2026Default_cff')
29+
else:
30+
process.load('Configuration.Geometry.GeometryExtended'+options.Scenario+'_cff')
31+
932
process.load('Geometry.CommonTopologies.globalTrackingGeometry_cfi')
1033
process.load('Geometry.TrackerGeometryBuilder.trackerParameters_cfi')
1134
process.load('Geometry.TrackerNumberingBuilder.trackerTopology_cfi')

0 commit comments

Comments
 (0)