7 #include "PixTestDacScanPix.hh"
17 :
PixTest(a, name), fParNtrig(-1), fParDAC("nada"),
18 fParLoDAC(-1), fParHiDAC(-1)
25 PixTestDacScanPix::PixTestDacScanPix() :
PixTest()
34 for( uint32_t i = 0; i <
fParameters.size(); ++i ) {
40 sval.erase(
remove( sval.begin(), sval.end(),
' '), sval.end() );
42 if( !parName.compare(
"ntrig") ) {
43 fParNtrig = atoi(sval.c_str() );
44 LOG(logDEBUG) <<
" setting fParNtrig ->" << fParNtrig
45 <<
"<- from sval = " << sval;
48 if( !parName.compare(
"dac") ) {
50 LOG(logDEBUG) <<
" setting fParDAC ->" << fParDAC
51 <<
"<- from sval = " << sval;
54 if( !parName.compare(
"daclo") ) {
55 fParLoDAC = atoi(sval.c_str() );
56 LOG(logDEBUG) <<
" setting fParLoDAC ->" << fParLoDAC
57 <<
"<- from sval = " << sval;
60 if( !parName.compare(
"dachi") ) {
61 fParHiDAC = atoi(sval.c_str() );
62 LOG(logDEBUG) <<
" setting fParHiDAC ->" << fParHiDAC
63 <<
"<- from sval = " << sval;
69 if( !parName.compare(
"pix1") ) {
71 if( string::npos != s1) {
72 str1 = sval.substr(0, s1);
73 pixc = atoi(str1.c_str() );
74 str2 = sval.substr(s1+1);
75 pixr = atoi(str2.c_str() );
76 fPIX.push_back( make_pair(pixc, pixr) );
79 fPIX.push_back(make_pair(-1, -1) );
90 void PixTestDacScanPix::init()
93 fDirectory = gFile->GetDirectory( fName.c_str() );
102 string( Form(
"scan DAC %s, count pixel responses\n", fParDAC.c_str() ) )
104 fSummaryTip = string(
"summary plot to be implemented")
109 void PixTestDacScanPix::bookHist(
string name)
111 LOG(logDEBUG) <<
"nothing done with " << name;
115 PixTestDacScanPix::~PixTestDacScanPix()
126 LOG(logINFO) <<
"PixTestDacScanPix::doTest() DAC = " << fParDAC;
131 LOG(logINFO) <<
"ERROR: " << fParDAC <<
" is not a ROC register";
135 if( fParHiDAC > maxDac ) {
136 LOG(logINFO) << fParDAC <<
" range only " << maxDac;
140 LOG(logINFO) <<
"PixTestDacScanPix::doTest() ntrig = " << fParNtrig;
145 int32_t col =
fPIX[
fPIX.size()-1].first;
146 int32_t row =
fPIX[
fPIX.size()-1].second;
153 vector< pair< uint8_t, vector<pixel> > >
162 uint32_t nRocs =
fPixSetup->getConfigParameters()->getNrocs();
164 for( uint32_t roc = 0; roc < nRocs; ++roc ) {
166 h1 =
new TH1D( Form(
"Readouts_vs_%s_c%d_r%d_C%d",
167 fParDAC.c_str(), col, row, roc ),
168 Form(
"Readouts vs %s c%d r%d C%d",
169 fParDAC.c_str(), col, row, roc ),
173 setTitles( h1, Form(
"%s [DAC]", fParDAC.c_str() ),
"readouts" );
181 for(
unsigned int i = 0; i < result.size(); ++i ) {
183 int idac = result[i].first;
185 vector<pixel> vpix = result[i].second;
187 for(
size_t ipx = 0; ipx < vpix.size(); ++ipx ) {
189 uint8_t roc = vpix[ipx].roc();
192 vpix[ipx].column() == col &&
193 vpix[ipx].row() == row ) {
195 h1->Fill( idac, vpix[ipx].value());
202 for(
size_t roc = 0; roc < nRocs; ++roc ) {
void setToolTips()
implement this to provide updated tool tips if the user changes test parameters
PixSetup * fPixSetup
all necessary stuff in one place
void doTest()
function connected to "DoTest" button of PixTab
virtual bool setParameter(std::string parName, std::string sval)
set the string value of a parameter
uint8_t getDACRange(std::string dacName)
std::vector< std::pair< int, int > > fPIX
range of enabled pixels for time-consuming tests
void testPixel(uint8_t column, uint8_t row, bool enable)
std::vector< std::pair< std::string, std::string > > fParameters
the parameters of this test
TDirectory * fDirectory
where the root histograms will end up
std::vector< std::pair< uint8_t, std::vector< pixel > > > getEfficiencyVsDAC(std::string dacName, uint8_t dacMin, uint8_t dacMax, uint16_t flags, uint16_t nTriggers)
void testAllPixels(bool enable)
std::list< TH1 * >::iterator fDisplayedHist
pointer to the histogram currently displayed
std::list< TH1 * > fHistList
list of histograms available in PixTab::next and PixTab::previous
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 update()
signal to PixTab to update the canvas
pxar::pxarCore * fApi
pointer to the API
void init()
sets all test parameters