14# pragma warning( disable : 2259 )
37 string histoAddr(
const string& name ) {
38 if (
name.starts_with(
"/stat/" ) ) {
return string( name, 6 ); }
42 string histoAddr(
const DataObject* obj,
const string& rel ) {
43 if ( !obj ) {
return rel; }
45 if ( !reg ) {
return rel; }
48 if ( rel.empty() ) {
return histoAddr( name ); }
49 if (
'/' == name[
name.size() - 1] ||
'/' == rel[0] ) {
return histoAddr( name + rel ); }
50 return histoAddr( name +
"/" + rel );
54 auto it = std::find_if(
m.begin(),
m.end(), [&lead](
const auto& i ) { return 0 == i.first.find( lead ); } );
55 if ( it ==
m.end() )
return 0;
56 string addr =
string( it->first, lead.size() );
60 return 1 + removeLeading( m, lead );
66 std::pair<string, string> split =
i_splitPath( full );
73 if ( obj[0] == SEPARATOR ) {
75 if ( !hObj->annotation().addItem(
"id", obj.substr( 1 ) ) ) hObj->annotation().setValue(
"id", obj.substr( 1 ) );
78 if ( !hObj->annotation().addItem(
"id", obj ) ) hObj->annotation().setValue(
"id", obj );
88 TH2D* h2d =
dynamic_cast<TH2D*
>( h3d->Project3D( dir.c_str() ) );
91 if ( r.second &&
registerObject( nameAndTitle, r.second ).isSuccess() ) {
return r.second; }
102 if ( b )
return b->
print( s );
103 error() <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase." <<
endmsg;
110 if ( b )
return b->
write( s );
111 error() <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase." <<
endmsg;
117 Gaudi::HistogramBase* b =
dynamic_cast<Gaudi::HistogramBase*
>(
h );
118 if ( b )
return b->
write( file_name );
119 error() <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase." <<
endmsg;
126 if ( tmp[0] != SEPARATOR ) {
127 tmp.insert( tmp.begin(), SEPARATOR );
131 if ( tmp.rfind( SEPARATOR ) == tmp.length() - 1 ) { tmp.erase( tmp.length() - 1, 1 ); }
132 int sep = tmp.rfind( SEPARATOR );
133 return { tmp.substr( 0, sep ), tmp.substr( sep + 1 ) };
138 string tmpPath = newPath;
139 if ( tmpPath[0] != SEPARATOR ) {
140 tmpPath.insert( tmpPath.begin(), SEPARATOR );
144 if ( tmpPath.rfind( SEPARATOR ) == tmpPath.length() - 1 ) { tmpPath.erase( tmpPath.rfind( SEPARATOR ), 1 ); }
147 if ( sc.
isSuccess() ) {
return pObject; }
148 int sep = tmpPath.rfind( SEPARATOR );
149 string rest( tmpPath, sep + 1, tmpPath.length() - sep );
150 string subPath( tmpPath, 0, sep );
154 error() <<
"Unable to create the histogram path" <<
endmsg;
163 auto directory = std::make_unique<DataObject>();
168 error() <<
"Unable to create the histogram directory: " << parentDir <<
"/" << subDir <<
endmsg;
173 error() <<
"Unable to create the histogram directory: " << parentDir <<
"/" << subDir <<
endmsg;
177 return directory.release();
192 string::size_type loc = ident.find(
" " );
193 string filename, auth, svc =
"", typ =
"";
194 string logname = ident.substr( 0, loc );
195 for (
auto attrib : Parser( ident.substr( loc + 1 ) ) ) {
199 filename = std::move( attrib.value );
202 typ = std::move( attrib.value );
208 if ( typ.length() > 0 ) {
212 entryname += logname;
225 info() <<
"Added stream file:" << filename <<
" as " << logname <<
endmsg;
232 error() <<
"Cannot add " << ident <<
" invalid filename!" <<
endmsg;
241 auto rootObj = std::make_unique<DataObject>();
242 status =
setRoot(
"/stat", rootObj.get() );
244 error() <<
"Unable to set hstogram data store root." <<
endmsg;
250 error() <<
"Could not find HistogramPersistencySvc." <<
endmsg;
257 if ( !status.
isSuccess() )
return status;
261 info() <<
" Predefined 1D-Histograms: " <<
endmsg;
263 info() <<
" Path='" << ih.first <<
"'"
264 <<
" Description " << ih.second <<
endmsg;
274IHistogram1D*
HistogramSvc::sliceX(
const string& name,
const IHistogram2D& h,
int idxY1,
int idxY2 ) {
275 std::pair<DataObject*, IHistogram1D*> o(
nullptr,
nullptr );
281 throw GaudiException(
"Cannot cast 2D histogram to H2D to create sliceX `" +
name +
"'!",
"HistogramSvc",
286 throw GaudiException(
"Cannot create sliceX `" +
name +
"' of 2D histogram!",
"HistogramSvc",
StatusCode::FAILURE );
290IHistogram1D*
HistogramSvc::sliceY(
const string& name,
const IHistogram2D& h,
int indexX1,
int indexX2 ) {
291 std::pair<DataObject*, IHistogram1D*> o(
nullptr,
nullptr );
300 if ( o.first &&
registerObject(
name, (IBaseHistogram*)o.second ).isSuccess() ) {
return o.second; }
302 throw GaudiException(
"Cannot create sliceY `" +
name +
"' of 2D histogram!",
"HistogramSvc",
StatusCode::FAILURE );
317 return i_book( pPar, rel, title,
320 string hn = histoAddr( pPar, rel );
323 return i_book( pPar, rel, title,
327 debug() <<
" Redefine the parameters for the histogram '" + hn +
"' to be " << ifound->second <<
endmsg;
330 return i_book( pPar, rel, ifound->second.title(),
332 ifound->second.bins(), ifound->second.lowEdge(), ifound->second.lowEdge() ) );
346 removeLeading(
m_defs1D.value(),
"/stat/" );
351 std::string
const& root =
rootName();
352 return path.substr( root.size() ) +
'/' + rel;
364 if (
m_defs1D.end() != im ) {
debug() <<
" " << im->second; }
372AIDA::IHistogram1D*
HistogramSvc::book(
const string& par,
const string& rel,
const string& title,
int nx,
double lowx,
378AIDA::IHistogram1D*
HistogramSvc::book(
const string& par,
int hID,
const string& title,
int nx,
double lowx,
380 return book( par, std::to_string( hID ), title, nx, lowx, upx );
386 return book( pPar, std::to_string( hID ), title, nx, lowx, upx );
390AIDA::IHistogram1D*
HistogramSvc::book(
const std::pair<string, string>& loc,
const string& title,
int nx,
double lowx,
392 return book( loc.first, loc.second, title, nx, lowx, upx );
396AIDA::IHistogram1D*
HistogramSvc::book(
const string& full,
const string& title,
int nx,
double lowx,
double upx ) {
401AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& par,
const string& rel,
const string& title,
int nx,
402 double lowx,
double upx,
const string& opt ) {
407AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& par,
int hID,
const string& title,
int nx,
double lowx,
408 double upx,
const string& opt ) {
409 return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, opt );
414 double upx,
const string& opt ) {
415 return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, opt );
419AIDA::IProfile1D*
HistogramSvc::bookProf(
const std::pair<string, string>& loc,
const string& title,
int nx,
420 double lowx,
double upx,
const string& opt ) {
421 return bookProf( loc.first, loc.second, title, nx, lowx, upx, opt );
425AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& full,
const string& title,
int nx,
double lowx,
double upx,
426 const string& opt ) {
432 double upx,
const string& opt ) {
439AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& par,
const string& rel,
const string& title,
int nx,
440 double lowx,
double upx,
double upper,
double lower,
const string& opt ) {
445AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& par,
int hID,
const string& title,
int nx,
double lowx,
446 double upx,
double upper,
double lower,
const string& opt ) {
447 return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, upper, lower, opt );
452 double upx,
double upper,
double lower,
const string& opt ) {
453 return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, upper, lower, opt );
457AIDA::IProfile1D*
HistogramSvc::bookProf(
const std::pair<string, string>& loc,
const string& title,
int nx,
458 double lowx,
double upx,
double upper,
double lower,
const string& opt ) {
459 return bookProf( loc.first, loc.second, title, nx, lowx, upx, upper, lower, opt );
463AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& full,
const string& title,
int nx,
double lowx,
double upx,
464 double upper,
double lower,
const string& opt ) {
470 double upx,
double upper,
double lower,
const string& opt ) {
478 return book( par, std::to_string( hID ), title, e );
483 return book( pPar, std::to_string( hID ), title, e );
487AIDA::IHistogram1D*
HistogramSvc::book(
const std::string& par,
const std::string& rel,
const std::string& title,
493AIDA::IHistogram1D*
HistogramSvc::book(
const std::pair<std::string, std::string>& loc,
const std::string& title,
495 return book( loc.first, loc.second, title, e );
521 return bookProf( par, std::to_string( hID ), title, e );
526 return bookProf( pPar, std::to_string( hID ), title, e );
532 return bookProf( loc.first, loc.second, title, e );
538 return i_book( pPar, rel, title,
550 Edges e,
double upper,
double lower ) {
556 double upper,
double lower ) {
557 return bookProf( par, std::to_string( hID ), title, e, upper, lower );
563 return bookProf( pPar, std::to_string( hID ), title, e, upper, lower );
568 Edges e,
double upper,
double lower ) {
569 return bookProf( loc.first, loc.second, title, e, upper, lower );
574 double upper,
double lower ) {
575 return i_book( pPar, rel, title,
580AIDA::IHistogram2D*
HistogramSvc::book(
const std::string& full,
const std::string& title,
int nx,
double lowx,
581 double upx,
int ny,
double lowy,
double upy ) {
582 return book(
i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy );
586AIDA::IHistogram2D*
HistogramSvc::book(
const std::string& par,
const std::string& rel,
const std::string& title,
587 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy ) {
588 return book(
createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy );
592AIDA::IHistogram2D*
HistogramSvc::book(
const std::string& par,
int hID,
const std::string& title,
int nx,
double lowx,
593 double upx,
int ny,
double lowy,
double upy ) {
594 return book( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
598AIDA::IHistogram2D*
HistogramSvc::book(
const std::pair<std::string, std::string>& loc,
const std::string& title,
599 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy ) {
600 return book( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy );
605 double upx,
int ny,
double lowy,
double upy ) {
606 return book( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
611 double lowx,
double upx,
int ny,
double lowy,
double upy ) {
619 double upx,
int ny,
double lowy,
double upy,
double upper,
double lower ) {
625 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy,
626 double upper,
double lower ) {
627 return bookProf(
createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
632 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy,
633 double upper,
double lower ) {
634 return bookProf( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
639 double lowx,
double upx,
int ny,
double lowy,
double upy,
double upper,
641 return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
646 double upx,
int ny,
double lowy,
double upy,
double upper,
double lower ) {
647 return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
652 double lowx,
double upx,
int ny,
double lowy,
double upy,
double upper,
654 return i_book( pPar, rel, title,
656 upy, upper, lower ) );
661 double upx,
int ny,
double lowy,
double upy ) {
667 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy ) {
673 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy ) {
674 return bookProf( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy );
679 double lowx,
double upx,
int ny,
double lowy,
double upy ) {
680 return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
685 double upx,
int ny,
double lowy,
double upy ) {
686 return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
691 double lowx,
double upx,
int ny,
double lowy,
double upy ) {
694 Gaudi::createProf2D(
serviceLocator(),
buildHistoPath( pPar, rel ), title, nx, lowx, upx, ny, lowy, upy, 0, 0 ) );
703AIDA::IHistogram2D*
HistogramSvc::book(
const std::string& par,
const std::string& rel,
const std::string& title,
710 return book( par, std::to_string( hID ), title, x, y );
714AIDA::IHistogram2D*
HistogramSvc::book(
const std::pair<std::string, std::string>& loc,
const std::string& title,
716 return book( loc.first, loc.second, title, x, y );
721 return book( pPar, std::to_string( hID ), title, x, y );
744 return bookProf( par, std::to_string( hID ), title, x, y );
749 return bookProf( pPar, std::to_string( hID ), title, x, y );
755 return bookProf( loc.first, loc.second, title, x, y );
761 return i_book( pPar, rel, title,
767 double upper,
double lower ) {
773 Edges x,
Edges y,
double upper,
double lower ) {
779 double upper,
double lower ) {
780 return bookProf( par, std::to_string( hID ), title, x, y, upper, lower );
785 double upper,
double lower ) {
786 return bookProf( pPar, std::to_string( hID ), title, x, y, upper, lower );
791 Edges x,
Edges y,
double upper,
double lower ) {
792 return bookProf( loc.first, loc.second, title, x, y, upper, lower );
797 Edges y,
double upper,
double lower ) {
798 return i_book( pPar, rel, title,
803AIDA::IHistogram3D*
HistogramSvc::book(
const std::string& full,
const std::string& title,
int nx,
double lowx,
804 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz ) {
805 return book(
i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
809AIDA::IHistogram3D*
HistogramSvc::book(
const std::string& par,
const std::string& rel,
const std::string& title,
810 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
811 double lowz,
double upz ) {
812 return book(
createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
816AIDA::IHistogram3D*
HistogramSvc::book(
const std::string& par,
int hID,
const std::string& title,
int nx,
double lowx,
817 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz ) {
818 return book( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
823 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz ) {
824 return book( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
828AIDA::IHistogram3D*
HistogramSvc::book(
const std::pair<std::string, std::string>& loc,
const std::string& title,
829 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
830 double lowz,
double upz ) {
831 return book( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
836 double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
838 return i_book( pPar, rel, title,
839 Gaudi::createH3D(
serviceLocator(),
buildHistoPath( pPar, rel ), title, nx, lowx, upx, ny, lowy, upy,
849AIDA::IHistogram3D*
HistogramSvc::book(
const std::string& par,
const std::string& rel,
const std::string& title,
857 return book( par, std::to_string( hID ), title, x, y, z );
863 return book( pPar, std::to_string( hID ), title, x, y, z );
867AIDA::IHistogram3D*
HistogramSvc::book(
const std::pair<std::string, std::string>& loc,
const std::string& title,
869 return book( loc.first, loc.second, title, x, y, z );
954 AIDA::IProfile1D*& obj ) {
1054 return Helper(
this ).
retrieve( ::detail::cast( par ), item, obj );
1059 return Helper(
this ).
retrieve( ::detail::cast( par ), item, obj );
1064 return Helper(
this ).
retrieve( ::detail::cast( par ), item, obj );
1069 return Helper(
this ).
retrieve( ::detail::cast( par ), item, obj );
1074 return Helper(
this ).
retrieve( ::detail::cast( par ), item, obj );
1079 return Helper(
this ).
retrieve( ::detail::cast( par ), item, obj );
1084 return Helper(
this ).
retrieve( ::detail::cast( par ), item, obj );
1089 return Helper(
this ).
retrieve( ::detail::cast( par ), item, obj );
1094 return Helper(
this ).
retrieve( ::detail::cast( par ), item, obj );
1099 return Helper(
this ).
retrieve( ::detail::cast( par ), item, obj );
1104 return Helper(
this ).
find( pReg, path, obj );
1108 return Helper(
this ).
find( pReg, path, obj );
1112 return Helper(
this ).
find( pReg, path, obj );
1116 return Helper(
this ).
find( pReg, path, obj );
1120 return Helper(
this ).
find( pReg, path, obj );
1173 return Helper(
this ).
find( par, item, obj );
1178 return Helper(
this ).
find( par, item, obj );
1183 return Helper(
this ).
find( par, item, obj );
1188 return Helper(
this ).
find( par, item, obj );
1193 return Helper(
this ).
find( par, item, obj );
1198 return Helper(
this ).
find( par, item, obj );
1203 return Helper(
this ).
find( par, item, obj );
1208 return Helper(
this ).
find( par, item, obj );
1213 return Helper(
this ).
find( par, item, obj );
1218 return Helper(
this ).
find( par, item, obj );
1223 return Helper(
this ).
find( par, item, obj );
1228 return Helper(
this ).
find( par, item, obj );
1233 return Helper(
this ).
find( par, item, obj );
1238 return Helper(
this ).
find( par, item, obj );
1243 return Helper(
this ).
find( par, item, obj );
1248 return Helper(
this ).
find( ::detail::cast( par ), item, obj );
1253 return Helper(
this ).
find( ::detail::cast( par ), item, obj );
1258 return Helper(
this ).
find( ::detail::cast( par ), item, obj );
1263 return Helper(
this ).
find( ::detail::cast( par ), item, obj );
1268 return Helper(
this ).
find( ::detail::cast( par ), item, obj );
1273 return Helper(
this ).
find( ::detail::cast( par ), item, obj );
1278 return Helper(
this ).
find( ::detail::cast( par ), item, obj );
1283 return Helper(
this ).
find( ::detail::cast( par ), item, obj );
1288 return Helper(
this ).
find( ::detail::cast( par ), item, obj );
1293 return Helper(
this ).
find( ::detail::cast( par ), item, obj );
1298 return sliceX(
name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN );
1303 return sliceY(
name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN );
1318 const AIDA::IHistogram1D& b ) {
1324 const AIDA::IHistogram1D& b ) {
1330 const AIDA::IHistogram1D& b ) {
1336 const AIDA::IHistogram1D& b ) {
1342 const AIDA::IHistogram2D& b ) {
1348 const AIDA::IHistogram2D& b ) {
1354 const AIDA::IHistogram2D& b ) {
1360 const AIDA::IHistogram2D& b ) {
1366 const AIDA::IHistogram3D& b ) {
1372 const AIDA::IHistogram3D& b ) {
1378 const AIDA::IHistogram3D& b ) {
1384 const AIDA::IHistogram3D& b ) {
1390 return i_project( nameAndTitle, h,
"xy" );
1395 return i_project( nameAndTitle, h,
"xz" );
1400 return i_project( nameAndTitle, h,
"yz" );
1405 double lowx,
double upx ) {
1406 return book(
name, title, nx, lowx, upx );
1411 double lowx,
double upx,
const std::string& ) {
1412 return book(
name, title, nx, lowx, upx );
1417 const std::string& ) {
1424 return book( nameAndTitle, nameAndTitle, nx, lowx, upx );
1434 const AIDA::IHistogram1D& h ) {
1440 const AIDA::IHistogram1D& h ) {
1441 return createCopy( loc.first, loc.second, h );
1451 double lowx,
double upx,
int ny,
double lowy,
double upy ) {
1452 return book(
name, title, nx, lowx, upx, ny, lowy, upy );
1457 double lowx,
double upx,
int ny,
double lowy,
double upy,
1458 const std::string& ) {
1459 return book(
name, title, nx, lowx, upx, ny, lowy, upy );
1464 const Edges& y,
const std::string& ) {
1470 int ny,
double lowy,
double upy ) {
1471 return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy );
1481 const AIDA::IHistogram2D& h ) {
1487 const AIDA::IHistogram2D& h ) {
1488 return createCopy( loc.first, loc.second, h );
1498 double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
1499 double lowz,
double upz ) {
1500 return book(
name, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1505 double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
1506 double lowz,
double upz,
const std::string& ) {
1507 return book(
name, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1512 const Edges& y,
const Edges& z,
const std::string& ) {
1513 return book(
name, title, x, y, z );
1518 int ny,
double lowy,
double upy,
int nz,
double lowz,
1520 return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1530 const AIDA::IHistogram3D& h ) {
1536 const AIDA::IHistogram3D& h ) {
1537 return createCopy( loc.first, loc.second, h );
1547 double upx,
const std::string& opt ) {
1553 double upx,
double upper,
double lower,
const std::string& opt ) {
1554 return bookProf(
name, title, nx, lowx, upx, upper, lower, opt );
1559 const std::string& ) {
1565 double upper,
double lower,
const std::string& ) {
1571 return bookProf( nametit, nametit, nx, lowx, upx,
"s" );
1576 double upper,
double lower ) {
1577 return bookProf( nametit, nametit, nx, lowx, upx, upper, lower,
"s" );
1587 const AIDA::IProfile1D& h ) {
1593 const AIDA::IProfile1D& h ) {
1594 return createCopy( loc.first, loc.second, h );
1604 double upx,
int ny,
double lowy,
double upy ) {
1605 return bookProf(
name, title, nx, lowx, upx, ny, lowy, upy );
1610 double upx,
int ny,
double lowy,
double upy,
1611 const std::string& ) {
1612 return bookProf(
name, title, nx, lowx, upx, ny, lowy, upy );
1617 const Edges& y,
const std::string& ) {
1623 int ny,
double lowy,
double upy ) {
1624 return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy );
1629 double upx,
int ny,
double lowy,
double upy,
double upper,
1631 return bookProf(
name, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
1636 double upx,
int ny,
double lowy,
double upy,
double upper,
1637 double lower,
const std::string& ) {
1638 return bookProf(
name, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
1643 const Edges& y,
double upper,
double lower,
1644 const std::string& ) {
1650 int ny,
double lowy,
double upy,
double upper,
double lower ) {
1651 return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy, upper, lower );
1661 const AIDA::IProfile2D& h ) {
1667 const AIDA::IProfile2D& h ) {
1668 return createCopy( loc.first, loc.second, h );
const long HBOOK_StorageType
const long ROOT_StorageType
void toupper(std::string &s)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
MSG::Level msgLevel() const
A DataObject is the base class of any identifiable object on any data store.
IRegistry * registry() const
Get pointer to Registry.
StatusCode setRoot(std::string root_name, DataObject *pRootObj) override
Initialize data store for new event by giving new event path and root object.
StatusCode finalize() override
Service initialization.
Gaudi::Property< std::string > m_rootName
StatusCode setDataLoader(IConversionSvc *svc, IDataProviderSvc *dpsvc=nullptr) override
IDataManagerSvc: IDataManagerSvc: Pass a default data loader to the service and optionally a data pro...
StatusCode initialize() override
Service initialization.
StatusCode registerObject(std::string_view parentPath, std::string_view objPath, DataObject *pObject) override
Register object with the data store.
Gaudi::Property< CLID > m_rootCLID
const std::string & rootName() const override
IDataManagerSvc: Accessor for root event name.
StatusCode registerAddress(std::string_view fullPath, IOpaqueAddress *pAddress) override
IDataManagerSvc: Register object address with the data store.
StatusCode clearStore() override
IDataManagerSvc: Remove all data objects in the data store.
static int toRootIndex(int index, int nbins)
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
Common base class for all histograms Use is solely functional to minimize dynamic_casts inside Histog...
virtual std::ostream & write(std::ostream &s) const =0
Write (binary) histogram to output stream.
virtual std::ostream & print(std::ostream &s) const =0
Print histogram to output stream.
decltype(auto) empty() const
Parse attribute strings allowing iteration over the various attributes.
Generic Transient Address.
unsigned long release() override
release reference to object
AIDA::IHistogram1D * sliceY(const std::string &name, const AIDA::IHistogram2D &h, int indexX) override
std::ostream & write(Base *h, std::ostream &s=std::cout) const override
Write (ASCII) the 1D histogram table into the output stream.
~HistogramSvc() override
Destructor.
AIDA::IHistogram2D * projectionXY(const std::string &nameAndTitle, const AIDA::IHistogram3D &h) override
AIDA::IHistogram1D * divide(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) override
std::set< std::string > m_mods1D
AIDA::IHistogram1D * projectionY(const std::string &name, const AIDA::IHistogram2D &h) override
StatusCode findObject(IRegistry *pReg, const std::string &path, AIDA::IProfile1D *&obj) override
StatusCode connectInput(const std::string &ident)
Connect input histogram file to the service.
AIDA::IHistogram3D * createHistogram3D(const std::string &name, const std::string &title, int nx, double lowx, double upx, int ny, double lowy, double upy, int nz, double lowz, double upz)
StatusCode retrieveObject(IRegistry *pReg, const std::string &path, AIDA::IHistogram1D *&obj) override
std::map< std::string, Gaudi::Histo1DDef > Histo1DMap
void update1Ddefs()
handler to be invoked for updating property m_defs1D
AIDA::IHistogram1D * createCopy(const std::string &full, const AIDA::IHistogram1D &h) override
StatusCode registerObject(const std::string &parent, const std::string &rel, Base *obj) override
Gaudi::Property< DBaseEntries > m_input
AIDA::IHistogram2D * projectionYZ(const std::string &nameAndTitle, const AIDA::IHistogram3D &h) override
std::pair< std::string, std::string > i_splitPath(const std::string &full)
Split full path into its components.
AIDA::IHistogram1D * projectionX(const std::string &name, const AIDA::IHistogram2D &h) override
StatusCode reinitialize() override
Initialise the service.
AIDA::IHistogram2D * projectionXZ(const std::string &nameAndTitle, const AIDA::IHistogram3D &h) override
AIDA::IHistogram1D * createHistogram1D(const std::string &name, const std::string &title, int nx, double lowx, double upx)
AIDA::IProfile1D * createProfile1D(const std::string &name, const std::string &title, int nx, double lowx, double upx, const std::string &opt) override
HistogramSvc(const std::string &name, ISvcLocator *svc)
Statndard Constructor.
AIDA::IHistogram1D * multiply(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) override
AIDA::IHistogram1D * book(const std::string &par, const std::string &rel, const std::string &title, int nx, double lowx, double upx) override
Book histogram and register it with the histogram data store.
std::string buildHistoPath(DataObject const *pPar, std::string const &rel)
extracts the path of an histogram from the related DataObject
Gaudi::Property< Histo1DMap > m_defs1D
AIDA::IHistogram2D * i_project(const std::string &nameAndTitle, const AIDA::IHistogram3D &h, const std::string &dir)
Helper for 2D projections.
AIDA::IHistogram1D * sliceX(const std::string &name, const AIDA::IHistogram2D &h, int indexY) override
AIDA::IProfile1D * bookProf(const std::string &par, const std::string &rel, const std::string &title, int nx, double lowx, double upx, const std::string &opt) override
Book histogram and register it with the histogram data store.
AIDA::IHistogram1D * add(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) override
std::ostream & print(Base *h, std::ostream &s=std::cout) const override
Print (ASCII) the 1D histogram into the output stream.
std::vector< double > Edges
StatusCode finalize() override
finalize the service
AIDA::IHistogram1D * subtract(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) override
AIDA::IHistogram2D * createHistogram2D(const std::string &name, const std::string &title, int nx, double lowx, double upx, int ny, double lowy, double upy)
AIDA::IProfile2D * createProfile2D(const std::string &name, const std::string &title, int nx, double lowx, double upx, int ny, double lowy, double upy)
DataObject * createPath(const std::string &newPath) override
Create all directories in a given full path.
DataObject * createDirectory(const std::string &parentDir, const std::string &subDir) override
Create a sub-directory in a directory.
StatusCode unregisterObject(Base *obj) override
StatusCode initialize() override
Initialise the service.
bool destroy(IBaseHistogram *hist) override
T * i_book(DataObject *pPar, const std::string &rel, const std::string &title, const std::pair< DataObject *, T * > &o)
AIDA::IBaseHistogram Base
The IRegistry represents the entry door to the environment any data object residing in a transient da...
virtual const id_type & identifier() const =0
Full identifier (or key)
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
const std::string & name() const override
Retrieve name of the service.
SmartIF< IFace > service(const std::string &name, bool createIf=true) const
This class is used for returning status codes from appropriate routines.
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
std::pair< DataObject *, AIDA::IHistogram2D * > createH2D(ISvcLocator *svcLocator, const std::string &path, const AIDA::IHistogram2D &hist)
Copy constructor.
std::pair< DataObject *, AIDA::IHistogram1D * > slice1DX(const std::string &name, const AIDA::IHistogram2D &h, int firstbin, int lastbin)
Create 1D slice from 2D histogram.
std::pair< DataObject *, AIDA::IHistogram1D * > slice1DY(const std::string &name, const AIDA::IHistogram2D &h, int firstbin, int lastbin)
Create 1D slice from 2D histogram.
std::pair< DataObject *, AIDA::IProfile2D * > createProf2D(ISvcLocator *svcLocator, const std::string &path, const AIDA::IProfile2D &hist)
Copy constructor.
std::pair< DataObject *, AIDA::IProfile1D * > createProf1D(ISvcLocator *svcLocator, const std::string &path, const AIDA::IProfile1D &hist)
Copy constructor.
T * getRepresentation(const Q &hist)
std::pair< DataObject *, AIDA::IHistogram3D * > createH3D(ISvcLocator *svcLocator, const std::string &path, const AIDA::IHistogram3D &hist)
Copy constructor.
std::pair< DataObject *, AIDA::IHistogram1D * > createH1D(ISvcLocator *svcLocator, const std::string &path, const AIDA::IHistogram1D &hist)
Copy constructor.
StatusCode retrieve(A1 a1, A3 *&a3)
StatusCode find(A1 a1, A3 *&a3)
static R * act(R *res, const S &b, void(T1::*pmf)(const T2 *, Double_t), Double_t scale)