15from ROOT
import Belle2
16from ROOT.Belle2
import KLMDatabaseImporter, BKLMAlignment, EKLMAlignment, \
17 EKLMSegmentAlignment, KLMAlignmentData, \
18 KLMElementNumbers, KLMChannelIndex
20basf2.set_log_level(basf2.LogLevel.INFO)
23if (len(sys.argv) >= 2):
24 if (sys.argv[1] ==
'mc'):
27dbImporter = KLMDatabaseImporter()
29bklmAlignment = BKLMAlignment()
30eklmAlignment = EKLMAlignment()
31eklmSegmentAlignment = EKLMSegmentAlignment()
33alignmentData = KLMAlignmentData(0, 0, 0, 0, 0, 0)
35index = KLMChannelIndex(KLMChannelIndex.c_IndexLevelLayer)
36index2 = KLMChannelIndex(KLMChannelIndex.c_IndexLevelLayer)
38while (index != index2.end()):
39 module = index.getKLMModuleNumber()
40 if (index.getSubdetector() == KLMElementNumbers.c_BKLM):
41 bklmAlignment.setModuleAlignment(module, alignmentData)
43 eklmAlignment.setModuleAlignment(module, alignmentData)
46index.setIndexLevel(KLMChannelIndex.c_IndexLevelStrip)
47index2.setIndexLevel(KLMChannelIndex.c_IndexLevelStrip)
48index = index2.beginEKLM()
49index.useEKLMSegments()
50while (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)