ATLAS Offline Software
Functions | Variables
print_hole_log Namespace Reference

Functions

def main (argv)
 

Variables

string __author__ = 'Ryan D. Reece <ryan.reece@cern.ch>'
 
string __date__ = '2009-04-20'
 
string __doc__
 

Function Documentation

◆ main()

def print_hole_log.main (   argv)

Definition at line 26 of file print_hole_log.py.

26 def main(argv):
27  f = ROOT.TFile('trt_eff.root', 'READ')
28  t = f.Get('trt_eff')
29 
30  o = file('trt_holes.log', 'w')
31 
32  event_number = 0
33 
34  # loop over tracks
35  nentries = t.GetEntries()
36  for i in xrange(nentries):
37  t.GetEntry(i)
38  if event_number != t.event_number:
39  # new event
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')
50  # loop over holes
51  n_holes = len(t.hole_det)
52  for i in xrange(n_holes):
53  if t.hole_det[i] == 3: # TRT
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' % {
55  'n' : i+1,
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],
63  'x' : t.hole_x[i],
64  'y' : t.hole_y[i],
65  'z' : t.hole_z[i],
66  } )
67 
68 
69 
70 #______________________________________________________________________________

Variable Documentation

◆ __author__

string print_hole_log.__author__ = 'Ryan D. Reece <ryan.reece@cern.ch>'
private

Definition at line 2 of file print_hole_log.py.

◆ __date__

string print_hole_log.__date__ = '2009-04-20'
private

Definition at line 3 of file print_hole_log.py.

◆ __doc__

string print_hole_log.__doc__
private
Initial value:
1 = """
2 NAME
3  print_hole_log.py - Creates a log file of TRT holes.
4 
5 SYNOPSIS
6  print_hole_log.py (no arguments)
7 
8 DESCRIPTION
9  Creates a log file of TRT holes from reading Ryan's
10  trt_eff.root ntuple for TRT straw efficiency studies.
11 
12 AUTHOR
13  %(author)s
14 
15 %(date)s
16 """ % {'author':__author__, 'date':__date__, 'copyright':__copyright__, 'license':__license__}

Definition at line 4 of file print_hole_log.py.

xrange
void xrange(TH1 *h, bool symmetric)
Definition: computils.cxx:515
print_hole_log.main
def main(argv)
Definition: print_hole_log.py:26
file
TFile * file
Definition: tile_monitor.h:29