All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HistogramSvc.cpp
Go to the documentation of this file.
1 #ifdef __ICC
2 // disable icc remark #2259: non-pointer conversion from "X" to "Y" may lose significant bits
3 // TODO: To be removed, since it comes from ROOT TMathBase.h
4 #pragma warning( disable : 2259 )
5 #endif
6 #ifdef WIN32
7 // Disable warning
8 // warning C4996: 'sprintf': This function or variable may be unsafe.
9 // coming from TString.h
10 #pragma warning( disable : 4996 )
11 #endif
12 
13 // STD & STL
14 #include <cstdlib>
15 #include <sstream>
16 #include <stdexcept>
17 
18 // GaudiKernel
20 #include "GaudiKernel/DataObject.h"
23 #include "GaudiKernel/Property.h"
24 
25 // Local
27 #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  return StatusCode::SUCCESS;
310 }
311 
312 //------------------------------------------------------------------------------
313 IHistogram1D* HistogramSvc::sliceX( const string& name, const IHistogram2D& h, int idxY1, int idxY2 )
314 {
315  std::pair<DataObject*, IHistogram1D*> o( nullptr, nullptr );
316  try {
317  int firstbin = Gaudi::Axis::toRootIndex( idxY1, h.yAxis().bins() );
318  int lastbin = Gaudi::Axis::toRootIndex( idxY2, h.yAxis().bins() );
319  o = Gaudi::slice1DX( name, h, firstbin, lastbin );
320  } catch ( ... ) {
321  throw GaudiException( "Cannot cast 2D histogram to H2D to create sliceX `" + name + "'!", "HistogramSvc",
323  }
324  if ( o.first && registerObject( name, (IBaseHistogram*)o.second ).isSuccess() ) {
325  return o.second;
326  }
327  delete o.first;
328  throw GaudiException( "Cannot create sliceX `" + name + "' of 2D histogram!", "HistogramSvc", StatusCode::FAILURE );
329 }
330 
331 //------------------------------------------------------------------------------
332 IHistogram1D* HistogramSvc::sliceY( const string& name, const IHistogram2D& h, int indexX1, int indexX2 )
333 {
334  std::pair<DataObject*, IHistogram1D*> o( nullptr, nullptr );
335  try {
336  int firstbin = Gaudi::Axis::toRootIndex( indexX1, h.xAxis().bins() );
337  int lastbin = Gaudi::Axis::toRootIndex( indexX2, h.xAxis().bins() );
338  o = Gaudi::slice1DY( name, h, firstbin, lastbin );
339  } catch ( ... ) {
340  throw GaudiException( "Cannot create sliceY `" + name + "'!", "HistogramSvc", StatusCode::FAILURE );
341  }
342  // name stands here for the fullPath of the histogram
343  if ( o.first && registerObject( name, (IBaseHistogram*)o.second ).isSuccess() ) {
344  return o.second;
345  }
346  delete o.first;
347  throw GaudiException( "Cannot create sliceY `" + name + "' of 2D histogram!", "HistogramSvc", StatusCode::FAILURE );
348 }
349 
350 //------------------------------------------------------------------------------
351 bool HistogramSvc::destroy( IBaseHistogram* hist )
352 {
353  StatusCode sc = unregisterObject( dynamic_cast<IHistogram*>( hist ) );
354  if ( !sc.isSuccess() ) return false;
355  delete hist;
356  return true;
357 }
358 
359 // ============================================================================
360 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, const string& rel,
361  const string& title, int nx, double lowx, double upx )
362 {
363  if ( m_defs1D.empty() ) {
364  return i_book( pPar, rel, title, Gaudi::createH1D( title, nx, lowx, upx ) );
365  }
366  string hn = histoAddr( pPar, rel );
367  auto ifound = m_defs1D.find( hn );
368  if ( m_defs1D.end() == ifound ) {
369  return i_book( pPar, rel, title, Gaudi::createH1D( title, nx, lowx, upx ) );
370  }
371  if ( msgLevel( MSG::DEBUG ) ) {
372  debug() << " Redefine the parameters for the histogram '" + hn + "' to be " << ifound->second << endmsg;
373  }
374  m_mods1D.insert( hn );
375  return i_book( pPar, rel, ifound->second.title(),
376  Gaudi::createH1D( ifound->second.title(), ifound->second.bins(), ifound->second.lowEdge(),
377  ifound->second.lowEdge() ) );
378 }
379 
380 // ============================================================================
381 // constructor
382 // ============================================================================
383 HistogramSvc::HistogramSvc( const string& nam, ISvcLocator* svc )
384  : base_class( nam, svc )
385 {
386  // Properties can be declared here
387  m_rootName = "/stat";
388  m_rootCLID = CLID_DataObject;
389  m_defs1D.declareUpdateHandler( &HistogramSvc::update1Ddefs, this );
390 }
391 
392 // ============================================================================
394 {
395  // check and remove the leading '/stat/'
396  removeLeading( m_defs1D.value(), "/stat/" );
397 }
398 
399 // ============================================================================
400 // finalize the service
401 // ============================================================================
403 {
404  if ( !m_mods1D.empty() ) {
405  if ( msgLevel( MSG::DEBUG ) ) debug() << " Substituted histograms #" << m_mods1D.size() << " : " << endmsg;
406  for ( const auto& ih : m_mods1D ) {
407  if ( msgLevel( MSG::DEBUG ) ) debug() << " Path='" << ih << "'";
408  auto im = m_defs1D.find( ih );
409  if ( m_defs1D.end() != im ) {
410  debug() << " " << im->second;
411  }
412  }
413  m_mods1D.clear();
414  }
415  return DataSvc::finalize();
416 }
417 
418 // ============================================================================
419 AIDA::IHistogram1D* HistogramSvc::book( const string& par, const string& rel,
420  const string& title,
421  int nx, double lowx, double upx )
422 {
423  return book( createPath( par ), rel, title, nx, lowx, upx );
424 }
425 
426 // ============================================================================
427 AIDA::IHistogram1D* HistogramSvc::book( const string& par, int hID,
428  const string& title,
429  int nx, double lowx, double upx )
430 {
431  return book( par, std::to_string( hID ), title, nx, lowx, upx );
432 }
433 
434 // ============================================================================
435 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, int hID,
436  const string& title,
437  int nx, double lowx, double upx )
438 {
439  return book( pPar, std::to_string( hID ), title, nx, lowx, upx );
440 }
441 
442 // ============================================================================
443 AIDA::IHistogram1D* HistogramSvc::book( const std::pair<string, string>& loc,
444  const string& title,
445  int nx, double lowx, double upx )
446 {
447  return book( loc.first, loc.second, title, nx, lowx, upx );
448 }
449 
450 // ============================================================================
451 AIDA::IHistogram1D* HistogramSvc::book( const string& full, const string& title,
452  int nx, double lowx, double upx )
453 {
454  return book( i_splitPath( full ), title, nx, lowx, upx );
455 }
456 
457 // ============================================================================
458 AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, const string& rel,
459  const string& title,
460  int nx, double lowx, double upx, const string& opt )
461 {
462  return bookProf( createPath( par ), rel, title, nx, lowx, upx, opt );
463 }
464 
465 // ============================================================================
466 AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, int hID, const string& title,
467  int nx, double lowx, double upx, const string& opt )
468 {
469  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, opt );
470 }
471 
472 // ============================================================================
473 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const string& title,
474  int nx, double lowx, double upx, const string& opt )
475 {
476  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, opt );
477 }
478 
479 // ============================================================================
480 AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair<string, string>& loc,
481  const string& title,
482  int nx, double lowx, double upx, const string& opt )
483 {
484  return bookProf( loc.first, loc.second, title, nx, lowx, upx, opt );
485 }
486 
487 // ============================================================================
488 AIDA::IProfile1D* HistogramSvc::bookProf( const string& full, const string& title,
489  int nx, double lowx, double upx, const string& opt )
490 {
491  return bookProf( i_splitPath( full ), title, nx, lowx, upx, opt );
492 }
493 
494 // ============================================================================
495 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const string& rel,
496  const string& title,
497  int nx, double lowx, double upx, const string& opt )
498 {
499  return i_book( pPar, rel, title, Gaudi::createProf1D( title, nx, lowx, upx, 0, 0, opt ) );
500 }
501 
502 // ============================================================================
503 AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, const string& rel,
504  const string& title,
505  int nx, double lowx, double upx,
506  double upper, double lower, const string& opt )
507 {
508  return bookProf( createPath( par ), rel, title, nx, lowx, upx, upper, lower, opt );
509 }
510 
511 // ============================================================================
512 AIDA::IProfile1D* HistogramSvc::bookProf( const string& par, int hID, const string& title,
513  int nx, double lowx, double upx,
514  double upper, double lower, const string& opt )
515 {
516  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, upper, lower, opt );
517 }
518 
519 // ============================================================================
520 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID, const string& title,
521  int nx, double lowx, double upx,
522  double upper, double lower, const string& opt )
523 {
524  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, upper, lower, opt );
525 }
526 
527 // ============================================================================
528 AIDA::IProfile1D* HistogramSvc::bookProf( const std::pair<string, string>& loc,
529  const string& title,
530  int nx, double lowx, double upx,
531  double upper, double lower, const string& opt )
532 {
533  return bookProf( loc.first, loc.second, title, nx, lowx, upx, upper, lower, opt );
534 }
535 
536 // ============================================================================
537 AIDA::IProfile1D* HistogramSvc::bookProf( const string& full, const string& title,
538  int nx, double lowx, double upx,
539  double upper, double lower, const string& opt )
540 {
541  return bookProf( i_splitPath( full ), title, nx, lowx, upx, upper, lower, opt );
542 }
543 
544 // ============================================================================
545 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const string& rel,
546  const string& title,
547  int nx, double lowx, double upx,
548  double upper, double lower, const string& opt )
549 {
550  return i_book( pPar, rel, title, Gaudi::createProf1D( title, nx, lowx, upx, upper, lower, opt ) );
551 }
552 
553 // ============================================================================
554 AIDA::IHistogram1D* HistogramSvc::book( const std::string& par, int hID,
555  const std::string& title, Edges e )
556 {
557  return book( par, std::to_string( hID ), title, e );
558 }
559 
560 // ============================================================================
561 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, int hID,
562  const std::string& title, Edges e )
563 {
564  return book( pPar, std::to_string( hID ), title, e );
565 }
566 
567 // ============================================================================
568 AIDA::IHistogram1D* HistogramSvc::book( const std::string& par, const std::string& rel,
569  const std::string& title, Edges e )
570 {
571  return book( createPath( par ), rel, title, e );
572 }
573 
574 // ============================================================================
576  const std::string& title, Edges e )
577 {
578  return book( loc.first, loc.second, title, e );
579 }
580 
581 // ============================================================================
582 AIDA::IHistogram1D* HistogramSvc::book( const std::string& full,
583  const std::string& title, Edges e )
584 {
585  return book( i_splitPath( full ), title, e );
586 }
587 
588 // ============================================================================
589 AIDA::IHistogram1D* HistogramSvc::book( DataObject* pPar, const std::string& rel,
590  const std::string& title, Edges e )
591 {
592  return i_book( pPar, rel, title, Gaudi::createH1D( title, e ) );
593 }
594 
595 // ============================================================================
596 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& full,
597  const std::string& title, Edges e )
598 {
599  return bookProf( i_splitPath( full ), title, e );
600 }
601 
602 // ============================================================================
603 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, const std::string& rel,
604  const std::string& title, Edges e )
605 {
606  return bookProf( createPath( par ), rel, title, e );
607 }
608 
609 // ============================================================================
610 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, int hID,
611  const std::string& title, Edges e )
612 {
613  return bookProf( par, std::to_string( hID ), title, e );
614 }
615 
616 // ============================================================================
617 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID,
618  const std::string& title, Edges e )
619 {
620  return bookProf( pPar, std::to_string( hID ), title, e );
621 }
622 
623 // ============================================================================
625  const std::string& title, Edges e )
626 {
627  return bookProf( loc.first, loc.second, title, e );
628 }
629 
630 // ============================================================================
631 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel,
632  const std::string& title, Edges e )
633 {
634  return i_book( pPar, rel, title, Gaudi::createProf1D( title, e, 0, 0 ) );
635 }
636 
637 // ============================================================================
638 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& full,
639  const std::string& title, Edges e,
640  double upper, double lower )
641 {
642  return bookProf( i_splitPath( full ), title, e, upper, lower );
643 }
644 
645 // ============================================================================
646 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, const std::string& rel,
647  const std::string& title, Edges e,
648  double upper, double lower )
649 {
650  return bookProf( createPath( par ), rel, title, e, upper, lower );
651 }
652 
653 // ============================================================================
654 AIDA::IProfile1D* HistogramSvc::bookProf( const std::string& par, int hID,
655  const std::string& title, Edges e,
656  double upper, double lower )
657 {
658  return bookProf( par, std::to_string( hID ), title, e, upper, lower );
659 }
660 
661 // ============================================================================
662 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, int hID,
663  const std::string& title, Edges e,
664  double upper, double lower )
665 {
666  return bookProf( pPar, std::to_string( hID ), title, e, upper, lower );
667 }
668 
669 // ============================================================================
671  const std::string& title, Edges e,
672  double upper, double lower )
673 {
674  return bookProf( loc.first, loc.second, title, e, upper, lower );
675 }
676 
677 // ============================================================================
678 AIDA::IProfile1D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel,
679  const std::string& title, Edges e,
680  double upper, double lower )
681 {
682  return i_book( pPar, rel, title, Gaudi::createProf1D( title, e, upper, lower ) );
683 }
684 
685 // ============================================================================
686 AIDA::IHistogram2D* HistogramSvc::book( const std::string& full, const std::string& title,
687  int nx, double lowx, double upx, int ny,
688  double lowy, double upy )
689 {
690  return book( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy );
691 }
692 
693 // ============================================================================
694 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, const std::string& rel,
695  const std::string& title,
696  int nx, double lowx, double upx,
697  int ny, double lowy, double upy )
698 {
699  return book( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy );
700 }
701 
702 // ============================================================================
703 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, int hID,
704  const std::string& title,
705  int nx, double lowx, double upx,
706  int ny, double lowy, double upy )
707 {
708  return book( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
709 }
710 
711 // ============================================================================
713  const std::string& title,
714  int nx, double lowx, double upx,
715  int ny, double lowy, double upy )
716 {
717  return book( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy );
718 }
719 
720 // ============================================================================
721 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, int hID,
722  const std::string& title,
723  int nx, double lowx, double upx,
724  int ny, double lowy, double upy )
725 {
726  return book( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
727 }
728 
729 // ============================================================================
730 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, const std::string& rel,
731  const std::string& title,
732  int nx, double lowx, double upx,
733  int ny, double lowy, double upy )
734 {
735  return i_book( pPar, rel, title, Gaudi::createH2D( title, nx, lowx, upx, ny, lowy, upy ) );
736 }
737 
738 // ============================================================================
739 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full,
740  const std::string& title,
741  int nx, double lowx, double upx,
742  int ny, double lowy, double upy,
743  double upper, double lower )
744 {
745  return bookProf( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
746 }
747 
748 // ============================================================================
749 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel,
750  const std::string& title,
751  int nx, double lowx, double upx,
752  int ny, double lowy, double upy,
753  double upper, double lower )
754 {
755  return bookProf( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
756 }
757 
758 // ============================================================================
760  const std::string& title,
761  int nx, double lowx, double upx,
762  int ny, double lowy, double upy,
763  double upper, double lower )
764 {
765  return bookProf( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy, upper, lower );
766 }
767 
768 // ============================================================================
769 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID,
770  const std::string& title,
771  int nx, double lowx, double upx,
772  int ny, double lowy, double upy,
773  double upper, double lower )
774 {
775  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
776 }
777 
778 // ============================================================================
779 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID,
780  const std::string& title,
781  int nx, double lowx, double upx,
782  int ny, double lowy, double upy,
783  double upper, double lower )
784 {
785  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, upper, lower );
786 }
787 
788 // ============================================================================
789 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel,
790  const std::string& title,
791  int nx, double lowx, double upx,
792  int ny, double lowy, double upy,
793  double upper, double lower )
794 {
795  return i_book( pPar, rel, title, Gaudi::createProf2D( title, nx, lowx, upx, ny, lowy, upy, upper, lower ) );
796 }
797 
798 // ============================================================================
799 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full,
800  const std::string& title,
801  int nx, double lowx, double upx,
802  int ny, double lowy, double upy )
803 {
804  return bookProf( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy );
805 }
806 
807 // ============================================================================
808 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel,
809  const std::string& title,
810  int nx, double lowx, double upx,
811  int ny, double lowy, double upy )
812 {
813  return bookProf( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy );
814 }
815 
816 // ============================================================================
818  const std::string& title,
819  int nx, double lowx, double upx,
820  int ny, double lowy, double upy )
821 {
822  return bookProf( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy );
823 }
824 
825 // ============================================================================
826 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID,
827  const std::string& title,
828  int nx, double lowx, double upx,
829  int ny, double lowy, double upy )
830 {
831  return bookProf( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
832 }
833 
834 // ============================================================================
835 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID,
836  const std::string& title,
837  int nx, double lowx, double upx,
838  int ny, double lowy, double upy )
839 {
840  return bookProf( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy );
841 }
842 
843 // ============================================================================
844 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel,
845  const std::string& title,
846  int nx, double lowx, double upx,
847  int ny, double lowy, double upy )
848 {
849  return i_book( pPar, rel, title, Gaudi::createProf2D( title, nx, lowx, upx, ny, lowy, upy, 0, 0 ) );
850 }
851 
852 // ============================================================================
853 AIDA::IHistogram2D* HistogramSvc::book( const std::string& full,
854  const std::string& title,
855  Edges x, Edges y )
856 {
857  return book( i_splitPath( full ), title, x, y );
858 }
859 
860 // ============================================================================
861 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, const std::string& rel,
862  const std::string& title,
863  Edges x, Edges y )
864 {
865  return book( createPath( par ), rel, title, x, y );
866 }
867 
868 // ============================================================================
869 AIDA::IHistogram2D* HistogramSvc::book( const std::string& par, int hID,
870  const std::string& title,
871  Edges x, Edges y )
872 {
873  return book( par, std::to_string( hID ), title, x, y );
874 }
875 
876 // ============================================================================
878  const std::string& title,
879  Edges x, Edges y )
880 {
881  return book( loc.first, loc.second, title, x, y );
882 }
883 
884 // ============================================================================
885 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, int hID,
886  const std::string& title,
887  Edges x, Edges y )
888 {
889  return book( pPar, std::to_string( hID ), title, x, y );
890 }
891 
892 // ============================================================================
893 AIDA::IHistogram2D* HistogramSvc::book( DataObject* pPar, const std::string& rel,
894  const std::string& title,
895  Edges x, Edges y )
896 {
897  return i_book( pPar, rel, title, Gaudi::createH2D( title, x, y ) );
898 }
899 
900 // ============================================================================
901 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full,
902  const std::string& title,
903  Edges x, Edges y )
904 {
905  return bookProf( i_splitPath( full ), title, x, y );
906 }
907 
908 // ============================================================================
909 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel,
910  const std::string& title,
911  Edges x, Edges y )
912 {
913  return bookProf( createPath( par ), rel, title, x, y );
914 }
915 
916 // ============================================================================
917 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID,
918  const std::string& title,
919  Edges x, Edges y )
920 {
921  return bookProf( par, std::to_string( hID ), title, x, y );
922 }
923 
924 // ============================================================================
925 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID,
926  const std::string& title,
927  Edges x, Edges y )
928 {
929  return bookProf( pPar, std::to_string( hID ), title, x, y );
930 }
931 
932 // ============================================================================
934  const std::string& title,
935  Edges x, Edges y )
936 {
937  return bookProf( loc.first, loc.second, title, x, y );
938 }
939 
940 // ============================================================================
941 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel,
942  const std::string& title,
943  Edges x, Edges y )
944 {
945  return i_book( pPar, rel, title, Gaudi::createProf2D( title, x, y, 0, 0 ) );
946 }
947 
948 // ============================================================================
949 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& full,
950  const std::string& title,
951  Edges x, Edges y, double upper, double lower )
952 {
953  return bookProf( i_splitPath( full ), title, x, y, upper, lower );
954 }
955 
956 // ============================================================================
957 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, const std::string& rel,
958  const std::string& title,
959  Edges x, Edges y, double upper, double lower )
960 {
961  return bookProf( createPath( par ), rel, title, x, y, upper, lower );
962 }
963 
964 // ============================================================================
965 AIDA::IProfile2D* HistogramSvc::bookProf( const std::string& par, int hID,
966  const std::string& title,
967  Edges x, Edges y, double upper, double lower )
968 {
969  return bookProf( par, std::to_string( hID ), title, x, y, upper, lower );
970 }
971 
972 // ============================================================================
973 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, int hID,
974  const std::string& title,
975  Edges x, Edges y, double upper, double lower )
976 {
977  return bookProf( pPar, std::to_string( hID ), title, x, y, upper, lower );
978 }
979 
980 // ============================================================================
982  const std::string& title,
983  Edges x, Edges y, double upper, double lower )
984 {
985  return bookProf( loc.first, loc.second, title, x, y, upper, lower );
986 }
987 
988 // ============================================================================
989 AIDA::IProfile2D* HistogramSvc::bookProf( DataObject* pPar, const std::string& rel,
990  const std::string& title,
991  Edges x, Edges y, double upper, double lower )
992 {
993  return i_book( pPar, rel, title, Gaudi::createProf2D( title, x, y, upper, lower ) );
994 }
995 
996 // ============================================================================
997 AIDA::IHistogram3D* HistogramSvc::book( const std::string& full,
998  const std::string& title,
999  int nx, double lowx, double upx,
1000  int ny, double lowy, double upy,
1001  int nz, double lowz, double upz )
1002 {
1003  return book( i_splitPath( full ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1004 }
1005 
1006 // ============================================================================
1007 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, const std::string& rel,
1008  const std::string& title,
1009  int nx, double lowx, double upx,
1010  int ny, double lowy, double upy,
1011  int nz, double lowz, double upz )
1012 {
1013  return book( createPath( par ), rel, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1014 }
1015 
1016 // ============================================================================
1017 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, int hID,
1018  const std::string& title,
1019  int nx, double lowx, double upx,
1020  int ny, double lowy, double upy,
1021  int nz, double lowz, double upz )
1022 {
1023  return book( par, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1024 }
1025 
1026 // ============================================================================
1027 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, int hID,
1028  const std::string& title,
1029  int nx, double lowx, double upx,
1030  int ny, double lowy, double upy,
1031  int nz, double lowz, double upz )
1032 {
1033  return book( pPar, std::to_string( hID ), title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1034 }
1035 
1036 // ============================================================================
1038  const std::string& title,
1039  int nx, double lowx, double upx,
1040  int ny, double lowy, double upy,
1041  int nz, double lowz, double upz )
1042 {
1043  return book( loc.first, loc.second, title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1044 }
1045 
1046 // ============================================================================
1047 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, const std::string& rel,
1048  const std::string& title,
1049  int nx, double lowx, double upx,
1050  int ny, double lowy, double upy,
1051  int nz, double lowz, double upz )
1052 {
1053  return i_book( pPar, rel, title, Gaudi::createH3D( title, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz ) );
1054 }
1055 
1056 // ============================================================================
1057 AIDA::IHistogram3D* HistogramSvc::book( const std::string& full,
1058  const std::string& title,
1059  Edges x, Edges y, Edges z )
1060 {
1061  return book( i_splitPath( full ), title, x, y, z );
1062 }
1063 
1064 // ============================================================================
1065 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, const std::string& rel,
1066  const std::string& title,
1067  Edges x, Edges y, Edges z )
1068 {
1069  return book( createPath( par ), rel, title, x, y, z );
1070 }
1071 
1072 // ============================================================================
1073 AIDA::IHistogram3D* HistogramSvc::book( const std::string& par, int hID,
1074  const std::string& title,
1075  Edges x, Edges y, Edges z )
1076 {
1077  return book( par, std::to_string( hID ), title, x, y, z );
1078 }
1079 
1080 // ============================================================================
1081 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, int hID,
1082  const std::string& title,
1083  Edges x, Edges y, Edges z )
1084 {
1085  return book( pPar, std::to_string( hID ), title, x, y, z );
1086 }
1087 
1088 // ============================================================================
1090  const std::string& title,
1091  Edges x, Edges y, Edges z )
1092 {
1093  return book( loc.first, loc.second, title, x, y, z );
1094 }
1095 
1096 // ============================================================================
1097 AIDA::IHistogram3D* HistogramSvc::book( DataObject* pPar, const std::string& rel,
1098  const std::string& title,
1099  Edges x, Edges y, Edges z )
1100 {
1101  return i_book( pPar, rel, title, Gaudi::createH3D( title, x, y, z ) );
1102 }
1103 
1104 // ============================================================================
1106  const std::string& rel, Base* obj )
1107 {
1108  return registerObject( createPath( parent ), rel, obj );
1109 }
1110 
1111 // ============================================================================
1113  int item, Base* obj )
1114 {
1115  return registerObject( parent, std::to_string( item ), obj );
1116 }
1117 
1118 // ============================================================================
1120  Base* obj )
1121 {
1122  return registerObject( detail::cast( pPar ), rel, obj );
1123 }
1124 
1125 // ============================================================================
1127 {
1128  return registerObject( pPar, std::to_string( item ), obj );
1129 }
1130 
1131 // ============================================================================
1133 {
1134  return registerObject( detail::cast( pPar ), item, obj );
1135 }
1136 
1137 // ============================================================================
1139 {
1140  return DataSvc::unregisterObject( detail::cast( obj ) );
1141 }
1142 
1143 // ============================================================================
1145 {
1146  return DataSvc::unregisterObject( detail::cast( obj ), objectPath );
1147 }
1148 
1149 // ============================================================================
1151 {
1152  return DataSvc::unregisterObject( detail::cast( obj ), item );
1153 }
1154 
1155 // ============================================================================
1157  AIDA::IHistogram1D*& obj )
1158 {
1159  return Helper( this ).retrieve( pReg, path, obj );
1160 }
1161 
1162 // ============================================================================
1164  AIDA::IProfile1D*& obj )
1165 {
1166  return Helper( this ).retrieve( pReg, path, obj );
1167 }
1168 
1169 // ============================================================================
1171  AIDA::IHistogram2D*& obj )
1172 {
1173  return Helper( this ).retrieve( pReg, path, obj );
1174 }
1175 
1176 // ============================================================================
1178  AIDA::IProfile2D*& obj )
1179 {
1180  return Helper( this ).retrieve( pReg, path, obj );
1181 }
1182 
1183 // ============================================================================
1185  AIDA::IHistogram3D*& obj )
1186 {
1187  return Helper( this ).retrieve( pReg, path, obj );
1188 }
1189 
1190 // ============================================================================
1192  AIDA::IProfile1D*& obj )
1193 {
1194  return Helper( this ).retrieve( full, obj );
1195 }
1196 
1197 // ============================================================================
1199  AIDA::IProfile2D*& obj )
1200 {
1201  return Helper( this ).retrieve( full, obj );
1202 }
1203 
1204 // ============================================================================
1206  AIDA::IHistogram1D*& obj )
1207 {
1208  return Helper( this ).retrieve( full, obj );
1209 }
1210 
1211 // ============================================================================
1213  AIDA::IHistogram2D*& obj )
1214 {
1215  return Helper( this ).retrieve( full, obj );
1216 }
1217 
1218 // ============================================================================
1220  AIDA::IHistogram3D*& obj )
1221 {
1222  return Helper( this ).retrieve( full, obj );
1223 }
1224 
1225 // ============================================================================
1227 
1228  AIDA::IProfile1D*& obj )
1229 {
1230  return Helper( this ).retrieve( parent, rel, obj );
1231 }
1232 
1233 // ============================================================================
1235  AIDA::IProfile2D*& obj )
1236 {
1237  return Helper( this ).retrieve( parent, rel, obj );
1238 }
1239 
1240 // ============================================================================
1242  AIDA::IHistogram1D*& obj )
1243 {
1244  return Helper( this ).retrieve( parent, rel, obj );
1245 }
1246 
1247 // ============================================================================
1249  AIDA::IHistogram2D*& obj )
1250 {
1251  return Helper( this ).retrieve( parent, rel, obj );
1252 }
1253 
1254 // ============================================================================
1256  AIDA::IHistogram3D*& obj )
1257 {
1258  return Helper( this ).retrieve( parent, rel, obj );
1259 }
1260 
1261 // ============================================================================
1263  AIDA::IProfile1D*& obj )
1264 {
1265  return Helper( this ).retrieve( parent, item, obj );
1266 }
1267 
1268 // ============================================================================
1270  AIDA::IProfile2D*& obj )
1271 {
1272  return Helper( this ).retrieve( parent, item, obj );
1273 }
1274 
1275 // ============================================================================
1277  AIDA::IHistogram1D*& obj )
1278 {
1279  return Helper( this ).retrieve( parent, item, obj );
1280 }
1281 
1282 // ============================================================================
1284  AIDA::IHistogram2D*& obj )
1285 {
1286  return Helper( this ).retrieve( parent, item, obj );
1287 }
1288 
1289 // ============================================================================
1291  AIDA::IHistogram3D*& obj )
1292 {
1293  return Helper( this ).retrieve( parent, item, obj );
1294 }
1295 // ============================================================================
1297  AIDA::IProfile1D*& obj )
1298 {
1299  return Helper( this ).retrieve( par, item, obj );
1300 }
1301 
1302 // ============================================================================
1304  AIDA::IProfile2D*& obj )
1305 {
1306  return Helper( this ).retrieve( par, item, obj );
1307 }
1308 
1309 // ============================================================================
1311  AIDA::IHistogram1D*& obj )
1312 {
1313  return Helper( this ).retrieve( par, item, obj );
1314 }
1315 
1316 // ============================================================================
1318  AIDA::IHistogram2D*& obj )
1319 {
1320  return Helper( this ).retrieve( par, item, obj );
1321 }
1322 
1323 // ============================================================================
1325  AIDA::IHistogram3D*& obj )
1326 {
1327  return Helper( this ).retrieve( par, item, obj );
1328 }
1329 
1330 // ============================================================================
1332  AIDA::IProfile1D*& obj )
1333 {
1334  return Helper( this ).retrieve( par, item, obj );
1335 }
1336 
1337 // ============================================================================
1339  AIDA::IProfile2D*& obj )
1340 {
1341  return Helper( this ).retrieve( par, item, obj );
1342 }
1343 
1344 // ============================================================================
1346  AIDA::IHistogram1D*& obj )
1347 {
1348  return Helper( this ).retrieve( par, item, obj );
1349 }
1350 
1351 // ============================================================================
1353  AIDA::IHistogram2D*& obj )
1354 {
1355  return Helper( this ).retrieve( par, item, obj );
1356 }
1357 
1358 // ============================================================================
1360  AIDA::IHistogram3D*& obj )
1361 {
1362  return Helper( this ).retrieve( par, item, obj );
1363 }
1364 
1365 // ============================================================================
1367  AIDA::IProfile1D*& obj )
1368 {
1369  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1370 }
1371 
1372 // ============================================================================
1374  AIDA::IProfile2D*& obj )
1375 {
1376  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1377 }
1378 
1379 // ============================================================================
1381  AIDA::IHistogram1D*& obj )
1382 {
1383  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1384 }
1385 
1386 // ============================================================================
1388  AIDA::IHistogram2D*& obj )
1389 {
1390  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1391 }
1392 
1393 // ============================================================================
1395  AIDA::IHistogram3D*& obj )
1396 {
1397  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1398 }
1399 
1400 // ============================================================================
1402  AIDA::IProfile1D*& obj )
1403 {
1404  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1405 }
1406 
1407 // ============================================================================
1409  AIDA::IProfile2D*& obj )
1410 {
1411  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1412 }
1413 
1414 // ============================================================================
1416  AIDA::IHistogram1D*& obj )
1417 {
1418  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1419 }
1420 
1421 // ============================================================================
1423  AIDA::IHistogram2D*& obj )
1424 {
1425  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1426 }
1427 
1428 // ============================================================================
1430  AIDA::IHistogram3D*& obj )
1431 {
1432  return Helper( this ).retrieve( detail::cast( par ), item, obj );
1433 }
1434 
1435 // ============================================================================
1436 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IProfile1D*& obj )
1437 {
1438  return Helper( this ).find( pReg, path, obj );
1439 }
1440 // ============================================================================
1441 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IProfile2D*& obj )
1442 {
1443  return Helper( this ).find( pReg, path, obj );
1444 }
1445 // ============================================================================
1446 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram1D*& obj )
1447 {
1448  return Helper( this ).find( pReg, path, obj );
1449 }
1450 // ============================================================================
1451 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram2D*& obj )
1452 {
1453  return Helper( this ).find( pReg, path, obj );
1454 }
1455 // ============================================================================
1456 StatusCode HistogramSvc::findObject( IRegistry* pReg, const std::string& path, AIDA::IHistogram3D*& obj )
1457 {
1458  return Helper( this ).find( pReg, path, obj );
1459 }
1460 // ============================================================================
1461 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IProfile1D*& obj )
1462 {
1463  return Helper( this ).find( full, obj );
1464 }
1465 // ============================================================================
1466 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IProfile2D*& obj )
1467 {
1468  return Helper( this ).find( full, obj );
1469 }
1470 
1471 // ============================================================================
1472 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram1D*& obj )
1473 {
1474  return Helper( this ).find( full, obj );
1475 }
1476 
1477 // ============================================================================
1478 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram2D*& obj )
1479 {
1480  return Helper( this ).find( full, obj );
1481 }
1482 
1483 // ============================================================================
1484 StatusCode HistogramSvc::findObject( const std::string& full, AIDA::IHistogram3D*& obj )
1485 {
1486  return Helper( this ).find( full, obj );
1487 }
1488 
1489 // ============================================================================
1490 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IProfile1D*& obj )
1491 {
1492  return Helper( this ).find( par, rel, obj );
1493 }
1494 
1495 // ============================================================================
1496 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IProfile2D*& obj )
1497 {
1498  return Helper( this ).find( par, rel, obj );
1499 }
1500 
1501 // ============================================================================
1502 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram1D*& obj )
1503 {
1504  return Helper( this ).find( par, rel, obj );
1505 }
1506 
1507 // ============================================================================
1508 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram2D*& obj )
1509 {
1510  return Helper( this ).find( par, rel, obj );
1511 }
1512 
1513 // ============================================================================
1514 StatusCode HistogramSvc::findObject( const std::string& par, const std::string& rel, AIDA::IHistogram3D*& obj )
1515 {
1516  return Helper( this ).find( par, rel, obj );
1517 }
1518 
1519 // ============================================================================
1520 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IProfile1D*& obj )
1521 {
1522  return Helper( this ).find( par, item, obj );
1523 }
1524 
1525 // ============================================================================
1526 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IProfile2D*& obj )
1527 {
1528  return Helper( this ).find( par, item, obj );
1529 }
1530 
1531 // ============================================================================
1532 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram1D*& obj )
1533 {
1534  return Helper( this ).find( par, item, obj );
1535 }
1536 
1537 // ============================================================================
1538 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram2D*& obj )
1539 {
1540  return Helper( this ).find( par, item, obj );
1541 }
1542 
1543 // ============================================================================
1544 StatusCode HistogramSvc::findObject( const std::string& par, int item, AIDA::IHistogram3D*& obj )
1545 {
1546  return Helper( this ).find( par, item, obj );
1547 }
1548 
1549 // ============================================================================
1550 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IProfile1D*& obj )
1551 {
1552  return Helper( this ).find( par, item, obj );
1553 }
1554 
1555 // ============================================================================
1556 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IProfile2D*& obj )
1557 {
1558  return Helper( this ).find( par, item, obj );
1559 }
1560 
1561 // ============================================================================
1562 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram1D*& obj )
1563 {
1564  return Helper( this ).find( par, item, obj );
1565 }
1566 
1567 // ============================================================================
1568 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram2D*& obj )
1569 {
1570  return Helper( this ).find( par, item, obj );
1571 }
1572 
1573 // ============================================================================
1574 StatusCode HistogramSvc::findObject( DataObject* par, int item, AIDA::IHistogram3D*& obj )
1575 {
1576  return Helper( this ).find( par, item, obj );
1577 }
1578 
1579 // ============================================================================
1580 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IProfile1D*& obj )
1581 {
1582  return Helper( this ).find( par, item, obj );
1583 }
1584 
1585 // ============================================================================
1586 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IProfile2D*& obj )
1587 {
1588  return Helper( this ).find( par, item, obj );
1589 }
1590 
1591 // ============================================================================
1592 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram1D*& obj )
1593 {
1594  return Helper( this ).find( par, item, obj );
1595 }
1596 
1597 // ============================================================================
1598 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram2D*& obj )
1599 {
1600  return Helper( this ).find( par, item, obj );
1601 }
1602 
1603 // ============================================================================
1604 StatusCode HistogramSvc::findObject( DataObject* par, const std::string& item, AIDA::IHistogram3D*& obj )
1605 {
1606  return Helper( this ).find( par, item, obj );
1607 }
1608 
1609 // ============================================================================
1610 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IProfile1D*& obj )
1611 {
1612  return Helper( this ).find( detail::cast( par ), item, obj );
1613 }
1614 
1615 // ============================================================================
1616 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IProfile2D*& obj )
1617 {
1618  return Helper( this ).find( detail::cast( par ), item, obj );
1619 }
1620 
1621 // ============================================================================
1622 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram1D*& obj )
1623 {
1624  return Helper( this ).find( detail::cast( par ), item, obj );
1625 }
1626 
1627 // ============================================================================
1628 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram2D*& obj )
1629 {
1630  return Helper( this ).find( detail::cast( par ), item, obj );
1631 }
1632 
1633 // ============================================================================
1634 StatusCode HistogramSvc::findObject( Base* par, int item, AIDA::IHistogram3D*& obj )
1635 {
1636  return Helper( this ).find( detail::cast( par ), item, obj );
1637 }
1638 
1639 // ============================================================================
1641  AIDA::IProfile1D*& obj )
1642 {
1643  return Helper( this ).find( detail::cast( par ), item, obj );
1644 }
1645 
1646 // ============================================================================
1648  AIDA::IProfile2D*& obj )
1649 {
1650  return Helper( this ).find( detail::cast( par ), item, obj );
1651 }
1652 
1653 // ============================================================================
1655  AIDA::IHistogram1D*& obj )
1656 {
1657  return Helper( this ).find( detail::cast( par ), item, obj );
1658 }
1659 
1660 // ============================================================================
1662  AIDA::IHistogram2D*& obj )
1663 {
1664  return Helper( this ).find( detail::cast( par ), item, obj );
1665 }
1666 
1667 // ============================================================================
1669  AIDA::IHistogram3D*& obj )
1670 {
1671  return Helper( this ).find( detail::cast( par ), item, obj );
1672 }
1673 
1674 // ============================================================================
1675 AIDA::IHistogram1D* HistogramSvc::projectionX( const std::string& name,
1676  const AIDA::IHistogram2D& h )
1677 {
1678  return sliceX( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN );
1679 }
1680 
1681 // ============================================================================
1682 AIDA::IHistogram1D* HistogramSvc::projectionY( const std::string& name,
1683  const AIDA::IHistogram2D& h )
1684 {
1685  return sliceY( name, h, IAxis::UNDERFLOW_BIN, IAxis::OVERFLOW_BIN );
1686 }
1687 
1688 // ============================================================================
1689 AIDA::IHistogram1D* HistogramSvc::sliceX( const std::string& name,
1690  const AIDA::IHistogram2D& h, int indexY )
1691 {
1692  return sliceX( name, h, indexY, indexY );
1693 }
1694 
1695 // ============================================================================
1696 AIDA::IHistogram1D* HistogramSvc::sliceY( const std::string& name,
1697  const AIDA::IHistogram2D& h, int indexX )
1698 {
1699  return sliceY( name, h, indexX, indexX );
1700 }
1701 
1702 // ============================================================================
1703 AIDA::IHistogram1D* HistogramSvc::add( const std::string& nameAndTitle,
1704  const AIDA::IHistogram1D& a,
1705  const AIDA::IHistogram1D& b )
1706 {
1707  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Add, 1. );
1708 }
1709 
1710 // ============================================================================
1711 AIDA::IHistogram1D* HistogramSvc::subtract( const std::string& nameAndTitle,
1712  const AIDA::IHistogram1D& a,
1713  const AIDA::IHistogram1D& b )
1714 {
1715  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Add, -1. );
1716 }
1717 
1718 // ============================================================================
1719 AIDA::IHistogram1D* HistogramSvc::multiply( const std::string& nameAndTitle,
1720  const AIDA::IHistogram1D& a,
1721  const AIDA::IHistogram1D& b )
1722 {
1723  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Multiply );
1724 }
1725 
1726 // ============================================================================
1727 AIDA::IHistogram1D* HistogramSvc::divide( const std::string& nameAndTitle,
1728  const AIDA::IHistogram1D& a,
1729  const AIDA::IHistogram1D& b )
1730 {
1731  return Helper::act( createCopy( nameAndTitle, a ), b, &TH1::Divide );
1732 }
1733 
1734 // ============================================================================
1735 AIDA::IHistogram2D* HistogramSvc::add( const std::string& nameAndTitle,
1736  const AIDA::IHistogram2D& a,
1737  const AIDA::IHistogram2D& b )
1738 {
1739  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Add, 1. );
1740 }
1741 
1742 // ============================================================================
1743 AIDA::IHistogram2D* HistogramSvc::subtract( const std::string& nameAndTitle,
1744  const AIDA::IHistogram2D& a,
1745  const AIDA::IHistogram2D& b )
1746 {
1747  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Add, -1. );
1748 }
1749 
1750 // ============================================================================
1751 AIDA::IHistogram2D* HistogramSvc::multiply( const std::string& nameAndTitle,
1752  const AIDA::IHistogram2D& a,
1753  const AIDA::IHistogram2D& b )
1754 {
1755  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Multiply );
1756 }
1757 
1758 // ============================================================================
1759 AIDA::IHistogram2D* HistogramSvc::divide( const std::string& nameAndTitle,
1760  const AIDA::IHistogram2D& a,
1761  const AIDA::IHistogram2D& b )
1762 {
1763  return Helper::act( createCopy( nameAndTitle, a ), b, &TH2D::Divide );
1764 }
1765 
1766 // ============================================================================
1767 AIDA::IHistogram3D* HistogramSvc::add( const std::string& nameAndTitle,
1768  const AIDA::IHistogram3D& a,
1769  const AIDA::IHistogram3D& b )
1770 {
1771  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Add, 1. );
1772 }
1773 
1774 // ============================================================================
1775 AIDA::IHistogram3D* HistogramSvc::subtract( const std::string& nameAndTitle,
1776  const AIDA::IHistogram3D& a,
1777  const AIDA::IHistogram3D& b )
1778 {
1779  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Add, -1. );
1780 }
1781 
1782 // ============================================================================
1783 AIDA::IHistogram3D* HistogramSvc::multiply( const std::string& nameAndTitle,
1784  const AIDA::IHistogram3D& a,
1785  const AIDA::IHistogram3D& b )
1786 {
1787  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Multiply );
1788 }
1789 
1790 // ============================================================================
1791 AIDA::IHistogram3D* HistogramSvc::divide( const std::string& nameAndTitle,
1792  const AIDA::IHistogram3D& a,
1793  const AIDA::IHistogram3D& b )
1794 {
1795  return Helper::act( createCopy( nameAndTitle, a ), b, &TH3D::Divide );
1796 }
1797 
1798 // ============================================================================
1799 AIDA::IHistogram2D* HistogramSvc::projectionXY( const std::string& nameAndTitle,
1800  const AIDA::IHistogram3D& h )
1801 {
1802  return i_project( nameAndTitle, h, "xy" );
1803 }
1804 
1805 // ============================================================================
1806 AIDA::IHistogram2D* HistogramSvc::projectionXZ( const std::string& nameAndTitle,
1807  const AIDA::IHistogram3D& h )
1808 {
1809  return i_project( nameAndTitle, h, "xz" );
1810 }
1811 
1812 // ============================================================================
1813 AIDA::IHistogram2D* HistogramSvc::projectionYZ( const std::string& nameAndTitle,
1814  const AIDA::IHistogram3D& h )
1815 {
1816  return i_project( nameAndTitle, h, "yz" );
1817 }
1818 
1819 // ============================================================================
1820 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name,
1821  const std::string& tit,
1822  int nx, double lowx, double upx )
1823 {
1824  return book( name, tit, nx, lowx, upx );
1825 }
1826 
1827 // ============================================================================
1828 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name,
1829  const std::string& tit,
1830  int nx, double lowx, double upx,
1831  const std::string& /*opt*/ )
1832 {
1833  return book( name, tit, nx, lowx, upx );
1834 }
1835 
1836 // ============================================================================
1837 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& name,
1838  const std::string& title,
1839  const Edges& x,
1840  const std::string& /*opt*/ )
1841 {
1842  return book( name, title, x );
1843 }
1844 
1845 // ============================================================================
1846 AIDA::IHistogram1D* HistogramSvc::createHistogram1D( const std::string& nameAndTitle,
1847  int nx, double lowx, double upx )
1848 {
1849  return book( nameAndTitle, nameAndTitle, nx, lowx, upx );
1850 }
1851 
1852 // ============================================================================
1853 AIDA::IHistogram1D* HistogramSvc::createCopy( const std::string& full,
1854  const AIDA::IHistogram1D& h )
1855 {
1856  return createCopy( i_splitPath( full ), h );
1857 }
1858 
1859 // ============================================================================
1860 AIDA::IHistogram1D* HistogramSvc::createCopy( const std::string& par,
1861  const std::string& rel,
1862  const AIDA::IHistogram1D& h )
1863 {
1864  return createCopy( createPath( par ), rel, h );
1865 }
1866 
1867 // ============================================================================
1869  const AIDA::IHistogram1D& h )
1870 {
1871  return createCopy( loc.first, loc.second, h );
1872 }
1873 
1874 // ============================================================================
1875 AIDA::IHistogram1D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel,
1876  const AIDA::IHistogram1D& h )
1877 {
1878  return i_book( pPar, rel, h.title(), Gaudi::createH1D( h ) );
1879 }
1880 
1881 // ============================================================================
1882 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& tit,
1883  int nx, double lowx, double upx,
1884  int ny, double lowy, double upy )
1885 {
1886  return book( name, tit, nx, lowx, upx, ny, lowy, upy );
1887 }
1888 
1889 // ============================================================================
1890 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& tit,
1891  int nx, double lowx, double upx,
1892  int ny, double lowy, double upy,
1893  const std::string& /*opt*/ )
1894 {
1895  return book( name, tit, nx, lowx, upx, ny, lowy, upy );
1896 }
1897 
1898 // ============================================================================
1899 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& name, const std::string& title,
1900  const Edges& x, const Edges& y,
1901  const std::string& /*opt*/ )
1902 {
1903  return book( name, title, x, y );
1904 }
1905 
1906 // ============================================================================
1907 AIDA::IHistogram2D* HistogramSvc::createHistogram2D( const std::string& nameAndTitle,
1908  int nx, double lowx, double upx,
1909  int ny, double lowy, double upy )
1910 {
1911  return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy );
1912 }
1913 
1914 // ============================================================================
1915 AIDA::IHistogram2D* HistogramSvc::createCopy( const std::string& full,
1916  const AIDA::IHistogram2D& h )
1917 {
1918  return createCopy( i_splitPath( full ), h );
1919 }
1920 
1921 // ============================================================================
1922 AIDA::IHistogram2D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
1923  const AIDA::IHistogram2D& h )
1924 {
1925  return createCopy( createPath( par ), rel, h );
1926 }
1927 
1928 // ============================================================================
1930  const AIDA::IHistogram2D& h )
1931 {
1932  return createCopy( loc.first, loc.second, h );
1933 }
1934 
1935 // ============================================================================
1936 AIDA::IHistogram2D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel,
1937  const AIDA::IHistogram2D& h )
1938 {
1939  return i_book( pPar, rel, h.title(), Gaudi::createH2D( h ) );
1940 }
1941 
1942 // ============================================================================
1943 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& tit,
1944  int nx, double lowx, double upx,
1945  int ny, double lowy, double upy,
1946  int nz, double lowz, double upz )
1947 {
1948  return book( name, tit, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1949 }
1950 
1951 // ============================================================================
1952 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& tit,
1953  int nx, double lowx, double upx,
1954  int ny, double lowy, double upy,
1955  int nz, double lowz, double upz,
1956  const std::string& /*opt*/ )
1957 {
1958  return book( name, tit, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1959 }
1960 
1961 // ============================================================================
1962 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& name, const std::string& title,
1963  const Edges& x, const Edges& y, const Edges& z,
1964  const std::string& /*opt*/ )
1965 {
1966  return book( name, title, x, y, z );
1967 }
1968 
1969 // ============================================================================
1970 AIDA::IHistogram3D* HistogramSvc::createHistogram3D( const std::string& nameAndTitle,
1971  int nx, double lowx, double upx,
1972  int ny, double lowy, double upy,
1973  int nz, double lowz, double upz )
1974 {
1975  return book( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy, nz, lowz, upz );
1976 }
1977 
1978 // ============================================================================
1979 AIDA::IHistogram3D* HistogramSvc::createCopy( const std::string& full,
1980  const AIDA::IHistogram3D& h )
1981 {
1982  return createCopy( i_splitPath( full ), h );
1983 }
1984 
1985 // ============================================================================
1986 AIDA::IHistogram3D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
1987  const AIDA::IHistogram3D& h )
1988 {
1989  return createCopy( createPath( par ), rel, h );
1990 }
1991 
1992 // ============================================================================
1994  const AIDA::IHistogram3D& h )
1995 {
1996  return createCopy( loc.first, loc.second, h );
1997 }
1998 
1999 // ============================================================================
2000 AIDA::IHistogram3D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel,
2001  const AIDA::IHistogram3D& h )
2002 {
2003  return i_book( pPar, rel, h.title(), Gaudi::createH3D( h ) );
2004 }
2005 
2006 // ============================================================================
2007 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& tit,
2008  int nx, double lowx, double upx,
2009  const std::string& opt )
2010 {
2011  return bookProf( name, tit, nx, lowx, upx, opt );
2012 }
2013 
2014 // ============================================================================
2015 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name, const std::string& tit,
2016  int nx, double lowx, double upx,
2017  double upper, double lower,
2018  const std::string& opt )
2019 {
2020  return bookProf( name, tit, nx, lowx, upx, upper, lower, opt );
2021 }
2022 
2023 // ============================================================================
2024 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name,
2025  const std::string& title, const Edges& x,
2026  const std::string& /* opt */ )
2027 {
2028  return bookProf( name, title, x );
2029 }
2030 
2031 
2032 // ============================================================================
2033 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& name,
2034  const std::string& title, const Edges& x,
2035  double upper, double lower,
2036  const std::string& /* opt */ )
2037 {
2038  return bookProf( name, title, x, upper, lower );
2039 }
2040 
2041 // ============================================================================
2042 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& nametit,
2043  int nx, double lowx, double upx )
2044 {
2045  return bookProf( nametit, nametit, nx, lowx, upx, "s" );
2046 }
2047 
2048 // ============================================================================
2049 AIDA::IProfile1D* HistogramSvc::createProfile1D( const std::string& nametit,
2050  int nx, double lowx, double upx,
2051  double upper, double lower )
2052 {
2053  return bookProf( nametit, nametit, nx, lowx, upx, upper, lower, "s" );
2054 }
2055 
2056 // ============================================================================
2057 AIDA::IProfile1D* HistogramSvc::createCopy( const std::string& full,
2058  const AIDA::IProfile1D& h )
2059 {
2060  return createCopy( i_splitPath( full ), h );
2061 }
2062 
2063 // ============================================================================
2064 AIDA::IProfile1D* HistogramSvc::createCopy( const std::string& par, const std::string& rel,
2065  const AIDA::IProfile1D& h )
2066 {
2067  return createCopy( createPath( par ), rel, h );
2068 }
2069 
2070 // ============================================================================
2072  const AIDA::IProfile1D& h )
2073 {
2074  return createCopy( loc.first, loc.second, h );
2075 }
2076 
2077 // ============================================================================
2078 AIDA::IProfile1D* HistogramSvc::createCopy( DataObject* pPar, const std::string& rel,
2079  const AIDA::IProfile1D& h )
2080 {
2081  return i_book( pPar, rel, h.title(), Gaudi::createProf1D( h ) );
2082 }
2083 
2084 // ============================================================================
2085 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& tit,
2086  int nx, double lowx, double upx,
2087  int ny, double lowy, double upy )
2088 {
2089  return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy );
2090 }
2091 
2092 // ============================================================================
2093 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& tit,
2094  int nx, double lowx, double upx,
2095  int ny, double lowy, double upy,
2096  const std::string& /*opt*/ )
2097 {
2098  return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy );
2099 }
2100 
2101 // ============================================================================
2102 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name,
2103  const std::string& title,
2104  const Edges& x, const Edges& y,
2105  const std::string& /*opt*/ )
2106 {
2107  return bookProf( name, title, x, y );
2108 }
2109 
2110 // ============================================================================
2111 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& nameAndTitle,
2112  int nx, double lowx, double upx,
2113  int ny, double lowy, double upy )
2114 {
2115  return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx, ny, lowy, upy );
2116 }
2117 
2118 // ============================================================================
2119 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name,
2120  const std::string& tit,
2121  int nx, double lowx, double upx,
2122  int ny, double lowy, double upy,
2123  double upper, double lower )
2124 {
2125  return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy, upper, lower );
2126 }
2127 
2128 // ============================================================================
2129 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name, const std::string& tit,
2130  int nx, double lowx, double upx,
2131  int ny, double lowy, double upy,
2132  double upper, double lower,
2133  const std::string& /*opt*/ )
2134 {
2135  return bookProf( name, tit, nx, lowx, upx, ny, lowy, upy, upper, lower );
2136 }
2137 
2138 // ============================================================================
2139 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& name,
2140  const std::string& title,
2141  const Edges& x, const Edges& y,
2142  double upper, double lower,
2143  const std::string& /*opt*/ )
2144 {
2145  return bookProf( name, title, x, y, upper, lower );
2146 }
2147 
2148 // ============================================================================
2149 AIDA::IProfile2D* HistogramSvc::createProfile2D( const std::string& nameAndTitle,
2150  int nx, double lowx, double upx,
2151  int ny, double lowy, double upy,
2152  double upper, double lower )
2153 {
2154  return bookProf( nameAndTitle, nameAndTitle, nx, lowx, upx,
2155  ny, lowy, upy, upper, lower );
2156 }
2157 
2158 // ============================================================================
2159 AIDA::IProfile2D* HistogramSvc::createCopy( const std::string& full,
2160  const AIDA::IProfile2D& h )
2161 {
2162  return createCopy( i_splitPath( full ), h );
2163 }
2164 
2165 // ============================================================================
2166 AIDA::IProfile2D* HistogramSvc::createCopy( const std::string& par,
2167  const std::string& rel,
2168  const AIDA::IProfile2D& h )
2169 {
2170  return createCopy( createPath( par ), rel, h );
2171 }
2172 
2173 // ============================================================================
2175  std::string>& loc,
2176  const AIDA::IProfile2D& h )
2177 {
2178  return createCopy( loc.first, loc.second, h );
2179 }
2180 
2181 // ============================================================================
2182 AIDA::IProfile2D* HistogramSvc::createCopy( DataObject* pPar,
2183  const std::string& rel,
2184  const AIDA::IProfile2D& h )
2185 {
2186  return i_book( pPar, rel, h.title(), Gaudi::createProf2D( h ) );
2187 }
StatusCode unregisterObject(const std::string &fullPath) override
Unregister object from the data store.
Definition: DataSvc.cpp:471
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
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 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::IHistogram1D * > createH1D(const AIDA::IHistogram1D &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:74
unsigned long release() override
release reference to object
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:356
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:8
IRegistry * registry() const
Get pointer to Registry.
Definition: DataObject.h:74
AIDA::IHistogram1D * subtract(const std::string &nameAndTitle, const AIDA::IHistogram1D &a, const AIDA::IHistogram1D &b) override
std::pair< DataObject *, AIDA::IProfile2D * > createProf2D(const AIDA::IProfile2D &hist)
Copy constructor.
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:179
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.
bool destroy(IBaseHistogram *hist) override
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
constexpr double m
Definition: SystemOfUnits.h:93
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:222
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:30
StatusCode findObject(const std::string &fullPath, DataObject *&pObject) override
Find object identified by its full path in the data store.
Definition: DataSvc.cpp:828
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:69
std::pair< DataObject *, AIDA::IHistogram2D * > createH2D(const AIDA::IHistogram2D &hist)
Copy constructor.
std::pair< DataObject *, AIDA::IHistogram1D * > slice1DX(const std::string &name, const AIDA::IHistogram2D &h, int firstbin, int lastbin)
Create 1D slice from 2D histogram.
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:1188
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.
StatusCode retrieveObject(IRegistry *pDirectory, const std::string &path, DataObject *&pObject) override
Retrieve object from data store.
Definition: DataSvc.cpp:763
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:22
STL class.
HistogramSvc(const std::string &name, ISvcLocator *svc)
Statndard Constructor.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
std::pair< DataObject *, AIDA::IHistogram3D * > createH3D(const AIDA::IHistogram3D &hist)
Copy constructor.
StatusCode initialize() override
Service initialization.
Definition: DataSvc.cpp:1153
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:245
static R * act(R *res, const S &b, void(T1::*pmf)(const T2 *, Double_t), Double_t scale)
Definition: HistogramSvc.h:107
static int toRootIndex(int index, int nbins)
Definition: Axis.h:33
std::pair< DataObject *, AIDA::IProfile1D * > createProf1D(const AIDA::IProfile1D &hist)
Copy constructor.
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:30
STL class.
void toupper(std::string &s)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244