Exemple #1
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)
        # TH2D
        ChipNo = self.ParentObject.Attributes['ChipNo']
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict

        if self.isDigitalROC:
            ModuleTypes = ['Digital', 'Analog']
        else:
            ModuleTypes = ['Analog', 'Digital']

        try:
            histname = self.HistoDict.get(self.NameSingle, ModuleTypes[0])
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle,
                                                                          histname, rocNo=ChipNo).Clone(
                self.GetUniqueID())
        except:
            histname = self.HistoDict.get(self.NameSingle, ModuleTypes[1])
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle,
                                                                          histname, rocNo=ChipNo).Clone(
                self.GetUniqueID())


        threshold = self.CheckBumpBondingProblems()

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            if not self.isDigitalROC:
                self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(
                    self.TestResultEnvironmentObject.GradingParameters['minThrDiff'],
                    self.TestResultEnvironmentObject.GradingParameters['maxThrDiff'])
            else:
                # self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(0,255)
                #minZ = self.ParentObject.ResultData['SubTestResults']['BumpBonding'].ResultData['Plot'][
                #    'ROOTObject'].FindFirstBinAbove(.9)
                #minZ = self.ParentObject.ResultData['SubTestResults']['BumpBonding'].ResultData['Plot'][
                #    'ROOTObject'].GetXaxis().GetBinLowEdge(minZ)
                #self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(minZ, threshold)
                self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(-5, 5)
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()

            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetTitle("#Delta Threshold [#sigma]")
            self.ResultData['Plot']['ROOTObject'].GetZaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw("colz")

        self.ResultData['Plot']['ROOTObject2'] = self.ResultData['Plot']['ROOTObject'].Clone(self.GetUniqueID())
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()

        self.Title = 'Bump Bonding Problems: C{ChipNo}'.format(ChipNo=self.chipNo)
        self.ResultData['KeyValueDictPairs']['DeadBumps']['Value'] = self.DeadBumpList
        self.ResultData['KeyValueDictPairs']['NDeadBumps']['Value'] = len(self.DeadBumpList)
        self.ResultData['KeyList'].append('NDeadBumps')
Exemple #2
0
    def PopulateResultData(self):
        ChipNo = self.ParentObject.Attributes['ChipNo']

        rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']['HREfficiency_{Rate}'.format(Rate=self.Attributes['Rate'])]
        try:
            histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get('HighRate', 'EfficiencyMap').format(ChipNo=self.ParentObject.Attributes['ChipNo'])
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(rootFileHandle, histogramName).Clone(self.GetUniqueID())
        except: 
            histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get('HighRate2', 'EfficiencyMap').format(ChipNo=self.ParentObject.Attributes['ChipNo'])
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(rootFileHandle, histogramName).Clone(self.GetUniqueID())
        self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(rootFileHandle, histogramName).Clone(self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            ROOT.gStyle.SetOptStat(0)
            self.Canvas.Clear()
            self.ResultData['Plot']['ROOTObject'].SetTitle("");
            #self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRangeUser(-50., 50.);
            #self.ResultData['Plot']['ROOTObject'].GetYaxis().SetRangeUser(0.5, 5.0 * self.ResultData['Plot'][
            #    'ROOTObject'].GetMaximum())
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column");
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5);
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].Draw('colz');
            

        self.Title = 'Efficiency Map {Rate}: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'],Rate=self.Attributes['Rate'])
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()        
Exemple #3
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        # self.ResultData['Plot']['ROOTObject'] =  ROOT.TH2D(self.GetUniqueID(), "", self.nCols, 0., self.nCols, self.nRows, 0., self.nRows ) # htm
        # TH2D

        ChipNo = self.ParentObject.Attributes['ChipNo']
        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        if HistoDict.has_option(self.NameSingle, 'TrimBits'):
            histname = HistoDict.get(self.NameSingle, 'TrimBits')
            root_object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo=ChipNo)
            self.ResultData['Plot']['ROOTObject'] = root_object.Clone(self.GetUniqueID())
        else:
            histname = HistoDict.get(self.NameSingle, 'TrimBitMap')
            root_object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo=ChipNo)
            self.ResultData['Plot']['ROOTObject'] = ROOT.TH1F(self.GetUniqueID(), 'TrimBitDistribution', 17, -.5, 16.5)
            for col in range(self.nCols):  # Columns
                for row in range(self.nRows):  # Rows
                    entry = root_object.GetBinContent(col + 1, row + 1)
                    self.ResultData['Plot']['ROOTObject'].Fill(entry)
        mean = 0
        rms = 0

        if self.ResultData['Plot']['ROOTObject']:
            # for i in range(self.nCols): # Columns
            #    for j in range(self.nRows): # Rows
            #        self.ResultData['Plot']['ROOTObject'].SetBinContent(i+1, j+1, self.ResultData['Plot']['ROOTObject_TrimMap'].GetBinContent(i+1, j+1))

            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].SetFillStyle(3002)
            self.ResultData['Plot']['ROOTObject'].SetLineColor(ROOT.kBlack)
            #self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(0., self.nTotalChips);
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Trim bits")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRangeUser(0, 15)

            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("entries")
            #            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.");
            #            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('')
            mean = self.ResultData['Plot']['ROOTObject'].GetMean()
            rms = self.ResultData['Plot']['ROOTObject'].GetRMS()
        self.ResultData['KeyValueDictPairs'] = {
            'mu': {
                'Value': '{0:1.2f}'.format(mean),
                'Label': 'μ'
            },
            'sigma': {
                'Value': '{0:1.2f}'.format(rms),
                'Label': 'σ'
            }
        }
        self.ResultData['KeyList'] = ['mu', 'sigma']

        if self.SavePlotFile:
            self.Canvas.SaveAs(self.GetPlotFileName())
        self.ResultData['Plot']['Enabled'] = 1
        self.Title = 'Trim Bits'
        self.ResultData['Plot']['ImageFile'] = self.GetPlotFileName()
Exemple #4
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(1)

        self.ResultData['Plot']['ROOTObject'] =ROOT.TH1D(self.GetUniqueID(), "", 100, 0., 600.) # hw
        self.ResultData['Plot']['ROOTObject_hd'] =ROOT.TH1D(self.GetUniqueID(), "", 100, 0., 600.) #Noise in unbonded pixel (not displayed) # hd
        self.ResultData['Plot']['ROOTObject_ht'] = ROOT.TH2D(self.GetUniqueID(), "", self.nCols, 0., self.nCols, self.nRows, 0., self.nRows) # ht
        isDigitalROC = False

        ChipNo = self.ParentObject.Attributes['ChipNo']
        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        self.ResultData['Plot']['ROOTObject_h2'] = None
        if HistoDict.has_option(self.NameSingle,'Analog'):
            histname = HistoDict.get(self.NameSingle,'Analog')
            object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
            if object != None:
                self.ResultData['Plot']['ROOTObject_h2'] = object.Clone(self.GetUniqueID())

        if not self.ResultData['Plot']['ROOTObject_h2']:
            isDigitalROC = True
            histname = HistoDict.get(self.NameSingle,'Digital')
            object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
            if object != None:
                self.ResultData['Plot']['ROOTObject_h2'] = object.Clone(self.GetUniqueID())
        if not self.ResultData['Plot']['ROOTObject_h2']:
            self.ResultData['HiddenData']['NoDatFile'] = True
            print 'Cannot find Histogram ',HistoDict.get(self.NameSingle,'Digital'),HistoDict.has_option(self.NameSingle,'Analog')
            print[x.GetName() for x in self.ParentObject.ParentObject.FileHandle.GetListOfKeys()]
            print 'NameSingle: ', self.NameSingle
Exemple #5
0
    def PopulateResultData(self):
        ChipNo = self.ParentObject.Attributes['ChipNo']

        histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get('HighRate', 'CalDelScan').format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        histogramName2 = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get('HighRate2', 'CalDelScan').format(ChipNo=self.ParentObject.Attributes['ChipNo'])

        self.Canvas.Clear()
        
        if 'CalDelScan' in self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']:
            rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']['CalDelScan']
            try:
                self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(rootFileHandle, histogramName).Clone(self.GetUniqueID())
            except:
                self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(rootFileHandle, histogramName2).Clone(self.GetUniqueID())

            if self.ResultData['Plot']['ROOTObject']:
                ROOT.gStyle.SetOptStat(0)
                self.ResultData['Plot']['ROOTObject'].SetTitle("")
                
                self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("CalDel")
                self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Efficiency")
                self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
                self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].Draw()

        self.Title = 'CalDel scan: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        self.SaveCanvas()        
Exemple #6
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)

        ROOT.gPad.SetLogy(1);
        mean = -9999
        rms = -9999
        nBumpBondingProblems = 0;
        nSigma = self.TestResultEnvironmentObject.GradingParameters['BumpBondingProblemsNSigma']
        # TH1D
        ChipNo = self.ParentObject.Attributes['ChipNo']
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        try:
            histname = self.ParentObject.ParentObject.ParentObject.HistoDict.get(self.NameSingle, 'Analog')
            object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo=ChipNo)
            self.ResultData['Plot']['ROOTObject'] = object.Clone(self.GetUniqueID())
        except:
            histname = self.ParentObject.ParentObject.ParentObject.HistoDict.get(self.NameSingle, 'Digital')
            object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo=ChipNo)
            self.ResultData['Plot']['ROOTObject'] = object.Clone(self.GetUniqueID())
        if self.ResultData['Plot']['ROOTObject']:
            self.Canvas.Clear()
            self.ResultData['Plot']['ROOTObject'].SetTitle("");
            if not self.Attributes['isDigitalROC']:
                self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRangeUser(-50., 50.);
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetRangeUser(0.5, 5.0 * self.ResultData['Plot'][
                'ROOTObject'].GetMaximum())
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Threshold difference");
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("No. of Entries");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5);
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].Draw();
            mean = self.ResultData['Plot']['ROOTObject'].GetMean()
            rms = self.ResultData['Plot']['ROOTObject'].GetRMS()
            startbin = self.ResultData['Plot']['ROOTObject'].FindBin(nSigma)
            for bin in range(startbin, self.ResultData['Plot']['ROOTObject'].GetNbinsX() + 1):
                nBumpBondingProblems += self.ResultData['Plot']['ROOTObject'].GetBinContent(bin)
            self.Cut = ROOT.TCutG('bumpBondingThreshold', 2)
            self.Cut.SetPoint(0, nSigma, -1e9)
            self.Cut.SetPoint(1, nSigma, +1e9)
            self.Cut.SetLineWidth(2)
            self.Cut.SetLineStyle(2)
            self.Cut.SetLineColor(ROOT.kRed)
            self.Cut.Draw('PL')

        self.Title = 'Bump Bonding: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        self.SaveCanvas()
        self.ResultData['KeyValueDictPairs']['Mean']['Value'] = round(mean, 2)
        self.ResultData['KeyList'].append('Mean')
        self.ResultData['KeyValueDictPairs']['RMS']['Value'] = round(rms, 2)
        self.ResultData['KeyList'].append('RMS')
        self.ResultData['KeyValueDictPairs']['Threshold']['Value'] = round(nSigma, 2)
        self.ResultData['KeyList'].append('Threshold')

        if self.Attributes['isDigitalROC']:
            self.ResultData['KeyValueDictPairs']['nSigma']['Value'] = nSigma
            self.ResultData['KeyValueDictPairs']['nBumpBondingProblems']['Value'] = round(nBumpBondingProblems, 0)
            self.ResultData['KeyList'].append('nSigma')
            self.ResultData['KeyList'].append('nBumpBondingProblems')
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)
        # TH2D
        ChipNo = self.ParentObject.Attributes['ChipNo']
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict

        if self.isDigitalROC:
            ModuleTypes = ['Digital', 'Analog']
        else:
            ModuleTypes = ['Analog', 'Digital']

        try:
            histname = self.HistoDict.get(self.NameSingle, ModuleTypes[0])
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle,
                                                                          histname, rocNo=ChipNo).Clone(
                self.GetUniqueID())
        except:
            histname = self.HistoDict.get(self.NameSingle, ModuleTypes[1])
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle,
                                                                          histname, rocNo=ChipNo).Clone(
                self.GetUniqueID())


        threshold = self.CheckBumpBondingProblems()

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            if not self.isDigitalROC:
                self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(
                    self.TestResultEnvironmentObject.GradingParameters['minThrDiff'],
                    self.TestResultEnvironmentObject.GradingParameters['maxThrDiff'])
            else:
                # self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(0,255)
                minZ = self.ParentObject.ResultData['SubTestResults']['BumpBonding'].ResultData['Plot'][
                    'ROOTObject'].FindFirstBinAbove(.9)
                minZ = self.ParentObject.ResultData['SubTestResults']['BumpBonding'].ResultData['Plot'][
                    'ROOTObject'].GetXaxis().GetBinLowEdge(minZ)
                self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(minZ, threshold)
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()

            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetTitle("#Delta Threshold [DAC]")
            self.ResultData['Plot']['ROOTObject'].GetZaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw("colz")

        self.ResultData['Plot']['ROOTObject2'] = self.ResultData['Plot']['ROOTObject'].Clone(self.GetUniqueID())
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()

        self.Title = 'Bump Bonding Problems: C{ChipNo}'.format(ChipNo=self.chipNo)
        self.ResultData['KeyValueDictPairs']['DeadBumps']['Value'] = self.DeadBumpList
        self.ResultData['KeyValueDictPairs']['NDeadBumps']['Value'] = len(self.DeadBumpList)
        self.ResultData['KeyList'].append('NDeadBumps')
