7 #include <TStopwatch.h>
9 #include "PixTestDacScanCurrent.hh"
19 :
PixTest(a, name), fParDAC("nada")
26 PixTestDacScanCurrent::PixTestDacScanCurrent() :
PixTest()
35 for( uint32_t i = 0; i <
fParameters.size(); ++i ) {
41 sval.erase(
remove( sval.begin(), sval.end(),
' ' ), sval.end() );
43 if( !parName.compare(
"dac" ) ) {
45 LOG(logDEBUG) <<
"PixTestDacScanCurrent setting fParDAC ->" << fParDAC
46 <<
"<- from sval = " << sval;
55 void PixTestDacScanCurrent::init()
57 fDirectory = gFile->GetDirectory( fName.c_str() );
66 fTestTip = string(
"measure ROC currents vs DAC");
67 fSummaryTip = string(
"summary plot to be implemented");
71 void PixTestDacScanCurrent::bookHist(
string name)
79 for( uint32_t i = 0; i <
fPixSetup->getConfigParameters()->getNrocs(); ++i ) {
81 h1 =
new TH1D( Form(
"Ia_vs_%s_C%d", name.c_str(), i),
82 Form(
"Ia vs %s C%d", name.c_str(), i),
86 setTitles( h1, Form(
"%s [DAC]", name.c_str() ),
"analog current [mA]" );
89 h1 =
new TH1D( Form(
"Id_vs_%s_C%d", name.c_str(), i),
90 Form(
"Id vs %s C%d", name.c_str(), i),
94 setTitles( h1, Form(
"%s [DAC]", name.c_str() ),
"digital current [mA]" );
100 PixTestDacScanCurrent::~PixTestDacScanCurrent()
102 LOG(logDEBUG) <<
"PixTestDacScanCurrent dtor";
103 std::list<TH1*>::iterator il;
106 LOG(logDEBUG) <<
"Write out " << (*il)->GetName();
118 LOG(logINFO) <<
"PixTestDacScanCurrent::doTest() DAC = " << fParDAC;
123 LOG(logINFO) <<
"ERROR: " << fParDAC <<
" is not a ROC register";
135 size_t nRocs =
fPixSetup->getConfigParameters()->getNrocs();
137 for( uint32_t roc = 0; roc < nRocs; ++roc ) {
139 hia = (TH1D*)
fDirectory->Get( Form(
"Ia_vs_%s_C%d", fParDAC.c_str(), roc ) );
140 hid = (TH1D*)
fDirectory->Get( Form(
"Id_vs_%s_C%d", fParDAC.c_str(), roc ) );
157 while( sw.RealTime() < 0.1 );
161 for( uint32_t idac = 0; idac <= maxDac; ++idac ) {
173 LOG(logINFO) <<
"XX did not find "
174 << Form(
"Ia_vs_%s_C%d", fParDAC.c_str(), roc );
177 if( hid ) hid->Draw();
void doTest()
function connected to "DoTest" button of PixTab
bool setDAC(std::string dacName, uint8_t dacValue, uint8_t rocI2C)
PixSetup * fPixSetup
all necessary stuff in one place
uint8_t getDACRange(std::string dacName)
std::vector< std::pair< std::string, std::string > > fParameters
the parameters of this test
TDirectory * fDirectory
where the root histograms will end up
void testAllPixels(bool enable)
std::list< TH1 * >::iterator fDisplayedHist
pointer to the histogram currently displayed
void setToolTips()
implement this to provide updated tool tips if the user changes test parameters
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
uint8_t getDAC(size_t rocId, std::string dacName)
pxar::pxarCore * fApi
pointer to the API
void init()
sets all test parameters
virtual bool setParameter(std::string parName, std::string sval)
set the string value of a parameter