42 if (
m_ths.retrieve().isFailure() ) {
48 std::unique_ptr<TH1F> h1 = std::make_unique<TH1F>(
"TempHist1",
"Temporary Tree 1", 100, 0., 100. );
49 if (
m_ths->regHist(
"TempHist1", std::move( h1 ) ).isFailure() ) {
53 std::unique_ptr<TH1F> h1a = std::make_unique<TH1F>(
"TempHist1a",
"Temporary Tree 1a", 100, 0., 100. );
54 if (
m_ths->regHist(
"other/TempHist1a", std::move( h1a ) ).isFailure() ) {
55 error() <<
"Couldn't register TempHist1a" <<
endmsg;
59 std::unique_ptr<TH1F> h2 = std::make_unique<TH1F>(
"Tree2",
"Tree 2", 100, 0., 100. );
60 if (
m_ths->regHist(
"/new/Tree2", std::move( h2 ) ).isFailure() ) {
error() <<
"Couldn't register Tree2" <<
endmsg; }
63 std::unique_ptr<TH1F> h3 = std::make_unique<TH1F>(
"1Dgauss",
"1D Gaussian", 100, -50., 50. );
64 if (
m_ths->regHist(
"/upd/xxx/gauss1d", std::move( h3 ) ).isFailure() ) {
69 std::unique_ptr<TH2F> h3a = std::make_unique<TH2F>(
"2Dgauss",
"2D Gaussian", 100, -50., 50., 100, -50, 50 );
70 if (
m_ths->regHist(
"/rec/gauss2d", std::move( h3a ) ).isFailure() ) {
75 std::unique_ptr<TH3F> h4 =
76 std::make_unique<TH3F>(
"3Dgauss",
"3D Gaussian", 100, -50., 50., 100, -50, 50, 100, -50, 50 );
77 if (
m_ths->regHist(
"/rec/gauss3d", std::move( h4 ) ).isFailure() ) {
81 TH1F* h5 =
new TH1F(
"TempHist5",
"Temporary Tree 5", 100, 0., 100. );
82 if (
m_ths->regHist(
"TempHist5", std::unique_ptr<TH1F>( h5 ) ).isFailure() ) {
85 if ( strcmp( h5->GetName(),
"TempHist5" ) ) {
86 error() <<
"Couldn't use TempHist5 afterwards. getName = " << h5->GetName() <<
endmsg;
89 TH1D* h7 =
new TH1D(
"TempHist7",
"Temporary Tree 7", 100, 0., 100. );
90 if (
m_ths->regHist(
"TempHist7", h7 ).isFailure() ) {
error() <<
"Couldn't register TempHist7" <<
endmsg; }
91 if ( strcmp( h7->GetName(),
"TempHist7" ) ) {
92 error() <<
"Couldn't use TempHist7 afterwards. getName = " << h7->GetName() <<
endmsg;
96 std::unique_ptr<TH1> tp = std::make_unique<TProfile>(
"profile",
"profile", 100, -50., -50. );
97 if (
m_ths->regHist(
"/rec/prof", std::move( tp ) ).isFailure() ) {
error() <<
"Couldn't register prof" <<
endmsg; }
100 std::unique_ptr<TTree> tr = std::make_unique<TTree>(
"treename",
"tree title" );
101 if (
m_ths->regTree(
"/rec/trees/stuff/tree1", std::move( tr ) ).isFailure() ) {
106 std::unique_ptr<TH1F> h3s = std::make_unique<TH1F>(
"1Dgauss_shared",
"1D Gaussian", 100, -50., 50. );
108 if (
m_ths->regShared(
"/upd/xxx/gauss1d_shared", std::move( h3s ), lh1 ).isFailure() ) {
109 error() <<
"Couldn't register gauss1d_shared" <<
endmsg;
113 std::unique_ptr<TH2F> h3sa = std::make_unique<TH2F>(
"2Dgauss_shared",
"2D Gaussian", 100, -50., 50., 100, -50, 50 );
115 if (
m_ths->regShared(
"/rec/gauss2d_shared", std::move( h3sa ), lh2 ).isFailure() ) {
116 error() <<
"Couldn't register gauss2d_shared" <<
endmsg;
120 std::unique_ptr<TH3F> h4s =
121 std::make_unique<TH3F>(
"3Dgauss_shared",
"3D Gaussian", 100, -50., 50., 100, -50, 50, 100, -50, 50 );
123 if (
m_ths->regShared(
"/rec/gauss3d_shared", std::move( h4s ), lh3 ).isFailure() ) {
124 error() <<
"Couldn't register gauss3d_shared" <<
endmsg;
138 double x = sin(
double( n ) ) * 52. + 50.;
141 if (
m_ths->getHist(
"TempHist1", h ).isSuccess() ) {
144 error() <<
"Couldn't retrieve TempHist 1" <<
endmsg;
147 if (
m_ths->getHist(
"other/TempHist1a", h ).isSuccess() ) {
150 error() <<
"Couldn't retrieve TempHist 1a" <<
endmsg;
153 if (
m_ths->getHist(
"/new/Tree2", h ).isSuccess() ) {
159 if (
m_ths->getHist(
"/upd/xxx/gauss1d", h ).isSuccess() ) {
160 for (
int i = 0; i < 1000; ++i ) { h->Fill( gauss(), 1. ); }
166 if (
m_ths->getHist(
"/rec/gauss2d", h2 ).isSuccess() ) {
167 for (
int i = 0; i < 1000; ++i ) { h2->Fill( gauss(), gauss(), 1. ); }
173 if (
m_ths->getHist(
"/rec/gauss3d", h3 ).isSuccess() ) {
174 for (
int i = 0; i < 1000; ++i ) { h3->Fill( gauss(), gauss(), gauss(), 1. ); }
179 if (
m_ths->getHist(
"TempHist5", h ).isSuccess() ) {
182 error() <<
"Couldn't retrieve TempHist 5" <<
endmsg;
186 if (
m_ths->getShared(
"/upd/xxx/gauss1d_shared", lh1 ).isSuccess() ) {
187 for (
int i = 0; i < 1000; ++i ) { lh1->Fill( gauss(), 1. ); }
189 error() <<
"Couldn't retrieve 1Dgauss_shared" <<
endmsg;
193 if (
m_ths->getShared(
"/rec/gauss2d_shared", lh2 ).isSuccess() ) {
194 for (
int i = 0; i < 1000; ++i ) { lh2->Fill( gauss(), gauss(), 1. ); }
196 error() <<
"Couldn't retrieve 2Dgauss_shared" <<
endmsg;
200 if (
m_ths->getShared(
"/rec/gauss3d_shared", lh3 ).isSuccess() ) {
201 for (
int i = 0; i < 1000; ++i ) { lh3->Fill( gauss(), gauss(), gauss(), 1. ); }
203 error() <<
"Couldn't retrieve 3Dgauss_shared" <<
endmsg;
206 TTree* tr(
nullptr );
207 if (
m_ths->getTree(
"/rec/trees/stuff/tree1", tr ).isFailure() ) {
208 error() <<
"Couldn't retrieve tree tree1" <<
endmsg;
212 tr->Branch(
"branch1", &p1,
"point1/I" );
213 tr->Branch(
"branch2", &p2,
"point2/I" );
214 tr->Branch(
"branch3", &p3,
"point3/I" );
216 for (
int i = 0; i < 1000; i++ ) {