@@ -43,7 +43,7 @@ def versionCheck(ver):
4343 print ("" )
4444 help ()
4545
46- def recoGeoLoad (score ):
46+ def recoGeoLoad (score , properties ):
4747 print ("Loading configuration for tag " , options .tag ,"...\n " )
4848
4949 if score == "Run1" :
@@ -64,7 +64,7 @@ def recoGeoLoad(score):
6464 process .GlobalTag .globaltag = autoCond ['upgrade2017' ]
6565 process .load ('Configuration.Geometry.GeometryExtended2017Reco_cff' )
6666
67- elif score == "2021" :
67+ elif score == "2021" :
6868 process .load ("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff" )
6969 from Configuration .AlCa .autoCond import autoCond
7070 process .GlobalTag .globaltag = autoCond ['upgrade2021' ]
@@ -78,10 +78,32 @@ def recoGeoLoad(score):
7878 elif "2026" in score :
7979 versionCheck (options .version )
8080 process .load ("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff" )
81- from Configuration .AlCa .autoCond import autoCond
82- process .GlobalTag .globaltag = autoCond ['phase2_realistic' ]
81+
82+ # Import the required configuration from the CMSSW module
83+ from Configuration .AlCa .autoCond import autoCond # Ensure autoCond is imported
84+
85+ # Ensure options.version is defined and set correctly
86+ version_key = '2026' + options .version # This constructs the key for accessing the properties dictionary
87+ print (f"Constructed version key: { version_key } " )
88+
89+ # Check if the key exists in properties for 2026
90+ if version_key in properties [2026 ]:
91+ # Get the specific global tag for this version
92+ global_tag_key = properties [2026 ][version_key ]['GT' ]
93+ print (f"Global tag key from properties: { global_tag_key } " )
94+
95+ # Check if this key exists in autoCond
96+ if global_tag_key .replace ("auto:" , "" ) in autoCond :
97+ # Set the global tag
98+ from Configuration .AlCa .GlobalTag import GlobalTag
99+ process .GlobalTag = GlobalTag (process .GlobalTag , global_tag_key , '' )
100+ else :
101+ raise KeyError (f"Global tag key '{ global_tag_key } ' not found in autoCond." )
102+ else :
103+ raise KeyError (f"Version key '{ version_key } ' not found in properties[2026]." )
83104 process .load ('Configuration.Geometry.GeometryExtended2026' + options .version + 'Reco_cff' )
84-
105+ process .trackerGeometry .applyAlignment = cms .bool (False )
106+
85107 elif score == "MaPSA" :
86108 process .load ('Geometry.TrackerGeometryBuilder.idealForDigiTrackerGeometry_cff' )
87109 process .load ('Geometry.TrackerCommonData.mapsaGeometryXML_cfi' )
@@ -114,11 +136,8 @@ def recoGeoLoad(score):
114136 help ()
115137
116138
117-
118-
119139options = VarParsing .VarParsing ()
120140
121-
122141defaultOutputFileName = "cmsRecoGeom.root"
123142
124143options .register ('tag' ,
@@ -171,16 +190,33 @@ def recoGeoLoad(score):
171190
172191options .parseArguments ()
173192
174-
175-
176-
177- process = cms .Process ("DUMP" )
193+ from Configuration .PyReleaseValidation .upgradeWorkflowComponents import upgradeProperties as properties
194+ # Determine version_key based on the value of options.tag
195+ if options .tag == "2026" or options .tag == "MaPSA" :
196+ prop_key = 2026
197+ version_key = options .tag + options .version
198+ elif options .tag == "2017" or options .tag == "2021" : #(this leads to crashes in tests ?)
199+ prop_key = 2017
200+ version_key = options .tag
201+ else :
202+ prop_key = None
203+ version_key = None
204+
205+ if (prop_key and version_key ):
206+ print (f"Constructed version key: { version_key } " )
207+ era_key = properties [prop_key ][str (version_key )]['Era' ]
208+ print (f"Constructed era key: { era_key } " )
209+ from Configuration .StandardSequences .Eras import eras
210+ era = getattr (eras , era_key )
211+ process = cms .Process ("DUMP" ,era )
212+ else :
213+ process = cms .Process ("DUMP" )
178214process .add_ (cms .Service ("InitRootHandlers" , ResetRootErrHandler = cms .untracked .bool (False )))
179215process .source = cms .Source ("EmptySource" )
180216process .maxEvents = cms .untracked .PSet (input = cms .untracked .int32 (1 ))
181217
182218
183- recoGeoLoad (options .tag )
219+ recoGeoLoad (options .tag , properties )
184220
185221if ( options .tgeo == True ):
186222 if (options .out == defaultOutputFileName ):
0 commit comments