00001
00002
00003 #ifndef GAUDIALG_GAUDIHISTOS_H
00004 #define GAUDIALG_GAUDIHISTOS_H 1
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <limits>
00020 #include <vector>
00021
00022
00023
00024 #include "GaudiKernel/HistoProperty.h"
00025
00026
00027
00028 #include "GaudiAlg/Maps.h"
00029 #include "GaudiAlg/HbookName.h"
00030
00031
00032 namespace AIDA
00033 {
00034 class IHistogram1D;
00035 class IHistogram2D;
00036 class IHistogram3D;
00037 class IProfile1D;
00038 class IProfile2D;
00039 }
00040
00050 template <class PBASE>
00051 class GAUDI_API GaudiHistos: public PBASE
00052 {
00053 public:
00054
00056 typedef GaudiAlg::HistoID HistoID;
00057
00059 typedef GaudiAlg::Histo1DMapNumericID Histo1DMapNumID;
00061 typedef GaudiAlg::Histo1DMapLiteralID Histo1DMapLitID;
00063 typedef GaudiAlg::Histo1DMapTitle Histo1DMapTitle;
00064
00066 typedef GaudiAlg::Histo2DMapNumericID Histo2DMapNumID;
00068 typedef GaudiAlg::Histo2DMapLiteralID Histo2DMapLitID;
00070 typedef GaudiAlg::Histo2DMapTitle Histo2DMapTitle;
00071
00073 typedef GaudiAlg::Histo3DMapNumericID Histo3DMapNumID;
00075 typedef GaudiAlg::Histo3DMapLiteralID Histo3DMapLitID;
00077 typedef GaudiAlg::Histo3DMapTitle Histo3DMapTitle;
00078
00080 typedef GaudiAlg::Profile1DMapNumericID Profile1DMapNumID;
00082 typedef GaudiAlg::Profile1DMapLiteralID Profile1DMapLitID;
00084 typedef GaudiAlg::Profile1DMapTitle Profile1DMapTitle;
00085
00087 typedef GaudiAlg::Profile2DMapNumericID Profile2DMapNumID;
00089 typedef GaudiAlg::Profile2DMapLiteralID Profile2DMapLitID;
00091 typedef GaudiAlg::Profile2DMapTitle Profile2DMapTitle;
00092
00094 typedef GaudiAlg::HistoBinEdges HistoBinEdges;
00095
00096 public:
00097
00098
00099
00100
00143 AIDA::IHistogram1D* plot1D
00144 ( const double value ,
00145 const std::string& title ,
00146 const double low ,
00147 const double high ,
00148 const unsigned long bins = 100 ,
00149 const double weight = 1.0 ) const ;
00150
00164 inline AIDA::IHistogram1D* plot
00165 ( const double value ,
00166 const std::string& title ,
00167 const double low ,
00168 const double high ,
00169 const unsigned long bins = 100 ,
00170 const double weight = 1.0 ) const
00171 {
00172 return plot1D ( value, title, low, high, bins, weight );
00173 }
00174
00199 AIDA::IHistogram1D* plot1D
00200 ( const double value ,
00201 const Gaudi::Histo1DDef& hdef ,
00202 const double weight = 1.0 ) const ;
00203
00214 inline AIDA::IHistogram1D* plot
00215 ( const double value ,
00216 const Gaudi::Histo1DDef& hdef ,
00217 const double weight = 1.0 ) const
00218 {
00219 return plot1D ( value, hdef, weight );
00220 }
00221
00286
00287 AIDA::IHistogram1D* plot1D
00288 ( const double value ,
00289 const HistoID& ID ,
00290 const std::string& title ,
00291 const double low ,
00292 const double high ,
00293 const unsigned long bins = 100 ,
00294 const double weight = 1.0 ) const ;
00295
00310 inline AIDA::IHistogram1D* plot
00311 ( const double value ,
00312 const HistoID& ID ,
00313 const std::string& title ,
00314 const double low ,
00315 const double high ,
00316 const unsigned long bins = 100 ,
00317 const double weight = 1.0 ) const
00318 {
00319 return plot1D ( value, ID, title, low, high, bins, weight );
00320 }
00321
00347 AIDA::IHistogram1D* plot1D
00348 ( const double value ,
00349 const HistoID& ID ,
00350 const Gaudi::Histo1DDef& hdef ,
00351 const double weight = 1.0 ) const ;
00352
00364 inline AIDA::IHistogram1D* plot
00365 ( const double value ,
00366 const HistoID& ID ,
00367 const Gaudi::Histo1DDef& hdef ,
00368 const double weight = 1.0 ) const
00369 {
00370 return plot1D ( value, ID, hdef, weight );
00371 }
00435 template <class FUNCTION,class OBJECT>
00436 inline AIDA::IHistogram1D* plot
00437 ( const FUNCTION& func ,
00438 OBJECT first ,
00439 OBJECT last ,
00440 const std::string& title ,
00441 const double low ,
00442 const double high ,
00443 const unsigned long bins = 100 ) const
00444 {
00445 AIDA::IHistogram1D* h(0);
00446 if ( produceHistos() )
00447 {
00448
00449 h = histo1D ( title ) ;
00450 if ( 0 == h ) { h = book1D ( title , low , high , bins ); }
00451
00452 while( first != last && 0 != h )
00453 { h = fill ( h , func( *first ) , 1.0 , title ) ; ++first ; }
00454 }
00455 return h ;
00456 }
00457
00513 template <class FUNCTION,class OBJECT>
00514 inline AIDA::IHistogram1D* plot
00515 ( const FUNCTION& func ,
00516 OBJECT first ,
00517 OBJECT last ,
00518 const HistoID& ID ,
00519 const std::string& title ,
00520 const double low ,
00521 const double high ,
00522 const unsigned long bins = 100 ) const
00523 {
00524 AIDA::IHistogram1D* h(0);
00525 if ( produceHistos() )
00526 {
00527
00528 h = histo1D ( ID ) ;
00529 if ( 0 == h ) { h = book1D ( ID , title , low , high , bins ); }
00530
00531 while( first != last && 0 != h )
00532 { h = fill( h , func( *first ) , 1.0 , title ) ; ++first ; }
00533 }
00534 return h;
00535 }
00536
00605 template <class FUNCTION,class OBJECT,class WEIGHT>
00606 inline AIDA::IHistogram1D* plot
00607 ( const FUNCTION& func ,
00608 OBJECT first ,
00609 OBJECT last ,
00610 const std::string& title ,
00611 const double low ,
00612 const double high ,
00613 const unsigned long bins ,
00614 const WEIGHT& weight ) const
00615 {
00616 AIDA::IHistogram1D* h(0);
00617 if ( produceHistos() )
00618 {
00619
00620 h = histo1D ( title ) ;
00621 if ( 0 == h ) { h = book1D ( title , low , high , bins ); }
00622
00623 while ( first != last && 0 != h )
00624 { h = fill ( h ,
00625 func ( *first ) ,
00626 weight ( *first ) , title ) ; ++first ; }
00627 }
00628 return h;
00629 }
00630
00697 template <class FUNCTION,class OBJECT,class WEIGHT>
00698 inline AIDA::IHistogram1D* plot
00699 ( const FUNCTION& func ,
00700 OBJECT first ,
00701 OBJECT last ,
00702 const HistoID& ID ,
00703 const std::string& title ,
00704 const double low ,
00705 const double high ,
00706 const unsigned long bins ,
00707 const WEIGHT& weight ) const
00708 {
00709 AIDA::IHistogram1D* h(0);
00710 if ( produceHistos() )
00711 {
00712
00713 h = histo1D ( ID ) ;
00714 if ( 0 == h ) { h = book1D ( ID , title , low , high , bins ); }
00715
00716 while( first != last && 0 != h )
00717 { h = fill ( h ,
00718 func ( *first ) ,
00719 weight ( *first ) , title ) ; ++first ; }
00720 }
00721 return h ;
00722 }
00723
00724
00725
00726
00766 AIDA::IHistogram1D* plot1D
00767 ( const double value ,
00768 const std::string& title ,
00769 const HistoBinEdges& edges ,
00770 const double weight = 1.0 ) const ;
00771
00835
00836 AIDA::IHistogram1D* plot1D
00837 ( const double value ,
00838 const HistoID& ID ,
00839 const std::string& title ,
00840 const HistoBinEdges& edges ,
00841 const double weight = 1.0 ) const ;
00842
00843
00844
00895 AIDA::IHistogram2D* plot2D
00896 ( const double valueX ,
00897 const double valueY ,
00898 const std::string& title ,
00899 const double lowX ,
00900 const double highX ,
00901 const double lowY ,
00902 const double highY ,
00903 const unsigned long binsX = 50 ,
00904 const unsigned long binsY = 50 ,
00905 const double weight = 1.0 ) const;
00906
00983 AIDA::IHistogram2D* plot2D
00984 ( const double valueX ,
00985 const double valueY ,
00986 const HistoID& ID ,
00987 const std::string& title ,
00988 const double lowX ,
00989 const double highX ,
00990 const double lowY ,
00991 const double highY ,
00992 const unsigned long binsX = 50 ,
00993 const unsigned long binsY = 50 ,
00994 const double weight = 1.0 ) const;
00995
00996
00997
00998
01044 AIDA::IHistogram2D* plot2D
01045 ( const double valueX ,
01046 const double valueY ,
01047 const std::string& title ,
01048 const HistoBinEdges& edgesX ,
01049 const HistoBinEdges& edgesY ,
01050 const double weight = 1.0 ) const ;
01051
01127 AIDA::IHistogram2D* plot2D
01128 ( const double valueX ,
01129 const double valueY ,
01130 const HistoID& ID ,
01131 const std::string& title ,
01132 const HistoBinEdges& edgesX ,
01133 const HistoBinEdges& edgesY ,
01134 const double weight = 1.0 ) const ;
01135
01136
01137
01196 AIDA::IHistogram3D* plot3D
01197 ( const double valueX ,
01198 const double valueY ,
01199 const double valueZ ,
01200 const std::string& title ,
01201 const double lowX ,
01202 const double highX ,
01203 const double lowY ,
01204 const double highY ,
01205 const double lowZ ,
01206 const double highZ ,
01207 const unsigned long binsX = 10 ,
01208 const unsigned long binsY = 10 ,
01209 const unsigned long binsZ = 10 ,
01210 const double weight = 1.0 ) const;
01211
01298 AIDA::IHistogram3D* plot3D
01299 ( const double valueX ,
01300 const double valueY ,
01301 const double valueZ ,
01302 const HistoID& ID ,
01303 const std::string& title ,
01304 const double lowX ,
01305 const double highX ,
01306 const double lowY ,
01307 const double highY ,
01308 const double lowZ ,
01309 const double highZ ,
01310 const unsigned long binsX = 10 ,
01311 const unsigned long binsY = 10 ,
01312 const unsigned long binsZ = 10 ,
01313 const double weight = 1.0 ) const;
01314
01315
01316
01317
01365 AIDA::IHistogram3D* plot3D
01366 ( const double valueX ,
01367 const double valueY ,
01368 const double valueZ ,
01369 const std::string& title ,
01370 const HistoBinEdges& edgesX ,
01371 const HistoBinEdges& edgesY ,
01372 const HistoBinEdges& edgesZ ,
01373 const double weight = 1.0 ) const ;
01374
01375
01460 AIDA::IHistogram3D* plot3D
01461 ( const double valueX ,
01462 const double valueY ,
01463 const double valueZ ,
01464 const HistoID& ID ,
01465 const std::string& title ,
01466 const HistoBinEdges& edgesX ,
01467 const HistoBinEdges& edgesY ,
01468 const HistoBinEdges& edgesZ ,
01469 const double weight = 1.0 ) const ;
01470
01471
01472
01473
01522 AIDA::IProfile1D* profile1D
01523 ( const double valueX ,
01524 const double valueY ,
01525 const std::string& title ,
01526 const double lowX ,
01527 const double highX ,
01528 const unsigned long binsX = 100 ,
01529 const std::string& opt = "" ,
01530 const double lowY = -std::numeric_limits<double>::max() ,
01531 const double highY = std::numeric_limits<double>::max() ,
01532 const double weight = 1.0 ) const ;
01533
01599 AIDA::IProfile1D* profile1D
01600 ( const double valueX ,
01601 const double valueY ,
01602 const HistoID& ID ,
01603 const std::string& title ,
01604 const double lowX ,
01605 const double highX ,
01606 const unsigned long binsX = 100 ,
01607 const std::string& opt = "" ,
01608 const double lowY = -std::numeric_limits<double>::max() ,
01609 const double highY = std::numeric_limits<double>::max() ,
01610 const double weight = 1.0 ) const;
01611
01612
01613
01614
01657 AIDA::IProfile1D* profile1D
01658 ( const double valueX ,
01659 const double valueY ,
01660 const std::string& title ,
01661 const HistoBinEdges& edges ,
01662 const double weight = 1.0 ) const ;
01663
01725 AIDA::IProfile1D* profile1D
01726 ( const double valueX ,
01727 const double valueY ,
01728 const HistoID& ID ,
01729 const std::string& title ,
01730 const HistoBinEdges& edges ,
01731 const double weight = 1.0 ) const;
01732
01733
01734
01785 AIDA::IProfile2D* profile2D
01786 ( const double valueX ,
01787 const double valueY ,
01788 const double valueZ ,
01789 const std::string& title ,
01790 const double lowX ,
01791 const double highX ,
01792 const double lowY ,
01793 const double highY ,
01794 const unsigned long binsX = 50 ,
01795 const unsigned long binsY = 50 ,
01796 const double weight = 1.0 ) const;
01797
01865 AIDA::IProfile2D* profile2D
01866 ( const double valueX ,
01867 const double valueY ,
01868 const double valueZ ,
01869 const HistoID& ID ,
01870 const std::string& title ,
01871 const double lowX ,
01872 const double highX ,
01873 const double lowY ,
01874 const double highY ,
01875 const unsigned long binsX = 50 ,
01876 const unsigned long binsY = 50 ,
01877 const double weight = 1.0 ) const;
01878
01879
01880
01881
01927 AIDA::IProfile2D* profile2D
01928 ( const double valueX ,
01929 const double valueY ,
01930 const double valueZ ,
01931 const std::string& title ,
01932 const HistoBinEdges& edgesX ,
01933 const HistoBinEdges& edgesY ,
01934 const double weight = 1.0 ) const ;
01935
01998 AIDA::IProfile2D* profile2D
01999 ( const double valueX ,
02000 const double valueY ,
02001 const double valueZ ,
02002 const HistoID& ID ,
02003 const std::string& title ,
02004 const HistoBinEdges& edgesX ,
02005 const HistoBinEdges& edgesY ,
02006 const double weight = 1.0 ) const;
02007
02008
02009 public:
02010
02011
02023 AIDA::IHistogram1D* book1D
02024 ( const std::string& title ,
02025 const double low = 0 ,
02026 const double high = 100 ,
02027 const unsigned long bins = 100 ) const ;
02028
02041 inline AIDA::IHistogram1D* book
02042 ( const std::string& title ,
02043 const double low = 0 ,
02044 const double high = 100 ,
02045 const unsigned long bins = 100 ) const
02046 {
02047 return book1D( title, low, high, bins );
02048 }
02049
02058 AIDA::IHistogram1D* book
02059 ( const Gaudi::Histo1DDef& hdef ) const ;
02060
02071 AIDA::IHistogram1D* book1D
02072 ( const HistoID& ID ,
02073 const std::string& title ,
02074 const double low = 0 ,
02075 const double high = 100 ,
02076 const unsigned long bins = 100 ) const ;
02077
02091 inline AIDA::IHistogram1D* book
02092 ( const HistoID& ID ,
02093 const std::string& title ,
02094 const double low = 0 ,
02095 const double high = 100 ,
02096 const unsigned long bins = 100 ) const
02097 {
02098 return book1D( ID, title, low, high, bins );
02099 }
02100
02108 inline AIDA::IHistogram1D* book
02109 ( const HistoID& ID ,
02110 const Gaudi::Histo1DDef& hdef ) const ;
02111
02112
02113 public:
02114
02115
02126 AIDA::IHistogram1D* book1D
02127 ( const std::string& title ,
02128 const HistoBinEdges& edges ) const ;
02129
02139 AIDA::IHistogram1D* book1D
02140 ( const HistoID& ID ,
02141 const std::string& title ,
02142 const HistoBinEdges& edges ) const ;
02143
02144
02145 public:
02146
02147
02162 AIDA::IHistogram2D* book2D
02163 ( const std::string& title ,
02164 const double lowX = 0 ,
02165 const double highX = 100 ,
02166 const unsigned long binsX = 50 ,
02167 const double lowY = 0 ,
02168 const double highY = 100 ,
02169 const unsigned long binsY = 50 ) const ;
02170
02181 AIDA::IHistogram2D* book2D
02182 ( const HistoID& ID ,
02183 const std::string& title ,
02184 const double lowX = 0 ,
02185 const double highX = 100 ,
02186 const unsigned long binsX = 50 ,
02187 const double lowY = 0 ,
02188 const double highY = 100 ,
02189 const unsigned long binsY = 50 ) const ;
02190
02191
02192 public:
02193
02194
02206 AIDA::IHistogram2D * book2D
02207 ( const std::string& title ,
02208 const HistoBinEdges& edgesX ,
02209 const HistoBinEdges& edgesY ) const ;
02210
02221 AIDA::IHistogram2D * book2D
02222 ( const HistoID& ID ,
02223 const std::string& title ,
02224 const HistoBinEdges& edgesX ,
02225 const HistoBinEdges& edgesY ) const ;
02226
02227
02228 public:
02229
02230
02248 AIDA::IHistogram3D* book3D
02249 ( const std::string& title ,
02250 const double lowX = 0 ,
02251 const double highX = 100 ,
02252 const unsigned long binsX = 10 ,
02253 const double lowY = 0 ,
02254 const double highY = 100 ,
02255 const unsigned long binsY = 10 ,
02256 const double lowZ = 0 ,
02257 const double highZ = 100 ,
02258 const unsigned long binsZ = 10 ) const ;
02259
02276 AIDA::IHistogram3D* book3D
02277 ( const HistoID& ID ,
02278 const std::string& title ,
02279 const double lowX = 0 ,
02280 const double highX = 100 ,
02281 const unsigned long binsX = 10 ,
02282 const double lowY = 0 ,
02283 const double highY = 100 ,
02284 const unsigned long binsY = 10 ,
02285 const double lowZ = 0 ,
02286 const double highZ = 100 ,
02287 const unsigned long binsZ = 10 ) const ;
02288
02289
02290 public:
02291
02292
02305 AIDA::IHistogram3D * book3D
02306 ( const std::string& title ,
02307 const HistoBinEdges& edgesX ,
02308 const HistoBinEdges& edgesY ,
02309 const HistoBinEdges& edgesZ ) const ;
02310
02322 AIDA::IHistogram3D * book3D
02323 ( const HistoID& ID ,
02324 const std::string& title ,
02325 const HistoBinEdges& edgesX ,
02326 const HistoBinEdges& edgesY ,
02327 const HistoBinEdges& edgesZ ) const ;
02328
02329
02330 public:
02331
02332
02347 AIDA::IProfile1D* bookProfile1D
02348 ( const std::string& title ,
02349 const double low = 0 ,
02350 const double high = 100 ,
02351 const unsigned long bins = 100 ,
02352 const std::string& opt = "" ,
02353 const double lowY = -std::numeric_limits<double>::max() ,
02354 const double highY = std::numeric_limits<double>::max() ) const;
02355
02371 AIDA::IProfile1D* bookProfile1D
02372 ( const HistoID& ID ,
02373 const std::string& title ,
02374 const double low = 0 ,
02375 const double high = 100 ,
02376 const unsigned long bins = 100 ,
02377 const std::string& opt = "" ,
02378 const double lowY = -std::numeric_limits<double>::max() ,
02379 const double highY = std::numeric_limits<double>::max() ) const;
02380
02381
02382 public:
02383
02384
02394 AIDA::IProfile1D* bookProfile1D
02395 ( const std::string& title ,
02396 const HistoBinEdges& edges ) const;
02397
02407 AIDA::IProfile1D* bookProfile1D
02408 ( const HistoID& ID ,
02409 const std::string& title ,
02410 const HistoBinEdges& edges ) const;
02411
02412
02413 public:
02414
02415
02430 AIDA::IProfile2D* bookProfile2D
02431 ( const std::string& title ,
02432 const double lowX = 0 ,
02433 const double highX = 100 ,
02434 const unsigned long binsX = 50 ,
02435 const double lowY = 0 ,
02436 const double highY = 100 ,
02437 const unsigned long binsY = 50 ) const ;
02438
02452 AIDA::IProfile2D* bookProfile2D
02453 ( const HistoID& ID ,
02454 const std::string& title ,
02455 const double lowX = 0 ,
02456 const double highX = 100 ,
02457 const unsigned long binsX = 50 ,
02458 const double lowY = 0 ,
02459 const double highY = 100 ,
02460 const unsigned long binsY = 50 ) const ;
02461
02462
02463 public:
02464
02465
02476 AIDA::IProfile2D* bookProfile2D
02477 ( const std::string& title ,
02478 const HistoBinEdges& edgesX,
02479 const HistoBinEdges& edgesY ) const ;
02480
02490 AIDA::IProfile2D* bookProfile2D
02491 ( const HistoID& ID ,
02492 const std::string& title ,
02493 const HistoBinEdges& edgesX,
02494 const HistoBinEdges& edgesY ) const ;
02495
02496
02497 public:
02498
02499
02507 AIDA::IHistogram1D* fill
02508 ( AIDA::IHistogram1D* histo ,
02509 const double value ,
02510 const double weight ,
02511 const std::string& title = "" ) const ;
02512
02521 AIDA::IHistogram2D* fill
02522 ( AIDA::IHistogram2D* histo ,
02523 const double valueX ,
02524 const double valueY ,
02525 const double weight ,
02526 const std::string& title = "" ) const ;
02527
02537 AIDA::IHistogram3D* fill
02538 ( AIDA::IHistogram3D* histo ,
02539 const double valueX ,
02540 const double valueY ,
02541 const double valueZ ,
02542 const double weight ,
02543 const std::string& title = "" ) const ;
02544
02553 AIDA::IProfile1D* fill
02554 ( AIDA::IProfile1D* histo ,
02555 const double valueX ,
02556 const double valueY ,
02557 const double weight ,
02558 const std::string& title = "" ) const ;
02559
02569 AIDA::IProfile2D* fill
02570 ( AIDA::IProfile2D* histo ,
02571 const double valueX ,
02572 const double valueY ,
02573 const double valueZ ,
02574 const double weight ,
02575 const std::string& title = "" ) const ;
02576
02577 public:
02578
02582 inline AIDA::IHistogram1D* histo1D ( const std::string& title ) const
02583 {
02584 Histo1DMapTitle::const_iterator found = histo1DMapTitle().find( title ) ;
02585 return ( histo1DMapTitle().end() == found ? 0 : found->second );
02586 }
02587
02595 inline AIDA::IHistogram1D* histo ( const std::string& title ) const
02596 {
02597 return histo1D( title );
02598 }
02599
02603 inline AIDA::IHistogram2D* histo2D ( const std::string& title ) const
02604 {
02605 Histo2DMapTitle::const_iterator found = histo2DMapTitle().find( title ) ;
02606 return ( histo2DMapTitle().end() == found ? 0 : found->second );
02607 }
02608
02612 inline AIDA::IHistogram3D* histo3D ( const std::string& title ) const
02613 {
02614 Histo3DMapTitle::const_iterator found = histo3DMapTitle().find( title ) ;
02615 return ( histo3DMapTitle().end() == found ? 0 : found->second );
02616 }
02617
02621 inline AIDA::IProfile1D* profile1D ( const std::string& title ) const
02622 {
02623 Profile1DMapTitle::const_iterator found = profile1DMapTitle().find( title ) ;
02624 return ( profile1DMapTitle().end() == found ? 0 : found->second );
02625 }
02626
02630 inline AIDA::IProfile2D* profile2D ( const std::string& title ) const
02631 {
02632 Profile2DMapTitle::const_iterator found = profile2DMapTitle().find( title ) ;
02633 return ( profile2DMapTitle().end() == found ? 0 : found->second );
02634 }
02635
02636 public:
02637
02641 AIDA::IHistogram1D* histo1D ( const HistoID& ID ) const;
02642
02650 inline AIDA::IHistogram1D* histo ( const HistoID& ID ) const
02651 {
02652 return histo1D( ID );
02653 }
02654
02658 AIDA::IHistogram2D* histo2D ( const HistoID& ID ) const;
02659
02663 AIDA::IHistogram3D* histo3D ( const HistoID& ID ) const;
02664
02668 AIDA::IProfile1D* profile1D ( const HistoID& ID ) const;
02669
02673 AIDA::IProfile2D* profile2D ( const HistoID& ID ) const;
02674
02675 public:
02676
02678 inline bool histoExists ( const std::string& title ) const
02679 {
02680 return
02681 ( 0 != histo ( title ) ||
02682 0 != histo2D ( title ) ||
02683 0 != histo3D ( title ) ||
02684 0 != profile1D ( title ) ||
02685 0 != profile2D ( title ) );
02686 }
02687
02689 inline bool histoExists ( const HistoID& ID ) const
02690 {
02691 return
02692 ( 0 != histo ( ID ) ||
02693 0 != histo2D ( ID ) ||
02694 0 != histo3D ( ID ) ||
02695 0 != profile1D ( ID ) ||
02696 0 != profile2D ( ID ) );
02697 }
02699 unsigned int totalNumberOfHistos() const;
02700
02701 public:
02702
02704 inline bool produceHistos () const { return m_produceHistos ; }
02706 inline bool fullDetail () const { return m_fullDetail ; }
02708 inline bool checkForNaN () const { return m_checkForNaN ; }
02710 inline bool splitHistoDir () const { return m_splitHistoDir ; }
02712 inline HistoID::NumericID histoOffSet () const { return m_histoOffSet ; }
02714 inline const std::string& histoTopDir () const { return m_histoTopDir ; }
02716 inline const std::string& histoDir () const { return m_histoDir ; }
02718 inline std::string histoPath () const
02719 {
02720 const std::string path = histoTopDir() + histoDir();
02721 return ( splitHistoDir() ? dirHbookName(path) : path );
02722 }
02724 inline bool histosPrint () const { return m_histosPrint ; }
02726 inline bool useNumericAutoIDs() const { return m_useNumericAutoIDs; }
02727
02732 int printHistos ( const MSG::Level level = MSG::ALWAYS ) const ;
02733
02761 const Histo1DMapTitle & histo1DMapTitle() const { return m_histo1DMapTitle; }
02762
02792 const Histo1DMapNumID & histo1DMapNumID () const { return m_histo1DMapNumID; }
02793
02822 const Histo1DMapLitID & histo1DMapLitID () const { return m_histo1DMapLitID; }
02823
02851 const Histo2DMapTitle & histo2DMapTitle() const { return m_histo2DMapTitle ; }
02852
02882 const Histo2DMapNumID & histo2DMapNumID () const { return m_histo2DMapNumID; }
02883
02912 const Histo2DMapLitID & histo2DMapLitID () const { return m_histo2DMapLitID; }
02913
02941 const Histo3DMapTitle & histo3DMapTitle () const { return m_histo3DMapTitle ; }
02942
02972 const Histo3DMapNumID & histo3DMapNumID () const { return m_histo3DMapNumID; }
02973
03002 const Histo3DMapLitID & histo3DMapLitID () const { return m_histo3DMapLitID; }
03003
03031 const Profile1DMapTitle & profile1DMapTitle() const { return m_profile1DMapTitle; }
03032
03062 const Profile1DMapNumID & profile1DMapNumID () const { return m_profile1DMapNumID; }
03063
03093 const Profile1DMapLitID & profile1DMapLitID () const { return m_profile1DMapLitID; }
03094
03122 const Profile2DMapTitle & profile2DMapTitle() const { return m_profile2DMapTitle; }
03123
03153 const Profile2DMapNumID & profile2DMapNumID () const { return m_profile2DMapNumID; }
03154
03184 const Profile2DMapLitID & profile2DMapLitID () const { return m_profile2DMapLitID; }
03185
03186 public:
03187
03189 inline void setProduceHistos ( const bool val ) { m_produceHistos = val ; }
03191 inline void setFullDetail ( const bool val ) { m_fullDetail = val ; }
03193 inline void setCheckForNaN ( const bool val ) { m_checkForNaN = val ; }
03195 inline void setSplitHistoDir ( const bool val ) { m_splitHistoDir = val ; }
03197 inline void setHistoOffSet ( const HistoID::NumericID val )
03198 { m_histoOffSet = val ; }
03199
03201 inline void setHistoTopDir ( const std::string& val ) { m_histoTopDir = val ; }
03202
03204 inline void setHistoDir ( const std::string& val ) { m_histoDir = val ; }
03205
03206 public:
03207
03209 GaudiHistos ( const std::string & name,
03210 ISvcLocator * pSvcLocator );
03211
03213 GaudiHistos ( const std::string& type ,
03214 const std::string& name ,
03215 const IInterface* parent );
03216
03218 virtual ~GaudiHistos();
03219
03220 protected:
03221
03225 virtual StatusCode initialize ();
03226
03230 virtual StatusCode finalize ();
03231
03232 private:
03233
03235 bool noHistos() const;
03236
03238 void initGaudiHistosConstructor();
03239
03245 void monitorHisto( const AIDA::IBaseHistogram* hist,
03246 const HistoID& ID ) const;
03247
03252 void newHistoID( const std::string & title,
03253 HistoID& ID ) const;
03254
03256 void stringSearchReplace( std::string & title,
03257 const std::string & A,
03258 const std::string & B ) const;
03259
03260 protected:
03261
03263 std::string convertTitleToID( const std::string & title ) const;
03264
03265 private:
03266
03268 void printHistoHandler ( Property& ) ;
03269
03270 private:
03271
03273 bool m_produceHistos ;
03275 bool m_fullDetail;
03277 bool m_checkForNaN ;
03279 bool m_splitHistoDir ;
03281 HistoID::NumericID m_histoOffSet ;
03283 std::string m_histoTopDir ;
03285 std::string m_histoDir ;
03287 bool m_histosPrint ;
03289 bool m_declareMoniHists;
03290
03292 mutable Histo1DMapTitle m_histo1DMapTitle ;
03294 mutable Histo1DMapNumID m_histo1DMapNumID ;
03296 mutable Histo1DMapLitID m_histo1DMapLitID ;
03297
03299 mutable Histo2DMapTitle m_histo2DMapTitle ;
03301 mutable Histo2DMapNumID m_histo2DMapNumID ;
03303 mutable Histo2DMapLitID m_histo2DMapLitID ;
03304
03306 mutable Histo3DMapTitle m_histo3DMapTitle ;
03308 mutable Histo3DMapNumID m_histo3DMapNumID ;
03310 mutable Histo3DMapLitID m_histo3DMapLitID ;
03311
03313 mutable Profile1DMapTitle m_profile1DMapTitle ;
03315 mutable Profile1DMapNumID m_profile1DMapNumID ;
03317 mutable Profile1DMapLitID m_profile1DMapLitID ;
03318
03320 mutable Profile2DMapTitle m_profile2DMapTitle ;
03322 mutable Profile2DMapNumID m_profile2DMapNumID ;
03324 mutable Profile2DMapLitID m_profile2DMapLitID ;
03325
03327 std::string m_histo1DTableFormat ;
03329 std::string m_histo1DTableFormatShort ;
03331 std::string m_histo1DTableHeader ;
03333 bool m_useNumericAutoIDs;
03337 std::map<std::string,std::string> m_idReplaceInfo;
03338
03339 };
03340
03341
03342
03343 #endif // GAUDIALG_GAUDIHISTOS_H
03344