The Gaudi Framework  v29r0 (ff2e7097)
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 {
31  using namespace AIDA;
32  using std::string;
33 
34  inline string histoAddr( const string& name )
35  {
36  if ( 0 == name.find( "/stat/" ) ) {
37  return string( name, 6 );
38  }
39  return name;
40  }
41 
42  inline string histoAddr( const DataObject* obj, const string& rel )
43  {
44  if ( !obj ) {
45  return rel;
46  }
47  IRegistry* reg = obj->registry();
48  if ( !reg ) {
49  return rel;
50  }
51  const string& name = reg->identifier();
52  //
53  if ( rel.empty() ) {
54  return histoAddr( name );
55  }
56  if ( '/' == name[name.size() - 1] || '/' == rel[0] ) {
57  return histoAddr( name + rel );
58  }
59  return histoAddr( name + "/" + rel );
60  }
61 
62  inline size_t removeLeading( HistogramSvc::Histo1DMap& m, const string& lead = "/stat/" )
63  {
64  for ( auto it = m.begin(); m.end() != it; ++it ) {
65  if ( 0 == it->first.find( lead ) ) {
66  string addr = string( it->first, lead.size() );
67  Gaudi::Histo1DDef hdef = it->second;
68  m.erase( it ); // remove
69  m[addr] = hdef; // insert
70  return 1 + removeLeading( m, lead ); // return
71  }
72  }
73  return 0;
74  }
75 }
76 
77 //------------------------------------------------------------------------------
78 StatusCode HistogramSvc::registerObject( const string& full, IBaseHistogram* obj )
79 {
80  std::pair<string, string> split = i_splitPath( full );
81  return registerObject( split.first, split.second, obj );
82 }
83 
84 //------------------------------------------------------------------------------
85 StatusCode HistogramSvc::registerObject( DataObject* pPar, const string& obj, IBaseHistogram* hObj )
86 {
87  // Set the histogram id
88  if ( obj[0] == SEPARATOR ) {
89  // hObj->setTitle(obj.substr(1) + "|" + hObj->title());
90  if ( !hObj->annotation().addItem( "id", obj.substr( 1 ) ) ) hObj->annotation().setValue( "id", obj.substr( 1 ) );
91  } else {
92  // hObj->setTitle(obj + "|" + hObj->title());
93  if ( !hObj->annotation().addItem( "id", obj ) ) hObj->annotation().setValue( "id", obj );
94  }
95  // Register the histogram in the histogram data store
96  return DataSvc::registerObject( pPar, obj, detail::cast( hObj ) );
97 }
98 
99 // Helper for 2D projections
100 AIDA::IHistogram2D* HistogramSvc::i_project( const string& nameAndTitle, const IHistogram3D& h, const string& dir )
101 {
102  TH3D* h3d = Gaudi::getRepresentation<IHistogram3D, TH3D>( h );
103  if ( h3d ) {
104  TH2D* h2d = dynamic_cast<TH2D*>( h3d->Project3D( dir.c_str() ) );
105  if ( h2d ) {
107  if ( r.second && registerObject( nameAndTitle, r.second ).isSuccess() ) {
108  return r.second;
109  }
110  }
111  }
112  return nullptr;
113 }
114 
115 //------------------------------------------------------------------------------
116 // ASCII output
117 //------------------------------------------------------------------------------
118 std::ostream& HistogramSvc::print( IBaseHistogram* h, std::ostream& s ) const
119 {
120  Gaudi::HistogramBase* b = dynamic_cast<Gaudi::HistogramBase*>( h );
121  if ( b ) return b->print( s );
122  error() << "Unknown histogram type: Cannot cast to Gaudi::HistogramBase." << endmsg;
123  return s;
124 }
125 
126 //------------------------------------------------------------------------------
127 std::ostream& HistogramSvc::write( IBaseHistogram* h, std::ostream& s ) const
128 {
129  Gaudi::HistogramBase* b = dynamic_cast<Gaudi::HistogramBase*>( h );
130  if ( b ) return b->write( s );
131  error() << "Unknown histogram type: Cannot cast to Gaudi::HistogramBase." << endmsg;
132  return s;
133 }
134 
135 //------------------------------------------------------------------------------
136 int HistogramSvc::write( IBaseHistogram* h, const char* file_name ) const
137 {
138  Gaudi::HistogramBase* b = dynamic_cast<Gaudi::HistogramBase*>( h );
139  if ( b ) return b->write( file_name );
140  error() << "Unknown histogram type: Cannot cast to Gaudi::HistogramBase." << endmsg;
141  return 0;
142 }
143 
144 //------------------------------------------------------------------------------
146 {
147  string tmp = full;
148  if ( tmp[0] != SEPARATOR ) {
149  tmp.insert( tmp.begin(), SEPARATOR );
150  tmp.insert( tmp.begin(), m_rootName.begin(), m_rootName.end() );
151  }
152  // Remove trailing "/" from newPath if it exists
153  if ( tmp.rfind( SEPARATOR ) == tmp.length() - 1 ) {
154  tmp.erase( tmp.rfind( SEPARATOR ), 1 );
155  }
156  int sep = tmp.rfind( SEPARATOR );
157  return {tmp.substr( 0, sep ), tmp.substr( sep )};
158 }
159 
160 //------------------------------------------------------------------------------
161 DataObject* HistogramSvc::createPath( const string& newPath )
162 {
163  string tmpPath = newPath;
164  if ( tmpPath[0] != SEPARATOR ) {
165  tmpPath.insert( tmpPath.begin(), SEPARATOR );
166  tmpPath.insert( tmpPath.begin(), m_rootName.begin(), m_rootName.end() );
167  }
168  // Remove trailing "/" from newPath if it exists
169  if ( tmpPath.rfind( SEPARATOR ) == tmpPath.length() - 1 ) {
170  tmpPath.erase( tmpPath.rfind( SEPARATOR ), 1 );
171  }
172  DataObject* pObject = nullptr;
173  StatusCode sc = DataSvc::findObject( tmpPath, pObject );
174  if ( sc.isSuccess() ) {
175  return pObject;
176  }
177  int sep = tmpPath.rfind( SEPARATOR );
178  string rest( tmpPath, sep + 1, tmpPath.length() - sep );
179  string subPath( tmpPath, 0, sep );
180  if ( 0 != sep ) {
181  createPath( subPath );
182  } else {
183  error() << "Unable to create the histogram path" << endmsg;
184  return nullptr;
185  }
186  pObject = createDirectory( subPath, rest );
187  return pObject;
188 }
189 
190 //------------------------------------------------------------------------------
191 DataObject* HistogramSvc::createDirectory( const string& parentDir, const string& subDir )
192 {
193  std::unique_ptr<DataObject> directory{new DataObject()};
194  if ( directory ) {
195  DataObject* pnode;
196  StatusCode status = DataSvc::retrieveObject( parentDir, pnode );
197  if ( status.isSuccess() ) {
198  status = DataSvc::registerObject( pnode, subDir, directory.get() );
199  if ( !status.isSuccess() ) {
200  error() << "Unable to create the histogram directory: " << parentDir << "/" << subDir << endmsg;
201  return nullptr;
202  }
203  } else {
204  error() << "Unable to create the histogram directory: " << parentDir << "/" << subDir << endmsg;
205  return nullptr;
206  }
207  }
208  return directory.release();
209 }
210 
211 //------------------------------------------------------------------------------
213 {
214  setDataLoader( nullptr ).ignore();
215  clearStore().ignore();
216 }
217 
218 //------------------------------------------------------------------------------
220 {
221  using Parser = Gaudi::Utils::AttribStringParser;
222  DataObject* pO = nullptr;
223  StatusCode status = this->findObject( m_rootName, pO );
224  if ( status.isSuccess() ) {
225  string::size_type loc = ident.find( " " );
226  string filename, auth, svc = "", typ = "";
227  string logname = ident.substr( 0, loc );
228  for ( auto attrib : Parser( ident.substr( loc + 1 ) ) ) {
229  switch (::toupper( attrib.tag[0] ) ) {
230  case 'F': // FILE='<file name>'
231  case 'D': // DATAFILE='<file name>'
232  filename = std::move( attrib.value );
233  break;
234  case 'T': // TYP='<HBOOK,ROOT,OBJY,...>'
235  typ = std::move( attrib.value );
236  break;
237  default:
238  break;
239  }
240  }
241  if ( typ.length() > 0 ) {
242  // Now add the registry entry to the store
243  string entryname = m_rootName;
244  entryname += '/';
245  entryname += logname;
246  GenericAddress* pA = nullptr;
247  switch (::toupper( typ[0] ) ) {
248  case 'H':
249  pA = new GenericAddress( HBOOK_StorageType, CLID_StatisticsFile, filename, entryname, 0, 'O' );
250  break;
251  case 'R':
252  pA = new GenericAddress( ROOT_StorageType, CLID_StatisticsFile, filename, entryname, 0, 'O' );
253  break;
254  }
255  if ( pA ) {
256  status = registerAddress( pO, logname, pA );
257  if ( status.isSuccess() ) {
258  info() << "Added stream file:" << filename << " as " << logname << endmsg;
259  return status;
260  }
261  pA->release();
262  }
263  }
264  }
265  error() << "Cannot add " << ident << " invalid filename!" << endmsg;
266  return StatusCode::FAILURE;
267 }
268 
269 //------------------------------------------------------------------------------
271 {
272  StatusCode status = DataSvc::initialize();
273  // Set root object
274  if ( status.isSuccess() ) {
276  status = setRoot( "/stat", rootObj.get() );
277  if ( status.isSuccess() ) {
278  rootObj.release();
279  } else {
280  error() << "Unable to set hstogram data store root." << endmsg;
281  return status;
282  }
283  auto svc = service<IConversionSvc>( "HistogramPersistencySvc", true );
284  if ( svc ) {
285  setDataLoader( svc.get() ).ignore();
286  } else {
287  error() << "Could not find HistogramPersistencySvc." << endmsg;
288  return StatusCode::FAILURE;
289  }
290  // Connect all input streams (if any)
291  for ( auto& j : m_input ) {
292  status = connectInput( j );
293  if ( !status.isSuccess() ) return status;
294  }
295  }
296  if ( !m_defs1D.empty() ) {
297  info() << " Predefined 1D-Histograms: " << endmsg;
298  for ( const auto& ih : m_defs1D ) {
299  info() << " Path='" << ih.first << "'"
300  << " Description " << ih.second << endmsg;
301  }
302  }
303  return status;
304 }
305 
306 //------------------------------------------------------------------------------
308 
309 //------------------------------------------------------------------------------
310 IHistogram1D* HistogramSvc::sliceX( const string& name, const IHistogram2D& h, int idxY1, int idxY2 )
311 {
312  std::pair<DataObject*, IHistogram1D*> o( nullptr, nullptr );
313  try {
314  int firstbin = Gaudi::Axis::toRootIndex( idxY1, h.yAxis().bins() );
315  int lastbin = Gaudi::Axis::toRootIndex( idxY2, h.yAxis().bins() );
316  o = Gaudi::slice1DX( name, h, firstbin, lastbin );
317  } catch ( ... ) {
318  throw GaudiException( "Cannot cast 2D histogram to H2D to create sliceX `" + name + "'!", "HistogramSvc",
320  }
321  if ( o.first && registerObject( name, (IBaseHistogram*)o.second ).isSuccess() ) {
322  return o.second;
323  }
324  delete o.first;
325  throw GaudiException( "Cannot create sliceX `" + name + "' of 2D histogram!", "HistogramSvc", StatusCode::FAILURE );
326 }
327 
328 //------------------------------------------------------------------------------
329 IHistogram1D* HistogramSvc::sliceY( const string& name, const IHistogram2D& h, int indexX1, int indexX2 )
330 {
331  std::pair<DataObject*, IHistogram1D*> o( nullptr, nullptr );
332  try {
333  int firstbin = Gaudi::Axis::toRootIndex( indexX1, h.xAxis().bins() );
334  int lastbin = Gaudi::Axis::toRootIndex( indexX2, h.xAxis().bins() );
335  o = Gaudi::slice1DY( name, h, firstbin, lastbin );
336  } catch ( ... ) {
337  throw GaudiException( "Cannot create sliceY `" + name + "'!", "HistogramSvc", StatusCode::FAILURE );
338  }
339  // name stands here for the fullPath of the histogram
340  if ( o.first && registerObject( name, (IBaseHistogram*)o.second ).isSuccess() ) {
341  return o.second;
342  }
343  delete o.first;
344  throw GaudiException( "Cannot create sliceY `" + name + "' of 2D histogram!", "HistogramSvc", StatusCode::FAILURE );
345 }
346 
347 //------------------------------------------------------------------------------
348 bool HistogramSvc::destroy( IBaseHistogram* hist )
349 {
350  StatusCode sc = unregisterObject( dynamic_cast<IHistogram*>( hist ) );
351  if ( !sc.isSuccess() ) return false;
352  delete hist;
353  return true;
354 }
355 
356 // ============================================================================
357 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, const string& rel, const string& title, int nx, double lowx,
358  double upx )
359 {
360  if ( m_defs1D.empty() ) {
361  return i_book( pPar, rel, title, Gaudi::createH1D( title, nx, lowx, upx ) );
362  }
363  string hn = histoAddr( pPar, rel );
364  auto ifound = m_defs1D.find( hn );
365  if ( m_defs1D.end() == ifound ) {
366  return i_book( pPar, rel, title, Gaudi::createH1D( title, nx, lowx, upx ) );
367  }
368  if ( msgLevel( MSG::DEBUG ) ) {
369  debug() << " Redefine the parameters for the histogram '" + hn + "' to be " << ifound->second << endmsg;
370  }
371  m_mods1D.insert( hn );
372  return i_book( pPar, rel, ifound->second.title(),
373  Gaudi::createH1D( ifound->second.title(), ifound->second.bins(), ifound->second.lowEdge(),
374  ifound->second.lowEdge() ) );
375 }
376 
377 // ============================================================================
378 // constructor
379 // ============================================================================
380 HistogramSvc::HistogramSvc( const string& nam, ISvcLocator* svc ) : base_class( nam, svc )
381 {
382  // Properties can be declared here
383  m_rootName = "/stat";
384  m_rootCLID = CLID_DataObject;
385  m_defs1D.declareUpdateHandler( &HistogramSvc::update1Ddefs, this );
386 }
387 
388 // ============================================================================
390 {
391  // check and remove the leading '/stat/'
392  removeLeading( m_defs1D.value(), "/stat/" );
393 }
394 
395 // ============================================================================
396 // finalize the service
397 // ============================================================================
399 {
400  if ( !m_mods1D.empty() ) {
401  if ( msgLevel( MSG::DEBUG ) ) debug() << " Substituted histograms #" << m_mods1D.size() << " : " << endmsg;
402  for ( const auto& ih : m_mods1D ) {
403  if ( msgLevel( MSG::DEBUG ) ) debug() << " Path='" << ih << "'";
404  auto im = m_defs1D.find( ih );
405  if ( m_defs1D.end() != im ) {
406  debug() << " " << im->second;
407  }
408  }
409  m_mods1D.clear();
410  }
411  return DataSvc::finalize();
412 }
413 
414 // ============================================================================
415 AIDA::IHistogram1D* HistogramSvc::book( const string& par, const string& rel, const string& title, int nx, double lowx,
416  double upx )
417 {
418  return book( createPath( par ), rel, title, nx, lowx, upx );
419 }
420 
421 // ============================================================================
422 AIDA::IHistogram1D* HistogramSvc::book( const string& par, int hID, const string& title, int nx, double lowx,
423  double upx )
424 {
425  return book( par, std::to_string( hID ), title, nx, lowx, upx );
426 }
427 
428 // ============================================================================
429 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, int hID, const string& title, int nx, double lowx,
430  double upx )
431 {
432  return book( pPar, std::to_string( hID ), title, nx, lowx, upx );
433 }
434 
435 // ============================================================================
436 AIDA::IHistogram1D* HistogramSvc::book( const std::pair<string, string>& loc, const string& title, int nx, double lowx,
437  double upx )
438 {
439  return book( loc.first, loc.second, title, nx, lowx, upx );
440 }
441 
442 // ============================================================================
443 AIDA::IHistogram1D* HistogramSvc::book( const string& full, const string& title, int nx, double lowx, double upx )
444 {
445  return book( i_splitPath( full ), title, nx, lowx, upx );
446 }
447 
448 // ============================================================================
449 AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, const string& rel, const string& title, int nx,
450  double lowx, double upx, const string& opt )
451 {
452  return bookProf( createPath( par ), rel, title, nx, lowx, upx, opt );
453 }
454 
455 // ============================================================================
456 AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, int hID, const string& title, int nx, double lowx,
457  double upx, const string& opt )
458 {
459  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, opt );
460 }
461 
462 // ============================================================================
463 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const string& title, int nx, double lowx,
464  double upx, const string& opt )
465 {
466  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, opt );
467 }
468 
469 // ============================================================================
470 AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair<string, string>& loc, const string& title, int nx,
471  double lowx, double upx, const string& opt )
472 {
473  return bookProf( loc.first, loc.second, title, nx, lowx, upx, opt );
474 }
475 
476 // ============================================================================
477 AIDA::IProfile1D* HistogramSvc::bookProf( const string& full, const string& title, int nx, double lowx, double upx,
478  const string& opt )
479 {
480  return bookProf( i_splitPath( full ), title, nx, lowx, upx, opt );
481 }
482 
483 // ============================================================================
484 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const string& rel, const string& title, int nx, double lowx,
485  double upx, const string& opt )
486 {
487  return i_book( pPar, rel, title, Gaudi::createProf1D( title, nx, lowx, upx, 0, 0, opt ) );
488 }
489 
490 // ============================================================================
491 AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, const string& rel, const string& title, int nx,
492  double lowx, double upx, double upper, double lower, const string& opt )
493 {
494  return bookProf( createPath( par ), rel, title, nx, lowx, upx, upper, lower, opt );
495 }
496 
497 // ============================================================================
498 AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, int hID, const string& title, int nx, double lowx,
499  double upx, double upper, double lower, const string& opt )
500 {
501  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, upper, lower, opt );
502 }
503 
504 // ============================================================================
505 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const string& title, int nx, double lowx,
506  double upx, double upper, double lower, const string& opt )
507 {
508  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, upper, lower, opt );
509 }
510 
511 // ============================================================================
512 AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair<string, string>& loc, const string& title, int nx,
513  double lowx, double upx, double upper, double lower, const string& opt )
514 {
515  return bookProf( loc.first, loc.second, title, nx, lowx, upx, upper, lower, opt );
516 }
517 
518 // ============================================================================
519 AIDA::IProfile1D* HistogramSvc::bookProf( const string& full, const string& title, int nx, double lowx, double upx,
520  double upper, double lower, const string& opt )
521 {
522  return bookProf( i_splitPath( full ), title, nx, lowx, upx, upper, lower, opt );
523 }
524 
525 // ============================================================================
526 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const string& rel, const string& title, int nx, double lowx,
527  double upx, double upper, double lower, const string& opt )
528 {
529  return i_book( pPar, rel, title, Gaudi::createProf1D( title, nx, lowx, upx, upper, lower, opt ) );
530 }
531 
532 // ============================================================================
533 AIDA::IHistogram1D* HistogramSvc::book( const std::string& par, int hID, const std::string& title, Edges e )
534 {
535  return book( par, std::to_string( hID ), title, e );
536 }
537 
538 // ============================================================================
539 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, int hID, const std::string& title, Edges e )
540 {
541  return book( pPar, std::to_string( hID ), title, e );
542 }
543 
544 // ============================================================================
545 AIDA::IHistogram1D* HistogramSvc::book( const std::string& par, const std::string& rel, const std::string& title,
546  Edges e )
547 {
548  return book( createPath( par ), rel, title, e );
549 }
550 
551 // ============================================================================
552 AIDA::IHistogram1D* HistogramSvc::book( const std::pair<std::string, std::string>& loc, const std::string& title,
553  Edges e )
554 {
555  return book( loc.first, loc.second, title, e );
556 }
557 
558 // ============================================================================
559 AIDA::IHistogram1D* HistogramSvc::book( const std::string& full, const std::string& title, Edges e )
560 {
561  return book( i_splitPath( full ), title, e );
562 }
563 
564 // ============================================================================
565 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, const std::string& rel, const std::string& title, Edges e )
566 {
567  return i_book( pPar, rel, title, Gaudi::createH1D( title, e ) );
568 }
569 
570 // ============================================================================
571 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& full, const std::string& title, Edges e )
572 {
573  return bookProf( i_splitPath( full ), title, e );
574 }
575 
576 // ============================================================================
577 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
578  Edges e )
579 {
580  return bookProf( createPath( par ), rel, title, e );
581 }
582 
583 // ============================================================================
584 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, Edges e )
585 {
586  return bookProf( par, std::to_string( hID ), title, e );
587 }
588 
589 // ============================================================================
590 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, Edges e )
591 {
592  return bookProf( pPar, std::to_string( hID ), title, e );
593 }
594 
595 // ============================================================================
596 AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
597  Edges e )
598 {
599  return bookProf( loc.first, loc.second, title, e );
600 }
601 
602 // ============================================================================
603 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, Edges e )
604 {
605  return i_book( pPar, rel, title, Gaudi::createProf1D( title, e, 0, 0 ) );
606 }
607 
608 // ============================================================================
609 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& full, const std::string& title, Edges e, double upper,
610  double lower )
611 {
612  return bookProf( i_splitPath( full ), title, e, upper, lower );
613 }
614 
615 // ============================================================================
616 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
617  Edges e, double upper, double lower )
618 {
619  return bookProf( createPath( par ), rel, title, e, upper, lower );
620 }
621 
622 // ============================================================================
623 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, Edges e,
624  double upper, double lower )
625 {
626  return bookProf( par, std::to_string( hID ), title, e, upper, lower );
627 }
628 
629 // ============================================================================
630 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, Edges e, double upper,
631  double lower )
632 {
633  return bookProf( pPar, std::to_string( hID ), title, e, upper, lower );
634 }
635 
636 // ============================================================================
637 AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
638  Edges e, double upper, double lower )
639 {
640  return bookProf( loc.first, loc.second, title, e, upper, lower );
641 }
642 
643 // ============================================================================
644 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, Edges e,
645  double upper, double lower )
646 {
647  return i_book( pPar, rel, title, Gaudi::createProf1D( title, e, upper, lower ) );
648 }
649 
650 // ============================================================================
651 AIDA::IHistogram2D* HistogramSvc::book( const std::string& full, const std::string& title, int nx, double lowx,
652  double upx, int ny, double lowy, double upy )
653 {
654  return book( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy );
655 }
656 
657 // ============================================================================
658 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, const std::string& rel, const std::string& title,
659  int nx, double lowx, double upx, int ny, double lowy, double upy )
660 {
661  return book( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy );
662 }
663 
664 // ============================================================================
665 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, int hID, const std::string& title, int nx, double lowx,
666  double upx, int ny, double lowy, double upy )
667 {
668  return book( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
669 }
670 
671 // ============================================================================
672 AIDA::IHistogram2D* HistogramSvc::book( const std::pair<std::string, std::string>& loc, const std::string& title,
673  int nx, double lowx, double upx, int ny, double lowy, double upy )
674 {
675  return book( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy );
676 }
677 
678 // ============================================================================
679 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, int hID, const std::string& title, int nx, double lowx,
680  double upx, int ny, double lowy, double upy )
681 {
682  return book( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
683 }
684 
685 // ============================================================================
686 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, const std::string& rel, const std::string& title, int nx,
687  double lowx, double upx, int ny, double lowy, double upy )
688 {
689  return i_book( pPar, rel, title, Gaudi::createH2D( title, nx, lowx, upx, ny, lowy, upy ) );
690 }
691 
692 // ============================================================================
693 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, const std::string& title, int nx, double lowx,
694  double upx, int ny, double lowy, double upy, double upper, double lower )
695 {
696  return bookProf( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
697 }
698 
699 // ============================================================================
700 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
701  int nx, double lowx, double upx, int ny, double lowy, double upy,
702  double upper, double lower )
703 {
704  return bookProf( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
705 }
706 
707 // ============================================================================
708 AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
709  int nx, double lowx, double upx, int ny, double lowy, double upy,
710  double upper, double lower )
711 {
712  return bookProf( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
713 }
714 
715 // ============================================================================
716 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, int nx,
717  double lowx, double upx, int ny, double lowy, double upy, double upper,
718  double lower )
719 {
720  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
721 }
722 
723 // ============================================================================
724 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, int nx, double lowx,
725  double upx, int ny, double lowy, double upy, double upper, double lower )
726 {
727  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
728 }
729 
730 // ============================================================================
731 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, int nx,
732  double lowx, double upx, int ny, double lowy, double upy, double upper,
733  double lower )
734 {
735  return i_book( pPar, rel, title, Gaudi::createProf2D( title, nx, lowx, upx, ny, lowy, upy, upper, lower ) );
736 }
737 
738 // ============================================================================
739 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, const std::string& title, int nx, double lowx,
740  double upx, int ny, double lowy, double upy )
741 {
742  return bookProf( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy );
743 }
744 
745 // ============================================================================
746 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
747  int nx, double lowx, double upx, int ny, double lowy, double upy )
748 {
749  return bookProf( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy );
750 }
751 
752 // ============================================================================
753 AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
754  int nx, double lowx, double upx, int ny, double lowy, double upy )
755 {
756  return bookProf( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy );
757 }
758 
759 // ============================================================================
760 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, int nx,
761  double lowx, double upx, int ny, double lowy, double upy )
762 {
763  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
764 }
765 
766 // ============================================================================
767 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, int nx, double lowx,
768  double upx, int ny, double lowy, double upy )
769 {
770  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
771 }
772 
773 // ============================================================================
774 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, int nx,
775  double lowx, double upx, int ny, double lowy, double upy )
776 {
777  return i_book( pPar, rel, title, Gaudi::createProf2D( title, nx, lowx, upx, ny, lowy, upy, 0, 0 ) );
778 }
779 
780 // ============================================================================
781 AIDA::IHistogram2D* HistogramSvc::book( const std::string& full, const std::string& title, Edges x, Edges y )
782 {
783  return book( i_splitPath( full ), title, x, y );
784 }
785 
786 // ============================================================================
787 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, const std::string& rel, const std::string& title,
788  Edges x, Edges y )
789 {
790  return book( createPath( par ), rel, title, x, y );
791 }
792 
793 // ============================================================================
794 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, int hID, const std::string& title, Edges x, Edges y )
795 {
796  return book( par, std::to_string( hID ), title, x, y );
797 }
798 
799 // ============================================================================
800 AIDA::IHistogram2D* HistogramSvc::book( const std::pair<std::string, std::string>& loc, const std::string& title,
801  Edges x, Edges y )
802 {
803  return book( loc.first, loc.second, title, x, y );
804 }
805 
806 // ============================================================================
807 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, int hID, const std::string& title, Edges x, Edges y )
808 {
809  return book( pPar, std::to_string( hID ), title, x, y );
810 }
811 
812 // ============================================================================
813 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, const std::string& rel, const std::string& title, Edges x,
814  Edges y )
815 {
816  return i_book( pPar, rel, title, Gaudi::createH2D( title, x, y ) );
817 }
818 
819 // ============================================================================
820 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, const std::string& title, Edges x, Edges y )
821 {
822  return bookProf( i_splitPath( full ), title, x, y );
823 }
824 
825 // ============================================================================
826 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
827  Edges x, Edges y )
828 {
829  return bookProf( createPath( par ), rel, title, x, y );
830 }
831 
832 // ============================================================================
833 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, Edges x, Edges y )
834 {
835  return bookProf( par, std::to_string( hID ), title, x, y );
836 }
837 
838 // ============================================================================
839 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, Edges x, Edges y )
840 {
841  return bookProf( pPar, std::to_string( hID ), title, x, y );
842 }
843 
844 // ============================================================================
845 AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
846  Edges x, Edges y )
847 {
848  return bookProf( loc.first, loc.second, title, x, y );
849 }
850 
851 // ============================================================================
852 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, Edges x,
853  Edges y )
854 {
855  return i_book( pPar, rel, title, Gaudi::createProf2D( title, x, y, 0, 0 ) );
856 }
857 
858 // ============================================================================
859 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full, const std::string& title, Edges x, Edges y,
860  double upper, double lower )
861 {
862  return bookProf( i_splitPath( full ), title, x, y, upper, lower );
863 }
864 
865 // ============================================================================
866 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel, const std::string& title,
867  Edges x, Edges y, double upper, double lower )
868 {
869  return bookProf( createPath( par ), rel, title, x, y, upper, lower );
870 }
871 
872 // ============================================================================
873 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID, const std::string& title, Edges x, Edges y,
874  double upper, double lower )
875 {
876  return bookProf( par, std::to_string( hID ), title, x, y, upper, lower );
877 }
878 
879 // ============================================================================
880 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID, const std::string& title, Edges x, Edges y,
881  double upper, double lower )
882 {
883  return bookProf( pPar, std::to_string( hID ), title, x, y, upper, lower );
884 }
885 
886 // ============================================================================
887 AIDA::IProfile2D* HistogramSvc::bookProf( const std::pair<std::string, std::string>& loc, const std::string& title,
888  Edges x, Edges y, double upper, double lower )
889 {
890  return bookProf( loc.first, loc.second, title, x, y, upper, lower );
891 }
892 
893 // ============================================================================
894 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel, const std::string& title, Edges x,
895  Edges y, double upper, double lower )
896 {
897  return i_book( pPar, rel, title, Gaudi::createProf2D( title, x, y, upper, lower ) );
898 }
899 
900 // ============================================================================
901 AIDA::IHistogram3D* HistogramSvc::book( const std::string& full, const std::string& title, int nx, double lowx,
902  double upx, int ny, double lowy, double upy, int nz, double lowz, double upz )
903 {
904  return book( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
905 }
906 
907 // ============================================================================
908 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, const std::string& rel, const std::string& title,
909  int nx, double lowx, double upx, int ny, double lowy, double upy, int nz,
910  double lowz, double upz )
911 {
912  return book( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
913 }
914 
915 // ============================================================================
916 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, int hID, const std::string& title, int nx, double lowx,
917  double upx, int ny, double lowy, double upy, int nz, double lowz, double upz )
918 {
919  return book( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
920 }
921 
922 // ============================================================================
923 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, int hID, const std::string& title, int nx, double lowx,
924  double upx, int ny, double lowy, double upy, int nz, double lowz, double upz )
925 {
926  return book( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
927 }
928 
929 // ============================================================================
930 AIDA::IHistogram3D* HistogramSvc::book( const std::pair<std::string, std::string>& loc, const std::string& title,
931  int nx, double lowx, double upx, int ny, double lowy, double upy, int nz,
932  double lowz, double upz )
933 {
934  return book( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
935 }
936 
937 // ============================================================================
938 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, const std::string& rel, const std::string& title, int nx,
939  double lowx, double upx, int ny, double lowy, double upy, int nz, double lowz,
940  double upz )
941 {
942  return i_book( pPar, rel, title, Gaudi::createH3D( title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ) );
943 }
944 
945 // ============================================================================
946 AIDA::IHistogram3D* HistogramSvc::book( const std::string& full, const std::string& title, Edges x, Edges y, Edges z )
947 {
948  return book( i_splitPath( full ), title, x, y, z );
949 }
950 
951 // ============================================================================
952 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, const std::string& rel, const std::string& title,
953  Edges x, Edges y, Edges z )
954 {
955  return book( createPath( par ), rel, title, x, y, z );
956 }
957 
958 // ============================================================================
959 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, int hID, const std::string& title, Edges x, Edges y,
960  Edges z )
961 {
962  return book( par, std::to_string( hID ), title, x, y, z );
963 }
964 
965 // ============================================================================
966 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, int hID, const std::string& title, Edges x, Edges y, Edges z )
967 {
968  return book( pPar, std::to_string( hID ), title, x, y, z );
969 }
970 
971 // ============================================================================
972 AIDA::IHistogram3D* HistogramSvc::book( const std::pair<std::string, std::string>& loc, const std::string& title,
973  Edges x, Edges y, Edges z )
974 {
975  return book( loc.first, loc.second, title, x, y, z );
976 }
977 
978 // ============================================================================
979 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, const std::string& rel, const std::string& title, Edges x,
980  Edges y, Edges z )
981 {
982  return i_book( pPar, rel, title, Gaudi::createH3D( title, x, y, z ) );
983 }
984 
985 // ============================================================================
987 {
988  return registerObject( createPath( parent ), rel, obj );
989 }
990 
991 // ============================================================================
992 StatusCode HistogramSvc::registerObject( const std::string& parent, int item, Base* obj )
993 {
994  return registerObject( parent, std::to_string( item ), obj );
995 }
996 
997 // ============================================================================
999 {
1000  return registerObject( detail::cast( pPar ), rel, obj );
1001 }
1002 
1003 // ============================================================================
1005 {
1006  return registerObject( pPar, std::to_string( item ), obj );
1007 }
1008 
1009 // ============================================================================
1011 {
1012  return registerObject( detail::cast( pPar ), item, obj );
1013 }
1014 
1015 // ============================================================================
1017 
1018 // ============================================================================
1020 {
1021  return DataSvc::unregisterObject( detail::cast( obj ), objectPath );
1022 }
1023 
1024 // ============================================================================
1026 {
1027  return DataSvc::unregisterObject( detail::cast( obj ), item );
1028 }
1029 
1030 // ============================================================================
1031 StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram1D*& obj )
1032 {
1033  return Helper( this ).retrieve( pReg, path, obj );
1034 }
1035 
1036 // ============================================================================
1037 StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, AIDA::IProfile1D*& obj )
1038 {
1039  return Helper( this ).retrieve( pReg, path, obj );
1040 }
1041 
1042 // ============================================================================
1043 StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram2D*& obj )
1044 {
1045  return Helper( this ).retrieve( pReg, path, obj );
1046 }
1047 
1048 // ============================================================================
1049 StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, AIDA::IProfile2D*& obj )
1050 {
1051  return Helper( this ).retrieve( pReg, path, obj );
1052 }
1053 
1054 // ============================================================================
1055 StatusCode HistogramSvc::retrieveObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram3D*& obj )
1056 {
1057  return Helper( this ).retrieve( pReg, path, obj );
1058 }
1059 
1060 // ============================================================================
1061 StatusCode HistogramSvc::retrieveObject( const std::string& full, AIDA::IProfile1D*& obj )
1062 {
1063  return Helper( this ).retrieve( full, obj );
1064 }
1065 
1066 // ============================================================================
1067 StatusCode HistogramSvc::retrieveObject( const std::string& full, AIDA::IProfile2D*& obj )
1068 {
1069  return Helper( this ).retrieve( full, obj );
1070 }
1071 
1072 // ============================================================================
1073 StatusCode HistogramSvc::retrieveObject( const std::string& full, AIDA::IHistogram1D*& obj )
1074 {
1075  return Helper( this ).retrieve( full, obj );
1076 }
1077 
1078 // ============================================================================
1079 StatusCode HistogramSvc::retrieveObject( const std::string& full, AIDA::IHistogram2D*& obj )
1080 {
1081  return Helper( this ).retrieve( full, obj );
1082 }
1083 
1084 // ============================================================================
1085 StatusCode HistogramSvc::retrieveObject( const std::string& full, AIDA::IHistogram3D*& obj )
1086 {
1087  return Helper( this ).retrieve( full, obj );
1088 }
1089 
1090 // ============================================================================
1092 
1093  AIDA::IProfile1D*& obj )
1094 {
1095  return Helper( this ).retrieve( parent, rel, obj );
1096 }
1097 
1098 // ============================================================================
1099 StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, AIDA::IProfile2D*& obj )
1100 {
1101  return Helper( this ).retrieve( parent, rel, obj );
1102 }
1103 
1104 // ============================================================================
1105 StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, AIDA::IHistogram1D*& obj )
1106 {
1107  return Helper( this ).retrieve( parent, rel, obj );
1108 }
1109 
1110 // ============================================================================
1111 StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, AIDA::IHistogram2D*& obj )
1112 {
1113  return Helper( this ).retrieve( parent, rel, obj );
1114 }
1115 
1116 // ============================================================================
1117 StatusCode HistogramSvc::retrieveObject( const std::string& parent, const std::string& rel, AIDA::IHistogram3D*& obj )
1118 {
1119  return Helper( this ).retrieve( parent, rel, obj );
1120 }
1121 
1122 // ============================================================================
1123 StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, AIDA::IProfile1D*& obj )
1124 {
1125  return Helper( this ).retrieve( parent, item, obj );
1126 }
1127 
1128 // ============================================================================
1129 StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, AIDA::IProfile2D*& obj )
1130 {
1131  return Helper( this ).retrieve( parent, item, obj );
1132 }
1133 
1134 // ============================================================================
1135 StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, AIDA::IHistogram1D*& obj )
1136 {
1137  return Helper( this ).retrieve( parent, item, obj );
1138 }
1139 
1140 // ============================================================================
1141 StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, AIDA::IHistogram2D*& obj )
1142 {
1143  return Helper( this ).retrieve( parent, item, obj );
1144 }
1145 
1146 // ============================================================================
1147 StatusCode HistogramSvc::retrieveObject( const std::string& parent, int item, AIDA::IHistogram3D*& obj )
1148 {
1149  return Helper( this ).retrieve( parent, item, obj );
1150 }
1151 // ============================================================================
1152 StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, AIDA::IProfile1D*& obj )
1153 {
1154  return Helper( this ).retrieve( par, item, obj );
1155 }
1156 
1157 // ============================================================================
1158 StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, AIDA::IProfile2D*& obj )
1159 {
1160  return Helper( this ).retrieve( par, item, obj );
1161 }
1162 
1163 // ============================================================================
1164 StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, AIDA::IHistogram1D*& obj )
1165 {
1166  return Helper( this ).retrieve( par, item, obj );
1167 }
1168 
1169 // ============================================================================
1170 StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, AIDA::IHistogram2D*& obj )
1171 {
1172  return Helper( this ).retrieve( par, item, obj );
1173 }
1174 
1175 // ============================================================================
1176 StatusCode HistogramSvc::retrieveObject( DataObject* par, const std::string& item, AIDA::IHistogram3D*& obj )
1177 {
1178  return Helper( this ).retrieve( par, item, obj );
1179 }
1180 
1181 // ============================================================================
1182 StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, AIDA::IProfile1D*& obj )
1183 {
1184  return Helper( this ).retrieve( par, item, obj );
1185 }
1186 
1187 // ============================================================================
1188 StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, AIDA::IProfile2D*& obj )
1189 {
1190  return Helper( this ).retrieve( par, item, obj );
1191 }
1192 
1193 // ============================================================================
1194 StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, AIDA::IHistogram1D*& obj )
1195 {
1196  return Helper( this ).retrieve( par, item, obj );
1197 }
1198 
1199 // ============================================================================
1200 StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, AIDA::IHistogram2D*& obj )
1201 {
1202  return Helper( this ).retrieve( par, item, obj );
1203 }
1204 
1205 // ============================================================================
1206 StatusCode HistogramSvc::retrieveObject( DataObject* par, int item, AIDA::IHistogram3D*& obj )
1207 {
1208  return Helper( this ).retrieve( par, item, obj );
1209 }
1210 
1211 // ============================================================================
1212 StatusCode HistogramSvc::retrieveObject( Base* par, int item, AIDA::IProfile1D*& obj )
1213 {
1214  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1215 }
1216 
1217 // ============================================================================
1218 StatusCode HistogramSvc::retrieveObject( Base* par, int item, AIDA::IProfile2D*& obj )
1219 {
1220  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1221 }
1222 
1223 // ============================================================================
1224 StatusCode HistogramSvc::retrieveObject( Base* par, int item, AIDA::IHistogram1D*& obj )
1225 {
1226  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1227 }
1228 
1229 // ============================================================================
1230 StatusCode HistogramSvc::retrieveObject( Base* par, int item, AIDA::IHistogram2D*& obj )
1231 {
1232  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1233 }
1234 
1235 // ============================================================================
1236 StatusCode HistogramSvc::retrieveObject( Base* par, int item, AIDA::IHistogram3D*& obj )
1237 {
1238  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1239 }
1240 
1241 // ============================================================================
1242 StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, AIDA::IProfile1D*& obj )
1243 {
1244  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1245 }
1246 
1247 // ============================================================================
1248 StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, AIDA::IProfile2D*& obj )
1249 {
1250  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1251 }
1252 
1253 // ============================================================================
1254 StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, AIDA::IHistogram1D*& obj )
1255 {
1256  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1257 }
1258 
1259 // ============================================================================
1260 StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, AIDA::IHistogram2D*& obj )
1261 {
1262  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1263 }
1264 
1265 // ============================================================================
1266 StatusCode HistogramSvc::retrieveObject( Base* par, const std::string& item, AIDA::IHistogram3D*& obj )
1267 {
1268  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1269 }
1270 
1271 // ============================================================================
1272 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IProfile1D*& obj )
1273 {
1274  return Helper( this ).find( pReg, path, obj );
1275 }
1276 // ============================================================================
1277 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IProfile2D*& obj )
1278 {
1279  return Helper( this ).find( pReg, path, obj );
1280 }
1281 // ============================================================================
1282 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram1D*& obj )
1283 {
1284  return Helper( this ).find( pReg, path, obj );
1285 }
1286 // ============================================================================
1287 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram2D*& obj )
1288 {
1289  return Helper( this ).find( pReg, path, obj );
1290 }
1291 // ============================================================================
1292 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram3D*& obj )
1293 {
1294  return Helper( this ).find( pReg, path, obj );
1295 }
1296 // ============================================================================
1297 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IProfile1D*& obj )
1298 {
1299  return Helper( this ).find( full, obj );
1300 }
1301 // ============================================================================
1302 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IProfile2D*& obj )
1303 {
1304  return Helper( this ).find( full, obj );
1305 }
1306 
1307 // ============================================================================
1308 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram1D*& obj )
1309 {
1310  return Helper( this ).find( full, obj );
1311 }
1312 
1313 // ============================================================================
1314 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram2D*& obj )
1315 {
1316  return Helper( this ).find( full, obj );
1317 }
1318 
1319 // ============================================================================
1320 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram3D*& obj )
1321 {
1322  return Helper( this ).find( full, obj );
1323 }
1324 
1325 // ============================================================================
1326 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IProfile1D*& obj )
1327 {
1328  return Helper( this ).find( par, rel, obj );
1329 }
1330 
1331 // ============================================================================
1332 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IProfile2D*& obj )
1333 {
1334  return Helper( this ).find( par, rel, obj );
1335 }
1336 
1337 // ============================================================================
1338 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram1D*& obj )
1339 {
1340  return Helper( this ).find( par, rel, obj );
1341 }
1342 
1343 // ============================================================================
1344 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram2D*& obj )
1345 {
1346  return Helper( this ).find( par, rel, obj );
1347 }
1348 
1349 // ============================================================================
1350 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram3D*& obj )
1351 {
1352  return Helper( this ).find( par, rel, obj );
1353 }
1354 
1355 // ============================================================================
1356 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IProfile1D*& obj )
1357 {
1358  return Helper( this ).find( par, item, obj );
1359 }
1360 
1361 // ============================================================================
1362 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IProfile2D*& obj )
1363 {
1364  return Helper( this ).find( par, item, obj );
1365 }
1366 
1367 // ============================================================================
1368 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram1D*& obj )
1369 {
1370  return Helper( this ).find( par, item, obj );
1371 }
1372 
1373 // ============================================================================
1374 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram2D*& obj )
1375 {
1376  return Helper( this ).find( par, item, obj );
1377 }
1378 
1379 // ============================================================================
1380 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram3D*& obj )
1381 {
1382  return Helper( this ).find( par, item, obj );
1383 }
1384 
1385 // ============================================================================
1386 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IProfile1D*& obj )
1387 {
1388  return Helper( this ).find( par, item, obj );
1389 }
1390 
1391 // ============================================================================
1392 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IProfile2D*& obj )
1393 {
1394  return Helper( this ).find( par, item, obj );
1395 }
1396 
1397 // ============================================================================
1398 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram1D*& obj )
1399 {
1400  return Helper( this ).find( par, item, obj );
1401 }
1402 
1403 // ============================================================================
1404 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram2D*& obj )
1405 {
1406  return Helper( this ).find( par, item, obj );
1407 }
1408 
1409 // ============================================================================
1410 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram3D*& obj )
1411 {
1412  return Helper( this ).find( par, item, obj );
1413 }
1414 
1415 // ============================================================================
1416 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IProfile1D*& obj )
1417 {
1418  return Helper( this ).find( par, item, obj );
1419 }
1420 
1421 // ============================================================================
1422 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IProfile2D*& obj )
1423 {
1424  return Helper( this ).find( par, item, obj );
1425 }
1426 
1427 // ============================================================================
1428 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram1D*& obj )
1429 {
1430  return Helper( this ).find( par, item, obj );
1431 }
1432 
1433 // ============================================================================
1434 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram2D*& obj )
1435 {
1436  return Helper( this ).find( par, item, obj );
1437 }
1438 
1439 // ============================================================================
1440 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram3D*& obj )
1441 {
1442  return Helper( this ).find( par, item, obj );
1443 }
1444 
1445 // ============================================================================
1446 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IProfile1D*& obj )
1447 {
1448  return Helper( this ).find( detail::cast( par ), item, obj );
1449 }
1450 
1451 // ============================================================================
1452 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IProfile2D*& obj )
1453 {
1454  return Helper( this ).find( detail::cast( par ), item, obj );
1455 }
1456 
1457 // ============================================================================
1458 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram1D*& obj )
1459 {
1460  return Helper( this ).find( detail::cast( par ), item, obj );
1461 }
1462 
1463 // ============================================================================
1464 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram2D*& obj )
1465 {
1466  return Helper( this ).find( detail::cast( par ), item, obj );
1467 }
1468 
1469 // ============================================================================
1470 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram3D*& obj )
1471 {
1472  return Helper( this ).find( detail::cast( par ), item, obj );
1473 }
1474 
1475 // ============================================================================
1476 StatusCode HistogramSvc::findObject( Base* par, const std::string& item, AIDA::IProfile1D*& obj )
1477 {
1478  return Helper( this ).find( detail::cast( par ), item, obj );
1479 }
1480 
1481 // ============================================================================
1482 StatusCode HistogramSvc::findObject( Base* par, const std::string& item, AIDA::IProfile2D*& obj )
1483 {
1484  return Helper( this ).find( detail::cast( par ), item, obj );
1485 }
1486 
1487 // ============================================================================
1488 StatusCode HistogramSvc::findObject( Base* par, const std::string& item, AIDA::IHistogram1D*& obj )
1489 {
1490  return Helper( this ).find( detail::cast( par ), item, obj );
1491 }
1492 
1493 // ============================================================================
1494 StatusCode HistogramSvc::findObject( Base* par, const std::string& item, AIDA::IHistogram2D*& obj )
1495 {
1496  return Helper( this ).find( detail::cast( par ), item, obj );
1497 }
1498 
1499 // ============================================================================
1500 StatusCode HistogramSvc::findObject( Base* par, const std::string& item, AIDA::IHistogram3D*& obj )
1501 {
1502  return Helper( this ).find( detail::cast( par ), item, obj );
1503 }
1504 
1505 // ============================================================================
1506 AIDA::IHistogram1D* HistogramSvc::projectionX( const std::string& name, const AIDA::IHistogram2D& h )
1507 {
1508  return sliceX( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN );
1509 }
1510 
1511 // ============================================================================
1512 AIDA::IHistogram1D* HistogramSvc::projectionY( const std::string& name, const AIDA::IHistogram2D& h )
1513 {
1514  return sliceY( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN );
1515 }
1516 
1517 // ============================================================================
1518 AIDA::IHistogram1D* HistogramSvc::sliceX( const std::string& name, const AIDA::IHistogram2D& h, int indexY )
1519 {
1520  return sliceX( name, h, indexY, indexY );
1521 }
1522 
1523 // ============================================================================
1524 AIDA::IHistogram1D* HistogramSvc::sliceY( const std::string& name, const AIDA::IHistogram2D& h, int indexX )
1525 {
1526  return sliceY( name, h, indexX, indexX );
1527 }
1528 
1529 // ============================================================================
1530 AIDA::IHistogram1D* HistogramSvc::add( const std::string& nameAndTitle, const AIDA::IHistogram1D& a,
1531  const AIDA::IHistogram1D& b )
1532 {
1533  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Add, 1. );
1534 }
1535 
1536 // ============================================================================
1537 AIDA::IHistogram1D* HistogramSvc::subtract( const std::string& nameAndTitle, const AIDA::IHistogram1D& a,
1538  const AIDA::IHistogram1D& b )
1539 {
1540  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Add, -1. );
1541 }
1542 
1543 // ============================================================================
1544 AIDA::IHistogram1D* HistogramSvc::multiply( const std::string& nameAndTitle, const AIDA::IHistogram1D& a,
1545  const AIDA::IHistogram1D& b )
1546 {
1547  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Multiply );
1548 }
1549 
1550 // ============================================================================
1551 AIDA::IHistogram1D* HistogramSvc::divide( const std::string& nameAndTitle, const AIDA::IHistogram1D& a,
1552  const AIDA::IHistogram1D& b )
1553 {
1554  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Divide );
1555 }
1556 
1557 // ============================================================================
1558 AIDA::IHistogram2D* HistogramSvc::add( const std::string& nameAndTitle, const AIDA::IHistogram2D& a,
1559  const AIDA::IHistogram2D& b )
1560 {
1561  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Add, 1. );
1562 }
1563 
1564 // ============================================================================
1565 AIDA::IHistogram2D* HistogramSvc::subtract( const std::string& nameAndTitle, const AIDA::IHistogram2D& a,
1566  const AIDA::IHistogram2D& b )
1567 {
1568  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Add, -1. );
1569 }
1570 
1571 // ============================================================================
1572 AIDA::IHistogram2D* HistogramSvc::multiply( const std::string& nameAndTitle, const AIDA::IHistogram2D& a,
1573  const AIDA::IHistogram2D& b )
1574 {
1575  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Multiply );
1576 }
1577 
1578 // ============================================================================
1579 AIDA::IHistogram2D* HistogramSvc::divide( const std::string& nameAndTitle, const AIDA::IHistogram2D& a,
1580  const AIDA::IHistogram2D& b )
1581 {
1582  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Divide );
1583 }
1584 
1585 // ============================================================================
1586 AIDA::IHistogram3D* HistogramSvc::add( const std::string& nameAndTitle, const AIDA::IHistogram3D& a,
1587  const AIDA::IHistogram3D& b )
1588 {
1589  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Add, 1. );
1590 }
1591 
1592 // ============================================================================
1593 AIDA::IHistogram3D* HistogramSvc::subtract( const std::string& nameAndTitle, const AIDA::IHistogram3D& a,
1594  const AIDA::IHistogram3D& b )
1595 {
1596  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Add, -1. );
1597 }
1598 
1599 // ============================================================================
1600 AIDA::IHistogram3D* HistogramSvc::multiply( const std::string& nameAndTitle, const AIDA::IHistogram3D& a,
1601  const AIDA::IHistogram3D& b )
1602 {
1603  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Multiply );
1604 }
1605 
1606 // ============================================================================
1607 AIDA::IHistogram3D* HistogramSvc::divide( const std::string& nameAndTitle, const AIDA::IHistogram3D& a,
1608  const AIDA::IHistogram3D& b )
1609 {
1610  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Divide );
1611 }
1612 
1613 // ============================================================================
1614 AIDA::IHistogram2D* HistogramSvc::projectionXY( const std::string& nameAndTitle, const AIDA::IHistogram3D& h )
1615 {
1616  return i_project( nameAndTitle, h, "xy" );
1617 }
1618 
1619 // ============================================================================
1620 AIDA::IHistogram2D* HistogramSvc::projectionXZ( const std::string& nameAndTitle, const AIDA::IHistogram3D& h )
1621 {
1622  return i_project( nameAndTitle, h, "xz" );
1623 }
1624 
1625 // ============================================================================
1626 AIDA::IHistogram2D* HistogramSvc::projectionYZ( const std::string& nameAndTitle, const AIDA::IHistogram3D& h )
1627 {
1628  return i_project( nameAndTitle, h, "yz" );
1629 }
1630 
1631 // ============================================================================
1632 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name, const std::string& tit, int nx,
1633  double lowx, double upx )
1634 {
1635  return book( name, tit, nx, lowx, upx );
1636 }
1637 
1638 // ============================================================================
1639 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name, const std::string& tit, int nx,
1640  double lowx, double upx, const std::string& /*opt*/ )
1641 {
1642  return book( name, tit, nx, lowx, upx );
1643 }
1644 
1645 // ============================================================================
1646 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name, const std::string& title, const Edges& x,
1647  const std::string& /*opt*/ )
1648 {
1649  return book( name, title, x );
1650 }
1651 
1652 // ============================================================================
1653 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& nameAndTitle, int nx, double lowx, double upx )
1654 {
1655  return book( nameAndTitle, nameAndTitle, nx, lowx, upx );
1656 }
1657 
1658 // ============================================================================
1659 AIDA::IHistogram1D* HistogramSvc::createCopy( const std::string& full, const AIDA::IHistogram1D& h )
1660 {
1661  return createCopy( i_splitPath( full ), h );
1662 }
1663 
1664 // ============================================================================
1665 AIDA::IHistogram1D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
1666  const AIDA::IHistogram1D& h )
1667 {
1668  return createCopy( createPath( par ), rel, h );
1669 }
1670 
1671 // ============================================================================
1673  const AIDA::IHistogram1D& h )
1674 {
1675  return createCopy( loc.first, loc.second, h );
1676 }
1677 
1678 // ============================================================================
1679 AIDA::IHistogram1D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, const AIDA::IHistogram1D& h )
1680 {
1681  return i_book( pPar, rel, h.title(), Gaudi::createH1D( h ) );
1682 }
1683 
1684 // ============================================================================
1685 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& tit, int nx,
1686  double lowx, double upx, int ny, double lowy, double upy )
1687 {
1688  return book( name, tit, nx, lowx, upx, ny, lowy, upy );
1689 }
1690 
1691 // ============================================================================
1692 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& tit, int nx,
1693  double lowx, double upx, int ny, double lowy, double upy,
1694  const std::string& /*opt*/ )
1695 {
1696  return book( name, tit, nx, lowx, upx, ny, lowy, upy );
1697 }
1698 
1699 // ============================================================================
1700 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& title, const Edges& x,
1701  const Edges& y, const std::string& /*opt*/ )
1702 {
1703  return book( name, title, x, y );
1704 }
1705 
1706 // ============================================================================
1707 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& nameAndTitle, int nx, double lowx, double upx,
1708  int ny, double lowy, double upy )
1709 {
1710  return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy );
1711 }
1712 
1713 // ============================================================================
1714 AIDA::IHistogram2D* HistogramSvc::createCopy( const std::string& full, const AIDA::IHistogram2D& h )
1715 {
1716  return createCopy( i_splitPath( full ), h );
1717 }
1718 
1719 // ============================================================================
1720 AIDA::IHistogram2D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
1721  const AIDA::IHistogram2D& h )
1722 {
1723  return createCopy( createPath( par ), rel, h );
1724 }
1725 
1726 // ============================================================================
1728  const AIDA::IHistogram2D& h )
1729 {
1730  return createCopy( loc.first, loc.second, h );
1731 }
1732 
1733 // ============================================================================
1734 AIDA::IHistogram2D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, const AIDA::IHistogram2D& h )
1735 {
1736  return i_book( pPar, rel, h.title(), Gaudi::createH2D( h ) );
1737 }
1738 
1739 // ============================================================================
1740 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& tit, int nx,
1741  double lowx, double upx, int ny, double lowy, double upy, int nz,
1742  double lowz, double upz )
1743 {
1744  return book( name, tit, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1745 }
1746 
1747 // ============================================================================
1748 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& tit, int nx,
1749  double lowx, double upx, int ny, double lowy, double upy, int nz,
1750  double lowz, double upz, const std::string& /*opt*/ )
1751 {
1752  return book( name, tit, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1753 }
1754 
1755 // ============================================================================
1756 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& title, const Edges& x,
1757  const Edges& y, const Edges& z, const std::string& /*opt*/ )
1758 {
1759  return book( name, title, x, y, z );
1760 }
1761 
1762 // ============================================================================
1763 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& nameAndTitle, int nx, double lowx, double upx,
1764  int ny, double lowy, double upy, int nz, double lowz, double upz )
1765 {
1766  return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1767 }
1768 
1769 // ============================================================================
1770 AIDA::IHistogram3D* HistogramSvc::createCopy( const std::string& full, const AIDA::IHistogram3D& h )
1771 {
1772  return createCopy( i_splitPath( full ), h );
1773 }
1774 
1775 // ============================================================================
1776 AIDA::IHistogram3D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
1777  const AIDA::IHistogram3D& h )
1778 {
1779  return createCopy( createPath( par ), rel, h );
1780 }
1781 
1782 // ============================================================================
1784  const AIDA::IHistogram3D& h )
1785 {
1786  return createCopy( loc.first, loc.second, h );
1787 }
1788 
1789 // ============================================================================
1790 AIDA::IHistogram3D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, const AIDA::IHistogram3D& h )
1791 {
1792  return i_book( pPar, rel, h.title(), Gaudi::createH3D( h ) );
1793 }
1794 
1795 // ============================================================================
1796 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& tit, int nx, double lowx,
1797  double upx, const std::string& opt )
1798 {
1799  return bookProf( name, tit, nx, lowx, upx, opt );
1800 }
1801 
1802 // ============================================================================
1803 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& tit, int nx, double lowx,
1804  double upx, double upper, double lower, const std::string& opt )
1805 {
1806  return bookProf( name, tit, nx, lowx, upx, upper, lower, opt );
1807 }
1808 
1809 // ============================================================================
1810 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& title, const Edges& x,
1811  const std::string& /* opt */ )
1812 {
1813  return bookProf( name, title, x );
1814 }
1815 
1816 // ============================================================================
1817 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& title, const Edges& x,
1818  double upper, double lower, const std::string& /* opt */ )
1819 {
1820  return bookProf( name, title, x, upper, lower );
1821 }
1822 
1823 // ============================================================================
1824 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& nametit, int nx, double lowx, double upx )
1825 {
1826  return bookProf( nametit, nametit, nx, lowx, upx, "s" );
1827 }
1828 
1829 // ============================================================================
1830 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& nametit, int nx, double lowx, double upx,
1831  double upper, double lower )
1832 {
1833  return bookProf( nametit, nametit, nx, lowx, upx, upper, lower, "s" );
1834 }
1835 
1836 // ============================================================================
1837 AIDA::IProfile1D* HistogramSvc::createCopy( const std::string& full, const AIDA::IProfile1D& h )
1838 {
1839  return createCopy( i_splitPath( full ), h );
1840 }
1841 
1842 // ============================================================================
1843 AIDA::IProfile1D* HistogramSvc::createCopy( const std::string& par, const std::string& rel, const AIDA::IProfile1D& h )
1844 {
1845  return createCopy( createPath( par ), rel, h );
1846 }
1847 
1848 // ============================================================================
1849 AIDA::IProfile1D* HistogramSvc::createCopy( const std::pair<std::string, std::string>& loc, const AIDA::IProfile1D& h )
1850 {
1851  return createCopy( loc.first, loc.second, h );
1852 }
1853 
1854 // ============================================================================
1855 AIDA::IProfile1D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, const AIDA::IProfile1D& h )
1856 {
1857  return i_book( pPar, rel, h.title(), Gaudi::createProf1D( h ) );
1858 }
1859 
1860 // ============================================================================
1861 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& tit, int nx, double lowx,
1862  double upx, int ny, double lowy, double upy )
1863 {
1864  return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy );
1865 }
1866 
1867 // ============================================================================
1868 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& tit, int nx, double lowx,
1869  double upx, int ny, double lowy, double upy,
1870  const std::string& /*opt*/ )
1871 {
1872  return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy );
1873 }
1874 
1875 // ============================================================================
1876 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& title, const Edges& x,
1877  const Edges& y, const std::string& /*opt*/ )
1878 {
1879  return bookProf( name, title, x, y );
1880 }
1881 
1882 // ============================================================================
1883 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& nameAndTitle, int nx, double lowx, double upx,
1884  int ny, double lowy, double upy )
1885 {
1886  return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy );
1887 }
1888 
1889 // ============================================================================
1890 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& tit, int nx, double lowx,
1891  double upx, int ny, double lowy, double upy, double upper,
1892  double lower )
1893 {
1894  return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy, upper, lower );
1895 }
1896 
1897 // ============================================================================
1898 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& tit, int nx, double lowx,
1899  double upx, int ny, double lowy, double upy, double upper,
1900  double lower, const std::string& /*opt*/ )
1901 {
1902  return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy, upper, lower );
1903 }
1904 
1905 // ============================================================================
1906 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& title, const Edges& x,
1907  const Edges& y, double upper, double lower,
1908  const std::string& /*opt*/ )
1909 {
1910  return bookProf( name, title, x, y, upper, lower );
1911 }
1912 
1913 // ============================================================================
1914 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& nameAndTitle, int nx, double lowx, double upx,
1915  int ny, double lowy, double upy, double upper, double lower )
1916 {
1917  return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy, upper, lower );
1918 }
1919 
1920 // ============================================================================
1921 AIDA::IProfile2D* HistogramSvc::createCopy( const std::string& full, const AIDA::IProfile2D& h )
1922 {
1923  return createCopy( i_splitPath( full ), h );
1924 }
1925 
1926 // ============================================================================
1927 AIDA::IProfile2D* HistogramSvc::createCopy( const std::string& par, const std::string& rel, const AIDA::IProfile2D& h )
1928 {
1929  return createCopy( createPath( par ), rel, h );
1930 }
1931 
1932 // ============================================================================
1933 AIDA::IProfile2D* HistogramSvc::createCopy( const std::pair<std::string, std::string>& loc, const AIDA::IProfile2D& h )
1934 {
1935  return createCopy( loc.first, loc.second, h );
1936 }
1937 
1938 // ============================================================================
1939 AIDA::IProfile2D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel, const AIDA::IProfile2D& h )
1940 {
1941  return i_book( pPar, rel, h.title(), Gaudi::createProf2D( h ) );
1942 }
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:459
Parse attribute strings allowing iteration over the various attributes.
Gaudi::Property< CLID > m_rootCLID
Definition: DataSvc.h:56
AIDA::IHistogram2D * createHistogram2D(const std::string &name, const std::string &tit, int nx, double lowx, double upx, int ny, double lowy, double upy)
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
Test for a status code of SUCCESS.
Definition: StatusCode.h:75
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:57
StatusCode retrieveObject(IRegistry *pReg, const std::string &path, AIDA::IHistogram1D *&obj) override
AIDA::IHistogram1D * sliceX(const std::string &name, const AIDA::IHistogram2D &h, int indexY) override
~HistogramSvc() override
Destructor.
StatusCode unregisterObject(Base *obj) override
T end(T...args)
Generic Transient Address.
StatusCode registerObject(const std::string &fullPath, DataObject *pObject) override
Register object with the data store.
Definition: DataSvc.cpp:353
virtual std::ostream & print(std::ostream &s) const =0
Print histogram to output stream.
STL class.
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:174
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::IHistogram3D * createHistogram3D(const std::string &name, const std::string &tit, int nx, double lowx, double upx, int ny, double lowy, double upy, int nz, double lowz, double upz)
AIDA::IHistogram2D * projectionXZ(const std::string &nameAndTitle, const AIDA::IHistogram3D &h) override
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:28
constexpr double m
Definition: SystemOfUnits.h:94
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:187
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:33
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:809
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:65
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:1156
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: Property.h:32
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.
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:751
T move(T...args)
AIDA::IProfile1D * createProfile1D(const std::string &name, const std::string &tit, int nx, double lowx, double upx, const std::string &opt) override
DataObject * createPath(const std::string &newPath) override
Create all directories in a given full path.
void update1Ddefs(Gaudi::Details::PropertyBase &)
handler to be invoked for updating property m_defs1D
AIDA::IHistogram1D * divide(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) 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 size(T...args)
Common base class for all histograms Use is solely functional to minimize dynamic_casts inside Histog...
Definition: HistogramBase.h:23
std::pair< DataObject *, AIDA::IProfile2D * > createProf2D(const AIDA::IProfile2D &hist)
Copy constructor.
STL class.
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:1119
T begin(T...args)
AIDA::IProfile2D * createProfile2D(const std::string &name, const std::string &tit, int nx, double lowx, double upx, int ny, double lowy, double upy)
AIDA::IHistogram1D * createHistogram1D(const std::string &name, const std::string &tit, int nx, double lowx, double upx)
string s
Definition: gaudirun.py:253
static R * act(R *res, const S &b, void(T1::*pmf)(const T2 *, Double_t), Double_t scale)
Definition: HistogramSvc.h:103
static int toRootIndex(int index, int nbins)
Definition: Axis.h:33
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.
MSG::Level msgLevel() const
get the output level from the embedded MsgStream
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:29
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:209
std::pair< DataObject *, AIDA::IProfile1D * > createProf1D(const AIDA::IProfile1D &hist)
Copy constructor.