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