Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HistogramSvc.cpp
Go to the documentation of this file.
1 #ifdef __ICC
2 // disable icc remark #2259: non-pointer conversion from "X" to "Y" may lose significant bits
3 // TODO: To be removed, since it comes from ROOT TMathBase.h
4 # pragma warning( disable : 2259 )
5 #endif
6 #ifdef WIN32
7 // Disable warning
8 // warning C4996: 'sprintf': This function or variable may be unsafe.
9 // coming from TString.h
10 # pragma warning( disable : 4996 )
11 #endif
12 
13 // STD & STL
14 #include <cstdlib>
15 #include <sstream>
16 #include <stdexcept>
17 
18 // GaudiKernel
20 #include "GaudiKernel/DataObject.h"
23 #include "GaudiKernel/Property.h"
24 
25 // Local
26 #include "GaudiPI.h"
28 
29 namespace {
30  using namespace AIDA;
31  using std::string;
32 
33  string histoAddr( const string& name ) {
34  if ( 0 == name.find( "/stat/" ) ) { return string( name, 6 ); }
35  return name;
36  }
37 
38  string histoAddr( const DataObject* obj, const string& rel ) {
39  if ( !obj ) { return rel; }
40  IRegistry* reg = obj->registry();
41  if ( !reg ) { return rel; }
42  const string& name = reg->identifier();
43  //
44  if ( rel.empty() ) { return histoAddr( name ); }
45  if ( '/' == name[name.size() - 1] || '/' == rel[0] ) { return histoAddr( name + rel ); }
46  return histoAddr( name + "/" + rel );
47  }
48 
49  size_t removeLeading( HistogramSvc::Histo1DMap& m, const string& lead = "/stat/" ) {
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() );
53  Gaudi::Histo1DDef hdef = it->second;
54  m.erase( it ); // remove
55  m[addr] = hdef; // insert
56  return 1 + removeLeading( m, lead ); // return
57  }
58 } // namespace
59 
60 //------------------------------------------------------------------------------
61 StatusCode HistogramSvc::registerObject( const string& full, IBaseHistogram* obj ) {
62  std::pair<string, string> split = i_splitPath( full );
63  return registerObject( split.first, split.second, obj );
64 }
65 
66 //------------------------------------------------------------------------------
67 StatusCode HistogramSvc::registerObject( DataObject* pPar, const string& obj, IBaseHistogram* hObj ) {
68  // Set the histogram id
69  if ( obj[0] == SEPARATOR ) {
70  // hObj->setTitle(obj.substr(1) + "|" + hObj->title());
71  if ( !hObj->annotation().addItem( "id", obj.substr( 1 ) ) ) hObj->annotation().setValue( "id", obj.substr( 1 ) );
72  } else {
73  // hObj->setTitle(obj + "|" + hObj->title());
74  if ( !hObj->annotation().addItem( "id", obj ) ) hObj->annotation().setValue( "id", obj );
75  }
76  // Register the histogram in the histogram data store
77  return DataSvc::registerObject( pPar, obj, ::detail::cast( hObj ) );
78 }
79 
80 // Helper for 2D projections
81 AIDA::IHistogram2D* HistogramSvc::i_project( const string& nameAndTitle, const IHistogram3D& h, const string& dir ) {
82  TH3D* h3d = Gaudi::getRepresentation<IHistogram3D, TH3D>( h );
83  if ( h3d ) {
84  TH2D* h2d = dynamic_cast<TH2D*>( h3d->Project3D( dir.c_str() ) );
85  if ( h2d ) {
87  if ( r.second && registerObject( nameAndTitle, r.second ).isSuccess() ) { return r.second; }
88  }
89  }
90  return nullptr;
91 }
92 
93 //------------------------------------------------------------------------------
94 // ASCII output
95 //------------------------------------------------------------------------------
96 std::ostream& HistogramSvc::print( IBaseHistogram* h, std::ostream& s ) const {
97  Gaudi::HistogramBase* b = dynamic_cast<Gaudi::HistogramBase*>( h );
98  if ( b ) return b->print( s );
99  error() << "Unknown histogram type: Cannot cast to Gaudi::HistogramBase." << endmsg;
100  return s;
101 }
102 
103 //------------------------------------------------------------------------------
104 std::ostream& HistogramSvc::write( IBaseHistogram* h, std::ostream& s ) const {
105  Gaudi::HistogramBase* b = dynamic_cast<Gaudi::HistogramBase*>( h );
106  if ( b ) return b->write( s );
107  error() << "Unknown histogram type: Cannot cast to Gaudi::HistogramBase." << endmsg;
108  return s;
109 }
110 
111 //------------------------------------------------------------------------------
112 int HistogramSvc::write( IBaseHistogram* h, const char* file_name ) const {
113  Gaudi::HistogramBase* b = dynamic_cast<Gaudi::HistogramBase*>( h );
114  if ( b ) return b->write( file_name );
115  error() << "Unknown histogram type: Cannot cast to Gaudi::HistogramBase." << endmsg;
116  return 0;
117 }
118 
119 //------------------------------------------------------------------------------
121  string tmp = full;
122  if ( tmp[0] != SEPARATOR ) {
123  tmp.insert( tmp.begin(), SEPARATOR );
124  tmp.insert( tmp.begin(), m_rootName.begin(), m_rootName.end() );
125  }
126  // Remove trailing "/" from newPath if it exists
127  if ( tmp.rfind( SEPARATOR ) == tmp.length() - 1 ) { tmp.erase( tmp.length() - 1, 1 ); }
128  int sep = tmp.rfind( SEPARATOR );
129  return {tmp.substr( 0, sep ), tmp.substr( sep )};
130 }
131 
132 //------------------------------------------------------------------------------
133 DataObject* HistogramSvc::createPath( const string& newPath ) {
134  string tmpPath = newPath;
135  if ( tmpPath[0] != SEPARATOR ) {
136  tmpPath.insert( tmpPath.begin(), SEPARATOR );
137  tmpPath.insert( tmpPath.begin(), m_rootName.begin(), m_rootName.end() );
138  }
139  // Remove trailing "/" from newPath if it exists
140  if ( tmpPath.rfind( SEPARATOR ) == tmpPath.length() - 1 ) { tmpPath.erase( tmpPath.rfind( SEPARATOR ), 1 ); }
141  DataObject* pObject = nullptr;
142  StatusCode sc = findObject( tmpPath, pObject );
143  if ( sc.isSuccess() ) { return pObject; }
144  int sep = tmpPath.rfind( SEPARATOR );
145  string rest( tmpPath, sep + 1, tmpPath.length() - sep );
146  string subPath( tmpPath, 0, sep );
147  if ( 0 != sep ) {
148  createPath( subPath );
149  } else {
150  error() << "Unable to create the histogram path" << endmsg;
151  return nullptr;
152  }
153  pObject = createDirectory( subPath, rest );
154  return pObject;
155 }
156 
157 //------------------------------------------------------------------------------
158 DataObject* HistogramSvc::createDirectory( const string& parentDir, const string& subDir ) {
159  auto directory = std::make_unique<DataObject>();
160  if ( directory ) {
161  DataObject* pnode;
162  StatusCode status = retrieveObject( parentDir, pnode );
163  if ( !status.isSuccess() ) {
164  error() << "Unable to create the histogram directory: " << parentDir << "/" << subDir << endmsg;
165  return nullptr;
166  }
167  status = DataSvc::registerObject( pnode, subDir, directory.get() );
168  if ( !status.isSuccess() ) {
169  error() << "Unable to create the histogram directory: " << parentDir << "/" << subDir << endmsg;
170  return nullptr;
171  }
172  }
173  return directory.release();
174 }
175 
176 //------------------------------------------------------------------------------
178  setDataLoader( nullptr ).ignore();
179  clearStore().ignore();
180 }
181 
182 //------------------------------------------------------------------------------
183 StatusCode HistogramSvc::connectInput( const string& ident ) {
184  using Parser = Gaudi::Utils::AttribStringParser;
185  DataObject* pO = nullptr;
186  StatusCode status = this->findObject( m_rootName.value(), pO );
187  if ( status.isSuccess() ) {
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] ) ) {
193  case 'F': // FILE='<file name>'
194  case 'D': // DATAFILE='<file name>'
195  filename = std::move( attrib.value );
196  break;
197  case 'T': // TYP='<HBOOK,ROOT,OBJY,...>'
198  typ = std::move( attrib.value );
199  break;
200  default:
201  break;
202  }
203  }
204  if ( typ.length() > 0 ) {
205  // Now add the registry entry to the store
206  string entryname = m_rootName;
207  entryname += '/';
208  entryname += logname;
209  GenericAddress* pA = nullptr;
210  switch ( ::toupper( typ[0] ) ) {
211  case 'H':
212  pA = new GenericAddress( HBOOK_StorageType, CLID_StatisticsFile, filename, entryname, 0, 'O' );
213  break;
214  case 'R':
215  pA = new GenericAddress( ROOT_StorageType, CLID_StatisticsFile, filename, entryname, 0, 'O' );
216  break;
217  }
218  if ( pA ) {
219  status = registerAddress( pO, logname, pA );
220  if ( status.isSuccess() ) {
221  info() << "Added stream file:" << filename << " as " << logname << endmsg;
222  return status;
223  }
224  pA->release();
225  }
226  }
227  }
228  error() << "Cannot add " << ident << " invalid filename!" << endmsg;
229  return StatusCode::FAILURE;
230 }
231 
232 //------------------------------------------------------------------------------
234  StatusCode status = DataSvc::initialize();
235  // Set root object
236  if ( status.isSuccess() ) {
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;
241  return status;
242  }
243  rootObj.release();
244  auto svc = service<IConversionSvc>( "HistogramPersistencySvc", true );
245  if ( !svc ) {
246  error() << "Could not find HistogramPersistencySvc." << endmsg;
247  return StatusCode::FAILURE;
248  }
249  setDataLoader( svc.get() ).ignore();
250  // Connect all input streams (if any)
251  for ( auto& j : m_input ) {
252  status = connectInput( j );
253  if ( !status.isSuccess() ) return status;
254  }
255  }
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;
261  }
262  }
263  return status;
264 }
265 
266 //------------------------------------------------------------------------------
268 
269 //------------------------------------------------------------------------------
270 IHistogram1D* HistogramSvc::sliceX( const string& name, const IHistogram2D& h, int idxY1, int idxY2 ) {
271  std::pair<DataObject*, IHistogram1D*> o( nullptr, nullptr );
272  try {
273  int firstbin = Gaudi::Axis::toRootIndex( idxY1, h.yAxis().bins() );
274  int lastbin = Gaudi::Axis::toRootIndex( idxY2, h.yAxis().bins() );
275  o = Gaudi::slice1DX( name, h, firstbin, lastbin );
276  } catch ( ... ) {
277  throw GaudiException( "Cannot cast 2D histogram to H2D to create sliceX `" + name + "'!", "HistogramSvc",
279  }
280  if ( o.first && registerObject( name, o.second ).isSuccess() ) { return o.second; }
281  delete o.first;
282  throw GaudiException( "Cannot create sliceX `" + name + "' of 2D histogram!", "HistogramSvc", StatusCode::FAILURE );
283 }
284 
285 //------------------------------------------------------------------------------
286 IHistogram1D* HistogramSvc::sliceY( const string& name, const IHistogram2D& h, int indexX1, int indexX2 ) {
287  std::pair<DataObject*, IHistogram1D*> o( nullptr, nullptr );
288  try {
289  int firstbin = Gaudi::Axis::toRootIndex( indexX1, h.xAxis().bins() );
290  int lastbin = Gaudi::Axis::toRootIndex( indexX2, h.xAxis().bins() );
291  o = Gaudi::slice1DY( name, h, firstbin, lastbin );
292  } catch ( ... ) {
293  throw GaudiException( "Cannot create sliceY `" + name + "'!", "HistogramSvc", StatusCode::FAILURE );
294  }
295  // name stands here for the fullPath of the histogram
296  if ( o.first && registerObject( name, (IBaseHistogram*)o.second ).isSuccess() ) { return o.second; }
297  delete o.first;
298  throw GaudiException( "Cannot create sliceY `" + name + "' of 2D histogram!", "HistogramSvc", StatusCode::FAILURE );
299 }
300 
301 //------------------------------------------------------------------------------
302 bool HistogramSvc::destroy( IBaseHistogram* hist ) {
303  StatusCode sc = unregisterObject( dynamic_cast<IHistogram*>( hist ) );
304  if ( !sc.isSuccess() ) return false;
305  delete hist;
306  return true;
307 }
308 
309 // ============================================================================
310 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, const string& rel, const string& title, int nx, double lowx,
311  double upx ) {
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 ) ); }
316  if ( msgLevel( MSG::DEBUG ) ) {
317  debug() << " Redefine the parameters for the histogram '" + hn + "' to be " << ifound->second << endmsg;
318  }
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() ) );
323 }
324 
325 // ============================================================================
326 // constructor
327 // ============================================================================
328 HistogramSvc::HistogramSvc( const string& nam, ISvcLocator* svc ) : base_class( nam, svc ) {
329  m_rootName = "/stat";
330  m_rootCLID = CLID_DataObject;
331 }
332 
333 // ============================================================================
335  // check and remove the leading '/stat/'
336  removeLeading( m_defs1D.value(), "/stat/" );
337 }
338 
339 // ============================================================================
340 // finalize the service
341 // ============================================================================
343  if ( !m_mods1D.empty() ) {
344  if ( msgLevel( MSG::DEBUG ) ) debug() << " Substituted histograms #" << m_mods1D.size() << " : " << endmsg;
345  for ( const auto& ih : m_mods1D ) {
346  if ( msgLevel( MSG::DEBUG ) ) debug() << " Path='" << ih << "'";
347  auto im = m_defs1D.find( ih );
348  if ( m_defs1D.end() != im ) { debug() << " " << im->second; }
349  }
350  m_mods1D.clear();
351  }
352  return DataSvc::finalize();
353 }
354 
355 // ============================================================================
356 AIDA::IHistogram1D* HistogramSvc::book( const string& par, const string& rel, const string& title, int nx, double lowx,
357  double upx ) {
358  return book( createPath( par ), rel, title, nx, lowx, upx );
359 }
360 
361 // ============================================================================
362 AIDA::IHistogram1D* HistogramSvc::book( const string& par, int hID, const string& title, int nx, double lowx,
363  double upx ) {
364  return book( par, std::to_string( hID ), title, nx, lowx, upx );
365 }
366 
367 // ============================================================================
368 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, int hID, const string& title, int nx, double lowx,
369  double upx ) {
370  return book( pPar, std::to_string( hID ), title, nx, lowx, upx );
371 }
372 
373 // ============================================================================
374 AIDA::IHistogram1D* HistogramSvc::book( const std::pair<string, string>& loc, const string& title, int nx, double lowx,
375  double upx ) {
376  return book( loc.first, loc.second, title, nx, lowx, upx );
377 }
378 
379 // ============================================================================
380 AIDA::IHistogram1D* HistogramSvc::book( const string& full, const string& title, int nx, double lowx, double upx ) {
381  return book( i_splitPath( full ), title, nx, lowx, upx );
382 }
383 
384 // ============================================================================
385 AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, const string& rel, const string& title, int nx,
386  double lowx, double upx, const string& opt ) {
387  return bookProf( createPath( par ), rel, title, nx, lowx, upx, opt );
388 }
389 
390 // ============================================================================
391 AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, int hID, const string& title, int nx, double lowx,
392  double upx, const string& opt ) {
393  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, opt );
394 }
395 
396 // ============================================================================
397 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const string& title, int nx, double lowx,
398  double upx, const string& opt ) {
399  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, opt );
400 }
401 
402 // ============================================================================
403 AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair<string, string>& loc, const string& title, int nx,
404  double lowx, double upx, const string& opt ) {
405  return bookProf( loc.first, loc.second, title, nx, lowx, upx, opt );
406 }
407 
408 // ============================================================================
409 AIDA::IProfile1D* HistogramSvc::bookProf( const string& full, const string& title, int nx, double lowx, double upx,
410  const string& opt ) {
411  return bookProf( i_splitPath( full ), title, nx, lowx, upx, opt );
412 }
413 
414 // ============================================================================
415 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const string& rel, const string& title, int nx, double lowx,
416  double upx, const string& opt ) {
417  return i_book( pPar, rel, title, Gaudi::createProf1D( title, nx, lowx, upx, 0, 0, opt ) );
418 }
419 
420 // ============================================================================
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 ) {
423  return bookProf( createPath( par ), rel, title, nx, lowx, upx, upper, lower, opt );
424 }
425 
426 // ============================================================================
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 ) {
429  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, upper, lower, opt );
430 }
431 
432 // ============================================================================
433 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const string& title, int nx, double lowx,
434  double upx, double upper, double lower, const string& opt ) {
435  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, upper, lower, opt );
436 }
437 
438 // ============================================================================
439 AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair<string, string>& loc, const string& title, int nx,
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 );
442 }
443 
444 // ============================================================================
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 ) {
447  return bookProf( i_splitPath( full ), title, nx, lowx, upx, upper, lower, opt );
448 }
449 
450 // ============================================================================
451 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const string& rel, const string& title, int nx, double lowx,
452  double upx, double upper, double lower, const string& opt ) {
453  return i_book( pPar, rel, title, Gaudi::createProf1D( title, nx, lowx, upx, upper, lower, opt ) );
454 }
455 
456 // ============================================================================
457 AIDA::IHistogram1D* HistogramSvc::book( const std::string& par, int hID, const std::string& title, Edges e ) {
458  return book( par, std::to_string( hID ), title, e );
459 }
460 
461 // ============================================================================
462 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, int hID, const std::string& title, Edges e ) {
463  return book( pPar, std::to_string( hID ), title, e );
464 }
465 
466 // ============================================================================
467 AIDA::IHistogram1D* HistogramSvc::book( const std::string& par, const std::string& rel, const std::string& title,
468  Edges e ) {
469  return book( createPath( par ), rel, title, e );
470 }
471 
472 // ============================================================================
473 AIDA::IHistogram1D* HistogramSvc::book( const std::pair<std::string, std::string>& loc, const std::string& title,
474  Edges e ) {
475  return book( loc.first, loc.second, title, e );
476 }
477 
478 // ============================================================================
479 AIDA::IHistogram1D* HistogramSvc::book( const std::string& full, const std::string& title, Edges e ) {
480  return book( i_splitPath( full ), title, e );
481 }
482 
483 // ============================================================================
484 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, const std::string& rel, const std::string& title, Edges e ) {
485  return i_book( pPar, rel, title, Gaudi::createH1D( title, e ) );
486 }
487 
488 // ============================================================================
489 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& full, const std::string& title, Edges e ) {
490  return bookProf( i_splitPath( full ), title, e );
491 }
492 
493 // ============================================================================
494 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
495  Edges e ) {
496  return bookProf( createPath( par ), rel, title, e );
497 }
498 
499 // ============================================================================
500 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, Edges e ) {
501  return bookProf( par, std::to_string( hID ), title, e );
502 }
503 
504 // ============================================================================
505 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, Edges e ) {
506  return bookProf( pPar, std::to_string( hID ), title, e );
507 }
508 
509 // ============================================================================
510 AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
511  Edges e ) {
512  return bookProf( loc.first, loc.second, title, e );
513 }
514 
515 // ============================================================================
516 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title,
517  Edges e ) {
518  return i_book( pPar, rel, title, Gaudi::createProf1D( title, e, 0, 0 ) );
519 }
520 
521 // ============================================================================
522 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& full, const std::string& title, Edges e, double upper,
523  double lower ) {
524  return bookProf( i_splitPath( full ), title, e, upper, lower );
525 }
526 
527 // ============================================================================
528 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
529  Edges e, double upper, double lower ) {
530  return bookProf( createPath( par ), rel, title, e, upper, lower );
531 }
532 
533 // ============================================================================
534 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, Edges e,
535  double upper, double lower ) {
536  return bookProf( par, std::to_string( hID ), title, e, upper, lower );
537 }
538 
539 // ============================================================================
540 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, Edges e, double upper,
541  double lower ) {
542  return bookProf( pPar, std::to_string( hID ), title, e, upper, lower );
543 }
544 
545 // ============================================================================
546 AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
547  Edges e, double upper, double lower ) {
548  return bookProf( loc.first, loc.second, title, e, upper, lower );
549 }
550 
551 // ============================================================================
552 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, Edges e,
553  double upper, double lower ) {
554  return i_book( pPar, rel, title, Gaudi::createProf1D( title, e, upper, lower ) );
555 }
556 
557 // ============================================================================
558 AIDA::IHistogram2D* HistogramSvc::book( const std::string& full, const std::string& title, int nx, double lowx,
559  double upx, int ny, double lowy, double upy ) {
560  return book( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy );
561 }
562 
563 // ============================================================================
564 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, const std::string& rel, const std::string& title,
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 );
567 }
568 
569 // ============================================================================
570 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, int hID, const std::string& title, int nx, double lowx,
571  double upx, int ny, double lowy, double upy ) {
572  return book( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
573 }
574 
575 // ============================================================================
576 AIDA::IHistogram2D* HistogramSvc::book( const std::pair<std::string, std::string>& loc, const std::string& title,
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 );
579 }
580 
581 // ============================================================================
582 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, int hID, const std::string& title, int nx, double lowx,
583  double upx, int ny, double lowy, double upy ) {
584  return book( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
585 }
586 
587 // ============================================================================
588 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, const std::string& rel, const std::string& title, int nx,
589  double lowx, double upx, int ny, double lowy, double upy ) {
590  return i_book( pPar, rel, title, Gaudi::createH2D( title, nx, lowx, upx, ny, lowy, upy ) );
591 }
592 
593 // ============================================================================
594 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, const std::string& title, int nx, double lowx,
595  double upx, int ny, double lowy, double upy, double upper, double lower ) {
596  return bookProf( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
597 }
598 
599 // ============================================================================
600 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
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 );
604 }
605 
606 // ============================================================================
607 AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
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 );
611 }
612 
613 // ============================================================================
614 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, int nx,
615  double lowx, double upx, int ny, double lowy, double upy, double upper,
616  double lower ) {
617  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
618 }
619 
620 // ============================================================================
621 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, int nx, double lowx,
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 );
624 }
625 
626 // ============================================================================
627 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, int nx,
628  double lowx, double upx, int ny, double lowy, double upy, double upper,
629  double lower ) {
630  return i_book( pPar, rel, title, Gaudi::createProf2D( title, nx, lowx, upx, ny, lowy, upy, upper, lower ) );
631 }
632 
633 // ============================================================================
634 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, const std::string& title, int nx, double lowx,
635  double upx, int ny, double lowy, double upy ) {
636  return bookProf( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy );
637 }
638 
639 // ============================================================================
640 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
641  int nx, double lowx, double upx, int ny, double lowy, double upy ) {
642  return bookProf( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy );
643 }
644 
645 // ============================================================================
646 AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
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 );
649 }
650 
651 // ============================================================================
652 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, int nx,
653  double lowx, double upx, int ny, double lowy, double upy ) {
654  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
655 }
656 
657 // ============================================================================
658 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, int nx, double lowx,
659  double upx, int ny, double lowy, double upy ) {
660  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
661 }
662 
663 // ============================================================================
664 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, int nx,
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 ) );
667 }
668 
669 // ============================================================================
670 AIDA::IHistogram2D* HistogramSvc::book( const std::string& full, const std::string& title, Edges x, Edges y ) {
671  return book( i_splitPath( full ), title, x, y );
672 }
673 
674 // ============================================================================
675 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, const std::string& rel, const std::string& title,
676  Edges x, Edges y ) {
677  return book( createPath( par ), rel, title, x, y );
678 }
679 
680 // ============================================================================
681 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, int hID, const std::string& title, Edges x, Edges y ) {
682  return book( par, std::to_string( hID ), title, x, y );
683 }
684 
685 // ============================================================================
686 AIDA::IHistogram2D* HistogramSvc::book( const std::pair<std::string, std::string>& loc, const std::string& title,
687  Edges x, Edges y ) {
688  return book( loc.first, loc.second, title, x, y );
689 }
690 
691 // ============================================================================
692 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, int hID, const std::string& title, Edges x, Edges y ) {
693  return book( pPar, std::to_string( hID ), title, x, y );
694 }
695 
696 // ============================================================================
697 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, const std::string& rel, const std::string& title, Edges x,
698  Edges y ) {
699  return i_book( pPar, rel, title, Gaudi::createH2D( title, x, y ) );
700 }
701 
702 // ============================================================================
703 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, const std::string& title, Edges x, Edges y ) {
704  return bookProf( i_splitPath( full ), title, x, y );
705 }
706 
707 // ============================================================================
708 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
709  Edges x, Edges y ) {
710  return bookProf( createPath( par ), rel, title, x, y );
711 }
712 
713 // ============================================================================
714 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, Edges x,
715  Edges y ) {
716  return bookProf( par, std::to_string( hID ), title, x, y );
717 }
718 
719 // ============================================================================
720 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, Edges x, Edges y ) {
721  return bookProf( pPar, std::to_string( hID ), title, x, y );
722 }
723 
724 // ============================================================================
725 AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
726  Edges x, Edges y ) {
727  return bookProf( loc.first, loc.second, title, x, y );
728 }
729 
730 // ============================================================================
731 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, Edges x,
732  Edges y ) {
733  return i_book( pPar, rel, title, Gaudi::createProf2D( title, x, y, 0, 0 ) );
734 }
735 
736 // ============================================================================
737 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, const std::string& title, Edges x, Edges y,
738  double upper, double lower ) {
739  return bookProf( i_splitPath( full ), title, x, y, upper, lower );
740 }
741 
742 // ============================================================================
743 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
744  Edges x, Edges y, double upper, double lower ) {
745  return bookProf( createPath( par ), rel, title, x, y, upper, lower );
746 }
747 
748 // ============================================================================
749 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, Edges x, Edges y,
750  double upper, double lower ) {
751  return bookProf( par, std::to_string( hID ), title, x, y, upper, lower );
752 }
753 
754 // ============================================================================
755 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, Edges x, Edges y,
756  double upper, double lower ) {
757  return bookProf( pPar, std::to_string( hID ), title, x, y, upper, lower );
758 }
759 
760 // ============================================================================
761 AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
762  Edges x, Edges y, double upper, double lower ) {
763  return bookProf( loc.first, loc.second, title, x, y, upper, lower );
764 }
765 
766 // ============================================================================
767 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, Edges x,
768  Edges y, double upper, double lower ) {
769  return i_book( pPar, rel, title, Gaudi::createProf2D( title, x, y, upper, lower ) );
770 }
771 
772 // ============================================================================
773 AIDA::IHistogram3D* HistogramSvc::book( const std::string& full, const std::string& title, int nx, double lowx,
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 );
776 }
777 
778 // ============================================================================
779 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, const std::string& rel, const std::string& title,
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 );
783 }
784 
785 // ============================================================================
786 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, int hID, const std::string& title, int nx, double lowx,
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 );
789 }
790 
791 // ============================================================================
792 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, int hID, const std::string& title, int nx, double lowx,
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 );
795 }
796 
797 // ============================================================================
798 AIDA::IHistogram3D* HistogramSvc::book( const std::pair<std::string, std::string>& loc, const std::string& title,
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 );
802 }
803 
804 // ============================================================================
805 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, const std::string& rel, const std::string& title, int nx,
806  double lowx, double upx, int ny, double lowy, double upy, int nz, double lowz,
807  double upz ) {
808  return i_book( pPar, rel, title, Gaudi::createH3D( title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ) );
809 }
810 
811 // ============================================================================
812 AIDA::IHistogram3D* HistogramSvc::book( const std::string& full, const std::string& title, Edges x, Edges y, Edges z ) {
813  return book( i_splitPath( full ), title, x, y, z );
814 }
815 
816 // ============================================================================
817 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, const std::string& rel, const std::string& title,
818  Edges x, Edges y, Edges z ) {
819  return book( createPath( par ), rel, title, x, y, z );
820 }
821 
822 // ============================================================================
823 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, int hID, const std::string& title, Edges x, Edges y,
824  Edges z ) {
825  return book( par, std::to_string( hID ), title, x, y, z );
826 }
827 
828 // ============================================================================
829 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, int hID, const std::string& title, Edges x, Edges y,
830  Edges z ) {
831  return book( pPar, std::to_string( hID ), title, x, y, z );
832 }
833 
834 // ============================================================================
835 AIDA::IHistogram3D* HistogramSvc::book( const std::pair<std::string, std::string>& loc, const std::string& title,
836  Edges x, Edges y, Edges z ) {
837  return book( loc.first, loc.second, title, x, y, z );
838 }
839 
840 // ============================================================================
841 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, const std::string& rel, const std::string& title, Edges x,
842  Edges y, Edges z ) {
843  return i_book( pPar, rel, title, Gaudi::createH3D( title, x, y, z ) );
844 }
845 
846 // ============================================================================
848  return registerObject( createPath( parent ), rel, obj );
849 }
850 
851 // ============================================================================
853  return registerObject( ::detail::cast( pPar ), rel, obj );
854 }
855 
856 // ============================================================================
857 StatusCode HistogramSvc::unregisterObject( Base* obj ) { return unregisterObject( ::detail::cast( obj ) ); }
858 
859 // ============================================================================
861  return unregisterObject( ::detail::cast( obj ), objectPath );
862 }
863 
864 // ============================================================================
866  return unregisterObject( ::detail::cast( obj ), item );
867 }
868 
869 // ============================================================================
870 StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram1D*& obj ) {
871  return Helper( this ).retrieve( pReg, path, obj );
872 }
873 
874 // ============================================================================
875 StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, AIDA::IProfile1D*& obj ) {
876  return Helper( this ).retrieve( pReg, path, obj );
877 }
878 
879 // ============================================================================
880 StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram2D*& obj ) {
881  return Helper( this ).retrieve( pReg, path, obj );
882 }
883 
884 // ============================================================================
885 StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, AIDA::IProfile2D*& obj ) {
886  return Helper( this ).retrieve( pReg, path, obj );
887 }
888 
889 // ============================================================================
890 StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram3D*& obj ) {
891  return Helper( this ).retrieve( pReg, path, obj );
892 }
893 
894 // ============================================================================
895 StatusCode HistogramSvc::retrieveObject( const std::string& full, AIDA::IProfile1D*& obj ) {
896  return Helper( this ).retrieve( full, obj );
897 }
898 
899 // ============================================================================
900 StatusCode HistogramSvc::retrieveObject( const std::string& full, AIDA::IProfile2D*& obj ) {
901  return Helper( this ).retrieve( full, obj );
902 }
903 
904 // ============================================================================
905 StatusCode HistogramSvc::retrieveObject( const std::string& full, AIDA::IHistogram1D*& obj ) {
906  return Helper( this ).retrieve( full, obj );
907 }
908 
909 // ============================================================================
910 StatusCode HistogramSvc::retrieveObject( const std::string& full, AIDA::IHistogram2D*& obj ) {
911  return Helper( this ).retrieve( full, obj );
912 }
913 
914 // ============================================================================
915 StatusCode HistogramSvc::retrieveObject( const std::string& full, AIDA::IHistogram3D*& obj ) {
916  return Helper( this ).retrieve( full, obj );
917 }
918 
919 // ============================================================================
921 
922  AIDA::IProfile1D*& obj ) {
923  return Helper( this ).retrieve( parent, rel, obj );
924 }
925 
926 // ============================================================================
927 StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, AIDA::IProfile2D*& obj ) {
928  return Helper( this ).retrieve( parent, rel, obj );
929 }
930 
931 // ============================================================================
932 StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, AIDA::IHistogram1D*& obj ) {
933  return Helper( this ).retrieve( parent, rel, obj );
934 }
935 
936 // ============================================================================
937 StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, AIDA::IHistogram2D*& obj ) {
938  return Helper( this ).retrieve( parent, rel, obj );
939 }
940 
941 // ============================================================================
942 StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, AIDA::IHistogram3D*& obj ) {
943  return Helper( this ).retrieve( parent, rel, obj );
944 }
945 
946 // ============================================================================
947 StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, AIDA::IProfile1D*& obj ) {
948  return Helper( this ).retrieve( parent, item, obj );
949 }
950 
951 // ============================================================================
952 StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, AIDA::IProfile2D*& obj ) {
953  return Helper( this ).retrieve( parent, item, obj );
954 }
955 
956 // ============================================================================
957 StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, AIDA::IHistogram1D*& obj ) {
958  return Helper( this ).retrieve( parent, item, obj );
959 }
960 
961 // ============================================================================
962 StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, AIDA::IHistogram2D*& obj ) {
963  return Helper( this ).retrieve( parent, item, obj );
964 }
965 
966 // ============================================================================
967 StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, AIDA::IHistogram3D*& obj ) {
968  return Helper( this ).retrieve( parent, item, obj );
969 }
970 // ============================================================================
971 StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, AIDA::IProfile1D*& obj ) {
972  return Helper( this ).retrieve( par, item, obj );
973 }
974 
975 // ============================================================================
976 StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, AIDA::IProfile2D*& obj ) {
977  return Helper( this ).retrieve( par, item, obj );
978 }
979 
980 // ============================================================================
981 StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, AIDA::IHistogram1D*& obj ) {
982  return Helper( this ).retrieve( par, item, obj );
983 }
984 
985 // ============================================================================
986 StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, AIDA::IHistogram2D*& obj ) {
987  return Helper( this ).retrieve( par, item, obj );
988 }
989 
990 // ============================================================================
991 StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, AIDA::IHistogram3D*& obj ) {
992  return Helper( this ).retrieve( par, item, obj );
993 }
994 
995 // ============================================================================
996 StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, AIDA::IProfile1D*& obj ) {
997  return Helper( this ).retrieve( par, item, obj );
998 }
999 
1000 // ============================================================================
1001 StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, AIDA::IProfile2D*& obj ) {
1002  return Helper( this ).retrieve( par, item, obj );
1003 }
1004 
1005 // ============================================================================
1006 StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, AIDA::IHistogram1D*& obj ) {
1007  return Helper( this ).retrieve( par, item, obj );
1008 }
1009 
1010 // ============================================================================
1011 StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, AIDA::IHistogram2D*& obj ) {
1012  return Helper( this ).retrieve( par, item, obj );
1013 }
1014 
1015 // ============================================================================
1016 StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, AIDA::IHistogram3D*& obj ) {
1017  return Helper( this ).retrieve( par, item, obj );
1018 }
1019 
1020 // ============================================================================
1021 StatusCode HistogramSvc::retrieveObject( Base* par, int item, AIDA::IProfile1D*& obj ) {
1022  return Helper( this ).retrieve( ::detail::cast( par ), item, obj );
1023 }
1024 
1025 // ============================================================================
1026 StatusCode HistogramSvc::retrieveObject( Base* par, int item, AIDA::IProfile2D*& obj ) {
1027  return Helper( this ).retrieve( ::detail::cast( par ), item, obj );
1028 }
1029 
1030 // ============================================================================
1031 StatusCode HistogramSvc::retrieveObject( Base* par, int item, AIDA::IHistogram1D*& obj ) {
1032  return Helper( this ).retrieve( ::detail::cast( par ), item, obj );
1033 }
1034 
1035 // ============================================================================
1036 StatusCode HistogramSvc::retrieveObject( Base* par, int item, AIDA::IHistogram2D*& obj ) {
1037  return Helper( this ).retrieve( ::detail::cast( par ), item, obj );
1038 }
1039 
1040 // ============================================================================
1041 StatusCode HistogramSvc::retrieveObject( Base* par, int item, AIDA::IHistogram3D*& obj ) {
1042  return Helper( this ).retrieve( ::detail::cast( par ), item, obj );
1043 }
1044 
1045 // ============================================================================
1046 StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, AIDA::IProfile1D*& obj ) {
1047  return Helper( this ).retrieve( ::detail::cast( par ), item, obj );
1048 }
1049 
1050 // ============================================================================
1051 StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, AIDA::IProfile2D*& obj ) {
1052  return Helper( this ).retrieve( ::detail::cast( par ), item, obj );
1053 }
1054 
1055 // ============================================================================
1056 StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, AIDA::IHistogram1D*& obj ) {
1057  return Helper( this ).retrieve( ::detail::cast( par ), item, obj );
1058 }
1059 
1060 // ============================================================================
1061 StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, AIDA::IHistogram2D*& obj ) {
1062  return Helper( this ).retrieve( ::detail::cast( par ), item, obj );
1063 }
1064 
1065 // ============================================================================
1066 StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, AIDA::IHistogram3D*& obj ) {
1067  return Helper( this ).retrieve( ::detail::cast( par ), item, obj );
1068 }
1069 
1070 // ============================================================================
1071 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IProfile1D*& obj ) {
1072  return Helper( this ).find( pReg, path, obj );
1073 }
1074 // ============================================================================
1075 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IProfile2D*& obj ) {
1076  return Helper( this ).find( pReg, path, obj );
1077 }
1078 // ============================================================================
1079 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram1D*& obj ) {
1080  return Helper( this ).find( pReg, path, obj );
1081 }
1082 // ============================================================================
1083 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram2D*& obj ) {
1084  return Helper( this ).find( pReg, path, obj );
1085 }
1086 // ============================================================================
1087 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram3D*& obj ) {
1088  return Helper( this ).find( pReg, path, obj );
1089 }
1090 // ============================================================================
1091 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IProfile1D*& obj ) {
1092  return Helper( this ).find( full, obj );
1093 }
1094 // ============================================================================
1095 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IProfile2D*& obj ) {
1096  return Helper( this ).find( full, obj );
1097 }
1098 
1099 // ============================================================================
1100 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram1D*& obj ) {
1101  return Helper( this ).find( full, obj );
1102 }
1103 
1104 // ============================================================================
1105 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram2D*& obj ) {
1106  return Helper( this ).find( full, obj );
1107 }
1108 
1109 // ============================================================================
1110 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram3D*& obj ) {
1111  return Helper( this ).find( full, obj );
1112 }
1113 
1114 // ============================================================================
1115 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IProfile1D*& obj ) {
1116  return Helper( this ).find( par, rel, obj );
1117 }
1118 
1119 // ============================================================================
1120 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IProfile2D*& obj ) {
1121  return Helper( this ).find( par, rel, obj );
1122 }
1123 
1124 // ============================================================================
1125 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram1D*& obj ) {
1126  return Helper( this ).find( par, rel, obj );
1127 }
1128 
1129 // ============================================================================
1130 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram2D*& obj ) {
1131  return Helper( this ).find( par, rel, obj );
1132 }
1133 
1134 // ============================================================================
1135 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram3D*& obj ) {
1136  return Helper( this ).find( par, rel, obj );
1137 }
1138 
1139 // ============================================================================
1140 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IProfile1D*& obj ) {
1141  return Helper( this ).find( par, item, obj );
1142 }
1143 
1144 // ============================================================================
1145 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IProfile2D*& obj ) {
1146  return Helper( this ).find( par, item, obj );
1147 }
1148 
1149 // ============================================================================
1150 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram1D*& obj ) {
1151  return Helper( this ).find( par, item, obj );
1152 }
1153 
1154 // ============================================================================
1155 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram2D*& obj ) {
1156  return Helper( this ).find( par, item, obj );
1157 }
1158 
1159 // ============================================================================
1160 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram3D*& obj ) {
1161  return Helper( this ).find( par, item, obj );
1162 }
1163 
1164 // ============================================================================
1165 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IProfile1D*& obj ) {
1166  return Helper( this ).find( par, item, obj );
1167 }
1168 
1169 // ============================================================================
1170 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IProfile2D*& obj ) {
1171  return Helper( this ).find( par, item, obj );
1172 }
1173 
1174 // ============================================================================
1175 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram1D*& obj ) {
1176  return Helper( this ).find( par, item, obj );
1177 }
1178 
1179 // ============================================================================
1180 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram2D*& obj ) {
1181  return Helper( this ).find( par, item, obj );
1182 }
1183 
1184 // ============================================================================
1185 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram3D*& obj ) {
1186  return Helper( this ).find( par, item, obj );
1187 }
1188 
1189 // ============================================================================
1190 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IProfile1D*& obj ) {
1191  return Helper( this ).find( par, item, obj );
1192 }
1193 
1194 // ============================================================================
1195 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IProfile2D*& obj ) {
1196  return Helper( this ).find( par, item, obj );
1197 }
1198 
1199 // ============================================================================
1200 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram1D*& obj ) {
1201  return Helper( this ).find( par, item, obj );
1202 }
1203 
1204 // ============================================================================
1205 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram2D*& obj ) {
1206  return Helper( this ).find( par, item, obj );
1207 }
1208 
1209 // ============================================================================
1210 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram3D*& obj ) {
1211  return Helper( this ).find( par, item, obj );
1212 }
1213 
1214 // ============================================================================
1215 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IProfile1D*& obj ) {
1216  return Helper( this ).find( ::detail::cast( par ), item, obj );
1217 }
1218 
1219 // ============================================================================
1220 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IProfile2D*& obj ) {
1221  return Helper( this ).find( ::detail::cast( par ), item, obj );
1222 }
1223 
1224 // ============================================================================
1225 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram1D*& obj ) {
1226  return Helper( this ).find( ::detail::cast( par ), item, obj );
1227 }
1228 
1229 // ============================================================================
1230 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram2D*& obj ) {
1231  return Helper( this ).find( ::detail::cast( par ), item, obj );
1232 }
1233 
1234 // ============================================================================
1235 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram3D*& obj ) {
1236  return Helper( this ).find( ::detail::cast( par ), item, obj );
1237 }
1238 
1239 // ============================================================================
1240 StatusCode HistogramSvc::findObject( Base* par, const std::string& item, AIDA::IProfile1D*& obj ) {
1241  return Helper( this ).find( ::detail::cast( par ), item, obj );
1242 }
1243 
1244 // ============================================================================
1245 StatusCode HistogramSvc::findObject( Base* par, const std::string& item, AIDA::IProfile2D*& obj ) {
1246  return Helper( this ).find( ::detail::cast( par ), item, obj );
1247 }
1248 
1249 // ============================================================================
1250 StatusCode HistogramSvc::findObject( Base* par, const std::string& item, AIDA::IHistogram1D*& obj ) {
1251  return Helper( this ).find( ::detail::cast( par ), item, obj );
1252 }
1253 
1254 // ============================================================================
1255 StatusCode HistogramSvc::findObject( Base* par, const std::string& item, AIDA::IHistogram2D*& obj ) {
1256  return Helper( this ).find( ::detail::cast( par ), item, obj );
1257 }
1258 
1259 // ============================================================================
1260 StatusCode HistogramSvc::findObject( Base* par, const std::string& item, AIDA::IHistogram3D*& obj ) {
1261  return Helper( this ).find( ::detail::cast( par ), item, obj );
1262 }
1263 
1264 // ============================================================================
1265 AIDA::IHistogram1D* HistogramSvc::projectionX( const std::string& name, const AIDA::IHistogram2D& h ) {
1266  return sliceX( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN );
1267 }
1268 
1269 // ============================================================================
1270 AIDA::IHistogram1D* HistogramSvc::projectionY( const std::string& name, const AIDA::IHistogram2D& h ) {
1271  return sliceY( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN );
1272 }
1273 
1274 // ============================================================================
1275 AIDA::IHistogram1D* HistogramSvc::sliceX( const std::string& name, const AIDA::IHistogram2D& h, int indexY ) {
1276  return sliceX( name, h, indexY, indexY );
1277 }
1278 
1279 // ============================================================================
1280 AIDA::IHistogram1D* HistogramSvc::sliceY( const std::string& name, const AIDA::IHistogram2D& h, int indexX ) {
1281  return sliceY( name, h, indexX, indexX );
1282 }
1283 
1284 // ============================================================================
1285 AIDA::IHistogram1D* HistogramSvc::add( const std::string& nameAndTitle, const AIDA::IHistogram1D& a,
1286  const AIDA::IHistogram1D& b ) {
1287  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Add, 1. );
1288 }
1289 
1290 // ============================================================================
1291 AIDA::IHistogram1D* HistogramSvc::subtract( const std::string& nameAndTitle, const AIDA::IHistogram1D& a,
1292  const AIDA::IHistogram1D& b ) {
1293  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Add, -1. );
1294 }
1295 
1296 // ============================================================================
1297 AIDA::IHistogram1D* HistogramSvc::multiply( const std::string& nameAndTitle, const AIDA::IHistogram1D& a,
1298  const AIDA::IHistogram1D& b ) {
1299  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Multiply );
1300 }
1301 
1302 // ============================================================================
1303 AIDA::IHistogram1D* HistogramSvc::divide( const std::string& nameAndTitle, const AIDA::IHistogram1D& a,
1304  const AIDA::IHistogram1D& b ) {
1305  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Divide );
1306 }
1307 
1308 // ============================================================================
1309 AIDA::IHistogram2D* HistogramSvc::add( const std::string& nameAndTitle, const AIDA::IHistogram2D& a,
1310  const AIDA::IHistogram2D& b ) {
1311  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Add, 1. );
1312 }
1313 
1314 // ============================================================================
1315 AIDA::IHistogram2D* HistogramSvc::subtract( const std::string& nameAndTitle, const AIDA::IHistogram2D& a,
1316  const AIDA::IHistogram2D& b ) {
1317  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Add, -1. );
1318 }
1319 
1320 // ============================================================================
1321 AIDA::IHistogram2D* HistogramSvc::multiply( const std::string& nameAndTitle, const AIDA::IHistogram2D& a,
1322  const AIDA::IHistogram2D& b ) {
1323  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Multiply );
1324 }
1325 
1326 // ============================================================================
1327 AIDA::IHistogram2D* HistogramSvc::divide( const std::string& nameAndTitle, const AIDA::IHistogram2D& a,
1328  const AIDA::IHistogram2D& b ) {
1329  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Divide );
1330 }
1331 
1332 // ============================================================================
1333 AIDA::IHistogram3D* HistogramSvc::add( const std::string& nameAndTitle, const AIDA::IHistogram3D& a,
1334  const AIDA::IHistogram3D& b ) {
1335  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Add, 1. );
1336 }
1337 
1338 // ============================================================================
1339 AIDA::IHistogram3D* HistogramSvc::subtract( const std::string& nameAndTitle, const AIDA::IHistogram3D& a,
1340  const AIDA::IHistogram3D& b ) {
1341  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Add, -1. );
1342 }
1343 
1344 // ============================================================================
1345 AIDA::IHistogram3D* HistogramSvc::multiply( const std::string& nameAndTitle, const AIDA::IHistogram3D& a,
1346  const AIDA::IHistogram3D& b ) {
1347  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Multiply );
1348 }
1349 
1350 // ============================================================================
1351 AIDA::IHistogram3D* HistogramSvc::divide( const std::string& nameAndTitle, const AIDA::IHistogram3D& a,
1352  const AIDA::IHistogram3D& b ) {
1353  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Divide );
1354 }
1355 
1356 // ============================================================================
1357 AIDA::IHistogram2D* HistogramSvc::projectionXY( const std::string& nameAndTitle, const AIDA::IHistogram3D& h ) {
1358  return i_project( nameAndTitle, h, "xy" );
1359 }
1360 
1361 // ============================================================================
1362 AIDA::IHistogram2D* HistogramSvc::projectionXZ( const std::string& nameAndTitle, const AIDA::IHistogram3D& h ) {
1363  return i_project( nameAndTitle, h, "xz" );
1364 }
1365 
1366 // ============================================================================
1367 AIDA::IHistogram2D* HistogramSvc::projectionYZ( const std::string& nameAndTitle, const AIDA::IHistogram3D& h ) {
1368  return i_project( nameAndTitle, h, "yz" );
1369 }
1370 
1371 // ============================================================================
1372 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name, const std::string& title, int nx,
1373  double lowx, double upx ) {
1374  return book( name, title, nx, lowx, upx );
1375 }
1376 
1377 // ============================================================================
1378 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name, const std::string& title, int nx,
1379  double lowx, double upx, const std::string& /*opt*/ ) {
1380  return book( name, title, nx, lowx, upx );
1381 }
1382 
1383 // ============================================================================
1384 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name, const std::string& title, const Edges& x,
1385  const std::string& /*opt*/ ) {
1386  return book( name, title, x );
1387 }
1388 
1389 // ============================================================================
1390 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& nameAndTitle, int nx, double lowx,
1391  double upx ) {
1392  return book( nameAndTitle, nameAndTitle, nx, lowx, upx );
1393 }
1394 
1395 // ============================================================================
1396 AIDA::IHistogram1D* HistogramSvc::createCopy( const std::string& full, const AIDA::IHistogram1D& h ) {
1397  return createCopy( i_splitPath( full ), h );
1398 }
1399 
1400 // ============================================================================
1401 AIDA::IHistogram1D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
1402  const AIDA::IHistogram1D& h ) {
1403  return createCopy( createPath( par ), rel, h );
1404 }
1405 
1406 // ============================================================================
1408  const AIDA::IHistogram1D& h ) {
1409  return createCopy( loc.first, loc.second, h );
1410 }
1411 
1412 // ============================================================================
1413 AIDA::IHistogram1D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, const AIDA::IHistogram1D& h ) {
1414  return i_book( pPar, rel, h.title(), Gaudi::createH1D( h ) );
1415 }
1416 
1417 // ============================================================================
1418 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& title, int nx,
1419  double lowx, double upx, int ny, double lowy, double upy ) {
1420  return book( name, title, nx, lowx, upx, ny, lowy, upy );
1421 }
1422 
1423 // ============================================================================
1424 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& title, int nx,
1425  double lowx, double upx, int ny, double lowy, double upy,
1426  const std::string& /*opt*/ ) {
1427  return book( name, title, nx, lowx, upx, ny, lowy, upy );
1428 }
1429 
1430 // ============================================================================
1431 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& title, const Edges& x,
1432  const Edges& y, const std::string& /*opt*/ ) {
1433  return book( name, title, x, y );
1434 }
1435 
1436 // ============================================================================
1437 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& nameAndTitle, int nx, double lowx, double upx,
1438  int ny, double lowy, double upy ) {
1439  return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy );
1440 }
1441 
1442 // ============================================================================
1443 AIDA::IHistogram2D* HistogramSvc::createCopy( const std::string& full, const AIDA::IHistogram2D& h ) {
1444  return createCopy( i_splitPath( full ), h );
1445 }
1446 
1447 // ============================================================================
1448 AIDA::IHistogram2D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
1449  const AIDA::IHistogram2D& h ) {
1450  return createCopy( createPath( par ), rel, h );
1451 }
1452 
1453 // ============================================================================
1455  const AIDA::IHistogram2D& h ) {
1456  return createCopy( loc.first, loc.second, h );
1457 }
1458 
1459 // ============================================================================
1460 AIDA::IHistogram2D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, const AIDA::IHistogram2D& h ) {
1461  return i_book( pPar, rel, h.title(), Gaudi::createH2D( h ) );
1462 }
1463 
1464 // ============================================================================
1465 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& title, int nx,
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 );
1469 }
1470 
1471 // ============================================================================
1472 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& title, int nx,
1473  double lowx, double upx, int ny, double lowy, double upy, int nz,
1474  double lowz, double upz, const std::string& /*opt*/ ) {
1475  return book( name, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1476 }
1477 
1478 // ============================================================================
1479 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& title, const Edges& x,
1480  const Edges& y, const Edges& z, const std::string& /*opt*/ ) {
1481  return book( name, title, x, y, z );
1482 }
1483 
1484 // ============================================================================
1485 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& nameAndTitle, int nx, double lowx, double upx,
1486  int ny, double lowy, double upy, int nz, double lowz,
1487  double upz ) {
1488  return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1489 }
1490 
1491 // ============================================================================
1492 AIDA::IHistogram3D* HistogramSvc::createCopy( const std::string& full, const AIDA::IHistogram3D& h ) {
1493  return createCopy( i_splitPath( full ), h );
1494 }
1495 
1496 // ============================================================================
1497 AIDA::IHistogram3D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
1498  const AIDA::IHistogram3D& h ) {
1499  return createCopy( createPath( par ), rel, h );
1500 }
1501 
1502 // ============================================================================
1504  const AIDA::IHistogram3D& h ) {
1505  return createCopy( loc.first, loc.second, h );
1506 }
1507 
1508 // ============================================================================
1509 AIDA::IHistogram3D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, const AIDA::IHistogram3D& h ) {
1510  return i_book( pPar, rel, h.title(), Gaudi::createH3D( h ) );
1511 }
1512 
1513 // ============================================================================
1514 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& title, int nx, double lowx,
1515  double upx, const std::string& opt ) {
1516  return bookProf( name, title, nx, lowx, upx, opt );
1517 }
1518 
1519 // ============================================================================
1520 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& title, int nx, double lowx,
1521  double upx, double upper, double lower, const std::string& opt ) {
1522  return bookProf( name, title, nx, lowx, upx, upper, lower, opt );
1523 }
1524 
1525 // ============================================================================
1526 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& title, const Edges& x,
1527  const std::string& /* opt */ ) {
1528  return bookProf( name, title, x );
1529 }
1530 
1531 // ============================================================================
1532 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& title, const Edges& x,
1533  double upper, double lower, const std::string& /* opt */ ) {
1534  return bookProf( name, title, x, upper, lower );
1535 }
1536 
1537 // ============================================================================
1538 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& nametit, int nx, double lowx, double upx ) {
1539  return bookProf( nametit, nametit, nx, lowx, upx, "s" );
1540 }
1541 
1542 // ============================================================================
1543 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& nametit, int nx, double lowx, double upx,
1544  double upper, double lower ) {
1545  return bookProf( nametit, nametit, nx, lowx, upx, upper, lower, "s" );
1546 }
1547 
1548 // ============================================================================
1549 AIDA::IProfile1D* HistogramSvc::createCopy( const std::string& full, const AIDA::IProfile1D& h ) {
1550  return createCopy( i_splitPath( full ), h );
1551 }
1552 
1553 // ============================================================================
1554 AIDA::IProfile1D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
1555  const AIDA::IProfile1D& h ) {
1556  return createCopy( createPath( par ), rel, h );
1557 }
1558 
1559 // ============================================================================
1561  const AIDA::IProfile1D& h ) {
1562  return createCopy( loc.first, loc.second, h );
1563 }
1564 
1565 // ============================================================================
1566 AIDA::IProfile1D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, const AIDA::IProfile1D& h ) {
1567  return i_book( pPar, rel, h.title(), Gaudi::createProf1D( h ) );
1568 }
1569 
1570 // ============================================================================
1571 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& title, int nx, double lowx,
1572  double upx, int ny, double lowy, double upy ) {
1573  return bookProf( name, title, nx, lowx, upx, ny, lowy, upy );
1574 }
1575 
1576 // ============================================================================
1577 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& title, int nx, double lowx,
1578  double upx, int ny, double lowy, double upy,
1579  const std::string& /*opt*/ ) {
1580  return bookProf( name, title, nx, lowx, upx, ny, lowy, upy );
1581 }
1582 
1583 // ============================================================================
1584 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& title, const Edges& x,
1585  const Edges& y, const std::string& /*opt*/ ) {
1586  return bookProf( name, title, x, y );
1587 }
1588 
1589 // ============================================================================
1590 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& nameAndTitle, int nx, double lowx, double upx,
1591  int ny, double lowy, double upy ) {
1592  return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy );
1593 }
1594 
1595 // ============================================================================
1596 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& title, int nx, double lowx,
1597  double upx, int ny, double lowy, double upy, double upper,
1598  double lower ) {
1599  return bookProf( name, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
1600 }
1601 
1602 // ============================================================================
1603 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& title, int nx, double lowx,
1604  double upx, int ny, double lowy, double upy, double upper,
1605  double lower, const std::string& /*opt*/ ) {
1606  return bookProf( name, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
1607 }
1608 
1609 // ============================================================================
1610 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& title, const Edges& x,
1611  const Edges& y, double upper, double lower,
1612  const std::string& /*opt*/ ) {
1613  return bookProf( name, title, x, y, upper, lower );
1614 }
1615 
1616 // ============================================================================
1617 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& nameAndTitle, int nx, double lowx, double upx,
1618  int ny, double lowy, double upy, double upper, double lower ) {
1619  return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy, upper, lower );
1620 }
1621 
1622 // ============================================================================
1623 AIDA::IProfile2D* HistogramSvc::createCopy( const std::string& full, const AIDA::IProfile2D& h ) {
1624  return createCopy( i_splitPath( full ), h );
1625 }
1626 
1627 // ============================================================================
1628 AIDA::IProfile2D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
1629  const AIDA::IProfile2D& h ) {
1630  return createCopy( createPath( par ), rel, h );
1631 }
1632 
1633 // ============================================================================
1635  const AIDA::IProfile2D& h ) {
1636  return createCopy( loc.first, loc.second, h );
1637 }
1638 
1639 // ============================================================================
1640 AIDA::IProfile2D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, const AIDA::IProfile2D& h ) {
1641  return i_book( pPar, rel, h.title(), Gaudi::createProf2D( h ) );
1642 }
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
Definition: DataSvc.h:51
virtual std::ostream & write(std::ostream &s) const =0
Write (binary) histogram to output stream.
Gaudi::Property< Histo1DMap > m_defs1D
T empty(T...args)
Define general base for Gaudi exception.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
const long HBOOK_StorageType
Definition: ClassID.h:56
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
constexpr char SEPARATOR
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.
bool isSuccess() const
Definition: StatusCode.h:267
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.
T to_string(T...args)
AIDA::IHistogram2D * projectionXY(const std::string &nameAndTitle, const AIDA::IHistogram3D &h) override
Gaudi::Property< std::string > m_rootName
Definition: DataSvc.h:52
StatusCode retrieveObject(IRegistry *pReg, const std::string &path, AIDA::IHistogram1D *&obj) override
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
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
T end(T...args)
Generic Transient Address.
virtual std::ostream & print(std::ostream &s) const =0
Print histogram to output stream.
STL class.
StatusCode registerObject(boost::string_ref parentPath, boost::string_ref objPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:295
StatusCode initialize() override
Initialise the service.
GaudiKernel.
Definition: Fill.h:10
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:72
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)
Definition: HistogramSvc.h:160
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.
STL class.
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.
Definition: StatusCode.h:50
constexpr double m
Definition: SystemOfUnits.h:92
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:171
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...
Definition: HistoDef.h:31
AIDA::IHistogram1D * multiply(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) override
T erase(T...args)
AIDA::IBaseHistogram Base
Definition: HistogramSvc.h:59
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
const long ROOT_StorageType
Definition: ClassID.h:52
StatusCode finalize() override
Service initialization.
Definition: DataSvc.cpp:847
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.
T move(T...args)
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.
T find_if(T...args)
T size(T...args)
Common base class for all histograms Use is solely functional to minimize dynamic_casts inside Histog...
Definition: HistogramBase.h:22
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.
Definition: DataSvc.cpp:814
T begin(T...args)
AIDA::IHistogram2D * createHistogram2D(const std::string &name, const std::string &title, int nx, double lowx, double upx, int ny, double lowy, double upy)
string s
Definition: gaudirun.py:312
constexpr static const auto FAILURE
Definition: StatusCode.h:86
static R * act(R *res, const S &b, void(T1::*pmf)(const T2 *, Double_t), Double_t scale)
Definition: HistogramSvc.h:93
static int toRootIndex(int index, int nbins)
Definition: Axis.h:31
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.
Definition: DataObject.h:30
STL class.
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.
Definition: MsgStream.h:192
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)