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