15 from ROOT.Belle2
import KLMDatabaseImporter, BKLMAlignment, EKLMAlignment, \
16 EKLMSegmentAlignment, KLMAlignmentData, \
17 KLMElementNumbers, KLMChannelIndex
19 basf2.set_log_level(basf2.LogLevel.INFO)
22 if (len(sys.argv) >= 2):
23 if (sys.argv[1] ==
'mc'):
26 dbImporter = KLMDatabaseImporter()
28 bklmAlignment = BKLMAlignment()
29 eklmAlignment = EKLMAlignment()
30 eklmSegmentAlignment = EKLMSegmentAlignment()
32 alignmentData = KLMAlignmentData(0, 0, 0, 0, 0, 0)
34 index = KLMChannelIndex(KLMChannelIndex.c_IndexLevelLayer)
35 index2 = KLMChannelIndex(KLMChannelIndex.c_IndexLevelLayer)
37 while (index != index2.end()):
38 module = index.getKLMModuleNumber()
39 if (index.getSubdetector() == KLMElementNumbers.c_BKLM):
40 bklmAlignment.setModuleAlignment(module, alignmentData)
42 eklmAlignment.setModuleAlignment(module, alignmentData)
45 index.setIndexLevel(KLMChannelIndex.c_IndexLevelStrip)
46 index2.setIndexLevel(KLMChannelIndex.c_IndexLevelStrip)
47 index = index2.beginEKLM()
48 index.useEKLMSegments()
49 while (index != index2.endEKLM()):
50 segment = index.getEKLMSegmentNumber()
51 eklmSegmentAlignment.setSegmentAlignment(segment, alignmentData)
55 dbImporter.setIOV(0, 0, 0, -1)
56 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
58 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
59 eklmSegmentAlignment,
True)
61 dbImporter.setIOV(1002, 0, 1002, -1)
62 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
64 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
65 eklmSegmentAlignment,
True)
67 dbImporter.setIOV(1003, 0, 1003, -1)
68 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
70 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
71 eklmSegmentAlignment,
True)
74 dbImporter.setIOV(0, 0, -1, -1)
75 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
77 dbImporter.importAlignment(bklmAlignment, eklmAlignment,
78 eklmSegmentAlignment,
True)