Exemple #8
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0);

        ROOT.gPad.SetLogy(1);

        # TH1D
        ChipNo=self.ParentObject.Attributes['ChipNo']
        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        histname = HistoDict.get(self.NameSingle,'TrimBit0')
        self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo).Clone(self.GetUniqueID())

        # TH1D
        histname = HistoDict.get(self.NameSingle,'TrimBit1')
        self.ResultData['Plot']['ROOTObject_TrimBit13'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo).Clone(self.GetUniqueID())
        # TH1D
        histname = HistoDict.get(self.NameSingle,'TrimBit2')
        self.ResultData['Plot']['ROOTObject_TrimBit11'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo).Clone(self.GetUniqueID())

        # TH1D
        histname = HistoDict.get(self.NameSingle,'TrimBit3')
        self.ResultData['Plot']['ROOTObject_TrimBit7'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo).Clone(self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("");
            self.ResultData['Plot']['ROOTObject'].SetAxisRange(0., 60.);
            self.ResultData['Plot']['ROOTObject'].SetMinimum(0.5);
            self.ResultData['Plot']['ROOTObject'].SetLineColor(ROOT.kBlack);
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Threshold difference");
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("No. of Entries");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5);
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle();

            self.ResultData['Plot']['ROOTObject'].Draw();

            self.ResultData['Plot']['ROOTObject_TrimBit13'].SetLineColor(ROOT.kRed);
            self.ResultData['Plot']['ROOTObject_TrimBit13'].Draw('same');


            self.ResultData['Plot']['ROOTObject_TrimBit11'].SetLineColor(ROOT.kBlue);
            self.ResultData['Plot']['ROOTObject_TrimBit11'].Draw('same');


            self.ResultData['Plot']['ROOTObject_TrimBit7'].SetLineColor(ROOT.kGreen);
            self.ResultData['Plot']['ROOTObject_TrimBit7'].Draw('same');

            Legend = ROOT.TLegend(0.5, 0.67, 0.84, 0.89, '', 'brNDC')
            Legend.AddEntry(self.ResultData['Plot']['ROOTObject'], 'Trim Value 14', 'l')
            Legend.AddEntry(self.ResultData['Plot']['ROOTObject_TrimBit13'], 'Trim Value 13', 'l')
            Legend.AddEntry(self.ResultData['Plot']['ROOTObject_TrimBit11'], 'Trim Value 11', 'l')
            Legend.AddEntry(self.ResultData['Plot']['ROOTObject_TrimBit7'], 'Trim Value 7', 'l')
            Legend.Draw()


        if self.SavePlotFile:
            self.Canvas.SaveAs(self.GetPlotFileName())
        self.ResultData['Plot']['Enabled'] = 1
        self.Title = 'Trim Bit Test'
        self.ResultData['Plot']['ImageFile'] = self.GetPlotFileName()
Exemple #9
0
    def PopulateResultData(self):
        try:
            if self.ParentObject.ParentObject.ParentObject.nTrigPixelAlive:
                if self.ParentObject.ParentObject.ParentObject.nTrigPixelAlive != self.PixelMapMaxValue:
                    print "PixelAliveMap: ntrig = %d from testParameters.dat is used instead of value from gradingParameters.cfg"%self.ParentObject.ParentObject.ParentObject.nTrigPixelAlive
                self.PixelMapMaxValue = self.ParentObject.ParentObject.ParentObject.nTrigPixelAlive
        except:
            pass

        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)
        # TH2D
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        ChipNo=self.ParentObject.Attributes['ChipNo']
        if self.HistoDict.has_option(self.NameSingle,'PixelMap'):
            histname = self.HistoDict.get(self.NameSingle,'PixelMap')
            object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
            self.ResultData['Plot']['ROOTObject']  = object.Clone(self.GetUniqueID())
        elif self.HistoDict.has_option(self.NameSingle,'Calibrate') and self.HistoDict.has_option(self.NameSingle,'Mask'):
            # TO BE CHECKED
            histname_Calibrate = self.HistoDict.get(self.NameSingle,'Calibrate')
            self.ResultData['Plot']['ROOTObject_Calibrate'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname_Calibrate, rocNo = ChipNo).Clone(self.GetUniqueID())
            histname_Mask = self.HistoDict.get(self.NameSingle,'Mask')
            self.ResultData['Plot']['ROOTObject_Mask'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname_Mask, rocNo = ChipNo).Clone(self.GetUniqueID())
            if not self.ResultData['Plot']['ROOTObject_Mask'] or not self.ResultData['Plot']['ROOTObject_Calibrate']:
                raise Exception('Cannot create PixelMap because of not found histos Mask: %s, Calibrate: %s'%(
                                 self.ResultData['Plot']['ROOTObject_Mask'],
                                 self.ResultData['Plot']['ROOTObject_Calibrate'],
                                 ))
            self.ResultData['Plot']['ROOTObject'] = self.ResultData['Plot']['ROOTObject_Calibrate'].Clone(self.GetUniqueID())
            nXbins = self.ResultData['Plot']['ROOTObject'].GetNbinsX()
            nYbins = self.ResultData['Plot']['ROOTObject'].GetNbinsY()

            for xbin in range(1,nXbins+1):
                for ybin in range(1,nYbins+1):
                    binContent = self.ResultData['Plot']['ROOTObject_Mask'].GetBinContent(xbin,ybin)

                    if (self.ParentObject.ParentObject.ParentObject.testSoftware == 'pxar' and binContent < -0.5) or (self.ParentObject.ParentObject.ParentObject.testSoftware != 'pxar' and binContent != 0):
                        if self.verbose: print 'MaskProblem with %d/%d'%(xbin,ybin)
                        self.ResultData['Plot']['ROOTObject'].SetBinContent(xbin,ybin,-1)

        self.CheckPixelAlive()
        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.");
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5);
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetTitle("No. of Readouts");
            self.ResultData['Plot']['ROOTObject'].GetZaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].Draw('colz');

        self.Title = 'Pixel Map: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()        
Exemple #10
0
    def PopulateResultData(self):
        try:
            if self.ParentObject.ParentObject.ParentObject.nTrigPixelAlive:
                if self.ParentObject.ParentObject.ParentObject.nTrigPixelAlive != self.PixelMapMaxValue:
                    print "PixelAliveMap: ntrig = %d from testParameters.dat is used instead of value from gradingParameters.cfg"%self.ParentObject.ParentObject.ParentObject.nTrigPixelAlive
                self.PixelMapMaxValue = self.ParentObject.ParentObject.ParentObject.nTrigPixelAlive
        except:
            pass

        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)
        # TH2D
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        ChipNo=self.ParentObject.Attributes['ChipNo']
        if self.HistoDict.has_option(self.NameSingle,'PixelMap'):
            histname = self.HistoDict.get(self.NameSingle,'PixelMap')
            object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
            self.ResultData['Plot']['ROOTObject']  = object.Clone(self.GetUniqueID())
        elif self.HistoDict.has_option(self.NameSingle,'Calibrate') and self.HistoDict.has_option(self.NameSingle,'Mask'):
            # TO BE CHECKED
            histname_Calibrate = self.HistoDict.get(self.NameSingle,'Calibrate')
            self.ResultData['Plot']['ROOTObject_Calibrate'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname_Calibrate, rocNo = ChipNo).Clone(self.GetUniqueID())
            histname_Mask = self.HistoDict.get(self.NameSingle,'Mask')
            self.ResultData['Plot']['ROOTObject_Mask'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname_Mask, rocNo = ChipNo).Clone(self.GetUniqueID())
            if not self.ResultData['Plot']['ROOTObject_Mask'] or not self.ResultData['Plot']['ROOTObject_Calibrate']:
                raise Exception('Cannot create PixelMap because of not found histos Mask: %s, Calibrate: %s'%(
                                 self.ResultData['Plot']['ROOTObject_Mask'],
                                 self.ResultData['Plot']['ROOTObject_Calibrate'],
                                 ))
            self.ResultData['Plot']['ROOTObject'] = self.ResultData['Plot']['ROOTObject_Calibrate'].Clone(self.GetUniqueID())
            nXbins = self.ResultData['Plot']['ROOTObject'].GetNbinsX()
            nYbins = self.ResultData['Plot']['ROOTObject'].GetNbinsY()

            for xbin in range(1,nXbins+1):
                for ybin in range(1,nYbins+1):
                    binContent = self.ResultData['Plot']['ROOTObject_Mask'].GetBinContent(xbin,ybin)

                    if (self.ParentObject.ParentObject.ParentObject.testSoftware == 'pxar' and binContent < -0.5) or (self.ParentObject.ParentObject.ParentObject.testSoftware != 'pxar' and binContent != 0):
                        if self.verbose: print 'MaskProblem with %d/%d'%(xbin,ybin)
                        self.ResultData['Plot']['ROOTObject'].SetBinContent(xbin,ybin,-1)

        self.CheckPixelAlive()
        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.");
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5);
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetTitle("No. of Readouts");
            self.ResultData['Plot']['ROOTObject'].GetZaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].Draw('colz');

        self.Title = 'Pixel Map: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()        
Exemple #11
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)

        ChipNo = self.ParentObject.Attributes['ChipNo']
        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict

        # load trimbit distribution from .root file or create from trim bit map
        if HistoDict.has_option(self.NameSingle, 'TrimBits'):
            histname = HistoDict.get(self.NameSingle, 'TrimBits')
            root_object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo=ChipNo)
        else:
            histname = HistoDict.get(self.NameSingle, 'TrimBitMap')
            root_object2 = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo=ChipNo)
            root_object = ROOT.TH1F(self.GetUniqueID(), 'TrimBitDistribution', 17, -.5, 16.5)
            for col in range(self.nCols):  # Columns
                for row in range(self.nRows):  # Rows
                    entry = root_object2.GetBinContent(col + 1, row + 1)
                    root_object.Fill(entry)

        self.ResultData['Plot']['ROOTObject'] = ROOT.TH1F(self.GetUniqueID(), 'TrimBitDistribution', 17, -.5, 16.5)
        for bin in range(0, root_object.GetNbinsX() + 1):
            bin_content = root_object.GetBinContent(bin)
            bin_center = int(root_object.GetXaxis().GetBinCenter(bin))
            self.ResultData['Plot']['ROOTObject'].Fill(bin_center, bin_content)
        mean = 0
        rms = 0

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].SetFillStyle(3002)
            self.ResultData['Plot']['ROOTObject'].SetLineColor(ROOT.kBlack)
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Trim bits")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRangeUser(0, 15)

            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("entries")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('hist')

            mean = self.ResultData['Plot']['ROOTObject'].GetMean()
            rms = self.ResultData['Plot']['ROOTObject'].GetRMS()

        self.ResultData['KeyValueDictPairs'] = {
            'mu': {
                'Value': '{0:1.2f}'.format(mean),
                'Label': 'μ'
            },
            'sigma': {
                'Value': '{0:1.2f}'.format(rms),
                'Label': 'RMS'
            }
        }
        self.ResultData['KeyList'] = ['mu', 'sigma']

        self.Title = 'Trim Bits'
        self.SaveCanvas()
