pxar
 All Classes Namespaces Functions Variables Typedefs Friends
PixTestFullTest.cc
1 #include <stdlib.h> /* atof, atoi */
2 #include <algorithm> // std::find
3 #include <iostream>
4 #include "PixUtil.hh"
5 #include "PixTestFactory.hh"
6 #include "PixTestFullTest.hh"
7 #include "log.h"
8 
9 #include <TH2.h>
10 
11 using namespace std;
12 using namespace pxar;
13 
14 ClassImp(PixTestFullTest)
15 
16 // ----------------------------------------------------------------------
17 PixTestFullTest::PixTestFullTest(PixSetup *a, std::string name) : PixTest(a, name) {
18  PixTest::init();
19  init();
20  LOG(logDEBUG) << "PixTestFullTest ctor(PixSetup &a, string, TGTab *)";
21 }
22 
23 
24 //----------------------------------------------------------
25 PixTestFullTest::PixTestFullTest() : PixTest() {
26  LOG(logDEBUG) << "PixTestFullTest ctor()";
27 }
28 
29 // ----------------------------------------------------------------------
30 bool PixTestFullTest::setParameter(string parName, string /*sval*/) {
31  bool found(false);
32  string stripParName;
33  for (unsigned int i = 0; i < fParameters.size(); ++i) {
34  if (fParameters[i].first == parName) {
35  found = true;
36  if (!parName.compare("deadface")) {
37  // fDeadFace = static_cast<uint16_t>(atoi(sval.c_str()));
38  setToolTips();
39  }
40  break;
41  }
42  }
43  return found;
44 }
45 
46 
47 // ----------------------------------------------------------------------
48 void PixTestFullTest::init() {
49  LOG(logDEBUG) << "PixTestFullTest::init()";
50 
51  setToolTips();
52  fDirectory = gFile->GetDirectory(fName.c_str());
53  if (!fDirectory) {
54  fDirectory = gFile->mkdir(fName.c_str());
55  }
56  fDirectory->cd();
57 
58 }
59 
60 // ----------------------------------------------------------------------
62  fTestTip = string("run the complete FullTest")
63  ;
64  fSummaryTip = string("to be implemented")
65  ;
66 }
67 
68 
69 // ----------------------------------------------------------------------
70 void PixTestFullTest::bookHist(string name) {
71  LOG(logDEBUG) << "nothing done with " << name;
72  fDirectory->cd();
73 }
74 
75 
76 //----------------------------------------------------------
77 PixTestFullTest::~PixTestFullTest() {
78  LOG(logDEBUG) << "PixTestFullTest dtor";
79 }
80 
81 
82 // ----------------------------------------------------------------------
84 
85  bigBanner(Form("PixTestFullTest::doTest()"));
86 
87  vector<string> suite;
88  suite.push_back("alive");
89  suite.push_back("bb");
90  suite.push_back("scurves");
91  suite.push_back("trim");
92  suite.push_back("phoptimization");
93  suite.push_back("gainpedestal");
94 
95  PixTest *t(0);
96 
97  string trimvcal("");
98  PixTestFactory *factory = PixTestFactory::instance();
99  for (unsigned int i = 0; i < suite.size(); ++i) {
100  t = factory->createTest(suite[i], fPixSetup);
101 
102  if (!suite[i].compare("trim")) {
103  trimvcal = t->getParameter("vcal");
104  fPixSetup->getConfigParameters()->setTrimVcalSuffix(trimvcal, true);
105  }
106 
107  t->fullTest();
108 
109  delete t;
110  }
111 
112 }
113 
114 
void setToolTips()
implement this to provide updated tool tips if the user changes test parameters
PixSetup * fPixSetup
all necessary stuff in one place
Definition: PixTest.hh:290
virtual void fullTest()
function called when FullTest is running; most often this is simply calling doTest() ...
Definition: PixTest.cc:607
std::vector< std::pair< std::string, std::string > > fParameters
the parameters of this test
Definition: PixTest.hh:302
void doTest()
function connected to "DoTest" button of PixTab
TDirectory * fDirectory
where the root histograms will end up
Definition: PixTest.hh:306
bool getParameter(std::string parName, int &)
return by reference the INT value of a parameter
Definition: PixTest.cc:450
virtual bool setParameter(std::string parName, std::string sval)
set the string value of a parameter
void init()
sets all test parameters
Definition: PixTest.cc:62