27 f = ROOT.TFile(
'trt_eff.root',
'READ')
30 o =
file(
'trt_holes.log',
'w')
35 nentries = t.GetEntries()
38 if event_number != t.event_number:
40 event_number = t.event_number
41 o.write(
'======================================================================================\n')
42 o.write(
' Run: %10s, LB: %10s, Event: %10s\n' % (t.run_number, t.lumi_block, t.event_number) )
43 o.write(
'======================================================================================\n')
44 o.write(
'--------------------------------------------------------------------------------------\n')
45 o.write(
' Track pT: %4g, eta: %3f, phi: %3f, d0: %4g, z0: %4g\n' % (t.track_pt, t.track_eta, t.track_phi, t.track_d0, t.track_z0) )
46 o.write(
' # pix hits: %3i, # SCT hits: %3i, # TRT hits: %3i\n' % (t.n_pixel_hits, t.n_sct_hits, t.n_trt_hits) )
47 o.write(
' # pix holes: %3i, # SCT holes: %3i, # TRT holes: %3i\n' % (t.n_pixel_holes, t.n_sct_holes, t.n_trt_holes) )
48 o.write(
'------ TRT holes -------------------------------\n')
49 o.write(
' # bec phi layer strawlayer straw locR locR_error x y z\n')
51 n_holes = len(t.hole_det)
53 if t.hole_det[i] == 3:
54 o.write(
'%(n)3i %(bec)3i %(phi)3i %(layer)3i %(strawlayer)3i %(straw)3i %(locR)8.4g %(locR_error)11.2g %(x)8.4g %(y)8.4g %(z)8.4g\n' % {
56 'bec' : t.hole_bec[i],
57 'phi' : t.hole_phi[i],
58 'layer' : t.hole_layer[i],
59 'strawlayer' : t.hole_strawlayer[i],
60 'straw' : t.hole_straw[i],
61 'locR' : t.hole_locR[i],
62 'locR_error' : t.hole_locR_error[i],