Exemple #12
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)

        ChipNo = self.ParentObject.Attributes['ChipNo']
        ROOTFile = self.ParentObject.ParentObject.FileHandle

        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        HistoNameAdcVsDac = HistoDict.get(self.NameSingle, 'AdcVsDac')
        HistoNameCurrentVsDac = HistoDict.get(self.NameSingle, 'CurrentVsDac')

        try:
            HistogramAdcVsDac = HistoGetter.get_histo(ROOTFile, HistoNameAdcVsDac, rocNo=ChipNo).Clone(self.GetUniqueID())
            HistogramCurrentVsDac = HistoGetter.get_histo(ROOTFile, HistoNameCurrentVsDac, rocNo=ChipNo).Clone(self.GetUniqueID())
        except:
            HistogramAdcVsDac = None
            HistogramCurrentVsDac = None

        if HistogramAdcVsDac and HistogramCurrentVsDac:
            NBinsX = HistogramAdcVsDac.GetXaxis().GetNbins()
            NBinsX2 = HistogramCurrentVsDac.GetXaxis().GetNbins()
            #print "nbins:", NBinsX," ",NBinsX2
            #print "ADC vs DAC: ",
            #for i in range(NBinsX):
            #    print HistogramAdcVsDac.GetBinContent(i +1),"  ",
            #print ""
            #print "current vs DAC: ",
            #for i in range(NBinsX2):
            #    print HistogramCurrentVsDac.GetBinContent(i +1),"  ",
            #print ""
            pointListADC = []
            pointListCurrent = []

            if NBinsX==NBinsX2:
                for i in range(NBinsX):
                    if HistogramAdcVsDac.GetBinContent(i+1)!=0 or HistogramCurrentVsDac.GetBinContent(i+1)!=0:
                        pointListCurrent.append(HistogramCurrentVsDac.GetBinContent(i+1))
                        pointListADC.append(HistogramAdcVsDac.GetBinContent(i+1))


            pointsADC = array.array('d', pointListADC)
            pointsCurrent = array.array('d', pointListCurrent)
            numPoints = len(pointsADC)

            self.ResultData['Plot']['ROOTObject'] = ROOT.TGraph(numPoints, pointsADC, pointsCurrent)


            if self.ResultData['Plot']['ROOTObject']:
                self.ResultData['Plot']['ROOTObject'].Draw('AP*')

            self.Title = 'Iana [ADC]/Iana [mA]'
            if self.Canvas:
                self.Canvas.SetCanvasSize(500, 500)

        self.SaveCanvas()

        #TODO: Axis label, punkte blau, fit pol 1. ordnung, Graph wegmachen, etc.
Exemple #13
0
    def PopulateResultData(self):
            ROOT.gStyle.SetOptStat(0);
            ROOT.gPad.SetLogy(0);
        # TH2D
            ChipNo = self.ParentObject.Attributes['ChipNo']
            self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
            print 'HistoDict BarePixelMap: ', self.HistoDict

            if self.ParentObject.ParentObject.ParentObject.testSoftware=='pxar':

                #blablabla = bla(self)
                #self.ResultData['Plot']['ROOTObject']=bla.ResultData['Plot']['ROOTObject'];

                histname = self.HistoDict.get(self.NameSingle,'Calibrate')
                if self.HistoDict.has_option(self.NameSingle,'Calibrate'):
                    histname = self.HistoDict.get(self.NameSingle,'Calibrate')            
                    object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
                    self.ResultData['Plot']['ROOTObject']  = object.Clone(self.GetUniqueID())
                    
            else:
                histname = self.HistoDict.get(self.NameSingle,'BarePixelMap') 
                if self.HistoDict.has_option(self.NameSingle,'BarePixelMap'):
                    histname = self.HistoDict.get(self.NameSingle,'BarePixelMap')
                    object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
                    if not object:
                        print 'no Histogram for ChipNo',ChipNo
                    else:
                        self.ResultData['Plot']['ROOTObject']  = object.Clone(self.GetUniqueID())
                        # loop over the histogram and find list of dead pixels
                        nXbins = self.ResultData['Plot']['ROOTObject'].GetNbinsX()
                        nYbins = self.ResultData['Plot']['ROOTObject'].GetNbinsY()
                        for xbin in range(1,nXbins+1):
                            for ybin in range(1,nYbins+1):
                                binContent = self.ResultData['Plot']['ROOTObject'].GetBinContent(xbin,ybin)
                                if binContent ==0:
                                    self.DeadPixelList.add((ChipNo,xbin-1,ybin-1))


            if not object:   
                print 'Inside BarePixelMap ChipNo: ', ChipNo
            else:
                

                if self.ResultData['Plot']['ROOTObject']:
                    self.ResultData['Plot']['ROOTObject'].SetTitle("")
                    self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
                    self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
                    self.ResultData['Plot']['ROOTObject'].Draw('colz')
                    self.ResultData['KeyValueDictPairs']['DeadPixels'] = {'Value':self.DeadPixelList, 'Label':'Dead Pixels'}
                    self.ResultData['KeyValueDictPairs']['NDeadPixels'] = { 'Value':len(self.DeadPixelList), 'Label':'N Dead Pixels'}

                    self.Title = 'BarePixelMap: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
                    self.SaveCanvas()
Exemple #14
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)
        # TH2D
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        ChipNo=self.ParentObject.Attributes['ChipNo']
        if self.HistoDict.has_option(self.NameSingle,'PixelMap'):
            histname = self.HistoDict.get(self.NameSingle,'PixelMap')
            object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
            self.ResultData['Plot']['ROOTObject']  = object.Clone(self.GetUniqueID())
        elif self.HistoDict.has_option(self.NameSingle,'Calibrate') and self.HistoDict.has_option(self.NameSingle,'Mask'):
            # TO BE CHECKED
            histname_Calibrate = self.HistoDict.get(self.NameSingle,'Calibrate')
            self.ResultData['Plot']['ROOTObject_Calibrate'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname_Calibrate, rocNo = ChipNo).Clone(self.GetUniqueID())
            histname_Mask = self.HistoDict.get(self.NameSingle,'Mask')
            self.ResultData['Plot']['ROOTObject_Mask'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname_Mask, rocNo = ChipNo).Clone(self.GetUniqueID())
            if not self.ResultData['Plot']['ROOTObject_Mask'] or not self.ResultData['Plot']['ROOTObject_Calibrate']:
                raise Exception('Cannot create PixelMap because of not found histos Mask: %s, Calibrate: %s'%(
                                 self.ResultData['Plot']['ROOTObject_Mask'],
                                 self.ResultData['Plot']['ROOTObject_Calibrate'],
                                 ))
            self.ResultData['Plot']['ROOTObject'] = self.ResultData['Plot']['ROOTObject_Calibrate'].Clone(self.GetUniqueID())
            nXbins = self.ResultData['Plot']['ROOTObject'].GetNbinsX()
            nYbins = self.ResultData['Plot']['ROOTObject'].GetNbinsY()
            if self.ParentObject.ParentObject.ParentObject.testSoftware=='pxar':
                comperateTo =1
            else:
                comperateTo=0

            for xbin in range(1,nXbins+1):
                for ybin in range(1,nYbins+1):
                    binContent = self.ResultData['Plot']['ROOTObject_Mask'].GetBinContent(xbin,ybin)

                    if binContent != comperateTo:
                        if self.verbose: print 'MaskProblem with %d/%d'%(xbin,ybin)
                        self.ResultData['Plot']['ROOTObject'].SetBinContent(xbin,ybin,-1)

        self.CheckPixelAlive()
        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.");
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5);
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetTitle("No. of Readouts");
            self.ResultData['Plot']['ROOTObject'].GetZaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].Draw('colz');

        if self.SavePlotFile:
            self.Canvas.SaveAs(self.GetPlotFileName())
        self.ResultData['Plot']['Enabled'] = 1
        self.Title = 'Pixel Map: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        self.ResultData['Plot']['ImageFile'] = self.GetPlotFileName()
Exemple #15
0
    def PopulateResultData(self):
        ChipNo = self.ParentObject.Attributes['ChipNo']

        rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']['HRData_{Rate}'.format(Rate=self.Attributes['Rate'])]
        histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get('HighRate', 'HitMap').format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(rootFileHandle, histogramName).Clone(self.GetUniqueID())

        NumberOfDefectivePixels = 0
        NumberOfHits = 0
        if self.ResultData['Plot']['ROOTObject']:
            for Row in range(self.nRows):
                for Column in range(self.nCols):
                    PixelHits = self.ResultData['Plot']['ROOTObject'].GetBinContent(Column+1, Row+1)
                    if PixelHits > 0:
                        NumberOfHits += PixelHits
                    else:
                        NumberOfDefectivePixels += 1
                        self.ResultData['HiddenData']['ListOfDefectivePixels'].append((ChipNo, Column, Row))

            self.ResultData['KeyValueDictPairs']['NHits']['Value'] = '{NHits:1.0f}'.format(NHits=NumberOfHits)

            NTriggersROOTObject = (
            HistoGetter.get_histo(
                    self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']['HRData_{Rate}'.format(Rate=self.Attributes['Rate'])],
                    "Xray.ntrig_Ag_V0" 
                )
            )
            TimeConstant = float(self.TestResultEnvironmentObject.XRayHRQualificationConfiguration['TimeConstant'])
            Area = float(self.TestResultEnvironmentObject.XRayHRQualificationConfiguration['Area'])
            NTriggers = float(NTriggersROOTObject.GetBinContent(1))
            NHits = float(self.ResultData['KeyValueDictPairs']['NHits']['Value'])
            RealHitrate = NHits / (NTriggers*TimeConstant*Area)*1e-6

            ROOT.gStyle.SetOptStat(0)
            self.Canvas.Clear()
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')

        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
        self.ResultData['KeyValueDictPairs']['NumberOfDefectivePixels']['Value'] = '{NumberOfDefectivePixels:1.0f}'.format(NumberOfDefectivePixels=NumberOfDefectivePixels)
        self.ResultData['KeyValueDictPairs']['RealHitrate']['Value'] = '{RealHitrate:1.2f}'.format(RealHitrate=RealHitrate)
        self.ResultData['KeyValueDictPairs']['RealHitrate']['NumericValue'] = RealHitrate

        self.Title = 'Hit Map {Rate}: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'],Rate=self.Attributes['Rate'])
Exemple #16
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)
        # TH2D
        ChipNo=self.ParentObject.Attributes['ChipNo']
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict


        try:
            histname = self.HistoDict.get(self.NameSingle,'Analog')
            self.ResultData['Plot']['ROOTObject'] =  HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle,histname,rocNo=ChipNo).Clone(self.GetUniqueID())
        except:
            histname = self.HistoDict.get(self.NameSingle,'Digital')
            self.ResultData['Plot']['ROOTObject'] =  HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle,histname,rocNo=ChipNo).Clone(self.GetUniqueID())
#             if not isDigitalROC:
#                 print "ERROR Cannot find vcals_xtal_CXXX but is analog Module..."
#             elif isDigitalROC:
#                 print "ERROR: FOound vcals_xtal_CXXX but is digital Module..."

        threshold = self.CheckBumpBondingProblems()

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("");
            if not self.isDigitalROC:
                self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(self.TestResultEnvironmentObject.GradingParameters['minThrDiff'], self.TestResultEnvironmentObject.GradingParameters['maxThrDiff']);
            else:
                #self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(0,255)
                minZ = self.ParentObject.ResultData['SubTestResults']['BumpBonding'].ResultData['Plot']['ROOTObject'].FindFirstBinAbove(.9)
                minZ = self.ParentObject.ResultData['SubTestResults']['BumpBonding'].ResultData['Plot']['ROOTObject'].GetXaxis().GetBinLowEdge(minZ)
                self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(minZ,threshold)
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.");
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5);
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle();

            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetTitle("#Delta Threshold [DAC]");
            self.ResultData['Plot']['ROOTObject'].GetZaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].Draw("colz");
            self.ResultData['Plot']['ROOTObject'].SaveAs(self.GetPlotFileName()+'.cpp')

        self.ResultData['Plot']['ROOTObject2'] = self.ResultData['Plot']['ROOTObject'].Clone(self.GetUniqueID())
        if self.SavePlotFile:
            self.Canvas.SaveAs(self.GetPlotFileName())

        self.ResultData['Plot']['Enabled'] = 1
        self.Title = 'Bump Bonding Problems: C{ChipNo}'.format(ChipNo=self.chipNo)
        self.ResultData['Plot']['ImageFile'] = self.GetPlotFileName()
        self.ResultData['KeyValueDictPairs']['DeadBumps'] = { 'Value':self.DeadBumpList, 'Label':'Dead Bumps'}
        self.ResultData['KeyValueDictPairs']['NDeadBumps'] = { 'Value':len(self.DeadBumpList), 'Label':'N Dead Bumps'}
        self.ResultData['KeyList'].append('NDeadBumps')
Exemple #17
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0);
        ROOT.gPad.SetLogy(1);

        # TH2D
        ChipNo = self.ParentObject.Attributes['ChipNo']
#        print 'display options1: ',self.ParentObject.ParentObject.HistoDict
#        print 'display options2: ',self.ParentObject.HistoDict
#        print 'display options3: ',self.HistoDict
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        print 'HistoDict BareBBWidth: ', self.HistoDict
        histname = self.HistoDict.get(self.NameSingle,'BareBBWidth')
