10 #include "PixTestCurrentVsDac.hh"
20 :
PixTest(a, name), fParDAC("nada")
27 PixTestCurrentVsDac::PixTestCurrentVsDac() :
PixTest()
37 std::transform(parName.begin(), parName.end(), parName.begin(), ::tolower);
38 for (
unsigned int i = 0; i <
fParameters.size(); ++i) {
41 sval.erase(
remove(sval.begin(), sval.end(),
' '), sval.end());
42 if( !parName.compare(
"dac" ) ) {
55 void PixTestCurrentVsDac::init()
57 fDirectory = gFile->GetDirectory( fName.c_str() );
64 void PixTestCurrentVsDac::bookHist(
string name)
70 for( uint32_t i = 0; i <
fPixSetup->getConfigParameters()->getNrocs(); ++i ) {
72 h1 =
new TH1D( Form(
"Ia_vs_%s_C%d", name.c_str(), i),
73 Form(
"Ia vs %s C%d", name.c_str(), i),
77 setTitles( h1, Form(
"%s [DAC]", name.c_str() ),
"analog current [mA]" );
80 h1 =
new TH1D( Form(
"Id_vs_%s_C%d", name.c_str(), i),
81 Form(
"Id vs %s C%d", name.c_str(), i),
85 setTitles( h1, Form(
"%s [DAC]", name.c_str() ),
"digital current [mA]" );
91 PixTestCurrentVsDac::~PixTestCurrentVsDac()
93 LOG(logDEBUG) <<
"PixTestCurrentVsDac dtor";
94 std::list<TH1*>::iterator il;
97 LOG(logDEBUG) <<
"Write out " << (*il)->GetName();
108 LOG(logINFO) <<
"PixTestCurrentVsDac::doTest() DAC = " << fParDAC;
117 for( uint32_t roc = 0; roc <
fPixSetup->getConfigParameters()->getNrocs(); ++roc ) {
119 hia = (TH1D*)
fDirectory->Get( Form(
"Ia_vs_%s_C%d", fParDAC.c_str(), roc ) );
120 hid = (TH1D*)
fDirectory->Get( Form(
"Id_vs_%s_C%d", fParDAC.c_str(), roc ) );
130 for(
int idac = 0; idac <= dacmax; ++idac ) {
141 LOG(logINFO) <<
"XX did not find "
142 << Form(
"Ia_vs_%s_C%d", fParDAC.c_str(), roc );
145 if( hid ) hid->Draw();
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)
virtual bool setParameter(std::string parName, std::string sval)
set the string value of a parameter
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
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
virtual void setToolTips()
implement this to provide updated tool tips if the user changes test parameters
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
void doTest()
function connected to "DoTest" button of PixTab