CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
gemGeometryCustoms.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 ## change the current default GEM geometry
4 
5 ## GE1/1 in 2019/2023 scenario
7  mynum = process.XMLIdealGeometryESSource.geomXMLFiles.index('Geometry/MuonCommonData/data/v4/gem11.xml')
8  process.XMLIdealGeometryESSource.geomXMLFiles.remove('Geometry/MuonCommonData/data/v4/gem11.xml')
9  process.XMLIdealGeometryESSource.geomXMLFiles.insert(mynum,'Geometry/MuonCommonData/data/v2/gem11.xml')
10  return process
11 
13  mynum = process.XMLIdealGeometryESSource.geomXMLFiles.index('Geometry/MuonCommonData/data/v4/gem11.xml')
14  process.XMLIdealGeometryESSource.geomXMLFiles.remove('Geometry/MuonCommonData/data/v4/gem11.xml')
15  process.XMLIdealGeometryESSource.geomXMLFiles.insert(mynum,'Geometry/MuonCommonData/data/v5/gem11.xml')
16  return process
17 
19  ## This is the default version
20  return process
21 
23  mynum = process.XMLIdealGeometryESSource.geomXMLFiles.index('Geometry/MuonCommonData/data/v4/gem11.xml')
24  process.XMLIdealGeometryESSource.geomXMLFiles.remove('Geometry/MuonCommonData/data/v4/gem11.xml')
25  process.XMLIdealGeometryESSource.geomXMLFiles.insert(mynum,'Geometry/MuonCommonData/data/v3/gem11.xml')
26  return process
27 
29  mynum = process.XMLIdealGeometryESSource.geomXMLFiles.index('Geometry/MuonCommonData/data/v4/gem11.xml')
30  process.XMLIdealGeometryESSource.geomXMLFiles.remove('Geometry/MuonCommonData/data/v4/gem11.xml')
31  process.XMLIdealGeometryESSource.geomXMLFiles.insert(mynum,'Geometry/MuonCommonData/data/v6/gem11.xml')
32  return process
33 
35  mynum = process.XMLIdealGeometryESSource.geomXMLFiles.index('Geometry/MuonCommonData/data/v4/gem11.xml')
36  process.XMLIdealGeometryESSource.geomXMLFiles.remove('Geometry/MuonCommonData/data/v4/gem11.xml')
37  process.XMLIdealGeometryESSource.geomXMLFiles.insert(mynum,'Geometry/MuonCommonData/data/v7/gem11.xml')
38  return process
39 
40 ### GE2/2 in 2023 scenario
41 def custom_GE21_v7(process) :
42  geomReplace( process, 'gem11.xml','Geometry/MuonCommonData/data/v7/gem11.xml')
43  geomReplace( process, 'gem21.xml','Geometry/MuonCommonData/data/v7/gem21.xml')
44  geomReplace( process, 'GEMSpecs.xml','Geometry/GEMGeometryBuilder/data/v7/GEMSpecs.xml')
45  return process
46 
47 def custom_GE21_v7_10deg(process) :
48  geomReplace( process, 'gem11.xml','Geometry/MuonCommonData/data/v7/gem11.xml')
49  geomReplace( process, 'gem21.xml','Geometry/MuonCommonData/data/v7_10deg/gem21.xml')
50  geomReplace( process, 'GEMSpecs.xml','Geometry/GEMGeometryBuilder/data/v7_10deg/GEMSpecs.xml')
51  return process
52 
53 def geomReplace(process, key, targetXML) :
54  mynum=-1
55  originalXML=''
56  for i, xml in enumerate( process.XMLIdealGeometryESSource.geomXMLFiles) :
57  if ( xml.find(key) != -1 ) :
58  mynum, originalXML = i, xml
59  break ## For now, to change multiple keys is not supported.
60  if ( mynum != -1 and originalXML != targetXML ) :
61  print "Changing Geometry from %s to %s"%(originalXML, targetXML)
62  process.XMLIdealGeometryESSource.geomXMLFiles.remove(originalXML)
63  process.XMLIdealGeometryESSource.geomXMLFiles.insert(mynum,targetXML)
64  if ( mynum == -1) :
65  print "Alert! key is not found on XMLIdealGeometryESSource"
66  return process
67 
def custom_GE11_6partitions_v1
change the current default GEM geometry
def custom_GE21_v7
GE2/2 in 2023 scenario.