14 <contact>software-tracking@belle2.org</contact>
15 <input>CosmicsExtrapolation.root</input>
16 <output>CosmicsExtrapolationPlots.root</output>
17 <description>Validation of cosmic track extrapolation.</description>
21 from ROOT
import Belle2, TNamed
23 contact =
'Kirill Chilikin (chilikin@lebedev.ru)'
26 input_file = ROOT.TFile(
'../CosmicsExtrapolation.root')
27 output_file = ROOT.TFile(
'CosmicsExtrapolationPlots.root',
'recreate')
33 hist_xres = ROOT.TH1F(
'xres',
'Extrapolated hit X resolution', 100, -20, 20)
34 hist_xres.SetXTitle(
'cm')
35 hist_xres.SetYTitle(
'Events')
36 function_list = hist_xres.GetListOfFunctions()
37 function_list.Add(TNamed(
'Description',
'X resolution'))
38 function_list.Add(TNamed(
'Check',
'No bias, resolution ~ 2 cm.'))
39 function_list.Add(TNamed(
'Contact', contact))
40 function_list.Add(TNamed(
'MetaOptions',
'shifter'))
42 hist_yres = ROOT.TH1F(
'yres',
'Extrapolated hit Y resolution', 100, -20, 20)
43 hist_yres.SetXTitle(
'cm')
44 hist_yres.SetYTitle(
'Events')
45 function_list = hist_yres.GetListOfFunctions()
46 function_list.Add(TNamed(
'Description',
'Y resolution'))
47 function_list.Add(TNamed(
'Check',
'No bias, resolution ~ 2 cm.'))
48 function_list.Add(TNamed(
'Contact', contact))
49 function_list.Add(TNamed(
'MetaOptions',
'shifter'))
51 hist_zres = ROOT.TH1F(
'zres',
'Extrapolated hit Z resolution', 100, -20, 20)
52 hist_zres.SetXTitle(
'cm')
53 hist_zres.SetYTitle(
'Events')
54 function_list = hist_zres.GetListOfFunctions()
55 function_list.Add(TNamed(
'Description',
'Z resolution'))
56 function_list.Add(TNamed(
'Check',
'No bias, resolution ~ 2 cm.'))
57 function_list.Add(TNamed(
'Contact', contact))
58 function_list.Add(TNamed(
'MetaOptions',
'shifter'))
60 for event
in input_file.tree:
61 bklmhit2ds = event.BKLMHit2ds
62 eklmhit2ds = event.EKLMHit2ds
63 exthits = event.ExtHits
64 for bklmhit2d
in bklmhit2ds:
65 section = bklmhit2d.getSection()
66 sector = bklmhit2d.getSector()
67 layer = bklmhit2d.getLayer()
68 for exthit
in exthits:
69 if exthit.getDetectorID() != Belle2.Const.BKLM:
71 module = exthit.getCopyID()
72 section_ext = bklm_numbers.getSectionByModule(module)
73 sector_ext = bklm_numbers.getSectorByModule(module)
74 layer_ext = bklm_numbers.getLayerByModule(module)
75 if (section_ext != section
or sector_ext != sector
or
78 ext_position = exthit.getPosition()
79 hist_xres.Fill(ext_position.X() - bklmhit2d.getGlobalPositionX())
80 hist_yres.Fill(ext_position.Y() - bklmhit2d.getGlobalPositionY())
81 hist_zres.Fill(ext_position.Z() - bklmhit2d.getGlobalPositionZ())
82 for eklmhit2d
in eklmhit2ds:
83 section = eklmhit2d.getSection()
84 sector = eklmhit2d.getSector()
85 layer = eklmhit2d.getLayer()
86 for exthit
in exthits:
87 if exthit.getDetectorID() != Belle2.Const.EKLM:
89 strip_global = exthit.getCopyID()
90 section_ext = eklm_numbers.getSectionByGlobalStrip(strip_global)
91 sector_ext = eklm_numbers.getSectorByGlobalStrip(strip_global)
92 layer_ext = eklm_numbers.getLayerByGlobalStrip(strip_global)
93 if (section_ext != section
or sector_ext != sector
or
96 ext_position = exthit.getPosition()
97 hist_xres.Fill(ext_position.X() - eklmhit2d.getPositionX())
98 hist_yres.Fill(ext_position.Y() - eklmhit2d.getPositionY())
99 hist_zres.Fill(ext_position.Z() - eklmhit2d.getPositionZ())
static const EKLMElementNumbers & Instance()
Instantiation.