CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MuonGeometrySanityCheck_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 MuonGeometrySanityCheck = cms.EDAnalyzer(
4  "MuonGeometrySanityCheck",
5  printout = cms.string("all"),
6  tolerance = cms.double(1e-6),
7  prefix = cms.string("CHECK"),
8  frames = cms.VPSet(),
9  points = cms.VPSet(),
10  )
11 
12 def detectors(dt=True, csc=True, me42=False, chambers=True, superlayers=False, layers=False):
13  output = []
14  if dt:
15  for wheelName in "-2", "-1", "0", "+1", "+2":
16  for stationName in "1", "2", "3", "4":
17  numSectors = 12
18  if stationName == "4": numSectors = 14
19  for sectorName in map(str, range(1, numSectors+1)):
20  name = "MB" + wheelName + "/" + stationName + "/" + sectorName
21  if chambers: output.append(name)
22 
23  superlayerNames = "1", "2", "3"
24  if stationName == "4": superlayerNames = "1", "3"
25  for superlayerName in superlayerNames:
26  name = "MB" + wheelName + "/" + stationName + "/" + sectorName + "/" + superlayerName
27  if superlayers: output.append(name)
28 
29  for layerName in "1", "2", "3", "4":
30  name = "MB" + wheelName + "/" + stationName + "/" + sectorName + "/" + superlayerName + "/" + layerName
31  if layers: output.append(name)
32 
33  if csc:
34  for stationName in "-4", "-3", "-2", "-1", "+1", "+2", "+3", "+4":
35  ringNames = "1", "2"
36  if stationName in ("-1", "+1"): ringNames = "1", "2", "3", "4"
37  for ringName in ringNames:
38  numChambers = 36
39  if stationName + "/" + ringName in ("-4/1", "-3/1", "-2/1", "+2/1", "+3/1", "+4/1"): numChambers = 18
40  for chamberName in map(str, range(1, numChambers+1)):
41  name = "ME" + stationName + "/" + ringName + "/" + chamberName
42  if chambers:
43  if me42 or stationName + "/" + ringName not in ("-4/2", "+4/2"):
44  output.append(name)
45 
46  for layerName in "1", "2", "3", "4", "5", "6":
47  name = "ME" + stationName + "/" + ringName + "/" + chamberName + "/" + layerName
48  if layers:
49  if me42 or stationName + "/" + ringName not in ("-4/2", "+4/2"):
50  output.append(name)
51 
52  return output