1 #ifndef GAUDIALG_GAUDIHISTOS_H
2 #define GAUDIALG_GAUDIHISTOS_H 1
47 template <
class PBASE>
130 AIDA::IHistogram1D* plot1D
131 (
const double value ,
135 const unsigned long bins = 100 ,
136 const double weight = 1.0 )
const ;
151 inline AIDA::IHistogram1D* plot
156 const unsigned long bins = 100 ,
157 const double weight = 1.0 )
const
159 return plot1D ( value, title, low, high, bins, weight );
186 AIDA::IHistogram1D* plot1D
187 (
const double value ,
189 const double weight = 1.0 )
const ;
201 inline AIDA::IHistogram1D* plot
202 (
const double value ,
204 const double weight = 1.0 )
const
206 return plot1D ( value, hdef, weight );
274 AIDA::IHistogram1D* plot1D
275 (
const double value ,
280 const unsigned long bins = 100 ,
281 const double weight = 1.0 )
const ;
297 inline AIDA::IHistogram1D* plot
298 (
const double value ,
303 const unsigned long bins = 100 ,
304 const double weight = 1.0 )
const
306 return plot1D ( value, ID, title, low, high, bins, weight );
334 AIDA::IHistogram1D* plot1D
335 (
const double value ,
338 const double weight = 1.0 )
const ;
351 inline AIDA::IHistogram1D* plot
352 (
const double value ,
355 const double weight = 1.0 )
const
357 return plot1D ( value, ID, hdef, weight );
422 template <
class FUNCTION,
class OBJECT>
423 inline AIDA::IHistogram1D* plot
430 const unsigned long bins = 100 )
const
432 AIDA::IHistogram1D*
h =
nullptr;
433 if ( produceHistos() )
436 h = histo1D ( title ) ;
437 if ( !h ) { h = book1D ( title , low , high , bins ); }
439 while( first != last && h )
440 { h =
fill ( h ,
func( *first ) , 1.0 , title ) ; ++first ; }
500 template <
class FUNCTION,
class OBJECT>
501 inline AIDA::IHistogram1D* plot
502 (
const FUNCTION& func ,
509 const unsigned long bins = 100 )
const
511 AIDA::IHistogram1D*
h(0);
512 if ( produceHistos() )
516 if ( !h ) { h = book1D ( ID , title , low , high , bins ); }
518 while( first != last && h )
519 { h =
fill( h ,
func( *first ) , 1.0 , title ) ; ++first ; }
592 template <
class FUNCTION,
class OBJECT,
class WEIGHT>
593 inline AIDA::IHistogram1D* plot
594 (
const FUNCTION& func ,
600 const unsigned long bins ,
601 const WEIGHT& weight )
const
603 AIDA::IHistogram1D*
h =
nullptr;
604 if ( produceHistos() )
607 h = histo1D ( title ) ;
608 if ( !h ) { h = book1D ( title , low , high , bins ); }
610 while ( first != last && h )
613 weight ( *first ) , title ) ; ++first ; }
684 template <
class FUNCTION,
class OBJECT,
class WEIGHT>
685 inline AIDA::IHistogram1D* plot
686 (
const FUNCTION& func ,
693 const unsigned long bins ,
694 const WEIGHT& weight )
const
696 AIDA::IHistogram1D*
h =
nullptr;
697 if ( produceHistos() )
701 if ( !h ) { h = book1D ( ID , title , low , high , bins ); }
703 while( first != last && h )
706 weight ( *first ) , title ) ; ++first ; }
753 AIDA::IHistogram1D* plot1D
754 (
const double value ,
756 const HistoBinEdges& edges ,
757 const double weight = 1.0 )
const ;
823 AIDA::IHistogram1D* plot1D
824 (
const double value ,
827 const HistoBinEdges& edges ,
828 const double weight = 1.0 )
const ;
882 AIDA::IHistogram2D* plot2D
883 (
const double valueX ,
884 const double valueY ,
890 const unsigned long binsX = 50 ,
891 const unsigned long binsY = 50 ,
892 const double weight = 1.0 )
const;
970 AIDA::IHistogram2D* plot2D
971 (
const double valueX ,
972 const double valueY ,
979 const unsigned long binsX = 50 ,
980 const unsigned long binsY = 50 ,
981 const double weight = 1.0 )
const;
1031 AIDA::IHistogram2D* plot2D
1032 (
const double valueX ,
1033 const double valueY ,
1035 const HistoBinEdges& edgesX ,
1036 const HistoBinEdges& edgesY ,
1037 const double weight = 1.0 )
const ;
1114 AIDA::IHistogram2D* plot2D
1115 (
const double valueX ,
1116 const double valueY ,
1119 const HistoBinEdges& edgesX ,
1120 const HistoBinEdges& edgesY ,
1121 const double weight = 1.0 )
const ;
1183 AIDA::IHistogram3D* plot3D
1184 (
const double valueX ,
1185 const double valueY ,
1186 const double valueZ ,
1189 const double highX ,
1191 const double highY ,
1193 const double highZ ,
1194 const unsigned long binsX = 10 ,
1195 const unsigned long binsY = 10 ,
1196 const unsigned long binsZ = 10 ,
1197 const double weight = 1.0 )
const;
1285 AIDA::IHistogram3D* plot3D
1286 (
const double valueX ,
1287 const double valueY ,
1288 const double valueZ ,
1292 const double highX ,
1294 const double highY ,
1296 const double highZ ,
1297 const unsigned long binsX = 10 ,
1298 const unsigned long binsY = 10 ,
1299 const unsigned long binsZ = 10 ,
1300 const double weight = 1.0 )
const;
1352 AIDA::IHistogram3D* plot3D
1353 (
const double valueX ,
1354 const double valueY ,
1355 const double valueZ ,
1357 const HistoBinEdges& edgesX ,
1358 const HistoBinEdges& edgesY ,
1359 const HistoBinEdges& edgesZ ,
1360 const double weight = 1.0 )
const ;
1447 AIDA::IHistogram3D* plot3D
1448 (
const double valueX ,
1449 const double valueY ,
1450 const double valueZ ,
1453 const HistoBinEdges& edgesX ,
1454 const HistoBinEdges& edgesY ,
1455 const HistoBinEdges& edgesZ ,
1456 const double weight = 1.0 )
const ;
1509 AIDA::IProfile1D* profile1D
1510 (
const double valueX ,
1511 const double valueY ,
1514 const double highX ,
1515 const unsigned long binsX = 100 ,
1519 const double weight = 1.0 )
const ;
1586 AIDA::IProfile1D* profile1D
1587 (
const double valueX ,
1588 const double valueY ,
1592 const double highX ,
1593 const unsigned long binsX = 100 ,
1597 const double weight = 1.0 )
const;
1644 AIDA::IProfile1D* profile1D
1645 (
const double valueX ,
1646 const double valueY ,
1648 const HistoBinEdges& edges ,
1649 const double weight = 1.0 )
const ;
1712 AIDA::IProfile1D* profile1D
1713 (
const double valueX ,
1714 const double valueY ,
1717 const HistoBinEdges& edges ,
1718 const double weight = 1.0 )
const;
1772 AIDA::IProfile2D* profile2D
1773 (
const double valueX ,
1774 const double valueY ,
1775 const double valueZ ,
1778 const double highX ,
1780 const double highY ,
1781 const unsigned long binsX = 50 ,
1782 const unsigned long binsY = 50 ,
1783 const double weight = 1.0 )
const;
1852 AIDA::IProfile2D* profile2D
1853 (
const double valueX ,
1854 const double valueY ,
1855 const double valueZ ,
1859 const double highX ,
1861 const double highY ,
1862 const unsigned long binsX = 50 ,
1863 const unsigned long binsY = 50 ,
1864 const double weight = 1.0 )
const;
1914 AIDA::IProfile2D* profile2D
1915 (
const double valueX ,
1916 const double valueY ,
1917 const double valueZ ,
1919 const HistoBinEdges& edgesX ,
1920 const HistoBinEdges& edgesY ,
1921 const double weight = 1.0 )
const ;
1985 AIDA::IProfile2D* profile2D
1986 (
const double valueX ,
1987 const double valueY ,
1988 const double valueZ ,
1991 const HistoBinEdges& edgesX ,
1992 const HistoBinEdges& edgesY ,
1993 const double weight = 1.0 )
const;
2010 AIDA::IHistogram1D* book1D
2012 const double low = 0 ,
2013 const double high = 100 ,
2014 const unsigned long bins = 100 )
const ;
2028 inline AIDA::IHistogram1D*
book
2030 const double low = 0 ,
2031 const double high = 100 ,
2032 const unsigned long bins = 100 )
const
2034 return book1D( title, low, high, bins );
2045 AIDA::IHistogram1D*
book
2058 AIDA::IHistogram1D* book1D
2059 (
const HistoID& ID ,
2061 const double low = 0 ,
2062 const double high = 100 ,
2063 const unsigned long bins = 100 )
const ;
2078 inline AIDA::IHistogram1D*
book
2079 (
const HistoID& ID ,
2081 const double low = 0 ,
2082 const double high = 100 ,
2083 const unsigned long bins = 100 )
const
2085 return book1D( ID, title, low, high, bins );
2095 inline AIDA::IHistogram1D*
book
2096 (
const HistoID& ID ,
2113 AIDA::IHistogram1D* book1D
2115 const HistoBinEdges& edges )
const ;
2126 AIDA::IHistogram1D* book1D
2127 (
const HistoID& ID ,
2129 const HistoBinEdges& edges )
const ;
2149 AIDA::IHistogram2D* book2D
2151 const double lowX = 0 ,
2152 const double highX = 100 ,
2153 const unsigned long binsX = 50 ,
2154 const double lowY = 0 ,
2155 const double highY = 100 ,
2156 const unsigned long binsY = 50 )
const ;
2168 AIDA::IHistogram2D* book2D
2169 (
const HistoID& ID ,
2171 const double lowX = 0 ,
2172 const double highX = 100 ,
2173 const unsigned long binsX = 50 ,
2174 const double lowY = 0 ,
2175 const double highY = 100 ,
2176 const unsigned long binsY = 50 )
const ;
2193 AIDA::IHistogram2D * book2D
2195 const HistoBinEdges& edgesX ,
2196 const HistoBinEdges& edgesY )
const ;
2208 AIDA::IHistogram2D * book2D
2209 (
const HistoID& ID ,
2211 const HistoBinEdges& edgesX ,
2212 const HistoBinEdges& edgesY )
const ;
2235 AIDA::IHistogram3D* book3D
2237 const double lowX = 0 ,
2238 const double highX = 100 ,
2239 const unsigned long binsX = 10 ,
2240 const double lowY = 0 ,
2241 const double highY = 100 ,
2242 const unsigned long binsY = 10 ,
2243 const double lowZ = 0 ,
2244 const double highZ = 100 ,
2245 const unsigned long binsZ = 10 )
const ;
2263 AIDA::IHistogram3D* book3D
2264 (
const HistoID& ID ,
2266 const double lowX = 0 ,
2267 const double highX = 100 ,
2268 const unsigned long binsX = 10 ,
2269 const double lowY = 0 ,
2270 const double highY = 100 ,
2271 const unsigned long binsY = 10 ,
2272 const double lowZ = 0 ,
2273 const double highZ = 100 ,
2274 const unsigned long binsZ = 10 )
const ;
2292 AIDA::IHistogram3D * book3D
2294 const HistoBinEdges& edgesX ,
2295 const HistoBinEdges& edgesY ,
2296 const HistoBinEdges& edgesZ )
const ;
2309 AIDA::IHistogram3D * book3D
2310 (
const HistoID& ID ,
2312 const HistoBinEdges& edgesX ,
2313 const HistoBinEdges& edgesY ,
2314 const HistoBinEdges& edgesZ )
const ;
2334 AIDA::IProfile1D* bookProfile1D
2336 const double low = 0 ,
2337 const double high = 100 ,
2338 const unsigned long bins = 100 ,
2358 AIDA::IProfile1D* bookProfile1D
2359 (
const HistoID& ID ,
2361 const double low = 0 ,
2362 const double high = 100 ,
2363 const unsigned long bins = 100 ,
2381 AIDA::IProfile1D* bookProfile1D
2383 const HistoBinEdges& edges )
const;
2394 AIDA::IProfile1D* bookProfile1D
2395 (
const HistoID& ID ,
2397 const HistoBinEdges& edges )
const;
2417 AIDA::IProfile2D* bookProfile2D
2419 const double lowX = 0 ,
2420 const double highX = 100 ,
2421 const unsigned long binsX = 50 ,
2422 const double lowY = 0 ,
2423 const double highY = 100 ,
2424 const unsigned long binsY = 50 )
const ;
2439 AIDA::IProfile2D* bookProfile2D
2440 (
const HistoID& ID ,
2442 const double lowX = 0 ,
2443 const double highX = 100 ,
2444 const unsigned long binsX = 50 ,
2445 const double lowY = 0 ,
2446 const double highY = 100 ,
2447 const unsigned long binsY = 50 )
const ;
2463 AIDA::IProfile2D* bookProfile2D
2465 const HistoBinEdges& edgesX,
2466 const HistoBinEdges& edgesY )
const ;
2477 AIDA::IProfile2D* bookProfile2D
2478 (
const HistoID& ID ,
2480 const HistoBinEdges& edgesX,
2481 const HistoBinEdges& edgesY )
const ;
2494 AIDA::IHistogram1D*
fill
2495 ( AIDA::IHistogram1D* histo ,
2496 const double value ,
2497 const double weight ,
2508 AIDA::IHistogram2D*
fill
2509 ( AIDA::IHistogram2D* histo ,
2510 const double valueX ,
2511 const double valueY ,
2512 const double weight ,
2524 AIDA::IHistogram3D*
fill
2525 ( AIDA::IHistogram3D* histo ,
2526 const double valueX ,
2527 const double valueY ,
2528 const double valueZ ,
2529 const double weight ,
2540 AIDA::IProfile1D*
fill
2541 ( AIDA::IProfile1D* histo ,
2542 const double valueX ,
2543 const double valueY ,
2544 const double weight ,
2556 AIDA::IProfile2D*
fill
2557 ( AIDA::IProfile2D* histo ,
2558 const double valueX ,
2559 const double valueY ,
2560 const double valueZ ,
2561 const double weight ,
2571 auto found = histo1DMapTitle().find( title ) ;
2572 return found != histo1DMapTitle().end() ? found->second :
nullptr;
2584 return histo1D( title );
2592 auto found = histo2DMapTitle().find( title ) ;
2593 return histo2DMapTitle().end() != found ? found->second :
nullptr;
2601 auto found = histo3DMapTitle().find( title ) ;
2602 return histo3DMapTitle().end() != found ? found->second :
nullptr;
2610 auto found = profile1DMapTitle().find( title ) ;
2611 return profile1DMapTitle().end() != found ? found->second :
nullptr;
2619 auto found = profile2DMapTitle().find( title ) ;
2620 return profile2DMapTitle().end() != found ? found->second :
nullptr;
2628 AIDA::IHistogram1D* histo1D (
const HistoID& ID )
const;
2637 inline AIDA::IHistogram1D*
histo (
const HistoID& ID )
const
2639 return histo1D( ID );
2645 AIDA::IHistogram2D* histo2D (
const HistoID& ID )
const;
2650 AIDA::IHistogram3D* histo3D (
const HistoID& ID )
const;
2655 AIDA::IProfile1D* profile1D (
const HistoID& ID )
const;
2660 AIDA::IProfile2D* profile2D (
const HistoID& ID )
const;
2668 ( 0 != histo ( title ) ||
2669 0 != histo2D ( title ) ||
2670 0 != histo3D ( title ) ||
2671 0 != profile1D ( title ) ||
2672 0 != profile2D ( title ) );
2679 ( 0 != histo ( ID ) ||
2680 0 != histo2D ( ID ) ||
2681 0 != histo3D ( ID ) ||
2682 0 != profile1D ( ID ) ||
2683 0 != profile2D ( ID ) );
2686 unsigned int totalNumberOfHistos()
const;
2699 inline HistoID::NumericID
histoOffSet ()
const {
return m_histoOffSet ; }
2984 { m_histoOffSet = val ; }
3013 {
return i_ghInitialize(); }
3023 {
return i_ghFinalize(); }
3031 bool noHistos()
const;
3034 void initGaudiHistosConstructor();
3041 void monitorHisto(
const AIDA::IBaseHistogram* hist,
3042 const HistoID& ID )
const;
3049 HistoID& ID )
const;
3059 void printHistoHandler (
Property& ) ;
3126 #endif // GAUDIALG_GAUDIHISTOS_H
void setFullDetail(const bool val)
set flag to control output level of histograms
HistoID::NumericID histoOffSet() const
get the value for histogram offset (property "HistoOffSet")
bool fullDetail() const
get flag to control output level of histograms
GaudiAlg::Histo3DMapID Histo3DMapID
the actual type for (ID)->(3D histogram) mapping
bool m_declareMoniHists
Flag to turn on/off the registration of histograms to the Monitoring Service.
GaudiAlg::Histo1DMapTitle Histo1DMapTitle
the actual type for title->(1D histogram) mapping
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL ...
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
AIDA::IProfile2D * profile2D(const std::string &title) const
access the EXISTING 2D profile histogram by title return the pointer to existing 2D profile histogram...
GAUDI_API AIDA::IHistogram1D * book(IHistogramSvc *svc, const std::string &path, const Gaudi::Histo1DDef &hist)
helper function to book 1D-histogram
Profile1DMapID m_profile1DMapID
the actual storage/access of 1D profile histograms by unique ID
GaudiAlg::Profile1DMapTitle Profile1DMapTitle
the actual type for title->(1D profile histogram) mapping
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
AIDA::IHistogram1D * histo(const HistoID &ID) const
access the EXISTING 1D histogram by ID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Histo1DMapID m_histo1DMapID
the actual storage/access of 1D histograms by unique ID
std::string m_histoTopDir
histogram top level directory
Histo3DMapTitle m_histo3DMapTitle
the actual storage/access of 3D histograms by unique title
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
void setHistoOffSet(const HistoID::NumericID val)
set a value for histogram offset (property "HistoOffSet"
const Histo3DMapTitle & histo3DMapTitle() const
get access to the map of all 3D histograms indexed via their title
GaudiAlg::Histo3DMapTitle Histo3DMapTitle
the actual type for title->(3D histogram) mapping
bool histoExists(const HistoID &ID) const
check the existence AND validity of the histogram with given title
GaudiAlg::Profile2DMapID Profile2DMapID
the actual type for (ID)->(2D profile histogram) mapping
std::string m_histo1DTableFormat
format for printout of 1D-histograms as a table
GaudiAlg::Profile1DMapID Profile1DMapID
the actual type for (ID)->(1D profile histogram) mapping
bool splitHistoDir() const
get the flag for histogram path split (property "HistoSplitDir")
const Profile2DMapTitle & profile2DMapTitle() const
get access to the map of all 2D profile histograms indexed via their title
GaudiAlg::HistoBinEdges HistoBinEdges
Edges for variable binning.
Histo2DMapTitle m_histo2DMapTitle
the actual storage/access of 2D histograms by unique title
void setProduceHistos(const bool val)
set the flag for histogram production (property "HistoProduce")
AIDA::IProfile1D * profile1D(const std::string &title) const
access the EXISTING 1D profile histogram by title return the pointer to existing 1D profile histogram...
const Histo1DMapTitle & histo1DMapTitle() const
get access to the map of all 1D histograms indexed via their title
GaudiAlg::Profile2DMapTitle Profile2DMapTitle
the actual type for title->(2D profile histogram) mapping
void setCheckForNaN(const bool val)
set the flag for NaN checks (property "HistoCheckForNan")
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL ...
Profile1DMapTitle m_profile1DMapTitle
the actual storage/access of 1D profile histograms by unique title
This class is used for returning status codes from appropriate routines.
HistoID::NumericID m_histoOffSet
general histogram ID offset (only works for automatically assigned numeric IDs)
Definition of the basic interface.
Simple helper class for description of 1D-histogram The class is targeted to act as the primary "hist...
bool m_histoCountersPrint
print histogram counters at finalization
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
bool useNumericAutoIDs() const
Use old style sequencial numerical automatically assigned IDs ?
GaudiAlg::Histo1DMapID Histo1DMapID
the actual type for (ID)->(1D histogram) mapping
const Profile1DMapTitle & profile1DMapTitle() const
get access to the map of all 1D profile histograms indexed via their title
string opt
print 'Summary: %32s [s] d d steps'%(summary.protocol,summary.type,summary.nevt,len(summary.data),)
std::string m_histo1DTableFormatShort
format for printout of 1D-histograms as a table
bool m_splitHistoDir
split histogram directory name (very useful for Hbook)
Profile2DMapID m_profile2DMapID
the actual storage/access of 2D profile histograms by unique ID
GaudiAlg::Histo2DMapTitle Histo2DMapTitle
the actual type for title->(2D histogram) mapping
void setSplitHistoDir(const bool val)
set the flag for histogram path split (property "HistoSplitDir")
Property base class allowing Property* collections to be "homogeneous".
Histo1DMapTitle m_histo1DMapTitle
the actual storage/access of 1D histograms by unique title
Profile2DMapTitle m_profile2DMapTitle
the actual storage/access of 2D profile histograms by unique title
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
bool histoCountersPrint() const
print histogram counters at finalization ?
void setHistoTopDir(const std::string &val)
set top-level histogram directory (property "HistoTopDir")
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
GaudiAlg::Histo2DMapID Histo2DMapID
the actual type for (ID)->(2D histogram) mapping
Histo3DMapID m_histo3DMapID
the actual storage/access of 3D histograms by unique ID
const std::string & histoDir() const
get histogram directory (property "HistoDir")
Common class providing an architecture-independent hash map.
const std::string & histoTopDir() const
get top-level histogram directory (property "HistoTopDir")
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Histo2DMapID m_histo2DMapID
the actual storage/access of 2D histograms by unique ID
void setHistoDir(const std::string &val)
set histogram directory (property "HistoDir")
Templated base class providing common histogramming methods for GaudiAlgorithm and GaudiTool like cla...
std::string m_histoDir
histogram directory
std::map< std::string, std::string > m_idReplaceInfo
Map of strings to search and replace when using the title as the basis of automatically generated lit...
bool m_produceHistos
flag to SWITCH ON/SWITCH OFF the histogrm fillling and booking
bool histoExists(const std::string &title) const
check the existence AND validity of the histogram with given title
const Histo2DMapTitle & histo2DMapTitle() const
get access to the map of all 2D histograms indexed via their title
A DataObject is the base class of any identifiable object on any data store.
std::string m_histo1DTableHeader
the header for the table of 1-D historgrams
bool m_useNumericAutoIDs
Flag to switch back to the old style sequencial numerical automatic IDs.
ID class for Histogram and Ntuples.
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL ...
bool m_checkForNaN
flag to control check for Nan/Finite while filling the histogram
bool histosPrint() const
print histograms at finalization ?
bool m_fullDetail
flag to control output level of histograms
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
bool m_histosPrint
print histograms at finalization