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