Gaudi Framework, version v23r5

Home   Generated: Wed Nov 28 2012
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GaudiHistos.h
Go to the documentation of this file.
1 // $Id: GaudiHistos.h,v 1.11 2008/10/27 19:22:20 marcocle Exp $
2 // ============================================================================
3 #ifndef GAUDIALG_GAUDIHISTOS_H
4 #define GAUDIALG_GAUDIHISTOS_H 1
5 // ============================================================================
6 /* @file GaudiHistos.h
7  *
8  * Header file for class : GaudiHistos
9  *
10  * @author Chris Jones Christopher.Rob.Jones@cern.ch
11  * @author Vanya BELYAEV Ivan.Belyaev@itep.ru
12  * @date 2005-08-08
13  */
14 // ============================================================================
15 // Include files#
16 // ============================================================================
17 // STD& STL
18 // ============================================================================
19 #include <limits>
20 #include <vector>
21 // ============================================================================
22 // GaudiKernel
23 // ============================================================================
25 // ============================================================================
26 // GaudiAlg
27 // ============================================================================
28 #include "GaudiAlg/Maps.h"
29 #include "GaudiAlg/HbookName.h"
30 // ============================================================================
31 // Forward declarations
32 namespace AIDA
33 {
34  class IHistogram1D;
35  class IHistogram2D;
36  class IHistogram3D;
37  class IProfile1D;
38  class IProfile2D;
39 }
40 // ============================================================================
50 template <class PBASE>
51 class GAUDI_API GaudiHistos: public PBASE
52 {
53 public:
54  // ==========================================================================
57  // ==========================================================================
62  // ==========================================================================
67  // ==========================================================================
72  // ==========================================================================
77  // ==========================================================================
82  // ==========================================================================
85  // ==========================================================================
86 public:
87  // ==========================================================================
88  // ================================= 1D Histograms ==========================
89  // ================================= Fixed Binning ==========================
90  // ==========================================================================
133  AIDA::IHistogram1D* plot1D
134  ( const double value ,
135  const std::string& title ,
136  const double low ,
137  const double high ,
138  const unsigned long bins = 100 ,
139  const double weight = 1.0 ) const ;
140  // ==========================================================================
154  inline AIDA::IHistogram1D* plot
155  ( const double value ,
156  const std::string& title ,
157  const double low ,
158  const double high ,
159  const unsigned long bins = 100 ,
160  const double weight = 1.0 ) const
161  {
162  return plot1D ( value, title, low, high, bins, weight );
163  }
164  // ==========================================================================
189  AIDA::IHistogram1D* plot1D
190  ( const double value ,
191  const Gaudi::Histo1DDef& hdef ,
192  const double weight = 1.0 ) const ;
193  // ==========================================================================
204  inline AIDA::IHistogram1D* plot
205  ( const double value ,
206  const Gaudi::Histo1DDef& hdef ,
207  const double weight = 1.0 ) const
208  {
209  return plot1D ( value, hdef, weight );
210  }
211  // ==========================================================================
276  // ==========================================================================
277  AIDA::IHistogram1D* plot1D
278  ( const double value ,
279  const HistoID& ID ,
280  const std::string& title ,
281  const double low ,
282  const double high ,
283  const unsigned long bins = 100 ,
284  const double weight = 1.0 ) const ;
285  // ==========================================================================
300  inline AIDA::IHistogram1D* plot
301  ( const double value ,
302  const HistoID& ID ,
303  const std::string& title ,
304  const double low ,
305  const double high ,
306  const unsigned long bins = 100 ,
307  const double weight = 1.0 ) const
308  {
309  return plot1D ( value, ID, title, low, high, bins, weight );
310  }
311  // ==========================================================================
337  AIDA::IHistogram1D* plot1D
338  ( const double value ,
339  const HistoID& ID ,
340  const Gaudi::Histo1DDef& hdef ,
341  const double weight = 1.0 ) const ;
342  // ==========================================================================
354  inline AIDA::IHistogram1D* plot
355  ( const double value ,
356  const HistoID& ID ,
357  const Gaudi::Histo1DDef& hdef ,
358  const double weight = 1.0 ) const
359  {
360  return plot1D ( value, ID, hdef, weight );
361  }
425  template <class FUNCTION,class OBJECT>
426  inline AIDA::IHistogram1D* plot
427  ( const FUNCTION& func ,
428  OBJECT first ,
429  OBJECT last ,
430  const std::string& title ,
431  const double low ,
432  const double high ,
433  const unsigned long bins = 100 ) const
434  {
435  AIDA::IHistogram1D* h(0);
436  if ( produceHistos() )
437  {
438  // retrieve or book the histogram
439  h = histo1D ( title ) ;
440  if ( 0 == h ) { h = book1D ( title , low , high , bins ); }
441  // fill histogram
442  while( first != last && 0 != h )
443  { h = fill ( h , func( *first ) , 1.0 , title ) ; ++first ; }
444  }
445  return h ;
446  }
447  // ==========================================================================
503  template <class FUNCTION,class OBJECT>
504  inline AIDA::IHistogram1D* plot
505  ( const FUNCTION& func ,
506  OBJECT first ,
507  OBJECT last ,
508  const HistoID& ID ,
509  const std::string& title ,
510  const double low ,
511  const double high ,
512  const unsigned long bins = 100 ) const
513  {
514  AIDA::IHistogram1D* h(0);
515  if ( produceHistos() )
516  {
517  // retrieve or book the histogram
518  h = histo1D ( ID ) ;
519  if ( 0 == h ) { h = book1D ( ID , title , low , high , bins ); }
520  // fill histogram
521  while( first != last && 0 != h )
522  { h = fill( h , func( *first ) , 1.0 , title ) ; ++first ; }
523  }
524  return h;
525  }
526  // ==========================================================================
595  template <class FUNCTION,class OBJECT,class WEIGHT>
596  inline AIDA::IHistogram1D* plot
597  ( const FUNCTION& func ,
598  OBJECT first ,
599  OBJECT last ,
600  const std::string& title ,
601  const double low ,
602  const double high ,
603  const unsigned long bins ,
604  const WEIGHT& weight ) const
605  {
606  AIDA::IHistogram1D* h(0);
607  if ( produceHistos() )
608  {
609  // retrieve or book the histogram
610  h = histo1D ( title ) ;
611  if ( 0 == h ) { h = book1D ( title , low , high , bins ); }
612  // fill histogram
613  while ( first != last && 0 != h )
614  { h = fill ( h ,
615  func ( *first ) ,
616  weight ( *first ) , title ) ; ++first ; }
617  }
618  return h;
619  }
620  // ==========================================================================
687  template <class FUNCTION,class OBJECT,class WEIGHT>
688  inline AIDA::IHistogram1D* plot
689  ( const FUNCTION& func ,
690  OBJECT first ,
691  OBJECT last ,
692  const HistoID& ID ,
693  const std::string& title ,
694  const double low ,
695  const double high ,
696  const unsigned long bins ,
697  const WEIGHT& weight ) const
698  {
699  AIDA::IHistogram1D* h(0);
700  if ( produceHistos() )
701  {
702  // retrieve or book the histogram
703  h = histo1D ( ID ) ;
704  if ( 0 == h ) { h = book1D ( ID , title , low , high , bins ); }
705  // fill histogram
706  while( first != last && 0 != h )
707  { h = fill ( h ,
708  func ( *first ) ,
709  weight ( *first ) , title ) ; ++first ; }
710  }
711  return h ;
712  }
713  // ==========================================================================
714  // ================================= 1D Histograms ==========================
715  // =============================== Variable Binning =========================
716  // ==========================================================================
756  AIDA::IHistogram1D* plot1D
757  ( const double value ,
758  const std::string& title ,
759  const HistoBinEdges& edges ,
760  const double weight = 1.0 ) const ;
761  // ==========================================================================
825  // ==========================================================================
826  AIDA::IHistogram1D* plot1D
827  ( const double value ,
828  const HistoID& ID ,
829  const std::string& title ,
830  const HistoBinEdges& edges ,
831  const double weight = 1.0 ) const ;
832  // ==========================================================================
833  // ================================= 2D Histograms ==========================
834  // ==========================================================================
885  AIDA::IHistogram2D* plot2D
886  ( const double valueX ,
887  const double valueY ,
888  const std::string& title ,
889  const double lowX ,
890  const double highX ,
891  const double lowY ,
892  const double highY ,
893  const unsigned long binsX = 50 ,
894  const unsigned long binsY = 50 ,
895  const double weight = 1.0 ) const;
896  // ==========================================================================
973  AIDA::IHistogram2D* plot2D
974  ( const double valueX ,
975  const double valueY ,
976  const HistoID& ID ,
977  const std::string& title ,
978  const double lowX ,
979  const double highX ,
980  const double lowY ,
981  const double highY ,
982  const unsigned long binsX = 50 ,
983  const unsigned long binsY = 50 ,
984  const double weight = 1.0 ) const;
985  // ==========================================================================
986  // ================================= 2D Histograms ==========================
987  // =============================== Variable Binning =========================
988  // ==========================================================================
1034  AIDA::IHistogram2D* plot2D
1035  ( const double valueX ,
1036  const double valueY ,
1037  const std::string& title ,
1038  const HistoBinEdges& edgesX ,
1039  const HistoBinEdges& edgesY ,
1040  const double weight = 1.0 ) const ;
1041  // ==========================================================================
1117  AIDA::IHistogram2D* plot2D
1118  ( const double valueX ,
1119  const double valueY ,
1120  const HistoID& ID ,
1121  const std::string& title ,
1122  const HistoBinEdges& edgesX ,
1123  const HistoBinEdges& edgesY ,
1124  const double weight = 1.0 ) const ;
1125  // ==========================================================================
1126  // ================================= 3D Histograms ==========================
1127  // ==========================================================================
1186  AIDA::IHistogram3D* plot3D
1187  ( const double valueX ,
1188  const double valueY ,
1189  const double valueZ ,
1190  const std::string& title ,
1191  const double lowX ,
1192  const double highX ,
1193  const double lowY ,
1194  const double highY ,
1195  const double lowZ ,
1196  const double highZ ,
1197  const unsigned long binsX = 10 ,
1198  const unsigned long binsY = 10 ,
1199  const unsigned long binsZ = 10 ,
1200  const double weight = 1.0 ) const;
1201  // ==========================================================================
1288  AIDA::IHistogram3D* plot3D
1289  ( const double valueX ,
1290  const double valueY ,
1291  const double valueZ ,
1292  const HistoID& ID ,
1293  const std::string& title ,
1294  const double lowX ,
1295  const double highX ,
1296  const double lowY ,
1297  const double highY ,
1298  const double lowZ ,
1299  const double highZ ,
1300  const unsigned long binsX = 10 ,
1301  const unsigned long binsY = 10 ,
1302  const unsigned long binsZ = 10 ,
1303  const double weight = 1.0 ) const;
1304  // ==========================================================================
1305  // ================================= 3D Histograms ==========================
1306  // =============================== Variable Binning =========================
1307  // ==========================================================================
1355  AIDA::IHistogram3D* plot3D
1356  ( const double valueX ,
1357  const double valueY ,
1358  const double valueZ ,
1359  const std::string& title ,
1360  const HistoBinEdges& edgesX ,
1361  const HistoBinEdges& edgesY ,
1362  const HistoBinEdges& edgesZ ,
1363  const double weight = 1.0 ) const ;
1364  // ==========================================================================
1365  // ==========================================================================
1450  AIDA::IHistogram3D* plot3D
1451  ( const double valueX ,
1452  const double valueY ,
1453  const double valueZ ,
1454  const HistoID& ID ,
1455  const std::string& title ,
1456  const HistoBinEdges& edgesX ,
1457  const HistoBinEdges& edgesY ,
1458  const HistoBinEdges& edgesZ ,
1459  const double weight = 1.0 ) const ;
1460  // ==========================================================================
1461  // ================================= 1D Profile =============================
1462  // ================================= Fixed binning ==========================
1463  // ==========================================================================
1512  AIDA::IProfile1D* profile1D
1513  ( const double valueX ,
1514  const double valueY ,
1515  const std::string& title ,
1516  const double lowX ,
1517  const double highX ,
1518  const unsigned long binsX = 100 ,
1519  const std::string& opt = "" ,
1520  const double lowY = -std::numeric_limits<double>::max() ,
1521  const double highY = std::numeric_limits<double>::max() ,
1522  const double weight = 1.0 ) const ;
1523  // ==========================================================================
1589  AIDA::IProfile1D* profile1D
1590  ( const double valueX ,
1591  const double valueY ,
1592  const HistoID& ID ,
1593  const std::string& title ,
1594  const double lowX ,
1595  const double highX ,
1596  const unsigned long binsX = 100 ,
1597  const std::string& opt = "" ,
1598  const double lowY = -std::numeric_limits<double>::max() ,
1599  const double highY = std::numeric_limits<double>::max() ,
1600  const double weight = 1.0 ) const;
1601  // ==========================================================================
1602  // ================================= 1D Profile =============================
1603  // ============================== Variable binning ==========================
1604  // ==========================================================================
1647  AIDA::IProfile1D* profile1D
1648  ( const double valueX ,
1649  const double valueY ,
1650  const std::string& title ,
1651  const HistoBinEdges& edges ,
1652  const double weight = 1.0 ) const ;
1653  // ==========================================================================
1715  AIDA::IProfile1D* profile1D
1716  ( const double valueX ,
1717  const double valueY ,
1718  const HistoID& ID ,
1719  const std::string& title ,
1720  const HistoBinEdges& edges ,
1721  const double weight = 1.0 ) const;
1722  // ==========================================================================
1723  // ================================= 2D Profile =============================
1724  // ==========================================================================
1775  AIDA::IProfile2D* profile2D
1776  ( const double valueX ,
1777  const double valueY ,
1778  const double valueZ ,
1779  const std::string& title ,
1780  const double lowX ,
1781  const double highX ,
1782  const double lowY ,
1783  const double highY ,
1784  const unsigned long binsX = 50 ,
1785  const unsigned long binsY = 50 ,
1786  const double weight = 1.0 ) const;
1787  // ==========================================================================
1855  AIDA::IProfile2D* profile2D
1856  ( const double valueX ,
1857  const double valueY ,
1858  const double valueZ ,
1859  const HistoID& ID ,
1860  const std::string& title ,
1861  const double lowX ,
1862  const double highX ,
1863  const double lowY ,
1864  const double highY ,
1865  const unsigned long binsX = 50 ,
1866  const unsigned long binsY = 50 ,
1867  const double weight = 1.0 ) const;
1868  // ==========================================================================
1869  // ================================= 2D Profile =============================
1870  // ============================== Variable binning ==========================
1871  // ==========================================================================
1917  AIDA::IProfile2D* profile2D
1918  ( const double valueX ,
1919  const double valueY ,
1920  const double valueZ ,
1921  const std::string& title ,
1922  const HistoBinEdges& edgesX ,
1923  const HistoBinEdges& edgesY ,
1924  const double weight = 1.0 ) const ;
1925  // ==========================================================================
1988  AIDA::IProfile2D* profile2D
1989  ( const double valueX ,
1990  const double valueY ,
1991  const double valueZ ,
1992  const HistoID& ID ,
1993  const std::string& title ,
1994  const HistoBinEdges& edgesX ,
1995  const HistoBinEdges& edgesY ,
1996  const double weight = 1.0 ) const;
1997  // ==========================================================================
1998 
1999 public: // 1D Fixed
2000 
2001  // ==========================================================================
2013  AIDA::IHistogram1D* book1D
2014  ( const std::string& title ,
2015  const double low = 0 ,
2016  const double high = 100 ,
2017  const unsigned long bins = 100 ) const ;
2018  // ==========================================================================
2031  inline AIDA::IHistogram1D* book
2032  ( const std::string& title ,
2033  const double low = 0 ,
2034  const double high = 100 ,
2035  const unsigned long bins = 100 ) const
2036  {
2037  return book1D( title, low, high, bins );
2038  }
2039  // ==========================================================================
2048  AIDA::IHistogram1D* book
2049  ( const Gaudi::Histo1DDef& hdef ) const ;
2050  // ==========================================================================
2061  AIDA::IHistogram1D* book1D
2062  ( const HistoID& ID ,
2063  const std::string& title ,
2064  const double low = 0 ,
2065  const double high = 100 ,
2066  const unsigned long bins = 100 ) const ;
2067  // ==========================================================================
2081  inline AIDA::IHistogram1D* book
2082  ( const HistoID& ID ,
2083  const std::string& title ,
2084  const double low = 0 ,
2085  const double high = 100 ,
2086  const unsigned long bins = 100 ) const
2087  {
2088  return book1D( ID, title, low, high, bins );
2089  }
2090  // ==========================================================================
2098  inline AIDA::IHistogram1D* book
2099  ( const HistoID& ID ,
2100  const Gaudi::Histo1DDef& hdef ) const ;
2101  // ==========================================================================
2102 
2103 public: // 1D Variable
2104 
2105  // ==========================================================================
2116  AIDA::IHistogram1D* book1D
2117  ( const std::string& title ,
2118  const HistoBinEdges& edges ) const ;
2119  // ==========================================================================
2129  AIDA::IHistogram1D* book1D
2130  ( const HistoID& ID ,
2131  const std::string& title ,
2132  const HistoBinEdges& edges ) const ;
2133  // ==========================================================================
2134 
2135 public: // 2D Fixed
2136 
2137  // ==========================================================================
2152  AIDA::IHistogram2D* book2D
2153  ( const std::string& title ,
2154  const double lowX = 0 ,
2155  const double highX = 100 ,
2156  const unsigned long binsX = 50 ,
2157  const double lowY = 0 ,
2158  const double highY = 100 ,
2159  const unsigned long binsY = 50 ) const ;
2160  // ==========================================================================
2171  AIDA::IHistogram2D* book2D
2172  ( const HistoID& ID ,
2173  const std::string& title ,
2174  const double lowX = 0 ,
2175  const double highX = 100 ,
2176  const unsigned long binsX = 50 ,
2177  const double lowY = 0 ,
2178  const double highY = 100 ,
2179  const unsigned long binsY = 50 ) const ;
2180  // ==========================================================================
2181 
2182 public: // 2D Variable
2183 
2184  // ==========================================================================
2196  AIDA::IHistogram2D * book2D
2197  ( const std::string& title ,
2198  const HistoBinEdges& edgesX ,
2199  const HistoBinEdges& edgesY ) const ;
2200  // ==========================================================================
2211  AIDA::IHistogram2D * book2D
2212  ( const HistoID& ID ,
2213  const std::string& title ,
2214  const HistoBinEdges& edgesX ,
2215  const HistoBinEdges& edgesY ) const ;
2216  // ==========================================================================
2217 
2218 public: // 3D Fixed
2219 
2220  // ==========================================================================
2238  AIDA::IHistogram3D* book3D
2239  ( const std::string& title ,
2240  const double lowX = 0 ,
2241  const double highX = 100 ,
2242  const unsigned long binsX = 10 ,
2243  const double lowY = 0 ,
2244  const double highY = 100 ,
2245  const unsigned long binsY = 10 ,
2246  const double lowZ = 0 ,
2247  const double highZ = 100 ,
2248  const unsigned long binsZ = 10 ) const ;
2249  // ==========================================================================
2266  AIDA::IHistogram3D* book3D
2267  ( const HistoID& ID ,
2268  const std::string& title ,
2269  const double lowX = 0 ,
2270  const double highX = 100 ,
2271  const unsigned long binsX = 10 ,
2272  const double lowY = 0 ,
2273  const double highY = 100 ,
2274  const unsigned long binsY = 10 ,
2275  const double lowZ = 0 ,
2276  const double highZ = 100 ,
2277  const unsigned long binsZ = 10 ) const ;
2278  // ==========================================================================
2279 
2280 public: // 3D Variable
2281 
2282  // ==========================================================================
2295  AIDA::IHistogram3D * book3D
2296  ( const std::string& title ,
2297  const HistoBinEdges& edgesX ,
2298  const HistoBinEdges& edgesY ,
2299  const HistoBinEdges& edgesZ ) const ;
2300  // ==========================================================================
2312  AIDA::IHistogram3D * book3D
2313  ( const HistoID& ID ,
2314  const std::string& title ,
2315  const HistoBinEdges& edgesX ,
2316  const HistoBinEdges& edgesY ,
2317  const HistoBinEdges& edgesZ ) const ;
2318  // ==========================================================================
2319 
2320 public: // 1D Fixed Profiles
2321 
2322  // ==========================================================================
2337  AIDA::IProfile1D* bookProfile1D
2338  ( const std::string& title ,
2339  const double low = 0 ,
2340  const double high = 100 ,
2341  const unsigned long bins = 100 ,
2342  const std::string& opt = "" ,
2343  const double lowY = -std::numeric_limits<double>::max() ,
2344  const double highY = std::numeric_limits<double>::max() ) const;
2345  // ==========================================================================
2361  AIDA::IProfile1D* bookProfile1D
2362  ( const HistoID& ID ,
2363  const std::string& title ,
2364  const double low = 0 ,
2365  const double high = 100 ,
2366  const unsigned long bins = 100 ,
2367  const std::string& opt = "" ,
2368  const double lowY = -std::numeric_limits<double>::max() ,
2369  const double highY = std::numeric_limits<double>::max() ) const;
2370  // ==========================================================================
2371 
2372 public: // 1D Variable Profiles
2373 
2374  // ==========================================================================
2384  AIDA::IProfile1D* bookProfile1D
2385  ( const std::string& title ,
2386  const HistoBinEdges& edges ) const;
2387  // ==========================================================================
2397  AIDA::IProfile1D* bookProfile1D
2398  ( const HistoID& ID ,
2399  const std::string& title ,
2400  const HistoBinEdges& edges ) const;
2401  // ==========================================================================
2402 
2403 public: // 2D Profiles
2404 
2405  // ==========================================================================
2420  AIDA::IProfile2D* bookProfile2D
2421  ( const std::string& title ,
2422  const double lowX = 0 ,
2423  const double highX = 100 ,
2424  const unsigned long binsX = 50 ,
2425  const double lowY = 0 ,
2426  const double highY = 100 ,
2427  const unsigned long binsY = 50 ) const ;
2428  // ==========================================================================
2442  AIDA::IProfile2D* bookProfile2D
2443  ( const HistoID& ID ,
2444  const std::string& title ,
2445  const double lowX = 0 ,
2446  const double highX = 100 ,
2447  const unsigned long binsX = 50 ,
2448  const double lowY = 0 ,
2449  const double highY = 100 ,
2450  const unsigned long binsY = 50 ) const ;
2451  // ==========================================================================
2452 
2453 public: // 2D Profiles
2454 
2455  // ==========================================================================
2466  AIDA::IProfile2D* bookProfile2D
2467  ( const std::string& title ,
2468  const HistoBinEdges& edgesX,
2469  const HistoBinEdges& edgesY ) const ;
2470  // ==========================================================================
2480  AIDA::IProfile2D* bookProfile2D
2481  ( const HistoID& ID ,
2482  const std::string& title ,
2483  const HistoBinEdges& edgesX,
2484  const HistoBinEdges& edgesY ) const ;
2485  // ==========================================================================
2486 
2487 public:
2488 
2489  // ==========================================================================
2497  AIDA::IHistogram1D* fill
2498  ( AIDA::IHistogram1D* histo ,
2499  const double value ,
2500  const double weight ,
2501  const std::string& title = "" ) const ;
2502  // ==========================================================================
2511  AIDA::IHistogram2D* fill
2512  ( AIDA::IHistogram2D* histo ,
2513  const double valueX ,
2514  const double valueY ,
2515  const double weight ,
2516  const std::string& title = "" ) const ;
2517  // ==========================================================================
2527  AIDA::IHistogram3D* fill
2528  ( AIDA::IHistogram3D* histo ,
2529  const double valueX ,
2530  const double valueY ,
2531  const double valueZ ,
2532  const double weight ,
2533  const std::string& title = "" ) const ;
2534  // ==========================================================================
2543  AIDA::IProfile1D* fill
2544  ( AIDA::IProfile1D* histo ,
2545  const double valueX ,
2546  const double valueY ,
2547  const double weight ,
2548  const std::string& title = "" ) const ;
2549  // ==========================================================================
2559  AIDA::IProfile2D* fill
2560  ( AIDA::IProfile2D* histo ,
2561  const double valueX ,
2562  const double valueY ,
2563  const double valueZ ,
2564  const double weight ,
2565  const std::string& title = "" ) const ;
2566  // ==========================================================================
2567 public:
2568  // ==========================================================================
2572  inline AIDA::IHistogram1D* histo1D ( const std::string& title ) const
2573  {
2574  Histo1DMapTitle::const_iterator found = histo1DMapTitle().find( title ) ;
2575  return ( histo1DMapTitle().end() == found ? 0 : found->second );
2576  }
2577  // ==========================================================================
2585  inline AIDA::IHistogram1D* histo ( const std::string& title ) const
2586  {
2587  return histo1D( title );
2588  }
2589  // ==========================================================================
2593  inline AIDA::IHistogram2D* histo2D ( const std::string& title ) const
2594  {
2595  Histo2DMapTitle::const_iterator found = histo2DMapTitle().find( title ) ;
2596  return ( histo2DMapTitle().end() == found ? 0 : found->second );
2597  }
2598  // ==========================================================================
2602  inline AIDA::IHistogram3D* histo3D ( const std::string& title ) const
2603  {
2604  Histo3DMapTitle::const_iterator found = histo3DMapTitle().find( title ) ;
2605  return ( histo3DMapTitle().end() == found ? 0 : found->second );
2606  }
2607  // ==========================================================================
2611  inline AIDA::IProfile1D* profile1D ( const std::string& title ) const
2612  {
2613  Profile1DMapTitle::const_iterator found = profile1DMapTitle().find( title ) ;
2614  return ( profile1DMapTitle().end() == found ? 0 : found->second );
2615  }
2616  // ==========================================================================
2620  inline AIDA::IProfile2D* profile2D ( const std::string& title ) const
2621  {
2622  Profile2DMapTitle::const_iterator found = profile2DMapTitle().find( title ) ;
2623  return ( profile2DMapTitle().end() == found ? 0 : found->second );
2624  }
2625  // ==========================================================================
2626 public:
2627  // ==========================================================================
2631  AIDA::IHistogram1D* histo1D ( const HistoID& ID ) const;
2632  // ==========================================================================
2640  inline AIDA::IHistogram1D* histo ( const HistoID& ID ) const
2641  {
2642  return histo1D( ID );
2643  }
2644  // ==========================================================================
2648  AIDA::IHistogram2D* histo2D ( const HistoID& ID ) const;
2649  // ==========================================================================
2653  AIDA::IHistogram3D* histo3D ( const HistoID& ID ) const;
2654  // ==========================================================================
2658  AIDA::IProfile1D* profile1D ( const HistoID& ID ) const;
2659  // ==========================================================================
2663  AIDA::IProfile2D* profile2D ( const HistoID& ID ) const;
2664  // ==========================================================================
2665 public:
2666  // ==========================================================================
2668  inline bool histoExists ( const std::string& title ) const
2669  {
2670  return
2671  ( 0 != histo ( title ) ||
2672  0 != histo2D ( title ) ||
2673  0 != histo3D ( title ) ||
2674  0 != profile1D ( title ) ||
2675  0 != profile2D ( title ) );
2676  }
2677  // ==========================================================================
2679  inline bool histoExists ( const HistoID& ID ) const
2680  {
2681  return
2682  ( 0 != histo ( ID ) ||
2683  0 != histo2D ( ID ) ||
2684  0 != histo3D ( ID ) ||
2685  0 != profile1D ( ID ) ||
2686  0 != profile2D ( ID ) );
2687  }
2689  unsigned int totalNumberOfHistos() const;
2690  // ==========================================================================
2691 public: // trivial & non-trivial accessors
2692  // ==========================================================================
2694  inline bool produceHistos () const { return m_produceHistos ; }
2696  inline bool fullDetail () const { return m_fullDetail ; }
2698  inline bool checkForNaN () const { return m_checkForNaN ; }
2700  inline bool splitHistoDir () const { return m_splitHistoDir ; }
2702  inline HistoID::NumericID histoOffSet () const { return m_histoOffSet ; }
2704  inline const std::string& histoTopDir () const { return m_histoTopDir ; }
2706  inline const std::string& histoDir () const { return m_histoDir ; }
2708  inline std::string histoPath () const
2709  {
2710  const std::string path = histoTopDir() + histoDir();
2711  return ( splitHistoDir() ? dirHbookName(path) : path );
2712  }
2714  inline bool histosPrint () const { return m_histosPrint ; }
2716  inline bool useNumericAutoIDs() const { return m_useNumericAutoIDs; }
2717  // ==========================================================================
2722  int printHistos ( const MSG::Level level = MSG::ALWAYS ) const ;
2723  // ==========================================================================
2751  const Histo1DMapTitle & histo1DMapTitle() const { return m_histo1DMapTitle; }
2752  // ==========================================================================
2777  const Histo1DMapID & histo1DMapID () const { return m_histo1DMapID ; }
2778  // ==========================================================================
2806  const Histo2DMapTitle & histo2DMapTitle() const { return m_histo2DMapTitle ; }
2807  // ==========================================================================
2832  const Histo2DMapID& histo2DMapID () const { return m_histo2DMapID ; }
2833  // ==========================================================================
2861  const Histo3DMapTitle & histo3DMapTitle () const { return m_histo3DMapTitle ; }
2862  // ==========================================================================
2887  const Histo3DMapID & histo3DMapID () const { return m_histo3DMapID; }
2888  // ==========================================================================
2916  const Profile1DMapTitle & profile1DMapTitle() const { return m_profile1DMapTitle; }
2917  // ==========================================================================
2942  const Profile1DMapID & profile1DMapID () const { return m_profile1DMapID; }
2943  // ==========================================================================
2971  const Profile2DMapTitle & profile2DMapTitle() const { return m_profile2DMapTitle; }
2972  // ==========================================================================
2997  const Profile2DMapID & profile2DMapID () const { return m_profile2DMapID; }
2998  // ==========================================================================
2999 public: // trivial setters
3000  // ==========================================================================
3002  inline void setProduceHistos ( const bool val ) { m_produceHistos = val ; }
3004  inline void setFullDetail ( const bool val ) { m_fullDetail = val ; }
3006  inline void setCheckForNaN ( const bool val ) { m_checkForNaN = val ; }
3008  inline void setSplitHistoDir ( const bool val ) { m_splitHistoDir = val ; }
3010  inline void setHistoOffSet ( const HistoID::NumericID val )
3011  { m_histoOffSet = val ; }
3012  // ==========================================================================
3014  inline void setHistoTopDir ( const std::string& val ) { m_histoTopDir = val ; }
3015  // ==========================================================================
3017  inline void setHistoDir ( const std::string& val ) { m_histoDir = val ; }
3018  // ==========================================================================
3019 public:
3020  // ==========================================================================
3022  GaudiHistos ( const std::string & name,
3023  ISvcLocator * pSvcLocator );
3024  // ==========================================================================
3026  GaudiHistos ( const std::string& type ,
3027  const std::string& name ,
3028  const IInterface* parent );
3029  // ==========================================================================
3031  virtual ~GaudiHistos() {}
3032  // ==========================================================================
3033 protected:
3034  // ==========================================================================
3038  virtual StatusCode initialize()
3039 #ifdef __ICC
3040  { return i_ghInitialize(); }
3041  StatusCode i_ghInitialize()
3042 #endif
3043  ;
3044  // ==========================================================================
3048  virtual StatusCode finalize()
3049 #ifdef __ICC
3050  { return i_ghFinalize(); }
3051  StatusCode i_ghFinalize()
3052 #endif
3053  ;
3054  // ==========================================================================
3055 private:
3056  // ==========================================================================
3058  bool noHistos() const;
3059  // ===========================================unsigned===============================
3061  void initGaudiHistosConstructor();
3062  // ==========================================================================
3068  void monitorHisto( const AIDA::IBaseHistogram* hist,
3069  const HistoID& ID ) const;
3070  // ==========================================================================
3075  void newHistoID( const std::string & title,
3076  HistoID& ID ) const;
3077  // ==========================================================================
3079  void stringSearchReplace( std::string & title,
3080  const std::string & A,
3081  const std::string & B ) const;
3082  // ==========================================================================
3083 protected:
3084  // ==========================================================================
3086  std::string convertTitleToID( const std::string & title ) const;
3087  // ==========================================================================
3088 private:
3089  // ==========================================================================
3091  void printHistoHandler ( Property& /* theProp */ ) ; // "HistoPrint"
3092  // ==========================================================================
3093 private:
3094  // ==========================================================================
3104  HistoID::NumericID m_histoOffSet ;
3113  // ==========================================================================
3118  // ==========================================================================
3123  // ==========================================================================
3128  // ==========================================================================
3133  // ==========================================================================
3138  // ==========================================================================
3151  // ==========================================================================
3152 };
3153 // ============================================================================
3154 // The END
3155 // ============================================================================
3156 #endif // GAUDIALG_GAUDIHISTOS_H
3157 // ============================================================================

Generated at Wed Nov 28 2012 12:17:09 for Gaudi Framework, version v23r5 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004