20 #include <TDirectory.h>
55 error() <<
"Couldn't get THistSvc" <<
endmsg;
62 error() <<
"Couldn't register TempHist1" <<
endmsg;
65 std::unique_ptr<TH1F> h1a = std::make_unique<TH1F>(
"TempHist1a",
"Temporary Tree 1a", 100, 0., 100. );
67 error() <<
"Couldn't register TempHist1a" <<
endmsg;
77 error() <<
"Couldn't register gauss1d" <<
endmsg;
81 std::unique_ptr<TH2F> h3a = std::make_unique<TH2F>(
"2Dgauss",
"2D Gaussian", 100, -50., 50., 100, -50, 50 );
83 error() <<
"Couldn't register gauss2d" <<
endmsg;
88 std::make_unique<TH3F>(
"3Dgauss",
"3D Gaussian", 100, -50., 50., 100, -50, 50, 100, -50, 50 );
90 error() <<
"Couldn't register gauss3d" <<
endmsg;
93 TH1F* h5 =
new TH1F(
"TempHist5",
"Temporary Tree 5", 100, 0., 100. );
95 error() <<
"Couldn't register TempHist5" <<
endmsg;
97 if ( strcmp( h5->GetName(),
"TempHist5" ) ) {
98 error() <<
"Couldn't use TempHist5 afterwards. getName = " << h5->GetName() <<
endmsg;
101 TH1D* h7 =
new TH1D(
"TempHist7",
"Temporary Tree 7", 100, 0., 100. );
103 if ( strcmp( h7->GetName(),
"TempHist7" ) ) {
104 error() <<
"Couldn't use TempHist7 afterwards. getName = " << h7->GetName() <<
endmsg;
114 error() <<
"Couldn't register tr" <<
endmsg;
118 std::unique_ptr<TH1F> h3s = std::make_unique<TH1F>(
"1Dgauss_shared",
"1D Gaussian", 100, -50., 50. );
121 error() <<
"Couldn't register gauss1d_shared" <<
endmsg;
125 std::unique_ptr<TH2F> h3sa = std::make_unique<TH2F>(
"2Dgauss_shared",
"2D Gaussian", 100, -50., 50., 100, -50, 50 );
128 error() <<
"Couldn't register gauss2d_shared" <<
endmsg;
133 std::make_unique<TH3F>(
"3Dgauss_shared",
"3D Gaussian", 100, -50., 50., 100, -50, 50, 100, -50, 50 );
136 error() <<
"Couldn't register gauss3d_shared" <<
endmsg;
150 double x = sin(
double(
n ) ) * 52. + 50.;
156 error() <<
"Couldn't retrieve TempHist 1" <<
endmsg;
162 error() <<
"Couldn't retrieve TempHist 1a" <<
endmsg;
168 error() <<
"Couldn't retrieve Tree2" <<
endmsg;
172 for (
int i = 0; i < 1000; ++i ) {
h->Fill(
gauss(), 1. ); }
174 error() <<
"Couldn't retrieve 1Dgauss" <<
endmsg;
179 for (
int i = 0; i < 1000; ++i ) { h2->Fill(
gauss(),
gauss(), 1. ); }
181 error() <<
"Couldn't retrieve 2Dgauss" <<
endmsg;
186 for (
int i = 0; i < 1000; ++i ) { h3->Fill(
gauss(),
gauss(),
gauss(), 1. ); }
188 error() <<
"Couldn't retrieve 3Dgauss" <<
endmsg;
194 error() <<
"Couldn't retrieve TempHist 5" <<
endmsg;
199 for (
int i = 0; i < 1000; ++i ) { lh1->Fill(
gauss(), 1. ); }
201 error() <<
"Couldn't retrieve 1Dgauss_shared" <<
endmsg;
206 for (
int i = 0; i < 1000; ++i ) { lh2->Fill(
gauss(),
gauss(), 1. ); }
208 error() <<
"Couldn't retrieve 2Dgauss_shared" <<
endmsg;
213 for (
int i = 0; i < 1000; ++i ) { lh3->Fill(
gauss(),
gauss(),
gauss(), 1. ); }
215 error() <<
"Couldn't retrieve 3Dgauss_shared" <<
endmsg;
218 TTree* tr(
nullptr );
220 error() <<
"Couldn't retrieve tree tree1" <<
endmsg;
224 tr->Branch(
"branch1", &
p1,
"point1/I" );
225 tr->Branch(
"branch2", &
p2,
"point2/I" );
226 tr->Branch(
"branch3", &p3,
"point3/I" );
228 for (
int i = 0; i < 1000; i++ ) {
246 info() <<
"printing keys for: " << td->GetPath() <<
" (" << td->GetList()->GetSize() <<
")" <<
endmsg;
247 TIter nextkey( td->GetList() );
248 while ( TKey*
key = (TKey*)nextkey() ) {
250 info() <<
key->GetName() <<
" (" <<
key->IsA()->GetName()
256 info() <<
"key == 0" <<
endmsg;
267 info() <<
"Finalizing..." <<
endmsg;