예제 #1
0
파일: bb_fix.py 프로젝트: w6225656/DSS
                            "_bbgraph.dot")
else:
    ftemp = helper.fileOpen(buildDir + "/" + top + "_bbgraph.dot")

bufBB = []
for line in ftemp:
    bufBB.append(line)
ftemp.close()

check = True
for line in buf:
    if "bbID= 1," in line:
        check = False

if check:
    helper.warning("Warning: bb offset found for benchmark " + top +
                   ". Fixing...")
    bbMin = 0
    bbMax = 0
    for line in buf:
        if "bbID= " in line:
            bb = helper.strFindNumber(line, "bbID= ")
            bb = int(bb)
            if bbMax < bb and bbMax == 0: bbMin = bb
            if bbMax < bb: bbMax = bb
    print("BB = 0+" + str(bbMin) + " - " + str(bbMax))
    bb = bbMin
    i = 1
    while (bb <= bbMax):
        bufBB = [w.replace("block" + str(bb), "block" + str(i)) for w in bufBB]
        buf = [w.replace("bbID= " + str(bb), "bbID= " + str(i)) for w in buf]
        i = i + 1
예제 #2
0
for px in sys.argv:
    if px == '-gtk':
        g = True

# Define the package manager
E = "apt"

helper.title("Debian")
helper.author("Mirko Brombin")
helper.website("https://linuxhub.it")

supported_versions = ["9.1.0"]