#        histname = self.ParentObject.ParentObject.ParentObject.HistoDict.get(self.NameSingle,'BareBBWidth')        
#        histname = self.ParentObject.ParentObject.ParentObject.HistoDict.get(self.NameSingle,'BBtestMap')

        print 'Inside BareBBWidth ChipNo: ', ChipNo
        print 'and the histname: ', histname

        if self.HistoDict.has_option(self.NameSingle,'BareBBWidth'):
            histname = self.HistoDict.get(self.NameSingle,'BareBBWidth')            
            object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
            self.ResultData['Plot']['ROOTObject']  = object.Clone(self.GetUniqueID())
        
            

        #self.ResultData['Plot']['ROOTObject'] =  HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle,histname,rocNo=ChipNo).Clone(self.GetUniqueID())


        print 'Inside BareBBWidth ChipNo: ', ChipNo
        print 'and the histname: ', histname


        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw()
            #            for column in range(self.nCols): #Column
            #                for row in range(self.nRows): #Row
            #                    self.HasAddressDecodingProblem(column, row)

        
            self.Cut = ROOT.TCutG('bumpWidthCut',2)
            self.Cut.SetPoint(0,33,-1e9)
            self.Cut.SetPoint(1,33,+1e9)
            self.Cut.SetLineWidth(2)
            self.Cut.SetLineStyle(2)
            self.Cut.SetLineColor(ROOT.kRed)
            self.Cut.Draw('PL')



            if self.SavePlotFile:
                self.Canvas.SaveAs(self.GetPlotFileName())
                self.ResultData['Plot']['Enabled'] = 1
                self.Title = 'Bare BBWidth: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
                self.ResultData['Plot']['ImageFile'] = self.GetPlotFileName()
Exemple #18
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        try:
            histname = self.ParentObject.HistoDict.get(self.NameSingle,
                                                       'AnalogCurrent')
            self.ResultData['Plot']['ROOTHisto'] = HistoGetter.get_histo(
                self.ParentObject.FileHandle, histname)
        except Exception as e:
            print e
            raise e
        self.ParentObject.ResultData['SubTestResults'][
            'DigitalCurrent'].SpecialPopulateResultData(
                self, {'name': 'Analog Current'})

        try:
            if os.path.isfile(self.ParentObject.logfilePath):
                with open(self.ParentObject.logfilePath, 'r') as logfile:
                    for line in logfile:
                        if 'setVana() done' in line and 'Module Ia' in line:
                            ModuleIa = line.split(
                                "Module Ia")[1].strip().split(" ")[0]
                            self.ResultData['KeyValueDictPairs'][
                                'ModuleIa'] = {
                                    'Label': 'Module Ia',
                                    'Value': ModuleIa,
                                    'Unit': 'mA'
                                }
                            self.ResultData['KeyList'].append('ModuleIa')
                            print "Module Ia: ", ModuleIa, " => per ROC: ", float(
                                ModuleIa) / 16.0, " mA"
                            break
        except:
            pass
Exemple #19
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        try:
            histname = self.ParentObject.HistoDict.get(self.NameSingle, 'AnalogCurrent')
            self.ResultData['Plot']['ROOTHisto'] = HistoGetter.get_histo(self.ParentObject.FileHandle, histname)
        except Exception as e:
            print e
            raise e
        self.ParentObject.ResultData['SubTestResults']['DigitalCurrent'].SpecialPopulateResultData(self,{'name':'Analog Current'})

        try:
            if os.path.isfile(self.ParentObject.logfilePath):
                with open(self.ParentObject.logfilePath, 'r') as logfile:
                    for line in logfile:
                        if 'setVana() done' in line and 'Module Ia' in line:
                            ModuleIa = line.split("Module Ia")[1].strip().split(" ")[0]
                            self.ResultData['KeyValueDictPairs']['ModuleIa'] = {
                                'Label': 'Module Ia',
                                'Value': ModuleIa,
                                'Unit': 'mA'
                            }
                            self.ResultData['KeyList'].append('ModuleIa')
                            print "Module Ia: ", ModuleIa, " => per ROC: ",float(ModuleIa)/16.0, " mA"
                            break
        except:
            pass
Exemple #20
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)

        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        HistoName = HistoDict.get('OnShellQuickTest', 'BumpBonding')
        ChipNo = self.ParentObject.Attributes['ChipNo']
        ROOTFile = self.ParentObject.ParentObject.FileHandle

        try:
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(
                ROOTFile, HistoName, rocNo=ChipNo).Clone(self.GetUniqueID())
        except:
            self.ResultData['Plot']['ROOTObject'] = None

        ChipNo = self.ParentObject.Attributes['ChipNo']
        if self.ResultData['Plot']['ROOTObject']:
            for column in range(self.nCols):
                for row in range(self.nRows):
                    defectIndicator = self.ResultData['Plot'][
                        'ROOTObject'].GetBinContent(column + 1, row + 1)
                    if defectIndicator > 0:
                        self.BumpbondingDefectsList.add((ChipNo, column, row))

            self.ResultData['KeyValueDictPairs']['BumpBondingDefects'][
                'Value'] = self.BumpbondingDefectsList
            self.ResultData['KeyValueDictPairs']['NBumpBondingDefects'][
                'Value'] = len(self.BumpbondingDefectsList)

            self.ResultData['Plot']['ROOTObject'].Draw("colz")

        self.Title = 'BumpBonding'
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'svg'
        self.SaveCanvas()
Exemple #21
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)

        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        HistoName = HistoDict.get('OnShellQuickTest', 'BumpBonding')
        ChipNo = self.ParentObject.Attributes['ChipNo']
        ROOTFile = self.ParentObject.ParentObject.FileHandle

        try:
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(ROOTFile, HistoName, rocNo=ChipNo).Clone(self.GetUniqueID())
        except:
            self.ResultData['Plot']['ROOTObject'] = None

        ChipNo = self.ParentObject.Attributes['ChipNo']
        if self.ResultData['Plot']['ROOTObject']:
            for column in range(self.nCols):
                for row in range(self.nRows):
                    defectIndicator = self.ResultData['Plot']['ROOTObject'].GetBinContent(column + 1, row + 1)
                    if defectIndicator > 0:
                        self.BumpbondingDefectsList.add((ChipNo, column, row))

            self.ResultData['KeyValueDictPairs']['BumpBondingDefects']['Value'] = self.BumpbondingDefectsList
            self.ResultData['KeyValueDictPairs']['NBumpBondingDefects']['Value'] = len(self.BumpbondingDefectsList)

            self.ResultData['Plot']['ROOTObject'].Draw("colz")

        self.Title = 'BumpBonding'
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'svg'
        self.SaveCanvas()
Exemple #22
0
    def PopulateResultData(self):
        ChipNo = self.ParentObject.Attributes['ChipNo']

        ROOT.gPad.SetLogx(0)
        ROOT.gPad.SetLogy(0)
        ROOT.gStyle.SetOptStat(0)
        self.Canvas.Clear()

        if 'PixelAlive' in self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']:
            rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']['PixelAlive']
            histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get('HighRate', 'AliveMap').format(ChipNo=self.ParentObject.Attributes['ChipNo'])

            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(rootFileHandle, histogramName).Clone(self.GetUniqueID())

            if self.ResultData['Plot']['ROOTObject']:
                self.ResultData['Plot']['ROOTObject'].SetTitle("")
                self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column")
                self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row")
                self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
                self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].Draw('colz')
                

        self.Title = 'Alive Map: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()        
Exemple #23
0
    def PopulateResultData(self):
        ChipNo = self.ParentObject.Attributes['ChipNo']

        rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes[
            'ROOTFiles']['HREfficiency_{Rate}'.format(
                Rate=self.Attributes['Rate'])]
        histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get(
            'HighRate', 'EfficiencyMap').format(
                ChipNo=self.ParentObject.Attributes['ChipNo'])

        self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(
            rootFileHandle, histogramName).Clone(self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            ROOT.gStyle.SetOptStat(0)
            self.Canvas.Clear()
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            #self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRangeUser(-50., 50.);
            #self.ResultData['Plot']['ROOTObject'].GetYaxis().SetRangeUser(0.5, 5.0 * self.ResultData['Plot'][
            #    'ROOTObject'].GetMaximum())
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(
                1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')

        self.Title = 'Efficiency Map {Rate}: C{ChipNo}'.format(
            ChipNo=self.ParentObject.Attributes['ChipNo'],
            Rate=self.Attributes['Rate'])
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #24
0
    def PopulateResultData(self):

        ROOT.gPad.SetLogy(0)
        ROOT.gStyle.SetOptStat(0)
        ChipNo=self.ParentObject.Attributes['ChipNo']

        try:
            HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
            histname = HistoDict.get(self.NameSingle, 'NoiseMap')
            NoiseMap = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
            self.ResultData['Plot']['ROOTObject'] = NoiseMap.Clone(self.GetUniqueID())
        except:
            self.ResultData['Plot']['ROOTObject'] = None
            print 'DID NOT FIND WIDTHS'

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(0, 10)
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')


        self.ResultData['Plot']['Caption'] = 'Noise Map (Vcal)'
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #25
0
    def PopulateResultData(self):

        ROOT.gPad.SetLogy(1)

        # TH1D
        ChipNo = self.ParentObject.Attributes['ChipNo']
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        histname = self.ParentObject.ParentObject.ParentObject.HistoDict.get(
            self.NameSingle, 'AddressLevels')
        self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(
            self.ParentObject.ParentObject.FileHandle, histname,
            rocNo=ChipNo).Clone(self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRangeUser(
                -1500., 1500.)
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                "Analog Output Level")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                "No. of Entries")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(
                1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw()

        self.SaveCanvas()
        self.ResultData['Plot']['Enabled'] = 1
        self.Title = 'Address Levels: C{ChipNo}'.format(
            ChipNo=self.ParentObject.Attributes['ChipNo'])
        self.ResultData['Plot']['ImageFile'] = self.GetPlotFileName()
Exemple #26
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)
        ROOT.gPad.SetLogx(0)

        # TH2D
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        ChipNo = self.ParentObject.Attributes['ChipNo']

        if self.HistoDict.has_option(self.NameSingle, self.Attributes['Map']):
            histname = self.HistoDict.get(self.NameSingle, self.Attributes['Map'])
            object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
            self.ResultData['Plot']['ROOTObject'] = object.Clone(self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw("colz")

        self.Title = 'PH Map: %s'%(self.Attributes['Map'] if 'Map' in self.Attributes else '?')
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)

        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #27
0
    def PopulateResultData(self):

        ROOT.gPad.SetLogy(0)
        ROOT.gStyle.SetOptStat(0)
        ChipNo = self.ParentObject.Attributes['ChipNo']

        try:
            self.ResultData['Plot'][
                'ROOTObject'] = self.ParentObject.ResultData['SubTestResults'][
                    'SCurveWidths'].ResultData['Plot']['ROOTObject_ht'].Clone(
                        self.GetUniqueID())
        except:
            self.ResultData['Plot']['ROOTObject'] = None

        pxarfit = False
        if self.ResultData['Plot']['ROOTObject'] is None or (
                'NoDatFile' in self.ParentObject.ResultData['SubTestResults']
            ['SCurveWidths'].ResultData['HiddenData']
                and self.ParentObject.ResultData['SubTestResults']
            ['SCurveWidths'].ResultData['HiddenData']['NoDatFile']):
            HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
            histname = HistoDict.get(self.NameSingle, 'ThresholdMap')
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(
                self.ParentObject.ParentObject.FileHandle,
                histname,
                rocNo=ChipNo).Clone(self.GetUniqueID())
            print "error: Scurve .dat file not found, try to use pxar histogram from root file instead! histogram: ", histname
            if self.ResultData['Plot']['ROOTObject']:
                print "found!"
                self.ResultData['KeyValueDictPairs']['fit'] = {
                    'Label': 'Fit',
                    'Value': 'pxar',
                }
                self.ResultData['KeyList'].append('fit')
                pxarfit = True

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(
                self.ParentObject.ResultData['SubTestResults']
                ['SCurveWidths'].ResultData['HiddenData']['htmin'],
                self.ParentObject.ResultData['SubTestResults']
                ['SCurveWidths'].ResultData['HiddenData']['htmax'])
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                "Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                "Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(
                1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            if pxarfit:
                self.ResultData['Plot']['ROOTObject'].SetTitle(
                    "fit and histogram taken from pxar!!!")
            self.ResultData['Plot']['ROOTObject'].Draw('colz')

        self.ResultData['Plot']['Caption'] = 'Vcal Threshold Trimmed'
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #28
0
    def PopulateResultData(self):
        

        
        ROOT.gPad.SetLogy(1);
        
        # TH1D
        ChipNo=self.ParentObject.Attributes['ChipNo']
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict 
        histname = self.ParentObject.ParentObject.ParentObject.HistoDict.get(self.NameSingle,'AddressLevels')
        self.ResultData['Plot']['ROOTObject'] =  HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle,histname,rocNo=ChipNo).Clone(self.GetUniqueID())
    

        
        
        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRangeUser(-1500., 1500.);
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Analog Output Level");
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("No. of Entries");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5);
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].Draw();
            

        self.SaveCanvas()      
        self.ResultData['Plot']['Enabled'] = 1
        self.Title = 'Address Levels: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        self.ResultData['Plot']['ImageFile'] = self.GetPlotFileName()
