Skip to content

Commit be8f632

Browse files
author
Sunanda
committed
Update the scripts in SimG4CMS/Calo/test/python for Run3 and Run4 scenarios
1 parent 2d878df commit be8f632

File tree

9 files changed

+111
-42
lines changed

9 files changed

+111
-42
lines changed

SimG4CMS/Calo/test/python/Gen_MinBias.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
###############################################################################
66
import FWCore.ParameterSet.Config as cms
7-
import os, sys, imp, re, random
7+
import os, sys, importlib, re, random
88
import FWCore.ParameterSet.VarParsing as VarParsing
99

1010
####################################################################

SimG4CMS/Calo/test/python/Gen_SingleMuon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
###############################################################################
66
import FWCore.ParameterSet.Config as cms
7-
import os, sys, imp, re, random
7+
import os, sys, importlib, re, random
88
import FWCore.ParameterSet.VarParsing as VarParsing
99

1010
####################################################################

SimG4CMS/Calo/test/python/SimRun3_cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
###############################################################################
1010
import FWCore.ParameterSet.Config as cms
11-
import os, sys, imp, re, random
11+
import os, sys, importlib, re, random
1212
import FWCore.ParameterSet.VarParsing as VarParsing
1313

1414
####################################################################

SimG4CMS/Calo/test/python/SimRun4_cfg.py

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
###############################################################################
22
# Way to use this:
3-
# cmsRun Sim2026_cfg.py geometry=D98 type=DDD data=Muon
3+
# cmsRun SimRun4_cfg.py geometry=D110 type=DDD data=Muon
44
#
5-
# Options for geometry: D98, D99
5+
# Options for geometry: D110, D120
66
# type: DDD, DD4hep
77
# data: Muon, MinBias
88
#
99
###############################################################################
1010
import FWCore.ParameterSet.Config as cms
11-
import os, sys, imp, re, random
11+
import os, sys, importlib, re, random
1212
import FWCore.ParameterSet.VarParsing as VarParsing
1313

1414
####################################################################
1515
### SETUP OPTIONS
1616
options = VarParsing.VarParsing('standard')
1717
options.register('geometry',
18-
"D98",
18+
"D110",
1919
VarParsing.VarParsing.multiplicity.singleton,
2020
VarParsing.VarParsing.varType.string,
21-
"geometry of operations: D98, D99")
21+
"geometry of operations: D110, D120")
2222
options.register('type',
2323
"DDD",
2424
VarParsing.VarParsing.multiplicity.singleton,
@@ -38,25 +38,28 @@
3838
####################################################################
3939
# Use the options
4040

41-
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
41+
geomName = "Run4" + options.geometry
42+
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
43+
GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName)
44+
4245
if (options.type == "DD4hep"):
4346
from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
44-
process = cms.Process('Sim2026',Phase2C17I13M9,dd4hep)
45-
geomFile = "Configuration.Geometry.Geometry" + options.type +"Extended2026" + options.geometry + "Reco_cff"
47+
process = cms.Process('SimRun4',ERA,dd4hep)
48+
geomFile = "Configuration.Geometry.Geometry" + options.type +"Extended" + geomName + "Reco_cff"
4649
else:
47-
process = cms.Process('Sim2026',Phase2C17I13M9)
48-
geomFile = "Configuration.Geometry.GeometryExtended2026" + options.geometry + "Reco_cff"
50+
process = cms.Process('SimRun4',ERA)
51+
geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff"
4952

50-
globalTag = "auto:phase2_realistic_T25"
5153
inFile = "file:step0" + options.data + ".root"
5254
outFile = "file:step1" + options.type + options.geometry + options.data + ".root"
5355
tFile = "file:" + options.type + options.geometry + options.data + ".root"
5456

55-
print("Geometry file: ", geomFile)
56-
print("Global Tag: ", globalTag)
57-
print("Input file: ", inFile)
58-
print("Output file: ", outFile)
59-
print("Histogram file:", tFile)
57+
print("Geometry file: ", geomFile)
58+
print("Global Tag Name: ", GLOBAL_TAG)
59+
print("Era Name: ", ERA)
60+
print("Input file: ", inFile)
61+
print("Output file: ", outFile)
62+
print("Histogram file: ", tFile)
6063

6164
process.load(geomFile)
6265
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
@@ -67,7 +70,7 @@
6770
process.load("Configuration.StandardSequences.SimIdeal_cff")
6871
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
6972
from Configuration.AlCa.GlobalTag import GlobalTag
70-
process.GlobalTag = GlobalTag(process.GlobalTag, globalTag, '')
73+
process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '')
7174

