| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
GaudiHistos< PBASE > Class Template Reference

Templated base class providing common histogramming methods for GaudiAlgorithm and GaudiTool like classes. More...

`#include <GaudiAlg/GaudiHistos.h>`

Inheritance diagram for GaudiHistos< PBASE >:
[legend]
Collaboration diagram for GaudiHistos< PBASE >:
[legend]

## Public Types
typedef GaudiAlg::HistoID | HistoID
| the actual type for histogram identifier More...
typedef GaudiAlg::Histo1DMapID | Histo1DMapID
| the actual type for (ID)->(1D histogram) mapping More...
typedef GaudiAlg::Histo1DMapTitle | Histo1DMapTitle
| the actual type for title->(1D histogram) mapping More...
typedef GaudiAlg::Histo2DMapID | Histo2DMapID
| the actual type for (ID)->(2D histogram) mapping More...
typedef GaudiAlg::Histo2DMapTitle | Histo2DMapTitle
| the actual type for title->(2D histogram) mapping More...
typedef GaudiAlg::Histo3DMapID | Histo3DMapID
| the actual type for (ID)->(3D histogram) mapping More...
typedef GaudiAlg::Histo3DMapTitle | Histo3DMapTitle
| the actual type for title->(3D histogram) mapping More...
typedef GaudiAlg::Profile1DMapID | Profile1DMapID
| the actual type for (ID)->(1D profile histogram) mapping More...
typedef GaudiAlg::Profile1DMapTitle | Profile1DMapTitle
| the actual type for title->(1D profile histogram) mapping More...
typedef GaudiAlg::Profile2DMapID | Profile2DMapID
| the actual type for (ID)->(2D profile histogram) mapping More...
typedef GaudiAlg::Profile2DMapTitle | Profile2DMapTitle
| the actual type for title->(2D profile histogram) mapping More...
typedef GaudiAlg::HistoBinEdges | HistoBinEdges
| Edges for variable binning. More...

