6 <contact>software-tracking@belle2.org</contact>
7 <input>CosmicsExtrapolation.root</input>
8 <output>CosmicsExtrapolationPlots.root</output>
9 <description>Validation of cosmic track extrapolation.</description>
13 contact =
'Kirill Chilikin (chilikin@lebedev.ru)'
16 from ROOT
import Belle2, TNamed
18 input_file = ROOT.TFile(
'../CosmicsExtrapolation.root')
19 output_file = ROOT.TFile(
'CosmicsExtrapolationPlots.root',
'recreate')
25 hist_xres = ROOT.TH1F(
'xres',
'Extrapolated hit X resolution', 100, -20, 20)
26 hist_xres.SetXTitle(
'cm')
27 hist_xres.SetYTitle(
'Events')
28 l = hist_xres.GetListOfFunctions()
29 l.Add(TNamed(
'Description',
'X resolution'))
30 l.Add(TNamed(
'Check',
'No bias, resolution ~ 2 cm.'))
31 l.Add(TNamed(
'Contact', contact))
32 l.Add(TNamed(
'MetaOptions',
'shifter'))
34 hist_yres = ROOT.TH1F(
'yres',
'Extrapolated hit Y resolution', 100, -20, 20)
35 hist_yres.SetXTitle(
'cm')
36 hist_yres.SetYTitle(
'Events')
37 l = hist_yres.GetListOfFunctions()
38 l.Add(TNamed(
'Description',
'Y resolution'))
39 l.Add(TNamed(
'Check',
'No bias, resolution ~ 2 cm.'))
40 l.Add(TNamed(
'Contact', contact))
41 l.Add(TNamed(
'MetaOptions',
'shifter'))
43 hist_zres = ROOT.TH1F(
'zres',
'Extrapolated hit Z resolution', 100, -20, 20)
44 hist_zres.SetXTitle(
'cm')
45 hist_zres.SetYTitle(
'Events')
46 l = hist_zres.GetListOfFunctions()
47 l.Add(TNamed(
'Description',
'Z resolution'))
48 l.Add(TNamed(
'Check',
'No bias, resolution ~ 2 cm.'))
49 l.Add(TNamed(
'Contact', contact))
50 l.Add(TNamed(
'MetaOptions',
'shifter'))
52 for event
in input_file.tree:
53 bklmhit2ds = event.BKLMHit2ds
54 eklmhit2ds = event.EKLMHit2ds
55 exthits = event.ExtHits
56 for bklmhit2d
in bklmhit2ds:
57 section = bklmhit2d.getSection()
58 sector = bklmhit2d.getSector()
59 layer = bklmhit2d.getLayer()
60 for exthit
in exthits:
61 if exthit.getDetectorID() != Belle2.Const.BKLM:
63 module = exthit.getCopyID()
64 section_ext = bklm_numbers.getSectionByModule(module)
65 sector_ext = bklm_numbers.getSectorByModule(module)
66 layer_ext = bklm_numbers.getLayerByModule(module)
67 if (section_ext != section
or sector_ext != sector
or
70 ext_position = exthit.getPosition()
71 hist_xres.Fill(ext_position.X() - bklmhit2d.getGlobalPositionX())
72 hist_yres.Fill(ext_position.Y() - bklmhit2d.getGlobalPositionY())
73 hist_zres.Fill(ext_position.Z() - bklmhit2d.getGlobalPositionZ())
74 for eklmhit2d
in eklmhit2ds:
75 section = eklmhit2d.getSection()
76 sector = eklmhit2d.getSector()
77 layer = eklmhit2d.getLayer()
78 for exthit
in exthits:
79 if exthit.getDetectorID() != Belle2.Const.EKLM:
81 strip_global = exthit.getCopyID()
82 section_ext = eklm_numbers.getSectionByGlobalStrip(strip_global)
83 sector_ext = eklm_numbers.getSectorByGlobalStrip(strip_global)
84 layer_ext = eklm_numbers.getLayerByGlobalStrip(strip_global)
85 if (section_ext != section
or sector_ext != sector
or
88 ext_position = exthit.getPosition()
89 hist_xres.Fill(ext_position.X() - eklmhit2d.getPositionX())
90 hist_yres.Fill(ext_position.Y() - eklmhit2d.getPositionY())
91 hist_zres.Fill(ext_position.Z() - eklmhit2d.getPositionZ())