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