28 const string myname =
"test_coldelecResponse: ";
29 cout << myname <<
"Starting test" <<
endl;
31 cout << myname <<
"NDEBUG must be off." <<
endl;
34 string line =
"-----------------------------";
37 cout << myname << line <<
endl;
38 cout <<
"Testing TF1." <<
endl;
40 cout << myname << line <<
endl;
41 cout <<
"Build waveforms." <<
endl;
48 for (
double fac : {1.0, 0.8, 0.5} ) {
49 double gain = gain0/fac;
50 double shap = fac*shap0;
51 for (
Index ioff=0; ioff<noff; ++ioff ) {
52 double toff = toff0 + dtoffs[ioff];
58 for ( TF1* pf : pfs ) {
59 double a = pf->Integral(0,30);
61 double arat = a/pf->GetParameter(0)/pf->GetParameter(1);
62 arats.push_back(arat);
65 cout << myname << line <<
endl;
66 cout <<
"Display waveforms." <<
endl;
70 for (
int ipar=0; ipar<pf0->GetNpar(); ++ipar ) {
71 string parName = pf0->GetParName(ipar);
72 cout <<
setw(10) << parName <<
":";
73 for ( TF1* pf : pfs ) cout <<
setw(w) << std::fixed << pf->GetParameter(ipar);
76 for (
double t=0.0;
t<30.0;
t+=1.0 ) {
77 cout <<
setw(10) <<
t <<
":";
78 for ( TF1* pf : pfs ) {
79 double wf = pf->Eval(t);
80 cout <<
setw(w) << std::fixed << wf;
84 cout <<
setw(10) <<
"area" <<
":";
85 for (
double area : areas ) cout <<
setw(w) << std::fixed << area;
88 cout <<
setw(10) <<
"A/h/s" <<
":";
89 for (
double arat : arats ) cout <<
setw(w) << std::fixed << arat;
92 cout << myname << line <<
endl;
93 cout << myname <<
"Done." <<
endl;
Q_EXPORT QTSManip setw(int w)
TF1 * coldelecResponseTF1(double gainIn, double shapingIn, double t0, std::string fname="ceresp")
void line(double t, double *p, double &x, double &y, double &z)
int test_coldelecResponse()
QTextStream & endl(QTextStream &s)