Commit 3b69e907 authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

Add table format printout support for 1D profile histograms

parent 9f66438e
......@@ -189,12 +189,10 @@ int GaudiHistos<PBASE>::printHistos( const MSG::Level level ) const
// Printout all histograms
Gaudi::Utils::Histos::Table table( m_histo1DTableFormat, m_histo1DTableHeader );
if ( !histo1DMapID().empty() ) {
msg << "1D histograms in directory "
<< "\"" << histoPath() << "\" : " << histo1DMapID().size();
const Gaudi::Utils::Histos::Table table( m_histo1DTableFormat, m_histo1DTableHeader );
if ( !table.header().empty() ) {
msg << std::endl << Gaudi::Utils::Histos::format( "ID", table.header(), m_histo1DTableFormatShort );
}
......@@ -242,13 +240,17 @@ int GaudiHistos<PBASE>::printHistos( const MSG::Level level ) const
if ( !profile1DMapID().empty() ) {
msg << "1D profile histograms in directory "
<< "\"" << histoPath() << "\" : " << profile1DMapID().size();
const Gaudi::Utils::Histos::Table table( m_histo1DTableFormat, m_histo1DTableHeader );
if ( !table.header().empty() ) {
msg << std::endl << Gaudi::Utils::Histos::format( "ID", table.header(), m_histo1DTableFormatShort );
}
for ( const auto& entry : ordered( profile1DMapID() ) ) {
const auto* aida = entry.second;
if ( !aida ) {
this->error() << "IProfile1D points to NULL" << endmsg;
continue;
}
msg << std::endl << GaudiAlg::Print1DProf::toString( aida, entry.first );
msg << std::endl << table.toString( aida, HistoID( entry.first ), m_histo1DTableFormatShort );
}
msg << endmsg;
}
......
JobOptionsSvc INFO # =======> /var/clus/usera/jonesc/LHCbCMake/Feature/Gaudi/GaudiExamples/options/Histograms.opts
JobOptionsSvc INFO # =======> /home/chris/LHCbCMake/Feature/Gaudi/GaudiExamples/options/Histograms.opts
JobOptionsSvc INFO # (5,1): AuditorSvc.Auditors = ["ChronoAuditor"]
JobOptionsSvc INFO # (9,1): MessageSvc.OutputLevel = 3
JobOptionsSvc INFO # (20,1): ApplicationMgr.TopAlg += ["GaudiHistoAlgorithm/SimpleHistos"]
......@@ -19,13 +19,13 @@ JobOptionsSvc INFO # (48,1): RootHistSvc.OutputFile = "histo.root"
JobOptionsSvc INFO # (57,1): HistogramDataSvc.Input = ["InFile DATAFILE='../data/input.hbook' TYP='HBOOK'"]
JobOptionsSvc INFO # (59,1): HistogramDataSvc.Predefined1DHistos = {"/stat/Histos2/2":["TEST2", -100, 200]}
JobOptionsSvc INFO # (63,1): HistogramDataSvc.OutputLevel = 2
JobOptionsSvc INFO # =======> /var/clus/usera/jonesc/LHCbCMake/Feature/Gaudi/GaudiExamples/options/Aida2Root.opts
JobOptionsSvc INFO # =======> /home/chris/LHCbCMake/Feature/Gaudi/GaudiExamples/options/Aida2Root.opts
JobOptionsSvc INFO # (3,1): ApplicationMgr.TopAlg += ["Aida2Root"]
JobOptionsSvc INFO Job options successfully read in from /var/clus/usera/jonesc/LHCbCMake/Feature/Gaudi/GaudiExamples/options/Aida2Root.opts
JobOptionsSvc INFO Job options successfully read in from /home/chris/LHCbCMake/Feature/Gaudi/GaudiExamples/options/Aida2Root.opts
ApplicationMgr SUCCESS
====================================================================================================================================
Welcome to ApplicationMgr (GaudiCoreSvc v30r5)
running on pcmz on Wed Dec 5 17:06:39 2018
running on localhost on Sat Dec 8 13:24:11 2018
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
SimpleHistos DEBUG Property update for OutputLevel : new value = 2
......@@ -303,15 +303,16 @@ SimpleHistos SUCCESS 3D histograms in directory "SimpleHistos" : 3
ID=3d "3D plot ForcedID" Ents/All=50000/50000<X>/sX=-0.0096715/1.0012,<Y>/sY=0.97036/0.90558,<Z>/sZ=0.0071234/1.1942
ID=varBinning/z "3D Variable Binning" Ents/All=50000/50000<X>/sX=-0.025596/2.8825,<Y>/sY=-0.0086423/1.0004,<Z>/sZ=0.97604/0.91269
SimpleHistos SUCCESS 1D profile histograms in directory "SimpleHistos" : 9
ID=Expo V Gauss 1DProf "Expo V Gauss 1DProf" Ents/All=50000/50000<X>/sX=-0.009832/1.0001
ID=Expo V Gauss 1DProf s "Expo V Gauss 1DProf s" Ents/All=50000/50000<X>/sX=-0.009832/1.0001
ID=Gauss V Flat 1DProf "Gauss V Flat 1DProf" Ents/All=50000/50000<X>/sX=-0.013795/5.7724
ID=Gauss V Flat 1DProf S "Gauss V Flat 1DProf S" Ents/All=50000/50000<X>/sX=-0.013795/5.7724
ID=Gauss V Flat 1DProf, with limits-I "Gauss V Flat 1DProf, with limits-I" Ents/All=24807/24807<X>/sX=0.026854/5.7561
ID=Gauss V Flat 1DProf, with limits-I s "Gauss V Flat 1DProf, with limits-I s" Ents/All=24807/24807<X>/sX=0.026854/5.7561
ID=Gauss V Flat 1DProf, with limits-II "Gauss V Flat 1DProf, with limits-II" Ents/All=25193/25193<X>/sX=-0.053822/5.7881
ID=Gauss V Flat 1DProf, with limits-II s "Gauss V Flat 1DProf, with limits-II s" Ents/All=25193/25193<X>/sX=-0.053822/5.7881
ID=varBinning/a "1D Profile Variable Binning" Ents/All=24949/50000<X>/sX=-0.028452/2.8834
| ID | Title | # | Mean | RMS | Skewness | Kurtosis |
| Expo V Gauss 1DProf | "Expo V Gauss 1DProf" | 50000 | -0.009832 | 1.0001 | 1.0944 | 57.826 |
| Expo V Gauss 1DProf s | "Expo V Gauss 1DProf s" | 50000 | -0.009832 | 1.0001 | 1.0944 | 57.826 |
| Gauss V Flat 1DProf | "Gauss V Flat 1DProf" | 50000 | -0.013795 | 5.7724 | 0 | -3 |
| Gauss V Flat 1DProf S | "Gauss V Flat 1DProf S" | 50000 | -0.013795 | 5.7724 | 0 | -3 |
| Gauss V Flat 1DProf, with | "Gauss V Flat 1DProf, with limits-I" | 24807 | 0.026854 | 5.7561 | -0.0078314 | -1.2358 |
| Gauss V Flat 1DProf, with | "Gauss V Flat 1DProf, with limits-I s" | 24807 | 0.026854 | 5.7561 | -0.0078314 | -1.2358 |
| Gauss V Flat 1DProf, with | "Gauss V Flat 1DProf, with limits-II" | 25193 | -0.053822 | 5.7881 | 0 | -3 |
| Gauss V Flat 1DProf, with | "Gauss V Flat 1DProf, with limits-II s" | 25193 | -0.053822 | 5.7881 | 0 | -3 |
| varBinning/a | "1D Profile Variable Binning" | 50000 | -0.028452 | 2.8834 | 0 | -3 |
SimpleHistos SUCCESS 2D profile histograms in directory "SimpleHistos" : 3
ID=2dprof "2D profile1" Ents/All=50000/50000<X>/sX=-0.0098803/0.9999,<Y>/sY=0.96914/0.90535
ID=321 "2D profile2" Ents/All=50000/50000<X>/sX=-0.0098803/0.9999,<Y>/sY=0.96914/0.90535
......@@ -437,11 +438,11 @@ EventLoopMgr INFO Histograms converted successfully according to request
*****Chrono***** INFO ****************************************************************************************************
*****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered)
*****Chrono***** INFO ****************************************************************************************************
1DForcedNumericID INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.0006(+-0.0775)/ 0/ 10 [ms] #=49999
1DOldStyle INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.0008(+-0.0894)/ 0/ 10 [ms] #=49999
1DForcedNumericID INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.0004(+-0.0632)/ 0/ 10 [ms] #=49999
1DForcedAlphaID INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.0008(+-0.0894)/ 0/ 10 [ms] #=49999
1DAutoID INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.0008(+-0.0894)/ 0/ 10 [ms] #=49999
1DForcedAlphaID INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.0006(+-0.0775)/ 0/ 10 [ms] #=49999
ChronoStatSvc INFO Time User : Tot= 0.93 [s] #= 1
1DOldStyle INFO Time User : Tot= 70 [ms] Ave/Min/Max=0.0014(+-0.118)/ 0/ 10 [ms] #=49999
ChronoStatSvc INFO Time User : Tot= 1.57 [s] #= 1
*****Chrono***** INFO ****************************************************************************************************
ChronoStatSvc.f... INFO Service finalized successfully
HistogramDataSvc DEBUG Substituted histograms #1 :
......
......@@ -3,7 +3,7 @@
ApplicationMgr SUCCESS
====================================================================================================================================
Welcome to ApplicationMgr (GaudiCoreSvc v30r5)
running on pcmz on Wed Dec 5 17:07:42 2018
running on localhost on Sat Dec 8 13:24:28 2018
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
ApplicationMgr INFO Successfully loaded modules : GaudiAlg, RootHistCnv
......@@ -292,9 +292,10 @@ HistoEx2 SUCCESS 2D histograms in directory "HistoEx2" : 3
ID= x vs y+3x " x vs y+3x " Ents/All=47804/50000<X>/sX=0.0020222/0.69612,<Y>/sY=-0.0072879/2.0754
ID= x vs y-3x " x vs y-3x " Ents/All=47806/50000<X>/sX=-0.0030373/0.6946,<Y>/sY=-0.0065218/2.0649
HistoEx2 SUCCESS 1D profile histograms in directory "HistoEx2" : 3
ID= x vs y (profile) " x vs y (profile)" Ents/All=47792/50000<X>/sX=-0.0087048/0.87747
ID= x vs y+3x (profile) " x vs y+3x (profile)" Ents/All=47792/50000<X>/sX=-0.0087048/0.87747
ID= x vs y-3x (profile) " x vs y-3x (profile)" Ents/All=47792/50000<X>/sX=-0.0087048/0.87747
| ID | Title | # | Mean | RMS | Skewness | Kurtosis |
| x vs y (profile) | " x vs y (profile)" | 50000 | -0.0087048 | 0.87747 | 0 | -3 |
| x vs y+3x (profile) | " x vs y+3x (profile)" | 50000 | -0.0087048 | 0.87747 | 0 | -3 |
| x vs y-3x (profile) | " x vs y-3x (profile)" | 50000 | -0.0087048 | 0.87747 | 0 | -3 |
EventLoopMgr INFO Histograms converted successfully according to request.
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
......@@ -12,7 +12,7 @@ Vanya BELYAEV ibelyaev@physics.syr.edu
ApplicationMgr SUCCESS
====================================================================================================================================
Welcome to ApplicationMgr (GaudiCoreSvc v30r5)
running on pcmz on Wed Dec 5 17:10:00 2018
running on localhost on Sat Dec 8 13:22:22 2018
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
ApplicationMgr INFO Successfully loaded modules : GaudiAlg, RootHistCnv
......@@ -139,7 +139,7 @@ RndmGenSvc INFO Using Random engine:HepRndm::Engine<CLHEP::RanluxEngin
Alg='HistoEx2', ID=' x vs y (profile)' , Histo=<ROOT.AIDA::IProfile1D object at 0x150f6428>
Alg='HistoEx2', ID=' x vs y (profile)' , Histo=<ROOT.AIDA::IProfile1D object at 0x135409b8>
Histo TES : "HistoEx2/ x vs y (profile)"
Histo Title : " x vs y (profile)"
......@@ -193,7 +193,7 @@ RndmGenSvc INFO Using Random engine:HepRndm::Engine<CLHEP::RanluxEngin
Alg='HistoEx2', ID=' x vs y+3x ' , Histo=Histogram 2D " x vs y+3x " 50 xbins [-2.000000,2.000000], 50 ybins [-4.000000,4.000000]
Alg='HistoEx2', ID=' x vs y+3x (profile)' , Histo=<ROOT.AIDA::IProfile1D object at 0x15148028>
Alg='HistoEx2', ID=' x vs y+3x (profile)' , Histo=<ROOT.AIDA::IProfile1D object at 0x1351f9c8>
Histo TES : "HistoEx2/ x vs y+3x (profile)"
Histo Title : " x vs y+3x (profile)"
......@@ -249,7 +249,7 @@ RndmGenSvc INFO Using Random engine:HepRndm::Engine<CLHEP::RanluxEngin
Alg='HistoEx2', ID=' x vs y-3x ' , Histo=Histogram 2D " x vs y-3x " 50 xbins [-2.000000,2.000000], 50 ybins [-4.000000,4.000000]
Alg='HistoEx2', ID=' x vs y ' , Histo=Histogram 2D " x vs y " 50 xbins [-2.000000,2.000000], 50 ybins [-4.000000,4.000000]
Alg='HistoEx2', ID=' x vs y-3x (profile)' , Histo=<ROOT.AIDA::IProfile1D object at 0x1504a6b8>
Alg='HistoEx2', ID=' x vs y-3x (profile)' , Histo=<ROOT.AIDA::IProfile1D object at 0x134cf188>
Histo TES : "HistoEx2/ x vs y-3x (profile)"
Histo Title : " x vs y-3x (profile)"
......@@ -326,9 +326,10 @@ HistoEx2 SUCCESS 2D histograms in directory "HistoEx2" : 3
ID= x vs y+3x " x vs y+3x " Ents/All=190894/200000<X>/sX=-0.00098056/0.69603,<Y>/sY=-0.0079536/2.0724
ID= x vs y-3x " x vs y-3x " Ents/All=190896/200000<X>/sX=-0.0018744/0.6958,<Y>/sY=-0.00026366/2.0675
HistoEx2 SUCCESS 1D profile histograms in directory "HistoEx2" : 3
ID= x vs y (profile) " x vs y (profile)" Ents/All=190848/200000<X>/sX=-0.0052704/0.8777
ID= x vs y+3x (profile) " x vs y+3x (profile)" Ents/All=190848/200000<X>/sX=-0.0052704/0.8777
ID= x vs y-3x (profile) " x vs y-3x (profile)" Ents/All=190848/200000<X>/sX=-0.0052704/0.8777
| ID | Title | # | Mean | RMS | Skewness | Kurtosis |
| x vs y (profile) | " x vs y (profile)" | 200000 | -0.0052704 | 0.8777 | 0 | -3 |
| x vs y+3x (profile) | " x vs y+3x (profile)" | 200000 | -0.0052704 | 0.8777 | 0 | -3 |
| x vs y-3x (profile) | " x vs y-3x (profile)" | 200000 | -0.0052704 | 0.8777 | 0 | -3 |
EventLoopMgr INFO Histograms converted successfully according to request.
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
JobOptionsSvc INFO # =======> /var/clus/usera/jonesc/LHCbCMake/Feature/Gaudi/GaudiExamples/options/Histograms.opts
JobOptionsSvc INFO # =======> /home/chris/LHCbCMake/Feature/Gaudi/GaudiExamples/options/Histograms.opts
JobOptionsSvc INFO # (5,1): AuditorSvc.Auditors = ["ChronoAuditor"]
JobOptionsSvc INFO # (9,1): MessageSvc.OutputLevel = 3
JobOptionsSvc INFO # (20,1): ApplicationMgr.TopAlg += ["GaudiHistoAlgorithm/SimpleHistos"]
......@@ -19,11 +19,11 @@ JobOptionsSvc INFO # (48,1): RootHistSvc.OutputFile = "histo.root"
JobOptionsSvc INFO # (57,1): HistogramDataSvc.Input = ["InFile DATAFILE='../data/input.hbook' TYP='HBOOK'"]
JobOptionsSvc INFO # (59,1): HistogramDataSvc.Predefined1DHistos = {"/stat/Histos2/2":["TEST2", -100, 200]}
JobOptionsSvc INFO # (63,1): HistogramDataSvc.OutputLevel = 2
JobOptionsSvc INFO Job options successfully read in from /var/clus/usera/jonesc/LHCbCMake/Feature/Gaudi/GaudiExamples/options/Histograms.opts
JobOptionsSvc INFO Job options successfully read in from /home/chris/LHCbCMake/Feature/Gaudi/GaudiExamples/options/Histograms.opts
ApplicationMgr SUCCESS
====================================================================================================================================
Welcome to ApplicationMgr (GaudiCoreSvc v30r5)
running on pcmz on Wed Dec 5 17:11:01 2018
running on localhost on Sat Dec 8 13:27:01 2018
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
SimpleHistos DEBUG Property update for OutputLevel : new value = 2
......@@ -243,15 +243,16 @@ SimpleHistos SUCCESS 3D histograms in directory "SimpleHistos" : 3
ID=3d "3D plot ForcedID" Ents/All=50000/50000<X>/sX=-0.0096715/1.0012,<Y>/sY=0.97036/0.90558,<Z>/sZ=0.0071234/1.1942
ID=varBinning/z "3D Variable Binning" Ents/All=50000/50000<X>/sX=-0.025596/2.8825,<Y>/sY=-0.0086423/1.0004,<Z>/sZ=0.97604/0.91269
SimpleHistos SUCCESS 1D profile histograms in directory "SimpleHistos" : 9
ID=Expo V Gauss 1DProf "Expo V Gauss 1DProf" Ents/All=50000/50000<X>/sX=-0.009832/1.0001
ID=Expo V Gauss 1DProf s "Expo V Gauss 1DProf s" Ents/All=50000/50000<X>/sX=-0.009832/1.0001
ID=Gauss V Flat 1DProf "Gauss V Flat 1DProf" Ents/All=50000/50000<X>/sX=-0.013795/5.7724
ID=Gauss V Flat 1DProf S "Gauss V Flat 1DProf S" Ents/All=50000/50000<X>/sX=-0.013795/5.7724
ID=Gauss V Flat 1DProf, with limits-I "Gauss V Flat 1DProf, with limits-I" Ents/All=24807/24807<X>/sX=0.026854/5.7561
ID=Gauss V Flat 1DProf, with limits-I s "Gauss V Flat 1DProf, with limits-I s" Ents/All=24807/24807<X>/sX=0.026854/5.7561
ID=Gauss V Flat 1DProf, with limits-II "Gauss V Flat 1DProf, with limits-II" Ents/All=25193/25193<X>/sX=-0.053822/5.7881
ID=Gauss V Flat 1DProf, with limits-II s "Gauss V Flat 1DProf, with limits-II s" Ents/All=25193/25193<X>/sX=-0.053822/5.7881
ID=varBinning/a "1D Profile Variable Binning" Ents/All=24949/50000<X>/sX=-0.028452/2.8834
| ID | Title | # | Mean | RMS | Skewness | Kurtosis |
| Expo V Gauss 1DProf | "Expo V Gauss 1DProf" | 50000 | -0.009832 | 1.0001 | 1.0944 | 57.826 |
| Expo V Gauss 1DProf s | "Expo V Gauss 1DProf s" | 50000 | -0.009832 | 1.0001 | 1.0944 | 57.826 |
| Gauss V Flat 1DProf | "Gauss V Flat 1DProf" | 50000 | -0.013795 | 5.7724 | 0 | -3 |
| Gauss V Flat 1DProf S | "Gauss V Flat 1DProf S" | 50000 | -0.013795 | 5.7724 | 0 | -3 |
| Gauss V Flat 1DProf, with | "Gauss V Flat 1DProf, with limits-I" | 24807 | 0.026854 | 5.7561 | -0.0078314 | -1.2358 |
| Gauss V Flat 1DProf, with | "Gauss V Flat 1DProf, with limits-I s" | 24807 | 0.026854 | 5.7561 | -0.0078314 | -1.2358 |
| Gauss V Flat 1DProf, with | "Gauss V Flat 1DProf, with limits-II" | 25193 | -0.053822 | 5.7881 | 0 | -3 |
| Gauss V Flat 1DProf, with | "Gauss V Flat 1DProf, with limits-II s" | 25193 | -0.053822 | 5.7881 | 0 | -3 |
| varBinning/a | "1D Profile Variable Binning" | 50000 | -0.028452 | 2.8834 | 0 | -3 |
SimpleHistos SUCCESS 2D profile histograms in directory "SimpleHistos" : 3
ID=2dprof "2D profile1" Ents/All=50000/50000<X>/sX=-0.0098803/0.9999,<Y>/sY=0.96914/0.90535
ID=321 "2D profile2" Ents/All=50000/50000<X>/sX=-0.0098803/0.9999,<Y>/sY=0.96914/0.90535
......@@ -270,11 +271,11 @@ EventLoopMgr INFO Histograms converted successfully according to request
*****Chrono***** INFO ****************************************************************************************************
*****Chrono***** INFO The Final CPU consumption ( Chrono ) Table (ordered)
*****Chrono***** INFO ****************************************************************************************************
1DAutoID INFO Time User : Tot= 20 [ms] Ave/Min/Max=0.0004(+-0.0632)/ 0/ 10 [ms] #=49999
1DForcedNumericID INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.0008(+-0.0894)/ 0/ 10 [ms] #=49999
1DForcedAlphaID INFO Time User : Tot= 10 [ms] Ave/Min/Max=0.0002(+-0.0447)/ 0/ 10 [ms] #=49999
1DAutoID INFO Time User : Tot= 40 [ms] Ave/Min/Max=0.0008(+-0.0894)/ 0/ 10 [ms] #=49999
1DForcedNumericID INFO Time User : Tot= 50 [ms] Ave/Min/Max=0.001(+- 0.1)/ 0/ 10 [ms] #=49999
1DOldStyle INFO Time User : Tot= 30 [ms] Ave/Min/Max=0.0006(+-0.0775)/ 0/ 10 [ms] #=49999
1DForcedAlphaID INFO Time User : Tot= 50 [ms] Ave/Min/Max=0.001(+- 0.1)/ 0/ 10 [ms] #=49999
ChronoStatSvc INFO Time User : Tot= 0.98 [s] #= 1
ChronoStatSvc INFO Time User : Tot= 1.53 [s] #= 1
*****Chrono***** INFO ****************************************************************************************************
ChronoStatSvc.f... INFO Service finalized successfully
HistogramDataSvc DEBUG Substituted histograms #1 :
......
......@@ -16,6 +16,7 @@
namespace AIDA
{
class IHistogram1D;
class IProfile1D;
}
// ============================================================================
namespace Gaudi
......@@ -31,7 +32,7 @@ namespace Gaudi
*/
class GAUDI_API HistoStats
{
public:
public: // 1D Histograms
// ======================================================================
/** get the "bin-by-bin"-moment around the specified "value"
* @param histo histogram
......@@ -134,7 +135,7 @@ namespace Gaudi
* @param number of entries
*/
static long nEntries( const AIDA::IHistogram1D* histo,
const int imin, // minimal bin number (included)
const int imin, // minimal bin number (included)
const int imax ); // maximal bin number (not included)
// ======================================================================
/** get the fraction of entries in histogram up to
......@@ -171,6 +172,146 @@ namespace Gaudi
*/
static double nEntriesFracErr( const AIDA::IHistogram1D* histo, const int imin, const int imax );
// ======================================================================
public: // 1D Profile Histograms
// ======================================================================
/** get the "bin-by-bin"-moment around the specified "value"
* @param histo histogram
* @param order the moment parameter
* @param value central value
* @return the evaluated moment
*/
static double moment( const AIDA::IProfile1D* histo, const unsigned int order, const double value = 0 );
// ======================================================================
/** evaluate the uncertanty for 'bin-by-bin'-moment
* @param histo histogram
* @param order the moment parameter
* @param value central value
* @return the evaluated uncertanty in the moment
*/
static double momentErr( const AIDA::IProfile1D* histo, const unsigned int order );
// ======================================================================
/** evaluate the 'bin-by-bin'-central moment (around the mean value)
* @param histo histogram
* @param order the moment parameter
* @param value central value
* @return the evaluated central moment
*/
static double centralMoment( const AIDA::IProfile1D* histo, const unsigned int order );
// ======================================================================
/** evaluate the uncertanty for 'bin-by-bin'-central moment
* (around the mean value)
* ( the uncertanty is calculated with O(1/n2) precision)
* @param histo histogram
* @param order the moment parameter
* @param value central value
* @return the evaluated uncertanty in the central moment
*/
static double centralMomentErr( const AIDA::IProfile1D* histo, const unsigned int order );
// ======================================================================
/// get the skewness for the profile histogram
static double skewness( const AIDA::IProfile1D* histo );
// ======================================================================
/// get the error in skewness for the profile histogram
static double skewnessErr( const AIDA::IProfile1D* histo );
// ======================================================================
/// get the kurtosis for the profile histogram
static double kurtosis( const AIDA::IProfile1D* histo );
// ======================================================================
/// get the error in kurtosis for the profile histogram
static double kurtosisErr( const AIDA::IProfile1D* histo );
// ======================================================================
/// get the mean value for the profile histogram (just for completeness)
static double mean( const AIDA::IProfile1D* histo );
// ======================================================================
/// get an error in the mean value
static double meanErr( const AIDA::IProfile1D* histo );
// ======================================================================
/// get the rms value for the profile histogram (just for completeness)
static double rms( const AIDA::IProfile1D* histo );
// ======================================================================
/// get an error in the rms value
static double rmsErr( const AIDA::IProfile1D* histo );
// ======================================================================
/// get an error in the sum bin height ("in-range integral")
static double sumBinHeightErr( const AIDA::IProfile1D* histo );
// ======================================================================
/// get an error in the sum of all bin height ("integral")
static double sumAllBinHeightErr( const AIDA::IProfile1D* histo );
// ======================================================================
/// get the effective entries (just for completeness)
static double nEff( const AIDA::IProfile1D* histo );
// ======================================================================
/// the fraction of overflow entries (useful for shape comparison)
static double overflowEntriesFrac( const AIDA::IProfile1D* histo );
/// the fraction of underflow entries (useful for shape comparison)
static double underflowEntriesFrac( const AIDA::IProfile1D* histo );
/// error on fraction of overflow entries (useful for shape comparison)
static double overflowEntriesFracErr( const AIDA::IProfile1D* histo );
/// the error on fraction of underflow entries (useful for shape comparison)
static double underflowEntriesFracErr( const AIDA::IProfile1D* histo );
// ======================================================================
/// the fraction of overflow intergal (useful for shape comparison)
static double overflowIntegralFrac( const AIDA::IProfile1D* histo );
/// the fraction of underflow integral (useful for shape comparison)
static double underflowIntegralFrac( const AIDA::IProfile1D* histo );
/// the error on fraction of overflow intergal
static double overflowIntegralFracErr( const AIDA::IProfile1D* histo );
/// the error on fraction of underflow integral
static double underflowIntegralFracErr( const AIDA::IProfile1D* histo );
// ======================================================================
/** get number of entries in profile histogram up to
* the certain bin (not-included)
* @attention underflow bin is included!
* @param histo the pointer to the histogram
* @param imax the bin number (not included)
* @param number of entries
*/
static long nEntries( const AIDA::IProfile1D* histo, const int imax );
/** get number of entries in profile histogram form the certain
* minimal bin up to the certain maximal bin (not-included)
* @param histo the pointer to the histogram
* @param imin the minimal bin number (included)
* @param imax the maximal bin number (not included)
* @param number of entries
*/
static long nEntries( const AIDA::IProfile1D* histo,
const int imin, // minimal bin number (included)
const int imax ); // maximal bin number (not included)
// ======================================================================
/** get the fraction of entries in profile histogram up to
* the certain bin (not-included)
* @attention underflow bin is included!
* @param histo the pointer to the histogram
* @param imax the bin number (not included)
* @param fraction of entries
*/
static double nEntriesFrac( const AIDA::IProfile1D* histo, const int imax );
/** get fraction of entries in profile histogram form the certain
* minimal bin up to the certain maximal bin (not-included)
* @param histo the pointer to the histogram
* @param imin the minimal bin number (included)
* @param imax the maximal bin number (not included)
* @param fraction of entries
*/
static double nEntriesFrac( const AIDA::IProfile1D* histo, const int imin, const int imax );
// ======================================================================
/** get the (binominal) error for the fraction of entries
* in profile histogram up to the certain bin (not-included)
* @attention underflow bin is included!
* @param histo the pointer to the histogram
* @param imax the bin number (not included)
* @param error for the fraction of entries
*/
static double nEntriesFracErr( const AIDA::IProfile1D* histo, const int imax );
/** get the (binomial) error for the fraction of entries in the profile histogram
* from the certain minimal bin up to the certain maximal bin (not-included)
* @param histo the pointer to the histogram
* @param imin the minimal bin number (included)
* @param imax the maximal bin number (not included)
* @param error for the fraction of entries
*/
static double nEntriesFracErr( const AIDA::IProfile1D* histo, const int imin, const int imax );
// ======================================================================
};
// ========================================================================
} // end of namespace Gaudi::Utils
......
......@@ -11,6 +11,7 @@
namespace AIDA
{
class IHistogram1D;
class IProfile1D;
class IBaseHistogram;
}
// ============================================================================
......@@ -127,7 +128,7 @@ namespace Gaudi
*/
GAUDI_API std::string path( const AIDA::IBaseHistogram* aida );
// ======================================================================
/** Make the string representation of the historgam
/** Make the string representation of the histogram
* according to the specified format.
* The method could be used to access/print various quantities
*
......@@ -167,6 +168,31 @@ namespace Gaudi
*/
GAUDI_API std::string format( const AIDA::IHistogram1D* histo, const std::string& fmt );
// ======================================================================
/** Make the string representation of the profile histogram
* according to the specified format.
* The method could be used to access/print various quantities
*
* @code
*
* using namespace Gaudi::Utils::Histos ;
*
* const AIDA::IProfile1D* histo = ... ;
*
* // print title in a free format:
* std::cout << format ( histo , "%2%" ) << std::endl ;
*
* // print the path in HTS in a free format:
* std::cout << format ( histo , " path in HTS: %1% " ) << std::endl ;
*
* @endcode
*
* @param histo reference to the histogram
* @param fmt the printout format
* @author Vanya BELYAEV ibelyaev@physics.syr.edu
* @date 2007-08-08
*/
GAUDI_API std::string format( const AIDA::IProfile1D* histo, const std::string& fmt );
// ======================================================================
/** format a full row in table, including ID, label, path or any other
* "extra" identifier in string form
*
......@@ -197,6 +223,37 @@ namespace Gaudi
*/
GAUDI_API std::string format( const AIDA::IHistogram1D* histo, const std::string& ID, const std::string& fmt1,
const std::string& fmt2 );
// ======================================================================
/** format a full row in table, including ID, label, path or any other
* "extra" identifier in string form
*
* @code
*
* using namespace Gaudi::Utils::Histos
* const AIDA::IProfile1D* histo = ... ;
*
* // define short format
* const std::string fmt1 = " |%1$-30.30s %|33t| %2" ;
*
* // define format for the histogram
* const std::string fmt2 = ... ;
*
* info () <<
* format ( "My Histo" , histo , fmt1 , fmt2 )
* << endmsg ;
*
* @endcode
*
* @param histo pointer to the histogram
* @param ID historgam ID, title, label or other extra information
* @param fmt1 "short" format used for the table
* @param fmt2 format used for the histogram printout
* @return formatted row
* @author Vanya BELYAEV ibelyaev@physics.syr.edu
* @date 2007-08-08
*/
GAUDI_API std::string format( const AIDA::IProfile1D* histo, const std::string& ID, const std::string& fmt1,
const std::string& fmt2 );
// ========================================================================
/** print the simple sequence (list-like) of histograms as table
*
......@@ -457,6 +514,9 @@ namespace Gaudi
/// make the string representation according to the default format
std::string toString( const AIDA::IHistogram1D* histo ) const;
// ======================================================================
/// make the string representation according to the default format
std::string toString( const AIDA::IProfile1D* histo ) const;
// ======================================================================
public:
// ======================================================================
/** format a full row in table, including ID, label, path or any other
......@@ -483,6 +543,30 @@ namespace Gaudi
* @return formatted row
*/
std::string toString( const AIDA::IHistogram1D* histo, const std::string& ID, const std::string& fmt ) const;
/** format a full row in table, including ID, label, path or any other
* "extra" identifier
*
* @code
*
* using namespace Gaudi::Utils::Histos ;
*
* const Table& table = ... ;
*
* const AIDA::IProfile1D* histo = ... ;
*
* // define short format
* const std::string fmt1 = " |%1$-30.30s %|33t| %2" ;
*
* info () << table.toString ( "My Histo" , histo , fmt ) ;
*
* @endcode
*
* @param histo pointer to the histogram
* @param ID historgam ID, title, label or other extra infomration
* @param fmt "short" format used for the table
* @return formatted row
*/
std::string toString( const AIDA::IProfile1D* histo, const std::string& ID, const std::string& fmt ) const;
// ======================================================================
public:
// the table header
......
This diff is collapsed.
......@@ -21,6 +21,7 @@
#endif
#include "AIDA/IAxis.h"
#include "AIDA/IHistogram1D.h"
#include "AIDA/IProfile1D.h"
#undef class
// ============================================================================
// GaudiKernel
......@@ -208,32 +209,29 @@ std::string Gaudi::Utils::Histos::Formats::header( const int ID )
// ============================================================================
std::string Gaudi::Utils::Histos::path( const AIDA::IBaseHistogram* aida )
{
if ( 0 == aida ) {
if ( !aida ) {
return "";
} // RETURN
const DataObject* object = dynamic_cast<const DataObject*>( aida );
if ( 0 == object ) {
if ( !object ) {
return "";
} // RETURN
IRegistry* registry = object->registry();
if ( 0 == registry ) {
if ( !registry ) {
return "";
} // RETURN
std::string _path = registry->identifier();
std::string::size_type n = _path.find( "/stat/" );
if ( 0 == n ) {
return std::string( _path, 6 );
} // RETURN
return _path; // RETURN
return ( 0 == n ? std::string( _path, 6 ) : _path ); // RETURN
}
// ============================================================================
/* Make the string representation of the historgam
/* Make the string representation of the histogram
* according to the specified format.
*/
// ============================================================================
std::string Gaudi::Utils::Histos::format( const AIDA::IHistogram1D* histo, const std::string& fmt )
{
if ( 0 == histo ) {
if ( !histo ) {
return "<NULL>";
}
using namespace Gaudi::Utils;
......@@ -245,13 +243,13 @@ std::string Gaudi::Utils::Histos::format( const AIDA::IHistogram1D* histo, const
_fmt % ( "\"" + path( histo ) + "\"" ) // 1) histogram path
% ( "\"" + histo->title() + "\"" ) // 2) title
% histo->allEntries() // 3) # entries
% histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN ) // 4) # underflow
% histo->binEntries( AIDA::IAxis::OVERFLOW_BIN ) // 5) # overflow
% histo->equivalentBinEntries() // 6) equivalent entries
% histo->binEntries( AIDA::IAxis::UNDERFLOW_BIN ) // 4) # underflow
% histo->binEntries( AIDA::IAxis::OVERFLOW_BIN ) // 5) # overflow
% HistoStats::nEff( histo ) // 6) equivalent entries
% histo->sumBinHeights() // 7) integral
% histo->mean() // 8) mean value
% HistoStats::mean( histo ) // 8) mean value
% HistoStats::meanErr( histo ) // 9) error in mean
% histo->rms() // 10) rms
% HistoStats::rms( histo ) // 10) rms
% HistoStats::rmsErr( histo ) // 11) error in rms
% HistoStats::skewness( histo ) // 12) skewness
% HistoStats::skewnessErr( histo ) // 13) error in skewness
......@@ -270,8 +268,58 @@ std::string Gaudi::Utils::Histos::format( const AIDA::IHistogram1D* histo, const
% HistoStats::underflowIntegralFrac( histo ) // 23) fraction of underflow integral
% HistoStats::underflowIntegralFracErr( histo ) // 24) error on 23
% HistoStats::overflowIntegralFrac( histo ) // 25) fraction of overflow intergal
% HistoStats::overflowIntegralFracErr( histo ); // 26) error on 25
//
% HistoStats::overflowIntegralFracErr( histo ) // 26) error on 25
;
return _fmt.str();
}
// ============================================================================