| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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, class = typename std::enable_if<std::is_base_of<GaudiAlgorithm, PBASE>::value, U>::type>
| 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, class = typename std::enable_if<std::is_base_of<GaudiTool, PBASE>::value, U>::type>
| 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 | initGaudiHistosConstructor ()
| Constructor initialisation and job options. 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...
void | printHistoHandler (Gaudi::Details::PropertyBase &)
| the handler for "HistoPrint" property 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 56 of file GaudiHistos.h.

## Member Typedef Documentation

template<class PBASE>

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

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

Definition at line 64 of file GaudiHistos.h.

template<class PBASE>

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

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

Definition at line 66 of file GaudiHistos.h.

template<class PBASE>

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

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

Definition at line 69 of file GaudiHistos.h.

template<class PBASE>

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

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

Definition at line 71 of file GaudiHistos.h.

template<class PBASE>

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

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

Definition at line 74 of file GaudiHistos.h.

template<class PBASE>

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

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

Definition at line 76 of file GaudiHistos.h.

template<class PBASE>

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

Edges for variable binning.

Definition at line 89 of file GaudiHistos.h.

template<class PBASE>

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

the actual type for histogram identifier

Definition at line 61 of file GaudiHistos.h.

template<class PBASE>

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

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

Definition at line 79 of file GaudiHistos.h.

template<class PBASE>

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

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

Definition at line 81 of file GaudiHistos.h.

template<class PBASE>

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

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

Definition at line 84 of file GaudiHistos.h.

template<class PBASE>

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

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

Definition at line 86 of file GaudiHistos.h.

## Constructor & Destructor Documentation

template<class PBASE>
template<typename U = PBASE, class = typename std::enable_if<std::is_base_of<GaudiAlgorithm, PBASE>::value, U>::type>

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 2701 of file GaudiHistos.h.

2701 : PBASE( name, pSvcLocator )
2702 {
2703 initGaudiHistosConstructor();
2704 }
GaudiHistos::initGaudiHistosConstructor
void initGaudiHistosConstructor()
Constructor initialisation and job options.
Definition: GaudiHistos.icpp:80
template<class PBASE>
template<typename U = PBASE, class = typename std::enable_if<std::is_base_of<GaudiTool, PBASE>::value, U>::type>

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 2709 of file GaudiHistos.h.

2710 : PBASE( type, name, parent )
2711 {
2712 initGaudiHistosConstructor();
2713 }
GaudiHistos::initGaudiHistosConstructor
void initGaudiHistosConstructor()
Constructor initialisation and job options.
Definition: GaudiHistos.icpp:80

## Member Function Documentation

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 1865 of file GaudiHistos.h.

1867 {
1868 return book1D( title, low, high, bins );
1869 }
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
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 153 of file GaudiHistos_1DFixedBinning.icpp.

154 {
155 return book1D( hdef.title(), hdef.lowEdge(), hdef.highEdge(), hdef.bins() );
156 }
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::highEdge
double highEdge() const
get the high edge
Definition: HistoDef.h:61
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition: HistoDef.h:59
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition: HistoDef.h:65
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition: HistoDef.h:63
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 1907 of file GaudiHistos.h.

1909 {
1910 return book1D( ID, title, low, high, bins );
1911 }
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
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 161 of file GaudiHistos_1DFixedBinning.icpp.

162 {
163 return book1D( ID, hdef.title(), hdef.lowEdge(), hdef.highEdge(), hdef.bins() );
164 }
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::highEdge
double highEdge() const
get the high edge
Definition: HistoDef.h:61
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition: HistoDef.h:59
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition: HistoDef.h:65
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition: HistoDef.h:63
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.

9 {
10 //
11 if ( !produceHistos() ) {
12 return nullptr;
13 } // RETURN
14 //
15 // exist?
16 auto hist = histo1D( title );
17 // histogram is already booked
18 if ( hist ) {
19 return hist;
20 } // RETURN !!
21
22 // propose the histogram ID
23 HistoID ID;
24 newHistoID( title, ID );
25
26 // Create a new histogram and return
27 return this->book1D( ID, title, low, high, bins );
28 }
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::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:357
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:2288
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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 33 of file GaudiHistos_1DFixedBinning.icpp.

35 {
36 //
37 if ( !produceHistos() ) {
38 return nullptr;
39 } // RETURN
40 //
41
42 // Check ID
43 if ( ID.undefined() ) {
44 this->Error( "Undefined Histogram ID : Title='" + title + "'" );
45 return nullptr;
46 }
47
48 // exist?
49 auto* hist = histo1D( ID );
50 // histogram is already booked
51 if ( hist ) {
52 return hist;
53 } // RETURN !!
54
55 // Histogram title
56 const std::string& htitle = ( title.empty() ? "Unnamed 1D Histogram ID=" + ID.idAsString() : title );
57
58 // book the histogram
59 if ( ID.numeric() ) {
60 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, bins, low, high );
61 } else if ( ID.literal() ) {
62 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, bins, low, high );
63 }
64
65 // check OK
66 if ( !hist ) {
67 this->Error( "IHistogram1D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" );
68 return nullptr;
69 } // RETURN !!
70
71 // add histogram into histogram storages
72 m_histo1DMapID[ID] = hist;
73 m_histo1DMapTitle[title] = hist;
74
75 // Declare to monitoring service
76 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
77
78 // Printout and return
79 if ( this->msgLevel( MSG::DEBUG ) ) {
80 this->debug() << "Booked 1D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
81 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
82 }
83 return hist;
84 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
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:2811
MSG::DEBUG
Definition: IMessageSvc.h:16
std::string
STL class.
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:294
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:2288
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::m_histo1DMapTitle
Histo1DMapTitle m_histo1DMapTitle
the actual storage/access of 1D histograms by unique title
Definition: GaudiHistos.h:2809
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:180
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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.

8 {
9 //
10 if ( !produceHistos() ) {
11 return nullptr;
12 } // RETURN
13 //
14 // exist?
15 auto hist = histo1D( title );
16 // histogram is already booked
17 if ( hist ) {
18 return hist;
19 } // RETURN !!
20
21 // propose the histogram ID
22 HistoID ID;
23 newHistoID( title, ID );
24
25 // Create a new histogram and return
26 return this->book1D( ID, title, edges );
27 }
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::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:357
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:2288
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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 32 of file GaudiHistos_1DVariableBinning.icpp.

34 {
35 //
36 if ( !produceHistos() ) {
37 return nullptr;
38 } // RETURN
39 //
40 // Check ID
41 if ( ID.undefined() ) {
42 this->Error( "Undefined Histogram ID : Title='" + title + "'" );
43 return nullptr;
44 }
45
46 // exist?
47 auto hist = histo1D( ID );
48 // histogram is already booked
49 if ( hist ) {
50 return hist;
51 } // RETURN !!
52
53 // Histogram title
54 const std::string& htitle = ( title.empty() ? "Unnamed 1D Histogram ID=" + ID.idAsString() : title );
55
56 // book the histogram
57 if ( ID.numeric() ) {
58 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, edges );
59 } else if ( ID.literal() ) {
60 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, edges );
61 }
62
63 // check OK
64 if ( !hist ) {
65 this->Error( "IHistogram1D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" );
66 return nullptr;
67 } // RETURN !!
68
69 // add histogram into histogram storages
70 m_histo1DMapID[ID] = hist;
71 m_histo1DMapTitle[title] = hist;
72
73 // Declare to monitoring service
74 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
75
76 // Printout and return
77 if ( this->msgLevel( MSG::DEBUG ) ) {
78 this->debug() << "Booked 1D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
79 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
80 }
81 return hist;
82 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
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:2811
MSG::DEBUG
Definition: IMessageSvc.h:16
std::string
STL class.
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:294
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:2288
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::m_histo1DMapTitle
Histo1DMapTitle m_histo1DMapTitle
the actual storage/access of 1D histograms by unique title
Definition: GaudiHistos.h:2809
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:180
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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.

10 {
11 //
12 if ( !produceHistos() ) {
13 return nullptr;
14 } // RETURN
15 //
16 // exist?
17 auto hist = histo2D( title );
18 // histogram is already booked
19 if ( hist ) {
20 return hist;
21 } // RETURN !!
22
23 // propose the histogram ID
24 HistoID ID;
25 newHistoID( title, ID );
26
27 // Create a new histogram and return
28 return this->book2D( ID, title, lowX, highX, binsX, lowY, highY, binsY );
29 }
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:2306
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:357
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::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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 34 of file GaudiHistos_2DFixedBinning.icpp.

37 {
38 //
39 if ( !produceHistos() ) {
40 return nullptr;
41 } // RETURN
42 //
43 // Check ID
44 if ( ID.undefined() ) {
45 this->Error( "Undefined Histogram ID : Title='" + title + "'" );
46 return nullptr;
47 }
48
49 // exist?
50 auto hist = histo2D( ID );
51 // histogram is already booked
52 if ( hist ) {
53 return hist;
54 } // RETURN !!
55
56 // Histogram title
57 const std::string& htitle = ( title.empty() ? "Unnamed 2D Histogram ID=" + ID.idAsString() : title );
58
59 // book the histogram
60 if ( ID.numeric() ) {
61 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, binsX, lowX, highX, binsY, lowY, highY );
62 } else if ( ID.literal() ) {
63 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, binsX, lowX, highX, binsY, lowY, highY );
64 }
65
66 // Check OK
67 if ( !hist ) {
68 this->Error( "IHistogram2D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" );
69 return nullptr;
70 } // RETURN !!
71
72 // add histogram into histogram storages
73 m_histo2DMapID[ID] = hist;
74 m_histo2DMapTitle[title] = hist;
75
76 // Declare to monitoring service
77 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
78
79 // Printout and return
80 if ( this->msgLevel( MSG::DEBUG ) ) {
81 this->debug() << "Booked 2D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
82 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
83 }
84 // return
85 return hist;
86 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
std::string::empty
T empty(T...args)
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:2306
MSG::DEBUG
Definition: IMessageSvc.h:16
GaudiHistos::m_histo2DMapTitle
Histo2DMapTitle m_histo2DMapTitle
the actual storage/access of 2D histograms by unique title
Definition: GaudiHistos.h:2814
std::string
STL class.
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:294
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
GaudiHistos::m_histo2DMapID
Histo2DMapID m_histo2DMapID
the actual storage/access of 2D histograms by unique ID
Definition: GaudiHistos.h:2816
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:180
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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.

