7 #include "PixTestMapPh.hh"
18 :
PixTest(a, name), fParNtrig(-1), fParCals(0)
22 LOG(logDEBUG) <<
"PixTestMapPh ctor(PixSetup &a, string, TGTab *)";
26 PixTestMapPh::PixTestMapPh() :
PixTest()
28 LOG(logDEBUG) <<
"PixTestMapPh ctor()";
36 for( uint32_t i = 0; i <
fParameters.size(); ++i ) {
42 if( !parName.compare(
"ntrig" ) )
43 fParNtrig = atoi( sval.c_str() );
45 if( !parName.compare(
"cals" ) )
46 fParCals = atoi( sval.c_str() );
55 void PixTestMapPh::init()
57 LOG(logDEBUG) <<
"PixTestMapPh::init()";
59 fDirectory = gFile->GetDirectory( fName.c_str() );
69 fTestTip = string(
"measure pulse height map");
70 fSummaryTip = string(
"summary plot to be implemented");
74 void PixTestMapPh::bookHist(
string name)
76 LOG(logDEBUG) <<
"nothing done with " << name;
80 PixTestMapPh::~PixTestMapPh()
82 LOG(logDEBUG) <<
"PixTestMapPh dtor";
83 std::list<TH1*>::iterator il;
86 LOG(logINFO) <<
"Write out " << (*il)->GetName();
95 LOG(logINFO) <<
"PixTestMapPh::doTest() ntrig = " << fParNtrig;
106 if( fParCals ) flags = FLAG_CALS;
107 LOG(logINFO) <<
"flag " << flags;
112 LOG(logINFO) <<
"CtrlReg 4 (large Vcal)";
120 LOG(logINFO) <<
"back to CtrlReg " << ctl;
123 LOG(logINFO) <<
"vpix.size() " << vpix.size();
132 size_t nRocs =
fPixSetup->getConfigParameters()->getNrocs();
134 for(
size_t roc = 0; roc < nRocs; ++roc ) {
136 h2 =
new TH2D( Form(
"MapPh_C%d",
int(roc) ),
137 Form(
"PH map ROC %d",
int(roc) ),
138 52, -0.5, 51.5, 80, -0.5, 79.5 );
142 h2->GetZaxis()->SetTitle(
"<PH> [ADC]" );
147 h1 =
new TH1D( Form(
"PhDistribution_C%d",
int(roc) ),
148 Form(
"Pulse height distribution ROC %d",
int(roc) ),
158 for(
size_t ipx = 0; ipx < vpix.size(); ++ipx ) {
159 h2 = maps.at(vpix[ipx].roc());
160 if( h2 ) h2->Fill( vpix[ipx].column(), vpix[ipx].row(), vpix[ipx].value());
161 h1 = hsts.at(vpix[ipx].roc());
162 if( h1 ) h1->Fill( vpix[ipx].value());
165 for(
size_t roc = 0; roc < nRocs; ++roc ) {
172 LOG(logINFO) <<
"PixTestMapPh::doTest() done for " << maps.size() <<
" ROCs";
std::vector< pixel > getPulseheightMap(uint16_t flags, uint16_t nTriggers)
bool setDAC(std::string dacName, uint8_t dacValue, uint8_t rocI2C)
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
void doTest()
function connected to "DoTest" button of PixTab
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 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)
virtual bool setParameter(std::string parName, std::string sval)
set the string value of a parameter
pxar::pxarCore * fApi
pointer to the API
void init()
sets all test parameters