#include <PixTest.hh>
Public Member Functions | |
| PixTest (PixSetup *a, std::string name) | |
| constructor requires PixSet to get test parameters and config parameters | |
| void | init () |
| sets all test parameters | |
| void | bookHist (std::string name) |
| use if you want, or define the histograms in the specific member functions | |
| void | bookTree () |
| book a minimal tree with pixel events | |
| virtual void | doAnalysis () |
| to be filled per test | |
| virtual void | doTest () |
| function connected to "DoTest" button of PixTab | |
| virtual void | fullTest () |
| function called when FullTest is running; most often this is simply calling doTest() | |
| virtual void | runCommand (std::string command) |
| allow execution of any button in the test | |
| void | saveDacs () |
| save DACs to file | |
| void | saveTrimBits () |
| save trim bits to file | |
| void | saveTbParameters () |
| save TB parameters to file | |
|
std::vector< std::vector < std::pair< int, int > > > | deadPixels (int ntrig, bool scanCalDel=false) |
| create vector (per ROC) of vector of dead pixels | |
| void | maskPixels () |
| mask all pixels mentioned in the mask file | |
| bool | testProblem () |
| query whether test 'failed' | |
| virtual void | setToolTips () |
| implement this to provide updated tool tips if the user changes test parameters | |
| virtual std::string | getStopTip () |
| hint to what happens if the user hits the "stop" button | |
| virtual std::string | getSummaryTip () |
| hint to what happens if the user hits the "summary" button | |
| virtual std::string | getTestTip () |
| get the string describing the test (called from PixTab::updateToolTips) | |
| virtual std::string | getHistOption (TH1 *) |
| get the hist display options (if stored in fHistOptions) | |
| int | pixelThreshold (std::string dac, int ntrig, int dacmin, int dacmax) |
| work-around to cope with suboptimal pxar/core | |
| void | dacScan (std::string dac, int ntrig, int dacmin, int dacmax, std::vector< shist256 * > maps, int ihit, int flag=0) |
| scan a dac range. Will call preScan to protect against r/o problems. | |
| void | preScan (std::string dac, std::vector< shist256 * > maps, int &dacmin, int &dacmax) |
| kind of another work-around (splitting the range, adjusting ntrig, etc) | |
| void | scurveAna (std::string dac, std::string name, std::vector< shist256 * > maps, std::vector< TH1 * > &resultMaps, int result) |
| do the scurve analysis | |
| void | getPhError (std::string dac, int dacmin, int dacmax, int FLAGS, int ntrig) |
| determine PH error interpolation | |
| std::vector< TH2D * > | phMaps (std::string name, uint16_t ntrig=10, uint16_t FLAGS=FLAG_FORCE_MASKED) |
| returns TH2D's with pulseheight maps | |
| std::vector< TH2D * > | efficiencyMaps (std::string name, uint16_t ntrig=10, uint16_t FLAGS=FLAG_FORCE_MASKED) |
| returns TH2D's with hit maps | |
| std::vector< TH1 * > | scurveMaps (std::string dac, std::string name, int ntrig=10, int daclo=0, int dachi=255, int dacsperstep=-1, int result=15, int ihit=1, int flag=FLAG_FORCE_MASKED) |
| std::vector< TH1 * > | thrMaps (std::string dac, std::string name, uint8_t dacmin, uint8_t dachi, int ntrig, uint16_t flag=0) |
| returns TH2D's for the threshold, the user flag argument is intended for selecting calS and will be OR'ed with other flags | |
| std::vector< TH1 * > | thrMaps (std::string dac, std::string name, int ntrig, uint16_t flag=0) |
| std::vector< std::pair< int, int > > | checkHotPixels (TH2D *h) |
|
std::pair< std::vector< TH2D * > , std::vector< TH2D * > > | xEfficiencyMaps (std::string name, uint16_t ntrig, uint16_t FLAGS=FLAG_CHECK_ORDER|FLAG_FORCE_UNMASKED) |
| Return pixelAlive map and additional hit map when running with external source. | |
| void | maskHotPixels (std::vector< TH2D * >) |
| determine hot pixels with high occupancy | |
| void | resetROC () |
| send reset to ROC(s) | |
| void | resetTBM () |
| send reset to TBM(s) | |
| uint16_t | prepareDaq (int triggerFreq, uint8_t trgTkDel) |
| set up DAQ (including call to setTriggerFrequency) | |
| uint16_t | setTriggerFrequency (int triggerFreq, uint8_t TrgTkDel) |
| set trigger frequence [kHz] and trigger token delay | |
| void | finalCleanup () |
| functions for DAQ | |
| void | pgToDefault () |
| TH1D * | bookTH1D (std::string sname, std::string title, int nbins, double xmin, double xmax) |
| book a TH1D, adding version information to the name and title | |
| TH2D * | bookTH2D (std::string sname, std::string title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double max) |
| book a TH2D, adding version information to the name and title | |
| TProfile2D * | bookTProfile2D (std::string sname, std::string title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double max, std::string option="") |
| book a TProfile2D, adding version information to the name and title | |
| void | fillDacHist (std::vector< std::pair< uint8_t, std::vector< pxar::pixel > > > &results, TH1D *h, int icol=-1, int irow=-1, int iroc=-1) |
| fill the results of a api::getEfficiencyVsDAC into a TH1D; if icol/irow/iroc are > -1, then fill only 'correct' pixels | |
| virtual void | sparseRoc (int npix=8) |
| select some pattern of pixels if not enabling the complete ROC. Enables the complete ROC if npix > 999 | |
| TH1D * | distribution (TH2D *, int nbins, double xmin, double xmax) |
| creates a 1D distribution of a map | |
| bool | threshold (TH1 *) |
| fit an s-curve to a distribution. Fills fThreshold, fThresholdE, fSigma, fSigmaE | |
| int | simpleThreshold (TH1 *) |
| find first bin above 50% level. Fills fThreshold, fThresholdE, fSigma, fSigmaE | |
| std::vector< int > | getMaximumVthrComp (int ntrig, double frac=0.8, int reserve=10) |
| maximum allowable VthrComp | |
| std::vector< int > | getMinimumVthrComp (std::vector< TH1 * >, int reserve=10, double nsigma=3.) |
| minimum allowable VthrComp; reserve indicate the separation from the minimum VthrComp where noise sets in | |
| double | getMinimumThreshold (std::vector< TH1 * >) |
| return minimum threshold in a set of maps | |
| double | getMaximumThreshold (std::vector< TH1 * >) |
| return maximum threshold in a set of maps | |
| std::vector< TH1 * > | mapsWithString (std::vector< TH1 * >, std::string name) |
| return a list of TH* that have 'name' as part to their histogram name | |
| std::vector< TH2D * > | mapsWithString (std::vector< TH2D * >, std::string name) |
| void | print (std::string, pxar::TLogLevel log=pxar::logINFO) |
| produce eye-catching printouts | |
| void | banner (std::string, pxar::TLogLevel log=pxar::logINFO) |
| void | bigBanner (std::string, pxar::TLogLevel log=pxar::logINFO) |
| void | cacheDacs (bool verbose=false) |
| cache all DACs | |
| void | restoreDacs (bool verbose=false) |
| restore all DACs | |
| std::vector< uint8_t > | getDacs (std::string dacName) |
| return from all ROCs the DAC dacName | |
| void | setDacs (std::string dacName, std::vector< uint8_t > dacVector) |
| set on all ROCs the DAC dacName | |
| std::string | getDacsString (std::string dacName) |
| return from all ROCs the DAC dacName as a string | |
| virtual TH1 * | moduleMap (std::string histname) |
| combine all available ROC maps into a module map | |
| void | clearHistList () |
| delete histogams from HistList | |
| std::string | getName () |
| returns the test name | |
| void | resetDirectory () |
| ??? | |
| TDirectory * | getDirectory () |
| return fDirectory | |
|
std::vector< std::pair < std::string, std::string > > | getParameters () |
| returns a vector of test parameter names and string values | |
| bool | getParameter (std::string parName, int &) |
| return by reference the INT value of a parameter | |
| bool | getParameter (std::string parName, float &) |
| return by reference the FLOAT value of a parameter | |
| std::string | getParameter (std::string parName) |
| return the string value of a parameter | |
| virtual bool | setParameter (std::string parName, std::string sval) |
| set the string value of a parameter | |
| virtual void | setDAC (std::string parName, uint8_t val) |
| allow setting DACs in scripts for entire DUT | |
| virtual void | setDAC (std::string parName, uint8_t val, uint8_t rocid) |
| allow setting DACs in scripts for spcific ROCs | |
| void | dumpParameters () |
| print all parameters and values | |
| void | setTitles (TH1 *h, const char *sx, const char *sy, float size=0.05, float xoff=1.1, float yoff=1.1, float lsize=0.05, int font=42) |
| utility to set histogram titles | |
| void | setId2Idx (std::map< int, int > a) |
| set the mapping between ROC ID and index | |
| int | getIdFromIdx (int idx) |
| provide the mapping between ROC ID and index | |
| int | getIdxFromId (int id) |
| provide the mapping between ROC index and ID | |
| bool | selectedRoc (int id) |
| is ROC ID selected? | |
| void | clearSelectedPixels () |
| clear selected pixel list | |
| void | addSelectedPixels (std::string sval) |
| add a selected pixel to the internal parameter list | |
| bool | setTestParameter (std::string parname, std::string value) |
| change the local parameter | |
| void | testDone () |
| signal to PixTab that the test is done (and to update the canvas) | |
| void | update () |
| signal to PixTab to update the canvas | |
| void | hvOff () |
| turn HV off | |
| void | hvOn () |
| turn HV on | |
| void | powerOff () |
| turn DTB power off | |
| void | powerOn () |
| turn DTB power on | |
| TH1 * | nextHist () |
| allow forward iteration through list of histograms | |
| TH1 * | previousHist () |
| allow backward iteration through list of histograms | |
Static Public Member Functions | |
| static std::string | stripPos (std::string) |
| decrepit, do not use | |
Protected Member Functions | |
| int | histCycle (std::string hname) |
| determine histogram cycle | |
| void | fillMap (TH2D *hmod, TH2D *hroc, int iroc) |
| provides the coordinate transformation to module map | |
| ClassDef (PixTest, 1) | |
Protected Attributes | |
| pxar::pxarCore * | fApi |
| pointer to the API | |
| PixSetup * | fPixSetup |
| all necessary stuff in one place | |
| PixTestParameters * | fTestParameters |
| the repository of all test parameters | |
| PixInitFunc * | fPIF |
| function instantiation and automatic initialization | |
| double | fThreshold |
| double | fThresholdE |
| double | fSigma |
| double | fSigmaE |
| variables for passing back s-curve results | |
| double | fThresholdN |
| variable for passing back the threshold where noise leads to loss of efficiency | |
| int | fNtrig |
| std::vector< double > | fPhErrP0 |
| std::vector< double > | fPhErrP1 |
| uint32_t | fNDaqErrors |
| std::string | fName |
| std::string | fTestTip |
| std::string | fSummaryTip |
| std::string | fStopTip |
| information for this test | |
|
std::vector< std::pair < std::string, std::string > > | fParameters |
| the parameters of this test | |
|
std::vector< std::vector < std::pair< std::string, uint8_t > > > | fDacCache |
| vector for all ROCs | |
| TDirectory * | fDirectory |
| where the root histograms will end up | |
| std::list< TH1 * > | fHistList |
| list of histograms available in PixTab::next and PixTab::previous | |
| std::map< TH1 *, std::string > | fHistOptions |
| options can be stored with each histogram | |
| std::list< TH1 * >::iterator | fDisplayedHist |
| pointer to the histogram currently displayed | |
|
std::vector< std::pair< int, int > > | fPIX |
| range of enabled pixels for time-consuming tests | |
| std::map< int, int > | fId2Idx |
| map the ROC ID onto the (results vector) index of the ROC | |
| TTree * | fTree |
| TreeEvent | fTreeEvent |
| TTimeStamp * | fTimeStamp |
| bool | fProblem |
|
std::vector< std::pair < std::string, uint8_t > > | fPg_setup |
|
std::vector< std::vector < std::pair< int, int > > > | fHotPixels |
Base class for all tests. If you write a test for pxar, it should inherit from this class.
Provides common utilities
Definition at line 65 of file PixTest.hh.
| vector< pair< int, int > > PixTest::checkHotPixels | ( | TH2D * | h | ) |
Calculate average number of hits per pixel, and if this average is above a certain threshold, then look if there are any pixels which are a margin of safety above the average, and then mask these pixels and add them to the mask list.
Definition at line 1636 of file PixTest.cc.
| vector< TH1 * > PixTest::scurveMaps | ( | std::string | dac, |
| std::string | name, | ||
| int | ntrig = 10, |
||
| int | daclo = 0, |
||
| int | dachi = 255, |
||
| int | dacsperstep = -1, |
||
| int | result = 15, |
||
| int | ihit = 1, |
||
| int | flag = FLAG_FORCE_MASKED |
||
| ) |
returns (mostly) TH2D's with maps of thresholds (plus additional histograms if "result" is set so) dacsperstep: if positive determines the maximum range of DACs to be looped over by pxarCore ihit controls whether a hitmap (ihit == 1) or PH map (ihit == 2) is returned flag allows to pass in other flags result controls the amount of information (histograms) returned: result & 0x1: thr maps result & 0x2: sig maps result & 0x4: noise edge maps result & 0x8: also dump distributions for those maps enabled with 1,2, or 4 result &0x10: dump 'problematic' threshold histogram fits result &0x20: dump all threshold histogram fits
Definition at line 177 of file PixTest.cc.
1.8.6