# Check for release
distro = helper.get_distro()
helper.warning("The script for Debian has not been tested yet.")
helper.warning("Production usage is not recommended at this time.")
if distro.release in supported_versions:

    class PostInstall:
        global E
        # Define menu voices
        voices_en_US = [
            ("Install updates ", "install_updates"),
            ("Install add-apt-repository", "enable_ppa"),
            ("Install GDebi (deb installer) ", "install_gdebi"),
            ("Install Qapt (deb installer) ", "install_qapt"),
            ("Install GNOME (DE)", "install_gnome"),
            ("Install GNOME (DE)", "install_gnome"),
            ("Install KDE (DE)", "install_kde"),
            ("Install XFCE (DE)", "install_xfce"),
예제 #3
0
 def __init__(self, tagger='DeepCSV', wp='medium', sigmabc='central', sigmalight='central', channel='ttbar', year=2016):
     """Load b tag weights from CSV file."""
     
     assert(year in [2016,2017,2018]), "You must choose a year from: 2016, 2017, or 2018."
     assert(tagger in ['CSVv2','DeepCSV']), "BTagWeightTool: You must choose a tagger from: CSVv2, DeepCSV!"
     assert(wp in ['loose','medium','tight']), "BTagWeightTool: You must choose a WP from: loose, medium, tight!"
     assert(sigmabc in ['central','up_correlated','down_correlated','up_uncorrelated','down_uncorrelated']), "BTagWeightTool: You must choose a WP for b/c jets from: central, up_correlated, down_correlated, up_uncorrelated, down_uncorrelated!"
     assert(sigmalight in ['central','up_correlated','down_correlated','up_uncorrelated','down_uncorrelated']), "BTagWeightTool: You must choose a WP for light jets from: central, up_correlated, down_correlated, up_uncorrelated, down_uncorrelated!"
     #assert(channel in ['mutau','eletau','tautau','mumu']), "BTagWeightTool: You must choose a channel from: mutau, eletau, tautau, mumu!"
     
     # FILE
     if year==2016:
       if 'deep' in tagger.lower():
         csvnamebc = path+'DeepCSV_2016LegacySF_V1_YearCorrelation-V1.csv'
         csvnamelight = path+'DeepCSV_2016LegacySF_WP_V1.csv'
         effname = path+'DeepCSV_2016_Moriond17_eff.root'
       else:
         csvnamebc = path+'CSVv2_Moriond17_B_H.csv'
         csvnamelight = path+'CSVv2_Moriond17_B_H.csv'
         effname = path+'CSVv2_2016_Moriond17_eff.root'
     elif year==2017:
       if 'deep' in tagger.lower():
         csvnamebc = path+'DeepCSV_94XSF_V4_B_F_YearCorrelation-V1.csv'
         csvnamelight = path+'DeepCSV_94XSF_WP_V4_B_F.csv'
         effname = path+'DeepCSV_2017_Fall17_eff.root'
       else:
         csvnamebc = path+'CSVv2_Moriond17_B_H.csv'
         csvnamelight = path+'CSVv2_Moriond17_B_H.csv'
         effname = path+'CSVv2_2017_Fall17_eff.root'
     elif year==2018:
       if 'deep' in tagger.lower():
         csvnamebc = path+'DeepCSV_102XSF_V1_YearCorrelation-V1.csv'
         csvnamelight = path+'DeepCSV_102XSF_WP_V1.csv'
         effname = path+'DeepCSV_2018_Autumn18_eff.root'
       else:
         csvnamebc = path+'CSVv2_94XSF_V2_B_F.csv'
         csvnamelight = path+'CSVv2_94XSF_V2_B_F.csv'
         effname = path+'CSVv2_2018_Autumn18_eff.root'
     
     # TAGGING WP
     self.wpname = wp
     self.wp     = getattr(BTagWPs(tagger,year),wp)
     if 'deep' in tagger.lower():
       tagged = lambda j: j.btagDeepB>self.wp
     else:
       tagged = lambda j: j.btagCSVV2>self.wp
     
     # CSV READER
     print "Loading BTagWeightTool for %s (%s WP)..."%(tagger,wp)
     op        = OP_LOOSE if wp=='loose' else OP_MEDIUM if wp=='medium' else OP_TIGHT if wp=='tight' else OP_RESHAPING
     type_udsg = 'incl'
     type_bc   = 'mujets' # 'mujets' for QCD; 'comb' for QCD+TT
     #Load reader for b/c jets
     calibbc     = BTagCalibration(tagger, csvnamebc)
     readerbc    = BTagCalibrationReader(op, sigmabc)
     readerbc.load(calibbc, FLAV_B, type_bc)
     readerbc.load(calibbc, FLAV_C, type_bc)
     #Load reader for light jets
     caliblight  = BTagCalibration(tagger, csvnamelight)
     readerlight = BTagCalibrationReader(op, sigmalight)
     readerlight.load(caliblight, FLAV_UDSG, type_udsg)
     
     # EFFICIENCIES
     effmaps    = { } # b tag efficiencies in MC to compute b tagging weight for an event
     efffile    = ensureTFile(effname)
     default    = False
     if not efffile:
       warning("File %s with efficiency histograms does not exist! Reverting to default efficiency histogram..."%(effname),title="BTagWeightTool")
       default  = True
     for flavor in [0,4,5]:
       flavor   = flavorToString(flavor)
       histname = "%s_%s_%s"%(tagger,flavor,wp)
       effname  = "%s/eff_%s_%s_%s"%(channel,tagger,flavor,wp)
       if efffile:
         effmaps[flavor]    = efffile.Get(effname)
         if not effmaps[flavor]:
           warning("histogram '%s' does not exist in %s! Reverting to default efficiency histogram..."%(effname,efffile.GetName()),title="BTagWeightTool")
           default          = True
           effmaps[flavor]  = createDefaultEfficiencyMap(effname,flavor,wp)
       else:
         effmaps[flavor]    = createDefaultEfficiencyMap(effname,flavor,wp)
       effmaps[flavor].SetDirectory(0)
     efffile.Close()
     
     if default:
       warning("Made use of default efficiency histograms! The b tag weights from this module should be regarded as placeholders only,\n"+\
               "and should NOT be used for analyses. B (mis)tag efficiencies in MC are analysis dependent. Please create your own\n"+\
               "efficiency histogram with corrections/btag/getBTagEfficiencies.py after running all MC samples with BTagWeightTool.",title="BTagWeightTool")
     
     self.tagged  = tagged
     self.calibbc   = calibbc
     self.readerbc  = readerbc
     self.caliblight = caliblight
     self.readerlight = readerlight
     self.effmaps = effmaps
예제 #4
0
g = False

for px in sys.argv:
    if px == '-gtk':
        g = True

# Define the package manager
E = "pacman"

helper.title("Arch Linux")
helper.author("Mirko Brombin")
helper.website("https://linuxhub.it")

# Check for release
distro = helper.get_distro()
helper.warning("This script may not be stable.")


class PostInstall:
    global E
    # Define menu voices
    voices_en_US = [
        ("Install updates", "install_updates"),
    ]
    voices_it_IT = [
        ("Installa aggiornamenti", "install_updates"),
    ]

    # Define functions for each menu voice
    def install_updates(self, g=False):
        helper.pkg_update(E)
예제 #5
0
syn = open(top + "/syn.tcl", "w")
cosim = open(top + "/cosim.tcl", "w")

buff = ""
tb = ""
buff = buff + "open_project -reset proj\nset_top " + top + "\nadd_files {"
for h in hL:
    buff = buff + os.path.relpath(h, top) + " "
for f in fL:
    if top + "_tb" not in f:
        buff = buff + os.path.relpath(f, top) + " "
    else:
        tb = os.path.relpath(f, top)
if tb == "":
    helper.warning("No test bench found for " + top)
    buff = buff + "}\n"
else:
    buff = buff + "}\nadd_files -tb {" + tb + "}\n"
buff = buff + "open_solution -reset \"soluion1\"\nset_part {xc7z020clg484-1}\ncreate_clock -period 10 -name default\n"

syn.write(buff)
syn.write("csynth_design\nexit\n")

cosim.write(buff)
cosim.write("csim_design\ncsynth_design\ncosim_design -O -rtl vhdl\nexit\n")

syn.close()
cosim.close()
print("tcl files generated successfully.")
예제 #6
0
                            "/solution1/syn/report/" + function +
                            "_csynth.rpt")
    while True:
        line = ftemp.readline()
        if "Pipeline" in line:
            break
    line = ftemp.readline()
    line = ftemp.readline()
    line = ftemp.readline()
    ftemp.close()
    line = line.split("|")
    fL.latency.append(int(line[2].replace(" ", "")))
    fL.compName.append("Unknown")
    if int(line[3].replace(" ", "")) != int(fL.ii[fL.name.index(function)]):
        helper.warning("Warning: function " + function +
                       " does not achieve the expected II of " +
                       fL.ii[fL.name.index(function)] + ". The final II is " +
                       line[3].replace(" ", "") + "!")
        fL.ii[fL.name.index(function)] = int(line[3].replace(" ", ""))
