7 #include "PixTestMapThr.hh"
17 :
PixTest(a, name), fParNtrig(-1)
21 LOG(logDEBUG) <<
"PixTestMapThr ctor(PixSetup &a, string, TGTab *)";
25 PixTestMapThr::PixTestMapThr() :
PixTest()
27 LOG(logDEBUG) <<
"PixTestMapThr ctor()";
35 for( uint32_t i = 0; i <
fParameters.size(); ++i ) {
41 if( !parName.compare(
"ntrig" ) )
42 fParNtrig = atoi( sval.c_str() );
51 void PixTestMapThr::init()
53 LOG(logDEBUG) <<
"PixTestMapThr::init()";
55 fDirectory = gFile->GetDirectory( fName.c_str() );
65 fTestTip = string(
"measure threshold map");
66 fSummaryTip = string(
"summary plot to be implemented");
70 void PixTestMapThr::bookHist(
string name)
72 LOG(logDEBUG) <<
"nothing done with " << name;
76 PixTestMapThr::~PixTestMapThr()
78 LOG(logDEBUG) <<
"PixTestMapThr dtor";
79 std::list<TH1*>::iterator il;
82 LOG(logINFO) <<
"Write out " << (*il)->GetName();
91 LOG(logINFO) <<
"PixTestMapThr::doTest() ntrig = " << fParNtrig;
98 LOG(logERROR) <<
"PixTestMapThr::doTest: no fApi ?!? quit";
106 uint16_t flags = FLAG_RISING_EDGE;
110 LOG(logINFO) <<
"vpix.size() " << vpix.size();
119 size_t nRocs =
fPixSetup->getConfigParameters()->getNrocs();
121 for(
size_t roc = 0; roc < nRocs; ++roc ) {
123 h2 =
new TH2D( Form(
"MapThr_C%d",
int(roc) ),
124 Form(
"Threshold map ROC %d",
int(roc) ),
125 52, -0.5, 51.5, 80, -0.5, 79.5 );
129 h2->GetZaxis()->SetTitle(
"Vcal threshold [DAC]" );
134 h1 =
new TH1D( Form(
"ThrDistribution_C%d",
int(roc) ),
135 Form(
"Threshold distribution ROC %d",
int(roc) ),
137 setTitles( h1,
"Vcal threshold [DAC]",
"pixels" );
146 for(
size_t ipx = 0; ipx < vpix.size(); ++ipx ) {
147 h2 = maps.at(vpix[ipx].roc());
148 if( h2 ) h2->Fill( vpix[ipx].column(), vpix[ipx].row(), vpix[ipx].value());
149 h1 = hsts.at(vpix[ipx].roc());
150 if( h1 ) h1->Fill( vpix[ipx].value());
153 for(
size_t roc = 0; roc < nRocs; ++roc ) {
160 LOG(logINFO) <<
"PixTestMapThr::doTest() done for " << maps.size() <<
" ROCs";
PixSetup * fPixSetup
all necessary stuff in one place
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< pixel > getThresholdMap(std::string dacName, uint8_t dacStep, 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
virtual bool setParameter(std::string parName, std::string sval)
set the string value of a parameter
void doTest()
function connected to "DoTest" button of PixTab
void update()
signal to PixTab to update the canvas
pxar::pxarCore * fApi
pointer to the API
void init()
sets all test parameters
void setToolTips()
implement this to provide updated tool tips if the user changes test parameters