Exemple #29
0
    def PopulateResultData(self):

        ROOT.gStyle.SetOptStat(0)
        self.ResultData['Plot']['ROOTObject'] = ROOT.TH2D(self.GetUniqueID(), "", self.nCols, 0., self.nCols,
                                                          self.nRows, 0., self.nRows)  # htm
        # TH2D

        ChipNo = self.ParentObject.Attributes['ChipNo']
        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        histname = HistoDict.get(self.NameSingle, 'TrimBitMap')
        self.ResultData['Plot']['ROOTObject_TrimMap'] = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle,
                                                                              histname,
                                                                              rocNo=ChipNo).Clone(self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            for i in range(self.nCols):  # Columns
                for j in range(self.nRows):  # Rows
                    self.ResultData['Plot']['ROOTObject'].SetBinContent(i + 1, j + 1, self.ResultData['Plot'][
                        'ROOTObject_TrimMap'].GetBinContent(i + 1, j + 1))
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(0., self.nTotalChips)
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Trim bit Map")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("entries")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')

        if self.SavePlotFile:
            self.Canvas.SaveAs(self.GetPlotFileName())
        self.ResultData['Plot']['Enabled'] = 1
        self.Title = 'Trim Bit Map'
        self.ResultData['Plot']['ImageFile'] = self.GetPlotFileName()
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0);
        ROOT.gPad.SetLogy(0);

        # TH2D
        ChipNo = self.ParentObject.Attributes['ChipNo']
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        histname = self.ParentObject.ParentObject.ParentObject.HistoDict.get(self.NameSingle,'AddressDecoding')
        self.ResultData['Plot']['ROOTObject'] =  HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle,histname,rocNo=ChipNo).Clone(self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')
            for column in range(self.nCols): #Column
                for row in range(self.nRows): #Row
                    self.HasAddressDecodingProblem(column, row)

        self.Title = 'Address Decoding: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
        self.ResultData['KeyValueDictPairs']['AddressDecodingProblems'] = {'Value':self.AddressProblemList, 'Label':'Address Decoding Problems', }
        self.ResultData['KeyValueDictPairs']['NAddressDecodingProblems'] = {'Value':len(self.AddressProblemList), 'Label':'N Address DecodingProblems', }
        self.ResultData['KeyList'].append('NAddressDecodingProblems')
Exemple #31
0
    def PopulateResultData(self):
        ChipNo = self.ParentObject.Attributes['ChipNo']

        histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get(
            'HighRate',
            'CalDelScan').format(ChipNo=self.ParentObject.Attributes['ChipNo'])

        self.Canvas.Clear()

        if 'CalDelScan' in self.ParentObject.ParentObject.ParentObject.Attributes[
                'ROOTFiles']:
            rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes[
                'ROOTFiles']['CalDelScan']
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(
                rootFileHandle, histogramName).Clone(self.GetUniqueID())

            if self.ResultData['Plot']['ROOTObject']:
                ROOT.gStyle.SetOptStat(0)
                self.ResultData['Plot']['ROOTObject'].SetTitle("")

                self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                    "CalDel")
                self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                    "Efficiency")
                self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].GetYaxis(
                ).SetTitleOffset(1.5)
                self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].Draw()

        self.Title = 'CalDel scan: C{ChipNo}'.format(
            ChipNo=self.ParentObject.Attributes['ChipNo'])
        self.SaveCanvas()
    def PopulateResultData(self):
        ROOT.gPad.SetLogy(0)
        ROOT.gStyle.SetOptStat(0);
        self.ResultData['Plot']['ROOTObject'] =  ROOT.TH2D(self.GetUniqueID(), "", self.nCols, 0., self.nCols, self.nRows, 0., self.nRows ) # htm
        # TH2D
        TrimBitHistograms = []
        ChipNo = self.ParentObject.Attributes['ChipNo']
        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        self.DeadTrimbitsList = set()
        try:
            self.PixelNotAliveList = self.ParentObject.ResultData['SubTestResults']['PixelMap'].ResultData['KeyValueDictPairs']['NotAlivePixels']['Value']
        except:
            self.PixelNotAliveList = set()

        for k in range(5):
            histname = HistoDict.get(self.NameSingle, 'TrimBitMap%d' % k)
            tmpHistogram = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
            tmpHistogram = tmpHistogram.Clone(self.GetUniqueID())
            TrimBitHistograms.append(tmpHistogram)
        for col in range(self.nCols):  # Column
            for row in range(self.nRows):  # Row
                if (ChipNo, col, row) not in self.PixelNotAliveList:
                    deadTrimBits = self.GetDeadTrimBits(col, row, TrimBitHistograms)
                    self.ResultData['Plot']['ROOTObject'].Fill(col, row, deadTrimBits)

        if self.ResultData['Plot']['ROOTObject']:

            self.ResultData['Plot']['ROOTObject'].SetTitle("");
            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(0., self.nTotalChips);
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Trim bit Problems");
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("entries");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.");
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.");
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5);
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle();
            self.ResultData['Plot']['ROOTObject'].Draw('colz');


        self.Title = 'Trim Bit Problems'
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
        self.ResultData['KeyValueDictPairs'] = {
            'DeadTrimbits': {
                'Value':self.DeadTrimbitsList,
                'Label':'Dead Trimbits'
            },
            'nDeadTrimbits': {
                'Value':'{0:1.0f}'.format(len(self.DeadTrimbitsList)),
                'Label':'Dead Trimbits'
            },
            'nDeadPixels': {
                'Value':'{0:1.0f}'.format(len(self.PixelNotAliveList)),
                'Label':'Dead Pixels'
            },

                                                }
        self.ResultData['KeyList'] = ['nDeadTrimbits', 'nDeadPixels']
    def PopulateResultData(self):
        ChipNo = self.ParentObject.Attributes['ChipNo']
        HitsVsEventsROOTObjects = {}
        Rates = self.ParentObject.ParentObject.ParentObject.Attributes['Rates']
        EventBins = 0
        EventMin = 0
        EventMax = 0
        Rate = self.Attributes['Rate']

        histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get('HighRate', 'hitsVsEvtCol').format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']['HRData_{Rate}'.format(Rate=Rate)]
        self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(rootFileHandle, histogramName).Clone(self.GetUniqueID())

        self.ResultData['HiddenData']['EventBins'] = max(
            self.ResultData['Plot']['ROOTObject'].GetXaxis().GetLast(),EventBins)

        if self.ResultData['Plot']['ROOTObject']:
            ROOT.gStyle.SetOptStat(0)
            self.Canvas.Clear()
            self.ResultData['Plot']['ROOTObject'].SetTitle("")

            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Event")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Column")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')

            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRange(
                self.ResultData['Plot']['ROOTObject'].GetXaxis().GetFirst(),
                self.ResultData['Plot']['ROOTObject'].GetXaxis().GetLast()-1
            )

            #why a fit anyway...
            FitPol0 = ROOT.TF1("GaussFitFunction", "pol0")
            self.ResultData['Plot']['ROOTObject'].Fit(FitPol0,'RQ0')

            Mean = -1
            RMS = -1
            if FitPol0:
                Mean = FitPol0.GetParameter(0)
                RMS = FitPol0.GetParError(0) # not rms but par0 error...

            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRange(
                self.ResultData['Plot']['ROOTObject'].GetXaxis().GetFirst(),
                self.ResultData['Plot']['ROOTObject'].GetXaxis().GetLast()
            )

            self.ResultData['KeyValueDictPairs']['mu']['Value'] = '{0:1.2f}'.format(Mean)
            self.ResultData['KeyValueDictPairs']['sigma']['Value'] = '{0:1.2f}'.format(RMS)

            self.ResultData['KeyList'] += ['mu','sigma']

            ROOT.gPad.Update()

        self.Title = 'Col. Uniformity per Event: C{ChipNo} {Rate}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'], Rate=self.Attributes['Rate'])
        if self.Canvas:
            self.Canvas.SetCanvasSize(750, 750)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #34
0
    def PopulateResultData(self):
            ROOT.gStyle.SetOptStat(0);
            ROOT.gPad.SetLogy(0);
        # TH2D
            ChipNo = self.ParentObject.Attributes['ChipNo']
            self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
            print 'HistoDict BarePixelMap: ', self.HistoDict

            if self.ParentObject.ParentObject.ParentObject.testSoftware=='pxar':

                #blablabla = bla(self)
                #self.ResultData['Plot']['ROOTObject']=bla.ResultData['Plot']['ROOTObject'];

                histname = self.HistoDict.get(self.NameSingle,'Calibrate')
                if self.HistoDict.has_option(self.NameSingle,'Calibrate'):
                    histname = self.HistoDict.get(self.NameSingle,'Calibrate')            
                    object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
                    self.ResultData['Plot']['ROOTObject']  = object.Clone(self.GetUniqueID())
                    
            else:
                histname = self.HistoDict.get(self.NameSingle,'BarePixelMap') 
                if self.HistoDict.has_option(self.NameSingle,'BarePixelMap'):
                    histname = self.HistoDict.get(self.NameSingle,'BarePixelMap')
                    object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
                    if not object:
                        print 'no Histogram for ChipNo',ChipNo
                    else:
                        self.ResultData['Plot']['ROOTObject']  = object.Clone(self.GetUniqueID())
                    
            if not object:   
                print 'Inside BarePixelMap ChipNo: ', ChipNo
            else:

                if self.ResultData['Plot']['ROOTObject']:
                    self.ResultData['Plot']['ROOTObject'].SetTitle("")
                    self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
                    self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
                    self.ResultData['Plot']['ROOTObject'].Draw('colz')
                    
                    if self.SavePlotFile:
                        self.Canvas.SaveAs(self.GetPlotFileName())
                        self.ResultData['Plot']['Enabled'] = 1
                        self.Title = 'BarePixelMap: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
                        self.ResultData['Plot']['ImageFile'] = self.GetPlotFileName()
Exemple #35
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)

        # TH2D
        ChipNo = self.ParentObject.Attributes['ChipNo']
        #self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        #print 'HistoDict BareBBScan: ', self.HistoDict
        #histname = self.HistoDict.get(self.NameSingle,'BareBBScan')

        #print 'Inside BareBBScan ChipNo: ', ChipNo
        #print 'and the histname: ', histname

        try:
            #if self.HistoDict.has_option(self.NameSingle,'BareBBScan'):
            self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
            histname = self.HistoDict.get(self.NameSingle, 'BareBBScan')
            object = HistoGetter.get_histo(
                self.ParentObject.ParentObject.FileHandle,
                histname,
                rocNo=ChipNo)
            self.ResultData['Plot']['ROOTObject'] = object.Clone(
                self.GetUniqueID())

            if object:

                if self.ResultData['Plot']['ROOTObject']:
                    self.ResultData['Plot']['ROOTObject'].SetTitle("")
                    self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                        "Column No.")
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                        "Row No.")
                    self.ResultData['Plot']['ROOTObject'].GetXaxis(
                    ).CenterTitle()
                    self.ResultData['Plot']['ROOTObject'].GetYaxis(
                    ).SetTitleOffset(1.5)
                    self.ResultData['Plot']['ROOTObject'].GetYaxis(
                    ).CenterTitle()
                    self.ResultData['Plot']['ROOTObject'].Draw('colz')
                    #            for column in range(self.nCols): #Column
                    #                for row in range(self.nRows): #Row
                    #                    self.HasAddressDecodingProblem(column, row)

                    self.Title = 'Bare BBScan: C{ChipNo}'.format(
                        ChipNo=self.ParentObject.Attributes['ChipNo'])

                    self.ResultData['Plot']['Format'] = 'png'
                    self.SaveCanvas()

            else:
                self.DisplayOptions['Show'] = False
                self.ResultData['Plot']['ROOTObject'] = None
                self.ResultData['KeyList'] = []

        except:
            self.DisplayOptions['Show'] = False
            self.ResultData['Plot']['ROOTObject'] = None
            self.ResultData['KeyList'] = []
            pass
