4 # pragma warning( disable : 2259 ) 10 # pragma warning( disable : 4996 ) 33 string histoAddr(
const string&
name ) {
34 if ( 0 == name.find(
"/stat/" ) ) {
return string( name, 6 ); }
38 string histoAddr(
const DataObject* obj,
const string& rel ) {
39 if ( !obj ) {
return rel; }
41 if ( !reg ) {
return rel; }
44 if ( rel.empty() ) {
return histoAddr( name ); }
45 if (
'/' == name[name.size() - 1] ||
'/' == rel[0] ) {
return histoAddr( name + rel ); }
46 return histoAddr( name +
"/" + rel );
50 auto it =
std::find_if( m.
begin(), m.
end(), [&lead](
const auto& i ) {
return 0 == i.first.find( lead ); } );
51 if ( it == m.
end() )
return 0;
52 string addr = string( it->first, lead.size() );
56 return 1 + removeLeading( m, lead );
63 return registerObject( split.first, split.second, obj );
71 if ( !hObj->annotation().addItem(
"id", obj.substr( 1 ) ) ) hObj->annotation().setValue(
"id", obj.substr( 1 ) );
74 if ( !hObj->annotation().addItem(
"id", obj ) ) hObj->annotation().setValue(
"id", obj );
82 TH3D* h3d = Gaudi::getRepresentation<IHistogram3D, TH3D>( h );
84 TH2D* h2d =
dynamic_cast<TH2D*
>( h3d->Project3D( dir.c_str() ) );
87 if ( r.second && registerObject( nameAndTitle, r.second ).isSuccess() ) {
return r.second; }
98 if ( b )
return b->
print( s );
99 error() <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase." <<
endmsg;
106 if ( b )
return b->
write( s );
107 error() <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase." <<
endmsg;
114 if ( b )
return b->
write( file_name );
115 error() <<
"Unknown histogram type: Cannot cast to Gaudi::HistogramBase." <<
endmsg;
124 tmp.insert( tmp.begin(), m_rootName.begin(), m_rootName.end() );
127 if ( tmp.rfind(
SEPARATOR ) == tmp.length() - 1 ) { tmp.erase( tmp.length() - 1, 1 ); }
129 return {tmp.substr( 0, sep ), tmp.substr( sep )};
134 string tmpPath = newPath;
136 tmpPath.insert( tmpPath.begin(),
SEPARATOR );
137 tmpPath.insert( tmpPath.begin(), m_rootName.begin(), m_rootName.end() );
140 if ( tmpPath.rfind(
SEPARATOR ) == tmpPath.length() - 1 ) { tmpPath.erase( tmpPath.rfind(
SEPARATOR ), 1 ); }
142 StatusCode sc = findObject( tmpPath, pObject );
143 if ( sc.
isSuccess() ) {
return pObject; }
145 string rest( tmpPath, sep + 1, tmpPath.length() - sep );
146 string subPath( tmpPath, 0, sep );
148 createPath( subPath );
150 error() <<
"Unable to create the histogram path" <<
endmsg;
153 pObject = createDirectory( subPath, rest );
159 auto directory = std::make_unique<DataObject>();
162 StatusCode status = retrieveObject( parentDir, pnode );
164 error() <<
"Unable to create the histogram directory: " << parentDir <<
"/" << subDir <<
endmsg;
169 error() <<
"Unable to create the histogram directory: " << parentDir <<
"/" << subDir <<
endmsg;
173 return directory.release();
178 setDataLoader(
nullptr ).ignore();
179 clearStore().ignore();
186 StatusCode status = this->findObject( m_rootName.value(), pO );
188 string::size_type loc = ident.find(
" " );
189 string filename, auth, svc =
"", typ =
"";
190 string logname = ident.substr( 0, loc );
191 for (
auto attrib : Parser( ident.substr( loc + 1 ) ) ) {
192 switch ( ::
toupper( attrib.tag[0] ) ) {
204 if ( typ.length() > 0 ) {
206 string entryname = m_rootName;
208 entryname += logname;
210 switch ( ::
toupper( typ[0] ) ) {
219 status = registerAddress( pO, logname, pA );
221 info() <<
"Added stream file:" << filename <<
" as " << logname <<
endmsg;
228 error() <<
"Cannot add " << ident <<
" invalid filename!" <<
endmsg;
237 auto rootObj = std::make_unique<DataObject>();
238 status = setRoot(
"/stat", rootObj.get() );
239 if ( status.isFailure() ) {
240 error() <<
"Unable to set hstogram data store root." <<
endmsg;
244 auto svc = service<IConversionSvc>(
"HistogramPersistencySvc", true );
246 error() <<
"Could not find HistogramPersistencySvc." <<
endmsg;
249 setDataLoader( svc.get() ).ignore();
251 for (
auto& j : m_input ) {
252 status = connectInput( j );
253 if ( !status.isSuccess() )
return status;
256 if ( !m_defs1D.empty() ) {
257 info() <<
" Predefined 1D-Histograms: " <<
endmsg;
258 for (
const auto& ih : m_defs1D ) {
259 info() <<
" Path='" << ih.first <<
"'" 260 <<
" Description " << ih.second <<
endmsg;
270 IHistogram1D*
HistogramSvc::sliceX(
const string& name,
const IHistogram2D& h,
int idxY1,
int idxY2 ) {
277 throw GaudiException(
"Cannot cast 2D histogram to H2D to create sliceX `" + name +
"'!",
"HistogramSvc",
280 if ( o.first && registerObject( name, o.second ).isSuccess() ) {
return o.second; }
286 IHistogram1D*
HistogramSvc::sliceY(
const string& name,
const IHistogram2D& h,
int indexX1,
int indexX2 ) {
296 if ( o.first && registerObject( name, (IBaseHistogram*)o.second ).isSuccess() ) {
return o.second; }
303 StatusCode sc = unregisterObject( dynamic_cast<IHistogram*>( hist ) );
312 if ( m_defs1D.empty() ) {
return i_book( pPar, rel, title,
Gaudi::createH1D( title, nx, lowx, upx ) ); }
313 string hn = histoAddr( pPar, rel );
314 auto ifound = m_defs1D.find( hn );
315 if ( m_defs1D.end() == ifound ) {
return i_book( pPar, rel, title,
Gaudi::createH1D( title, nx, lowx, upx ) ); }
317 debug() <<
" Redefine the parameters for the histogram '" + hn +
"' to be " << ifound->second <<
endmsg;
319 m_mods1D.insert( hn );
320 return i_book( pPar, rel, ifound->second.title(),
321 Gaudi::createH1D( ifound->second.title(), ifound->second.bins(), ifound->second.lowEdge(),
322 ifound->second.lowEdge() ) );
336 removeLeading(
m_defs1D.value(),
"/stat/" );
348 if (
m_defs1D.end() != im ) {
debug() <<
" " << im->second; }
356 AIDA::IHistogram1D*
HistogramSvc::book(
const string&
par,
const string& rel,
const string& title,
int nx,
double lowx,
362 AIDA::IHistogram1D*
HistogramSvc::book(
const string& par,
int hID,
const string& title,
int nx,
double lowx,
376 return book( loc.first, loc.second, title, nx, lowx, upx );
380 AIDA::IHistogram1D*
HistogramSvc::book(
const string& full,
const string& title,
int nx,
double lowx,
double upx ) {
385 AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& par,
const string& rel,
const string& title,
int nx,
386 double lowx,
double upx,
const string& opt ) {
391 AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& par,
int hID,
const string& title,
int nx,
double lowx,
392 double upx,
const string& opt ) {
398 double upx,
const string& opt ) {
404 double lowx,
double upx,
const string& opt ) {
405 return bookProf( loc.first, loc.second, title, nx, lowx, upx, opt );
409 AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& full,
const string& title,
int nx,
double lowx,
double upx,
410 const string& opt ) {
416 double upx,
const string& opt ) {
421 AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& par,
const string& rel,
const string& title,
int nx,
422 double lowx,
double upx,
double upper,
double lower,
const string& opt ) {
427 AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& par,
int hID,
const string& title,
int nx,
double lowx,
428 double upx,
double upper,
double lower,
const string& opt ) {
434 double upx,
double upper,
double lower,
const string& opt ) {
440 double lowx,
double upx,
double upper,
double lower,
const string& opt ) {
441 return bookProf( loc.first, loc.second, title, nx, lowx, upx, upper, lower, opt );
445 AIDA::IProfile1D*
HistogramSvc::bookProf(
const string& full,
const string& title,
int nx,
double lowx,
double upx,
446 double upper,
double lower,
const string& opt ) {
452 double upx,
double upper,
double lower,
const string& opt ) {
475 return book( loc.first, loc.second, title, e );
512 return bookProf( loc.first, loc.second, title, e );
529 Edges e,
double upper,
double lower ) {
535 double upper,
double lower ) {
547 Edges e,
double upper,
double lower ) {
548 return bookProf( loc.first, loc.second, title, e, upper, lower );
553 double upper,
double lower ) {
559 double upx,
int ny,
double lowy,
double upy ) {
560 return book(
i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy );
565 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy ) {
566 return book(
createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy );
571 double upx,
int ny,
double lowy,
double upy ) {
577 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy ) {
578 return book( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy );
583 double upx,
int ny,
double lowy,
double upy ) {
589 double lowx,
double upx,
int ny,
double lowy,
double upy ) {
595 double upx,
int ny,
double lowy,
double upy,
double upper,
double lower ) {
601 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy,
602 double upper,
double lower ) {
603 return bookProf(
createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
608 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy,
609 double upper,
double lower ) {
610 return bookProf( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
615 double lowx,
double upx,
int ny,
double lowy,
double upy,
double upper,
617 return bookProf( par,
std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
622 double upx,
int ny,
double lowy,
double upy,
double upper,
double lower ) {
623 return bookProf( pPar,
std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
628 double lowx,
double upx,
int ny,
double lowy,
double upy,
double upper,
630 return i_book( pPar, rel, title,
Gaudi::createProf2D( title, nx, lowx, upx, ny, lowy, upy, upper, lower ) );
635 double upx,
int ny,
double lowy,
double upy ) {
641 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy ) {
647 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy ) {
648 return bookProf( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy );
653 double lowx,
double upx,
int ny,
double lowy,
double upy ) {
659 double upx,
int ny,
double lowy,
double upy ) {
665 double lowx,
double upx,
int ny,
double lowy,
double upy ) {
666 return i_book( pPar, rel, title,
Gaudi::createProf2D( title, nx, lowx, upx, ny, lowy, upy, 0, 0 ) );
688 return book( loc.first, loc.second, title, x, y );
727 return bookProf( loc.first, loc.second, title, x, y );
738 double upper,
double lower ) {
744 Edges x,
Edges y,
double upper,
double lower ) {
750 double upper,
double lower ) {
756 double upper,
double lower ) {
762 Edges x,
Edges y,
double upper,
double lower ) {
763 return bookProf( loc.first, loc.second, title, x, y, upper, lower );
768 Edges y,
double upper,
double lower ) {
774 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz ) {
775 return book(
i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
780 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
781 double lowz,
double upz ) {
782 return book(
createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
787 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz ) {
788 return book( par,
std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
793 double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
double upz ) {
794 return book( pPar,
std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
799 int nx,
double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
800 double lowz,
double upz ) {
801 return book( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
806 double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
double lowz,
808 return i_book( pPar, rel, title,
Gaudi::createH3D( title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ) );
837 return book( loc.first, loc.second, title, x, y, z );
871 return Helper(
this ).retrieve( pReg, path, obj );
876 return Helper(
this ).retrieve( pReg, path, obj );
881 return Helper(
this ).retrieve( pReg, path, obj );
886 return Helper(
this ).retrieve( pReg, path, obj );
891 return Helper(
this ).retrieve( pReg, path, obj );
896 return Helper(
this ).retrieve( full, obj );
901 return Helper(
this ).retrieve( full, obj );
906 return Helper(
this ).retrieve( full, obj );
911 return Helper(
this ).retrieve( full, obj );
916 return Helper(
this ).retrieve( full, obj );
922 AIDA::IProfile1D*& obj ) {
923 return Helper(
this ).retrieve( parent, rel, obj );
928 return Helper(
this ).retrieve( parent, rel, obj );
933 return Helper(
this ).retrieve( parent, rel, obj );
938 return Helper(
this ).retrieve( parent, rel, obj );
943 return Helper(
this ).retrieve( parent, rel, obj );
948 return Helper(
this ).retrieve( parent, item, obj );
953 return Helper(
this ).retrieve( parent, item, obj );
958 return Helper(
this ).retrieve( parent, item, obj );
963 return Helper(
this ).retrieve( parent, item, obj );
968 return Helper(
this ).retrieve( parent, item, obj );
972 return Helper(
this ).retrieve( par, item, obj );
977 return Helper(
this ).retrieve( par, item, obj );
982 return Helper(
this ).retrieve( par, item, obj );
987 return Helper(
this ).retrieve( par, item, obj );
992 return Helper(
this ).retrieve( par, item, obj );
997 return Helper(
this ).retrieve( par, item, obj );
1002 return Helper(
this ).retrieve( par, item, obj );
1007 return Helper(
this ).retrieve( par, item, obj );
1012 return Helper(
this ).retrieve( par, item, obj );
1017 return Helper(
this ).retrieve( par, item, obj );
1022 return Helper(
this ).retrieve( ::detail::cast( par ), item, obj );
1027 return Helper(
this ).retrieve( ::detail::cast( par ), item, obj );
1032 return Helper(
this ).retrieve( ::detail::cast( par ), item, obj );
1037 return Helper(
this ).retrieve( ::detail::cast( par ), item, obj );
1042 return Helper(
this ).retrieve( ::detail::cast( par ), item, obj );
1047 return Helper(
this ).retrieve( ::detail::cast( par ), item, obj );
1052 return Helper(
this ).retrieve( ::detail::cast( par ), item, obj );
1057 return Helper(
this ).retrieve( ::detail::cast( par ), item, obj );
1062 return Helper(
this ).retrieve( ::detail::cast( par ), item, obj );
1067 return Helper(
this ).retrieve( ::detail::cast( par ), item, obj );
1072 return Helper(
this ).find( pReg, path, obj );
1076 return Helper(
this ).find( pReg, path, obj );
1080 return Helper(
this ).find( pReg, path, obj );
1084 return Helper(
this ).find( pReg, path, obj );
1088 return Helper(
this ).find( pReg, path, obj );
1092 return Helper(
this ).find( full, obj );
1096 return Helper(
this ).find( full, obj );
1101 return Helper(
this ).find( full, obj );
1106 return Helper(
this ).find( full, obj );
1111 return Helper(
this ).find( full, obj );
1116 return Helper(
this ).find( par, rel, obj );
1121 return Helper(
this ).find( par, rel, obj );
1126 return Helper(
this ).find( par, rel, obj );
1131 return Helper(
this ).find( par, rel, obj );
1136 return Helper(
this ).find( par, rel, obj );
1141 return Helper(
this ).find( par, item, obj );
1146 return Helper(
this ).find( par, item, obj );
1151 return Helper(
this ).find( par, item, obj );
1156 return Helper(
this ).find( par, item, obj );
1161 return Helper(
this ).find( par, item, obj );
1166 return Helper(
this ).find( par, item, obj );
1171 return Helper(
this ).find( par, item, obj );
1176 return Helper(
this ).find( par, item, obj );
1181 return Helper(
this ).find( par, item, obj );
1186 return Helper(
this ).find( par, item, obj );
1191 return Helper(
this ).find( par, item, obj );
1196 return Helper(
this ).find( par, item, obj );
1201 return Helper(
this ).find( par, item, obj );
1206 return Helper(
this ).find( par, item, obj );
1211 return Helper(
this ).find( par, item, obj );
1216 return Helper(
this ).find( ::detail::cast( par ), item, obj );
1221 return Helper(
this ).find( ::detail::cast( par ), item, obj );
1226 return Helper(
this ).find( ::detail::cast( par ), item, obj );
1231 return Helper(
this ).find( ::detail::cast( par ), item, obj );
1236 return Helper(
this ).find( ::detail::cast( par ), item, obj );
1241 return Helper(
this ).find( ::detail::cast( par ), item, obj );
1246 return Helper(
this ).find( ::detail::cast( par ), item, obj );
1251 return Helper(
this ).find( ::detail::cast( par ), item, obj );
1256 return Helper(
this ).find( ::detail::cast( par ), item, obj );
1261 return Helper(
this ).find( ::detail::cast( par ), item, obj );
1266 return sliceX( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN );
1271 return sliceY( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN );
1276 return sliceX( name, h, indexY, indexY );
1281 return sliceY( name, h, indexX, indexX );
1286 const AIDA::IHistogram1D& b ) {
1292 const AIDA::IHistogram1D& b ) {
1298 const AIDA::IHistogram1D& b ) {
1304 const AIDA::IHistogram1D& b ) {
1310 const AIDA::IHistogram2D& b ) {
1316 const AIDA::IHistogram2D& b ) {
1322 const AIDA::IHistogram2D& b ) {
1328 const AIDA::IHistogram2D& b ) {
1334 const AIDA::IHistogram3D& b ) {
1340 const AIDA::IHistogram3D& b ) {
1346 const AIDA::IHistogram3D& b ) {
1352 const AIDA::IHistogram3D& b ) {
1358 return i_project( nameAndTitle, h,
"xy" );
1363 return i_project( nameAndTitle, h,
"xz" );
1368 return i_project( nameAndTitle, h,
"yz" );
1373 double lowx,
double upx ) {
1374 return book( name, title, nx, lowx, upx );
1380 return book( name, title, nx, lowx, upx );
1386 return book( name, title, x );
1392 return book( nameAndTitle, nameAndTitle, nx, lowx, upx );
1402 const AIDA::IHistogram1D& h ) {
1408 const AIDA::IHistogram1D& h ) {
1409 return createCopy( loc.first, loc.second, h );
1419 double lowx,
double upx,
int ny,
double lowy,
double upy ) {
1420 return book( name, title, nx, lowx, upx, ny, lowy, upy );
1425 double lowx,
double upx,
int ny,
double lowy,
double upy,
1427 return book( name, title, nx, lowx, upx, ny, lowy, upy );
1433 return book( name, title, x, y );
1438 int ny,
double lowy,
double upy ) {
1439 return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy );
1449 const AIDA::IHistogram2D& h ) {
1455 const AIDA::IHistogram2D& h ) {
1456 return createCopy( loc.first, loc.second, h );
1466 double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
1467 double lowz,
double upz ) {
1468 return book( name, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1473 double lowx,
double upx,
int ny,
double lowy,
double upy,
int nz,
1475 return book( name, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1481 return book( name, title, x, y, z );
1486 int ny,
double lowy,
double upy,
int nz,
double lowz,
1488 return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1498 const AIDA::IHistogram3D& h ) {
1504 const AIDA::IHistogram3D& h ) {
1505 return createCopy( loc.first, loc.second, h );
1516 return bookProf( name, title, nx, lowx, upx, opt );
1521 double upx,
double upper,
double lower,
const std::string& opt ) {
1522 return bookProf( name, title, nx, lowx, upx, upper, lower, opt );
1533 double upper,
double lower,
const std::string& ) {
1534 return bookProf( name, title, x, upper, lower );
1539 return bookProf( nametit, nametit, nx, lowx, upx,
"s" );
1544 double upper,
double lower ) {
1545 return bookProf( nametit, nametit, nx, lowx, upx, upper, lower,
"s" );
1555 const AIDA::IProfile1D& h ) {
1561 const AIDA::IProfile1D& h ) {
1562 return createCopy( loc.first, loc.second, h );
1572 double upx,
int ny,
double lowy,
double upy ) {
1573 return bookProf( name, title, nx, lowx, upx, ny, lowy, upy );
1578 double upx,
int ny,
double lowy,
double upy,
1580 return bookProf( name, title, nx, lowx, upx, ny, lowy, upy );
1586 return bookProf( name, title, x, y );
1591 int ny,
double lowy,
double upy ) {
1592 return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy );
1597 double upx,
int ny,
double lowy,
double upy,
double upper,
1599 return bookProf( name, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
1604 double upx,
int ny,
double lowy,
double upy,
double upper,
1606 return bookProf( name, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
1611 const Edges& y,
double upper,
double lower,
1613 return bookProf( name, title, x, y, upper, lower );
1618 int ny,
double lowy,
double upy,
double upper,
double lower ) {
1619 return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy, upper, lower );
1629 const AIDA::IProfile2D& h ) {
1635 const AIDA::IProfile2D& h ) {
1636 return createCopy( loc.first, loc.second, h );
Parse attribute strings allowing iteration over the various attributes.
AIDA::IProfile2D * createProfile2D(const std::string &name, const std::string &title, int nx, double lowx, double upx, int ny, double lowy, double upy)
Gaudi::Property< CLID > m_rootCLID
virtual std::ostream & write(std::ostream &s) const =0
Write (binary) histogram to output stream.
Gaudi::Property< Histo1DMap > m_defs1D
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
const long HBOOK_StorageType
std::set< std::string > m_mods1D
AIDA::IHistogram1D * add(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) override
StatusCode registerObject(const std::string &parent, const std::string &rel, Base *obj) override
std::pair< DataObject *, AIDA::IHistogram2D * > createH2D(const AIDA::IHistogram2D &hist)
Copy constructor.
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.
DataObject * createDirectory(const std::string &parentDir, const std::string &subDir) override
Create a sub-directory in a directory.
unsigned long release() override
release reference to object
std::pair< DataObject *, AIDA::IHistogram1D * > slice1DY(const std::string &name, const AIDA::IHistogram2D &h, int firstbin, int lastbin)
Create 1D slice from 2D histogram.
AIDA::IHistogram2D * projectionXY(const std::string &nameAndTitle, const AIDA::IHistogram3D &h) override
Gaudi::Property< std::string > m_rootName
StatusCode retrieveObject(IRegistry *pReg, const std::string &path, AIDA::IHistogram1D *&obj) override
constexpr static const auto SUCCESS
AIDA::IHistogram1D * sliceX(const std::string &name, const AIDA::IHistogram2D &h, int indexY) override
~HistogramSvc() override
Destructor.
AIDA::IHistogram1D * createHistogram1D(const std::string &name, const std::string &title, int nx, double lowx, double upx)
StatusCode unregisterObject(Base *obj) override
Generic Transient Address.
virtual std::ostream & print(std::ostream &s) const =0
Print histogram to output stream.
StatusCode registerObject(boost::string_ref parentPath, boost::string_ref objPath, DataObject *pObject) override
Register object with the data store.
StatusCode initialize() override
Initialise the service.
IRegistry * registry() const
Get pointer to Registry.
AIDA::IHistogram1D * subtract(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) override
StatusCode finalize() override
finalize the service
T * i_book(DataObject *pPar, const std::string &rel, const std::string &title, const std::pair< DataObject *, T * > &o)
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::IHistogram2D * projectionXZ(const std::string &nameAndTitle, const AIDA::IHistogram3D &h) override
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)
std::ostream & print(Base *h, std::ostream &s=std::cout) const override
Print (ASCII) the 1D histogram into the output stream.
AIDA::IHistogram1D * sliceY(const std::string &name, const AIDA::IHistogram2D &h, int indexX) override
AIDA::IHistogram1D * projectionY(const std::string &name, const AIDA::IHistogram2D &h) override
virtual const id_type & identifier() const =0
Full identifier (or key)
StatusCode connectInput(const std::string &ident)
Connect input histogram file to the service.
std::pair< DataObject *, AIDA::IHistogram3D * > createH3D(const AIDA::IHistogram3D &hist)
Copy constructor.
bool destroy(IBaseHistogram *hist) override
This class is used for returning status codes from appropriate routines.
void clear(STATE_TYPE _i=std::ios_base::failbit)
AIDA::IHistogram1D * projectionX(const std::string &name, const AIDA::IHistogram2D &h) override
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
AIDA::IHistogram1D * multiply(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) override
AIDA::IBaseHistogram Base
The IRegistry represents the entry door to the environment any data object residing in a transient da...
const long ROOT_StorageType
StatusCode finalize() override
Service initialization.
std::ostream & write(Base *h, std::ostream &s=std::cout) const override
Write (ASCII) the 1D histogram table into the output stream.
std::pair< DataObject *, AIDA::IHistogram1D * > slice1DX(const std::string &name, const AIDA::IHistogram2D &h, int firstbin, int lastbin)
Create 1D slice from 2D histogram.
DataObject * createPath(const std::string &newPath) override
Create all directories in a given full path.
AIDA::IHistogram1D * divide(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) override
AIDA::IProfile1D * createProfile1D(const std::string &name, const std::string &title, int nx, double lowx, double upx, const std::string &opt) override
StatusCode findObject(IRegistry *pReg, const std::string &path, AIDA::IProfile1D *&obj) override
std::pair< std::string, std::string > i_splitPath(const std::string &full)
Split full path into its components.
Common base class for all histograms Use is solely functional to minimize dynamic_casts inside Histog...
std::pair< DataObject *, AIDA::IProfile2D * > createProf2D(const AIDA::IProfile2D &hist)
Copy constructor.
HistogramSvc(const std::string &name, ISvcLocator *svc)
Statndard Constructor.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
StatusCode initialize() override
Service initialization.
AIDA::IHistogram2D * createHistogram2D(const std::string &name, const std::string &title, int nx, double lowx, double upx, int ny, double lowy, double upy)
constexpr static const auto FAILURE
static R * act(R *res, const S &b, void(T1::*pmf)(const T2 *, Double_t), Double_t scale)
static int toRootIndex(int index, int nbins)
AIDA::IHistogram2D * projectionYZ(const std::string &nameAndTitle, const AIDA::IHistogram3D &h) override
AIDA::IHistogram1D * createCopy(const std::string &full, const AIDA::IHistogram1D &h) override
StatusCode reinitialize() override
Initialise the service.
AIDA::IHistogram2D * i_project(const std::string &nameAndTitle, const AIDA::IHistogram3D &h, const std::string &dir)
Helper for 2D projections.
A DataObject is the base class of any identifiable object on any data store.
void toupper(std::string &s)
std::pair< DataObject *, AIDA::IHistogram1D * > createH1D(const AIDA::IHistogram1D &hist)
Copy constructor.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
std::pair< DataObject *, AIDA::IProfile1D * > createProf1D(const AIDA::IProfile1D &hist)
Copy constructor.
void update1Ddefs()
handler to be invoked for updating property m_defs1D
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)