9 {
10 //
11 if ( !produceHistos() ) {
12 return nullptr;
13 } // RETURN
14 //
15 // exist?
16 auto hist = histo2D( title );
17 // histogram is already booked
18 if ( hist ) {
19 return hist;
20 } // RETURN !!
21
22 // propose the histogram ID
23 HistoID ID;
24 newHistoID( title, ID );
25
26 // Create a new histogram and return
27 return this->book2D( ID, title, edgesX, edgesY );
28 }
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:2306
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:357
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::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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 33 of file GaudiHistos_2DVariableBinning.icpp.

35 {
36 //
37 if ( !produceHistos() ) {
38 return nullptr;
39 } // RETURN
40 //
41 // Check ID
42 if ( ID.undefined() ) {
43 this->Error( "Undefined Histogram ID : Title='" + title + "'" );
44 return nullptr;
45 }
46
47 // exist?
48 auto hist = histo2D( ID );
49 // histogram is already booked
50 if ( hist ) {
51 return hist;
52 } // RETURN !!
53
54 // Histogram title
55 const std::string& htitle = ( title.empty() ? "Unnamed 2D Histogram ID=" + ID.idAsString() : title );
56
57 // book the histogram
58 if ( ID.numeric() ) {
59 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, edgesX, edgesY );
60 } else if ( ID.literal() ) {
61 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, edgesX, edgesY );
62 }
63
64 // check OK
65 if ( !hist ) {
66 this->Error( "IHistogram2D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" );
67 return nullptr;
68 } // RETURN !!
69
70 // add histogram into histogram storages
71 m_histo2DMapID[ID] = hist;
72 m_histo2DMapTitle[title] = hist;
73
74 // Declare to monitoring service
75 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
76
77 // Printout and return
78 if ( this->msgLevel( MSG::DEBUG ) ) {
79 this->debug() << "Booked 2D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
80 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
81 }
82 return hist;
83 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
std::string::empty
T empty(T...args)
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:2306
MSG::DEBUG
Definition: IMessageSvc.h:16
GaudiHistos::m_histo2DMapTitle
Histo2DMapTitle m_histo2DMapTitle
the actual storage/access of 2D histograms by unique title
Definition: GaudiHistos.h:2814
std::string
STL class.
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:294
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
GaudiHistos::m_histo2DMapID
Histo2DMapID m_histo2DMapID
the actual storage/access of 2D histograms by unique ID
Definition: GaudiHistos.h:2816
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:180
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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.

11 {
12 //
13 if ( !produceHistos() ) {
14 return nullptr;
15 } // RETURN
16 //
17 // exist?
18 auto hist = histo3D( title );
19 // histogram is already booked
20 if ( hist ) {
21 return hist;
22 } // RETURN !!
23
24 // propose the histogram ID
25 HistoID ID;
26 newHistoID( title, ID );
27
28 // Create a new histogram and return
29 return this->book3D( ID, title, lowX, highX, binsX, lowY, highY, binsY, lowZ, highZ, binsZ );
30 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:357
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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::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:2315
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 35 of file GaudiHistos_3DFixedBinning.icpp.

39 {
40 //
41 if ( !produceHistos() ) {
42 return nullptr;
43 } // RETURN
44 //
45 // Check ID
46 if ( ID.undefined() ) {
47 this->Error( "Undefined Histogram ID : Title='" + title + "'" );
48 return nullptr;
49 }
50
51 // exist?
52 auto hist = histo3D( ID );
53 // histogram is already booked
54 if ( hist ) {
55 return hist;
56 } // RETURN !!
57
58 // Histogram title
59 const std::string& htitle = ( title.empty() ? "Unnamed 3D Histogram ID=" + ID.idAsString() : title );
60
61 // book the histogram
62 if ( ID.numeric() ) {
63 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, binsX, lowX, highX, binsY, lowY, highY, binsZ,
64 lowZ, highZ );
65 } else if ( ID.literal() ) {
66 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, binsX, lowX, highX, binsY, lowY, highY,
67 binsZ, lowZ, highZ );
68 }
69
70 // Check OK
71 if ( !hist ) {
72 this->Error( "IHistogram3D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" );
73 return nullptr;
74 } // RETURN !!
75
76 // add histogram into histogram storages
77 m_histo3DMapID[ID] = hist;
78 m_histo3DMapTitle[title] = hist;
79
80 // Declare to monitoring service
81 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
82
83 // Printout and return
84 if ( this->msgLevel( MSG::DEBUG ) ) {
85 this->debug() << "Booked 3D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
86 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
87 }
88 return hist;
89 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
std::string::empty
T empty(T...args)
MSG::DEBUG
Definition: IMessageSvc.h:16
GaudiHistos::m_histo3DMapTitle
Histo3DMapTitle m_histo3DMapTitle
the actual storage/access of 3D histograms by unique title
Definition: GaudiHistos.h:2819
std::string
STL class.
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:294
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
GaudiHistos::m_histo3DMapID
Histo3DMapID m_histo3DMapID
the actual storage/access of 3D histograms by unique ID
Definition: GaudiHistos.h:2821
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:180
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:2315
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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.

9 {
10 //
11 if ( !produceHistos() ) {
12 return nullptr;
13 } // RETURN
14 //
15 // exist?
16 auto hist = histo3D( title );
17 // histogram is already booked
18 if ( hist ) {
19 return hist;
20 } // RETURN !!
21
22 // propose the histogram ID
23 HistoID ID;
24 newHistoID( title, ID );
25
26 // Create a new histogram and return
27 return this->book3D( ID, title, edgesX, edgesY, edgesZ );
28 }
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:357
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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::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:2315
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 33 of file GaudiHistos_3DVariableBinning.icpp.

