20 #include "TDirectory.h"
56 error() <<
"Couldn't get THistSvc" <<
endmsg;
63 error() <<
"Couldn't register TempHist1" <<
endmsg;
66 std::unique_ptr<TH1F> h1a = std::make_unique<TH1F>(
"TempHist1a",
"Temporary Tree 1a", 100, 0., 100. );
68 error() <<
"Couldn't register TempHist1a" <<
endmsg;
78 error() <<
"Couldn't register gauss1d" <<
endmsg;
82 std::unique_ptr<TH2F> h3a = std::make_unique<TH2F>(
"2Dgauss",
"2D Gaussian", 100, -50., 50., 100, -50, 50 );
84 error() <<
"Couldn't register gauss2d" <<
endmsg;
89 std::make_unique<TH3F>(
"3Dgauss",
"3D Gaussian", 100, -50., 50., 100, -50, 50, 100, -50, 50 );
91 error() <<
"Couldn't register gauss3d" <<
endmsg;
94 TH1F* h5 =
new TH1F(
"TempHist5",
"Temporary Tree 5", 100, 0., 100. );
96 error() <<
"Couldn't register TempHist5" <<
endmsg;
98 if ( strcmp( h5->GetName(),
"TempHist5" ) ) {
99 error() <<
"Couldn't use TempHist5 afterwards. getName = " << h5->GetName() <<
endmsg;
102 TH1D* h6 =
new TH1D(
"TempHist6",
"Temporary Tree 6", 100, 0., 100. );
104 error() <<
"Couldn't register TempHist6" <<
endmsg;
106 if ( strcmp( h6->GetName(),
"TempHist6" ) ) {
107 error() <<
"Couldn't use TempHist6 afterwards. getName = " << h6->GetName() <<
endmsg;
110 TH1D* h7 =
new TH1D(
"TempHist7",
"Temporary Tree 7", 100, 0., 100. );
112 if ( strcmp( h7->GetName(),
"TempHist7" ) ) {
113 error() <<
"Couldn't use TempHist7 afterwards. getName = " << h7->GetName() <<
endmsg;
123 error() <<
"Couldn't register tr" <<
endmsg;
127 std::unique_ptr<TH1F> h3s = std::make_unique<TH1F>(
"1Dgauss_shared",
"1D Gaussian", 100, -50., 50. );
130 error() <<
"Couldn't register gauss1d_shared" <<
endmsg;
134 std::unique_ptr<TH2F> h3sa = std::make_unique<TH2F>(
"2Dgauss_shared",
"2D Gaussian", 100, -50., 50., 100, -50, 50 );
137 error() <<
"Couldn't register gauss2d_shared" <<
endmsg;
142 std::make_unique<TH3F>(
"3Dgauss_shared",
"3D Gaussian", 100, -50., 50., 100, -50, 50, 100, -50, 50 );
145 error() <<
"Couldn't register gauss3d_shared" <<
endmsg;
159 double x = sin(
double(
n ) ) * 52. + 50.;
165 error() <<
"Couldn't retrieve TempHist 1" <<
endmsg;
171 error() <<
"Couldn't retrieve TempHist 1a" <<
endmsg;
177 error() <<
"Couldn't retrieve Tree2" <<
endmsg;
181 for (
int i = 0; i < 1000; ++i ) {
h->Fill(
gauss(), 1. ); }
183 error() <<
"Couldn't retrieve 1Dgauss" <<
endmsg;
188 for (
int i = 0; i < 1000; ++i ) { h2->Fill(
gauss(),
gauss(), 1. ); }
190 error() <<
"Couldn't retrieve 2Dgauss" <<
endmsg;
195 for (
int i = 0; i < 1000; ++i ) { h3->Fill(
gauss(),
gauss(),
gauss(), 1. ); }
197 error() <<
"Couldn't retrieve 3Dgauss" <<
endmsg;
203 error() <<
"Couldn't retrieve TempHist 5" <<
endmsg;
209 error() <<
"Couldn't retrieve TempHist 6" <<
endmsg;
214 for (
int i = 0; i < 1000; ++i ) { lh1->Fill(
gauss(), 1. ); }
216 error() <<
"Couldn't retrieve 1Dgauss_shared" <<
endmsg;
221 for (
int i = 0; i < 1000; ++i ) { lh2->Fill(
gauss(),
gauss(), 1. ); }
223 error() <<
"Couldn't retrieve 2Dgauss_shared" <<
endmsg;
228 for (
int i = 0; i < 1000; ++i ) { lh3->Fill(
gauss(),
gauss(),
gauss(), 1. ); }
230 error() <<
"Couldn't retrieve 3Dgauss_shared" <<
endmsg;
233 TTree* tr(
nullptr );
235 error() <<
"Couldn't retrieve tree tree1" <<
endmsg;
239 tr->Branch(
"branch1", &
p1,
"point1/I" );
240 tr->Branch(
"branch2", &
p2,
"point2/I" );
241 tr->Branch(
"branch3", &p3,
"point3/I" );
243 for (
int i = 0; i < 1000; i++ ) {
261 info() <<
"printing keys for: " << td->GetPath() <<
" (" << td->GetList()->GetSize() <<
")" <<
endmsg;
262 TIter nextkey( td->GetList() );
263 while ( TKey*
key = (TKey*)nextkey() ) {
265 info() <<
key->GetName() <<
" (" <<
key->IsA()->GetName()
271 info() <<
"key == 0" <<
endmsg;
282 info() <<
"Finalizing..." <<
endmsg;
285 error() <<
"Failed to deregister histogram TempHist6" <<
endmsg;