name = "bhm" elif len(sys.argv) == 2: name = sys.argv[1] else: name = "bhm" ts = teststand(name) #ts.set_ped_all(6) #set_ped(crate_port, 3, 31) links = uhtr.get_links(ts,12) #for link in links : # link.Print() d = time_string() print "pedestalTest_{0}.root".format(d) uhtr.get_histo(ts,12,1000,0,"pedestalTest_{0}.root".format(d)) inputFile = TFile("pedestalTest_{0}.root".format(d),"READ") gStyle.SetFillColor(0) can = TCanvas("can","can",500,500) can1=TCanvas('can1','can1',1200,400) can1.Divide(3,1) means=TH1F('mean','mean',20,0,10) rmss=TH1F('rms','rms',18,0,6) print "plotting histograms..." for link in links : if not link.on : continue if link.n is -1: print "---------------------------" print 'BAD LINK' continue
parser=OptionParser() parser.add_option('-t','--teststand',dest='name',default='904',help="The name of the teststand you want to use (default is \"904\").") parser.add_option('-q','--qieid',dest='qieid',default='0x8D000000 0xAA24DA70',help="The ID of the QIE card from which we read the pedestal.") parser.add_option('-o','--output',dest='out',default='data/ts_904/plots',help="The directory in which the output file will be saved.") (options, args) = parser.parse_args() ts = teststand(options.name) slotlink=ts.uhtr_from_qie(qie_id=options.qieid) slot=slotlink.keys()[0] links=slotlink[slot] print 'slot:',slot d = time_string() fdnm=options.out+'/'+d.split('_')[0] if not os.path.exists(fdnm): os.makedirs(fdnm) print "pedestalTest_{0}.root".format(d) uhtr.get_histo(ts,slot,1000,0,fdnm+"/pedestalTest_{0}.root".format(d)) inputFile = TFile(fdnm+"/pedestalTest_{0}.root".format(d),"READ") gStyle.SetFillColor(0) can = TCanvas("can","can",500,500) can1=TCanvas('can1','can1',1200,400) can1.Divide(3,1) means=TH1F('mean','mean',20,0,10) rmss=TH1F('rms','rms',18,0,6) print "plotting histograms..." for link in links : # if link.n is -1: # print "---------------------------" # print 'BAD LINK' # continue print "---------------------------" print 'link:',link