CMS 3D CMS Logo

TreeToEdges Namespace Reference


Classes

class  Int

Functions

def runme

Variables

tuple cutoff = int(sys.argv[3])
list infile = sys.argv[1]
list outfile = sys.argv[2]


Function Documentation

def TreeToEdges::runme (   infile,
  outfile,
  cutoff 
)

Definition at line 18 of file TreeToEdges.py.

00018                                 :
00019     fin = open(infile,'r')
00020     fout = open(outfile,'w')
00021     tree = {}
00022     count = 0
00023     
00024     for line in fin.xreadlines():
00025 
00026         a = line.split()
00027         id = int(a.pop(0))
00028         tot = int(a.pop(0))
00029         if tot < cutoff: break
00030         head = int(a.pop(0))
00031         
00032         for node in a:
00033             val = int(node)
00034             key = (head,val)
00035                 
00036             n = tree.get(key)
00037             if n == None:
00038                 tree[key] = Int(tot)
00039             else:
00040                 n.inc(tot)
00041             head = val
00042             
00043         count += 1
00044 
00045     for node in tree.items():
00046         # print node
00047         print >>fout, node[1], ' ', node[0][0], ' ', node[0][1]
00048             
if __name__ == "__main__":


Variable Documentation

tuple TreeToEdges::cutoff = int(sys.argv[3]) [static]

Definition at line 56 of file TreeToEdges.py.

Referenced by TkGluedMeasurementDet::checkHitProjection(), stor::StorageManager::configureAction(), and stor::SMProxyServer::configuring().

list TreeToEdges::infile = sys.argv[1] [static]

Definition at line 54 of file TreeToEdges.py.

Referenced by TrackerMap::build(), VisCuTkBuilder::buildMap(), HcalLutManager::getLutSetFromFile(), SiStripBadStripFromASCIIFile::getNewObject(), SiStripGainFromAsciiFile::getNewObject(), HcalQIEManager::getQIETableFromFile(), HcalTBObjectUnpacker::parseCalib(), EcalTrigPrimESProducer::parseTextFile(), and HCalSD::readWeightFromFile().

list TreeToEdges::outfile = sys.argv[2] [static]

Definition at line 55 of file TreeToEdges.py.


Generated on Tue Jun 9 18:53:04 2009 for CMSSW by  doxygen 1.5.4