CMS 3D CMS Logo

Functions | Variables

NewTree Namespace Reference

Functions

def runme
def runme2

Variables

list fid = sys.argv[1]
list infile = sys.argv[2]
list outfile = fid+Parameters.parameters['view']

Function Documentation

def NewTree::runme (   fid,
  infile,
  outfile 
)

Definition at line 24 of file NewTree.py.

00025                              :
00026     fin = open(infile,'r')
00027     fout = open(outfile,'w')
00028     tot_up = Parameters.parameters['view']['levels_up']
00029     tot_down = Parameters.parameters['view']['levels_down']
00030     print "up=",tot_up," down=",tot_down
00031     # trigger too difficult for now
00032     trigger = Parameters.parameters['find']['immediate_children_threshold']
00033     
00034     for line in fin.xreadlines():
00035         a=line.split()
00036         b=a[2:]
00037         # find fid in a
00038         try:
00039             i=operator.indexOf(b,fid)
00040             # write out stuff according to tot_up and tot_down
00041             if i < tot_up: c = i
00042             else: c = tot_up
00043             print >>fout,"%s %s %s"%(a[0],a[1],string.join(b[i-c:i+1+tot_down]))
00044         except ValueError:
00045             pass

def NewTree::runme2 (   fid,
  infile,
  outfile 
)

Definition at line 12 of file NewTree.py.

00013                               :
00014     fin = open(infile,'r')
00015     fout = open(outfile,'w')
00016     sub = ' ' + fid + '[ $]'
00017     r = re.compile(sub)
00018     
00019     for line in fin.xreadlines():
00020         i = line.index(' ')+1
00021         s = r.search(line[i:])
00022         if s != None:
00023             print >>fout,line[0:i+s.end()-1]


Variable Documentation

list NewTree::fid = sys.argv[1]
list NewTree::infile = sys.argv[2]

Definition at line 52 of file NewTree.py.

Definition at line 53 of file NewTree.py.