7275
process.source = cms.Source("PoolSource",
7376
dropDescendantsOfDroppedBranches = cms.untracked.bool(False),

SimG4CMS/Calo/test/python/minbias.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
###############################################################################
22
# Way to use this:
33
# cmsRun minbias.py geometry=2016
4-
# Options for geometry 2016, 2017, 2018, 2021, 2026, legacy
4+
# Options for geometry 2016, 2017, 2018, 2021, Run4, legacy
55
#
66
###############################################################################
77
import FWCore.ParameterSet.Config as cms
8-
import os, sys, imp, re
8+
import os, sys, importlib, re
99
import FWCore.ParameterSet.VarParsing as VarParsing
1010

1111
####################################################################
@@ -15,7 +15,7 @@
1515
"2021",
1616
VarParsing.VarParsing.multiplicity.singleton,
1717
VarParsing.VarParsing.varType.string,
18-
"geometry of operations: 2016, 2017, 2018, 2021, 2026, legacy")
18+
"geometry of operations: 2016, 2017, 2018, 2021, Run4, legacy")
1919

2020
### get and parse the command line arguments
2121

@@ -48,7 +48,7 @@
4848
process = cms.Process('Sim',Run3_DDD)
4949
geomFile = "Configuration.Geometry.GeometryExtended" + options.geometry + "Reco_cff"
5050
globalTag = "auto:phase1_2022_realistic"
51-
elif (options.geometry == "2026"):
51+
elif (options.geometry == "Run4"):
5252
from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
5353
process = cms.Process('Sim',Phase2C11M9)
5454
geomFile = "Configuration.Geometry.GeometryExtended" + options.geometry + "D110Reco_cff"

SimG4CMS/Calo/test/python/minbiasRun4_cfg.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# Way to use this:
33
# cmsRun testHGCalParametersDDD_cfg.py type=V18
44
#
5-
# Options for type V16, V17, V17Shift, V18
5+
# Options for type V16, V17, V17Shift, V18, V19
66
#
77
###############################################################################
88
import FWCore.ParameterSet.Config as cms
9-
import os, sys, imp, re
9+
import os, sys, importlib, re
1010
import FWCore.ParameterSet.VarParsing as VarParsing
1111

1212
####################################################################
@@ -16,23 +16,32 @@
1616
"V18",
1717
VarParsing.VarParsing.multiplicity.singleton,
1818
VarParsing.VarParsing.varType.string,
19-
"type of operations: V16, V17, V17Shift, V18")
19+
"type of operations: V16, V17, V17Shift, V18, V19")
2020

2121
### get and parse the command line arguments
2222
options.parseArguments()
2323
print(options)
2424

25-
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
26-
27-
process = cms.Process("HGCalParametersTest",Phase2C17I13M9)
2825

2926
if (options.type == "V18"):
27+
from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
28+
process = cms.Process("HGCalParametersTest",Phase2C22I13M9)
29+
geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + "Reco_cff"
30+
elif (options.type == "V19"):
31+
from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
32+
process = cms.Process("HGCalParametersTest",Phase2C22I13M9)
3033
geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + "Reco_cff"
3134
elif (options.type == "V17Shift"):
35+
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
36+
process = cms.Process("HGCalParametersTest",Phase2C17I13M9)
3237
geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + "Reco_cff"
3338
elif (options.type == "V17"):
39+
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
40+
process = cms.Process("HGCalParametersTest",Phase2C17I13M9)
3441
geomFile = "Configuration.Geometry.GeometryExtendedRun4D110Reco_cff"
3542
else:
43+
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
44+
process = cms.Process("HGCalParametersTest",Phase2C17I13M9)
3645
geomFile = "Configuration.Geometry.GeometryExtendedRun4D100Reco_cff"
3746

3847
outFile = "minbias" + options.type + ".root"

SimG4CMS/Calo/test/python/testHGCalGuardRing_cfg.py

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,59 @@
1+
###############################################################################
2+
# Way to use this:
3+
# cmsRun testHGCalGuardRing_cfg.py geometry=D110 type=DDD
4+
#
5+
# Options for geometry: D104, D110, D116, D120
6+
# type: DDD, DD4hep
7+
#
8+
###############################################################################
19
import FWCore.ParameterSet.Config as cms
2-
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
10+
import os, sys, importlib, re, random
11+
import FWCore.ParameterSet.VarParsing as VarParsing
312

4-
process = cms.Process("HGCalGuardRingTest",Phase2C17I13M9)
13+
####################################################################
14+
### SETUP OPTIONS
15+
options = VarParsing.VarParsing('standard')
16+
options.register('geometry',
17+
"D110",
18+
VarParsing.VarParsing.multiplicity.singleton,
19+
VarParsing.VarParsing.varType.string,
20+
"geometry of operations: D104, D110, D116, D120")
21+
options.register('type',
22+
"DDD",
23+
VarParsing.VarParsing.multiplicity.singleton,
24+
VarParsing.VarParsing.varType.string,
25+
"type of operations: DDD, DD4hep")
26+
27+
### get and parse the command line arguments
28+
options.parseArguments()
29+
30+
print(options)
31+
32+
####################################################################
33+
# Use the options
34+
35+
geomName = "Run4" + options.geometry
36+
import Configuration.Geometry.defaultPhase2ConditionsEra_cff as _settings
37+
GLOBAL_TAG, ERA = _settings.get_era_and_conditions(geomName)
38+
39+
if (options.type == "DD4hep"):
40+
from Configuration.ProcessModifiers.dd4hep_cff import dd4hep
41+
process = cms.Process('GuardRing',ERA,dd4hep)
42+
geomFile = "Configuration.Geometry.Geometry" + options.type +"Extended" + geomName + "Reco_cff"
43+
else:
44+
process = cms.Process('GuardRing',ERA)
45+
geomFile = "Configuration.Geometry.GeometryExtended" + geomName + "Reco_cff"
46+
47+
print("Geometry file: ", geomFile)
48+
print("Global Tag Name: ", GLOBAL_TAG)
49+
print("Era Name: ", ERA)
550