36 {
37 //
38 if ( !produceHistos() ) {
39 return nullptr;
40 } // RETURN
41 //
42 // Check ID
43 if ( ID.undefined() ) {
44 this->Error( "Undefined Histogram ID : Title='" + title + "'" );
45 return nullptr;
46 }
47
48 // exist?
49 auto hist = histo3D( ID );
50 // histogram is already booked
51 if ( hist ) {
52 return hist;
53 } // RETURN !!
54
55 // Histogram title
56 const std::string& htitle = ( title.empty() ? "Unnamed 3D Histogram ID=" + ID.idAsString() : title );
57
58 // book the histogram
59 if ( ID.numeric() ) {
60 hist = this->histoSvc()->book( histoPath(), ID.numericID(), htitle, edgesX, edgesY, edgesZ );
61 } else if ( ID.literal() ) {
62 hist = this->histoSvc()->book( histoPath() + "/" + ID.literalID(), htitle, edgesX, edgesY, edgesZ );
63 }
64
65 // check OK
66 if ( !hist ) {
67 this->Error( "IHistogram3D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" );
68 return nullptr;
69 } // RETURN !!
70
71 // add histogram into histogram storages
72 m_histo3DMapID[ID] = hist;
73 m_histo3DMapTitle[title] = hist;
74
75 // Declare to monitoring service
76 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
77
78 // Printout and return
79 if ( this->msgLevel( MSG::DEBUG ) ) {
80 this->debug() << "Booked 3D Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
81 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
82 }
83 return hist;
84 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
std::string::empty
T empty(T...args)
MSG::DEBUG
Definition: IMessageSvc.h:16
GaudiHistos::m_histo3DMapTitle
Histo3DMapTitle m_histo3DMapTitle
the actual storage/access of 3D histograms by unique title
Definition: GaudiHistos.h:2819
std::string
STL class.
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:294
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
GaudiHistos::m_histo3DMapID
Histo3DMapID m_histo3DMapID
the actual storage/access of 3D histograms by unique ID
Definition: GaudiHistos.h:2821
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:180
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:2315
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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.

8 {
9 //
10 if ( !produceHistos() ) {
11 return nullptr;
12 } // RETURN
13 //
14 // exist?
15 auto hist = profile1D( title );
16 // histogram is already booked
17 if ( hist ) {
18 return hist;
19 } // RETURN !!
20
21 // propose the histogram ID
22 HistoID ID;
23 newHistoID( title, ID );
24
25 // Book the histo and return
26 return this->bookProfile1D( ID, title, low, high, bins, opt, lowY, highY );
27 }
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:115
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:357
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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
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 32 of file GaudiHistos_1DProfFixedBinning.icpp.

36 {
37 //
38 if ( !produceHistos() ) {
39 return nullptr;
40 } // RETURN
41 //
42 // Check ID
43 if ( ID.undefined() ) {
44 this->Error( "Undefined Histogram ID : Title='" + title + "'" );
45 return nullptr;
46 }
47
48 // exist?
49 auto hist = profile1D( ID );
50 // histogram is already booked
51 if ( hist ) {
52 return hist;
53 } // RETURN !!
54
55 // Histogram title
56 const std::string& htitle = ( title.empty() ? "Unnamed 1D Profile Histogram ID=" + ID.idAsString() : title );
57
58 // book the histogram
59 if ( ID.numeric() ) {
60 hist = this->histoSvc()->bookProf( histoPath(), ID.numericID(), htitle, bins, low, high, lowY, highY, opt );
61 } else if ( ID.literal() ) {
62 hist = this->histoSvc()->bookProf( histoPath() + "/" + ID.literalID(), htitle, bins, low, high, lowY, highY, opt );
63 }
64
65 // test ok
66 if ( !hist ) {
67 this->Error( "IProfile1D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" );
68 return nullptr;
69 } // RETURN !!
70
71 // add histogram into histogram storages
72 m_profile1DMapID[ID] = hist;
73 m_profile1DMapTitle[title] = hist;
74
75 // Declare to monitoring service
76 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
77
78 // printout and return
79 if ( this->msgLevel( MSG::DEBUG ) ) {
80 this->debug() << "Booked 1D Profile Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
81 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
82 }
83 return hist;
84 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
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:2826
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:115
MSG::DEBUG
Definition: IMessageSvc.h:16
std::string
STL class.
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:294
GaudiHistos::m_profile1DMapTitle
Profile1DMapTitle m_profile1DMapTitle
the actual storage/access of 1D profile histograms by unique title
Definition: GaudiHistos.h:2824
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:180
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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.

6 {
7 //
8 if ( !produceHistos() ) {
9 return nullptr;
10 } // RETURN
11 //
12 // exist?
13 auto hist = profile1D( title );
14 // histogram is already booked
15 if ( hist ) {
16 return hist;
17 } // RETURN !!
18
19 // propose the histogram ID
20 HistoID ID;
21 newHistoID( title, ID );
22
23 // Book the histo and return
24 return this->bookProfile1D( ID, title, edges );
25 }
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:115
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:357
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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
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 30 of file GaudiHistos_1DProfVariableBinning.icpp.

32 {
33 //
34 if ( !produceHistos() ) {
35 return nullptr;
36 } // RETURN
37 //
38 // Check ID
39 if ( ID.undefined() ) {
40 this->Error( "Undefined Histogram ID : Title='" + title + "'" );
41 return nullptr;
42 }
43
44 // exist?
45 auto hist = profile1D( ID );
46 // histogram is already booked
47 if ( hist ) {
48 return hist;
49 } // RETURN !!
50
51 // Histogram title
52 const std::string& htitle = ( title.empty() ? "Unnamed 1D Profile Histogram ID=" + ID.idAsString() : title );
53
54 // book the histogram
55 if ( ID.numeric() ) {
56 hist = this->histoSvc()->bookProf( histoPath(), ID.numericID(), htitle, edges );
57 } else if ( ID.literal() ) {
58 hist = this->histoSvc()->bookProf( histoPath() + "/" + ID.literalID(), htitle, edges );
59 }
60
61 // test ok
62 if ( !hist ) {
63 this->Error( "IProfile1D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" );
64 return nullptr;
65 } // RETURN !!
66
67 // add histogram into histogram storages
68 m_profile1DMapID[ID] = hist;
69 m_profile1DMapTitle[title] = hist;
70
71 // Declare to monitoring service
72 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
73
74 // printout and return
75 if ( this->msgLevel( MSG::DEBUG ) ) {
76 this->debug() << "Booked 1D Profile Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
77 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
78 }
79 return hist;
80 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
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:2826
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:115
MSG::DEBUG
Definition: IMessageSvc.h:16
std::string
STL class.
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:294
GaudiHistos::m_profile1DMapTitle
Profile1DMapTitle m_profile1DMapTitle
the actual storage/access of 1D profile histograms by unique title
Definition: GaudiHistos.h:2824
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:180
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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.

8 {
9 //
10 if ( !produceHistos() ) {
11 return 0;
12 } // RETURN
13 //
14 // exist?
15 auto hist = profile2D( title );
16 // histogram is already booked
17 if ( 0 != hist ) {
18 return hist;
19 } // RETURN !!
20
21 // propose the histogram ID
22 HistoID ID;
23 newHistoID( title, ID );
24
25 // book histogram and return
26 return this->bookProfile2D( ID, title, lowX, highX, binsX, lowY, highY, binsY );
27 }
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::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:357
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:114
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 32 of file GaudiHistos_2DProfFixedBinning.icpp.

35 {
36 //
37 if ( !produceHistos() ) {
38 return 0;
39 } // RETURN
40 //
41 // Check ID
42 if ( ID.undefined() ) {
43 this->Error( "Undefined Histogram ID : Title='" + title + "'" );
44 return nullptr;
45 }
46 // exist?
47 auto hist = profile2D( ID );
48 // histogram is already booked
49 if ( 0 != hist ) {
50 return hist;
51 } // RETURN !!
52
53 // Histogram title
54 const std::string& htitle = ( title.empty() ? "Unnamed 2D Profile Histogram ID=" + ID.idAsString() : title );
55
56 // book the histogram
57 if ( ID.numeric() ) {
58 hist = this->histoSvc()->bookProf( histoPath(), ID.numericID(), htitle, binsX, lowX, highX, binsY, lowY, highY );
59 } else if ( ID.literal() ) {
60 hist = this->histoSvc()->bookProf( histoPath() + "/" + ID.literalID(), htitle, binsX, lowX, highX, binsY, lowY,
61 highY );
62 }
63
64 // test OK
65 if ( 0 == hist ) {
66 this->Error( "IProfile2D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" );
67 return 0;
68 } // RETURN !!
69
70 // add histogram into histogram storages
71 m_profile2DMapID[ID] = hist;
72 m_profile2DMapTitle[title] = hist;
73
74 // Declare to monitoring service
75 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
76
77 // printout and return
78 if ( this->msgLevel( MSG::DEBUG ) ) {
79 this->debug() << "Booked 2D Profile Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
80 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
81 }
82 return hist;
83 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
std::string::empty
T empty(T...args)
MSG::DEBUG
Definition: IMessageSvc.h:16
std::string
STL class.
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:294
GaudiHistos::m_profile2DMapID
Profile2DMapID m_profile2DMapID
the actual storage/access of 2D profile histograms by unique ID
Definition: GaudiHistos.h:2831
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::m_profile2DMapTitle
Profile2DMapTitle m_profile2DMapTitle
the actual storage/access of 2D profile histograms by unique title
Definition: GaudiHistos.h:2829
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:180
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:114
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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.

7 {
8 //
9 if ( !produceHistos() ) {
10 return 0;
11 } // RETURN
12 //
13 // exist?
14 auto hist = profile2D( title );
15 // histogram is already booked
16 if ( hist ) {
17 return hist;
18 } // RETURN !!
19
20 // propose the histogram ID
21 HistoID ID;
22 newHistoID( title, ID );
23
24 // book histogram and return
25 return this->bookProfile2D( ID, title, edgesX, edgesY );
26 }
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::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::newHistoID
void newHistoID(const std::string &title, HistoID &ID) const
Create a new histogram ID using the given title.
Definition: GaudiHistos.icpp:357
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:114
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 31 of file GaudiHistos_2DProfVariableBinning.icpp.

33 {
34 //
35 if ( !produceHistos() ) {
36 return 0;
37 } // RETURN
38 //
39 // Check ID
40 if ( ID.undefined() ) {
41 this->Error( "Undefined Histogram ID : Title='" + title + "'" );
42 return nullptr;
43 }
44 // exist?
45 auto hist = profile2D( ID );
46 // histogram is already booked
47 if ( hist ) {
48 return hist;
49 } // RETURN !!
50
51 // Histogram title
52 const std::string& htitle = ( title.empty() ? "Unnamed 2D Profile Histogram ID=" + ID.idAsString() : title );
53
54 // book the histogram
55 if ( ID.numeric() ) {
56 hist = this->histoSvc()->bookProf( histoPath(), ID.numericID(), htitle, edgesX, edgesY );
57 } else if ( ID.literal() ) {
58 hist = this->histoSvc()->bookProf( histoPath() + "/" + ID.literalID(), htitle, edgesX, edgesY );
59 }
60
61 // test OK
62 if ( !hist ) {
63 this->Error( "IProfile2D* points to NULL! ID='" + ID.idAsString() + "' title='" + htitle + "'" );
64 return nullptr;
65 } // RETURN !!
66
67 // add histogram into histogram storages
68 m_profile2DMapID[ID] = hist;
69 m_profile2DMapTitle[title] = hist;
70
71 // Declare to monitoring service
72 monitorHisto( Gaudi::Utils::Histos::toBase( hist ), ID );
73
74 // printout and return
75 if ( this->msgLevel( MSG::DEBUG ) ) {
76 this->debug() << "Booked 2D Profile Histogram : ID='" << ID << "' Path=" << histoPath() << " Title='"
77 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
78 }
79 return hist;
80 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
std::string::empty
T empty(T...args)
MSG::DEBUG
Definition: IMessageSvc.h:16
std::string
STL class.
GaudiHistos::monitorHisto
void monitorHisto(const AIDA::IBaseHistogram *hist, const HistoID &ID) const
Declare a histogram to the monitor service.
Definition: GaudiHistos.icpp:294
GaudiHistos::m_profile2DMapID
Profile2DMapID m_profile2DMapID
the actual storage/access of 2D profile histograms by unique ID
Definition: GaudiHistos.h:2831
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::m_profile2DMapTitle
Profile2DMapTitle m_profile2DMapTitle
the actual storage/access of 2D profile histograms by unique title
Definition: GaudiHistos.h:2829
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
Gaudi::Utils::Histos::toBase
GAUDI_API AIDA::IBaseHistogram * toBase(AIDA::IHistogram1D *histo)
Definition: Fill.cpp:180
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:114
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
template<class PBASE>

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

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

Definition at line 2400 of file GaudiHistos.h.

2400 { return m_checkForNaN; }
GaudiHistos::m_checkForNaN
Gaudi::Property< bool > m_checkForNaN
Definition: GaudiHistos.h:2778
template<class PBASE >

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

Create an ID string from a title string.

Definition at line 384 of file GaudiHistos.icpp.

385 {
386 // clean up the ID string for all unwanted characters
387 for ( const auto& i : m_idReplaceInfo ) {
388 stringSearchReplace( title, i.first, i.second );
389 }
390 return title;
391 }
GaudiHistos::m_idReplaceInfo
Gaudi::Property< std::map< std::string, std::string > > m_idReplaceInfo
Definition: GaudiHistos.h:2801
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 89 of file GaudiHistos_1DFixedBinning.icpp.

91 {
92 if ( !histo ) {
93 return nullptr;
94 } // RETURN
95 //
96 if ( !checkForNaN() ) {
97 Gaudi::Utils::Histos::fill( histo, value, weight );
98 } else if ( std::isfinite( value ) && std::isfinite( weight ) ) {
99 Gaudi::Utils::Histos::fill( histo, value, weight );
100 } else if ( std::isnan( value ) || std::isnan( weight ) ) {
101 this->Warning( "fill():: 'NaN' value is skipped from the histogram '" +
102 Gaudi::Utils::Histos::htitle( histo, title ) + "'" );
103 } else {
104 this->Warning( "fill():: 'Infinite' value is skipped from the histogram '" +
105 Gaudi::Utils::Histos::htitle( histo, title ) + "'" );
106 }
107 // return
108 return histo;
109 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
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::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2301
std::isnan
T isnan(T...args)
GaudiHistos::checkForNaN
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
Definition: GaudiHistos.h:2400
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 91 of file GaudiHistos_2DFixedBinning.icpp.

93 {
94 //
95 if ( !histo ) {
96 return nullptr;
97 } // RETURN
98 //
99 if ( !checkForNaN() ) {
100 Gaudi::Utils::Histos::fill( histo, valueX, valueY, weight );
101 } else if ( std::isfinite( valueX ) && std::isfinite( valueY ) && std::isfinite( weight ) ) {
102 Gaudi::Utils::Histos::fill( histo, valueX, valueY, weight );
103 } else if ( std::isnan( valueX ) || std::isnan( valueY ) || std::isnan( weight ) ) {
104 this->Warning( "fill():: 'NaN' value is skipped from the histogram '" +
105 Gaudi::Utils::Histos::htitle( histo, title ) + "'" );
106 } else {
107 this->Warning( "fill():: 'Infinite' value is skipped from the histogram '" +
108 Gaudi::Utils::Histos::htitle( histo, title ) + "'" );
109 }
110 // return
111 return histo;
112 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
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::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2301
std::isnan
T isnan(T...args)
GaudiHistos::checkForNaN
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
Definition: GaudiHistos.h:2400
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 94 of file GaudiHistos_3DFixedBinning.icpp.

96 {
97 if ( !histo ) {
98 return nullptr;
99 } // RETURN
100 //
101 if ( !checkForNaN() ) {
102 Gaudi::Utils::Histos::fill( histo, valueX, valueY, valueZ, weight );
103 } else if ( std::isfinite( valueX ) && std::isfinite( valueY ) && std::isfinite( valueZ ) &&
104 std::isfinite( weight ) ) {
105 Gaudi::Utils::Histos::fill( histo, valueX, valueY, valueZ, weight );
106 } else if ( std::isnan( valueX ) || std::isnan( valueY ) || std::isnan( valueZ ) || std::isnan( weight ) ) {
107 this->Warning( "fill():: 'NaN' value is skipped from the histogram '" +
108 Gaudi::Utils::Histos::htitle( histo, title ) + "'" );
109 } else {
110 this->Warning( "fill():: 'Infinite' value is skipped from the histogram '" +
111 Gaudi::Utils::Histos::htitle( histo, title ) + "'" );
112 }
113 // return
114 return histo;
115 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
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::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2301
std::isnan
T isnan(T...args)
GaudiHistos::checkForNaN
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
Definition: GaudiHistos.h:2400
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 89 of file GaudiHistos_1DProfFixedBinning.icpp.

91 {
92 //
93 if ( !histo ) {
94 return nullptr;
95 } // RETURN
96 //
97 if ( !checkForNaN() ) {
98 Gaudi::Utils::Histos::fill( histo, valueX, valueY, weight );
99 } else if ( std::isfinite( valueX ) && std::isfinite( valueY ) && std::isfinite( weight ) ) {
100 Gaudi::Utils::Histos::fill( histo, valueX, valueY, weight );
101 } else if ( std::isnan( valueX ) || std::isnan( valueY ) || std::isnan( weight ) ) {
102 this->Warning( "fill():: 'NaN' value is skipped from the histogram '" +
103 Gaudi::Utils::Histos::htitle( histo, title ) + "'" );
104 } else {
105 this->Warning( "fill():: 'Infinite' value is skipped from the histogram '" +
106 Gaudi::Utils::Histos::htitle( histo, title ) + "'" );
107 }
108 // return
109 return histo;
110 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
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::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2301
std::isnan
T isnan(T...args)
GaudiHistos::checkForNaN
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
Definition: GaudiHistos.h:2400
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 88 of file GaudiHistos_2DProfFixedBinning.icpp.

90 {
91 if ( 0 == histo ) {
92 return 0;
93 } // RETURN
94 //
95 if ( !checkForNaN() ) {
96 Gaudi::Utils::Histos::fill( histo, valueX, valueY, valueZ, weight );
97 } else if ( std::isfinite( valueX ) && std::isfinite( valueY ) && std::isfinite( valueZ ) &&
98 std::isfinite( weight ) ) {
99 Gaudi::Utils::Histos::fill( histo, valueX, valueY, valueZ, weight );
100 } else if ( std::isnan( valueX ) || std::isnan( valueY ) || std::isnan( valueZ ) || std::isnan( weight ) ) {
101 this->Warning( "fill():: 'NaN' value is skipped from the histogram '" +
102 Gaudi::Utils::Histos::htitle( histo, title ) + "'" );
103 } else {
104 this->Warning( "fill():: 'Infinite' value is skipped from the histogram '" +
105 Gaudi::Utils::Histos::htitle( histo, title ) + "'" );
106 }
107 // return
108 return histo;
109 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
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::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2301
std::isnan
T isnan(T...args)
GaudiHistos::checkForNaN
bool checkForNaN() const
get the flag for NaN checks (property "HistoCheckForNan")
Definition: GaudiHistos.h:2400
template<class PBASE >

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

standard finalization method

Returns
  status code

Definition at line 136 of file GaudiHistos.icpp.

137 {
138
139 if ( produceHistos() ) {
140
141 // Count how many histos of each type
142 if ( ( !noHistos() ) && histoCountersPrint() ) {
143 const unsigned int n1D = histo1DMapID().size();
144 const unsigned int n2D = histo2DMapID().size();
145 const unsigned int n3D = histo3DMapID().size();
146 const unsigned int n1DP = profile1DMapID().size();
147 const unsigned int n2DP = profile2DMapID().size();
148 const unsigned int total = n1D + n2D + n3D + n1DP + n2DP;
149 if ( total > 0 ) {
150 this->always() << "Booked " << total << " Histogram(s) : ";
151 if ( n1D > 0 ) this->always() << "1D=" << n1D << " ";
152 if ( n2D > 0 ) this->always() << "2D=" << n2D << " ";
153 if ( n3D > 0 ) this->always() << "3D=" << n3D << " ";
154 if ( n1DP > 0 ) this->always() << "1DProf=" << n1DP << " ";
155 if ( n2DP > 0 ) this->always() << "2DProf=" << n2DP << " ";
156 this->always() << endmsg;
157 }
158 }
159
160 // detailed printing
161 if ( histosPrint() ) {
162 printHistos();
163 }
164 }
165
166 // clear all maps
167 m_histo1DMapTitle.clear();
168 m_histo2DMapTitle.clear();
169 m_histo3DMapTitle.clear();
170 m_histo1DMapID.clear();
171 m_histo2DMapID.clear();
172 m_histo3DMapID.clear();
173 m_profile1DMapTitle.clear();
174 m_profile2DMapTitle.clear();
175 m_profile1DMapID.clear();
176 m_profile2DMapID.clear();
177
178 // finalize base class
179 return PBASE::finalize();
180 }
GaudiHistos::printHistos
int printHistos(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of histograms
Definition: GaudiHistos.icpp:185
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:199
GaudiHistos::m_profile1DMapID
Profile1DMapID m_profile1DMapID
the actual storage/access of 1D profile histograms by unique ID
Definition: GaudiHistos.h:2826
GaudiHistos::noHistos
bool noHistos() const
Check if all histogram maps are empty.
Definition: GaudiHistos.icpp:284
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2675
GaudiHistos::m_histo1DMapID
Histo1DMapID m_histo1DMapID
the actual storage/access of 1D histograms by unique ID
Definition: GaudiHistos.h:2811
GaudiHistos::m_histo3DMapTitle
Histo3DMapTitle m_histo3DMapTitle
the actual storage/access of 3D histograms by unique title
Definition: GaudiHistos.h:2819
GaudiHistos::m_histo2DMapTitle
Histo2DMapTitle m_histo2DMapTitle
the actual storage/access of 2D histograms by unique title
Definition: GaudiHistos.h:2814
GaudiHistos::m_profile1DMapTitle
Profile1DMapTitle m_profile1DMapTitle
the actual storage/access of 1D profile histograms by unique title
Definition: GaudiHistos.h:2824
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2473
GaudiHistos::m_profile2DMapID
Profile2DMapID m_profile2DMapID
the actual storage/access of 2D profile histograms by unique ID
Definition: GaudiHistos.h:2831
GaudiHistos::m_histo1DMapTitle
Histo1DMapTitle m_histo1DMapTitle
the actual storage/access of 1D histograms by unique title
Definition: GaudiHistos.h:2809
GaudiHistos::m_profile2DMapTitle
Profile2DMapTitle m_profile2DMapTitle
the actual storage/access of 2D profile histograms by unique title
Definition: GaudiHistos.h:2829
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2625
GaudiHistos::histoCountersPrint
bool histoCountersPrint() const
print histogram counters at finalization ?
Definition: GaudiHistos.h:2414
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
GaudiHistos::m_histo3DMapID
Histo3DMapID m_histo3DMapID
the actual storage/access of 3D histograms by unique ID
Definition: GaudiHistos.h:2821
GaudiUtils::Map::clear
void clear()
Definition: Map.h:195
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2523
GaudiHistos::m_histo2DMapID
Histo2DMapID m_histo2DMapID
the actual storage/access of 2D histograms by unique ID
Definition: GaudiHistos.h:2816
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
GaudiHistos::histosPrint
bool histosPrint() const
print histograms at finalization ?
Definition: GaudiHistos.h:2412
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2573
template<class PBASE>

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

get flag to control output level of histograms

Definition at line 2398 of file GaudiHistos.h.

2398 { return m_fullDetail; }
GaudiHistos::m_fullDetail
Gaudi::Property< bool > m_fullDetail
Definition: GaudiHistos.h:2788
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 2301 of file GaudiHistos.h.

2301 { 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:2288
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 2353 of file GaudiHistos.h.

2353 { 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:2288
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 2288 of file GaudiHistos.h.

2289 {
2290 auto found = histo1DMapTitle().find( title );
2291 return found != histo1DMapTitle().end() ? found->second : nullptr;
2292 }
GaudiHistos::histo1DMapTitle
const Histo1DMapTitle & histo1DMapTitle() const
get access to the map of all 1D histograms indexed via their title
Definition: GaudiHistos.h:2449
GaudiUtils::Map::end
iterator end()
Definition: Map.h:134
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:151
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 308 of file GaudiHistos.icpp.

309 {
310 return lookup_( histo1DMapID(), ID );
311 }
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2473
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 2473 of file GaudiHistos.h.

2473 { return m_histo1DMapID; }
GaudiHistos::m_histo1DMapID
Histo1DMapID m_histo1DMapID
the actual storage/access of 1D histograms by unique ID
Definition: GaudiHistos.h:2811
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 2449 of file GaudiHistos.h.

2449 { return m_histo1DMapTitle; }
GaudiHistos::m_histo1DMapTitle
Histo1DMapTitle m_histo1DMapTitle
the actual storage/access of 1D histograms by unique title
Definition: GaudiHistos.h:2809
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 2306 of file GaudiHistos.h.

2307 {
2308 auto found = histo2DMapTitle().find( title );
2309 return histo2DMapTitle().end() != found ? found->second : nullptr;
2310 }
GaudiUtils::Map::end
iterator end()
Definition: Map.h:134
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:151
GaudiHistos::histo2DMapTitle
const Histo2DMapTitle & histo2DMapTitle() const
get access to the map of all 2D histograms indexed via their title
Definition: GaudiHistos.h:2500
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 316 of file GaudiHistos.icpp.

317 {
318 return lookup_( histo2DMapID(), ID );
319 }
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2523
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 2523 of file GaudiHistos.h.

2523 { return m_histo2DMapID; }
GaudiHistos::m_histo2DMapID
Histo2DMapID m_histo2DMapID
the actual storage/access of 2D histograms by unique ID
Definition: GaudiHistos.h:2816
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 2500 of file GaudiHistos.h.

2500 { return m_histo2DMapTitle; }
GaudiHistos::m_histo2DMapTitle
Histo2DMapTitle m_histo2DMapTitle
the actual storage/access of 2D histograms by unique title
Definition: GaudiHistos.h:2814
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 2315 of file GaudiHistos.h.

2316 {
2317 auto found = histo3DMapTitle().find( title );
2318 return histo3DMapTitle().end() != found ? found->second : nullptr;
2319 }
GaudiHistos::histo3DMapTitle
const Histo3DMapTitle & histo3DMapTitle() const
get access to the map of all 3D histograms indexed via their title
Definition: GaudiHistos.h:2550
GaudiUtils::Map::end
iterator end()
Definition: Map.h:134
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:151
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 324 of file GaudiHistos.icpp.

325 {
326 return lookup_( histo3DMapID(), ID );
327 }
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2573
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 2573 of file GaudiHistos.h.

2573 { return m_histo3DMapID; }
GaudiHistos::m_histo3DMapID
Histo3DMapID m_histo3DMapID
the actual storage/access of 3D histograms by unique ID
Definition: GaudiHistos.h:2821
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 2550 of file GaudiHistos.h.

2550 { return m_histo3DMapTitle; }
GaudiHistos::m_histo3DMapTitle
Histo3DMapTitle m_histo3DMapTitle
the actual storage/access of 3D histograms by unique title
Definition: GaudiHistos.h:2819
template<class PBASE>

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

print histogram counters at finalization ?

Definition at line 2414 of file GaudiHistos.h.

2414 { return m_histoCountersPrint; }
GaudiHistos::m_histoCountersPrint
Gaudi::Property< bool > m_histoCountersPrint
Definition: GaudiHistos.h:2776
template<class PBASE>

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

get histogram directory (property "HistoDir")

Definition at line 2408 of file GaudiHistos.h.

2408 { return m_histoDir; }
GaudiHistos::m_histoDir
Gaudi::Property< std::string > m_histoDir
Definition: GaudiHistos.h:2786
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 2378 of file GaudiHistos.h.

2379 {
2380 return ( 0 != histo( title ) || 0 != histo2D( title ) || 0 != histo3D( title ) || 0 != profile1D( title ) ||
2381 0 != profile2D( title ) );
2382 }
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:2306
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:115
GaudiHistos::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2301
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:114
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:2315
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 2385 of file GaudiHistos.h.

2386 {
2387 return ( 0 != histo( ID ) || 0 != histo2D( ID ) || 0 != histo3D( ID ) || 0 != profile1D( ID ) ||
2388 0 != profile2D( ID ) );
2389 }
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:2306
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:115
GaudiHistos::histo
AIDA::IHistogram1D * histo(const std::string &title) const
access the EXISTING 1D histogram by title
Definition: GaudiHistos.h:2301
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:114
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:2315
template<class PBASE>

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

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

Definition at line 2404 of file GaudiHistos.h.

2404 { return m_histoOffSet; }
GaudiHistos::m_histoOffSet
Gaudi::Property< HistoID::NumericID > m_histoOffSet
Definition: GaudiHistos.h:2782
template<class PBASE >

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

get the constructed histogram path

Definition at line 410 of file GaudiHistos.icpp.

411 {
412 std::string path = histoTopDir() + histoDir();
413 return splitHistoDir() ? dirHbookName( path ) : path;
414 }
GaudiPython.HistoUtils.path
path
Definition: HistoUtils.py:895
GaudiHistos::splitHistoDir
bool splitHistoDir() const
get the flag for histogram path split (property "HistoSplitDir")
Definition: GaudiHistos.h:2402
std::string
STL class.
GaudiHistos::histoDir
const std::string & histoDir() const
get histogram directory (property "HistoDir")
Definition: GaudiHistos.h:2408
GaudiHistos::histoTopDir
const std::string & histoTopDir() const
get top-level histogram directory (property "HistoTopDir")
Definition: GaudiHistos.h:2406
template<class PBASE>

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

print histograms at finalization ?

Definition at line 2412 of file GaudiHistos.h.

2412 { return m_histosPrint; }
GaudiHistos::m_histosPrint
Gaudi::Property< bool > m_histosPrint
Definition: GaudiHistos.h:2774
template<class PBASE>

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

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

Definition at line 2406 of file GaudiHistos.h.

2406 { return m_histoTopDir; }
GaudiHistos::m_histoTopDir
Gaudi::Property< std::string > m_histoTopDir
Definition: GaudiHistos.h:2784
template<class PBASE >

void GaudiHistos< PBASE >::initGaudiHistosConstructor | ( |  | ) |
| private

Constructor initialisation and job options.

Definition at line 80 of file GaudiHistos.icpp.

81 {
82 m_histosPrint.declareUpdateHandler( &GaudiHistos<PBASE>::printHistoHandler, this );
83 }
GaudiHistos::m_histosPrint
Gaudi::Property< bool > m_histosPrint
Definition: GaudiHistos.h:2774
GaudiHistos
Templated base class providing common histogramming methods for GaudiAlgorithm and GaudiTool like cla...
Definition: GaudiHistos.h:56
template<class PBASE >

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

standard initialization method

Returns
  status code

Definition at line 94 of file GaudiHistos.icpp.

95 {
96 // initialize base class
97 const StatusCode sc = PBASE::initialize();
98 if ( sc.isFailure() ) return sc;
99
100 // produce histograms?
101 if ( !produceHistos() ) {
102 this->debug() << "Histogram production is switched OFF" << endmsg;
103 return sc;
104 }
105
106 // check the validity of histogram service
107 if ( !this->histoSvc() ) {
108 return this->Error( "initialize():: IHistogramSvc* is invalid" );
109 }
110
111 // Warn if the user has decided to use numerical automatic IDs
112 if ( useNumericAutoIDs() ) {
113 this->Warning(
114 "Using numerical automatic IDs. These are not guaranteed to be totally deterministic. Use with care...",
115 StatusCode::SUCCESS )
116 .ignore();
117 }
118
119 // Finally, print the location histogram will be written to
120 this->Print( "The histogram path is set to be '" + histoPath() + "'", StatusCode( StatusCode::SUCCESS, true ),
121 MSG::DEBUG )
122 .ignore();
123
124 return sc;
125 }
StatusCode::SUCCESS
Definition: StatusCode.h:31
MSG::DEBUG
Definition: IMessageSvc.h:16
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
GaudiHistos::useNumericAutoIDs
bool useNumericAutoIDs() const
Use old style sequencial numerical automatically assigned IDs ?
Definition: GaudiHistos.h:2416
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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 294 of file GaudiHistos.icpp.

295 {
296 if ( hist && m_declareMoniHists ) {
297 if ( this->msgLevel( MSG::DEBUG ) ) {
298 this->debug() << "Monitoring histogram '" << ID.idAsString() << "' desc = '"
299 << Gaudi::Utils::Histos::htitle( hist ) << "'" << endmsg;
300 }
301 this->declareInfo( histoPath() + "/" + ID.idAsString(), hist, Gaudi::Utils::Histos::htitle( hist ) );
302 }
303 }
Gaudi::Utils::Histos::htitle
GAUDI_API std::string htitle(const AIDA::IBaseHistogram *histo, const std::string &title="")
get the title
Definition: Fill.cpp:126
MSG::DEBUG
Definition: IMessageSvc.h:16
GaudiHistos::m_declareMoniHists
Gaudi::Property< bool > m_declareMoniHists
Definition: GaudiHistos.h:2789
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
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 357 of file GaudiHistos.icpp.

358 {
359 if ( useNumericAutoIDs() || title.empty() ) {
360 if ( !useNumericAutoIDs() ) {
361 this->Warning(
362 "Cannot generate automatic literal ID from an empty title ! Using numeric ID instead for histogram ID",
363 StatusCode::SUCCESS );
364 }
365 // propose the histogram ID (always numeric)
366 ID = HistoID( totalNumberOfHistos() + 1 + histoOffSet() );
367 // adjust the proposed ID
368 while ( histoExists( ID ) ) {
369 ID = HistoID( ID.numeric() + 1 );
370 }
371 } else {
372 // use the title to create a unique literal ID
373 ID = HistoID( this->convertTitleToID( title ) );
374 // Just in case ...
375 while ( histoExists( ID ) ) {
376 ID = HistoID( ID.idAsString() + "_" );
377 }
378 }
379 }
GaudiHistos::histoOffSet
HistoID::NumericID histoOffSet() const
get the value for histogram offset (property "HistoOffSet")
Definition: GaudiHistos.h:2404
StatusCode::SUCCESS
Definition: StatusCode.h:31
std::string::empty
T empty(T...args)
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::totalNumberOfHistos
unsigned int totalNumberOfHistos() const
Returns the total number of histograms (of all types) currently booked.
Definition: GaudiHistos.icpp:348
GaudiHistos::useNumericAutoIDs
bool useNumericAutoIDs() const
Use old style sequencial numerical automatically assigned IDs ?
Definition: GaudiHistos.h:2416
GaudiHistos::histoExists
bool histoExists(const std::string &title) const
check the existence AND validity of the histogram with given title
Definition: GaudiHistos.h:2378
GaudiHistos::convertTitleToID
std::string convertTitleToID(std::string title) const
Create an ID string from a title string.
Definition: GaudiHistos.icpp:384
template<class PBASE >

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

Check if all histogram maps are empty.

Definition at line 284 of file GaudiHistos.icpp.

285 {
286 return ( histo1DMapTitle().empty() && histo2DMapTitle().empty() && histo3DMapTitle().empty() &&
287 profile1DMapTitle().empty() && profile2DMapTitle().empty() && histo1DMapID().empty() &&
288 histo2DMapID().empty() && histo3DMapID().empty() && profile1DMapID().empty() && profile2DMapID().empty() );
289 }
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2675
GaudiHistos::histo3DMapTitle
const Histo3DMapTitle & histo3DMapTitle() const
get access to the map of all 3D histograms indexed via their title
Definition: GaudiHistos.h:2550
GaudiHistos::profile2DMapTitle
const Profile2DMapTitle & profile2DMapTitle() const
get access to the map of all 2D profile histograms indexed via their title
Definition: GaudiHistos.h:2652
GaudiHistos::histo1DMapTitle
const Histo1DMapTitle & histo1DMapTitle() const
get access to the map of all 1D histograms indexed via their title
Definition: GaudiHistos.h:2449
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2473
GaudiHistos::profile1DMapTitle
const Profile1DMapTitle & profile1DMapTitle() const
get access to the map of all 1D profile histograms indexed via their title
Definition: GaudiHistos.h:2602
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2625
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2523
GaudiHistos::histo2DMapTitle
const Histo2DMapTitle & histo2DMapTitle() const
get access to the map of all 2D histograms indexed via their title
Definition: GaudiHistos.h:2500
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2573
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 154 of file GaudiHistos.h.

156 {
157 return plot1D( value, title, low, high, bins, weight );
158 }
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:114
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 196 of file GaudiHistos.h.

197 {
198 return plot1D( value, hdef, weight );
199 }
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:114
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 283 of file GaudiHistos.h.

285 {
286 return plot1D( value, ID, title, low, high, bins, weight );
287 }
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:114
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 328 of file GaudiHistos.h.

330 {
331 return plot1D( value, ID, hdef, weight );
332 }
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:114
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 397 of file GaudiHistos.h.

399 {
400 AIDA::IHistogram1D* h = nullptr;
401 if ( produceHistos() ) {
402 // retrieve or book the histogram
403 h = histo1D( title );
404 if ( !h ) {
405 h = book1D( title, low, high, bins );
406 }
407 // fill histogram
408 while ( first != last && h ) {
409 h = fill( h, func( *first ), 1.0, title );
410 ++first;
411 }
412 }
413 return h;
414 }
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::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:2288
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:229
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 472 of file GaudiHistos.h.

475 {
476 AIDA::IHistogram1D* h( 0 );
477 if ( produceHistos() ) {
478 // retrieve or book the histogram
479 h = histo1D( ID );
480 if ( !h ) {
481 h = book1D( ID, title, low, high, bins );
482 }
483 // fill histogram
484 while ( first != last && h ) {
485 h = fill( h, func( *first ), 1.0, title );
486 ++first;
487 }
488 }
489 return h;
490 }
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::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:2288
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:229
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 561 of file GaudiHistos.h.

564 {
565 AIDA::IHistogram1D* h = nullptr;
566 if ( produceHistos() ) {
567 // retrieve or book the histogram
568 h = histo1D( title );
569 if ( !h ) {
570 h = book1D( title, low, high, bins );
571 }
572 // fill histogram
573 while ( first != last && h ) {
574 h = fill( h, func( *first ), weight( *first ), title );
575 ++first;
576 }
577 }
578 return h;
579 }
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::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:2288
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:229
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 648 of file GaudiHistos.h.

651 {
652 AIDA::IHistogram1D* h = nullptr;
653 if ( produceHistos() ) {
654 // retrieve or book the histogram
655 h = histo1D( ID );
656 if ( !h ) {
657 h = book1D( ID, title, low, high, bins );
658 }
659 // fill histogram
660 while ( first != last && h ) {
661 h = fill( h, func( *first ), weight( *first ), title );
662 ++first;
663 }
664 }
665 return h;
666 }
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::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:2288
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:229
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 114 of file GaudiHistos_1DFixedBinning.icpp.

116 {
117 AIDA::IHistogram1D* h( nullptr );
118 if ( produceHistos() ) {
119 // retrieve or book the histogram
120 h = histo1D( title );
121 if ( !h ) {
122 h = book1D( title, low, high, bins );
123 }
124 // fill the histogram
125 h = fill( h, value, weight, title );
126 }
127 return h;
128 }
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::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:2288
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 169 of file GaudiHistos_1DFixedBinning.icpp.

171 {
172 return plot1D( value, hdef.title(), hdef.lowEdge(), hdef.highEdge(), hdef.bins(), weight );
173 }
Gaudi::Histo1DDef::highEdge
double highEdge() const
get the high edge
Definition: HistoDef.h:61
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition: HistoDef.h:59
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition: HistoDef.h:65
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition: HistoDef.h:63
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:114
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 133 of file GaudiHistos_1DFixedBinning.icpp.

136 {
137 AIDA::IHistogram1D* h( nullptr );
138 if ( produceHistos() ) {
139 // retrieve or book the histogram
140 h = histo1D( ID );
141 if ( !h ) {
142 h = book1D( ID, title, low, high, bins );
143 }
144 // fill
145 h = fill( h, value, weight, title );
146 }
147 return h;
148 }
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::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:2288
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 178 of file GaudiHistos_1DFixedBinning.icpp.

180 {
181 return plot1D( value, ID, hdef.title(), hdef.lowEdge(), hdef.highEdge(), hdef.bins(), weight );
182 }
Gaudi::Histo1DDef::highEdge
double highEdge() const
get the high edge
Definition: HistoDef.h:61
Gaudi::Histo1DDef::lowEdge
double lowEdge() const
get the low edge
Definition: HistoDef.h:59
Gaudi::Histo1DDef::title
const std::string & title() const
get the title
Definition: HistoDef.h:65
Gaudi::Histo1DDef::bins
int bins() const
get the number of bins
Definition: HistoDef.h:63
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:114
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 87 of file GaudiHistos_1DVariableBinning.icpp.

89 {
90 AIDA::IHistogram1D* h( nullptr );
91 if ( produceHistos() ) {
92 // retrieve or book the histogram
93 h = histo1D( title );
94 if ( !h ) {
95 h = book1D( title, edges );
96 }
97 // fill the histogram
98 h = fill( h, value, weight, title );
99 }
100 return h;
101 }
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::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:2288
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 106 of file GaudiHistos_1DVariableBinning.icpp.

108 {
109 AIDA::IHistogram1D* h( nullptr );
110 if ( produceHistos() ) {
111 // retrieve or book the histogram
112 h = histo1D( ID );
113 if ( !h ) {
114 h = book1D( ID, title, edges );
115 }
116 // fill
117 h = fill( h, value, weight, title );
118 }
119 return h;
120 }
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::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:2288
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 117 of file GaudiHistos_2DFixedBinning.icpp.

121 {
122 AIDA::IHistogram2D* h( nullptr );
123 if ( produceHistos() ) {
124 // retrieve or book the histogram
125 h = histo2D( title );
126 if ( !h ) {
127 h = book2D( title, lowX, highX, binsX, lowY, highY, binsY );
128 }
129 // fill the histogram
130 h = fill( h, valueX, valueY, weight, title );
131 }
132 return h;
133 }
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:2306
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
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::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 138 of file GaudiHistos_2DFixedBinning.icpp.

142 {
143 AIDA::IHistogram2D* h( nullptr );
144 // produce histograms ?
145 if ( produceHistos() ) {
146 // retrieve or book the histogram
147 h = histo2D( ID );
148 if ( !h ) {
149 h = book2D( ID, title, lowX, highX, binsX, lowY, highY, binsY );
150 }
151 // fill the histogram
152 h = fill( h, valueX, valueY, weight, title );
153 }
154 return h;
155 }
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:2306
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
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::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 88 of file GaudiHistos_2DVariableBinning.icpp.

91 {
92 AIDA::IHistogram2D* h( nullptr );
93 if ( produceHistos() ) {
94 // retrieve or book the histogram
95 h = histo2D( title );
96 if ( !h ) {
97 h = book2D( title, edgesX, edgesY );
98 }
99 // fill the histogram
100 h = fill( h, valueX, valueY, weight, title );
101 }
102 return h;
103 }
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:2306
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
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::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 108 of file GaudiHistos_2DVariableBinning.icpp.

111 {
112 AIDA::IHistogram2D* h( nullptr );
113 if ( produceHistos() ) {
114 // retrieve or book the histogram
115 h = histo2D( ID );
116 if ( !h ) {
117 h = book2D( ID, title, edgesX, edgesY );
118 }
119 // fill
120 h = fill( h, valueX, valueY, weight, title );
121 }
122 return h;
123 }
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:2306
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
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::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:89
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 121 of file GaudiHistos_3DFixedBinning.icpp.

125 {
126 AIDA::IHistogram3D* h( nullptr );
127 if ( produceHistos() ) {
128 // retrieve or book the histogram
129 h = histo3D( title );
130 if ( !h ) {
131 h = book3D( title, lowX, highX, binsX, lowY, highY, binsY, lowZ, highZ, binsZ );
132 }
133 // fill the histogram
134 h = fill( h, valueX, valueY, valueZ, weight, title );
135 }
136 return h;
137 }
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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::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:2315
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:89
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 143 of file GaudiHistos_3DFixedBinning.icpp.

147 {
148 AIDA::IHistogram3D* h( nullptr );
149 if ( produceHistos() ) {
150 // retrieve or book the histogram
151 h = histo3D( ID );
152 if ( !h ) {
153 h = book3D( ID, title, lowX, highX, binsX, lowY, highY, binsY, lowZ, highZ, binsZ );
154 }
155 // fill the histogram
156 h = fill( h, valueX, valueY, valueZ, weight, title );
157 }
158 return h;
159 }
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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::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:2315
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:89
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 89 of file GaudiHistos_3DVariableBinning.icpp.

93 {
94 AIDA::IHistogram3D* h( nullptr );
95 if ( produceHistos() ) {
96 // retrieve or book the histogram
97 h = histo3D( title );
98 if ( !h ) {
99 h = book3D( title, edgesX, edgesY, edgesZ );
100 }
101 // fill the histogram
102 h = fill( h, valueX, valueY, valueZ, weight, title );
103 }
104 return h;
105 }
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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::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:2315
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:89
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 110 of file GaudiHistos_3DVariableBinning.icpp.

114 {
115 AIDA::IHistogram3D* h( nullptr );
116 if ( produceHistos() ) {
117 // retrieve or book the histogram
118 h = histo3D( ID );
119 if ( !h ) {
120 h = book3D( ID, title, edgesX, edgesY, edgesZ );
121 }
122 // fill
123 h = fill( h, valueX, valueY, valueZ, weight, title );
124 }
125 return h;
126 }
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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::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:2315
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:89
template<class PBASE >

void GaudiHistos< PBASE >::printHistoHandler | ( | Gaudi::Details::PropertyBase & |  | ) |
| private

the handler for "HistoPrint" property

Definition at line 396 of file GaudiHistos.icpp.

397 {
398 // no action if not yet initialized
399 if ( this->FSMState() < Gaudi::StateMachine::INITIALIZED ) {
400 return;
401 }
402 if ( this->histosPrint() ) {
403 this->printHistos( MSG::ALWAYS );
404 }
405 }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
GaudiHistos::printHistos
int printHistos(const MSG::Level level=MSG::ALWAYS) const
perform the actual printout of histograms
Definition: GaudiHistos.icpp:185
MSG::ALWAYS
Definition: IMessageSvc.h:16
GaudiHistos::histosPrint
bool histosPrint() const
print histograms at finalization ?
Definition: GaudiHistos.h:2412
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 185 of file GaudiHistos.icpp.

186 {
187 using namespace Gaudi::Utils::Histos;
188
189 if ( noHistos() ) {
190 if ( this->msgLevel( MSG::DEBUG ) ) {
191 this->msgStream( level ) << "No histograms are booked" << endmsg;
192 }
193 return 0; // RETURN
194 }
195
196 MsgStream& msg = this->msgStream( level );
197
198 // Printout all histograms
199
200 Gaudi::Utils::Histos::Table table( m_histo1DTableFormat, m_histo1DTableHeader );
201
202 if ( !histo1DMapID().empty() ) {
203 msg << "List of booked 1D histograms in directory "
204 << "\"" << histoPath() << "\" :-";
205
206 if ( !table.header().empty() ) {
207 msg << std::endl << Gaudi::Utils::Histos::format( "ID", table.header(), m_histo1DTableFormatShort );
208 }
209 for ( const auto& entry : ordered( histo1DMapID() ) ) {
210 const auto* aida = entry.second;
211 if ( !aida ) {
212 this->error() << "IHistogram1D points to NULL" << endmsg;
213 continue;
214 }
215 // format and print the row
216 msg << std::endl << table.toString( aida, HistoID( entry.first ), m_histo1DTableFormatShort );
217 }
218 msg << endmsg;
219 }
220 // ==========================================================================
221 if ( !histo2DMapID().empty() ) {
222 msg << "List of booked 2D histograms in directory "
223 << "\"" << histoPath() << "\" :-";
224
225 for ( const auto& entry : ordered( histo2DMapID() ) ) {
226 const auto* aida = entry.second;
227 if ( !aida ) {
228 this->error() << "IHistogram2D points to NULL" << endmsg;
229 continue;
230 }
231 msg << std::endl << GaudiAlg::Print2D::toString( aida, entry.first );
232 }
233 msg << endmsg;
234 }
235 // ==========================================================================
236 if ( !histo3DMapID().empty() ) {
237 msg << "List of booked 3D histograms in directory "
238 << "\"" << histoPath() << "\" :-";
239 for ( const auto& entry : ordered( histo3DMapID() ) ) {
240 const auto* aida = entry.second;
241 if ( !aida ) {
242 this->error() << "IHistogram3D points to NULL" << endmsg;
243 continue;
244 }
245 msg << std::endl << GaudiAlg::Print3D::toString( aida, entry.first );
246 }
247 msg << endmsg;
248 }
249 // ==========================================================================
250 if ( !profile1DMapID().empty() ) {
251 msg << "List of booked 1D profile histograms in directory "
252 << "\"" << histoPath() << "\" :-";
253 for ( const auto& entry : ordered( profile1DMapID() ) ) {
254 const auto* aida = entry.second;
255 if ( !aida ) {
256 this->error() << "IProfile1D points to NULL" << endmsg;
257 continue;
258 }
259 msg << std::endl << GaudiAlg::Print1DProf::toString( aida, entry.first );
260 }
261 msg << endmsg;
262 }
263 // ==========================================================================
264 if ( !profile2DMapID().empty() ) {
265 msg << "List of booked 2D profile histograms in directory "
266 << "\"" << histoPath() << "\" :-";
267 for ( const auto& entry : ordered( profile2DMapID() ) ) {
268 const auto* aida = entry.second;
269 if ( !aida ) {
270 this->error() << "IProfile2D points to NULL" << endmsg;
271 continue;
272 }
273 msg << std::endl << GaudiAlg::Print2DProf::toString( aida, entry.first );
274 }
275 msg << endmsg;
276 }
277 //
278 return this->totalNumberOfHistos();
279 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
GaudiHistos::noHistos
bool noHistos() const
Check if all histogram maps are empty.
Definition: GaudiHistos.icpp:284
GaudiHistos::HistoID
GaudiAlg::HistoID HistoID
the actual type for histogram identifier
Definition: GaudiHistos.h:61
GaudiHistos::m_histo1DTableFormatShort
Gaudi::Property< std::string > m_histo1DTableFormatShort
Definition: GaudiHistos.h:2793
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2675
Gaudi::Utils::Histos::format
GAUDI_API std::string format(const AIDA::IHistogram1D *histo, const std::string &fmt)
Make the string representation of the historgam according to the specified format.
Definition: HistoTableFormat.cpp:234
MSG::DEBUG
Definition: IMessageSvc.h:16
std::endl
T endl(T...args)
Gaudi::Utils::Histos
Collection of useful utilities for manipulations with AIDA hisgograms.
Definition: Fill.h:29
GaudiHistos::m_histo1DTableHeader
Gaudi::Property< std::string > m_histo1DTableHeader
Definition: GaudiHistos.h:2795
GaudiHistos::m_histo1DTableFormat
Gaudi::Property< std::string > m_histo1DTableFormat
Definition: GaudiHistos.h:2790
GaudiHistos::totalNumberOfHistos
unsigned int totalNumberOfHistos() const
Returns the total number of histograms (of all types) currently booked.
Definition: GaudiHistos.icpp:348
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2473
Gaudi::Utils::Histos::Table
Simple class for the customizeble printout of the histogram tables.
Definition: HistoTableFormat.h:381
GaudiAlg::Print3D::toString
static std::string toString(const AIDA::IHistogram3D *aida, const GaudiAlg::HistoID &ID)
Definition: Print.cpp:102
GaudiHistos::histoPath
std::string histoPath() const
get the constructed histogram path
Definition: GaudiHistos.icpp:410
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2625
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2523
GaudiAlg::Print2D::toString
static std::string toString(const AIDA::IHistogram2D *aida, const GaudiAlg::HistoID &ID)
Definition: Print.cpp:86
gaudirun.level
level
Definition: gaudirun.py:271
GaudiAlg::Print1DProf::toString
static std::string toString(const AIDA::IProfile1D *aida, const GaudiAlg::HistoID &ID)
Definition: Print.cpp:120
GaudiAlg::Print2DProf::toString
static std::string toString(const AIDA::IProfile2D *aida, const GaudiAlg::HistoID &ID)
Definition: Print.cpp:135
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2573
template<class PBASE>

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

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

Definition at line 2396 of file GaudiHistos.h.

2396 { return m_produceHistos; }
GaudiHistos::m_produceHistos
Gaudi::Property< bool > m_produceHistos
Definition: GaudiHistos.h:2773
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 115 of file GaudiHistos_1DProfFixedBinning.icpp.

119 {
120 AIDA::IProfile1D* h = nullptr;
121 if ( produceHistos() ) {
122 // retrieve or book the histogram
123 h = profile1D( title );
124 if ( !h ) {
125 h = bookProfile1D( title, lowX, highX, binsX, opt, lowY, highY );
126 }
127 // fill the histogram
128 h = fill( h, valueX, valueY, weight, title );
129 }
130 return h;
131 }
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:115
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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::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:89
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 136 of file GaudiHistos_1DProfFixedBinning.icpp.

140 {
141 AIDA::IProfile1D* h = nullptr;
142 if ( produceHistos() ) {
143 // retrieve or book the histogram
144 h = profile1D( ID );
145 if ( !h ) {
146 h = bookProfile1D( ID, title, lowX, highX, binsX, opt, lowY, highY );
147 }
148 // fill the histogram
149 h = fill( h, valueX, valueY, weight, title );
150 }
151 return h;
152 }
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:115
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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::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:89
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 85 of file GaudiHistos_1DProfVariableBinning.icpp.

87 {
88 AIDA::IProfile1D* h( nullptr );
89 if ( produceHistos() ) {
90 // retrieve or book the histogram
91 h = profile1D( title );
92 if ( !h ) {
93 h = bookProfile1D( title, edges );
94 }
95 // fill the histogram
96 h = fill( h, valueX, valueY, weight, title );
97 }
98 return h;
99 }
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:115
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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::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:89
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 104 of file GaudiHistos_1DProfVariableBinning.icpp.

107 {
108 AIDA::IProfile1D* h( nullptr );
109 if ( produceHistos() ) {
110 // retrieve or book the histogram
111 h = profile1D( ID );
112 if ( !h ) {
113 h = bookProfile1D( ID, title, edges );
114 }
115 // fill the histogram
116 h = fill( h, valueX, valueY, weight, title );
117 }
118 return h;
119 }
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:115
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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::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:89
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 2324 of file GaudiHistos.h.

2325 {
2326 auto found = profile1DMapTitle().find( title );
2327 return profile1DMapTitle().end() != found ? found->second : nullptr;
2328 }
GaudiUtils::Map::end
iterator end()
Definition: Map.h:134
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:151
GaudiHistos::profile1DMapTitle
const Profile1DMapTitle & profile1DMapTitle() const
get access to the map of all 1D profile histograms indexed via their title
Definition: GaudiHistos.h:2602
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 332 of file GaudiHistos.icpp.

333 {
334 return lookup_( profile1DMapID(), ID );
335 }
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2625
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 2625 of file GaudiHistos.h.

2625 { return m_profile1DMapID; }
GaudiHistos::m_profile1DMapID
Profile1DMapID m_profile1DMapID
the actual storage/access of 1D profile histograms by unique ID
Definition: GaudiHistos.h:2826
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 2602 of file GaudiHistos.h.

2602 { return m_profile1DMapTitle; }
GaudiHistos::m_profile1DMapTitle
Profile1DMapTitle m_profile1DMapTitle
the actual storage/access of 1D profile histograms by unique title
Definition: GaudiHistos.h:2824
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 114 of file GaudiHistos_2DProfFixedBinning.icpp.

118 {
119 AIDA::IProfile2D* h = nullptr;
120 if ( produceHistos() ) {
121 // retrieve or book the histogram
122 h = profile2D( title );
123 if ( 0 == h ) {
124 h = bookProfile2D( title, lowX, highX, binsX, lowY, highY, binsY );
125 }
126 // fill the histogram
127 h = fill( h, valueX, valueY, valueZ, weight, title );
128 }
129 return h;
130 }
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
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:114
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:89
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 135 of file GaudiHistos_2DProfFixedBinning.icpp.

140 {
141 AIDA::IProfile2D* h = nullptr;
142 if ( produceHistos() ) {
143 // retrieve or book the histogram
144 h = profile2D( ID );
145 if ( 0 == h ) {
146 h = bookProfile2D( ID, title, lowX, highX, binsX, lowY, highY, binsY );
147 }
148 // fill the histogram
149 h = fill( h, valueX, valueY, valueZ, weight, title );
150 }
151 return h;
152 }
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
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:114
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:89
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 85 of file GaudiHistos_2DProfVariableBinning.icpp.

88 {
89 AIDA::IProfile2D* h( nullptr );
90 if ( produceHistos() ) {
91 // retrieve or book the histogram
92 h = profile2D( title );
93 if ( !h ) {
94 h = bookProfile2D( title, edgesX, edgesY );
95 }
96 // fill the histogram
97 h = fill( h, valueX, valueY, valueZ, weight, title );
98 }
99 return h;
100 }
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
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:114
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:89
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 105 of file GaudiHistos_2DProfVariableBinning.icpp.

109 {
110 AIDA::IProfile2D* h( nullptr );
111 if ( produceHistos() ) {
112 // retrieve or book the histogram
113 h = profile2D( ID );
114 if ( !h ) {
115 h = bookProfile2D( ID, title, edgesX, edgesY );
116 }
117
118 // fill the histogram
119 h = fill( h, valueX, valueY, valueZ, weight, title );
120 }
121 return h;
122 }
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
HiveAlgSequencer.h
h
Definition: HiveAlgSequencer.py:24
GaudiHistos::produceHistos
bool produceHistos() const
get the flag for histogram production (property "HistoProduce")
Definition: GaudiHistos.h:2396
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:114
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:89
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 2333 of file GaudiHistos.h.

2334 {
2335 auto found = profile2DMapTitle().find( title );
2336 return profile2DMapTitle().end() != found ? found->second : nullptr;
2337 }
GaudiHistos::profile2DMapTitle
const Profile2DMapTitle & profile2DMapTitle() const
get access to the map of all 2D profile histograms indexed via their title
Definition: GaudiHistos.h:2652
GaudiUtils::Map::end
iterator end()
Definition: Map.h:134
GaudiUtils::Map::find
iterator find(const key_type &key)
Definition: Map.h:151
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 340 of file GaudiHistos.icpp.

341 {
342 return lookup_( profile2DMapID(), ID );
343 }
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2675
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 2675 of file GaudiHistos.h.

2675 { return m_profile2DMapID; }
GaudiHistos::m_profile2DMapID
Profile2DMapID m_profile2DMapID
the actual storage/access of 2D profile histograms by unique ID
Definition: GaudiHistos.h:2831
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 2652 of file GaudiHistos.h.

2652 { return m_profile2DMapTitle; }
GaudiHistos::m_profile2DMapTitle
Profile2DMapTitle m_profile2DMapTitle
the actual storage/access of 2D profile histograms by unique title
Definition: GaudiHistos.h:2829
template<class PBASE>

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

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

Definition at line 2684 of file GaudiHistos.h.

2684 { m_checkForNaN = val; }
GaudiHistos::m_checkForNaN
Gaudi::Property< bool > m_checkForNaN
Definition: GaudiHistos.h:2778
template<class PBASE>

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

set flag to control output level of histograms

Definition at line 2682 of file GaudiHistos.h.

2682 { m_fullDetail = val; }
GaudiHistos::m_fullDetail
Gaudi::Property< bool > m_fullDetail
Definition: GaudiHistos.h:2788
template<class PBASE>

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

set histogram directory (property "HistoDir")

Definition at line 2694 of file GaudiHistos.h.

2694 { m_histoDir = val; }
GaudiHistos::m_histoDir
Gaudi::Property< std::string > m_histoDir
Definition: GaudiHistos.h:2786
template<class PBASE>

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

set a value for histogram offset (property "HistoOffSet"

Definition at line 2688 of file GaudiHistos.h.

2688 { m_histoOffSet = val; }
GaudiHistos::m_histoOffSet
Gaudi::Property< HistoID::NumericID > m_histoOffSet
Definition: GaudiHistos.h:2782
template<class PBASE>

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

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

Definition at line 2691 of file GaudiHistos.h.

2691 { m_histoTopDir = val; }
GaudiHistos::m_histoTopDir
Gaudi::Property< std::string > m_histoTopDir
Definition: GaudiHistos.h:2784
template<class PBASE>

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

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

Definition at line 2680 of file GaudiHistos.h.

2680 { m_produceHistos = val; }
GaudiHistos::m_produceHistos
Gaudi::Property< bool > m_produceHistos
Definition: GaudiHistos.h:2773
template<class PBASE>

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

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

Definition at line 2686 of file GaudiHistos.h.

2686 { m_splitHistoDir = val; }
GaudiHistos::m_splitHistoDir
Gaudi::Property< bool > m_splitHistoDir
Definition: GaudiHistos.h:2780
template<class PBASE>

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

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

Definition at line 2402 of file GaudiHistos.h.

2402 { return m_splitHistoDir; }
GaudiHistos::m_splitHistoDir
Gaudi::Property< bool > m_splitHistoDir
Definition: GaudiHistos.h:2780
template<class PBASE >

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

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

Definition at line 348 of file GaudiHistos.icpp.

349 {
350 return histo1DMapID().size() + histo2DMapID().size() + histo3DMapID().size() + profile1DMapID().size() +
351 profile2DMapID().size();
352 }
GaudiUtils::Map::size
size_type size() const
Definition: Map.h:199
GaudiHistos::profile2DMapID
const Profile2DMapID & profile2DMapID() const
get access to the map of 2D profile histograms index via a ID
Definition: GaudiHistos.h:2675
GaudiHistos::histo1DMapID
const Histo1DMapID & histo1DMapID() const
get access to the map of all 1D histograms index via ID
Definition: GaudiHistos.h:2473
GaudiHistos::profile1DMapID
const Profile1DMapID & profile1DMapID() const
get access to the map of 1D profile histograms index via a ID
Definition: GaudiHistos.h:2625
GaudiHistos::histo2DMapID
const Histo2DMapID & histo2DMapID() const
get access to the map of 2D histograms index via ID
Definition: GaudiHistos.h:2523
GaudiHistos::histo3DMapID
const Histo3DMapID & histo3DMapID() const
get access to the map of all 3D histograms index via a ID
Definition: GaudiHistos.h:2573
template<class PBASE>

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

Use old style sequencial numerical automatically assigned IDs ?

Definition at line 2416 of file GaudiHistos.h.

2416 { return m_useNumericAutoIDs; }
GaudiHistos::m_useNumericAutoIDs
Gaudi::Property< bool > m_useNumericAutoIDs
Definition: GaudiHistos.h:2798

## Member Data Documentation

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 2778 of file GaudiHistos.h.

template<class PBASE>

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

Definition at line 2789 of file GaudiHistos.h.

template<class PBASE>

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

Definition at line 2788 of file GaudiHistos.h.

template<class PBASE>

Histo1DMapID GaudiHistos< PBASE >::m_histo1DMapID
| mutable private

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

Definition at line 2811 of file GaudiHistos.h.

template<class PBASE>

Histo1DMapTitle GaudiHistos< PBASE >::m_histo1DMapTitle
| mutable private

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

Definition at line 2809 of file GaudiHistos.h.

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 2790 of file GaudiHistos.h.

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 2793 of file GaudiHistos.h.

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 2795 of file GaudiHistos.h.

template<class PBASE>

Histo2DMapID GaudiHistos< PBASE >::m_histo2DMapID
| mutable private

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

Definition at line 2816 of file GaudiHistos.h.

template<class PBASE>

Histo2DMapTitle GaudiHistos< PBASE >::m_histo2DMapTitle
| mutable private

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

Definition at line 2814 of file GaudiHistos.h.

template<class PBASE>

Histo3DMapID GaudiHistos< PBASE >::m_histo3DMapID
| mutable private

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

Definition at line 2821 of file GaudiHistos.h.

template<class PBASE>

Histo3DMapTitle GaudiHistos< PBASE >::m_histo3DMapTitle
| mutable private

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

Definition at line 2819 of file GaudiHistos.h.

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 2776 of file GaudiHistos.h.

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 2786 of file GaudiHistos.h.

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 2782 of file GaudiHistos.h.

template<class PBASE>

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

Initial value:
{this, "HistoPrint", false,
"Switch on/off the printout of histograms at finalization"}

Definition at line 2774 of file GaudiHistos.h.

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 2784 of file GaudiHistos.h.

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 2801 of file GaudiHistos.h.

template<class PBASE>

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

Definition at line 2773 of file GaudiHistos.h.

template<class PBASE>

Profile1DMapID GaudiHistos< PBASE >::m_profile1DMapID
| mutable private

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

Definition at line 2826 of file GaudiHistos.h.

template<class PBASE>

Profile1DMapTitle GaudiHistos< PBASE >::m_profile1DMapTitle
| mutable private

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

Definition at line 2824 of file GaudiHistos.h.

template<class PBASE>

Profile2DMapID GaudiHistos< PBASE >::m_profile2DMapID
| mutable private

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

Definition at line 2831 of file GaudiHistos.h.

template<class PBASE>

Profile2DMapTitle GaudiHistos< PBASE >::m_profile2DMapTitle
| mutable private

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

Definition at line 2829 of file GaudiHistos.h.

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 2780 of file GaudiHistos.h.

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 2798 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