## Public Member Functions
AIDA::IHistogram1D * | plot1D (const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
| fill the 1D histogram (book on demand) More...
AIDA::IHistogram1D * | plot (const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
| fill the 1D histogram (book on demand) More...
AIDA::IHistogram1D * | plot1D (const double value, const Gaudi::Histo1DDef &hdef, const double weight=1.0) const
| fill the 1D histogram (book on demand) More...
AIDA::IHistogram1D * | plot (const double value, const Gaudi::Histo1DDef &hdef, const double weight=1.0) const
| fill the 1D histogram (book on demand) More...
AIDA::IHistogram1D * | plot1D (const double value, const HistoID &ID, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
| fill the 1D histogram with forced ID assignment (book on demand) More...
AIDA::IHistogram1D * | plot (const double value, const HistoID &ID, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
| fill the 1D histogram with forced ID assignment (book on demand) More...
AIDA::IHistogram1D * | plot1D (const double value, const HistoID &ID, const Gaudi::Histo1DDef &hdef, const double weight=1.0) const
| fill the 1D histogram with forced ID assignment (book on demand) More...
AIDA::IHistogram1D * | plot (const double value, const HistoID &ID, const Gaudi::Histo1DDef &hdef, const double weight=1.0) const
| fill the 1D histogram (book on demand) More...
template<class FUNCTION , class OBJECT >
AIDA::IHistogram1D * | plot (const FUNCTION &func, OBJECT first, OBJECT last, const std::string &title, const double low, const double high, const unsigned long bins=100) const
| fill the 1D histogram with information from [first,last) sequence More...
template<class FUNCTION , class OBJECT >
AIDA::IHistogram1D * | plot (const FUNCTION &func, OBJECT first, OBJECT last, const HistoID &ID, const std::string &title, const double low, const double high, const unsigned long bins=100) const
| fill the 1D histogram with forced ID and information from [first,last) sequence More...
template<class FUNCTION , class OBJECT , class WEIGHT >
AIDA::IHistogram1D * | plot (const FUNCTION &func, OBJECT first, OBJECT last, const std::string &title, const double low, const double high, const unsigned long bins, const WEIGHT &weight) const
| book and fill the 1D histogram with information from [first,last) sequence with given weight More...
template<class FUNCTION , class OBJECT , class WEIGHT >
AIDA::IHistogram1D * | plot (const FUNCTION &func, OBJECT first, OBJECT last, const HistoID &ID, const std::string &title, const double low, const double high, const unsigned long bins, const WEIGHT &weight) const
| book and fill the 1D histogram with forced ID and information from [first,last) sequence with given weight More...
AIDA::IHistogram1D * | plot1D (const double value, const std::string &title, const HistoBinEdges &edges, const double weight=1.0) const
| Fill the 1D variable binning histogram (book on demand) More...
AIDA::IHistogram1D * | plot1D (const double value, const HistoID &ID, const std::string &title, const HistoBinEdges &edges, const double weight=1.0) const
| fill the 1D variable binning histogram with forced ID assignment (book on demand) More...
AIDA::IHistogram2D * | plot2D (const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
| fill the 2D histogram (book on demand) More...
AIDA::IHistogram2D * | plot2D (const double valueX, const double valueY, const HistoID &ID, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
| fill the 2D histogram with forced ID assignment (book on demand) More...
AIDA::IHistogram2D * | plot2D (const double valueX, const double valueY, const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY, const double weight=1.0) const
| Fill the 2D variable binning histogram (book on demand) More...
AIDA::IHistogram2D * | plot2D (const double valueX, const double valueY, const HistoID &ID, const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY, const double weight=1.0) const
| fill the 2D variable histogram with forced ID assignment (book on demand) More...
AIDA::IHistogram3D * | plot3D (const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const double lowZ, const double highZ, const unsigned long binsX=10, const unsigned long binsY=10, const unsigned long binsZ=10, const double weight=1.0) const
| fill the 3D histogram (book on demand) More...
AIDA::IHistogram3D * | plot3D (const double valueX, const double valueY, const double valueZ, const HistoID &ID, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const double lowZ, const double highZ, const unsigned long binsX=10, const unsigned long binsY=10, const unsigned long binsZ=10, const double weight=1.0) const
| fill the 3D histogram with forced ID assignment (book on demand) More...
AIDA::IHistogram3D * | plot3D (const double valueX, const double valueY, const double valueZ, const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY, const HistoBinEdges &edgesZ, const double weight=1.0) const
| Fill the 3D variable binning histogram (book on demand) More...
AIDA::IHistogram3D * | plot3D (const double valueX, const double valueY, const double valueZ, const HistoID &ID, const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY, const HistoBinEdges &edgesZ, const double weight=1.0) const
| fill the 3D histogram with forced ID assignment (book on demand) More...
AIDA::IProfile1D * | profile1D (const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
| fill the 1D profile histogram (book on demand) More...
AIDA::IProfile1D * | profile1D (const double valueX, const double valueY, const HistoID &ID, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
| fill the 1D profile histogram with forced ID assignment (book on demand) More...
AIDA::IProfile1D * | profile1D (const double valueX, const double valueY, const std::string &title, const HistoBinEdges &edges, const double weight=1.0) const
| fill the 1D variable binning profile histogram (book on demand) More...
AIDA::IProfile1D * | profile1D (const double valueX, const double valueY, const HistoID &ID, const std::string &title, const HistoBinEdges &edges, const double weight=1.0) const
| fill the 1D variable binning profile histogram with forced ID assignment (book on demand) More...
AIDA::IProfile2D * | profile2D (const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
| fill the 2D profile histogram (book on demand) More...
AIDA::IProfile2D * | profile2D (const double valueX, const double valueY, const double valueZ, const HistoID &ID, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
| fill the 2D profile histogram with forced ID assignment (book on demand) More...
AIDA::IProfile2D * | profile2D (const double valueX, const double valueY, const double valueZ, const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY, const double weight=1.0) const
| fill the 2D variable binning profile histogram (book on demand) More...
AIDA::IProfile2D * | profile2D (const double valueX, const double valueY, const double valueZ, const HistoID &ID, const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY, const double weight=1.0) const
| fill the 2D variable binning profile histogram with forced ID assignment (book on demand) More...
AIDA::IHistogram1D * | book1D (const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
| book the 1D histogram More...
AIDA::IHistogram1D * | book (const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
| book the 1D histogram More...
AIDA::IHistogram1D * | book (const Gaudi::Histo1DDef &hdef) const
| book the 1D histogram More...
AIDA::IHistogram1D * | book1D (const HistoID &ID, const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
| book the 1D histogram with forced ID More...
AIDA::IHistogram1D * | book (const HistoID &ID, const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
| book the 1D histogram with forced ID More...
AIDA::IHistogram1D * | book (const HistoID &ID, const Gaudi::Histo1DDef &hdef) const
| book the 1D histogram with forced ID More...
AIDA::IHistogram1D * | book1D (const std::string &title, const HistoBinEdges &edges) const
| book the 1D variable binning histogram More...
AIDA::IHistogram1D * | book1D (const HistoID &ID, const std::string &title, const HistoBinEdges &edges) const
| book the 1D variable binning histogram with given ID More...
AIDA::IHistogram2D * | book2D (const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
| book the 2D histogram More...
AIDA::IHistogram2D * | book2D (const HistoID &ID, const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
| book the 2D histogram with forced ID More...
AIDA::IHistogram2D * | book2D (const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY) const
| book the 2D variable binning histogram More...
AIDA::IHistogram2D * | book2D (const HistoID &ID, const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY) const
| book the 2D variable binning histogram with given ID More...
AIDA::IHistogram3D * | book3D (const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const
| book the 3D histogram More...
AIDA::IHistogram3D * | book3D (const HistoID &ID, const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const
| book the 3D histogram with forced ID More...
AIDA::IHistogram3D * | book3D (const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY, const HistoBinEdges &edgesZ) const
| book the 3D variable binning histogram More...
AIDA::IHistogram3D * | book3D (const HistoID &ID, const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY, const HistoBinEdges &edgesZ) const
| book the 3D variable binning histogram with given ID More...
AIDA::IProfile1D * | bookProfile1D (const std::string &title, const double low=0, const double high=100, const unsigned long bins=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max()) const
| book the 1D profile histogram More...
AIDA::IProfile1D * | bookProfile1D (const HistoID &ID, const std::string &title, const double low=0, const double high=100, const unsigned long bins=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max()) const
| book the 1D profile histogram More...
AIDA::IProfile1D * | bookProfile1D (const std::string &title, const HistoBinEdges &edges) const
| book the 1D profile histogram More...
AIDA::IProfile1D * | bookProfile1D (const HistoID &ID, const std::string &title, const HistoBinEdges &edges) const
| book the 1D profile histogram More...
AIDA::IProfile2D * | bookProfile2D (const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
| book the 2D profile histogram More...
AIDA::IProfile2D * | bookProfile2D (const HistoID &ID, const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
| book the 2D profile histogram with forced ID More...
AIDA::IProfile2D * | bookProfile2D (const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY) const
| book the 2D profile histogram More...
AIDA::IProfile2D * | bookProfile2D (const HistoID &ID, const std::string &title, const HistoBinEdges &edgesX, const HistoBinEdges &edgesY) const
| book the 2D profile histogram with forced ID More...
AIDA::IHistogram1D * | fill (AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
| fill the 1D histogram with the value and weight More...
AIDA::IHistogram2D * | fill (AIDA::IHistogram2D *histo, const double valueX, const double valueY, const double weight, const std::string &title="") const
| fill the 2D histogram with the value and weight More...
AIDA::IHistogram3D * | fill (AIDA::IHistogram3D *histo, const double valueX, const double valueY, const double valueZ, const double weight, const std::string &title="") const
| fill the 3D histogram with the value and weight More...
AIDA::IProfile1D * | fill (AIDA::IProfile1D *histo, const double valueX, const double valueY, const double weight, const std::string &title="") const
| fill the 1D profile histogram with the values and weight More...
AIDA::IProfile2D * | fill (AIDA::IProfile2D *histo, const double valueX, const double valueY, const double valueZ, const double weight, const std::string &title="") const
| fill the 2D profile histogram with the values and weight More...
AIDA::IHistogram1D * | histo1D (const std::string &title) const
| access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL More...
AIDA::IHistogram1D * | histo (const std::string &title) const
| access the EXISTING 1D histogram by title More...
AIDA::IHistogram2D * | histo2D (const std::string &title) const
| access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL More...
AIDA::IHistogram3D * | histo3D (const std::string &title) const
| access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL More...
AIDA::IProfile1D * | profile1D (const std::string &title) const
| access the EXISTING 1D profile histogram by title return the pointer to existing 1D profile histogram or NULL More...
AIDA::IProfile2D * | profile2D (const std::string &title) const
| access the EXISTING 2D profile histogram by title return the pointer to existing 2D profile histogram or NULL More...
AIDA::IHistogram1D * | histo1D (const HistoID &ID) const
| access the EXISTING 1D histogram by ID return the pointer to existing 1D histogram or NULL More...
AIDA::IHistogram1D * | histo (const HistoID &ID) const
| access the EXISTING 1D histogram by ID More...
AIDA::IHistogram2D * | histo2D (const HistoID &ID) const
| access the EXISTING 2D histogram by ID return the pointer to existing 2D histogram or NULL More...
AIDA::IHistogram3D * | histo3D (const HistoID &ID) const
| access the EXISTING 3D histogram by ID return the pointer to existing 3D histogram or NULL More...
AIDA::IProfile1D * | profile1D (const HistoID &ID) const
| access the EXISTING 1D profile histogram by ID return the pointer to existing 1D profile histogram or NULL More...
AIDA::IProfile2D * | profile2D (const HistoID &ID) const
| access the EXISTING 2D profile histogram by ID return the pointer to existing 2D profile histogram or NULL More...
bool | histoExists (const std::string &title) const
| check the existence AND validity of the histogram with given title More...
bool | histoExists (const HistoID &ID) const
| check the existence AND validity of the histogram with given title More...
unsigned int | totalNumberOfHistos () const
| Returns the total number of histograms (of all types) currently booked. More...
bool | produceHistos () const
| get the flag for histogram production (property "HistoProduce") More...
bool | fullDetail () const
| get flag to control output level of histograms More...
bool | checkForNaN () const
| get the flag for NaN checks (property "HistoCheckForNan") More...
bool | splitHistoDir () const
| get the flag for histogram path split (property "HistoSplitDir") More...
HistoID::NumericID | histoOffSet () const
| get the value for histogram offset (property "HistoOffSet") More...
const std::string & | histoTopDir () const
| get top-level histogram directory (property "HistoTopDir") More...
const std::string & | histoDir () const
| get histogram directory (property "HistoDir") More...
std::string | histoPath () const
| get the constructed histogram path More...
bool | histosPrint () const
| print histograms at finalization ? More...
bool | histoCountersPrint () const
| print histogram counters at finalization ? More...
bool | useNumericAutoIDs () const
| Use old style sequencial numerical automatically assigned IDs ? More...
int | printHistos (const MSG::Level level=MSG::ALWAYS) const
| perform the actual printout of histograms More...
const Histo1DMapTitle & | histo1DMapTitle () const
| get access to the map of all 1D histograms indexed via their title More...
const Histo1DMapID & | histo1DMapID () const
| get access to the map of all 1D histograms index via ID More...
const Histo2DMapTitle & | histo2DMapTitle () const
| get access to the map of all 2D histograms indexed via their title More...
const Histo2DMapID & | histo2DMapID () const
| get access to the map of 2D histograms index via ID More...
const Histo3DMapTitle & | histo3DMapTitle () const
| get access to the map of all 3D histograms indexed via their title More...
const Histo3DMapID & | histo3DMapID () const
| get access to the map of all 3D histograms index via a ID More...
const Profile1DMapTitle & | profile1DMapTitle () const
| get access to the map of all 1D profile histograms indexed via their title More...
const Profile1DMapID & | profile1DMapID () const
| get access to the map of 1D profile histograms index via a ID More...
const Profile2DMapTitle & | profile2DMapTitle () const
| get access to the map of all 2D profile histograms indexed via their title More...
const Profile2DMapID & | profile2DMapID () const
| get access to the map of 2D profile histograms index via a ID More...
void | setProduceHistos (const bool val)
| set the flag for histogram production (property "HistoProduce") More...
void | setFullDetail (const bool val)
| set flag to control output level of histograms More...
void | setCheckForNaN (const bool val)
| set the flag for NaN checks (property "HistoCheckForNan") More...
void | setSplitHistoDir (const bool val)
| set the flag for histogram path split (property "HistoSplitDir") More...
void | setHistoOffSet (const HistoID::NumericID val)
| set a value for histogram offset (property "HistoOffSet" More...
void | setHistoTopDir (const std::string &val)
| set top-level histogram directory (property "HistoTopDir") More...
void | setHistoDir (const std::string &val)
| set histogram directory (property "HistoDir") More...
template<typename U = PBASE, typename = std::enable_if_t<std::is_base_of_v<Gaudi::Algorithm, PBASE>, U>>
| GaudiHistos (const std::string &name, ISvcLocator *pSvcLocator)
| Algorithm constructor - the SFINAE constraint below ensures that this is constructor is only defined if PBASE derives from GaudiAlgorithm. More...
template<typename U = PBASE, typename = std::enable_if_t<std::is_base_of_v<GaudiTool, PBASE>, U>>
| GaudiHistos (const std::string &type, const std::string &name, const IInterface *parent)
| Tool constructor - SFINAE-ed to insure this constructor is only defined if PBASE derives from GaudiTool. More...

## Protected Member Functions
StatusCode | initialize () override
| standard initialization method More...
StatusCode | finalize () override
| standard finalization method More...
std::string | convertTitleToID (std::string title) const
| Create an ID string from a title string. More...

## Private Member Functions
bool | noHistos () const
| Check if all histogram maps are empty. More...
void | monitorHisto (const AIDA::IBaseHistogram *hist, const HistoID &ID) const
| Declare a histogram to the monitor service. More...
void | newHistoID (const std::string &title, HistoID &ID) const
| Create a new histogram ID using the given title. More...

## Private Attributes
Gaudi::Property< bool > | m_produceHistos {this, "HistoProduce", true, "Switch on/off the production of histograms"}
Gaudi::Property< bool > | m_histosPrint
Gaudi::Property< bool > | m_histoCountersPrint
Gaudi::Property< bool > | m_checkForNaN
Gaudi::Property< bool > | m_splitHistoDir
Gaudi::Property< HistoID::NumericID > | m_histoOffSet
Gaudi::Property< std::string > | m_histoTopDir
Gaudi::Property< std::string > | m_histoDir
Gaudi::Property< bool > | m_fullDetail {this, "FullDetail", false}
Gaudi::Property< bool > | m_declareMoniHists {this, "MonitorHistograms", true}
Gaudi::Property< std::string > | m_histo1DTableFormat
Gaudi::Property< std::string > | m_histo1DTableFormatShort
Gaudi::Property< std::string > | m_histo1DTableHeader
Gaudi::Property< bool > | m_useNumericAutoIDs
Gaudi::Property< std::map< std::string, std::string > > | m_idReplaceInfo
Histo1DMapTitle | m_histo1DMapTitle
| the actual storage/access of 1D histograms by unique title More...
Histo1DMapID | m_histo1DMapID
| the actual storage/access of 1D histograms by unique ID More...
Histo2DMapTitle | m_histo2DMapTitle
| the actual storage/access of 2D histograms by unique title More...
Histo2DMapID | m_histo2DMapID
| the actual storage/access of 2D histograms by unique ID More...
Histo3DMapTitle | m_histo3DMapTitle
| the actual storage/access of 3D histograms by unique title More...
Histo3DMapID | m_histo3DMapID
| the actual storage/access of 3D histograms by unique ID More...
Profile1DMapTitle | m_profile1DMapTitle
| the actual storage/access of 1D profile histograms by unique title More...
Profile1DMapID | m_profile1DMapID
| the actual storage/access of 1D profile histograms by unique ID More...
Profile2DMapTitle | m_profile2DMapTitle
| the actual storage/access of 2D profile histograms by unique title More...
Profile2DMapID | m_profile2DMapID
| the actual storage/access of 2D profile histograms by unique ID More...

## Detailed Description

### template<class PBASE>
class GaudiHistos< PBASE >

Templated base class providing common histogramming methods for GaudiAlgorithm and GaudiTool like classes.

Author
  Chris Jones Chris.nosp@m.toph.nosp@m.er.Ro.nosp@m.b.Jo.nosp@m.nes@c.nosp@m.ern..nosp@m.ch
  Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru

Date
  2005-08-08

Definition at line 55 of file GaudiHistos.h.

## Member Typedef Documentation

## ◆ Histo1DMapID

template<class PBASE>

typedef GaudiAlg::Histo1DMapID GaudiHistos< PBASE >::Histo1DMapID

the actual type for (ID)->(1D histogram) mapping

Definition at line 62 of file GaudiHistos.h.

## ◆ Histo1DMapTitle

template<class PBASE>

typedef GaudiAlg::Histo1DMapTitle GaudiHistos< PBASE >::Histo1DMapTitle

the actual type for title->(1D histogram) mapping

Definition at line 64 of file GaudiHistos.h.

## ◆ Histo2DMapID

template<class PBASE>

typedef GaudiAlg::Histo2DMapID GaudiHistos< PBASE >::Histo2DMapID

the actual type for (ID)->(2D histogram) mapping

Definition at line 67 of file GaudiHistos.h.

## ◆ Histo2DMapTitle

template<class PBASE>

typedef GaudiAlg::Histo2DMapTitle GaudiHistos< PBASE >::Histo2DMapTitle

the actual type for title->(2D histogram) mapping

Definition at line 69 of file GaudiHistos.h.

## ◆ Histo3DMapID

template<class PBASE>

typedef GaudiAlg::Histo3DMapID GaudiHistos< PBASE >::Histo3DMapID

the actual type for (ID)->(3D histogram) mapping

Definition at line 72 of file GaudiHistos.h.

## ◆ Histo3DMapTitle

template<class PBASE>

typedef GaudiAlg::Histo3DMapTitle GaudiHistos< PBASE >::Histo3DMapTitle

the actual type for title->(3D histogram) mapping

Definition at line 74 of file GaudiHistos.h.

## ◆ HistoBinEdges

template<class PBASE>

typedef GaudiAlg::HistoBinEdges GaudiHistos< PBASE >::HistoBinEdges

Edges for variable binning.

Definition at line 87 of file GaudiHistos.h.

## ◆ HistoID

template<class PBASE>

typedef GaudiAlg::HistoID GaudiHistos< PBASE >::HistoID

the actual type for histogram identifier

Definition at line 59 of file GaudiHistos.h.

## ◆ Profile1DMapID

template<class PBASE>

typedef GaudiAlg::Profile1DMapID GaudiHistos< PBASE >::Profile1DMapID

the actual type for (ID)->(1D profile histogram) mapping

Definition at line 77 of file GaudiHistos.h.

## ◆ Profile1DMapTitle

template<class PBASE>

typedef GaudiAlg::Profile1DMapTitle GaudiHistos< PBASE >::Profile1DMapTitle

the actual type for title->(1D profile histogram) mapping

Definition at line 79 of file GaudiHistos.h.

## ◆ Profile2DMapID

template<class PBASE>

typedef GaudiAlg::Profile2DMapID GaudiHistos< PBASE >::Profile2DMapID

the actual type for (ID)->(2D profile histogram) mapping

Definition at line 82 of file GaudiHistos.h.

## ◆ Profile2DMapTitle

template<class PBASE>

typedef GaudiAlg::Profile2DMapTitle GaudiHistos< PBASE >::Profile2DMapTitle

the actual type for title->(2D profile histogram) mapping

Definition at line 84 of file GaudiHistos.h.

## Constructor & Destructor Documentation

## ◆ GaudiHistos() [1/2]

template<class PBASE>
template<typename U = PBASE, typename = std::enable_if_t<std::is_base_of_v<Gaudi::Algorithm, PBASE>, U>>

GaudiHistos< PBASE >::GaudiHistos | ( | const std::string & | name,
|  | ISvcLocator * | pSvcLocator
| ) |  |
| inline

Algorithm constructor - the SFINAE constraint below ensures that this is constructor is only defined if PBASE derives from GaudiAlgorithm.

Definition at line 2678 of file GaudiHistos.h.

2678 : PBASE( name, pSvcLocator ) {}
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41

## ◆ GaudiHistos() [2/2]

template<class PBASE>
template<typename U = PBASE, typename = std::enable_if_t<std::is_base_of_v<GaudiTool, PBASE>, U>>

GaudiHistos< PBASE >::GaudiHistos | ( | const std::string & | type,
|  | const std::string & | name,
|  | const IInterface * | parent
| ) |  |
| inline

Tool constructor - SFINAE-ed to insure this constructor is only defined if PBASE derives from GaudiTool.

Definition at line 2683 of file GaudiHistos.h.

2684 : PBASE( type, name, parent ) {}
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
gaudirun.type
type
Definition: gaudirun.py:142

## Member Function Documentation

## ◆ book() [1/4]

template<class PBASE>

AIDA::IHistogram1D* GaudiHistos< PBASE >::book | ( | const std::string & | title,
|  | const double | low = `0`,
|  | const double | high = `100`,
|  | const unsigned long | bins = `100`
| ) |  | const
| inline

book the 1D histogram

Wrapper method for the equivalent book1D method. Retained for backwards compatibility, please use book1D instead.

See also
  IHistogram1D

Parameters

  title | histogram title (must be unique within the algorithm)
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins

Returns
  pointer to AIDA 1D histogram

Definition at line 1849 of file GaudiHistos.h.

1850 {
1851 return book1D( title, low, high, bins );
1852 }
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7

## ◆ book() [2/4]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::book | ( | const Gaudi::Histo1DDef & | hdef | ) | const

book the 1D histogram

The histogram will be assigned a unique identifier

See also
  AIDA::IHistogram1D

Parameters

  hdef | histogram description/definition

Returns
  pointer to AIDA 1D histogram

Definition at line 137 of file GaudiHistos_1DFixedBinning.icpp.

137 {
138 return book1D( hdef.title(), hdef.lowEdge(), hdef.highEdge(), hdef.bins() );
139 }
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition: HistoDef.h:59
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition: HistoDef.h:57
Gaudi::Histo1DDef::highEdge
double highEdge() const
get the high edge
Definition: HistoDef.h:55
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition: HistoDef.h:53

## ◆ book() [3/4]

template<class PBASE>

AIDA::IHistogram1D* GaudiHistos< PBASE >::book | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | low = `0`,
|  | const double | high = `100`,
|  | const unsigned long | bins = `100`
| ) |  | const
| inline

book the 1D histogram with forced ID

Wrapper method for the equivalent book1D method. Retained for backwards compatibility, please use book1D instead.

See also
  IHistogram1D

Parameters

  ID | unique histogram ID
  title | histogram title (must be unique within the algorithm)
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins

Returns
  pointer to AIDA histogram

Definition at line 1890 of file GaudiHistos.h.

1891 {
1892 return book1D( ID, title, low, high, bins );
1893 }
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7

## ◆ book() [4/4]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::book | ( | const HistoID & | ID,
|  | const Gaudi::Histo1DDef & | hdef
| ) |  | const
| inline

book the 1D histogram with forced ID

See also
  IHistogram1D

Parameters

  ID | unique histogram ID
  hdef | histogram descriptor

Returns
  pointer to AIDA histogram

Definition at line 144 of file GaudiHistos_1DFixedBinning.icpp.

144 {
145 return book1D( ID, hdef.title(), hdef.lowEdge(), hdef.highEdge(), hdef.bins() );
146 }
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition: HistoDef.h:59
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition: HistoDef.h:57
Gaudi::Histo1DDef::highEdge
double highEdge() const
get the high edge
Definition: HistoDef.h:55
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition: HistoDef.h:53

## ◆ book1D() [1/4]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::book1D | ( | const std::string & | title,
|  | const double | low = `0`,
|  | const double | high = `100`,
|  | const unsigned long | bins = `100`
| ) |  | const

book the 1D histogram

The histogram will be assigned a unique identifier

See also
  AIDA::IHistogram1D

Parameters

  title | histogram title (must be unique within the algorithm)
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins

Returns
  pointer to AIDA 1D histogram

Definition at line 7 of file GaudiHistos_1DFixedBinning.icpp.

8 {
9 //
10 if ( !produceHistos() ) { return nullptr; } // RETURN
11 //
12 // exist?
13 auto hist = histo1D( title );
14 // histogram is already booked
15 if ( hist ) { return hist; } // RETURN !!
16
17 // propose the histogram ID
18 HistoID ID;
19 newHistoID( title, ID );
20
21 // Create a new histogram and return
22 return this->book1D( ID, title, low, high, bins );
23 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:329
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book1D() [2/4]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::book1D | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | low = `0`,
|  | const double | high = `100`,
|  | const unsigned long | bins = `100`
| ) |  | const

book the 1D histogram with forced ID

See also
  IHistogram1D

Parameters

  ID | unique histogram ID
  title | histogram title (must be unique within the algorithm)
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins

Returns
  pointer to AIDA histogram

Definition at line 28 of file GaudiHistos_1DFixedBinning.icpp.

29 {
30 //
31 if ( !produceHistos() ) { return nullptr; } // RETURN
32 //
33
34 // Check ID
35 if ( ID.undefined() ) {
36 this->Error( "Undefined Histogram ID : Title='" + title + "'" ).ignore();
37 return nullptr;
38 }
39
40 // exist?
41 auto* hist = histo1D( ID );
42 // histogram is already booked
43 if ( hist ) { return hist; } // RETURN !!
44
45 // Histogram title
46 const std::string& htitle = ( title.empty() ? "Unnamed 1D Histogram ID=" + ID.idAsString() : title );
47
48 // book the histogram
49 if ( ID.numeric() ) {
50 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, bins, low, high );
51 } else if ( ID.literal() ) {
52 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, bins, low, high );
53 }
54
55 // check OK
56 if ( !hist ) {
57 this->Error( "IHistogram1D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" ).ignore();
58 return nullptr;
59 } // RETURN !!
60
61 // add histogram into histogram storages
62 m_histo1DMapID[ID] = hist;
63 m_histo1DMapTitle[title] = hist;
64
65 // Declare to monitoring service
66 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
67
68 // Printout and return
69 if ( this->msgLevel( MSG::DEBUG ) ) {
70 this->debug() << "Booked 1D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
71 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
72 }
73 return hist;
74 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
std::string::empty
T empty(T... args)
GaudiHistos::m_histo1DMapID
Histo1DMapID m_histo1DMapID
the actual storage/access of 1D histograms by unique ID
Definition: GaudiHistos.h:2780
MSG::DEBUG
Definition: IMessageSvc.h:15
std::string
STL class.
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:273
GaudiHistos::m_histo1DMapTitle
Histo1DMapTitle m_histo1DMapTitle
the actual storage/access of 1D histograms by unique title
Definition: GaudiHistos.h:2778
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:155
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book1D() [3/4]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::book1D | ( | const std::string & | title,
|  | const HistoBinEdges & | edges
| ) |  | const

book the 1D variable binning histogram

The histogram will be assigned a unique identifier

See also
  AIDA::IHistogram1D

Parameters

  title | histogram title (must be unique within the algorithm)
  edges | The histogram bin edges

Returns
  pointer to AIDA 1D histogram

Definition at line 7 of file GaudiHistos_1DVariableBinning.icpp.

7 {
8 //
9 if ( !produceHistos() ) { return nullptr; } // RETURN
10 //
11 // exist?
12 auto hist = histo1D( title );
13 // histogram is already booked
14 if ( hist ) { return hist; } // RETURN !!
15
16 // propose the histogram ID
17 HistoID ID;
18 newHistoID( title, ID );
19
20 // Create a new histogram and return
21 return this->book1D( ID, title, edges );
22 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:329
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book1D() [4/4]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::book1D | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const HistoBinEdges & | edges
| ) |  | const

book the 1D variable binning histogram with given ID

See also
  AIDA::IHistogram1D

Parameters

  ID | unique histogram ID
  title | histogram title (must be unique within the algorithm)
  edges | The histogram bin edges

Returns
  pointer to AIDA 1D histogram

Definition at line 27 of file GaudiHistos_1DVariableBinning.icpp.

28 {
29 //
30 if ( !produceHistos() ) { return nullptr; } // RETURN
31 //
32 // Check ID
33 if ( ID.undefined() ) {
34 this->Error( "Undefined Histogram ID : Title='" + title + "'" ).ignore();
35 return nullptr;
36 }
37
38 // exist?
39 auto hist = histo1D( ID );
40 // histogram is already booked
41 if ( hist ) { return hist; } // RETURN !!
42
43 // Histogram title
44 const std::string& htitle = ( title.empty() ? "Unnamed 1D Histogram ID=" + ID.idAsString() : title );
45
46 // book the histogram
47 if ( ID.numeric() ) {
48 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, edges );
49 } else if ( ID.literal() ) {
50 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, edges );
51 }
52
53 // check OK
54 if ( !hist ) {
55 this->Error( "IHistogram1D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" ).ignore();
56 return nullptr;
57 } // RETURN !!
58
59 // add histogram into histogram storages
60 m_histo1DMapID[ID] = hist;
61 m_histo1DMapTitle[title] = hist;
62
63 // Declare to monitoring service
64 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
65
66 // Printout and return
67 if ( this->msgLevel( MSG::DEBUG ) ) {
68 this->debug() << "Booked 1D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
69 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
70 }
71 return hist;
72 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
std::string::empty
T empty(T... args)
GaudiHistos::m_histo1DMapID
Histo1DMapID m_histo1DMapID
the actual storage/access of 1D histograms by unique ID
Definition: GaudiHistos.h:2780
MSG::DEBUG
Definition: IMessageSvc.h:15
std::string
STL class.
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:273
GaudiHistos::m_histo1DMapTitle
Histo1DMapTitle m_histo1DMapTitle
the actual storage/access of 1D histograms by unique title
Definition: GaudiHistos.h:2778
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:155
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book2D() [1/4]

template<class PBASE >

AIDA::IHistogram2D * GaudiHistos< PBASE >::book2D | ( | const std::string & | title,
|  | const double | lowX = `0`,
|  | const double | highX = `100`,
|  | const unsigned long | binsX = `50`,
|  | const double | lowY = `0`,
|  | const double | highY = `100`,
|  | const unsigned long | binsY = `50`
| ) |  | const

book the 2D histogram

The histogram will be assigned a unique identifier

See also
  IHistogram2D

Parameters

  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  binsX | number of bins in x
  lowY | low y limit for histogram
  highY | high y limit for histogram
  binsY | number of bins in y

Returns
  pointer to AIDA 2D histogram

Definition at line 7 of file GaudiHistos_2DFixedBinning.icpp.

9 {
10 //
11 if ( !produceHistos() ) { return nullptr; } // RETURN
12 //
13 // exist?
14 auto hist = histo2D( title );
15 // histogram is already booked
16 if ( hist ) { return hist; } // RETURN !!
17
18 // propose the histogram ID
19 HistoID ID;
20 newHistoID( title, ID );
21
22 // Create a new histogram and return
23 return this->book2D( ID, title, lowX, highX, binsX, lowY, highY, binsY );
24 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:329
GaudiHistos::book2D
AIDA::IHistogram2D * book2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D histogram
Definition: GaudiHistos_2DFixedBinning.icpp:7
GaudiHistos::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book2D() [2/4]

template<class PBASE >

AIDA::IHistogram2D * GaudiHistos< PBASE >::book2D | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | lowX = `0`,
|  | const double | highX = `100`,
|  | const unsigned long | binsX = `50`,
|  | const double | lowY = `0`,
|  | const double | highY = `100`,
|  | const unsigned long | binsY = `50`
| ) |  | const

book the 2D histogram with forced ID

See also
  IHistogram2D

Parameters

  ID | unique histogram ID
  title | histogram title (must be unique within the algorithm)
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins

Returns
  pointer to AIDA histogram

Definition at line 29 of file GaudiHistos_2DFixedBinning.icpp.

31 {
32 //
33 if ( !produceHistos() ) { return nullptr; } // RETURN
34 //
35 // Check ID
36 if ( ID.undefined() ) {
37 this->Error( "Undefined Histogram ID : Title='" + title + "'" ).ignore();
38 return nullptr;
39 }
40
41 // exist?
42 auto hist = histo2D( ID );
43 // histogram is already booked
44 if ( hist ) { return hist; } // RETURN !!
45
46 // Histogram title
47 const std::string& htitle = ( title.empty() ? "Unnamed 2D Histogram ID=" + ID.idAsString() : title );
48
49 // book the histogram
50 if ( ID.numeric() ) {
51 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, binsX, lowX, highX, binsY, lowY, highY );
52 } else if ( ID.literal() ) {
53 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, binsX, lowX, highX, binsY, lowY, highY );
54 }
55
56 // Check OK
57 if ( !hist ) {
58 this->Error( "IHistogram2D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" ).ignore();
59 return nullptr;
60 } // RETURN !!
61
62 // add histogram into histogram storages
63 m_histo2DMapID[ID] = hist;
64 m_histo2DMapTitle[title] = hist;
65
66 // Declare to monitoring service
67 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
68
69 // Printout and return
70 if ( this->msgLevel( MSG::DEBUG ) ) {
71 this->debug() << "Booked 2D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
72 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
73 }
74 // return
75 return hist;
76 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
std::string::empty
T empty(T... args)
MSG::DEBUG
Definition: IMessageSvc.h:15
GaudiHistos::m_histo2DMapTitle
Histo2DMapTitle m_histo2DMapTitle
the actual storage/access of 2D histograms by unique title
Definition: GaudiHistos.h:2783
std::string
STL class.
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:273
GaudiHistos::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
GaudiHistos::m_histo2DMapID
Histo2DMapID m_histo2DMapID
the actual storage/access of 2D histograms by unique ID
Definition: GaudiHistos.h:2785
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:155
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book2D() [3/4]

template<class PBASE >

AIDA::IHistogram2D * GaudiHistos< PBASE >::book2D | ( | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY
| ) |  | const

book the 2D variable binning histogram

The histogram will be assigned a unique identifier

See also
  AIDA::IHistogram2D

Parameters

  title | histogram title (must be unique within the algorithm)
  edgesX | The histogram x bin edges
  edgesY | The histogram y bin edges

Returns
  pointer to AIDA 2D histogram

Definition at line 7 of file GaudiHistos_2DVariableBinning.icpp.

8 {
9 //
10 if ( !produceHistos() ) { return nullptr; } // RETURN
11 //
12 // exist?
13 auto hist = histo2D( title );
14 // histogram is already booked
15 if ( hist ) { return hist; } // RETURN !!
16
17 // propose the histogram ID
18 HistoID ID;
19 newHistoID( title, ID );
20
21 // Create a new histogram and return
22 return this->book2D( ID, title, edgesX, edgesY );
23 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:329
GaudiHistos::book2D
AIDA::IHistogram2D * book2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D histogram
Definition: GaudiHistos_2DFixedBinning.icpp:7
GaudiHistos::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book2D() [4/4]

template<class PBASE >

AIDA::IHistogram2D * GaudiHistos< PBASE >::book2D | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY
| ) |  | const

book the 2D variable binning histogram with given ID

See also
  AIDA::IHistogram2D

Parameters

  ID | unique histogram ID
  title | histogram title (must be unique within the algorithm)
  edgesX | The histogram x bin edges
  edgesY | The histogram y bin edges

Returns
  pointer to AIDA 2D histogram

Definition at line 28 of file GaudiHistos_2DVariableBinning.icpp.

29 {
30 //
31 if ( !produceHistos() ) { return nullptr; } // RETURN
32 //
33 // Check ID
34 if ( ID.undefined() ) {
35 this->Error( "Undefined Histogram ID : Title='" + title + "'" ).ignore();
36 return nullptr;
37 }
38
39 // exist?
40 auto hist = histo2D( ID );
41 // histogram is already booked
42 if ( hist ) { return hist; } // RETURN !!
43
44 // Histogram title
45 const std::string& htitle = ( title.empty() ? "Unnamed 2D Histogram ID=" + ID.idAsString() : title );
46
47 // book the histogram
48 if ( ID.numeric() ) {
49 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, edgesX, edgesY );
50 } else if ( ID.literal() ) {
51 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, edgesX, edgesY );
52 }
53
54 // check OK
55 if ( !hist ) {
56 this->Error( "IHistogram2D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" ).ignore();
57 return nullptr;
58 } // RETURN !!
59
60 // add histogram into histogram storages
61 m_histo2DMapID[ID] = hist;
62 m_histo2DMapTitle[title] = hist;
63
64 // Declare to monitoring service
65 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
66
67 // Printout and return
68 if ( this->msgLevel( MSG::DEBUG ) ) {
69 this->debug() << "Booked 2D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
70 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
71 }
72 return hist;
73 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
std::string::empty
T empty(T... args)
MSG::DEBUG
Definition: IMessageSvc.h:15
GaudiHistos::m_histo2DMapTitle
Histo2DMapTitle m_histo2DMapTitle
the actual storage/access of 2D histograms by unique title
Definition: GaudiHistos.h:2783
std::string
STL class.
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:273
GaudiHistos::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
GaudiHistos::m_histo2DMapID
Histo2DMapID m_histo2DMapID
the actual storage/access of 2D histograms by unique ID
Definition: GaudiHistos.h:2785
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:155
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book3D() [1/4]

template<class PBASE >

AIDA::IHistogram3D * GaudiHistos< PBASE >::book3D | ( | const std::string & | title,
|  | const double | lowX = `0`,
|  | const double | highX = `100`,
|  | const unsigned long | binsX = `10`,
|  | const double | lowY = `0`,
|  | const double | highY = `100`,
|  | const unsigned long | binsY = `10`,
|  | const double | lowZ = `0`,
|  | const double | highZ = `100`,
|  | const unsigned long | binsZ = `10`
| ) |  | const

book the 3D histogram

The histogram will be assigned a unique identifier

See also
  IHistogram3D

Parameters

  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  binsX | number of bins in x
  lowY | low y limit for histogram
  highY | high y limit for histogram
  binsY | number of bins in y
  lowZ | low y limit for histogram
  highZ | high y limit for histogram
  binsZ | number of bins in y

Returns
  pointer to AIDA 3D histogram

Definition at line 7 of file GaudiHistos_3DFixedBinning.icpp.

10 {
11 //
12 if ( !produceHistos() ) { return nullptr; } // RETURN
13 //
14 // exist?
15 auto hist = histo3D( title );
16 // histogram is already booked
17 if ( hist ) { return hist; } // RETURN !!
18
19 // propose the histogram ID
20 HistoID ID;
21 newHistoID( title, ID );
22
23 // Create a new histogram and return
24 return this->book3D( ID, title, lowX, highX, binsX, lowY, highY, binsY, lowZ, highZ, binsZ );
25 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:329
GaudiHistos::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295
GaudiHistos::book3D
AIDA::IHistogram3D * book3D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const
book the 3D histogram
Definition: GaudiHistos_3DFixedBinning.icpp:7
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book3D() [2/4]

template<class PBASE >

AIDA::IHistogram3D * GaudiHistos< PBASE >::book3D | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | lowX = `0`,
|  | const double | highX = `100`,
|  | const unsigned long | binsX = `10`,
|  | const double | lowY = `0`,
|  | const double | highY = `100`,
|  | const unsigned long | binsY = `10`,
|  | const double | lowZ = `0`,
|  | const double | highZ = `100`,
|  | const unsigned long | binsZ = `10`
| ) |  | const

book the 3D histogram with forced ID

See also
  IHistogram3D

Parameters

  ID | unique histogram ID
  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  binsX | number of bins in x
  lowY | low y limit for histogram
  highY | high y limit for histogram
  binsY | number of bins in y
  lowZ | low y limit for histogram
  highZ | high y limit for histogram
  binsZ | number of bins in y

Returns
  pointer to AIDA 3D histogram

Definition at line 30 of file GaudiHistos_3DFixedBinning.icpp.

33 {
34 //
35 if ( !produceHistos() ) { return nullptr; } // RETURN
36 //
37 // Check ID
38 if ( ID.undefined() ) {
39 this->Error( "Undefined Histogram ID : Title='" + title + "'" ).ignore();
40 return nullptr;
41 }
42
43 // exist?
44 auto hist = histo3D( ID );
45 // histogram is already booked
46 if ( hist ) { return hist; } // RETURN !!
47
48 // Histogram title
49 const std::string& htitle = ( title.empty() ? "Unnamed 3D Histogram ID=" + ID.idAsString() : title );
50
51 // book the histogram
52 if ( ID.numeric() ) {
53 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, binsX, lowX, highX, binsY, lowY, highY, binsZ,
54 lowZ, highZ );
55 } else if ( ID.literal() ) {
56 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, binsX, lowX, highX, binsY, lowY, highY,
57 binsZ, lowZ, highZ );
58 }
59
60 // Check OK
61 if ( !hist ) {
62 this->Error( "IHistogram3D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" ).ignore();
63 return nullptr;
64 } // RETURN !!
65
66 // add histogram into histogram storages
67 m_histo3DMapID[ID] = hist;
68 m_histo3DMapTitle[title] = hist;
69
70 // Declare to monitoring service
71 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
72
73 // Printout and return
74 if ( this->msgLevel( MSG::DEBUG ) ) {
75 this->debug() << "Booked 3D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
76 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
77 }
78 return hist;
79 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
std::string::empty
T empty(T... args)
MSG::DEBUG
Definition: IMessageSvc.h:15
GaudiHistos::m_histo3DMapTitle
Histo3DMapTitle m_histo3DMapTitle
the actual storage/access of 3D histograms by unique title
Definition: GaudiHistos.h:2788
std::string
STL class.
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:273
GaudiHistos::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295
GaudiHistos::m_histo3DMapID
Histo3DMapID m_histo3DMapID
the actual storage/access of 3D histograms by unique ID
Definition: GaudiHistos.h:2790
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:155
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book3D() [3/4]

template<class PBASE >

AIDA::IHistogram3D * GaudiHistos< PBASE >::book3D | ( | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY,
|  | const HistoBinEdges & | edgesZ
| ) |  | const

book the 3D variable binning histogram

The histogram will be assigned a unique identifier

See also
  AIDA::IHistogram3D

Parameters

  title | histogram title (must be unique within the algorithm)
  edgesX | The histogram x bin edges
  edgesY | The histogram y bin edges
  edgesZ | The histogram z bin edges

Returns
  pointer to AIDA 3D histogram

Definition at line 7 of file GaudiHistos_3DVariableBinning.icpp.

8 {
9 //
10 if ( !produceHistos() ) { return nullptr; } // RETURN
11 //
12 // exist?
13 auto hist = histo3D( title );
14 // histogram is already booked
15 if ( hist ) { return hist; } // RETURN !!
16
17 // propose the histogram ID
18 HistoID ID;
19 newHistoID( title, ID );
20
21 // Create a new histogram and return
22 return this->book3D( ID, title, edgesX, edgesY, edgesZ );
23 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:329
GaudiHistos::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295
GaudiHistos::book3D
AIDA::IHistogram3D * book3D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const
book the 3D histogram
Definition: GaudiHistos_3DFixedBinning.icpp:7
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ book3D() [4/4]

template<class PBASE >

AIDA::IHistogram3D * GaudiHistos< PBASE >::book3D | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY,
|  | const HistoBinEdges & | edgesZ
| ) |  | const

book the 3D variable binning histogram with given ID

See also
  AIDA::IHistogram3D

Parameters

  ID | unique histogram ID
  title | histogram title (must be unique within the algorithm)
  edgesX | The histogram x bin edges
  edgesY | The histogram y bin edges
  edgesZ | The histogram z bin edges

Returns
  pointer to AIDA 3D histogram

Definition at line 28 of file GaudiHistos_3DVariableBinning.icpp.

30 {
31 //
32 if ( !produceHistos() ) { return nullptr; } // RETURN
33 //
34 // Check ID
35 if ( ID.undefined() ) {
36 this->Error( "Undefined Histogram ID : Title='" + title + "'" ).ignore();
37 return nullptr;
38 }
39
40 // exist?
41 auto hist = histo3D( ID );
42 // histogram is already booked
43 if ( hist ) { return hist; } // RETURN !!
44
45 // Histogram title
46 const std::string& htitle = ( title.empty() ? "Unnamed 3D Histogram ID=" + ID.idAsString() : title );
47
48 // book the histogram
49 if ( ID.numeric() ) {
50 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, edgesX, edgesY, edgesZ );
51 } else if ( ID.literal() ) {
52 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, edgesX, edgesY, edgesZ );
53 }
54
55 // check OK
56 if ( !hist ) {
57 this->Error( "IHistogram3D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" ).ignore();
58 return nullptr;
59 } // RETURN !!
60
61 // add histogram into histogram storages
62 m_histo3DMapID[ID] = hist;
63 m_histo3DMapTitle[title] = hist;
64
65 // Declare to monitoring service
66 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
67
68 // Printout and return
69 if ( this->msgLevel( MSG::DEBUG ) ) {
70 this->debug() << "Booked 3D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
71 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
72 }
73 return hist;
74 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
std::string::empty
T empty(T... args)
MSG::DEBUG
Definition: IMessageSvc.h:15
GaudiHistos::m_histo3DMapTitle
Histo3DMapTitle m_histo3DMapTitle
the actual storage/access of 3D histograms by unique title
Definition: GaudiHistos.h:2788
std::string
STL class.
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:273
GaudiHistos::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295
GaudiHistos::m_histo3DMapID
Histo3DMapID m_histo3DMapID
the actual storage/access of 3D histograms by unique ID
Definition: GaudiHistos.h:2790
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:155
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ bookProfile1D() [1/4]

template<class PBASE >

AIDA::IProfile1D * GaudiHistos< PBASE >::bookProfile1D | ( | const std::string & | title,
|  | const double | low = `0`,
|  | const double | high = `100`,
|  | const unsigned long | bins = `100`,
|  | const std::string & | opt = `""`,
|  | const double | lowY = `-std::numeric_limits<double>::max()`,
|  | const double | highY = `std::numeric_limits<double>::max()`
| ) |  | const

book the 1D profile histogram

The histogram will be assigned a unique identifier

See also
  IHistogram1D

Parameters

  title | histogram title (must be unique within the algorithm)
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins
  opt | the options, used for evaluation of errors
  lowY | the min cut-off for y-values
  highY | the max cut-off for y-values

Returns
  pointer to AIDA 1D profile histogram

Definition at line 5 of file GaudiHistos_1DProfFixedBinning.icpp.

7 {
8 //
9 if ( !produceHistos() ) { return nullptr; } // RETURN
10 //
11 // exist?
12 auto hist = profile1D( title );
13 // histogram is already booked
14 if ( hist ) { return hist; } // RETURN !!
15
16 // propose the histogram ID
17 HistoID ID;
18 newHistoID( title, ID );
19
20 // Book the histo and return
21 return this->bookProfile1D( ID, title, low, high, bins, opt, lowY, highY );
22 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:329
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:104
GaudiHistos::bookProfile1D
AIDA::IProfile1D * bookProfile1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max()) const
book the 1D profile histogram
Definition: GaudiHistos_1DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ bookProfile1D() [2/4]

template<class PBASE >

AIDA::IProfile1D * GaudiHistos< PBASE >::bookProfile1D | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | low = `0`,
|  | const double | high = `100`,
|  | const unsigned long | bins = `100`,
|  | const std::string & | opt = `""`,
|  | const double | lowY = `-std::numeric_limits<double>::max()`,
|  | const double | highY = `std::numeric_limits<double>::max()`
| ) |  | const

book the 1D profile histogram

The histogram will be assigned a unique identifier

See also
  IHistogram1D

Parameters

  title | histogram title (must be unique within the algorithm)
  edges | The histogram bin edges
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins
  opt | the options, used for evaluation of errors
  lowY | the min cut-off for y-values
  highY | the max cut-off for y-values

Returns
  pointer to AIDA 1D profile histogram

Definition at line 27 of file GaudiHistos_1DProfFixedBinning.icpp.

30 {
31 //
32 if ( !produceHistos() ) { return nullptr; } // RETURN
33 //
34 // Check ID
35 if ( ID.undefined() ) {
36 this->Error( "Undefined Histogram ID : Title='" + title + "'" ).ignore();
37 return nullptr;
38 }
39
40 // exist?
41 auto hist = profile1D( ID );
42 // histogram is already booked
43 if ( hist ) { return hist; } // RETURN !!
44
45 // Histogram title
46 const std::string& htitle = ( title.empty() ? "Unnamed 1D Profile Histogram ID=" + ID.idAsString() : title );
47
48 // book the histogram
49 if ( ID.numeric() ) {
50 hist = this->histoSvc()->bookProf( histoPath(), ID.numericID(), htitle, bins, low, high, lowY, highY, opt );
51 } else if ( ID.literal() ) {
52 hist = this->histoSvc()->bookProf( histoPath() + "/" + ID.literalID(), htitle, bins, low, high, lowY, highY, opt );
53 }
54
55 // test ok
56 if ( !hist ) {
57 this->Error( "IProfile1D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" ).ignore();
58 return nullptr;
59 } // RETURN !!
60
61 // add histogram into histogram storages
62 m_profile1DMapID[ID] = hist;
63 m_profile1DMapTitle[title] = hist;
64
65 // Declare to monitoring service
66 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
67
68 // printout and return
69 if ( this->msgLevel( MSG::DEBUG ) ) {
70 this->debug() << "Booked 1D Profile Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
71 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
72 }
73 return hist;
74 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
std::string::empty
T empty(T... args)
GaudiHistos::m_profile1DMapID
Profile1DMapID m_profile1DMapID
the actual storage/access of 1D profile histograms by unique ID
Definition: GaudiHistos.h:2795
MSG::DEBUG
Definition: IMessageSvc.h:15
std::string
STL class.
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::m_profile1DMapTitle
Profile1DMapTitle m_profile1DMapTitle
the actual storage/access of 1D profile histograms by unique title
Definition: GaudiHistos.h:2793
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:273
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:104
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:155
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ bookProfile1D() [3/4]

template<class PBASE >

AIDA::IProfile1D * GaudiHistos< PBASE >::bookProfile1D | ( | const std::string & | title,
|  | const HistoBinEdges & | edges
| ) |  | const

book the 1D profile histogram

The histogram will be assigned a unique identifier

See also
  IHistogram1D

Parameters

  title | histogram title (must be unique within the algorithm)
  edges | The histogram bin edges

Returns
  pointer to AIDA 1D profile histogram

Definition at line 5 of file GaudiHistos_1DProfVariableBinning.icpp.

5 {
6 //
7 if ( !produceHistos() ) { return nullptr; } // RETURN
8 //
9 // exist?
10 auto hist = profile1D( title );
11 // histogram is already booked
12 if ( hist ) { return hist; } // RETURN !!
13
14 // propose the histogram ID
15 HistoID ID;
16 newHistoID( title, ID );
17
18 // Book the histo and return
19 return this->bookProfile1D( ID, title, edges );
20 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:329
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:104
GaudiHistos::bookProfile1D
AIDA::IProfile1D * bookProfile1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max()) const
book the 1D profile histogram
Definition: GaudiHistos_1DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ bookProfile1D() [4/4]

template<class PBASE >

AIDA::IProfile1D * GaudiHistos< PBASE >::bookProfile1D | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const HistoBinEdges & | edges
| ) |  | const

book the 1D profile histogram

The histogram will be assigned a unique identifier

See also
  IHistogram1D

Parameters

  title | histogram title (must be unique within the algorithm)
  edges | The histogram bin edges

Returns
  pointer to AIDA 1D profile histogram

Definition at line 25 of file GaudiHistos_1DProfVariableBinning.icpp.

26 {
27 //
28 if ( !produceHistos() ) { return nullptr; } // RETURN
29 //
30 // Check ID
31 if ( ID.undefined() ) {
32 this->Error( "Undefined Histogram ID : Title='" + title + "'" ).ignore();
33 return nullptr;
34 }
35
36 // exist?
37 auto hist = profile1D( ID );
38 // histogram is already booked
39 if ( hist ) { return hist; } // RETURN !!
40
41 // Histogram title
42 const std::string& htitle = ( title.empty() ? "Unnamed 1D Profile Histogram ID=" + ID.idAsString() : title );
43
44 // book the histogram
45 if ( ID.numeric() ) {
46 hist = this->histoSvc()->bookProf( histoPath(), ID.numericID(), htitle, edges );
47 } else if ( ID.literal() ) {
48 hist = this->histoSvc()->bookProf( histoPath() + "/" + ID.literalID(), htitle, edges );
49 }
50
51 // test ok
52 if ( !hist ) {
53 this->Error( "IProfile1D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" ).ignore();
54 return nullptr;
55 } // RETURN !!
56
57 // add histogram into histogram storages
58 m_profile1DMapID[ID] = hist;
59 m_profile1DMapTitle[title] = hist;
60
61 // Declare to monitoring service
62 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
63
64 // printout and return
65 if ( this->msgLevel( MSG::DEBUG ) ) {
66 this->debug() << "Booked 1D Profile Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
67 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
68 }
69 return hist;
70 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
std::string::empty
T empty(T... args)
GaudiHistos::m_profile1DMapID
Profile1DMapID m_profile1DMapID
the actual storage/access of 1D profile histograms by unique ID
Definition: GaudiHistos.h:2795
MSG::DEBUG
Definition: IMessageSvc.h:15
std::string
STL class.
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::m_profile1DMapTitle
Profile1DMapTitle m_profile1DMapTitle
the actual storage/access of 1D profile histograms by unique title
Definition: GaudiHistos.h:2793
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:273
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:104
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:155
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ bookProfile2D() [1/4]

template<class PBASE >

AIDA::IProfile2D * GaudiHistos< PBASE >::bookProfile2D | ( | const std::string & | title,
|  | const double | lowX = `0`,
|  | const double | highX = `100`,
|  | const unsigned long | binsX = `50`,
|  | const double | lowY = `0`,
|  | const double | highY = `100`,
|  | const unsigned long | binsY = `50`
| ) |  | const

book the 2D profile histogram

The histogram will be assigned a unique identifier

See also
  AIDA::IProfile2D

Parameters

  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  binsX | number of bins in x
  lowY | low y limit for histogram
  highY | high y limit for histogram
  binsY | number of bins in y

Returns
  pointer to AIDA 2D histogram

Definition at line 5 of file GaudiHistos_2DProfFixedBinning.icpp.

7 {
8 //
9 if ( !produceHistos() ) { return 0; } // RETURN
10 //
11 // exist?
12 auto hist = profile2D( title );
13 // histogram is already booked
14 if ( 0 != hist ) { return hist; } // RETURN !!
15
16 // propose the histogram ID
17 HistoID ID;
18 newHistoID( title, ID );
19
20 // book histogram and return
21 return this->bookProfile2D( ID, title, lowX, highX, binsX, lowY, highY, binsY );
22 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:329
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:103
GaudiHistos::bookProfile2D
AIDA::IProfile2D * bookProfile2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D profile histogram
Definition: GaudiHistos_2DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ bookProfile2D() [2/4]

template<class PBASE >

AIDA::IProfile2D * GaudiHistos< PBASE >::bookProfile2D | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | lowX = `0`,
|  | const double | highX = `100`,
|  | const unsigned long | binsX = `50`,
|  | const double | lowY = `0`,
|  | const double | highY = `100`,
|  | const unsigned long | binsY = `50`
| ) |  | const

book the 2D profile histogram with forced ID

See also
  AIDA::IProfile2D

Parameters

  ID | unique histogram ID
  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  binsX | number of bins in x
  lowY | low y limit for histogram
  highY | high y limit for histogram
  binsY | number of bins in y

Returns
  pointer to AIDA histogram

Definition at line 27 of file GaudiHistos_2DProfFixedBinning.icpp.

29 {
30 //
31 if ( !produceHistos() ) { return 0; } // RETURN
32 //
33 // Check ID
34 if ( ID.undefined() ) {
35 this->Error( "Undefined Histogram ID : Title='" + title + "'" ).ignore();
36 return nullptr;
37 }
38 // exist?
39 auto hist = profile2D( ID );
40 // histogram is already booked
41 if ( 0 != hist ) { return hist; } // RETURN !!
42
43 // Histogram title
44 const std::string& htitle = ( title.empty() ? "Unnamed 2D Profile Histogram ID=" + ID.idAsString() : title );
45
46 // book the histogram
47 if ( ID.numeric() ) {
48 hist = this->histoSvc()->bookProf( histoPath(), ID.numericID(), htitle, binsX, lowX, highX, binsY, lowY, highY );
49 } else if ( ID.literal() ) {
50 hist = this->histoSvc()->bookProf( histoPath() + "/" + ID.literalID(), htitle, binsX, lowX, highX, binsY, lowY,
51 highY );
52 }
53
54 // test OK
55 if ( 0 == hist ) {
56 this->Error( "IProfile2D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" ).ignore();
57 return 0;
58 } // RETURN !!
59
60 // add histogram into histogram storages
61 m_profile2DMapID[ID] = hist;
62 m_profile2DMapTitle[title] = hist;
63
64 // Declare to monitoring service
65 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
66
67 // printout and return
68 if ( this->msgLevel( MSG::DEBUG ) ) {
69 this->debug() << "Booked 2D Profile Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
70 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
71 }
72 return hist;
73 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
std::string::empty
T empty(T... args)
MSG::DEBUG
Definition: IMessageSvc.h:15
std::string
STL class.
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:273
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:103
GaudiHistos::m_profile2DMapID
Profile2DMapID m_profile2DMapID
the actual storage/access of 2D profile histograms by unique ID
Definition: GaudiHistos.h:2800
GaudiHistos::m_profile2DMapTitle
Profile2DMapTitle m_profile2DMapTitle
the actual storage/access of 2D profile histograms by unique title
Definition: GaudiHistos.h:2798
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:155
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ bookProfile2D() [3/4]

template<class PBASE >

AIDA::IProfile2D * GaudiHistos< PBASE >::bookProfile2D | ( | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY
| ) |  | const

book the 2D profile histogram

The histogram will be assigned a unique identifier

See also
  AIDA::IProfile2D

Parameters

  title | histogram title (must be unique within the algorithm)
  edgesX | x bin edges
  edgesY | y bin edges

Returns
  pointer to AIDA 2D histogram

Definition at line 5 of file GaudiHistos_2DProfVariableBinning.icpp.

6 {
7 //
8 if ( !produceHistos() ) { return 0; } // RETURN
9 //
10 // exist?
11 auto hist = profile2D( title );
12 // histogram is already booked
13 if ( hist ) { return hist; } // RETURN !!
14
15 // propose the histogram ID
16 HistoID ID;
17 newHistoID( title, ID );
18
19 // book histogram and return
20 return this->bookProfile2D( ID, title, edgesX, edgesY );
21 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:329
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:103
GaudiHistos::bookProfile2D
AIDA::IProfile2D * bookProfile2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D profile histogram
Definition: GaudiHistos_2DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ bookProfile2D() [4/4]

template<class PBASE >

AIDA::IProfile2D * GaudiHistos< PBASE >::bookProfile2D | ( | const HistoID & | ID,
|  | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY
| ) |  | const

book the 2D profile histogram with forced ID

See also
  AIDA::IProfile2D

Parameters

  ID | unique histogram ID
  title | histogram title (must be unique within the algorithm)
  edgesX | x bin edges
  edgesY | y bin edges

Returns
  pointer to AIDA histogram

Definition at line 26 of file GaudiHistos_2DProfVariableBinning.icpp.

27 {
28 //
29 if ( !produceHistos() ) { return 0; } // RETURN
30 //
31 // Check ID
32 if ( ID.undefined() ) {
33 this->Error( "Undefined Histogram ID : Title='" + title + "'" ).ignore();
34 return nullptr;
35 }
36 // exist?
37 auto hist = profile2D( ID );
38 // histogram is already booked
39 if ( hist ) { return hist; } // RETURN !!
40
41 // Histogram title
42 const std::string& htitle = ( title.empty() ? "Unnamed 2D Profile Histogram ID=" + ID.idAsString() : title );
43
44 // book the histogram
45 if ( ID.numeric() ) {
46 hist = this->histoSvc()->bookProf( histoPath(), ID.numericID(), htitle, edgesX, edgesY );
47 } else if ( ID.literal() ) {
48 hist = this->histoSvc()->bookProf( histoPath() + "/" + ID.literalID(), htitle, edgesX, edgesY );
49 }
50
51 // test OK
52 if ( !hist ) {
53 this->Error( "IProfile2D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" ).ignore();
54 return nullptr;
55 } // RETURN !!
56
57 // add histogram into histogram storages
58 m_profile2DMapID[ID] = hist;
59 m_profile2DMapTitle[title] = hist;
60
61 // Declare to monitoring service
62 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
63
64 // printout and return
65 if ( this->msgLevel( MSG::DEBUG ) ) {
66 this->debug() << "Booked 2D Profile Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
67 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
68 }
69 return hist;
70 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
std::string::empty
T empty(T... args)
MSG::DEBUG
Definition: IMessageSvc.h:15
std::string
STL class.
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:273
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:103
GaudiHistos::m_profile2DMapID
Profile2DMapID m_profile2DMapID
the actual storage/access of 2D profile histograms by unique ID
Definition: GaudiHistos.h:2800
GaudiHistos::m_profile2DMapTitle
Profile2DMapTitle m_profile2DMapTitle
the actual storage/access of 2D profile histograms by unique title
Definition: GaudiHistos.h:2798
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:155
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ checkForNaN()

template<class PBASE>

bool GaudiHistos< PBASE >::checkForNaN | ( |  | ) | const
| inline

get the flag for NaN checks (property "HistoCheckForNan")

Definition at line 2375 of file GaudiHistos.h.

2375 { return m_checkForNaN; }
GaudiHistos::m_checkForNaN
Gaudi::Property< bool > m_checkForNaN
Definition: GaudiHistos.h:2747

## ◆ convertTitleToID()

template<class PBASE >

std::string GaudiHistos< PBASE >::convertTitleToID | ( | std::string | title | ) | const
| protected

Create an ID string from a title string.

Definition at line 352 of file GaudiHistos.icpp.

352 {
353 // clean up the ID string for all unwanted characters
354 for ( const auto& i : m_idReplaceInfo ) { stringSearchReplace( title, i.first, i.second ); }
355 return title;
356 }
GaudiHistos::m_idReplaceInfo
Gaudi::Property< std::map< std::string, std::string > > m_idReplaceInfo
Definition: GaudiHistos.h:2770

## ◆ fill() [1/5]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::fill | ( | AIDA::IHistogram1D * | histo,
|  | const double | value,
|  | const double | weight,
|  | const std::string & | title = `""`
| ) |  | const

fill the 1D histogram with the value and weight

Parameters

  histo | 1D histogram to be filled
  value | value to be put into the histogram
  weight | weight to be used
  title | histogram title (to be used for error report)

Returns
  pointer to AIDA 1D histogram

Definition at line 79 of file GaudiHistos_1DFixedBinning.icpp.

80 {
81 if ( !histo ) { return nullptr; } // RETURN
82 //
83 if ( !checkForNaN() ) {
84 Gaudi::Utils::Histos::fill( histo, value, weight );
85 } else if ( std::isfinite( value ) && std::isfinite( weight ) ) {
86 Gaudi::Utils::Histos::fill( histo, value, weight );
87 } else if ( std::isnan( value ) || std::isnan( weight ) ) {
88 this->Warning( "fill():: 'NaN' value is skipped from the histogram '" +
89 Gaudi::Utils::Histos::htitle( histo, title ) + "'" )
90 .ignore();
91 } else {
92 this->Warning( "fill():: 'Infinite' value is skipped from the histogram '" +
93 Gaudi::Utils::Histos::htitle( histo, title ) + "'" )
94 .ignore();
95 }
96 // return
97 return histo;
98 }
GaudiHistos::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2282
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
Gaudi::Utils::Histos::fill
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:35
std::isfinite
T isfinite(T... args)
GaudiHistos::checkForNaN
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
Definition: GaudiHistos.h:2375
std::isnan
T isnan(T... args)

## ◆ fill() [2/5]

template<class PBASE >

AIDA::IHistogram2D * GaudiHistos< PBASE >::fill | ( | AIDA::IHistogram2D * | histo,
|  | const double | valueX,
|  | const double | valueY,
|  | const double | weight,
|  | const std::string & | title = `""`
| ) |  | const

fill the 2D histogram with the value and weight

Parameters

  histo | 2D histogram to be filled
  valueX | x value to be put into the histogram
  valueY | y value to be put into the histogram
  weight | weight to be used
  title | histogram title (to be used for error report)

Returns
  pointer to AIDA 2D histogram

Definition at line 81 of file GaudiHistos_2DFixedBinning.icpp.

82 {
83 //
84 if ( !histo ) { return nullptr; } // RETURN
85 //
86 if ( !checkForNaN() ) {
87 Gaudi::Utils::Histos::fill( histo, valueX, valueY, weight );
88 } else if ( std::isfinite( valueX ) && std::isfinite( valueY ) && std::isfinite( weight ) ) {
89 Gaudi::Utils::Histos::fill( histo, valueX, valueY, weight );
90 } else if ( std::isnan( valueX ) || std::isnan( valueY ) || std::isnan( weight ) ) {
91 this->Warning( "fill():: 'NaN' value is skipped from the histogram '" +
92 Gaudi::Utils::Histos::htitle( histo, title ) + "'" )
93 .ignore();
94 } else {
95 this->Warning( "fill():: 'Infinite' value is skipped from the histogram '" +
96 Gaudi::Utils::Histos::htitle( histo, title ) + "'" )
97 .ignore();
98 }
99 // return
100 return histo;
101 }
GaudiHistos::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2282
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
Gaudi::Utils::Histos::fill
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:35
std::isfinite
T isfinite(T... args)
GaudiHistos::checkForNaN
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
Definition: GaudiHistos.h:2375
std::isnan
T isnan(T... args)

## ◆ fill() [3/5]

template<class PBASE >

AIDA::IHistogram3D * GaudiHistos< PBASE >::fill | ( | AIDA::IHistogram3D * | histo,
|  | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const double | weight,
|  | const std::string & | title = `""`
| ) |  | const

fill the 3D histogram with the value and weight

Parameters

  histo | 3D histogram to be filled
  valueX | x value to be put into the histogram
  valueY | y value to be put into the histogram
  valueZ | z value to be put into the histogram
  weight | weight to be used
  title | histogram title (to be used for error report)

Returns
  pointer to AIDA 3D histogram

Definition at line 84 of file GaudiHistos_3DFixedBinning.icpp.

86 {
87 if ( !histo ) { return nullptr; } // RETURN
88 //
89 if ( !checkForNaN() ) {
90 Gaudi::Utils::Histos::fill( histo, valueX, valueY, valueZ, weight );
91 } else if ( std::isfinite( valueX ) && std::isfinite( valueY ) && std::isfinite( valueZ ) &&
92 std::isfinite( weight ) ) {
93 Gaudi::Utils::Histos::fill( histo, valueX, valueY, valueZ, weight );
94 } else if ( std::isnan( valueX ) || std::isnan( valueY ) || std::isnan( valueZ ) || std::isnan( weight ) ) {
95 this->Warning( "fill():: 'NaN' value is skipped from the histogram '" +
96 Gaudi::Utils::Histos::htitle( histo, title ) + "'" )
97 .ignore();
98 } else {
99 this->Warning( "fill():: 'Infinite' value is skipped from the histogram '" +
100 Gaudi::Utils::Histos::htitle( histo, title ) + "'" )
101 .ignore();
102 }
103 // return
104 return histo;
105 }
GaudiHistos::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2282
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
Gaudi::Utils::Histos::fill
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:35
std::isfinite
T isfinite(T... args)
GaudiHistos::checkForNaN
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
Definition: GaudiHistos.h:2375
std::isnan
T isnan(T... args)

## ◆ fill() [4/5]

template<class PBASE >

AIDA::IProfile1D * GaudiHistos< PBASE >::fill | ( | AIDA::IProfile1D * | histo,
|  | const double | valueX,
|  | const double | valueY,
|  | const double | weight,
|  | const std::string & | title = `""`
| ) |  | const

fill the 1D profile histogram with the values and weight

Parameters

  histo | 1D profile histogram to be filled
  valueX | x value to be put into the histogram
  valueY | y value to be put into the histogram
  weight | weight to be used
  title | histogram title (to be used for error report)

Returns
  pointer to AIDA 1D histogram

Definition at line 79 of file GaudiHistos_1DProfFixedBinning.icpp.

80 {
81 //
82 if ( !histo ) { return nullptr; } // RETURN
83 //
84 if ( !checkForNaN() ) {
85 Gaudi::Utils::Histos::fill( histo, valueX, valueY, weight );
86 } else if ( std::isfinite( valueX ) && std::isfinite( valueY ) && std::isfinite( weight ) ) {
87 Gaudi::Utils::Histos::fill( histo, valueX, valueY, weight );
88 } else if ( std::isnan( valueX ) || std::isnan( valueY ) || std::isnan( weight ) ) {
89 this->Warning( "fill():: 'NaN' value is skipped from the histogram '" +
90 Gaudi::Utils::Histos::htitle( histo, title ) + "'" )
91 .ignore();
92 } else {
93 this->Warning( "fill():: 'Infinite' value is skipped from the histogram '" +
94 Gaudi::Utils::Histos::htitle( histo, title ) + "'" )
95 .ignore();
96 }
97 // return
98 return histo;
99 }
GaudiHistos::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2282
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
Gaudi::Utils::Histos::fill
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:35
std::isfinite
T isfinite(T... args)
GaudiHistos::checkForNaN
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
Definition: GaudiHistos.h:2375
std::isnan
T isnan(T... args)

## ◆ fill() [5/5]

template<class PBASE >

AIDA::IProfile2D * GaudiHistos< PBASE >::fill | ( | AIDA::IProfile2D * | histo,
|  | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const double | weight,
|  | const std::string & | title = `""`
| ) |  | const

fill the 2D profile histogram with the values and weight

Parameters

  histo | 2D profile histogram to be filled
  valueX | x value to be put into the histogram
  valueY | y value to be put into the histogram
  valueZ | z value to be put into the histogram
  weight | weight to be used
  title | histogram title (to be used for error report)

Returns
  pointer to AIDA 1D histogram

Definition at line 78 of file GaudiHistos_2DProfFixedBinning.icpp.

79 {
80 if ( 0 == histo ) { return 0; } // RETURN
81 //
82 if ( !checkForNaN() ) {
83 Gaudi::Utils::Histos::fill( histo, valueX, valueY, valueZ, weight );
84 } else if ( std::isfinite( valueX ) && std::isfinite( valueY ) && std::isfinite( valueZ ) &&
85 std::isfinite( weight ) ) {
86 Gaudi::Utils::Histos::fill( histo, valueX, valueY, valueZ, weight );
87 } else if ( std::isnan( valueX ) || std::isnan( valueY ) || std::isnan( valueZ ) || std::isnan( weight ) ) {
88 this->Warning( "fill():: 'NaN' value is skipped from the histogram '" +
89 Gaudi::Utils::Histos::htitle( histo, title ) + "'" )
90 .ignore();
91 } else {
92 this->Warning( "fill():: 'Infinite' value is skipped from the histogram '" +
93 Gaudi::Utils::Histos::htitle( histo, title ) + "'" )
94 .ignore();
95 }
96 // return
97 return histo;
98 }
GaudiHistos::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2282
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
Gaudi::Utils::Histos::fill
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:35
std::isfinite
T isfinite(T... args)
GaudiHistos::checkForNaN
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
Definition: GaudiHistos.h:2375
std::isnan
T isnan(T... args)

## ◆ finalize()

template<class PBASE >

StatusCode GaudiHistos< PBASE >::finalize | ( |  | ) |
| override protected

standard finalization method

Returns
  status code

Definition at line 120 of file GaudiHistos.icpp.

120 {
121
122 if ( produceHistos() ) {
123
124 // Count how many histos of each type
125 if ( ( !noHistos() ) && histoCountersPrint() ) {
126 const unsigned int n1D = histo1DMapID().size();
127 const unsigned int n2D = histo2DMapID().size();
128 const unsigned int n3D = histo3DMapID().size();
129 const unsigned int n1DP = profile1DMapID().size();
130 const unsigned int n2DP = profile2DMapID().size();
131 const unsigned int total = n1D + n2D + n3D + n1DP + n2DP;
132 if ( total > 0 ) {
133 this->always() << "Booked " << total << " Histogram(s) : ";
134 if ( n1D > 0 ) this->always() << "1D=" << n1D << " ";
135 if ( n2D > 0 ) this->always() << "2D=" << n2D << " ";
136 if ( n3D > 0 ) this->always() << "3D=" << n3D << " ";
137 if ( n1DP > 0 ) this->always() << "1DProf=" << n1DP << " ";
138 if ( n2DP > 0 ) this->always() << "2DProf=" << n2DP << " ";
139 this->always() << endmsg;
140 }
141 }
142
143 // detailed printing
144 if ( histosPrint() ) { printHistos(); }
145 }
146
147 // clear all maps
148 m_histo1DMapTitle.clear();
149 m_histo2DMapTitle.clear();
150 m_histo3DMapTitle.clear();
151 m_histo1DMapID.clear();
152 m_histo2DMapID.clear();
153 m_histo3DMapID.clear();
154 m_profile1DMapTitle.clear();
155 m_profile2DMapTitle.clear();
156 m_profile1DMapID.clear();
157 m_profile2DMapID.clear();
158
159 // finalize base class
160 return PBASE::finalize();
161 }
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2548
GaudiHistos::m_profile1DMapID
Profile1DMapID m_profile1DMapID
the actual storage/access of 1D profile histograms by unique ID
Definition: GaudiHistos.h:2795
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2650
GaudiHistos::m_histo1DMapID
Histo1DMapID m_histo1DMapID
the actual storage/access of 1D histograms by unique ID
Definition: GaudiHistos.h:2780
GaudiHistos::m_histo3DMapTitle
Histo3DMapTitle m_histo3DMapTitle
the actual storage/access of 3D histograms by unique title
Definition: GaudiHistos.h:2788
GaudiHistos::m_histo2DMapTitle
Histo2DMapTitle m_histo2DMapTitle
the actual storage/access of 2D histograms by unique title
Definition: GaudiHistos.h:2783
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2600
GaudiHistos::histosPrint
bool histosPrint() const
print histograms at finalization ?
Definition: GaudiHistos.h:2387
GaudiHistos::m_profile1DMapTitle
Profile1DMapTitle m_profile1DMapTitle
the actual storage/access of 1D profile histograms by unique title
Definition: GaudiHistos.h:2793
GaudiHistos::noHistos
bool noHistos() const
Check if all histogram maps are empty.
Definition: GaudiHistos.icpp:264
GaudiHistos::histoCountersPrint
bool histoCountersPrint() const
print histogram counters at finalization ?
Definition: GaudiHistos.h:2389
GaudiHistos::m_profile2DMapID
Profile2DMapID m_profile2DMapID
the actual storage/access of 2D profile histograms by unique ID
Definition: GaudiHistos.h:2800
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:189
GaudiHistos::m_histo1DMapTitle
Histo1DMapTitle m_histo1DMapTitle
the actual storage/access of 1D histograms by unique title
Definition: GaudiHistos.h:2778
GaudiHistos::m_profile2DMapTitle
Profile2DMapTitle m_profile2DMapTitle
the actual storage/access of 2D profile histograms by unique title
Definition: GaudiHistos.h:2798
GaudiHistos::m_histo3DMapID
Histo3DMapID m_histo3DMapID
the actual storage/access of 3D histograms by unique ID
Definition: GaudiHistos.h:2790
GaudiHistos::printHistos
int printHistos(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of histograms
Definition: GaudiHistos.icpp:166
GaudiUtils::Map::clear
void clear()
Definition: Map.h:185
GaudiHistos::m_histo2DMapID
Histo2DMapID m_histo2DMapID
the actual storage/access of 2D histograms by unique ID
Definition: GaudiHistos.h:2785
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2448
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2498

## ◆ fullDetail()

template<class PBASE>

bool GaudiHistos< PBASE >::fullDetail | ( |  | ) | const
| inline

get flag to control output level of histograms

Definition at line 2373 of file GaudiHistos.h.

2373 { return m_fullDetail; }
GaudiHistos::m_fullDetail
Gaudi::Property< bool > m_fullDetail
Definition: GaudiHistos.h:2757

## ◆ histo() [1/2]

template<class PBASE>

AIDA::IHistogram1D* GaudiHistos< PBASE >::histo | ( | const std::string & | title | ) | const
| inline

access the EXISTING 1D histogram by title

Wrapper method for the equivalent histo1D method. Retained for backwards compatibility, please use histo1D instead.

return the pointer to existing 1D histogram or NULL

Definition at line 2282 of file GaudiHistos.h.

2282 { return histo1D( title ); }
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270

## ◆ histo() [2/2]

template<class PBASE>

AIDA::IHistogram1D* GaudiHistos< PBASE >::histo | ( | const HistoID & | ID | ) | const
| inline

access the EXISTING 1D histogram by ID

Wrapper method for the equivalent histo1D method. Retained for backwards compatibility, please use histo1D instead.

return the pointer to existing 1D histogram or NULL

Definition at line 2330 of file GaudiHistos.h.

2330 { return histo1D( ID ); }
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270

## ◆ histo1D() [1/2]

template<class PBASE>

AIDA::IHistogram1D* GaudiHistos< PBASE >::histo1D | ( | const std::string & | title | ) | const
| inline

access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL

Definition at line 2270 of file GaudiHistos.h.

2270 {
2271 auto found = histo1DMapTitle().find( title );
2272 return found != histo1DMapTitle().end() ? found->second : nullptr;
2273 }
GaudiUtils::Map::end
iterator end()
Definition: Map.h:130
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:147
GaudiHistos::histo1DMapTitle
const Histo1DMapTitle & histo1DMapTitle() const
get access to the map of all 1D histograms indexed via their title
Definition: GaudiHistos.h:2424

## ◆ histo1D() [2/2]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::histo1D | ( | const HistoID & | ID | ) | const

access the EXISTING 1D histogram by ID return the pointer to existing 1D histogram or NULL

Definition at line 286 of file GaudiHistos.icpp.

286 {
287 return lookup_( histo1DMapID(), ID );
288 }
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2448

## ◆ histo1DMapID()

template<class PBASE>

const Histo1DMapID& GaudiHistos< PBASE >::histo1DMapID | ( |  | ) | const
| inline

get access to the map of all 1D histograms index via ID

// iterate over the map!
for ( const auto& entry : histo1DMapID() )
{
// histogram ID
const HistoID ID = entry.first ;
// histogram itself
AIDA::IHistogram1D* h = entry.second ;
if ( 0 == h ) { continue ;}
std::cout << " Histogram ID " << ID
<< " Histogram title " << h->title() << std::endl ;
}

Definition at line 2448 of file GaudiHistos.h.

2448 { return m_histo1DMapID; }
GaudiHistos::m_histo1DMapID
Histo1DMapID m_histo1DMapID
the actual storage/access of 1D histograms by unique ID
Definition: GaudiHistos.h:2780

## ◆ histo1DMapTitle()

template<class PBASE>

const Histo1DMapTitle& GaudiHistos< PBASE >::histo1DMapTitle | ( |  | ) | const
| inline

get access to the map of all 1D histograms indexed via their title

Using this method one can inspect e.g. a list of active histograms

// iterate over the map!
for ( const auto& entry :histo1DMapTitle() )
{
// histogram title
const std::string& title = entry.first ;
// histogram itself
AIDA::IHistogram1D* hist = entry.second ;
if( !hist ) { continue ; } // ATTENTION!
std::cout << " Histogram title " << title << std::endl ;
}

Attention
  The map COULD contains NULL pointers, the check before use is mandatory!

Definition at line 2424 of file GaudiHistos.h.

2424 { return m_histo1DMapTitle; }
GaudiHistos::m_histo1DMapTitle
Histo1DMapTitle m_histo1DMapTitle
the actual storage/access of 1D histograms by unique title
Definition: GaudiHistos.h:2778

## ◆ histo2D() [1/2]

template<class PBASE>

AIDA::IHistogram2D* GaudiHistos< PBASE >::histo2D | ( | const std::string & | title | ) | const
| inline

access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL

Definition at line 2287 of file GaudiHistos.h.

2287 {
2288 auto found = histo2DMapTitle().find( title );
2289 return histo2DMapTitle().end() != found ? found->second : nullptr;
2290 }
GaudiHistos::histo2DMapTitle
const Histo2DMapTitle & histo2DMapTitle() const
get access to the map of all 2D histograms indexed via their title
Definition: GaudiHistos.h:2475
GaudiUtils::Map::end
iterator end()
Definition: Map.h:130
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:147

## ◆ histo2D() [2/2]

template<class PBASE >

AIDA::IHistogram2D * GaudiHistos< PBASE >::histo2D | ( | const HistoID & | ID | ) | const

access the EXISTING 2D histogram by ID return the pointer to existing 2D histogram or NULL

Definition at line 293 of file GaudiHistos.icpp.

293 {
294 return lookup_( histo2DMapID(), ID );
295 }
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2498

## ◆ histo2DMapID()

template<class PBASE>

const Histo2DMapID& GaudiHistos< PBASE >::histo2DMapID | ( |  | ) | const
| inline

get access to the map of 2D histograms index via ID

// iterate over the map!
for ( const auto& entry : histo2DMapID() )
{
// histogram ID
const HistoID ID = entry.first ;
// histogram itself
AIDA::IHistogram2D* h = entry.second ;
if ( 0 == h ) { continue ;}
std::cout << " Histogram ID " << ID
<< " Histogram title " << h->title() << std::endl ;
}

Definition at line 2498 of file GaudiHistos.h.

2498 { return m_histo2DMapID; }
GaudiHistos::m_histo2DMapID
Histo2DMapID m_histo2DMapID
the actual storage/access of 2D histograms by unique ID
Definition: GaudiHistos.h:2785

## ◆ histo2DMapTitle()

template<class PBASE>

const Histo2DMapTitle& GaudiHistos< PBASE >::histo2DMapTitle | ( |  | ) | const
| inline

get access to the map of all 2D histograms indexed via their title

Using this method one can inspect e.g. a list of active histograms

// iterate over the map!
for ( const auto& entry : histo2DMapTitle() )
{
// histogram title
const std::string& title = entry.first ;
// histogram itself
AIDA::IHistogram2D* hist = entry.second ;
if( 0 == hist ) { continue ; } // ATTENTION!
std::cout << " Histogram title " << title << std::endl ;
}

Attention
  The map COULD contains NULL pointers, the check before use is mandatory!

Definition at line 2475 of file GaudiHistos.h.

2475 { return m_histo2DMapTitle; }
GaudiHistos::m_histo2DMapTitle
Histo2DMapTitle m_histo2DMapTitle
the actual storage/access of 2D histograms by unique title
Definition: GaudiHistos.h:2783

## ◆ histo3D() [1/2]

template<class PBASE>

AIDA::IHistogram3D* GaudiHistos< PBASE >::histo3D | ( | const std::string & | title | ) | const
| inline

access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL

Definition at line 2295 of file GaudiHistos.h.

2295 {
2296 auto found = histo3DMapTitle().find( title );
2297 return histo3DMapTitle().end() != found ? found->second : nullptr;
2298 }
GaudiHistos::histo3DMapTitle
const Histo3DMapTitle & histo3DMapTitle() const
get access to the map of all 3D histograms indexed via their title
Definition: GaudiHistos.h:2525
GaudiUtils::Map::end
iterator end()
Definition: Map.h:130
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:147

## ◆ histo3D() [2/2]

template<class PBASE >

AIDA::IHistogram3D * GaudiHistos< PBASE >::histo3D | ( | const HistoID & | ID | ) | const

access the EXISTING 3D histogram by ID return the pointer to existing 3D histogram or NULL

Definition at line 300 of file GaudiHistos.icpp.

300 {
301 return lookup_( histo3DMapID(), ID );
302 }
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2548

## ◆ histo3DMapID()

template<class PBASE>

const Histo3DMapID& GaudiHistos< PBASE >::histo3DMapID | ( |  | ) | const
| inline

get access to the map of all 3D histograms index via a ID

// iterate over the map!
for ( const auto& entry : histo3DMapID() )
{
// histogram ID
const HistoID ID = entry.first ;
// histogram itself
AIDA::IHistogram3D* h = entry.second ;
if ( 0 == h ) { continue ;}
std::cout << " Histogram ID " << ID
<< " Histogram title " << h->title() << std::endl ;
}

Definition at line 2548 of file GaudiHistos.h.

2548 { return m_histo3DMapID; }
GaudiHistos::m_histo3DMapID
Histo3DMapID m_histo3DMapID
the actual storage/access of 3D histograms by unique ID
Definition: GaudiHistos.h:2790

## ◆ histo3DMapTitle()

template<class PBASE>

const Histo3DMapTitle& GaudiHistos< PBASE >::histo3DMapTitle | ( |  | ) | const
| inline

get access to the map of all 3D histograms indexed via their title

Using this method one can inspect e.g. a list of active histograms

// iterate over the map!
for ( const auto& entry : histo3DMapTitle() )
{
// histogram title
const std::string& title = entry.first ;
// histogram itself
AIDA::IHistogram3D* hist = entry.second ;
if( 0 == hist ) { continue ; } // ATTENTION!
std::cout << " Histogram title " << title << std::endl ;
}

Attention
  The map COULD contains NULL pointers, the check before use is mandatory!

Definition at line 2525 of file GaudiHistos.h.

2525 { return m_histo3DMapTitle; }
GaudiHistos::m_histo3DMapTitle
Histo3DMapTitle m_histo3DMapTitle
the actual storage/access of 3D histograms by unique title
Definition: GaudiHistos.h:2788

## ◆ histoCountersPrint()

template<class PBASE>

bool GaudiHistos< PBASE >::histoCountersPrint | ( |  | ) | const
| inline

print histogram counters at finalization ?

Definition at line 2389 of file GaudiHistos.h.

2389 { return m_histoCountersPrint; }
GaudiHistos::m_histoCountersPrint
Gaudi::Property< bool > m_histoCountersPrint
Definition: GaudiHistos.h:2745

## ◆ histoDir()

template<class PBASE>

const std::string& GaudiHistos< PBASE >::histoDir | ( |  | ) | const
| inline

get histogram directory (property "HistoDir")

Definition at line 2383 of file GaudiHistos.h.

2383 { return m_histoDir; }
GaudiHistos::m_histoDir
Gaudi::Property< std::string > m_histoDir
Definition: GaudiHistos.h:2755

## ◆ histoExists() [1/2]

template<class PBASE>

bool GaudiHistos< PBASE >::histoExists | ( | const std::string & | title | ) | const
| inline

check the existence AND validity of the histogram with given title

Definition at line 2355 of file GaudiHistos.h.

2355 {
2356 return ( 0 != histo( title ) || 0 != histo2D( title ) || 0 != histo3D( title ) || 0 != profile1D( title ) ||
2357 0 != profile2D( title ) );
2358 }
GaudiHistos::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2282
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:103
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:104
GaudiHistos::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
GaudiHistos::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295

## ◆ histoExists() [2/2]

template<class PBASE>

bool GaudiHistos< PBASE >::histoExists | ( | const HistoID & | ID | ) | const
| inline

check the existence AND validity of the histogram with given title

Definition at line 2361 of file GaudiHistos.h.

2361 {
2362 return ( 0 != histo( ID ) || 0 != histo2D( ID ) || 0 != histo3D( ID ) || 0 != profile1D( ID ) ||
2363 0 != profile2D( ID ) );
2364 }
GaudiHistos::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2282
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:103
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:104
GaudiHistos::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
GaudiHistos::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295

## ◆ histoOffSet()

template<class PBASE>

HistoID::NumericID GaudiHistos< PBASE >::histoOffSet | ( |  | ) | const
| inline

get the value for histogram offset (property "HistoOffSet")

Definition at line 2379 of file GaudiHistos.h.

2379 { return m_histoOffSet; }
GaudiHistos::m_histoOffSet
Gaudi::Property< HistoID::NumericID > m_histoOffSet
Definition: GaudiHistos.h:2751

## ◆ histoPath()

template<class PBASE >

std::string GaudiHistos< PBASE >::histoPath | ( |  | ) | const

get the constructed histogram path

Definition at line 360 of file GaudiHistos.icpp.

360 {
361 std::string path = histoTopDir() + histoDir();
362 return splitHistoDir() ? dirHbookName( path ) : path;
363 }
GaudiHistos::histoTopDir
const std::string & histoTopDir() const
get top-level histogram directory (property "HistoTopDir")
Definition: GaudiHistos.h:2381
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:932
GaudiHistos::histoDir
const std::string & histoDir() const
get histogram directory (property "HistoDir")
Definition: GaudiHistos.h:2383
std::string
STL class.
GaudiHistos::splitHistoDir
bool splitHistoDir() const
get the flag for histogram path split (property "HistoSplitDir")
Definition: GaudiHistos.h:2377

## ◆ histosPrint()

template<class PBASE>

bool GaudiHistos< PBASE >::histosPrint | ( |  | ) | const
| inline

print histograms at finalization ?

Definition at line 2387 of file GaudiHistos.h.

2387 { return m_histosPrint; }
GaudiHistos::m_histosPrint
Gaudi::Property< bool > m_histosPrint
Definition: GaudiHistos.h:2737

## ◆ histoTopDir()

template<class PBASE>

const std::string& GaudiHistos< PBASE >::histoTopDir | ( |  | ) | const
| inline

get top-level histogram directory (property "HistoTopDir")

Definition at line 2381 of file GaudiHistos.h.

2381 { return m_histoTopDir; }
GaudiHistos::m_histoTopDir
Gaudi::Property< std::string > m_histoTopDir
Definition: GaudiHistos.h:2753

## ◆ initialize()

template<class PBASE >

StatusCode GaudiHistos< PBASE >::initialize | ( |  | ) |
| override protected

standard initialization method

Returns
  status code

Definition at line 81 of file GaudiHistos.icpp.

81 {
82 // initialize base class
83 const StatusCode sc = PBASE::initialize();
84 if ( sc.isFailure() ) return sc;
85
86 // produce histograms?
87 if ( !produceHistos() ) {
88 this->debug() << "Histogram production is switched OFF" << endmsg;
89 return sc;
90 }
91
92 // check the validity of histogram service
93 if ( !this->histoSvc() ) { return this->Error( "initialize():: IHistogramSvc* is invalid" ); }
94
95 // Warn if the user has decided to use numerical automatic IDs
96 if ( useNumericAutoIDs() ) {
97 this->Warning(
98 "Using numerical automatic IDs. These are not guaranteed to be totally deterministic. Use with care...",
99 StatusCode::SUCCESS )
100 .ignore();
101 }
102
103 // Finally, print the location histogram will be written to
104 this->Print( "The histogram path is set to be '" + histoPath() + "'", StatusCode( StatusCode::SUCCESS, true ),
105 MSG::DEBUG )
106 .ignore();
107
108 return sc;
109 }
MSG::DEBUG
Definition: IMessageSvc.h:15
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
GaudiHistos::useNumericAutoIDs
bool useNumericAutoIDs() const
Use old style sequencial numerical automatically assigned IDs ?
Definition: GaudiHistos.h:2391
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ monitorHisto()

template<class PBASE >

void GaudiHistos< PBASE >::monitorHisto | ( | const AIDA::IBaseHistogram * | hist,
|  | const HistoID & | ID
| ) |  | const
| private

Declare a histogram to the monitor service.

Uses the histogram ID as the 'name' sent to the monitor service and the histogram title as the long description

Definition at line 273 of file GaudiHistos.icpp.

273 {
274 if ( hist && m_declareMoniHists ) {
275 if ( this->msgLevel( MSG::DEBUG ) ) {
276 this->debug() << "Monitoring histogram '" << ID.idAsString() << "' desc = '"
277 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
278 }
279 this->declareInfo( histoPath() + "/" + ID.idAsString(), hist, Gaudi::Utils::Histos::htitle( hist ) );
280 }
281 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:109
MSG::DEBUG
Definition: IMessageSvc.h:15
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::m_declareMoniHists
Gaudi::Property< bool > m_declareMoniHists
Definition: GaudiHistos.h:2758
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ newHistoID()

template<class PBASE >

void GaudiHistos< PBASE >::newHistoID | ( | const std::string & | title,
|  | HistoID & | ID
| ) |  | const
| private

Create a new histogram ID using the given title.

Parameters

  [in] | title | Histogram title
  [out] | ID | The ID to use for the new histogram

Definition at line 329 of file GaudiHistos.icpp.

329 {
330 if ( useNumericAutoIDs() || title.empty() ) {
331 if ( !useNumericAutoIDs() ) {
332 this->Warning(
333 "Cannot generate automatic literal ID from an empty title ! Using numeric ID instead for histogram ID",
334 StatusCode::SUCCESS )
335 .ignore();
336 }
337 // propose the histogram ID (always numeric)
338 ID = HistoID( totalNumberOfHistos() + 1 + histoOffSet() );
339 // adjust the proposed ID
340 while ( histoExists( ID ) ) { ID = HistoID( ID.numeric() + 1 ); }
341 } else {
342 // use the title to create a unique literal ID
343 ID = HistoID( this->convertTitleToID( title ) );
344 // Just in case ...
345 while ( histoExists( ID ) ) { ID = HistoID( ID.idAsString() + "_" ); }
346 }
347 }
std::string::empty
T empty(T... args)
GaudiHistos::convertTitleToID
std::string convertTitleToID(std::string title) const
Create an ID string from a title string.
Definition: GaudiHistos.icpp:352
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
GaudiHistos::histoExists
bool histoExists(const std::string &title) const
check the existence AND validity of the histogram with given title
Definition: GaudiHistos.h:2355
GaudiHistos::histoOffSet
HistoID::NumericID histoOffSet() const
get the value for histogram offset (property "HistoOffSet")
Definition: GaudiHistos.h:2379
GaudiHistos::useNumericAutoIDs
bool useNumericAutoIDs() const
Use old style sequencial numerical automatically assigned IDs ?
Definition: GaudiHistos.h:2391
GaudiHistos::totalNumberOfHistos
unsigned int totalNumberOfHistos() const
Returns the total number of histograms (of all types) currently booked.
Definition: GaudiHistos.icpp:321

## ◆ noHistos()

template<class PBASE >

bool GaudiHistos< PBASE >::noHistos | ( |  | ) | const
| private

Check if all histogram maps are empty.

Definition at line 264 of file GaudiHistos.icpp.

264 {
265 return ( histo1DMapTitle().empty() && histo2DMapTitle().empty() && histo3DMapTitle().empty() &&
266 profile1DMapTitle().empty() && profile2DMapTitle().empty() && histo1DMapID().empty() &&
267 histo2DMapID().empty() && histo3DMapID().empty() && profile1DMapID().empty() && profile2DMapID().empty() );
268 }
GaudiHistos::histo2DMapTitle
const Histo2DMapTitle & histo2DMapTitle() const
get access to the map of all 2D histograms indexed via their title
Definition: GaudiHistos.h:2475
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2548
GaudiHistos::histo3DMapTitle
const Histo3DMapTitle & histo3DMapTitle() const
get access to the map of all 3D histograms indexed via their title
Definition: GaudiHistos.h:2525
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2650
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2600
GaudiHistos::profile1DMapTitle
const Profile1DMapTitle & profile1DMapTitle() const
get access to the map of all 1D profile histograms indexed via their title
Definition: GaudiHistos.h:2577
GaudiHistos::histo1DMapTitle
const Histo1DMapTitle & histo1DMapTitle() const
get access to the map of all 1D histograms indexed via their title
Definition: GaudiHistos.h:2424
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2448
GaudiHistos::profile2DMapTitle
const Profile2DMapTitle & profile2DMapTitle() const
get access to the map of all 2D profile histograms indexed via their title
Definition: GaudiHistos.h:2627
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2498

## ◆ plot() [1/8]

template<class PBASE>

AIDA::IHistogram1D* GaudiHistos< PBASE >::plot | ( | const double | value,
|  | const std::string & | title,
|  | const double | low,
|  | const double | high,
|  | const unsigned long | bins = `100`,
|  | const double | weight = `1.0`
| ) |  | const
| inline

fill the 1D histogram (book on demand)

Wrapper method for the equivalent plot1D method. Retained for backwards compatibility, please use plot1D instead.

Parameters

  value | value to be filled
  title | histogram title (must be unique within the algorithm)
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins
  weight | weight

Returns
  pointer to AIDA 1D histogram

Definition at line 152 of file GaudiHistos.h.

153 {
154 return plot1D( value, title, low, high, bins, weight );
155 }
GaudiHistos::plot1D
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
Definition: GaudiHistos_1DFixedBinning.icpp:103

## ◆ plot() [2/8]

template<class PBASE>

AIDA::IHistogram1D* GaudiHistos< PBASE >::plot | ( | const double | value,
|  | const Gaudi::Histo1DDef & | hdef,
|  | const double | weight = `1.0`
| ) |  | const
| inline

fill the 1D histogram (book on demand)

Wrapper method for the equivalent plot1D method. Retained for backwards compatibility, please use plot1D instead.

Parameters

  value | value to be filled
  hdef | histogram descriptor
  weight | weight

Returns
  pointer to AIDA 1D histogram

Definition at line 193 of file GaudiHistos.h.

194 {
195 return plot1D( value, hdef, weight );
196 }
GaudiHistos::plot1D
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
Definition: GaudiHistos_1DFixedBinning.icpp:103

## ◆ plot() [3/8]

template<class PBASE>

AIDA::IHistogram1D* GaudiHistos< PBASE >::plot | ( | const double | value,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | low,
|  | const double | high,
|  | const unsigned long | bins = `100`,
|  | const double | weight = `1.0`
| ) |  | const
| inline

fill the 1D histogram with forced ID assignment (book on demand)

Wrapper method for the equivalent plot1D method. Retained for backwards compatibility, please use plot1D instead.

Parameters

  value | value to be filled
  ID | histogram identifier
  title | histogram title (must be unique within the algorithm)
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins
  weight | weight

Returns
  pointer to AIDA 1D histogram

Definition at line 280 of file GaudiHistos.h.

282 {
283 return plot1D( value, ID, title, low, high, bins, weight );
284 }
GaudiHistos::plot1D
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
Definition: GaudiHistos_1DFixedBinning.icpp:103

## ◆ plot() [4/8]

template<class PBASE>

AIDA::IHistogram1D* GaudiHistos< PBASE >::plot | ( | const double | value,
|  | const HistoID & | ID,
|  | const Gaudi::Histo1DDef & | hdef,
|  | const double | weight = `1.0`
| ) |  | const
| inline

fill the 1D histogram (book on demand)

Wrapper method for the equivalent plot1D method. Retained for backwards compatibility, please use plot1D instead.

Parameters

  value | value to be filled
  ID | histogram identifier
  hdef | histogram descriptor
  weight | weight

Returns
  pointer to AIDA 1D histogram

Definition at line 325 of file GaudiHistos.h.

326 {
327 return plot1D( value, ID, hdef, weight );
328 }
GaudiHistos::plot1D
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
Definition: GaudiHistos_1DFixedBinning.icpp:103

## ◆ plot() [5/8]

template<class PBASE>
template<class FUNCTION , class OBJECT >

AIDA::IHistogram1D* GaudiHistos< PBASE >::plot | ( | const FUNCTION & | func,
|  | OBJECT | first,
|  | OBJECT | last,
|  | const std::string & | title,
|  | const double | low,
|  | const double | high,
|  | const unsigned long | bins = `100`
| ) |  | const
| inline

fill the 1D histogram with information from [first,last) sequence

std::vector<double> v = ... ;
plot( sin , // function
v.begin() , v.end() , // sequence
" bla-bla " , // title
-1. , 1.0 , // low and high limits
100 ) // number of bins

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

Sequence, objects and function can be non-trivial:

Particles* p = ... ;
plot( PT , // function
p->begin() , p->end() , // sequence
" bla-bla " , // title
-1. , 1.0 , // low and high limits
100 ) ; // number of bins

where `PT` can be any function or function object for which the expression `PT(p)` , with `p` of type `Particle*` have some sense and can be evaluated to the values, which is convertible to `double`

Attention
  These plot methods using iterator ranges are more efficient than the simplier "value" only methods, since the associated histogram only requires locating from internal storage once per loop, as opposed to once per fill for the simplier functions. It is recommended to use these whenever possible.

See also
  AIDA::IHistogram1D

Parameters

  func | function to be plotted
  first | begin of the sequence
  last | end of the sequence
  title | histogram title
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins for histogram

Definition at line 393 of file GaudiHistos.h.

394 {
395 AIDA::IHistogram1D* h = nullptr;
396 if ( produceHistos() ) {
397 // retrieve or book the histogram
398 h = histo1D( title );
399 if ( !h ) { h = book1D( title, low, high, bins ); }
400 // fill histogram
401 while ( first != last && h ) {
402 h = fill( h, func( *first ), 1.0, title );
403 ++first;
404 }
405 }
406 return h;
407 }
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:211
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot() [6/8]

template<class PBASE>
template<class FUNCTION , class OBJECT >

AIDA::IHistogram1D* GaudiHistos< PBASE >::plot | ( | const FUNCTION & | func,
|  | OBJECT | first,
|  | OBJECT | last,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | low,
|  | const double | high,
|  | const unsigned long | bins = `100`
| ) |  | const
| inline

fill the 1D histogram with forced ID and information from [first,last) sequence

std::vector<double> v = ... ;
// Example with numeric ID
plot( sin , // function
v.begin() , v.end() , // sequence
100 , " bla-bla " , // ID and title
-1. , 1.0 , // low and high limits
100 ); // number of bins
// Example with literal ID
plot( sin , // function
v.begin() , v.end() , // sequence
"sin" , " bla-bla " , // ID and title
-1. , 1.0 , // low and high limits
100 ); // number of bins

Sequence, objects and function can be non-trivial:

Particles* p = ... ;
plot( PT , // function
p->begin() , p->end() , // sequence
100 , " bla-bla " , // ID and title
-1. , 1.0 , // low and high limits
100 ) ; // number of bins

Attention
  These plot methods using iterator ranges are more efficient than the simplier "value" only methods, since the associated histogram only requires locating from internal storage once per loop, as opposed to once per fill for the simplier functions. It is recommended to use these whenever possible.

See also
  AIDA::IHistogram1D

Parameters

  func | function to be plotted
  first | begin of the sequence
  last | end of the sequence
  ID | histogram identifier
  title | histogram title
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins for histogram

Definition at line 465 of file GaudiHistos.h.

467 {
468 AIDA::IHistogram1D* h( 0 );
469 if ( produceHistos() ) {
470 // retrieve or book the histogram
471 h = histo1D( ID );
472 if ( !h ) { h = book1D( ID, title, low, high, bins ); }
473 // fill histogram
474 while ( first != last && h ) {
475 h = fill( h, func( *first ), 1.0, title );
476 ++first;
477 }
478 }
479 return h;
480 }
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:211
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot() [7/8]

template<class PBASE>
template<class FUNCTION , class OBJECT , class WEIGHT >

AIDA::IHistogram1D* GaudiHistos< PBASE >::plot | ( | const FUNCTION & | func,
|  | OBJECT | first,
|  | OBJECT | last,
|  | const std::string & | title,
|  | const double | low,
|  | const double | high,
|  | const unsigned long | bins,
|  | const WEIGHT & | weight
| ) |  | const
| inline

book and fill the 1D histogram with information from [first,last) sequence with given weight

std::vector<double> v = ... ;
plot( sin , // function
v.begin() , v.end() , // sequence
" bla-bla " , // title
-1. , 1.0 , // low and high limits
100 , // number of bins
tanh ); // weight function

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

Sequence, objects and function can be non-trivial:

Particles* p = ... ;
plot( PT , // function
p->begin() , p->end() , // sequence
" bla-bla " , // title
-1. , 1.0 , // low and high limits
100 , // number of bins
MASS ) ; // weight function

where `PT` and `MASS` can be any function or function object for which the expressions `PT(p)` and `MASS` with `p` of type `Particle*` have some sense and can be evaluated to the values, which is convertible to `double`

Attention
  These plot methods using iterator ranges are more efficient than the simplier "value" only methods, since the associated histogram only requires locating from internal storage once per loop, as opposed to once per fill for the simplier functions. It is recommended to use these whenever possible.

See also
  AIDA::IHistogram1D

Parameters

  first | begin of the sequence
  last | end of the sequence
  title | histogram title
  func | function to be plotted
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins for histogram
  weight | weight function

Definition at line 551 of file GaudiHistos.h.

553 {
554 AIDA::IHistogram1D* h = nullptr;
555 if ( produceHistos() ) {
556 // retrieve or book the histogram
557 h = histo1D( title );
558 if ( !h ) { h = book1D( title, low, high, bins ); }
559 // fill histogram
560 while ( first != last && h ) {
561 h = fill( h, func( *first ), weight( *first ), title );
562 ++first;
563 }
564 }
565 return h;
566 }
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:211
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot() [8/8]

template<class PBASE>
template<class FUNCTION , class OBJECT , class WEIGHT >

AIDA::IHistogram1D* GaudiHistos< PBASE >::plot | ( | const FUNCTION & | func,
|  | OBJECT | first,
|  | OBJECT | last,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | low,
|  | const double | high,
|  | const unsigned long | bins,
|  | const WEIGHT & | weight
| ) |  | const
| inline

book and fill the 1D histogram with forced ID and information from [first,last) sequence with given weight

std::vector<double> v = ... ;
// example with numerical ID
plot( sin , // function
v.begin() , v.end() , // sequence
100 , " bla-bla " , // ID and title
-1. , 1.0 , // low and high limits
100 , // number of bins
sinh ); // weight function
// example with literal ID
plot( sin , // function
v.begin() , v.end() , // sequence
"sin" , " bla-bla " , // ID and title
-1. , 1.0 , // low and high limits
100 , // number of bins
sinh ); // weight function

Attention
  no checks for NaN or Finite are performed!

Sequence, objects and function can be non-trivial:

Particles* p = ... ;
plot( PT , // function
p->begin() , p->end() , // sequence
100 , " bla-bla " , // ID and title
-1. , 1.0 , // low and high limits
100 , // number of bins
MASS ) ; // weight function

where `PT` and `MASS` can be any function or function object for which the expressions `PT(p)` and `MASS` with `p` of type `Particle*` have some sense and can be evaluated to the values, which is convertible to `double`

Attention
  These plot methods using iterator ranges are more efficient than the simplier "value" only methods, since the associated histogram only requires locating from internal storage once per loop, as opposed to once per fill for the simplier functions. It is recommended to use these whenever possible.

See also
  AIDA::IHistogram1D

Parameters

  first | begin of the sequence
  last | end of the sequence
  ID | histogram identifier
  title | histogram title
  func | function to be plotted
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins for histogram
  weight | weight function

Definition at line 635 of file GaudiHistos.h.

637 {
638 AIDA::IHistogram1D* h = nullptr;
639 if ( produceHistos() ) {
640 // retrieve or book the histogram
641 h = histo1D( ID );
642 if ( !h ) { h = book1D( ID, title, low, high, bins ); }
643 // fill histogram
644 while ( first != last && h ) {
645 h = fill( h, func( *first ), weight( *first ), title );
646 ++first;
647 }
648 }
649 return h;
650 }
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:211
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot1D() [1/6]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::plot1D | ( | const double | value,
|  | const std::string & | title,
|  | const double | low,
|  | const double | high,
|  | const unsigned long | bins = `100`,
|  | const double | weight = `1.0`
| ) |  | const

fill the 1D histogram (book on demand)

const double mass = ... ;
plot1D( mass , "Invariant Mass" , 2.5 , 3.5 , 100 )

This example illustrates the filling of the histogram titled `"InvariantMass"` with value `mass` .

If the histogram with given title does not exist yet it will be automatically booked with parameters `low` equal to 2.5, parameters `high` equal to 3.5 and `bins` equal to 100.

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

See also
  AIDA::IHistogram1D

Parameters

  value | value to be filled
  title | histogram title (must be unique within the algorithm)
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins
  weight | weight

Returns
  pointer to AIDA 1D histogram

Definition at line 103 of file GaudiHistos_1DFixedBinning.icpp.

105 {
106 AIDA::IHistogram1D* h( nullptr );
107 if ( produceHistos() ) {
108 // retrieve or book the histogram
109 h = histo1D( title );
110 if ( !h ) { h = book1D( title, low, high, bins ); }
111 // fill the histogram
112 h = fill( h, value, weight, title );
113 }
114 return h;
115 }
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot1D() [2/6]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::plot1D | ( | const double | value,
|  | const Gaudi::Histo1DDef & | hdef,
|  | const double | weight = `1.0`
| ) |  | const

fill the 1D histogram (book on demand)

const Gaudi::Histo1DDef& hdef = ... ;
const double mass = ... ;
plot1D ( mass , hdef ) ;

The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title.

The histogram descriptor comes e.g. from the component properties.

See also
  AIDA::IHistogram1D

Parameters

  value | value to be filled
  hdef | histogram descriptor
  weight | weight

Returns
  pointer to AIDA 1D histogram

Definition at line 151 of file GaudiHistos_1DFixedBinning.icpp.

152 {
153 return plot1D( value, hdef.title(), hdef.lowEdge(), hdef.highEdge(), hdef.bins(), weight );
154 }
GaudiHistos::plot1D
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
Definition: GaudiHistos_1DFixedBinning.icpp:103
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition: HistoDef.h:59
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition: HistoDef.h:57
Gaudi::Histo1DDef::highEdge
double highEdge() const
get the high edge
Definition: HistoDef.h:55
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition: HistoDef.h:53

## ◆ plot1D() [3/6]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::plot1D | ( | const double | value,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | low,
|  | const double | high,
|  | const unsigned long | bins = `100`,
|  | const double | weight = `1.0`
| ) |  | const

fill the 1D histogram with forced ID assignment (book on demand)

const double mass = ... ;
plot1D( mass , 15 , "Invariant Mass" , 2.5 , 3.5 , 100 )

This example illustrates the filling of the 1D histogram ID=15 titled `"Invariant Mass"` with value `mass` .

If the histogram with given ID does not exist yet it will be automatically booked with parameters `low` equal to 2.5, parameters `high` equal to 3.5 and `bins` equal to 100.

It is also possible to use literal IDs. For example :-

const double mass = ... ;
plot1D( mass , "mass" , "Invariant Mass" , 2.5 , 3.5 , 100 )

Will book the same histogram, using the id "mass".

It is also possible using literal IDs, to place histograms in sub-directories from the main histogram directory, using for example :-

const double mass = ... ;
plot1D( mass , "subdir/mass" , "Invariant Mass" , 2.5 , 3.5 , 100 )

Which will create the histogram "mass" in the sub-directory "subdir". Histograms can also be created in sub-directories with numeric IDs if IDs such as "subdir/1" are used.

Attention
  If the histogram with given ID is already booked through automatic assignment of histogram ID, the error will not be detected. Therefore it is recommended to use non-trivial histogram ID offset (property "HistoOffSet") if one need to combine these techniques together. It is still desirable to use the unique histogram title to avoid a bad interference.

See also
  AIDA::IHistogram1D

Parameters

  value | value to be filled
  ID | histogram identifier
  title | histogram title (must be unique within the algorithm)
  low | low limit for histogram
  high | high limit for histogram
  bins | number of bins
  weight | weight

Returns
  pointer to AIDA 1D histogram

Definition at line 120 of file GaudiHistos_1DFixedBinning.icpp.

122 {
123 AIDA::IHistogram1D* h( nullptr );
124 if ( produceHistos() ) {
125 // retrieve or book the histogram
126 h = histo1D( ID );
127 if ( !h ) { h = book1D( ID, title, low, high, bins ); }
128 // fill
129 h = fill( h, value, weight, title );
130 }
131 return h;
132 }
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot1D() [4/6]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::plot1D | ( | const double | value,
|  | const HistoID & | ID,
|  | const Gaudi::Histo1DDef & | hdef,
|  | const double | weight = `1.0`
| ) |  | const

fill the 1D histogram with forced ID assignment (book on demand)

// get the histogram descriptor
const Gaudi::Histo1DDef& hdef = ... ;
// get the histogram ID
const HistoID ID = ... ;
const double mass = ... ;
plot1D ( mass , ID , hdef )

See also
  AIDA::IHistogram1D

The histogram descriptor comes e.g. from component properties

Parameters

  value | value to be filled
  ID | histogram identifier
  hdef | histogram descriptor
  weight | weight

Returns
  pointer to AIDA 1D histogram

Definition at line 159 of file GaudiHistos_1DFixedBinning.icpp.

160 {
161 return plot1D( value, ID, hdef.title(), hdef.lowEdge(), hdef.highEdge(), hdef.bins(), weight );
162 }
GaudiHistos::plot1D
AIDA::IHistogram1D * plot1D(const double value, const std::string &title, const double low, const double high, const unsigned long bins=100, const double weight=1.0) const
fill the 1D histogram (book on demand)
Definition: GaudiHistos_1DFixedBinning.icpp:103
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition: HistoDef.h:59
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition: HistoDef.h:57
Gaudi::Histo1DDef::highEdge
double highEdge() const
get the high edge
Definition: HistoDef.h:55
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition: HistoDef.h:53

## ◆ plot1D() [5/6]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::plot1D | ( | const double | value,
|  | const std::string & | title,
|  | const HistoBinEdges & | edges,
|  | const double | weight = `1.0`
| ) |  | const

Fill the 1D variable binning histogram (book on demand)

const GaudiAlg::HistoBinEdges edges = ...;
const double mass = ... ;
plot1D( mass , "Invariant Mass" , edges )

This example illustrates the filling of the histogram titled `"InvariantMass"` with value `mass`.

If the histogram with given title does not exist yet it will be automatically booked with the given histogram bin edges.

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

See also
  AIDA::IHistogram1D

Parameters

  value | value to be filled
  title | histogram title (must be unique within the algorithm)
  edges | The histogram bin edges
  weight | weight

Returns
  pointer to AIDA 1D histogram

Definition at line 77 of file GaudiHistos_1DVariableBinning.icpp.

78 {
79 AIDA::IHistogram1D* h( nullptr );
80 if ( produceHistos() ) {
81 // retrieve or book the histogram
82 h = histo1D( title );
83 if ( !h ) { h = book1D( title, edges ); }
84 // fill the histogram
85 h = fill( h, value, weight, title );
86 }
87 return h;
88 }
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot1D() [6/6]

template<class PBASE >

AIDA::IHistogram1D * GaudiHistos< PBASE >::plot1D | ( | const double | value,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const HistoBinEdges & | edges,
|  | const double | weight = `1.0`
| ) |  | const

fill the 1D variable binning histogram with forced ID assignment (book on demand)

const GaudiAlg::HistoBinEdges edges = ...;
const double mass = ... ;
plot1D( mass , 15 , "Invariant Mass" , edges )

This example illustrates the filling of the 1D histogram ID=15 titled `"Invariant Mass"` with value `mass`.

If the histogram with given ID does not exist yet it will be automatically booked with the given histogram bin edges.

It is also possible to use literal IDs. For example :-

const GaudiAlg::HistoBinEdges edges = ...;
const double mass = ... ;
plot1D( mass , "mass" , "Invariant Mass" , edges )

Will book the same histogram, using the id "mass".

It is also possible using literal IDs, to place histograms in sub-directories from the main histogram directory, using for example :-

const GaudiAlg::HistoBinEdges edges = ...;
const double mass = ... ;
plot1D( mass , "subdir/mass" , "Invariant Mass" , edges )

Which will create the histogram "mass" in the sub-directory "subdir". Histograms can also be created in sub-directories with numeric IDs if IDs such as "subdir/1" are used.

Attention
  If the histogram with given ID is already booked through automatic assignment of histogram ID, the error will not be detected. Therefore it is recommended to use non-trivial histogram ID offset (property "HistoOffSet") if one need to combine these techniques together. It is still desirable to use the unique histogram title to avoid a bad interference.

See also
  AIDA::IHistogram1D

Parameters

  value | value to be filled
  ID | histogram identifier
  title | histogram title (must be unique within the algorithm)
  edges | The histogram bin edges
  weight | weight

Returns
  pointer to AIDA 1D histogram

Definition at line 93 of file GaudiHistos_1DVariableBinning.icpp.

94 {
95 AIDA::IHistogram1D* h( nullptr );
96 if ( produceHistos() ) {
97 // retrieve or book the histogram
98 h = histo1D( ID );
99 if ( !h ) { h = book1D( ID, title, edges ); }
100 // fill
101 h = fill( h, value, weight, title );
102 }
103 return h;
104 }
GaudiHistos::histo1D
AIDA::IHistogram1D * histo1D(const std::string &title) const
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL
Definition: GaudiHistos.h:2270
GaudiHistos::book1D
AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const
book the 1D histogram
Definition: GaudiHistos_1DFixedBinning.icpp:7
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot2D() [1/4]

template<class PBASE >

AIDA::IHistogram2D * GaudiHistos< PBASE >::plot2D | ( | const double | valueX,
|  | const double | valueY,
|  | const std::string & | title,
|  | const double | lowX,
|  | const double | highX,
|  | const double | lowY,
|  | const double | highY,
|  | const unsigned long | binsX = `50`,
|  | const unsigned long | binsY = `50`,
|  | const double | weight = `1.0`
| ) |  | const

fill the 2D histogram (book on demand)

const double mass1 = ... ;
const double mass2 = ... ;
plot2D( mass1, mass2,
"Invariant Mass2 versus Mass1" ,2.5 ,3.5, 4.5, 5.5, 100, 200 );

This example illustrates the filling of the 2D histogram titled `"Invariant Mass2 versus Mass1"` with values `mass1` and `mass2` .

If the histogram with given title does not exist yet it will be automatically booked with parameters `lowX` equal to 2.5, `highX` equal to 3.5, `lowY` equal to 4.5, `highY` equal to 5.5, `binsX` equal to 100 and `binsY` equal to 200.

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

See also
  AIDA::IHistogram2D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  lowY | low y limit for histogram
  highY | high y limit for histogram
  binsX | number of bins in x
  binsY | number of bins in y
  weight | weight

Returns
  pointer to AIDA 2D histogram

Definition at line 106 of file GaudiHistos_2DFixedBinning.icpp.

109 {
110 AIDA::IHistogram2D* h( nullptr );
111 if ( produceHistos() ) {
112 // retrieve or book the histogram
113 h = histo2D( title );
114 if ( !h ) { h = book2D( title, lowX, highX, binsX, lowY, highY, binsY ); }
115 // fill the histogram
116 h = fill( h, valueX, valueY, weight, title );
117 }
118 return h;
119 }
GaudiHistos::book2D
AIDA::IHistogram2D * book2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D histogram
Definition: GaudiHistos_2DFixedBinning.icpp:7
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot2D() [2/4]

template<class PBASE >

AIDA::IHistogram2D * GaudiHistos< PBASE >::plot2D | ( | const double | valueX,
|  | const double | valueY,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | lowX,
|  | const double | highX,
|  | const double | lowY,
|  | const double | highY,
|  | const unsigned long | binsX = `50`,
|  | const unsigned long | binsY = `50`,
|  | const double | weight = `1.0`
| ) |  | const

fill the 2D histogram with forced ID assignment (book on demand)

const double mass1 = ... ;
const double mass2 = ... ;
plot2D( mass1, mass2, 15,
"Invariant Mass2 versus Mass1" ,2.5 ,3.5, 4.5, 5.5, 100, 200 );

This example illustrates the filling of the 2D histogram ID=15 titled `"Invariant Mass2 versus Mass1"` with values `mass1` and `mass2` .

If the histogram with given title does not exist yet it will be automatically booked with parameters `lowX` equal to 2.5, `highX` equal to 3.5, `lowY` equal to 4.5, `highY` equal to 5.5, `binsX` equal to 100 and `binsY` equal to 200.

It is also possible to use literal IDs. For example :-

const double mass1 = ... ;
const double mass2 = ... ;
plot2D( mass1, mass2, "mass",
"Invariant Mass2 versus Mass1" ,2.5 ,3.5, 4.5, 5.5, 100, 200 );

Will book the same histogram, using the id "mass".

It is also possible using literal IDs, to place histograms in sub-directories from the main histogram directory, using for example :-

const double mass1 = ... ;
const double mass2 = ... ;
plot2D( mass1, mass2, "subdir/mass",
"Invariant Mass2 versus Mass1" ,2.5 ,3.5, 4.5, 5.5, 100, 200 );

Which will create the histogram "mass" in the sub-directory "subdir". Histograms can also be created in sub-directories with numeric IDs if IDs such as "subdir/1" are used.

Attention
  If the histogram with given ID is already booked through automatic assignment of histogram ID, the error will not be detected. Therefore it is recommended to use non-trivial histogram ID offset (property "HistoOffSet") if one need to combine these techniques together It is still desirable to use the unique histogram title to avoid a bad interference

See also
  AIDA::IHistogram2D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  ID | Histogram ID to use
  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  lowY | low y limit for histogram
  highY | high y limit for histogram
  binsX | number of bins in x
  binsY | number of bins in y
  weight | weight

Returns
  pointer to AIDA 2D histogram

Definition at line 124 of file GaudiHistos_2DFixedBinning.icpp.

127 {
128 AIDA::IHistogram2D* h( nullptr );
129 // produce histograms ?
130 if ( produceHistos() ) {
131 // retrieve or book the histogram
132 h = histo2D( ID );
133 if ( !h ) { h = book2D( ID, title, lowX, highX, binsX, lowY, highY, binsY ); }
134 // fill the histogram
135 h = fill( h, valueX, valueY, weight, title );
136 }
137 return h;
138 }
GaudiHistos::book2D
AIDA::IHistogram2D * book2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D histogram
Definition: GaudiHistos_2DFixedBinning.icpp:7
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot2D() [3/4]

template<class PBASE >

AIDA::IHistogram2D * GaudiHistos< PBASE >::plot2D | ( | const double | valueX,
|  | const double | valueY,
|  | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY,
|  | const double | weight = `1.0`
| ) |  | const

Fill the 2D variable binning histogram (book on demand)

const GaudiAlg::HistoBinEdges edgesX = ...;
const GaudiAlg::HistoBinEdges edgesY = ...;
const double mass1 = ... ;
const double mass2 = ... ;
plot2D( mass1, mass2,
"Invariant Mass2 versus Mass1" , edgesX, edgesY );

This example illustrates the filling of the 2D histogram titled `"Invariant Mass2 versus Mass1"` with values `mass1` and `mass2` .

If the histogram with given title does not exist yet it will be automatically booked with the given histogram bin edges.

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

See also
  AIDA::IHistogram2D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  title | histogram title (must be unique within the algorithm)
  edgesX | The histogram x bin edges
  edgesY | The histogram y bin edges
  weight | weight

Returns
  pointer to AIDA 2D histogram

Definition at line 78 of file GaudiHistos_2DVariableBinning.icpp.

80 {
81 AIDA::IHistogram2D* h( nullptr );
82 if ( produceHistos() ) {
83 // retrieve or book the histogram
84 h = histo2D( title );
85 if ( !h ) { h = book2D( title, edgesX, edgesY ); }
86 // fill the histogram
87 h = fill( h, valueX, valueY, weight, title );
88 }
89 return h;
90 }
GaudiHistos::book2D
AIDA::IHistogram2D * book2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D histogram
Definition: GaudiHistos_2DFixedBinning.icpp:7
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot2D() [4/4]

template<class PBASE >

AIDA::IHistogram2D * GaudiHistos< PBASE >::plot2D | ( | const double | valueX,
|  | const double | valueY,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY,
|  | const double | weight = `1.0`
| ) |  | const

fill the 2D variable histogram with forced ID assignment (book on demand)

const GaudiAlg::HistoBinEdges edgesX = ...;
const GaudiAlg::HistoBinEdges edgesY = ...;
const double mass1 = ... ;
const double mass2 = ... ;
plot2D( mass1, mass2, 15,
"Invariant Mass2 versus Mass1", edgesX, edgesY );

This example illustrates the filling of the 2D histogram ID=15 titled `"Invariant Mass2 versus Mass1"` with values `mass1` and `mass2` .

If the histogram with given title does not exist yet it will be automatically booked with the given histogram bin edges.

It is also possible to use literal IDs. For example :-

const GaudiAlg::HistoBinEdges edgesX = ...;
const GaudiAlg::HistoBinEdges edgesY = ...;
const double mass1 = ... ;
const double mass2 = ... ;
plot2D( mass1, mass2, "mass",
"Invariant Mass2 versus Mass1", edgesX, edgesY );

Will book the same histogram, using the id "mass".

It is also possible using literal IDs, to place histograms in sub-directories from the main histogram directory, using for example :-

const GaudiAlg::HistoBinEdges edgesX = ...;
const GaudiAlg::HistoBinEdges edgesY = ...;
const double mass1 = ... ;
const double mass2 = ... ;
plot2D( mass1, mass2, "subdir/mass",
"Invariant Mass2 versus Mass1", edgesX, edgesY );

Which will create the histogram "mass" in the sub-directory "subdir". Histograms can also be created in sub-directories with numeric IDs if IDs such as "subdir/1" are used.

Attention
  If the histogram with given ID is already booked through automatic assignment of histogram ID, the error will not be detected. Therefore it is recommended to use non-trivial histogram ID offset (property "HistoOffSet") if one need to combine these techniques together It is still desirable to use the unique histogram title to avoid a bad interference

See also
  AIDA::IHistogram2D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  ID | Histogram ID to use
  title | histogram title (must be unique within the algorithm)
  edgesX | The histogram x bin edges
  edgesY | The histogram y bin edges
  weight | weight

Returns
  pointer to AIDA 2D histogram

Definition at line 95 of file GaudiHistos_2DVariableBinning.icpp.

97 {
98 AIDA::IHistogram2D* h( nullptr );
99 if ( produceHistos() ) {
100 // retrieve or book the histogram
101 h = histo2D( ID );
102 if ( !h ) { h = book2D( ID, title, edgesX, edgesY ); }
103 // fill
104 h = fill( h, valueX, valueY, weight, title );
105 }
106 return h;
107 }
GaudiHistos::book2D
AIDA::IHistogram2D * book2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D histogram
Definition: GaudiHistos_2DFixedBinning.icpp:7
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::histo2D
AIDA::IHistogram2D * histo2D(const std::string &title) const
access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL
Definition: GaudiHistos.h:2287
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot3D() [1/4]

template<class PBASE >

AIDA::IHistogram3D * GaudiHistos< PBASE >::plot3D | ( | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const std::string & | title,
|  | const double | lowX,
|  | const double | highX,
|  | const double | lowY,
|  | const double | highY,
|  | const double | lowZ,
|  | const double | highZ,
|  | const unsigned long | binsX = `10`,
|  | const unsigned long | binsY = `10`,
|  | const unsigned long | binsZ = `10`,
|  | const double | weight = `1.0`
| ) |  | const

fill the 3D histogram (book on demand)

const double X = ... ;
const double Y = ... ;
const double Z = ... ;
plot3D( X, Y, Z, "Space Points" ,
2.5 , 3.5 ,
4.5 , 5.5 ,
6.5 , 7.5 ,
10, 20, 30 );

This example illustrates the filling of the 3D histogram titled `"Space Points"` with values `X`, `Y` and `Z`.

If the histogram with given title does not exist yet it will be automatically booked with parameters `lowX` equal to 2.5, `highX` equal to 3.5, `lowY` equal to 4.5, `highY` equal to 5.5, `lowZ` equal to 6.5, `highZ` equal to 7.5, `binsX` equal to 10, `binsY` equal to 20 and `binsZ` equal to 30.

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

See also
  AIDA::IHistogram3D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  valueZ | z value to be filled
  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  lowY | low y limit for histogram
  highY | high y limit for histogram
  lowZ | low z limit for histogram
  highZ | high z limit for histogram
  binsX | number of bins in x
  binsY | number of bins in y
  binsZ | number of bins in z
  weight | weight

Returns
  pointer to AIDA 3D histogram

Definition at line 111 of file GaudiHistos_3DFixedBinning.icpp.

114 {
115 AIDA::IHistogram3D* h( nullptr );
116 if ( produceHistos() ) {
117 // retrieve or book the histogram
118 h = histo3D( title );
119 if ( !h ) { h = book3D( title, lowX, highX, binsX, lowY, highY, binsY, lowZ, highZ, binsZ ); }
120 // fill the histogram
121 h = fill( h, valueX, valueY, valueZ, weight, title );
122 }
123 return h;
124 }
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295
GaudiHistos::book3D
AIDA::IHistogram3D * book3D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const
book the 3D histogram
Definition: GaudiHistos_3DFixedBinning.icpp:7
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot3D() [2/4]

template<class PBASE >

AIDA::IHistogram3D * GaudiHistos< PBASE >::plot3D | ( | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | lowX,
|  | const double | highX,
|  | const double | lowY,
|  | const double | highY,
|  | const double | lowZ,
|  | const double | highZ,
|  | const unsigned long | binsX = `10`,
|  | const unsigned long | binsY = `10`,
|  | const unsigned long | binsZ = `10`,
|  | const double | weight = `1.0`
| ) |  | const

fill the 3D histogram with forced ID assignment (book on demand)

const double X = ... ;
const double Y = ... ;
const double Z = ... ;
plot3D( X, Y, Z,
15 , "Space Points" ,
2.5 ,3.5, 4.5, 5.5, 6.5, 7.5, 10, 20, 30 );

This example illustrates the filling of the 3D histogram ID=15 titled `"Space Points"` with values `X`, `Y` and `Z`.

If the histogram with given title does not exist yet it will be automatically booked with parameters `lowX` equal to 2.5, `highX` equal to 3.5, `lowY` equal to 4.5, `highY` equal to 5.5, `lowZ` equal to 6.5, `highZ` equal to 7.5, `binsX` equal to 10, `binsY` equal to 20 and `binsZ` equal to 30.

It is also possible to use literal IDs. For example :-

const double X = ... ;
const double Y = ... ;
const double Z = ... ;
plot3D( X, Y, Z,
"space", "Space Points" ,
2.5 ,3.5, 4.5, 5.5, 6.5, 7.5, 10, 20, 30 );

Will book the same histogram, using the id "space".

It is also possible using literal IDs, to place histograms in sub-directories from the main histogram directory, using for example :-

const double X = ... ;
const double Y = ... ;
const double Z = ... ;
plot3D( X, Y, Z,
"subdir/space", "Space Points" ,
2.5 ,3.5, 4.5, 5.5, 6.5, 7.5, 10, 20, 30 );

Which will create the histogram "space" in the sub-directory "subdir". Histograms can also be created in sub-directories with numeric IDs if IDs such as "subdir/1" are used.

Attention
  If the histogram with given ID is already booked through automatic assignment of histogram ID, the error will not be detected. Therefore it is recommended to use non-trivial histogram ID offset (property "HistoOffSet") if one need to combine these techniques together It is still desirable to use the unique histogram title to avoid a bad interference

See also
  AIDA::IHistogram3D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  valueZ | z value to be filled
  ID | Histogram ID to use
  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  lowY | low y limit for histogram
  highY | high y limit for histogram
  lowZ | low z limit for histogram
  highZ | high z limit for histogram
  binsX | number of bins in x
  binsY | number of bins in y
  binsZ | number of bins in z
  weight | weight

Returns
  pointer to AIDA 3D histogram

Definition at line 130 of file GaudiHistos_3DFixedBinning.icpp.

133 {
134 AIDA::IHistogram3D* h( nullptr );
135 if ( produceHistos() ) {
136 // retrieve or book the histogram
137 h = histo3D( ID );
138 if ( !h ) { h = book3D( ID, title, lowX, highX, binsX, lowY, highY, binsY, lowZ, highZ, binsZ ); }
139 // fill the histogram
140 h = fill( h, valueX, valueY, valueZ, weight, title );
141 }
142 return h;
143 }
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295
GaudiHistos::book3D
AIDA::IHistogram3D * book3D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const
book the 3D histogram
Definition: GaudiHistos_3DFixedBinning.icpp:7
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot3D() [3/4]

template<class PBASE >

AIDA::IHistogram3D * GaudiHistos< PBASE >::plot3D | ( | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY,
|  | const HistoBinEdges & | edgesZ,
|  | const double | weight = `1.0`
| ) |  | const

Fill the 3D variable binning histogram (book on demand)

const GaudiAlg::HistoBinEdges edgesX = ...;
const GaudiAlg::HistoBinEdges edgesY = ...;
const GaudiAlg::HistoBinEdges edgesZ = ...;
const double X = ... ;
const double Y = ... ;
const double Z = ... ;
plot3D( X, Y, Z, "Space Points", edgesX, edgesY, edgesZ );

This example illustrates the filling of the 3D histogram titled `"Space Points"` with values `X`, `Y` and `Z`.

If the histogram with given title does not exist yet it will be automatically booked with the given histogram bin edges.

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

See also
  AIDA::IHistogram3D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  valueZ | z value to be filled
  title | histogram title (must be unique within the algorithm)
  edgesX | The histogram x bin edges
  edgesY | The histogram y bin edges
  edgesZ | The histogram z bin edges
  weight | weight

Returns
  pointer to AIDA 3D histogram

Definition at line 79 of file GaudiHistos_3DVariableBinning.icpp.

82 {
83 AIDA::IHistogram3D* h( nullptr );
84 if ( produceHistos() ) {
85 // retrieve or book the histogram
86 h = histo3D( title );
87 if ( !h ) { h = book3D( title, edgesX, edgesY, edgesZ ); }
88 // fill the histogram
89 h = fill( h, valueX, valueY, valueZ, weight, title );
90 }
91 return h;
92 }
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295
GaudiHistos::book3D
AIDA::IHistogram3D * book3D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const
book the 3D histogram
Definition: GaudiHistos_3DFixedBinning.icpp:7
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ plot3D() [4/4]

template<class PBASE >

AIDA::IHistogram3D * GaudiHistos< PBASE >::plot3D | ( | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY,
|  | const HistoBinEdges & | edgesZ,
|  | const double | weight = `1.0`
| ) |  | const

fill the 3D histogram with forced ID assignment (book on demand)

const GaudiAlg::HistoBinEdges edgesX = ...;
const GaudiAlg::HistoBinEdges edgesY = ...;
const GaudiAlg::HistoBinEdges edgesZ = ...;
const double X = ... ;
const double Y = ... ;
const double Z = ... ;
plot3D( X, Y, Z, "Space Points", edgesX, edgesY, edgesZ );

This example illustrates the filling of the 3D histogram ID=15 titled `"Space Points"` with values `X`, `Y` and `Z`.

If the histogram with given title does not exist yet it will be automatically booked with the given histogram bin edges and histogram ID.

It is also possible to use literal IDs. For example :-

const GaudiAlg::HistoBinEdges edgesX = ...;
const GaudiAlg::HistoBinEdges edgesY = ...;
const GaudiAlg::HistoBinEdges edgesZ = ...;
const double X = ... ;
const double Y = ... ;
const double Z = ... ;
plot3D( X, Y, Z,
"space", "Space Points" ,
edgesX, edgesY, edgesZ );

Will book the same histogram, using the id "space".

It is also possible using literal IDs, to place histograms in sub-directories from the main histogram directory, using for example :-

const GaudiAlg::HistoBinEdges edgesX = ...;
const GaudiAlg::HistoBinEdges edgesY = ...;
const GaudiAlg::HistoBinEdges edgesZ = ...;
const double X = ... ;
const double Y = ... ;
const double Z = ... ;
plot3D( X, Y, Z,
"subdir/space", "Space Points" ,
edgesX, edgesY, edgesZ );

Which will create the histogram "space" in the sub-directory "subdir". Histograms can also be created in sub-directories with numeric IDs if IDs such as "subdir/1" are used.

Attention
  If the histogram with given ID is already booked through automatic assignment of histogram ID, the error will not be detected. Therefore it is recommended to use non-trivial histogram ID offset (property "HistoOffSet") if one need to combine these techniques together It is still desirable to use the unique histogram title to avoid a bad interference

See also
  AIDA::IHistogram3D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  valueZ | z value to be filled
  ID | Histogram ID to use
  title | histogram title (must be unique within the algorithm)
  edgesX | The histogram x bin edges
  edgesY | The histogram y bin edges
  edgesZ | The histogram z bin edges
  weight | weight

Returns
  pointer to AIDA 3D histogram

Definition at line 97 of file GaudiHistos_3DVariableBinning.icpp.

100 {
101 AIDA::IHistogram3D* h( nullptr );
102 if ( produceHistos() ) {
103 // retrieve or book the histogram
104 h = histo3D( ID );
105 if ( !h ) { h = book3D( ID, title, edgesX, edgesY, edgesZ ); }
106 // fill
107 h = fill( h, valueX, valueY, valueZ, weight, title );
108 }
109 return h;
110 }
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::histo3D
AIDA::IHistogram3D * histo3D(const std::string &title) const
access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL
Definition: GaudiHistos.h:2295
GaudiHistos::book3D
AIDA::IHistogram3D * book3D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=10, const double lowY=0, const double highY=100, const unsigned long binsY=10, const double lowZ=0, const double highZ=100, const unsigned long binsZ=10) const
book the 3D histogram
Definition: GaudiHistos_3DFixedBinning.icpp:7
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ printHistos()

template<class PBASE >

int GaudiHistos< PBASE >::printHistos | ( | const MSG::Level | level = `MSG::ALWAYS` | ) | const

perform the actual printout of histograms

Parameters

  level | The message level to print at

Returns
  number of active histograms

Definition at line 166 of file GaudiHistos.icpp.

166 {
167 using namespace Gaudi::Utils::Histos;
168
169 if ( noHistos() ) {
170 if ( this->msgLevel( MSG::DEBUG ) ) { this->msgStream( level ) << "No histograms are booked" << endmsg; }
171 return 0; // RETURN
172 }
173
174 MsgStream& msg = this->msgStream( level );
175
176 // Printout all histograms
177
178 if ( !histo1DMapID().empty() ) {
179 msg << "1D histograms in directory "
180 << "\"" << histoPath() << "\" : " << histo1DMapID().size();
181 const Gaudi::Utils::Histos::Table table( m_histo1DTableFormat, m_histo1DTableHeader );
182 if ( !table.header().empty() ) {
183 msg << std::endl << Gaudi::Utils::Histos::format( "ID", table.header(), m_histo1DTableFormatShort );
184 }
185 for ( const auto& entry : ordered( histo1DMapID() ) ) {
186 const auto* aida = entry.second;
187 if ( !aida ) {
188 this->error() << "IHistogram1D points to NULL" << endmsg;
189 continue;
190 }
191 // format and print the row
192 msg << std::endl << table.toString( aida, HistoID( entry.first ), m_histo1DTableFormatShort );
193 }
194 msg << endmsg;
195 }
196 // ==========================================================================
197 if ( !histo2DMapID().empty() ) {
198 msg << "2D histograms in directory "
199 << "\"" << histoPath() << "\" : " << histo2DMapID().size();
200
201 for ( const auto& entry : ordered( histo2DMapID() ) ) {
202 const auto* aida = entry.second;
203 if ( !aida ) {
204 this->error() << "IHistogram2D points to NULL" << endmsg;
205 continue;
206 }
207 msg << std::endl << GaudiAlg::Print2D::toString( aida, entry.first );
208 }
209 msg << endmsg;
210 }
211 // ==========================================================================
212 if ( !histo3DMapID().empty() ) {
213 msg << "3D histograms in directory "
214 << "\"" << histoPath() << "\" : " << histo3DMapID().size();
215 for ( const auto& entry : ordered( histo3DMapID() ) ) {
216 const auto* aida = entry.second;
217 if ( !aida ) {
218 this->error() << "IHistogram3D points to NULL" << endmsg;
219 continue;
220 }
221 msg << std::endl << GaudiAlg::Print3D::toString( aida, entry.first );
222 }
223 msg << endmsg;
224 }
225 // ==========================================================================
226 if ( !profile1DMapID().empty() ) {
227 msg << "1D profile histograms in directory "
228 << "\"" << histoPath() << "\" : " << profile1DMapID().size();
229 const Gaudi::Utils::Histos::Table table( m_histo1DTableFormat, m_histo1DTableHeader );
230 if ( !table.header().empty() ) {
231 msg << std::endl << Gaudi::Utils::Histos::format( "ID", table.header(), m_histo1DTableFormatShort );
232 }
233 for ( const auto& entry : ordered( profile1DMapID() ) ) {
234 const auto* aida = entry.second;
235 if ( !aida ) {
236 this->error() << "IProfile1D points to NULL" << endmsg;
237 continue;
238 }
239 msg << std::endl << table.toString( aida, HistoID( entry.first ), m_histo1DTableFormatShort );
240 }
241 msg << endmsg;
242 }
243 // ==========================================================================
244 if ( !profile2DMapID().empty() ) {
245 msg << "2D profile histograms in directory "
246 << "\"" << histoPath() << "\" : " << profile2DMapID().size();
247 for ( const auto& entry : ordered( profile2DMapID() ) ) {
248 const auto* aida = entry.second;
249 if ( !aida ) {
250 this->error() << "IProfile2D points to NULL" << endmsg;
251 continue;
252 }
253 msg << std::endl << GaudiAlg::Print2DProf::toString( aida, entry.first );
254 }
255 msg << endmsg;
256 }
257 //
258 return this->totalNumberOfHistos();
259 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2548
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2650
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:59
GaudiHistos::m_histo1DTableFormatShort
Gaudi::Property< std::string > m_histo1DTableFormatShort
Definition: GaudiHistos.h:2762
Gaudi::Utils::Histos::format
GAUDI_API std::string format(const AIDA::IHistogram1D *histo, const std::string &fmt)
Make the string representation of the histogram according to the specified format.
Definition: HistoTableFormat.cpp:234
MSG::DEBUG
Definition: IMessageSvc.h:15
std::endl
T endl(T... args)
Gaudi::Utils::Histos
Collection of useful utilities for manipulations with AIDA hisgograms.
Definition: Fill.h:26
GaudiHistos::m_histo1DTableHeader
Gaudi::Property< std::string > m_histo1DTableHeader
Definition: GaudiHistos.h:2764
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2600
GaudiHistos::m_histo1DTableFormat
Gaudi::Property< std::string > m_histo1DTableFormat
Definition: GaudiHistos.h:2759
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:360
GaudiHistos::noHistos
bool noHistos() const
Check if all histogram maps are empty.
Definition: GaudiHistos.icpp:264
Gaudi::Utils::Histos::Table
Simple class for the customizeble printout of the histogram tables.
Definition: HistoTableFormat.h:427
GaudiAlg::Print3D::toString
static std::string toString(const AIDA::IHistogram3D *aida, const GaudiAlg::HistoID &ID)
Definition: Print.cpp:89
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:189
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8
GaudiAlg::Print2D::toString
static std::string toString(const AIDA::IHistogram2D *aida, const GaudiAlg::HistoID &ID)
Definition: Print.cpp:75
gaudirun.level
level
Definition: gaudirun.py:334
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2448
GaudiHistos::totalNumberOfHistos
unsigned int totalNumberOfHistos() const
Returns the total number of histograms (of all types) currently booked.
Definition: GaudiHistos.icpp:321
GaudiAlg::Print2DProf::toString
static std::string toString(const AIDA::IProfile2D *aida, const GaudiAlg::HistoID &ID)
Definition: Print.cpp:118
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2498

## ◆ produceHistos()

template<class PBASE>

bool GaudiHistos< PBASE >::produceHistos | ( |  | ) | const
| inline

get the flag for histogram production (property "HistoProduce")

Definition at line 2371 of file GaudiHistos.h.

2371 { return m_produceHistos; }
GaudiHistos::m_produceHistos
Gaudi::Property< bool > m_produceHistos
Definition: GaudiHistos.h:2736

## ◆ profile1D() [1/6]

template<class PBASE >

AIDA::IProfile1D * GaudiHistos< PBASE >::profile1D | ( | const double | valueX,
|  | const double | valueY,
|  | const std::string & | title,
|  | const double | lowX,
|  | const double | highX,
|  | const unsigned long | binsX = `100`,
|  | const std::string & | opt = `""`,
|  | const double | lowY = `-std::numeric_limits<double>::max()`,
|  | const double | highY = `std::numeric_limits<double>::max()`,
|  | const double | weight = `1.0`
| ) |  | const

fill the 1D profile histogram (book on demand)

const double mass1 = ... ;
const double mass2 = ... ;
profile1D( mass1, mass2, "Invariant Mass2 versus Mass1" ,2.5 ,3.5, 100 );

This example illustrates the filling of the 1D profile histogram titled `"Invariant Mass2 versus Mass1"` with values `mass1` and `mass2` .

If the histogram with given title does not exist yet it will be automatically booked with parameters `lowX` equal to 2.5, `highX` equal to 3.5, `binsX` equal to 100

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

See also
  AIDA::IProfile1D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  binsX | number of bins in x
  opt | the options, used for evaluation of errors
  lowY | the min cut-off for y-values
  highY | the max cut-off for y-values
  weight | weight

Returns
  pointer to AIDA 1D profile histogram

Definition at line 104 of file GaudiHistos_1DProfFixedBinning.icpp.

107 {
108 AIDA::IProfile1D* h = nullptr;
109 if ( produceHistos() ) {
110 // retrieve or book the histogram
111 h = profile1D( title );
112 if ( !h ) { h = bookProfile1D( title, lowX, highX, binsX, opt, lowY, highY ); }
113 // fill the histogram
114 h = fill( h, valueX, valueY, weight, title );
115 }
116 return h;
117 }
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:104
GaudiHistos::bookProfile1D
AIDA::IProfile1D * bookProfile1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max()) const
book the 1D profile histogram
Definition: GaudiHistos_1DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ profile1D() [2/6]

template<class PBASE >

AIDA::IProfile1D * GaudiHistos< PBASE >::profile1D | ( | const double | valueX,
|  | const double | valueY,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | lowX,
|  | const double | highX,
|  | const unsigned long | binsX = `100`,
|  | const std::string & | opt = `""`,
|  | const double | lowY = `-std::numeric_limits<double>::max()`,
|  | const double | highY = `std::numeric_limits<double>::max()`,
|  | const double | weight = `1.0`
| ) |  | const

fill the 1D profile histogram with forced ID assignment (book on demand)

const double mass1 = ... ;
const double mass2 = ... ;
profile1D( mass1, mass2,
15, "Invariant Mass2 versus Mass1" ,2.5 ,3.5, 100 );

This example illustrates the filling of the 1D profile histogram with ID=15 titled `"Invariant Mass2 versus Mass1"` with values `mass1` and `mass2` .

If the histogram with given title does not exist yet it will be automatically booked with parameters `lowX` equal to 2.5, `highX` equal to 3.5, `binsX` equal to 100

It is also possible to use literal IDs. For example :-

const double mass1 = ... ;
const double mass2 = ... ;
profile1D( mass1, mass2,
"mass", "Invariant Mass2 versus Mass1" ,2.5 ,3.5, 100 );

Will book the same histogram, using the id "mass".

It is also possible using literal IDs, to place histograms in sub-directories from the main histogram directory, using for example :-

const double mass1 = ... ;
const double mass2 = ... ;
profile1D( mass1, mass2,
"subdir/mass", "Invariant Mass2 versus Mass1" ,2.5 ,3.5, 100 );

Which will create the histogram "mass" in the sub-directory "subdir". Histograms can also be created in sub-directories with numeric IDs if IDs such as "subdir/1" are used.

See also
  AIDA::IProfile1D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  ID | histogram identifier
  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  binsX | number of bins in x
  opt | the options, used for evaluation of errors
  lowY | the min cut-off for y-values
  highY | the max cut-off for y-values
  weight | weight

Returns
  pointer to AIDA 1D profile histogram

Definition at line 122 of file GaudiHistos_1DProfFixedBinning.icpp.

125 {
126 AIDA::IProfile1D* h = nullptr;
127 if ( produceHistos() ) {
128 // retrieve or book the histogram
129 h = profile1D( ID );
130 if ( !h ) { h = bookProfile1D( ID, title, lowX, highX, binsX, opt, lowY, highY ); }
131 // fill the histogram
132 h = fill( h, valueX, valueY, weight, title );
133 }
134 return h;
135 }
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:104
GaudiHistos::bookProfile1D
AIDA::IProfile1D * bookProfile1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max()) const
book the 1D profile histogram
Definition: GaudiHistos_1DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ profile1D() [3/6]

template<class PBASE >

AIDA::IProfile1D * GaudiHistos< PBASE >::profile1D | ( | const double | valueX,
|  | const double | valueY,
|  | const std::string & | title,
|  | const HistoBinEdges & | edges,
|  | const double | weight = `1.0`
| ) |  | const

fill the 1D variable binning profile histogram (book on demand)

const GaudiAlg::HistoBinEdges edges = ...;
const double mass1 = ... ;
const double mass2 = ... ;
profile1D( mass1, mass2, "Invariant Mass2 versus Mass1", edges );

This example illustrates the filling of the 1D profile histogram titled `"Invariant Mass2 versus Mass1"` with values `mass1` and `mass2` .

If the histogram with given title does not exist yet it will be automatically booked with the given histogram bin edges.

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

See also
  AIDA::IProfile1D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  title | histogram title (must be unique within the algorithm)
  edges | The histogram bin edges
  weight | weight

Returns
  pointer to AIDA 1D profile histogram

Definition at line 75 of file GaudiHistos_1DProfVariableBinning.icpp.

76 {
77 AIDA::IProfile1D* h( nullptr );
78 if ( produceHistos() ) {
79 // retrieve or book the histogram
80 h = profile1D( title );
81 if ( !h ) { h = bookProfile1D( title, edges ); }
82 // fill the histogram
83 h = fill( h, valueX, valueY, weight, title );
84 }
85 return h;
86 }
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:104
GaudiHistos::bookProfile1D
AIDA::IProfile1D * bookProfile1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max()) const
book the 1D profile histogram
Definition: GaudiHistos_1DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ profile1D() [4/6]

template<class PBASE >

AIDA::IProfile1D * GaudiHistos< PBASE >::profile1D | ( | const double | valueX,
|  | const double | valueY,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const HistoBinEdges & | edges,
|  | const double | weight = `1.0`
| ) |  | const

fill the 1D variable binning profile histogram with forced ID assignment (book on demand)

const GaudiAlg::HistoBinEdges edges = ...;
const double mass1 = ... ;
const double mass2 = ... ;
profile1D( mass1, mass2,
15, "Invariant Mass2 versus Mass1", edges );

This example illustrates the filling of the 1D profile histogram with ID=15 titled `"Invariant Mass2 versus Mass1"` with values `mass1` and `mass2` .

If the histogram with given ID does not exist yet it will be automatically booked with the given histogram bin edges.

It is also possible to use literal IDs. For example :-

const GaudiAlg::HistoBinEdges edges = ...;
const double mass1 = ... ;
const double mass2 = ... ;
profile1D( mass1, mass2,
"mass", "Invariant Mass2 versus Mass1", edges );

Will book the same histogram, using the id "mass".

It is also possible using literal IDs, to place histograms in sub-directories from the main histogram directory, using for example :-

const GaudiAlg::HistoBinEdges edges = ...;
const double mass1 = ... ;
const double mass2 = ... ;
profile1D( mass1, mass2,
"subdir/mass", "Invariant Mass2 versus Mass1", edges );

Which will create the histogram "mass" in the sub-directory "subdir". Histograms can also be created in sub-directories with numeric IDs if IDs such as "subdir/1" are used.

See also
  AIDA::IProfile1D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  ID | histogram identifier
  title | histogram title (must be unique within the algorithm)
  edges | The histogram bin edges
  weight | weight

Returns
  pointer to AIDA 1D profile histogram

Definition at line 91 of file GaudiHistos_1DProfVariableBinning.icpp.

93 {
94 AIDA::IProfile1D* h( nullptr );
95 if ( produceHistos() ) {
96 // retrieve or book the histogram
97 h = profile1D( ID );
98 if ( !h ) { h = bookProfile1D( ID, title, edges ); }
99 // fill the histogram
100 h = fill( h, valueX, valueY, weight, title );
101 }
102 return h;
103 }
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::profile1D
AIDA::IProfile1D * profile1D(const double valueX, const double valueY, const std::string &title, const double lowX, const double highX, const unsigned long binsX=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max(), const double weight=1.0) const
fill the 1D profile histogram (book on demand)
Definition: GaudiHistos_1DProfFixedBinning.icpp:104
GaudiHistos::bookProfile1D
AIDA::IProfile1D * bookProfile1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100, const std::string &opt="", const double lowY=-std::numeric_limits< double >::max(), const double highY=std::numeric_limits< double >::max()) const
book the 1D profile histogram
Definition: GaudiHistos_1DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ profile1D() [5/6]

template<class PBASE>

AIDA::IProfile1D* GaudiHistos< PBASE >::profile1D | ( | const std::string & | title | ) | const
| inline

access the EXISTING 1D profile histogram by title return the pointer to existing 1D profile histogram or NULL

Definition at line 2303 of file GaudiHistos.h.

2303 {
2304 auto found = profile1DMapTitle().find( title );
2305 return profile1DMapTitle().end() != found ? found->second : nullptr;
2306 }
GaudiUtils::Map::end
iterator end()
Definition: Map.h:130
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:147
GaudiHistos::profile1DMapTitle
const Profile1DMapTitle & profile1DMapTitle() const
get access to the map of all 1D profile histograms indexed via their title
Definition: GaudiHistos.h:2577

## ◆ profile1D() [6/6]

template<class PBASE >

AIDA::IProfile1D * GaudiHistos< PBASE >::profile1D | ( | const HistoID & | ID | ) | const

access the EXISTING 1D profile histogram by ID return the pointer to existing 1D profile histogram or NULL

Definition at line 307 of file GaudiHistos.icpp.

307 {
308 return lookup_( profile1DMapID(), ID );
309 }
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2600

## ◆ profile1DMapID()

template<class PBASE>

const Profile1DMapID& GaudiHistos< PBASE >::profile1DMapID | ( |  | ) | const
| inline

get access to the map of 1D profile histograms index via a ID

// iterate over the map!
for ( const auto& entry : profile1DMapID() )
{
// histogram ID
const HistoID ID = entry.first ;
// histogram itself
AIDA::IProfile1D* h = entry.second ;
if ( 0 == h ) { continue ;}
std::cout << " Histogram ID " << ID
<< " Histogram title " << h->title() << std::endl ;
}

Definition at line 2600 of file GaudiHistos.h.

2600 { return m_profile1DMapID; }
GaudiHistos::m_profile1DMapID
Profile1DMapID m_profile1DMapID
the actual storage/access of 1D profile histograms by unique ID
Definition: GaudiHistos.h:2795

## ◆ profile1DMapTitle()

template<class PBASE>

const Profile1DMapTitle& GaudiHistos< PBASE >::profile1DMapTitle | ( |  | ) | const
| inline

get access to the map of all 1D profile histograms indexed via their title

Using this method one can inspect e.g. a list of active histograms

const Profile1DMapTitle& histos = profile1DMapTitle() ;
// iterate over the map!
for ( Profile1DMapTitle::const_iterator entry = histos.begin() ;
histos.end() != entry ; ++entry )
{
// histogram title
const std::string& title = entry->first ;
// histogram itself
AIDA::IProfile1D* hist = entry->second ;
if( 0 == hist ) { continue ; } // ATTENTION!
std::cout << " Histogram title " << title << std::endl ;
}

Attention
  The map COULD contains NULL pointers, the check before use is mandatory!

Definition at line 2577 of file GaudiHistos.h.

2577 { return m_profile1DMapTitle; }
GaudiHistos::m_profile1DMapTitle
Profile1DMapTitle m_profile1DMapTitle
the actual storage/access of 1D profile histograms by unique title
Definition: GaudiHistos.h:2793

## ◆ profile2D() [1/6]

template<class PBASE >

AIDA::IProfile2D * GaudiHistos< PBASE >::profile2D | ( | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const std::string & | title,
|  | const double | lowX,
|  | const double | highX,
|  | const double | lowY,
|  | const double | highY,
|  | const unsigned long | binsX = `50`,
|  | const unsigned long | binsY = `50`,
|  | const double | weight = `1.0`
| ) |  | const

fill the 2D profile histogram (book on demand)

const double X = ... ;
const double Y = ... ;
const double Z = ... ;
profile2( X, Y, Z, "Space Points" ,2.5 ,3.5, 4.5, 5.5, 10, 20 );

This example illustrates the filling of the 2D profile histogram titled `"Space Points"` with values `X`, `Y` and `Z`.

If the histogram with given title does not exist yet it will be automatically booked with parameters `lowX` equal to 2.5, `highX` equal to 3.5, `lowY` equal to 4.5, `highY` equal to 5.5, `binsX` equal to 10, `binsY` equal to 20.

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

See also
  AIDA::IProfile2D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  valueZ | z value to be filled
  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  lowY | low y limit for histogram
  highY | high y limit for histogram
  binsX | number of bins in x
  binsY | number of bins in y
  weight | weight

Returns
  pointer to AIDA 2D profile histogram

Definition at line 103 of file GaudiHistos_2DProfFixedBinning.icpp.

106 {
107 AIDA::IProfile2D* h = nullptr;
108 if ( produceHistos() ) {
109 // retrieve or book the histogram
110 h = profile2D( title );
111 if ( 0 == h ) { h = bookProfile2D( title, lowX, highX, binsX, lowY, highY, binsY ); }
112 // fill the histogram
113 h = fill( h, valueX, valueY, valueZ, weight, title );
114 }
115 return h;
116 }
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:103
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::bookProfile2D
AIDA::IProfile2D * bookProfile2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D profile histogram
Definition: GaudiHistos_2DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ profile2D() [2/6]

template<class PBASE >

AIDA::IProfile2D * GaudiHistos< PBASE >::profile2D | ( | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const double | lowX,
|  | const double | highX,
|  | const double | lowY,
|  | const double | highY,
|  | const unsigned long | binsX = `50`,
|  | const unsigned long | binsY = `50`,
|  | const double | weight = `1.0`
| ) |  | const

fill the 2D profile histogram with forced ID assignment (book on demand)

const double X = ... ;
const double Y = ... ;
const double Z = ... ;
profile2D( X, Y, Z, 15, "Space Points" ,2.5 ,3.5, 4.5, 5.5, 10, 20 );

This example illustrates the filling of the 2D profile histogram with ID=15 titled `"Space Points"` with values `X`, `Y` and `Z`.

If the histogram with given title does not exist yet it will be automatically booked with parameters `lowX` equal to 2.5, `highX` equal to 3.5, `lowY` equal to 4.5, `highY` equal to 5.5, `binsX` equal to 10, `binsY` equal to 20.

It is also possible to use literal IDs. For example :-

const double X = ... ;
const double Y = ... ;
const double Z = ... ;
profile2D( X, Y, Z, "space", "Space Points" ,2.5 ,3.5, 4.5, 5.5, 10, 20 );

Will book the same histogram, using the id "space".

It is also possible using literal IDs, to place histograms in sub-directories from the main histogram directory, using for example :-

const double X = ... ;
const double Y = ... ;
const double Z = ... ;
profile2D( X, Y, Z,
"subdir/space", "Space Points" ,2.5 ,3.5, 4.5, 5.5, 10, 20 );

Which will create the histogram "space" in the sub-directory "subdir". Histograms can also be created in sub-directories with numeric IDs if IDs such as "subdir/1" are used.

See also
  AIDA::IProfile2D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  valueZ | z value to be filled
  ID | histogram identifier
  title | histogram title (must be unique within the algorithm)
  lowX | low x limit for histogram
  highX | high x limit for histogram
  lowY | low y limit for histogram
  highY | high y limit for histogram
  binsX | number of bins in x
  binsY | number of bins in y
  weight | weight

Returns
  pointer to AIDA 2D profile histogram

Definition at line 121 of file GaudiHistos_2DProfFixedBinning.icpp.

125 {
126 AIDA::IProfile2D* h = nullptr;
127 if ( produceHistos() ) {
128 // retrieve or book the histogram
129 h = profile2D( ID );
130 if ( 0 == h ) { h = bookProfile2D( ID, title, lowX, highX, binsX, lowY, highY, binsY ); }
131 // fill the histogram
132 h = fill( h, valueX, valueY, valueZ, weight, title );
133 }
134 return h;
135 }
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:103
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::bookProfile2D
AIDA::IProfile2D * bookProfile2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D profile histogram
Definition: GaudiHistos_2DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ profile2D() [3/6]

template<class PBASE >

AIDA::IProfile2D * GaudiHistos< PBASE >::profile2D | ( | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY,
|  | const double | weight = `1.0`
| ) |  | const

fill the 2D variable binning profile histogram (book on demand)

const GaudiAlg::HistoBinEdges edgesX = ...;
const GaudiAlg::HistoBinEdges edgesY = ...;
const double X = ... ;
const double Y = ... ;
const double Z = ... ;
profile2D( X, Y, Z, "Space Points", edgesX, edgesY );

This example illustrates the filling of the 2D profile histogram titled `"Space Points"` with values `X`, `Y` and `Z`.

If the histogram with given title does not exist yet it will be automatically booked with the given histogram bin edges.

Attention
  The histogram will get a unique identifier automatically assigned which by default will be equal to the histogram title. An option exists to instead use numerical IDs. In this case the first histogram booked will be ID=1 the next ID=2 and so on. Note though this scheme is not recommended as it does NOT guarantee predictability of the ID a given histogram will be given when filled under conditional statements, since in these circumstances the order in which the histograms are first filled, and thus booked, will depend on the nature of the first few events read. This is particularly problematic when users submit many parallel 'sub-jobs' and then attempt to merge the final output ROOT (or HBOOK) files, since a given histogram could have different IDs in each of the sub-jobs. Consequently it is strongly recommended that users do not use numerical automatic IDs unless they are sure they understand what they are doing.

See also
  AIDA::IProfile2D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  valueZ | z value to be filled
  title | histogram title (must be unique within the algorithm)
  edgesX | The histogram x bin edges
  edgesY | The histogram x bin edges
  weight | weight

Returns
  pointer to AIDA 1D profile histogram

Definition at line 75 of file GaudiHistos_2DProfVariableBinning.icpp.

77 {
78 AIDA::IProfile2D* h( nullptr );
79 if ( produceHistos() ) {
80 // retrieve or book the histogram
81 h = profile2D( title );
82 if ( !h ) { h = bookProfile2D( title, edgesX, edgesY ); }
83 // fill the histogram
84 h = fill( h, valueX, valueY, valueZ, weight, title );
85 }
86 return h;
87 }
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:103
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::bookProfile2D
AIDA::IProfile2D * bookProfile2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D profile histogram
Definition: GaudiHistos_2DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ profile2D() [4/6]

template<class PBASE >

AIDA::IProfile2D * GaudiHistos< PBASE >::profile2D | ( | const double | valueX,
|  | const double | valueY,
|  | const double | valueZ,
|  | const HistoID & | ID,
|  | const std::string & | title,
|  | const HistoBinEdges & | edgesX,
|  | const HistoBinEdges & | edgesY,
|  | const double | weight = `1.0`
| ) |  | const

fill the 2D variable binning profile histogram with forced ID assignment (book on demand)

const GaudiAlg::HistoBinEdges edgesX = ...;
const GaudiAlg::HistoBinEdges edgesY = ...;
const double X = ... ;
const double Y = ... ;
const double Z = ... ;
profile2( X, Y, Z, "Space Points", edgesX, edgesY );

This example illustrates the filling of the 2D profile histogram titled `"Space Points"` with values `X`, `Y` and `Z`.

If the histogram with given ID does not exist yet it will be automatically booked with the given histogram bin edges.

It is also possible to use literal IDs. For example :-

const double X = ... ;
const double Y = ... ;
const double Z = ... ;
profile2D( X, Y, Z, "space", "Space Points", edgesX, edgesY );

Will book the same histogram, using the id "mass".

It is also possible using literal IDs, to place histograms in sub-directories from the main histogram directory, using for example :-

const double X = ... ;
const double Y = ... ;
const double Z = ... ;
profile2D( X, Y, Z,
"subdir/space", "Space Points", edgesX, edgesY );

Which will create the histogram "mass" in the sub-directory "subdir". Histograms can also be created in sub-directories with numeric IDs if IDs such as "subdir/1" are used.

See also
  AIDA::IProfile2D

Parameters

  valueX | x value to be filled
  valueY | y value to be filled
  valueZ | z value to be filled
  ID | histogram identifier
  title | histogram title (must be unique within the algorithm)
  edgesX | The histogram x bin edges
  edgesY | The histogram y bin edges
  weight | weight

Returns
  pointer to AIDA 1D profile histogram

Definition at line 92 of file GaudiHistos_2DProfVariableBinning.icpp.

95 {
96 AIDA::IProfile2D* h( nullptr );
97 if ( produceHistos() ) {
98 // retrieve or book the histogram
99 h = profile2D( ID );
100 if ( !h ) { h = bookProfile2D( ID, title, edgesX, edgesY ); }
101
102 // fill the histogram
103 h = fill( h, valueX, valueY, valueZ, weight, title );
104 }
105 return h;
106 }
GaudiHistos::profile2D
AIDA::IProfile2D * profile2D(const double valueX, const double valueY, const double valueZ, const std::string &title, const double lowX, const double highX, const double lowY, const double highY, const unsigned long binsX=50, const unsigned long binsY=50, const double weight=1.0) const
fill the 2D profile histogram (book on demand)
Definition: GaudiHistos_2DProfFixedBinning.icpp:103
GaudiHistos::fill
AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const
fill the 1D histogram with the value and weight
Definition: GaudiHistos_1DFixedBinning.icpp:79
GaudiHistos::bookProfile2D
AIDA::IProfile2D * bookProfile2D(const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=50, const double lowY=0, const double highY=100, const unsigned long binsY=50) const
book the 2D profile histogram
Definition: GaudiHistos_2DProfFixedBinning.icpp:5
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2371

## ◆ profile2D() [5/6]

template<class PBASE>

AIDA::IProfile2D* GaudiHistos< PBASE >::profile2D | ( | const std::string & | title | ) | const
| inline

access the EXISTING 2D profile histogram by title return the pointer to existing 2D profile histogram or NULL

Definition at line 2311 of file GaudiHistos.h.

2311 {
2312 auto found = profile2DMapTitle().find( title );
2313 return profile2DMapTitle().end() != found ? found->second : nullptr;
2314 }
GaudiUtils::Map::end
iterator end()
Definition: Map.h:130
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:147
GaudiHistos::profile2DMapTitle
const Profile2DMapTitle & profile2DMapTitle() const
get access to the map of all 2D profile histograms indexed via their title
Definition: GaudiHistos.h:2627

## ◆ profile2D() [6/6]

template<class PBASE >

AIDA::IProfile2D * GaudiHistos< PBASE >::profile2D | ( | const HistoID & | ID | ) | const

access the EXISTING 2D profile histogram by ID return the pointer to existing 2D profile histogram or NULL

Definition at line 314 of file GaudiHistos.icpp.

314 {
315 return lookup_( profile2DMapID(), ID );
316 }
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2650

## ◆ profile2DMapID()

template<class PBASE>

const Profile2DMapID& GaudiHistos< PBASE >::profile2DMapID | ( |  | ) | const
| inline

get access to the map of 2D profile histograms index via a ID

// iterate over the map!
for ( const auto& entry : profile2DMapID() )
{
// histogram ID
const HistoID ID = entry.first ;
// histogram itself
AIDA::IProfile2D* h = entry.second ;
if ( 0 == h ) { continue ;}
std::cout << " Histogram ID " << ID
<< " Histogram title " << h->title() << std::endl ;
}

Definition at line 2650 of file GaudiHistos.h.

2650 { return m_profile2DMapID; }
GaudiHistos::m_profile2DMapID
Profile2DMapID m_profile2DMapID
the actual storage/access of 2D profile histograms by unique ID
Definition: GaudiHistos.h:2800

## ◆ profile2DMapTitle()

template<class PBASE>

const Profile2DMapTitle& GaudiHistos< PBASE >::profile2DMapTitle | ( |  | ) | const
| inline

get access to the map of all 2D profile histograms indexed via their title

Using this method one can inspect e.g. a list of active histograms

// iterate over the map!
for ( const auto& entry : profile2DMapTitle() )
{
// histogram title
const std::string& title = entry.first ;
// histogram itself
AIDA::IProfile2D* hist = entry.second ;
if( 0 == hist ) { continue ; } // ATTENTION!
std::cout << " Histogram title " << title << std::endl ;
}

Attention
  The map COULD contains NULL pointers, the check before use is mandatory!

Definition at line 2627 of file GaudiHistos.h.

2627 { return m_profile2DMapTitle; }
GaudiHistos::m_profile2DMapTitle
Profile2DMapTitle m_profile2DMapTitle
the actual storage/access of 2D profile histograms by unique title
Definition: GaudiHistos.h:2798

## ◆ setCheckForNaN()

template<class PBASE>

void GaudiHistos< PBASE >::setCheckForNaN | ( | const bool | val | ) |
| inline

set the flag for NaN checks (property "HistoCheckForNan")

Definition at line 2659 of file GaudiHistos.h.

2659 { m_checkForNaN = val; }
GaudiHistos::m_checkForNaN
Gaudi::Property< bool > m_checkForNaN
Definition: GaudiHistos.h:2747

## ◆ setFullDetail()

template<class PBASE>

void GaudiHistos< PBASE >::setFullDetail | ( | const bool | val | ) |
| inline

set flag to control output level of histograms

Definition at line 2657 of file GaudiHistos.h.

2657 { m_fullDetail = val; }
GaudiHistos::m_fullDetail
Gaudi::Property< bool > m_fullDetail
Definition: GaudiHistos.h:2757

## ◆ setHistoDir()

template<class PBASE>

void GaudiHistos< PBASE >::setHistoDir | ( | const std::string & | val | ) |
| inline

set histogram directory (property "HistoDir")

Definition at line 2669 of file GaudiHistos.h.

2669 { m_histoDir = val; }
GaudiHistos::m_histoDir
Gaudi::Property< std::string > m_histoDir
Definition: GaudiHistos.h:2755

## ◆ setHistoOffSet()

template<class PBASE>

void GaudiHistos< PBASE >::setHistoOffSet | ( | const HistoID::NumericID | val | ) |
| inline

set a value for histogram offset (property "HistoOffSet"

Definition at line 2663 of file GaudiHistos.h.

2663 { m_histoOffSet = val; }
GaudiHistos::m_histoOffSet
Gaudi::Property< HistoID::NumericID > m_histoOffSet
Definition: GaudiHistos.h:2751

## ◆ setHistoTopDir()

template<class PBASE>

void GaudiHistos< PBASE >::setHistoTopDir | ( | const std::string & | val | ) |
| inline

set top-level histogram directory (property "HistoTopDir")

Definition at line 2666 of file GaudiHistos.h.

2666 { m_histoTopDir = val; }
GaudiHistos::m_histoTopDir
Gaudi::Property< std::string > m_histoTopDir
Definition: GaudiHistos.h:2753

## ◆ setProduceHistos()

template<class PBASE>

void GaudiHistos< PBASE >::setProduceHistos | ( | const bool | val | ) |
| inline

set the flag for histogram production (property "HistoProduce")

Definition at line 2655 of file GaudiHistos.h.

2655 { m_produceHistos = val; }
GaudiHistos::m_produceHistos
Gaudi::Property< bool > m_produceHistos
Definition: GaudiHistos.h:2736

## ◆ setSplitHistoDir()

template<class PBASE>

void GaudiHistos< PBASE >::setSplitHistoDir | ( | const bool | val | ) |
| inline

set the flag for histogram path split (property "HistoSplitDir")

Definition at line 2661 of file GaudiHistos.h.

2661 { m_splitHistoDir = val; }
GaudiHistos::m_splitHistoDir
Gaudi::Property< bool > m_splitHistoDir
Definition: GaudiHistos.h:2749

## ◆ splitHistoDir()

template<class PBASE>

bool GaudiHistos< PBASE >::splitHistoDir | ( |  | ) | const
| inline

get the flag for histogram path split (property "HistoSplitDir")

Definition at line 2377 of file GaudiHistos.h.

2377 { return m_splitHistoDir; }
GaudiHistos::m_splitHistoDir
Gaudi::Property< bool > m_splitHistoDir
Definition: GaudiHistos.h:2749

## ◆ totalNumberOfHistos()

template<class PBASE >

unsigned int GaudiHistos< PBASE >::totalNumberOfHistos | ( |  | ) | const

Returns the total number of histograms (of all types) currently booked.

Definition at line 321 of file GaudiHistos.icpp.

321 {
322 return histo1DMapID().size() + histo2DMapID().size() + histo3DMapID().size() + profile1DMapID().size() +
323 profile2DMapID().size();
324 }
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2548
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2650
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2600
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:189
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2448
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2498

## ◆ useNumericAutoIDs()

template<class PBASE>

bool GaudiHistos< PBASE >::useNumericAutoIDs | ( |  | ) | const
| inline

Use old style sequencial numerical automatically assigned IDs ?

Definition at line 2391 of file GaudiHistos.h.

2391 { return m_useNumericAutoIDs; }
GaudiHistos::m_useNumericAutoIDs
Gaudi::Property< bool > m_useNumericAutoIDs
Definition: GaudiHistos.h:2767

## Member Data Documentation

## ◆ m_checkForNaN

template<class PBASE>

Gaudi::Property<bool> GaudiHistos< PBASE >::m_checkForNaN
| private

Initial value:
{this, "HistoCheckForNaN", true,
"Switch on/off the checks for NaN and Infinity for histogram fill"}

Definition at line 2747 of file GaudiHistos.h.

## ◆ m_declareMoniHists

template<class PBASE>

Gaudi::Property<bool> GaudiHistos< PBASE >::m_declareMoniHists {this, "MonitorHistograms", true}
| private

Definition at line 2758 of file GaudiHistos.h.

## ◆ m_fullDetail

template<class PBASE>

Gaudi::Property<bool> GaudiHistos< PBASE >::m_fullDetail {this, "FullDetail", false}
| private

Definition at line 2757 of file GaudiHistos.h.

## ◆ m_histo1DMapID

template<class PBASE>

Histo1DMapID GaudiHistos< PBASE >::m_histo1DMapID
| mutable private

the actual storage/access of 1D histograms by unique ID

Definition at line 2780 of file GaudiHistos.h.

## ◆ m_histo1DMapTitle

template<class PBASE>

Histo1DMapTitle GaudiHistos< PBASE >::m_histo1DMapTitle
| mutable private

the actual storage/access of 1D histograms by unique title

Definition at line 2778 of file GaudiHistos.h.

## ◆ m_histo1DTableFormat

template<class PBASE>

Gaudi::Property<std::string> GaudiHistos< PBASE >::m_histo1DTableFormat
| private

Initial value:
{this, "FormatFor1DHistoTable",
Gaudi::Utils::Histos::Formats::format(),
"Format string for printout of 1D histograms"}

Definition at line 2759 of file GaudiHistos.h.

## ◆ m_histo1DTableFormatShort

template<class PBASE>

Gaudi::Property<std::string> GaudiHistos< PBASE >::m_histo1DTableFormatShort
| private

Initial value:
{this, "ShortFormatFor1DHistoTable", " | %1$-25.25s %2%",
"Format string for printout of 1D histograms"}

Definition at line 2762 of file GaudiHistos.h.

## ◆ m_histo1DTableHeader

template<class PBASE>

Gaudi::Property<std::string> GaudiHistos< PBASE >::m_histo1DTableHeader
| private

Initial value:
{this, "HeaderFor1DHistoTable",
Gaudi::Utils::Histos::Formats::header(),
"The table header for printout of 1D histograms "}

Definition at line 2764 of file GaudiHistos.h.

## ◆ m_histo2DMapID

template<class PBASE>

Histo2DMapID GaudiHistos< PBASE >::m_histo2DMapID
| mutable private

the actual storage/access of 2D histograms by unique ID

Definition at line 2785 of file GaudiHistos.h.

## ◆ m_histo2DMapTitle

template<class PBASE>

Histo2DMapTitle GaudiHistos< PBASE >::m_histo2DMapTitle
| mutable private

the actual storage/access of 2D histograms by unique title

Definition at line 2783 of file GaudiHistos.h.

## ◆ m_histo3DMapID

template<class PBASE>

Histo3DMapID GaudiHistos< PBASE >::m_histo3DMapID
| mutable private

the actual storage/access of 3D histograms by unique ID

Definition at line 2790 of file GaudiHistos.h.

## ◆ m_histo3DMapTitle

template<class PBASE>

Histo3DMapTitle GaudiHistos< PBASE >::m_histo3DMapTitle
| mutable private

the actual storage/access of 3D histograms by unique title

Definition at line 2788 of file GaudiHistos.h.

## ◆ m_histoCountersPrint

template<class PBASE>

Gaudi::Property<bool> GaudiHistos< PBASE >::m_histoCountersPrint
| private

Initial value:
{this, "HistoCountersPrint", true,
"Switch on/off the printout of histogram counters at finalization"}

Definition at line 2745 of file GaudiHistos.h.

## ◆ m_histoDir

template<class PBASE>

Gaudi::Property<std::string> GaudiHistos< PBASE >::m_histoDir
| private

Initial value:
{
this, "HistoDir", boost::algorithm::replace_all_copy( this->name(), ":", "_" ), "Histogram Directory"}

Definition at line 2755 of file GaudiHistos.h.

## ◆ m_histoOffSet

template<class PBASE>

Gaudi::Property<HistoID::NumericID> GaudiHistos< PBASE >::m_histoOffSet
| private

Initial value:
{
this, "HistoOffSet", 0, "OffSet for automatically assigned histogram numerical identifiers "}

Definition at line 2751 of file GaudiHistos.h.

## ◆ m_histosPrint

template<class PBASE>

Gaudi::Property<bool> GaudiHistos< PBASE >::m_histosPrint
| private

Initial value:
{this, "HistoPrint", false,
[this]( const auto& ) {
if ( this->FSMState() >= Gaudi::StateMachine::INITIALIZED &&
this->histosPrint() )
this->printHistos( MSG::ALWAYS );
},
"Switch on/off the printout of histograms at finalization"}

Definition at line 2737 of file GaudiHistos.h.

## ◆ m_histoTopDir

template<class PBASE>

Gaudi::Property<std::string> GaudiHistos< PBASE >::m_histoTopDir
| private

Initial value:
{this, "HistoTopDir", "",
"Top level histogram directory (take care that it ends with '/')"}

Definition at line 2753 of file GaudiHistos.h.

## ◆ m_idReplaceInfo

template<class PBASE>

Gaudi::Property<std::map<std::string, std::string> > GaudiHistos< PBASE >::m_idReplaceInfo
| private

Initial value:
{
this,
"AutoStringIDPurgeMap",
{{"/", "=SLASH="}},
"Map of strings to search and replace when using the title "
"as the basis of automatically generated literal IDs"}

Definition at line 2770 of file GaudiHistos.h.

## ◆ m_produceHistos

template<class PBASE>

Gaudi::Property<bool> GaudiHistos< PBASE >::m_produceHistos {this, "HistoProduce", true, "Switch on/off the production of histograms"}
| private

Definition at line 2736 of file GaudiHistos.h.

## ◆ m_profile1DMapID

template<class PBASE>

Profile1DMapID GaudiHistos< PBASE >::m_profile1DMapID
| mutable private

the actual storage/access of 1D profile histograms by unique ID

Definition at line 2795 of file GaudiHistos.h.

## ◆ m_profile1DMapTitle

template<class PBASE>

Profile1DMapTitle GaudiHistos< PBASE >::m_profile1DMapTitle
| mutable private

the actual storage/access of 1D profile histograms by unique title

Definition at line 2793 of file GaudiHistos.h.

## ◆ m_profile2DMapID

template<class PBASE>

Profile2DMapID GaudiHistos< PBASE >::m_profile2DMapID
| mutable private

the actual storage/access of 2D profile histograms by unique ID

Definition at line 2800 of file GaudiHistos.h.

## ◆ m_profile2DMapTitle

template<class PBASE>

Profile2DMapTitle GaudiHistos< PBASE >::m_profile2DMapTitle
| mutable private

the actual storage/access of 2D profile histograms by unique title

Definition at line 2798 of file GaudiHistos.h.

## ◆ m_splitHistoDir

template<class PBASE>

Gaudi::Property<bool> GaudiHistos< PBASE >::m_splitHistoDir
| private

Initial value:
{this, "HistoSplitDir", false,
"Split long directory names into short pieces (suitable for HBOOK)"}

Definition at line 2749 of file GaudiHistos.h.

## ◆ m_useNumericAutoIDs

template<class PBASE>

Gaudi::Property<bool> GaudiHistos< PBASE >::m_useNumericAutoIDs
| private

Initial value:
{
this, "UseSequencialNumericAutoIDs", false,
"Flag to allow users to switch back to the old style of creating numerical automatic IDs"}

Definition at line 2767 of file GaudiHistos.h.

The documentation for this class was generated from the following files:

- GaudiAlg/GaudiAlg/GaudiHistos.h
- GaudiAlg/GaudiAlg/GaudiHistos.icpp
- GaudiAlg/GaudiAlg/GaudiHistos_1DFixedBinning.icpp
- GaudiAlg/GaudiAlg/GaudiHistos_1DProfFixedBinning.icpp
- GaudiAlg/GaudiAlg/GaudiHistos_1DProfVariableBinning.icpp
- GaudiAlg/GaudiAlg/GaudiHistos_1DVariableBinning.icpp
- GaudiAlg/GaudiAlg/GaudiHistos_2DFixedBinning.icpp
- GaudiAlg/GaudiAlg/GaudiHistos_2DProfFixedBinning.icpp
- GaudiAlg/GaudiAlg/GaudiHistos_2DProfVariableBinning.icpp
- GaudiAlg/GaudiAlg/GaudiHistos_2DVariableBinning.icpp
- GaudiAlg/GaudiAlg/GaudiHistos_3DFixedBinning.icpp
- GaudiAlg/GaudiAlg/GaudiHistos_3DVariableBinning.icpp