#include <string>
#include <iostream>
#include <fstream>
#include "dunecore/DuneInterface/Tool/HistogramManager.h"
#include "dunecore/ArtSupport/DuneToolManager.h"
#include "TH1F.h"
#include <cassert>
Go to the source code of this file.
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 80 of file test_SimpleHistogramManager.cxx.
81 bool useExistingFcl =
false;
85 cout <<
"Usage: " <<
argv[0] <<
" [ARG]" <<
endl;
86 cout <<
" If ARG = true, existing FCL file is used." <<
endl;
89 useExistingFcl = sarg ==
"true" || sarg ==
"1";
int test_SimpleHistogramManager(bool useExistingFcl=false)
QTextStream & endl(QTextStream &s)
int test_SimpleHistogramManager |
( |
bool |
useExistingFcl = false | ) |
|
Definition at line 26 of file test_SimpleHistogramManager.cxx.
27 const string myname =
"test_SimpleHistogramManager: ";
29 cout << myname <<
"NDEBUG must be off." <<
endl;
32 string line =
"-----------------------------";
34 cout << myname << line <<
endl;
35 string fclfile =
"test_SimpleHistogramManager.fcl";
36 if ( ! useExistingFcl ) {
37 cout << myname <<
"Creating top-level FCL." <<
endl;
38 ofstream
fout(fclfile.c_str());
41 fout <<
" tool_type: SimpleHistogramManager" <<
endl;
47 cout << myname <<
"Using existing top-level FCL." <<
endl;
50 cout << myname << line <<
endl;
51 cout << myname <<
"Fetching tool manager." <<
endl;
53 assert ( ptm !=
nullptr );
58 cout << myname << line <<
endl;
59 cout << myname <<
"Fetching tool." <<
endl;
61 assert( phm !=
nullptr );
63 cout << myname << line <<
endl;
64 cout << myname <<
"Creating histogram." <<
endl;
65 TH1* ph =
new TH1F(
"h1",
"h1", 10, 0, 10);
66 assert(ph->GetDirectory() !=
nullptr);
68 cout << myname << line <<
endl;
69 cout << myname <<
"Managing histogram." <<
endl;
70 assert(phm->manage(ph) == 0);
71 assert(ph->GetDirectory() ==
nullptr);
73 cout << myname << line <<
endl;
74 cout << myname <<
"Done." <<
endl;
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)