Exemple #36
0
    def PopulateResultData(self):
        NumberOfLowEfficiencyPixels = 0
        ChipNo = self.ParentObject.Attributes['ChipNo']

        histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get(
            'HighRate', 'BackgroundMap').format(
                ChipNo=self.ParentObject.Attributes['ChipNo'])
        rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes[
            'ROOTFiles']['HREfficiency_{Rate}'.format(
                Rate=self.Attributes['Rate'])]
        self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(
            rootFileHandle, histogramName).Clone(self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            ROOT.gStyle.SetOptStat(0)
            self.Canvas.Clear()
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            #self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRangeUser(-50., 50.);
            #self.ResultData['Plot']['ROOTObject'].GetYaxis().SetRangeUser(0.5, 5.0 * self.ResultData['Plot'][
            #    'ROOTObject'].GetMaximum())
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(
                1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].SetContour(100)
            self.ResultData['Plot']['ROOTObject'].Draw('colz')
            self.ResultData['KeyValueDictPairs']['NHits'][
                'Value'] = '{NHits:1.0f}'.format(
                    NHits=self.ResultData['Plot']['ROOTObject'].GetEntries())

        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()

        TimeConstant = float(self.TestResultEnvironmentObject.
                             XRayHRQualificationConfiguration['TimeConstant'])
        Area = float(self.TestResultEnvironmentObject.
                     XRayHRQualificationConfiguration['Area'])

        # total number of triggers = number of pixels * ntrig(triggers per pixel)
        NPixels = 80 * 52
        NTriggers = NPixels * self.ParentObject.ParentObject.ParentObject.Attributes[
            'Ntrig']['HREfficiency_{Rate}'.format(
                Rate=self.Attributes['Rate'])]
        NHits = float(self.ResultData['KeyValueDictPairs']['NHits']['Value'])
        RealHitrate = NHits / (NTriggers * TimeConstant * Area) * 1e-6

        self.ResultData['KeyValueDictPairs']['RealHitrate'][
            'Value'] = '{RealHitrate:1.2f}'.format(RealHitrate=RealHitrate)

        self.ResultData['KeyValueDictPairs']['RealHitrate'][
            'NumericValue'] = RealHitrate
        self.ResultData['KeyList'] += ['RealHitrate']
        self.Title = 'Background Map {Rate}: C{ChipNo}'.format(
            ChipNo=self.ParentObject.Attributes['ChipNo'],
            Rate=self.Attributes['Rate'])
 def PopulateResultData(self):
     ROOT.gStyle.SetOptStat(0)
     try:
         histname = self.ParentObject.HistoDict.get(self.NameSingle, 'DigitalCurrent')
         self.ResultData['Plot']['ROOTHisto'] = HistoGetter.get_histo(self.ParentObject.FileHandle, histname)
     except Exception as e:
         print e
         raise e
     self.SpecialPopulateResultData(self,{'name':'Digital Current'})
Exemple #38
0
    def PopulateResultData(self):
        ChipNo = self.ParentObject.Attributes['ChipNo']

        ROOT.gPad.SetLogx(0)
        ROOT.gStyle.SetOptStat(0)
        self.Canvas.Clear()
        self.ResultData['Plot']['ROOTObject'] = None

        if 'MaskHotPixels' in self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']:
            rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']['MaskHotPixels']
            histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get('HighRate', 'HotPixelMap').format(ChipNo=self.ParentObject.Attributes['ChipNo'])

            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(rootFileHandle, histogramName).Clone(self.GetUniqueID())

        else:
            if 'RetrimHotPixelsPath' in self.ParentObject.ParentObject.ParentObject.Attributes:
                self.ResultData['Plot']['ROOTObject'] = ROOT.TH2D(self.GetUniqueID(), "", self.nCols, 0., self.nCols, self.nRows, 0., self.nRows) 
                Directory = self.ParentObject.ParentObject.ParentObject.Attributes['RetrimHotPixelsPath']
                MaskFileName = Directory + '/' + self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get('HighRate', 'MaskFile')
                MaskFileLines = []

                try:
                    with open(MaskFileName, "r") as f:
                        MaskFileLines = f.readlines()
                except:
                    print "could not open mask file '%s'"%MaskFileName

                for MaskFileLine in MaskFileLines:
                    line = MaskFileLine.strip().split(' ')
                    if len(line) >= 4 and line[0].lower() == 'pix' and int(line[1]) == int(ChipNo):
                        self.ResultData['Plot']['ROOTObject'].SetBinContent(1 + int(line[2]), 1 + int(line[3]), 1)


        if self.ResultData['Plot']['ROOTObject']:
            for col in range(0, self.nCols):
                for row in range(0, self.nRows):
                    if self.ResultData['Plot']['ROOTObject'].GetBinContent(1+col,1+row) > 0:
                        self.HotPixelsList.add((ChipNo, col, row))

            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')

        self.ResultData['HiddenData']['ListOfHotPixels'] = {'Label': 'Masked Hot Pixels List', 'Value': self.HotPixelsList}
        self.ResultData['HiddenData']['NumberOfHotPixels'] = {'Label': 'Masked Hot Pixels', 'Value': len(self.HotPixelsList)}

        self.Title = 'Masked Hot Pixels {Rate}: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'],Rate=self.Attributes['Rate'])
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()        
Exemple #39
0
 def PopulateResultData(self):
     ROOT.gStyle.SetOptStat(0)
     try:
         histname = self.ParentObject.HistoDict.get(self.NameSingle,
                                                    'DigitalCurrent')
         self.ResultData['Plot']['ROOTHisto'] = HistoGetter.get_histo(
             self.ParentObject.FileHandle, histname)
     except Exception as e:
         print e
         raise e
     self.SpecialPopulateResultData(self, {'name': 'Digital Current'})
Exemple #40
0
    def PopulateResultData(self):
        # initialize ROOT
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)
        ROOT.gPad.SetLogx(0)

        # initialize data
        ChipNo = self.ParentObject.Attributes['ChipNo']

        try:
            self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
            histname = self.HistoDict.get(self.NameSingle, "PixelHit")
            histo = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo=ChipNo)
            self.ResultData['Plot']['ROOTObject'] = ROOT.TH2D(self.GetUniqueID(), "", self.nCols, 0., self.nCols, self.nRows, 0., self.nRows)

            # if BB4 test exists
            if histo:

                # fill plot
                self.ResultData['Plot']['ROOTObject'] = ROOT.TH2D(self.GetUniqueID(), "", self.nCols, 0., self.nCols, self.nRows, 0., self.nRows)
                for col in range(self.nCols):
                    for row in range(self.nRows):
                        value = 1 if histo.GetBinContent(col + 1, row + 1) < 1 else 0
                        if value > 0:
                            self.DeadBumpList.add((ChipNo, col, row))
                        self.ResultData['Plot']['ROOTObject'].SetBinContent(col + 1, row + 1, value)
                # draw
                if self.ResultData['Plot']['ROOTObject']:
                    self.ResultData['Plot']['ROOTObject'].SetTitle("")
                    self.ResultData['Plot']['ROOTObject'].Draw('colz')
                    self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(0, 1)
                    self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
                    self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
                    self.ResultData['Plot']['ROOTObject'].Draw('colz')

                self.SaveCanvas()

                self.ResultData['KeyValueDictPairs']['DeadBumps'] = {'Value': self.DeadBumpList, 'Label': 'Dead Bumps'}
                self.ResultData['KeyValueDictPairs']['NDeadBumps'] = {'Value': len(self.DeadBumpList), 'Label': 'Dead Bumps'}
                self.ResultData['KeyList'] = ['NDeadBumps']
            else:
                self.DisplayOptions['Show'] = False
                self.ResultData['Plot']['ROOTObject'] = None
                self.ResultData['KeyList'] = []

        except:
            self.DisplayOptions['Show'] = False
            self.ResultData['Plot']['ROOTObject'] = None
            self.ResultData['KeyList'] = []
            pass
Exemple #41
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0);
        ROOT.gPad.SetLogy(0);

        # TH2D
        ChipNo = self.ParentObject.Attributes['ChipNo']
        #self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        #print 'HistoDict BareBBScan: ', self.HistoDict
        #histname = self.HistoDict.get(self.NameSingle,'BareBBScan')

        #print 'Inside BareBBScan ChipNo: ', ChipNo
        #print 'and the histname: ', histname

        try:
            #if self.HistoDict.has_option(self.NameSingle,'BareBBScan'):
            self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
            histname = self.HistoDict.get(self.NameSingle,'BareBBScan')            
            object = HistoGetter.get_histo(self.ParentObject.ParentObject.FileHandle, histname, rocNo = ChipNo)
            self.ResultData['Plot']['ROOTObject']  = object.Clone(self.GetUniqueID())
        

            if object:

                if self.ResultData['Plot']['ROOTObject']:
                    self.ResultData['Plot']['ROOTObject'].SetTitle("")
                    self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column No.")
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row No.")
                    self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
                    self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
                    self.ResultData['Plot']['ROOTObject'].Draw('colz')
                    #            for column in range(self.nCols): #Column
                    #                for row in range(self.nRows): #Row
                    #                    self.HasAddressDecodingProblem(column, row)
                    
                    self.Title = 'Bare BBScan: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'])
                
            
                    self.ResultData['Plot']['Format'] = 'png'
                    self.SaveCanvas()
			

            else:
                self.DisplayOptions['Show'] = False
                self.ResultData['Plot']['ROOTObject'] = None
                self.ResultData['KeyList'] = []

        except:
            self.DisplayOptions['Show'] = False
            self.ResultData['Plot']['ROOTObject'] = None
            self.ResultData['KeyList'] = []
            pass
Exemple #42
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)

        # read histograms
        self.HistoDict = self.ParentObject.HistoDict
        if self.HistoDict.has_option('OnShellQuickTest', 'DeltaAliveHV'):
            histname = self.HistoDict.get('OnShellQuickTest', 'DeltaAliveHV')
            rootObject = HistoGetter.get_histo(self.ParentObject.FileHandle,
                                               histname)
            self.ResultData['Plot']['ROOTObject'] = rootObject.Clone(
                self.GetUniqueID())

            # check dead and inefficient pixels
            deltaAliveHV = 0
            deltaAliveHVRocs = []
            nChips = self.ParentObject.Attributes['NumberOfChips']
            for chipNo in range(nChips):
                deltaAliveHV += self.ResultData['Plot'][
                    'ROOTObject'].GetBinContent(1 + chipNo)
                deltaAliveHVRocs.append(self.ResultData['Plot']
                                        ['ROOTObject'].GetBinContent(1 +
                                                                     chipNo))

            # fill dictionaries
            self.ResultData['KeyValueDictPairs']['DeltaAliveHV'][
                'Value'] = deltaAliveHV
            self.ResultData['HiddenData'][
                'DeltaAliveHVRocs'] = deltaAliveHVRocs

            # style histogram
            if self.ResultData['Plot']['ROOTObject']:
                self.ResultData['Plot']['ROOTObject'].SetTitle("")
                self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                    "ROC")
                self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                    "# dead pixels")
                self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].GetYaxis(
                ).SetTitleOffset(1.5)
                self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].Draw('')

            self.Title = 'Delta Alive HV'

            # save canvas
            if self.Canvas:
                self.Canvas.SetCanvasSize(500, 500)
            self.ResultData['Plot']['Format'] = 'svg'
            self.SaveCanvas()