651
process.load("SimGeneral.HepPDTESSource.pdt_cfi")
7-
process.load("Configuration.Geometry.GeometryExtendedRun4D110Reco_cff")
52+
process.load(geomFile)
853
process.load('FWCore.MessageService.MessageLogger_cfi')
54+
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
55+
from Configuration.AlCa.GlobalTag import GlobalTag
56+
process.GlobalTag = GlobalTag(process.GlobalTag, GLOBAL_TAG, '')
957

1058
if hasattr(process,'MessageLogger'):
1159
process.MessageLogger.HGCSim=dict()

SimG4CMS/Calo/test/python/testHGCalMouseBite_cfg.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import FWCore.ParameterSet.Config as cms
2-
import os, sys, imp, re
2+
import os, sys, importlib, re
33
import FWCore.ParameterSet.VarParsing as VarParsing
44

55
####################################################################
@@ -9,25 +9,34 @@
99
"V18",
1010
VarParsing.VarParsing.multiplicity.singleton,
1111
VarParsing.VarParsing.varType.string,
12-
"type of operations: V16, V17, V17Shift, V18")
12+
"type of operations: V16, V17, V17Shift, V18, V19")
1313

1414
### get and parse the command line arguments
1515
options.parseArguments()
1616
print(options)
1717

18-
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
19-
20-
process = cms.Process("HGCalMouseBiteTest",Phase2C17I13M9)
2118

2219
####################################################################
2320
# Use the options
2421
if (options.type == "V18"):
22+
from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
23+
process = cms.Process("HGCalMouseBiteTest",Phase2C22I13M9)
2524
geomFile = "Configuration.Geometry.GeometryExtendedRun4D104_cff"
25+
elif (options.type == "V19"):
26+
from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9
27+
process = cms.Process("HGCalMouseBiteTest",Phase2C22I13M9)
28+
geomFile = "Configuration.Geometry.GeometryExtendedRun4D120_cff"
2629
elif (options.type == "V17Shift"):
30+
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
31+
process = cms.Process("HGCalMouseBiteTest",Phase2C17I13M9)
2732
geomFile = "Geometry.HGCalCommonData.testHGCal" + options.type + "Reco_cff"
2833
elif (options.type == "V16"):
34+
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
35+
process = cms.Process("HGCalMouseBiteTest",Phase2C17I13M9)
2936
geomFile = "Configuration.Geometry.GeometryExtendedRun4D100_cff"
3037
else:
38+
from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9
39+
process = cms.Process("HGCalMouseBiteTest",Phase2C17I13M9)
3140
geomFile = "Configuration.Geometry.GeometryExtendedRun4D110_cff"
3241

3342
print("Geometry file: ", geomFile)

SimG4CMS/Calo/test/python/ttbar.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
###############################################################################
22
# Way to use this:
33
# cmsRun ttbar.py geometry=2016
4-
# Options for geometry 2016, 2017, 2018, 2021, 2026, legacy
4+
# Options for geometry 2016, 2017, 2018, 2021, Run4, legacy
55
#
66
###############################################################################
77
import FWCore.ParameterSet.Config as cms
8-
import os, sys, imp, re
8+
import os, sys, importlib, re
99
import FWCore.ParameterSet.VarParsing as VarParsing
1010

1111
####################################################################
@@ -15,7 +15,7 @@
1515
"2021",
1616
VarParsing.VarParsing.multiplicity.singleton,
1717
VarParsing.VarParsing.varType.string,
18-
"geometry of operations: 2016, 2017, 2018, 2021, 2026, legacy")
18+
"geometry of operations: 2016, 2017, 2018, 2021, Run4, legacy")
1919

2020
### get and parse the command line arguments
2121

@@ -48,7 +48,7 @@
4848
process = cms.Process('Sim',Run3_DDD)
4949
geomFile = "Configuration.Geometry.GeometryExtended" + options.geometry + "Reco_cff"
5050
globalTag = "auto:phase1_2022_realistic"
51-
elif (options.geometry == "2026"):
51+
elif (options.geometry == "Run4"):
5252
from Configuration.Eras.Era_Phase2C11M9_cff import Phase2C11M9
5353
process = cms.Process('Sim',Phase2C11M9)
5454
geomFile = "Configuration.Geometry.GeometryExtended" + options.geometry + "D110Reco_cff"

0 commit comments

Comments
 (0)