14 from ROOT.Belle2
import KLMDatabaseImporter, BKLMAlignment, EKLMAlignment, \
15 EKLMSegmentAlignment, KLMAlignmentData, \
16 KLMChannelIndex, KLMDisplacementGenerator
19 main = basf2.create_path()
20 basf2.set_log_level(basf2.LogLevel.INFO)
23 main.add_module(
'EventInfoSetter')
26 main.add_module(
'Gearbox')
31 dbImporter = KLMDatabaseImporter()
33 bklmAlignment = BKLMAlignment()
34 eklmAlignment = EKLMAlignment()
35 eklmSegmentAlignment = EKLMSegmentAlignment()
38 displacementGenerator = KLMDisplacementGenerator()
39 displacementGenerator.fillZeroDisplacements(
40 eklmAlignment, eklmSegmentAlignment)
41 displacementGenerator.generateFixedModuleDisplacement(1, 0, 0)
42 displacementGenerator.saveDisplacement(
43 eklmAlignment, eklmSegmentAlignment,
'EKLMDisplacement.root')
46 alignmentData = KLMAlignmentData(0, 0, 0, 0, 0, 0)
47 index = KLMChannelIndex(KLMChannelIndex.c_IndexLevelLayer)
48 index2 = KLMChannelIndex(KLMChannelIndex.c_IndexLevelLayer)
49 index = index2.beginBKLM()
51 while (index != index2.endBKLM()):
52 module = index.getKLMModuleNumber()
53 bklmAlignment.setModuleAlignment(module, alignmentData)
57 dbImporter.setIOV(0, 0, -1, -1)
58 dbImporter.importAlignment(
59 bklmAlignment, eklmAlignment, eklmSegmentAlignment,
True)