Exemple #43
0
    def PopulateResultData(self):

        ROOT.gPad.SetLogy(0)
        ROOT.gStyle.SetOptStat(0)
        ChipNo = self.ParentObject.Attributes['ChipNo']

        try:
            DeadPixelList = self.ParentObject.ResultData['SubTestResults'][
                'PixelMap'].ResultData['KeyValueDictPairs']['DeadPixels'][
                    'Value']
        except:
            DeadPixelList = ()
            print "warning: could not find pixel alive map, cannot distinguish threshold defects from dead pixels!"

        ChipNo = self.ParentObject.Attributes['ChipNo']
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        histname = self.ParentObject.ParentObject.ParentObject.HistoDict.get(
            self.NameSingle, 'ThresholdMapTrimmed')
        ThresholdMap = HistoGetter.get_histo(
            self.ParentObject.ParentObject.FileHandle, histname,
            rocNo=ChipNo).Clone(self.GetUniqueID())
        self.ResultData['Plot']['ROOTObject'] = ROOT.TH2D(
            self.GetUniqueID(), "", self.nCols, 0., self.nCols, self.nRows, 0.,
            self.nRows)

        for col in range(0, ThresholdMap.GetNbinsX()):
            for row in range(0, ThresholdMap.GetNbinsY()):
                threshold = ThresholdMap.GetBinContent(col + 1, row + 1)
                if DeadPixelList is None or (ChipNo, col,
                                             row) not in DeadPixelList:
                    self.ResultData['Plot']['ROOTObject'].Fill(
                        col, row, threshold)

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                "Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                "Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(
                1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')

        self.ResultData['Plot']['Caption'] = 'Vcal Threshold Trimmed Map'
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #44
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)

        # TH2D
        ChipNo = self.ParentObject.Attributes['ChipNo']
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        histname = self.ParentObject.ParentObject.ParentObject.HistoDict.get(
            self.NameSingle, 'AddressDecoding')
        self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(
            self.ParentObject.ParentObject.FileHandle, histname,
            rocNo=ChipNo).Clone(self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                "Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                "Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(
                1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')
            for column in range(self.nCols):  #Column
                for row in range(self.nRows):  #Row
                    self.HasAddressDecodingProblem(column, row)

        self.Title = 'Address Decoding: C{ChipNo}'.format(
            ChipNo=self.ParentObject.Attributes['ChipNo'])
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
        self.ResultData['KeyValueDictPairs']['AddressDecodingProblems'] = {
            'Value': self.AddressProblemList,
            'Label': 'Address Decoding Problems',
        }
        self.ResultData['KeyValueDictPairs']['NAddressDecodingProblems'] = {
            'Value': len(self.AddressProblemList),
            'Label': 'N Address DecodingProblems',
        }
        self.ResultData['KeyList'].append('NAddressDecodingProblems')
Exemple #45
0
    def PopulateResultData(self):

        ROOT.gStyle.SetOptStat(0)
        self.ResultData['Plot']['ROOTObject'] = ROOT.TH2D(
            self.GetUniqueID(), "", self.nCols, 0., self.nCols, self.nRows, 0.,
            self.nRows)  # htm
        # TH2D

        ChipNo = self.ParentObject.Attributes['ChipNo']
        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        histname = HistoDict.get(self.NameSingle, 'TrimBitMap')
        self.ResultData['Plot']['ROOTObject_TrimMap'] = HistoGetter.get_histo(
            self.ParentObject.ParentObject.FileHandle, histname,
            rocNo=ChipNo).Clone(self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            for i in range(self.nCols):  # Columns
                for j in range(self.nRows):  # Rows
                    self.ResultData['Plot']['ROOTObject'].SetBinContent(
                        i + 1, j + 1, self.ResultData['Plot']
                        ['ROOTObject_TrimMap'].GetBinContent(i + 1, j + 1))
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(
                0., self.nTotalChips)
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                "Trim bit Map")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                "entries")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                "Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                "Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(
                1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')

        self.Title = 'Trim Bit Map'
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #46
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)

        # read histograms
        self.HistoDict = self.ParentObject.HistoDict
        if self.HistoDict.has_option('OnShellQuickTest', 'Iana'):
            histname = self.HistoDict.get('OnShellQuickTest', 'Iana')
            rootObject = HistoGetter.get_histo(self.ParentObject.FileHandle, histname)
            self.ResultData['Plot']['ROOTObject'] = rootObject.Clone(self.GetUniqueID())

            # check dead and inefficient pixels
            IanaRoc = []
            nChips = self.ParentObject.Attributes['NumberOfChips']
            for chipNo in range(nChips):
                IanaRoc.append(self.ResultData['Plot']['ROOTObject'].GetBinContent(1 + chipNo))

            # fill dictionaries
            self.ResultData['KeyValueDictPairs']['IanaTotal']['Value'] = "%1.1f"%sum(IanaRoc)
            self.ResultData['KeyValueDictPairs']['IanaMean']['Value'] = "%1.1f"%(sum(IanaRoc) / len(IanaRoc) if len(IanaRoc) > 0 else -1)
            self.ResultData['KeyValueDictPairs']['IanaMin']['Value'] = "%1.1f"%min(IanaRoc) if len(IanaRoc) > 0 else -1
            self.ResultData['KeyValueDictPairs']['IanaMax']['Value'] = "%1.1f"%max(IanaRoc) if len(IanaRoc) > 0 else -1

            self.ResultData['HiddenData']['IanaRocs'] = IanaRoc

            # style histogram
            if self.ResultData['Plot']['ROOTObject']:
                self.ResultData['Plot']['ROOTObject'].SetTitle("")
                self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("ROC")
                self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
                self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].SetStats(0)
                self.ResultData['Plot']['ROOTObject'].Draw('')

            self.Title = 'Iana'

            # save canvas
            if self.Canvas:
                self.Canvas.SetCanvasSize(500, 500)
            self.ResultData['Plot']['Format'] = 'svg'
            self.SaveCanvas()
Exemple #47
0
    def PopulateResultData(self):
        ChipNo = self.ParentObject.Attributes['ChipNo']

        rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes['ROOTFiles']['HRData_{Rate}'.format(Rate=self.Attributes['Rate'])]
        histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get('HighRate', 'HitMap').format(ChipNo=self.ParentObject.Attributes['ChipNo'])
        histoHitMap = HistoGetter.get_histo(rootFileHandle, histogramName).Clone(self.GetUniqueID())

        histoAlive = self.ParentObject.ResultData['SubTestResults']['AliveMap'].ResultData['Plot']['ROOTObject']
        histoHot = self.ParentObject.ResultData['SubTestResults']['HotPixelMap_{Rate}'.format(Rate=self.Attributes['Rate'])].ResultData['Plot']['ROOTObject']

        self.ResultData['Plot']['ROOTObject'] = ROOT.TH2D(self.GetUniqueID(), "", self.nCols, 0., self.nCols, self.nRows, 0., self.nRows) 

        try:
            NtrigAlive = self.ParentObject.ParentObject.ParentObject.Attributes['Ntrig']['PixelAlive']
        except:
            NtrigAlive = 10

        if histoHitMap:
            for Row in range(self.nRows):
                for Column in range(self.nCols):
                    PixelHits = histoHitMap.GetBinContent(Column+1, Row+1)
                    PixelAlive = (not histoAlive) or (histoAlive.GetBinContent(Column+1, Row+1) == NtrigAlive)
                    PixelUnmasked = (not histoHot) or (histoHot.GetBinContent(Column+1, Row+1) < 1)

                    if PixelHits < 1 and PixelAlive and PixelUnmasked:
                        self.BBDefectsList.add((ChipNo, Column, Row))
                        self.ResultData['Plot']['ROOTObject'].SetBinContent(Column+1, Row+1, 1)

            ROOT.gStyle.SetOptStat(0)
            self.Canvas.Clear()
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle("Column")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle("Row")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')

        self.SaveCanvas()
        self.ResultData['KeyValueDictPairs']['NumberOfDefectivePixels']['Value'] = '{NumberOfDefectivePixels:1.0f}'.format(NumberOfDefectivePixels=len(self.BBDefectsList))
        self.ResultData['HiddenData']['ListOfDefectivePixels'] = {'Label': 'BB defects', 'Value': self.BBDefectsList}
        self.Title = 'BB Defects {Rate}: C{ChipNo}'.format(ChipNo=self.ParentObject.Attributes['ChipNo'],Rate=self.Attributes['Rate'])
Exemple #48
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)

        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        HistoName = HistoDict.get(self.NameSingle, 'VdigCalibration')
        ChipNo = self.ParentObject.Attributes['ChipNo']
        ROOTFile = self.ParentObject.ParentObject.FileHandle

        try:
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(
                ROOTFile, HistoName, rocNo=ChipNo).Clone(self.GetUniqueID())
        except:
            pass

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].Draw()

        self.Title = 'Vdig [ADC]/Vd [V]'
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.SaveCanvas()
Exemple #49
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)

        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        HistoName = HistoDict.get('OnShellQuickTest', 'CalDelVthrcomp')
        ChipNo = self.ParentObject.Attributes['ChipNo']
        ROOTFile = self.ParentObject.ParentObject.FileHandle

        try:
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(
                ROOTFile, HistoName, rocNo=ChipNo).Clone(self.GetUniqueID())
        except:
            self.ResultData['Plot']['ROOTObject'] = None

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].Draw("colz")

        self.Title = 'CalDel/Vthrcomp'
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #50
0
    def PopulateResultData(self):

        ROOT.gPad.SetLogy(0)
        ROOT.gStyle.SetOptStat(0)
        ChipNo = self.ParentObject.Attributes['ChipNo']

        try:
            HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
            histname = HistoDict.get(self.NameSingle, 'NoiseMap')
            NoiseMap = HistoGetter.get_histo(
                self.ParentObject.ParentObject.FileHandle,
                histname,
                rocNo=ChipNo)
            self.ResultData['Plot']['ROOTObject'] = NoiseMap.Clone(
                self.GetUniqueID())
        except:
            self.ResultData['Plot']['ROOTObject'] = None
            print 'DID NOT FIND WIDTHS'

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].GetZaxis().SetRangeUser(
                0, 10)
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                "Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                "Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(
                1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw('colz')

        self.ResultData['Plot']['Caption'] = 'Noise Map (Vcal)'
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #51
0
    def PopulateResultData(self):
        ROOT.gStyle.SetOptStat(0)
        ROOT.gPad.SetLogy(0)
        ROOT.gPad.SetLogx(0)

        # TH2D
        self.HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        ChipNo = self.ParentObject.Attributes['ChipNo']

        if self.HistoDict.has_option(self.NameSingle, self.Attributes['Map']):
            histname = self.HistoDict.get(self.NameSingle,
                                          self.Attributes['Map'])
            object = HistoGetter.get_histo(
                self.ParentObject.ParentObject.FileHandle,
                histname,
                rocNo=ChipNo)
            self.ResultData['Plot']['ROOTObject'] = object.Clone(
                self.GetUniqueID())

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                "Column No.")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                "Row No.")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(
                1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw("colz")

        self.Title = 'PH Map: %s' % (self.Attributes['Map']
                                     if 'Map' in self.Attributes else '?')
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)

        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #52
0
    def PopulateResultData(self):
        ChipNo = self.ParentObject.Attributes['ChipNo']

        ROOT.gPad.SetLogx(0)
        ROOT.gPad.SetLogy(0)
        ROOT.gStyle.SetOptStat(0)
        self.Canvas.Clear()

        if 'PixelAlive' in self.ParentObject.ParentObject.ParentObject.Attributes[
                'ROOTFiles']:
            rootFileHandle = self.ParentObject.ParentObject.ParentObject.Attributes[
                'ROOTFiles']['PixelAlive']
            histogramName = self.ParentObject.ParentObject.ParentObject.ParentObject.HistoDict.get(
                'HighRate', 'AliveMap').format(
                    ChipNo=self.ParentObject.Attributes['ChipNo'])

            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(
                rootFileHandle, histogramName).Clone(self.GetUniqueID())

            if self.ResultData['Plot']['ROOTObject']:
                self.ResultData['Plot']['ROOTObject'].SetTitle("")
                self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                    "Column")
                self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                    "Row")
                self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].GetYaxis(
                ).SetTitleOffset(1.5)
                self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
                self.ResultData['Plot']['ROOTObject'].Draw('colz')

        self.Title = 'Alive Map: C{ChipNo}'.format(
            ChipNo=self.ParentObject.Attributes['ChipNo'])
        if self.Canvas:
            self.Canvas.SetCanvasSize(500, 500)
        self.ResultData['Plot']['Format'] = 'png'
        self.SaveCanvas()
