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