54 if (
m_ths.retrieve().isFailure() ) {
60 std::unique_ptr<TH1F> h1 = std::make_unique<TH1F>(
"TempHist1",
"Temporary Tree 1", 100, 0., 100. );
61 if (
m_ths->regHist(
"TempHist1", std::move( h1 ) ).isFailure() ) {
65 std::unique_ptr<TH1F> h1a = std::make_unique<TH1F>(
"TempHist1a",
"Temporary Tree 1a", 100, 0., 100. );
66 if (
m_ths->regHist(
"other/TempHist1a", std::move( h1a ) ).isFailure() ) {
67 error() <<
"Couldn't register TempHist1a" <<
endmsg;
71 std::unique_ptr<TH1F> h2 = std::make_unique<TH1F>(
"Tree2",
"Tree 2", 100, 0., 100. );
72 if (
m_ths->regHist(
"/new/Tree2", std::move( h2 ) ).isFailure() ) {
error() <<
"Couldn't register Tree2" <<
endmsg; }
75 std::unique_ptr<TH1F> h3 = std::make_unique<TH1F>(
"1Dgauss",
"1D Gaussian", 100, -50., 50. );
76 if (
m_ths->regHist(
"/upd/xxx/gauss1d", std::move( h3 ) ).isFailure() ) {
81 std::unique_ptr<TH2F> h3a = std::make_unique<TH2F>(
"2Dgauss",
"2D Gaussian", 100, -50., 50., 100, -50, 50 );
82 if (
m_ths->regHist(
"/rec/gauss2d", std::move( h3a ) ).isFailure() ) {
87 std::unique_ptr<TH3F> h4 =
88 std::make_unique<TH3F>(
"3Dgauss",
"3D Gaussian", 100, -50., 50., 100, -50, 50, 100, -50, 50 );
89 if (
m_ths->regHist(
"/rec/gauss3d", std::move( h4 ) ).isFailure() ) {
93 TH1F* h5 =
new TH1F(
"TempHist5",
"Temporary Tree 5", 100, 0., 100. );
94 if (
m_ths->regHist(
"TempHist5", std::unique_ptr<TH1F>( h5 ) ).isFailure() ) {
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. );
102 if (
m_ths->regHist(
"TempHist7", h7 ).isFailure() ) {
error() <<
"Couldn't register TempHist7" <<
endmsg; }
103 if ( strcmp( h7->GetName(),
"TempHist7" ) ) {
104 error() <<
"Couldn't use TempHist7 afterwards. getName = " << h7->GetName() <<
endmsg;
108 std::unique_ptr<TH1> tp = std::make_unique<TProfile>(
"profile",
"profile", 100, -50., -50. );
109 if (
m_ths->regHist(
"/rec/prof", std::move( tp ) ).isFailure() ) {
error() <<
"Couldn't register prof" <<
endmsg; }
112 std::unique_ptr<TTree> tr = std::make_unique<TTree>(
"treename",
"tree title" );
113 if (
m_ths->regTree(
"/rec/trees/stuff/tree1", std::move( tr ) ).isFailure() ) {
118 std::unique_ptr<TH1F> h3s = std::make_unique<TH1F>(
"1Dgauss_shared",
"1D Gaussian", 100, -50., 50. );
120 if (
m_ths->regShared(
"/upd/xxx/gauss1d_shared", std::move( h3s ), lh1 ).isFailure() ) {
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 );
127 if (
m_ths->regShared(
"/rec/gauss2d_shared", std::move( h3sa ), lh2 ).isFailure() ) {
128 error() <<
"Couldn't register gauss2d_shared" <<
endmsg;
132 std::unique_ptr<TH3F> h4s =
133 std::make_unique<TH3F>(
"3Dgauss_shared",
"3D Gaussian", 100, -50., 50., 100, -50, 50, 100, -50, 50 );
135 if (
m_ths->regShared(
"/rec/gauss3d_shared", std::move( h4s ), lh3 ).isFailure() ) {
136 error() <<
"Couldn't register gauss3d_shared" <<
endmsg;
150 double x = sin(
double( n ) ) * 52. + 50.;
153 if (
m_ths->getHist(
"TempHist1", h ).isSuccess() ) {
156 error() <<
"Couldn't retrieve TempHist 1" <<
endmsg;
159 if (
m_ths->getHist(
"other/TempHist1a", h ).isSuccess() ) {
162 error() <<
"Couldn't retrieve TempHist 1a" <<
endmsg;
165 if (
m_ths->getHist(
"/new/Tree2", h ).isSuccess() ) {
171 if (
m_ths->getHist(
"/upd/xxx/gauss1d", h ).isSuccess() ) {
172 for (
int i = 0; i < 1000; ++i ) { h->Fill( gauss(), 1. ); }
178 if (
m_ths->getHist(
"/rec/gauss2d", h2 ).isSuccess() ) {
179 for (
int i = 0; i < 1000; ++i ) { h2->Fill( gauss(), gauss(), 1. ); }
185 if (
m_ths->getHist(
"/rec/gauss3d", h3 ).isSuccess() ) {
186 for (
int i = 0; i < 1000; ++i ) { h3->Fill( gauss(), gauss(), gauss(), 1. ); }
191 if (
m_ths->getHist(
"TempHist5", h ).isSuccess() ) {
194 error() <<
"Couldn't retrieve TempHist 5" <<
endmsg;
198 if (
m_ths->getShared(
"/upd/xxx/gauss1d_shared", lh1 ).isSuccess() ) {
199 for (
int i = 0; i < 1000; ++i ) { lh1->Fill( gauss(), 1. ); }
201 error() <<
"Couldn't retrieve 1Dgauss_shared" <<
endmsg;
205 if (
m_ths->getShared(
"/rec/gauss2d_shared", lh2 ).isSuccess() ) {
206 for (
int i = 0; i < 1000; ++i ) { lh2->Fill( gauss(), gauss(), 1. ); }
208 error() <<
"Couldn't retrieve 2Dgauss_shared" <<
endmsg;
212 if (
m_ths->getShared(
"/rec/gauss3d_shared", lh3 ).isSuccess() ) {
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 );
219 if (
m_ths->getTree(
"/rec/trees/stuff/tree1", tr ).isFailure() ) {
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++ ) {