Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:27

0001 #!/bin/env python
0002 from __future__ import print_function
0003 from builtins import range
0004 import ROOT
0005 from ROOT import *
0006 import sys
0007 if len(sys.argv) < 2 :
0008   print("Usage: dump_parameteriza.py filename")
0009   exit()
0010 fileToRead= TFile(sys.argv[1], "read")
0011 
0012 fileToRead.cd()
0013 
0014 
0015 
0016 SchemasMeaningFile = open("SchemasMeaning.txt", "w")
0017 SchemasMeaningFile.write("------------------------LEGEND-------------------------  \n")
0018 SchemasMeaningFile.write("METHOD:  \n")
0019 SchemasMeaningFile.write("\t0 \t float16  \n")
0020 SchemasMeaningFile.write("\t1 \t reduceMantissa  \n")
0021 SchemasMeaningFile.write("\t2 \t logPack  \n")
0022 SchemasMeaningFile.write("\t3 \t tanLogPack  \n")
0023 SchemasMeaningFile.write("\t4 \t zero  \n")
0024 SchemasMeaningFile.write("\t5 \t one  \n")
0025     
0026     
0027 SchemasMeaningFile.write("TARGET:  \n")
0028 SchemasMeaningFile.write("\t0 \t realValue  \n")
0029 SchemasMeaningFile.write("\t1 \t ratioToRef  \n")
0030 SchemasMeaningFile.write("\t2 \t differenceToRef  \n\n")
0031 
0032 
0033 
0034 next = TIter ((fileToRead.Get("schemas")).GetListOfKeys())
0035 
0036 
0037 key = next()
0038 while key != None  :
0039 
0040     cl = gROOT.GetClass(key.GetClassName())  
0041     schemaNumber = key.ReadObj().GetName();
0042     schemaN = int(schemaNumber);
0043 
0044     SchemasMeaningFile.write("SCHEMA " + schemaNumber + "\n")
0045     SchemasMeaningFile.write("ELEMENT \t METHOD \tTARGET  \tBIT USED \t  Lmin \t\t  Lmax" + "\n")
0046     
0047 
0048     for i in range(0,5) :
0049         for j in range(i,5) :
0050             folder = "schemas/"+schemaNumber+"/"+str(i)+str(j)
0051 
0052 
0053 
0054             method = str(fileToRead.Get(folder+"/method").GetVal())
0055             target = str(fileToRead.Get(folder+"/target").GetVal())
0056             bit    = str(fileToRead.Get(folder+"/bit").GetVal())
0057             param0 = str(fileToRead.Get(folder+"/param")[0])
0058             param1 = str(fileToRead.Get(folder+"/param")[1])
0059             
0060             
0061             SchemasMeaningFile.write(str(i)+str(j) + "\t\t " + method + "\t\t  " + target + "\t\t  " + bit + "\t\t   " + param0 + "  \t  " + param1 + "\n")
0062 
0063 
0064         
0065     key = next()
0066 
0067 
0068 fileToRead.Close()
0069 SchemasMeaningFile.close()
0070 
0071 
0072 
0073 
0074