Exemple #53
0
    def PopulateResultData(self):
        #ROOT.gStyle.SetOptStat(0)

        #HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        #HistoName = HistoDict.get(self.NameSingle, 'VbgCalibration')
        #print HistoName
        HistoName= 'Readback.Vbg_readback_VdCal_V0'
        ChipNo = self.ParentObject.Attributes['ChipNo']
        ROOTFile = self.ParentObject.ParentObject.FileHandle

        try:
            self.ResultData['Plot']['ROOTObject'] = HistoGetter.get_histo(ROOTFile, HistoName).Clone(self.GetUniqueID())
        except:
            pass

        if self.ResultData['Plot']['ROOTObject']:
            Vbg=round(self.ResultData['Plot']['ROOTObject'].GetBinContent(ChipNo+1),3)
            self.ResultData['KeyValueDictPairs'] = {
                        'Vbg': {
                        'Value':Vbg,
                        'Label':'Vbg'
                        },
                                                    }
            self.ResultData['KeyList'] = ['Vbg']
    def analyse_test_list(self, testList):
        tests = []
        testchain = AbstractClasses.Helper.testchain.parse_test_list(testList)

        if testchain:
            test = testchain.next()
            Testnames = []
            while test:
                env = AbstractClasses.Helper.environment.environment(test.test_str, self.initParser)
                test.environment = env
                test.testname = test.test_str.split("@")[0]
                Testnames.append(test.test_str.split("@")[0])
                test = test.next()
            index = 0
            test = testchain.next()
            if not ('HREfficiency' in Testnames):
                tests, test, index = self.appendTemperatureGraph(tests, test, index)
                tests, test, index = self.appendHumidityGraph(tests, test, index)
            tests, test, index = self.appendCurrentGraph(tests, test, index)
            HRTestAdded = False
        else:
            test = None

        self.TestResultEnvironmentObject.IVCurveFiles = {}

        # qualifications
        QualificationAdded = False
        while test:
            if 'fulltest' in test.testname.lower():
                print '\t-> appendFulltest'
                tests, test, index = self.appendFulltest(tests, test, index)
                QualificationAdded = True
            elif test.testname.lower().startswith('reception'):
                print '\t-> appendReception'
                tests, test, index = self.appendReception(tests, test, index)
                QualificationAdded = True
            elif 'powercycle' in test.testname:
                test = test.next()
            elif 'cycle' in test.testname.lower():
                print '\t-> appendTemperatureCycle'
                tests, test, index = self.appendTemperatureCycle(tests, test, index)
            elif 'xrayspectrum' in test.testname.lower() or 'xraypxar' in test.testname.lower():
                print '\t-> appendXraySpectrum'
                tests, test, index = self.appendXrayCalibration(tests, test, index)
                QualificationAdded = True
            elif (
                    ('hrefficiency' in test.testname.lower()
                        or 'hrdata' in test.testname.lower()
                        or 'hrscurves' in test.testname.lower()
                    )
                    and not HRTestAdded
                ):
                # Accept all tests with names 'HREfficiency'
                print '\t-> appendXRayHighRateTest'
                tests, test, index = self.appendXRayHighRateTest(tests, test, index)
                HRTestAdded = True
                QualificationAdded = True
            elif 'leakagecurrentpon' in test.testname.lower():
                print '\t-> appendLeakageCurrentPON'
                tests, test, index = self.appendLeakageCurrentPON(tests, test, index)
            else:
                if self.verbose:
                    print '\t-> cannot convert ', test.testname
                index += 1
                test = test.next()

        # single tests
        singleTestsList = ['PixelAlive', 'ReadbackCal', 'BumpBonding', 'Scurves', 'Trim', 'GainPedestal', 'Hitmap', 'PhOptimization']

        # try to find tests from test list in ini file
        if not QualificationAdded:
            print "no qualifications found, looking for single tests"
            #testchain = AbstractClasses.Helper.testchain.parse_test_list(testList)
            if testchain:
                test = testchain.next()
                index = 0
                while test:
                    if test.testname.lower() in [x.lower() for x in singleTestsList]:
                        print '\t-> appendSingleTest %s'%test.testname
                        tests, test, index = self.appendSingleTest(tests, test, index)
                        QualificationAdded = True
                    else:
                        if self.verbose:
                            print '\t-> cannot convert ', test.testname
                        index += 1
                        test = test.next()

        # check root files in subfolders directly and try to find something...
        if not QualificationAdded:
            SubtestfoldersPath = "%s/*_*_*/*.root"%self.TestResultEnvironmentObject.ModuleDataDirectory
            SubtestfolderRootFiles = glob.glob(SubtestfoldersPath)
            print "found at least some .root files:", SubtestfolderRootFiles

            # these defines the histograms which are checked for existence in the .root file
            # if found, the single test is added
            SingleTestsDicts = [
                {'HistoDictSection': 'PixelMap',
                 'HistoDictEntry': 'Calibrate',
                 'SingleTestName': 'PixelAlive'},
                {'HistoDictSection': 'VcalThresholdUntrimmed',
                 'HistoDictEntry': 'ThresholdMap',
                 'SingleTestName': 'Scurves'},
                {'HistoDictSection': 'TrimBitMap',
                 'HistoDictEntry': 'TrimBitMap',
                 'SingleTestName': 'Trim'},
                {'HistoDictSection': 'GainPedestal',
                 'HistoDictEntry': 'GainPedestalP0',
                 'SingleTestName': 'GainPedestal'},
                {'HistoDictSection': 'PHMap',
                 'HistoDictEntry': 'MaxPHMap',
                 'SingleTestName': 'PhOptimization'},
            ]
            for RootFileName in SubtestfolderRootFiles:
                RootFile = ROOT.TFile.Open(RootFileName)
                if RootFile:
                    self.check_Test_Software()
                    print "file: %s =>"%RootFileName

                    for SingleTestsDict in SingleTestsDicts:
                        if self.HistoDict.has_option(SingleTestsDict['HistoDictSection'], SingleTestsDict['HistoDictEntry']):
                            histname = self.HistoDict.get(SingleTestsDict['HistoDictSection'], SingleTestsDict['HistoDictEntry'])
                            object = HistoGetter.get_histo(RootFile, histname, rocNo = 0)
                            if object:
                                SubfolderName = RootFileName.split('/')[-2]
                                print '\t-> appendSingleTest %s'%test
                                index = int(SubfolderName.split('_')[0])
                                Environment = SubfolderName.split('_')[-1]
                                Temperature = Environment.replace('p','').replace('m', '-')
                                Directory = SubfolderName
                                tests, test, index = self.appendSingleTestFromRootfile(tests, SingleTestsDict['SingleTestName'], index, Directory, Environment, Temperature)
                                QualificationAdded = True

                    RootFile.Close()
                else:
                    print "cannot open root file '%s'"%RootFileName

        if not QualificationAdded:
            print "Could not find anything to analyze, check if:"
            print "  - there is either a correct .ini file in configfiles subfolder containing the test list"
            print "  - or a .root file in the test subfolder containing histograms with the correct naming convention (eg. like in pxar.cfg)"

        self.appendOperationDetails(self.ResultData['SubTestResultDictList'])

        return tests
    def PopulateResultData(self):

        ROOT.gPad.SetLogy(1)
        ROOT.gStyle.SetOptStat(1)
        ChipNo = self.ParentObject.Attributes['ChipNo']
        try:
            DeadPixelList = self.ParentObject.ResultData['SubTestResults'][
                'PixelMap'].ResultData['KeyValueDictPairs']['DeadPixels'][
                    'Value']
        except:
            DeadPixelList = ()
            print "warning: could not find pixel alive map, cannot distinguish threshold defects from dead pixels!"

        # TH1D
        HistoDict = self.ParentObject.ParentObject.ParentObject.HistoDict
        histname = HistoDict.get(self.NameSingle, 'ThresholdMap')
        ThresholdMap = HistoGetter.get_histo(
            self.ParentObject.ParentObject.FileHandle, histname, rocNo=ChipNo)
        self.ResultData['Plot']['ROOTObject'] = ROOT.TH1F(
            self.GetUniqueID(), 'ThresholdDist', 256, -.5, 255.5)

        for col in range(0, ThresholdMap.GetNbinsX()):
            for row in range(0, ThresholdMap.GetNbinsY()):
                threshold = ThresholdMap.GetBinContent(col + 1, row + 1)
                if DeadPixelList is None or (ChipNo, col,
                                             row) not in DeadPixelList:
                    self.ResultData['Plot']['ROOTObject'].Fill(threshold)

        bin_min = self.ResultData['Plot']['ROOTObject'].FindFirstBinAbove()
        bin_max = self.ResultData['Plot']['ROOTObject'].FindLastBinAbove()
        self.ResultData['Plot']['ROOTObject'].GetXaxis().SetRange(
            bin_min - 1, bin_max + 1)

        self.ResultData['Plot']['ROOTObject_Map'] = ThresholdMap.Clone(
            self.GetUniqueID())
        gaus = ROOT.TF1('gaus', 'gaus(0)', 0, 255)
        gaus.SetParameters(1600.,
                           self.ResultData['Plot']['ROOTObject'].GetMean(),
                           self.ResultData['Plot']['ROOTObject'].GetRMS())
        gaus.SetParLimits(0, 0., 4160.)
        gaus.SetParLimits(1, 0.,
                          2. * self.ResultData['Plot']['ROOTObject'].GetMean())
        gaus.SetParLimits(2, 0.,
                          2. * self.ResultData['Plot']['ROOTObject'].GetRMS())
        #mG
        #switching to gaussian fit so that width is not driven by outliers (counted separately as pixel defects)
        self.ResultData['Plot']['ROOTObject'].Fit(gaus, 'QBR', '', 0., 255.)
        #MeanVcalThr = self.ResultData['Plot']['ROOTObject'].GetMean()
        MeanVcalThr = gaus.GetParameter(1)
        #sG
        #RMSVcalThr = self.ResultData['Plot']['ROOTObject'].GetRMS()
        RMSVcalThr = gaus.GetParameter(2)
        #nG
        first = self.ResultData['Plot']['ROOTObject'].GetXaxis().GetFirst()
        last = self.ResultData['Plot']['ROOTObject'].GetXaxis().GetLast()
        IntegralVcalThr = self.ResultData['Plot']['ROOTObject'].Integral(
            first, last)
        #nG_entries
        IntegralVcalThr_Entries = self.ResultData['Plot'][
            'ROOTObject'].GetEntries()

        under = self.ResultData['Plot']['ROOTObject'].GetBinContent(0)
        over = self.ResultData['Plot']['ROOTObject'].GetBinContent(
            self.ResultData['Plot']['ROOTObject'].GetNbinsX() + 1)

        if self.ParentObject.ResultData['SubTestResults'][
                'OpParameters'].ResultData['HiddenData'].has_key('vcalTrim'):
            self.vcalTrim = self.ParentObject.ResultData['SubTestResults'][
                'OpParameters'].ResultData['HiddenData']['vcalTrim']
        else:
            self.vcalTrim = 0
        if self.vcalTrim < 0:
            self.vcalTrim = 0
        maxDiff = self.TestResultEnvironmentObject.GradingParameters['tthrTol']
        self.ResultData['KeyValueDictPairs'] = {
            'N': {
                'Value': '{0:1.0f}'.format(IntegralVcalThr),
                'Label': 'N'
            },
            'mu': {
                'Value': '{0:1.2f}'.format(MeanVcalThr),
                'Label': 'μ'
            },
            'sigma': {
                'Value': '{0:1.2f}'.format(RMSVcalThr),
                'Label': 'σ_fit'
            },
            'vcal': {
                'Value': '{0:1.2f}'.format(self.vcalTrim),
                'Label': 'vcal'
            },
            'maxDiff': {
                'Value': '{0:1.2f}'.format(maxDiff),
                'Label': 'Max Delta'
            }
        }
        self.ResultData['KeyList'] = ['N', 'mu', 'sigma']
        if under:
            self.ResultData['KeyValueDictPairs']['under'] = {
                'Value': '{0:1.2f}'.format(under),
                'Label': 'Underflow'
            }
            self.ResultData['KeyList'].append('under')
        if over:
            self.ResultData['KeyValueDictPairs']['over'] = {
                'Value': '{0:1.2f}'.format(over),
                'Label': 'Overflow'
            }
            self.ResultData['KeyList'].append('over')

        if self.ResultData['Plot']['ROOTObject']:
            self.ResultData['Plot']['ROOTObject'].SetTitle("")
            self.ResultData['Plot']['ROOTObject'].SetAxisRange(0, 100)
            self.ResultData['Plot']['ROOTObject'].GetXaxis().SetTitle(
                "Vcal Threshold")
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitle(
                "No. of Entries")
            self.ResultData['Plot']['ROOTObject'].GetXaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].GetYaxis().SetTitleOffset(
                1.5)
            self.ResultData['Plot']['ROOTObject'].GetYaxis().CenterTitle()
            self.ResultData['Plot']['ROOTObject'].Draw()
        self.ResultData['Plot']['ROOTObject_LowEdge'] = ROOT.TCutG('lLower', 2)
        self.ResultData['Plot']['ROOTObject_LowEdge'].SetPoint(
            0, self.vcalTrim - maxDiff, -1e6)
        self.ResultData['Plot']['ROOTObject_LowEdge'].SetPoint(
            1, self.vcalTrim - maxDiff, +1e6)
        self.ResultData['Plot']['ROOTObject_LowEdge'].SetLineColor(ROOT.kRed)
        self.ResultData['Plot']['ROOTObject_LowEdge'].SetLineStyle(2)
        self.ResultData['Plot']['ROOTObject_LowEdge'].Draw('same')

        self.ResultData['Plot']['ROOTObject_UpEdge'] = ROOT.TCutG('lUpper', 2)
        self.ResultData['Plot']['ROOTObject_UpEdge'].SetPoint(
            0, self.vcalTrim + maxDiff, -1e6)
        self.ResultData['Plot']['ROOTObject_UpEdge'].SetPoint(
            1, self.vcalTrim + maxDiff, +1e6)
        self.ResultData['Plot']['ROOTObject_UpEdge'].SetLineColor(ROOT.kRed)
        self.ResultData['Plot']['ROOTObject_UpEdge'].SetLineStyle(2)
        self.ResultData['Plot']['ROOTObject_UpEdge'].Draw('same')
        if self.ResultData['Plot']['ROOTObject_Map']:
            for column in range(self.nCols):  # Column
                for row in range(self.nRows):  # Row
                    if DeadPixelList is None or (ChipNo, column,
                                                 row) not in DeadPixelList:
                        self.HasThresholdDefect(column, row)

        self.Title = 'Vcal Threshold Trimmed'
        self.SaveCanvas()
        self.ResultData['KeyValueDictPairs']['TrimProblems'] = {
            'Value': self.ThrDefectList,
            'Label': 'Trim Problems'
        }
        self.ResultData['KeyValueDictPairs']['NTrimProblems'] = {
            'Value': len(self.ThrDefectList),
            'Label': 'N Trim Problems'
        }
        self.ResultData['KeyList'].append('NTrimProblems')