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