11 #include "PixTestSetCalDel.hh" 
   27   for( 
unsigned int i = 0; i < fPIX.size(); ++i) {
 
   28     LOG(logDEBUG) << 
" PixTestSetCalDel setting fPIX" << i
 
   29           <<  
" ->" << fPIX[i].first
 
   30           << 
"/" << fPIX[i].second;
 
   35 PixTestSetCalDel::PixTestSetCalDel() : 
PixTest() {
 
   45   for (
unsigned int i = 0; i < 
fParameters.size(); ++i) {
 
   48       sval.erase( 
remove( sval.begin(), sval.end(), 
' '), sval.end() );
 
   49       if( !parName.compare(
"ntrig") ) {
 
   50     fParNtrig = atoi( sval.c_str() );
 
   51     LOG(logDEBUG) << 
" PixTestSetCalDel setting fParNtrig  ->" << fParNtrig
 
   52               << 
"<- from sval = " << sval;
 
   54       if( !parName.compare(
"pix1") ) {
 
   56     if( string::npos != s1) {
 
   57       str1 = sval.substr(0, s1);
 
   58       pixc = atoi(str1.c_str());
 
   59       str2 = sval.substr(s1+1);
 
   60       pixr = atoi(str2.c_str());
 
   61       fPIX.push_back( make_pair(pixc, pixr) );
 
   64       fPIX.push_back( make_pair(-1, -1) );
 
   75 void PixTestSetCalDel::init()
 
   78   fDirectory = gFile->GetDirectory( fName.c_str() );
 
   88   fTestTip = string( 
"scan and set CalDel using one pixel");
 
   89   fSummaryTip = string(
"summary plot to be implemented");
 
   93 void PixTestSetCalDel::bookHist(
string name) {
 
   99   for( 
unsigned int i = 0; i < 
fPixSetup->getConfigParameters()->getNrocs(); ++i ) {
 
  101     for( 
unsigned int ip = 0; ip < 
fPIX.size(); ++ip ) {
 
  102       h1 = 
new TH1D(Form(
"NhitsVs%s_c%d_r%d_C%d", name.c_str(), 
fPIX[ip].first, 
fPIX[ip].second, i),
 
  103             Form(
"NhitsVs%s_c%d_r%d_C%d", name.c_str(), 
fPIX[ip].first, 
fPIX[ip].second, i),
 
  106       setTitles( h1, Form( 
"%s [DAC]", name.c_str() ), 
"readouts" );
 
  113 PixTestSetCalDel::~PixTestSetCalDel() {
 
  114   LOG(logDEBUG) << 
"PixTestSetCalDel dtor";
 
  121   LOG(logINFO) << 
"PixTestSetCalDel::doTest() ntrig = " << fParNtrig;
 
  126   for( 
unsigned int i = 0; i < 
fPIX.size(); ++i) {
 
  132   string DacName = 
"caldel";
 
  134   vector <pair <uint8_t, vector<pixel> > > results =
 
  137   LOG(logDEBUG) << 
" dacscandata.size(): " << results.size();
 
  145   for( 
unsigned int i = 0; i < results.size(); ++i ) { 
 
  147     pair<uint8_t, vector<pixel> > v = results[i];
 
  148     int caldel = v.first;
 
  150     vector<pixel> vpix = v.second; 
 
  152     for( 
unsigned int ipx = 0; ipx < vpix.size(); ++ipx ) {
 
  154       int roc = vpix.at(ipx).roc();
 
  156       int nn = (int)vpix.at(ipx).value();
 
  165       h = (TH1D*)
fDirectory->Get( Form( 
"NhitsVs%s_c%d_r%d_C%d",
 
  166                     DacName.c_str(), vpix.at(ipx).column(), vpix.at(ipx).row(), roc ) );
 
  169     h->Fill( caldel, nn );
 
  172     LOG(logDEBUG) << 
"XX did not find " 
  173               << Form( 
"NhitsVs%s_c%d_r%d_C%d",
 
  174                    DacName.c_str(), vpix.at(ipx).column(), vpix.at(ipx).row(), roc );
 
  188   for( 
unsigned int roc = 0; roc < 
fPixSetup->getConfigParameters()->getNrocs(); ++roc ) {
 
  190     LOG(logINFO) << 
"ROC " << setw(2) << roc
 
  191          << 
": eff plateau from " << setw(3) << i0[roc]
 
  192          << 
" to " << setw(3) << i9[roc];
 
  194       int i2 = i0[roc] + (i9[roc]-i0[roc])/4;
 
  196       LOG(logINFO) << 
"ROC " << setw(2) << roc
 
  197            << 
": set CalDel to " << i2;
 
bool setDAC(std::string dacName, uint8_t dacValue, uint8_t rocI2C)
PixSetup * fPixSetup
all necessary stuff in one place 
std::vector< std::pair< int, int > > fPIX
range of enabled pixels for time-consuming tests 
void testPixel(uint8_t column, uint8_t row, bool enable)
std::vector< std::pair< std::string, std::string > > fParameters
the parameters of this test 
void setToolTips()
implement this to provide updated tool tips if the user changes test parameters 
TDirectory * fDirectory
where the root histograms will end up 
void doTest()
function connected to "DoTest" button of PixTab 
std::vector< std::pair< uint8_t, std::vector< pixel > > > getEfficiencyVsDAC(std::string dacName, 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 
void update()
signal to PixTab to update the canvas 
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