7 #include "PixTestMap.hh"
17 PixTest(a, name), fParNtrig(-1), fParVcal(-1)
21 LOG(logDEBUG) <<
"PixTestMap ctor(PixSetup &a, string, TGTab *)";
25 PixTestMap::PixTestMap() :
PixTest()
27 LOG(logDEBUG) <<
"PixTestMap ctor()";
35 for( uint32_t i = 0; i <
fParameters.size(); ++i ) {
41 if( !parName.compare(
"ntrig") ) {
42 fParNtrig = atoi(sval.c_str() );
46 if( !parName.compare(
"vcal") ) {
47 fParVcal = atoi(sval.c_str() );
57 void PixTestMap::init()
59 LOG(logDEBUG) <<
"PixTestMap::init()";
62 fDirectory = gFile->GetDirectory(fName.c_str() );
73 string(
"send Ntrig pulses to each pixel and count readouts\n")
74 + string(
"the result is a hitmap, not an efficiency map")
77 string(
"all ROCs are displayed side-by-side. Note the orientation:\n")
78 + string(
"the canvas bottom corresponds to the narrow module side with the cable")
83 void PixTestMap::bookHist(
string name)
86 LOG(logDEBUG) <<
"nothing done with " << name;
90 PixTestMap::~PixTestMap()
92 LOG(logDEBUG) <<
"PixTestMap dtor";
99 LOG(logINFO) <<
"PixTestMap::doTest() ntrig = " << fParNtrig;
106 copy( test2.begin(), test2.end(), back_inserter(
fHistList) );
110 TH1D *halive =
new TH1D(
"MapCount",
111 "Map pixels per ROC;ROC;alive pixels",
114 halive->SetMinimum(0);
115 halive->SetMaximum(4200);
118 TH1D *hperfect =
new TH1D(
"PerfectCount",
119 "Perfect pixels per ROC;ROC;perfect pixels",
121 hperfect->SetStats(0);
122 hperfect->SetMinimum(0);
123 hperfect->SetMaximum(4200);
126 TH1D *hdead =
new TH1D(
"DeadCount",
127 "Dead pixels per ROC;ROC;dead pixels",
130 hdead->SetMinimum(0);
131 hdead->SetMaximum(4200);
136 for(
size_t roc = 0; roc < test2.size(); ++roc ) {
146 for(
int ix = 0; ix < h2->GetNbinsX(); ++ix ) {
147 for(
int iy = 0; iy < h2->GetNbinsY(); ++iy ) {
148 int nn = int( h2->GetBinContent( ix+1, iy+1 ) + 0.1 );
149 if( nn == 0 ) dead++;
150 if( nn >= fParNtrig/2 ) alive++;
151 if( nn == fParNtrig ) perfect++;
155 LOG(logINFO) <<
"ROC " << setw(2) << roc
156 <<
" dead " << setw(4) << dead
157 <<
", alive " << setw(4) << alive
158 <<
", perfect " << setw(4) << perfect;
160 hdead->Fill( roc, dead );
161 halive->Fill( roc, alive );
162 hperfect->Fill( roc, perfect );
175 LOG(logINFO) <<
"PixTestMap::doTest() done";
std::vector< TH2D * > efficiencyMaps(std::string name, uint16_t ntrig=10, uint16_t FLAGS=FLAG_FORCE_MASKED)
returns TH2D's with hit maps
void setToolTips()
implement this to provide updated tool tips if the user changes test parameters
void doTest()
function connected to "DoTest" button of PixTab
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
virtual bool setParameter(std::string parName, std::string sval)
set the string value of a parameter
void update()
signal to PixTab to update the canvas
pxar::pxarCore * fApi
pointer to the API
void init()
sets all test parameters