if len(fL.latency) != len(fL.ii):
    helper.error("Error: latency extraction failed.")
    assert 0
print("Timing information of SS components extracted.")

# added the time constraint of the static component into the dot graph of the dynamic circuit
dotGraph = []
ftemp = helper.fileOpen(buildDir + "/ds_" + top.name + "/" + top.name + ".dot")
for line in ftemp:
    dotGraph.append(line)
ftemp.close()
funcConnect = []
ftemp = helper.fileOpen(buildDir + "/ds_" + top.name + "/" + top.name +
예제 #7
0
for px in sys.argv:
    if px == '-gtk':
        g = True

# Define the package manager
E = "yum"

helper.title("Centos")
helper.author("Mirko Brombin")
helper.website("https://linuxhub.it")

supported_versions = ["7 (Core)"]

# Check for release
distro = helper.get_distro()
helper.warning("TThis script is intended for use in server environments.")
if distro.release in supported_versions:

    class PostInstall:
        global E
        # Define menu voices
        voices_en_US = [
            ("Install updates", "install_updates"),
            ("Install EPEL repo", "install_epel"),
            ("Install postfix", "install_postfix"),
            ("Install dovecot", "install_dovecot"),
            ("Install nginx", "install_nginx"),
            ("Install apache2", "install_apache"),
            ("Install php-fpm", "install_php_fpm"),
        ]
        voices_it_IT = [