Example #1
0


pxfec.send("roc 0:15").readlines()
pxfec.send("mask").readlines()



for roc in range(0, 16):
  pxfec.send("roc {0:d}".format(roc)).readlines()

  for row in range(0, 52):
    print "measure in roc ", roc, " and row ", row, "    ", (100./832*(52*roc +row)), "%"  
    for col in range(0, 80):
       pxfec.send("arm "+ str(row) + " " + str(col)).readlines() 
       for l in digfed.send("testcal 1").readlines():
         print l
         datafile.write(l)
         datafile.write('\n')

       pxfec.send("mask")


print "finished"



ccu.close()
digfed.close()
pxfec.close()
Example #2
0
sector.poh[6].fedchannels=[None,9,10,11,12]
########################################################
# fed channel to bundle to poh map is stored in:
# pohfile=open('pohfiber.txt', 'r')
 

ccu.send("sector " + str(sector.name)).readlines()
ccu.send("reset").readlines()
ccu.send("piareset all").readlines()

###############################################################################
ccu.send("power all").readlines()
ccu.send("reset").readlines()

print "setting poh bias and gain"

   

print ccu.send("group " + sector.poh[2].group).readlines()
    #ccu.send("reset").readlines()
    
    #print sector.poh[k].name +" setall 3 3 3 3 40 40 40 40"
    #print ccu.send("poh2 setall 3 3 3 3 40 40 40 40").readlines()
print ccu.send("pll read").readlines()
    #print ccu.send("poh2 read").readlines()
  
######################################################################
ccu.close()
log.printLog()
log.saveLog("log/testCCU")
Example #3
0
        c1.Update()

    c1.Print(filename)
    gCanvases.append(c1)

    if wait:
        raw_input("hit return to continue")


try:
    sectorname = sys.argv[1]
except:
    print "usage: aohrms.py <sector>"
    sys.exit(1)

s = SECTOR(sectorname, fed, 7, ccu, pxfec, caen)
print "Sector     ", sectorname
print "FED slot   ", s.fedslot

for l in fed.send("reset").readlines():
    print l

print "read rms"
for i in range(1, 37):
    for l in fed.send("rms " + str(i)).readlines():
        print " rms ", l

print "finished"

fed.close()
Example #4
0
    datafile.write("\t")
    #  sleep(0.1)
    datafile.write("{0:d}".format(x))
    #  sleep(0.1)
    datafile.write("\t")
    #  sleep(0.1)
    print "begin with testprogram for ", str(y), "and ", str(x)

    for l in digfed.send("test {0:d}".format(NrOfBursts)).readlines():
        # sleep(0.1)
        print l
        datafile.write(l)
        datafile.write('\n')

print "finished"

print "5"
'''
for l in digfed.send("test {0:d}".format(NrOfBursts)).readlines():
  print l
  datafile.write(l)
  datafile.write('\n')


print "finished"

ccu.close()
digfed.close()
pxfec.close()
'''
Example #5
0
    log.error("ring/mfec not found "+tag)
    sys.exit(1)
    
if status=="no CCU found":
    log.error("no CCU found "+tag)
    print "verify ccu power"
    while True:
        yesno=raw_input("continue anyway (y/n) ")
        if yesno=='n': sys.exit(1)
        if yesno=='y': break

else:
    log.ok("CCUs found")
    
       

# start tests
print "test tracker DOHs"
dohA=tDOH(ccu, "0x7b", "0x10",log)
dohA.VerifyProgramming()
dohB=tDOH(ccu, "0x7c", "0x10",log)
dohB.VerifyProgramming()
print "start redundancy test"
TestRedundancy(ccu,log=log) 


ccu.close()

log.printLog()
log.saveLog("log/testCCU")
Example #6
0
from SimpleSocket import SimpleSocket
import sys, readline
""" console client for SimpleSocket servers or SimpleServer applications"""

if not len(sys.argv) == 3:
    print "usage: python client.py <host> <port>"
    sys.exit(1)

host, port = sys.argv[1], int(sys.argv[2])

try:
    readline.read_history_file(".history")
except:
    pass

mySocket = SimpleSocket(host, port)

while mySocket.isOpen():
    cmd = raw_input("%s " % (mySocket.prompt))
    mySocket.send(cmd)
    for l in mySocket.readline():
        print l

mySocket.close()
readline.write_history_file(".history")
Example #7
0
    c2.Update()
    c2.Print()
    c2.Write()

    c3=TCanvas()
    c3.cd()
    c3.Divide(int(len(histo2)/2),2)
    for i in histo3:
        c3.cd(k+1)
        i.Draw("TEXT")
        i.Write()
        k=k+1
    c3.Update()
    c3.Print()
    c3.Write()
    digfed.close()
########################################################
if tbmplldelayonetest==True:
   
    print "header trailer one value"
    print "STOP TRIGGER"
    print "poh in position " + str(sublist) + " fiber bundle in the digital fed"
    rep = raw_input(' when ready hit return: ')
    ccu.send("reset").readlines()
    ccu.send("piareset all").readlines()
    digfed.send("reset").readlines()
    digfed.send("regreset").readlines()
    digfed.send("PLLreset").readlines()
    digfed.send("PLLresetPiggy").readlines()
    digfed.send("setupTTC").readlines()
    digfed.send("initFitelN").readlines()
