16 from ROOT.Belle2
import KLMDatabaseImporter, BKLMAlignment, EKLMAlignment, \
17 EKLMSegmentAlignment, KLMAlignmentData, \
18 KLMElementNumbers, KLMChannelIndex
20 basf2.set_log_level(basf2.LogLevel.INFO)
23 if (len(sys.argv) >= 2):
24 if (sys.argv[1] ==
'mc'):
27 dbImporter = KLMDatabaseImporter()
29 bklmAlignment = BKLMAlignment()
30 eklmAlignment = EKLMAlignment()
31 eklmSegmentAlignment = EKLMSegmentAlignment()
33 alignmentData = KLMAlignmentData(0, 0, 0, 0, 0, 0)
35 index = KLMChannelIndex(KLMChannelIndex.c_IndexLevelLayer)
36 index2 = KLMChannelIndex(KLMChannelIndex.c_IndexLevelLayer)
38 while (index != index2.end()):
39 module = index.getKLMModuleNumber()
40 if (index.getSubdetector() == KLMElementNumbers.c_BKLM):
41 bklmAlignment.setModuleAlignment(module, alignmentData)
43 eklmAlignment.setModuleAlignment(module, alignmentData)
46 index.setIndexLevel(KLMChannelIndex.c_IndexLevelStrip)
47 index2.setIndexLevel(KLMChannelIndex.c_IndexLevelStrip)
48 index = index2.beginEKLM()
49 index.useEKLMSegments()
50 while (index != index2.endEKLM()):
51 segment = index.getEKLMSegmentNumber()
52 eklmSegmentAlignment.setSegmentAlignment(segment, alignmentData)
56 dbImporter.setIOV(0, 0, 0, -1)
57 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
59 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
60 eklmSegmentAlignment,
True)
62 dbImporter.setIOV(1002, 0, 1002, -1)
63 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
65 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
66 eklmSegmentAlignment,
True)
68 dbImporter.setIOV(1003, 0, 1003, -1)
69 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
71 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
72 eklmSegmentAlignment,
True)
75 dbImporter.setIOV(0, 0, -1, -1)
76 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
78 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
79 eklmSegmentAlignment,
True)