Classes | |
class | Alignable |
class | CSCAlignable |
class | DTAlignable |
class | MuonGeometry |
class | Operation |
Functions | |
def | cscorder |
def | dtorder |
def geometryXMLparser::cscorder | ( | a, | ||
b | ||||
) |
Definition at line 36 of file geometryXMLparser.py.
00036 : 00037 for ai, bi, name in zip(list(a) + [0]*(5 - len(a)), \ 00038 list(b) + [0]*(5 - len(b)), \ 00039 ("endcap", "station", "ring", "chamber", "layer")): 00040 exec("a%s = %d" % (name, ai)) 00041 exec("b%s = %d" % (name, bi)) 00042 00043 if astation == 1 and aring == 3: return cmp(a, b) 00044 00045 elif aendcap == bendcap and astation == bstation and aring == bring and achamber != bchamber: 00046 if achamber == 0: return -1 # upper hierarchy comes first 00047 if bchamber == 0: return 1 # upper hierarchy comes first 00048 if achamber % 2 == 1 and bchamber % 2 == 0: return -1 # odds come first 00049 elif achamber % 2 == 0 and bchamber % 2 == 1: return 1 # evens come after 00050 00051 return cmp(a, b) 00052 00053 # External libraries (standard in Python >= 2.4, at least) import xml.sax
def geometryXMLparser::dtorder | ( | a, | ||
b | ||||
) |
Definition at line 15 of file geometryXMLparser.py.
00015 : 00016 for ai, bi, name in zip(list(a) + [0]*(5 - len(a)), \ 00017 list(b) + [0]*(5 - len(b)), \ 00018 ("wheel", "station", "sector", "superlayer", "layer")): 00019 exec("a%s = %d" % (name, ai)) 00020 exec("b%s = %d" % (name, bi)) 00021 00022 if awheel == bwheel and astation == bstation: 00023 00024 if asector != bsector: 00025 if astation == 4: sectororder = [0, 1, 2, 3, 4, 13, 5, 6, 7, 8, 9, 10, 14, 11, 12] 00026 elif awheel == 0: sectororder = [0, 1, 5, 9, 2, 6, 10, 3, 7, 11, 4, 8, 12] 00027 else: sectororder = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] 00028 return cmp(sectororder.index(asector), sectororder.index(bsector)) 00029 00030 elif asuperlayer != bsuperlayer: 00031 superlayerorder = [0, 1, 3, 2] 00032 return cmp(superlayerorder.index(asuperlayer), superlayerorder.index(bsuperlayer)) 00033 00034 return cmp(a, b) 00035 def cscorder(a, b):