Example #8
0
try:
   sectorname=sys.argv[1]
except:
   print "usage: aohrms.py <sector>"
   sys.exit(1)
   


s=SECTOR(sectorname,fed,8,ccu,pxfec,caen)
ccu.send("cratereset").readlines()
#rmsvstime(s,4,1)
for l in ccu.send("scanccu").readlines():
   print l


filename=getFilename("testdata/myaoh%s.ps"%(s.name))
rootfile=TFile(os.path.splitext(filename)[0]+".root","CREATE")
##TCanvas('c1', '', 200, 10, 800, 800).Print(filename+"[")
TCanvas('c1').Print(filename+"[")
for aoh in range(1,1):
   showRMSAOH(s,aoh,wait=False,filename=filename)
TCanvas('c1').Print(filename+"]")
#for h in hList: h.Write()
#rootfile.Write()
rootfile.Close()
#showRMSAOH(s,4)

fed.close()
ccu.close()

Example #9
0
ccu.send("channel 0x13").readlines()
ccu.send("delay25 init").readlines()
ccu.send("pll reset").readlines()
ccu.send("pll init").readlines()
ccu.send("doh init").readlines()
ccu.send("poh1 init").readlines()
ccu.send("poh2 init").readlines()
ccu.send("poh3 init").readlines()
ccu.send("poh4 init").readlines()
ccu.send("poh5 init").readlines()
ccu.send("poh6 init").readlines()
ccu.send("poh7 init").readlines()
#ccu.send("doh setall 3 3 3 40 40 40").readlines()
ccu.send("poh1 setall 3 3 3 3 40 40 40 40").readlines()
ccu.send("poh2 setall 3 3 3 3 40 40 40 40").readlines()
ccu.send("poh3 setall 3 3 3 3 40 40 40 40").readlines()
ccu.send("poh4 setall 3 3 3 3 40 40 40 40").readlines()
ccu.send("poh5 setall 3 3 3 3 40 40 40 40").readlines()
ccu.send("poh6 setall 3 3 3 3 40 40 40 40").readlines()
ccu.send("poh7 setall 3 3 3 3 40 40 40 40").readlines()
# ccu.send("poh1 setall 3 3 3 3 20 20 20 20").readlines()
# ccu.send("poh2 setall 3 3 3 3 20 20 20 20").readlines()
# ccu.send("poh3 setall 3 3 3 3 20 20 20 20").readlines()
# ccu.send("poh4 setall 3 3 3 3 20 20 20 20").readlines()
# ccu.send("poh5 setall 3 3 3 3 20 20 20 20").readlines()
# ccu.send("poh6 setall 3 3 3 3 20 20 20 20").readlines()
# ccu.send("poh7 setall 3 3 3 3 20 20 20 20").readlines()

ccu.close()
pxfec.close()
Example #10
0
from SimpleSocket import SimpleSocket
import sys,readline
""" console client for SimpleSocket servers or SimpleServer applications"""

if not len(sys.argv)==3:
    print "usage: python client.py <host> <port>"
    sys.exit(1)
    
host,port=sys.argv[1],int(sys.argv[2])


try:
    readline.read_history_file(".history")
except:
    pass

mySocket=SimpleSocket( host, port)


while mySocket.isOpen():
    cmd=raw_input("%s " %(mySocket.prompt))
    mySocket.send(cmd)
    for l in mySocket.readline():
        print l
    
mySocket.close()
readline.write_history_file(".history")
Example #11
0
            h = TH2D('hd', "", 2, 0, tmax, 2, 0, 1024)
            h.Draw()


try:
    sectorname = sys.argv[1]
except:
    print "usage: aohrms.py <sector>"
    sys.exit(1)

s = SECTOR(sectorname, fed, 8, ccu, pxfec, caen)
ccu.send("cratereset").readlines()
#rmsvstime(s,4,1)
for l in ccu.send("scanccu").readlines():
    print l

filename = getFilename("testdata/myaoh%s.ps" % (s.name))
rootfile = TFile(os.path.splitext(filename)[0] + ".root", "CREATE")
##TCanvas('c1', '', 200, 10, 800, 800).Print(filename+"[")
TCanvas('c1').Print(filename + "[")
for aoh in range(1, 1):
    showRMSAOH(s, aoh, wait=False, filename=filename)
TCanvas('c1').Print(filename + "]")
#for h in hList: h.Write()
#rootfile.Write()
rootfile.Close()
#showRMSAOH(s,4)

fed.close()
ccu.close()
Example #12
0
  c1.Print(filename)
  gCanvases.append(c1)
        
  if wait:
      raw_input("hit return to continue")


try:
   sectorname=sys.argv[1]
except:
   print "usage: aohrms.py <sector>"
   sys.exit(1)
   

s=SECTOR(sectorname,fed,7,ccu,pxfec,caen)
print "Sector     ",sectorname
print "FED slot   ",s.fedslot

for l in fed.send("reset").readlines():
   print l

print "read rms"
for i in range(1,37):
   for l in fed.send("rms "+str(i)).readlines():
      print " rms ",l


print "finished"

fed.close()