CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
geometryXMLtoCSV.ContentHandler Class Reference
Inheritance diagram for geometryXMLtoCSV.ContentHandler:

Public Member Functions

def endElement
 
def startElement
 

Detailed Description

Definition at line 36 of file geometryXMLtoCSV.py.

Member Function Documentation

def geometryXMLtoCSV.ContentHandler.endElement (   self,
  tag 
)

Definition at line 74 of file geometryXMLtoCSV.py.

References print().

74 
75  def endElement(self, tag):
76  if tag == "operation":
77  print("") # end current line (note: no comma)
78 
# Actually make it and use it on "stdin" (a file object)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def geometryXMLtoCSV.ContentHandler.startElement (   self,
  tag,
  attrib 
)

Definition at line 38 of file geometryXMLtoCSV.py.

References print().

38 
39  def startElement(self, tag, attrib):
40  attrib = dict(attrib.items())
41  if "rawId" in attrib: raise Exception("Please use \"rawIds = false\"")
42  if "aa" in attrib: raise Exception("Please use \"survey = false\"")
43 
44  # <DT...>: print wheel/station/sector/superlayer/layer
45  if tag[0:2] == "DT":
46  print(tag, end=' ') # ending with a comma means "don't print end-of-line character"
47  for a in "wheel", "station", "sector", "superlayer", "layer":
48  if a in attrib:
49  print((", %s" % attrib[a]), end=' ')
50  else:
51  print(", ", end=' ')
52 
53  # <CSC...>: print endcap/station/ring/chamber/layer
54  elif tag[0:3] == "CSC":
55  print(tag, end=' ')
56  for a in "endcap", "station", "ring", "chamber", "layer":
57  if a in attrib:
58  print((", %s" % attrib[a]), end=' ')
59  else:
60  print(", ", end=' ')
61 
62  # <setposition>: print x, y, z and phix, phiy, phiz or alpha, beta, gamma
63  elif tag == "setposition":
64  print((", %(relativeto)s, %(x)s, %(y)s, %(z)s" % attrib), end=' ')
65  if "phix" in attrib:
66  print((", phixyz, %(phix)s, %(phiy)s, %(phiz)s" % attrib), end=' ')
67  else:
68  print((", Euler, %(alpha)s, %(beta)s, %(gamma)s" % attrib), end=' ')
69 
70  # <setape>: print xx, xy, xz, yy, yz, zz
71  elif tag == "setape":
72  print((", %(xx)s, %(xy)s, %(xz)s, %(yy)s, %(yz)s, %(zz)s" % attrib), end=' ')
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47