The Gaudi Framework  v30r3 (a5ef0a68)
IHistoTool Class Referenceabstract

An abstract interface for "histogramming tool". More...

#include <GaudiTools/IHistoTool.h>

Inheritance diagram for IHistoTool:
Collaboration diagram for IHistoTool:

Public Types

typedef Histos::HistoID HistoID
 the actual type for histogram identifier (HBOOK style) More...
 
- Public Types inherited from IInterface
enum  Status : StatusCode::code_t {
  Status::FAILURE = 0, Status::SUCCESS = 1, Status::NO_INTERFACE, Status::VERSMISMATCH,
  Status::LAST_ERROR
}
 Return status. More...
 
using iid = Gaudi::InterfaceId< IInterface, 0, 0 >
 Interface ID. More...
 
using ext_iids = Gaudi::interface_list< iid >
 Extra interfaces. More...
 

Public Member Functions

 DeclareInterfaceID (IHistoTool, 2, 0)
 InterfaceID. More...
 
virtual 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 =0
 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...
 
virtual 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 =0
 fill the 1D histogram with forced ID assignement (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...
 
virtual 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 =0
 fill the 2D histogram (book on demand) More...
 
virtual 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 =0
 fill the 2D histogram with forced ID assignment (book on demand) More...
 
virtual 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 =0
 fill the 3D histogram (book on demand) More...
 
virtual 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 =0
 fill the 3D histogram with forced ID assignment (book on demand) More...
 
virtual AIDA::IHistogram1D * book1D (const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const =0
 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...
 
virtual 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 =0
 book the 2D histogram More...
 
virtual 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 =0
 book the 3D histogram More...
 
virtual AIDA::IHistogram1D * book1D (const HistoID &ID, const std::string &title="", const double low=0, const double high=100, const unsigned long bins=100) const =0
 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...
 
virtual AIDA::IHistogram2D * book2D (const HistoID &ID, const std::string &title, const double lowX=0, const double highX=100, const unsigned long binsX=100, const double lowY=0, const double highY=100, const unsigned long binsY=100) const =0
 book the 2D histogram with forced ID More...
 
virtual 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 =0
 book the 3D histogram with forced ID More...
 
virtual AIDA::IHistogram1D * fill (AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const =0
 fill the 1D histo with the value and weight More...
 
virtual AIDA::IHistogram2D * fill (AIDA::IHistogram2D *histo, const double valueX, const double valueY, const double weight, const std::string &title="") const =0
 fill the 2D histo with the value and weight More...
 
virtual AIDA::IHistogram3D * fill (AIDA::IHistogram3D *histo, const double valueX, const double valueY, const double valueZ, const double weight, const std::string &title="") const =0
 fill the 3D histo with the value and weight More...
 
virtual AIDA::IHistogram1D * histo1D (const std::string &title) const =0
 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...
 
virtual AIDA::IHistogram2D * histo2D (const std::string &title) const =0
 access the EXISTING 2D histogram by title return the pointer to existing 2D histogram or NULL More...
 
virtual AIDA::IHistogram3D * histo3D (const std::string &title) const =0
 access the EXISTING 3D histogram by title return the pointer to existing 3D histogram or NULL More...
 
virtual AIDA::IHistogram1D * histo1D (const HistoID &ID) const =0
 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...
 
virtual AIDA::IHistogram2D * histo2D (const HistoID &ID) const =0
 access the EXISTING 2D histogram by ID return the pointer to existing 2D histogram or NULL More...
 
virtual AIDA::IHistogram3D * histo3D (const HistoID &ID) const =0
 access the EXISTING 3D histogram by ID return the pointer to existing 3D histogram or NULL More...
 
virtual bool histoExists (const std::string &title) const =0
 check the existence AND validity of the histogram with given title More...
 
virtual bool histoExists (const HistoID &ID) const =0
 check the existence AND validity of the histogram with given title 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...
 
- Public Member Functions inherited from IAlgTool
 DeclareInterfaceID (IAlgTool, 4, 0)
 InterfaceID. More...
 
virtual const std::stringtype () const =0
 The type of an AlgTool, meaning the concrete AlgTool class. More...
 
virtual const IInterfaceparent () const =0
 The parent of the concrete AlgTool. More...
 
virtual StatusCode configure ()=0
 Configuration (from OFFLINE to CONFIGURED). More...
 
virtual StatusCode initialize ()=0
 Initialization (from CONFIGURED to INITIALIZED). More...
 
virtual StatusCode start ()=0
 Start (from INITIALIZED to RUNNING). More...
 
virtual StatusCode stop ()=0
 Stop (from RUNNING to INITIALIZED). More...
 
virtual StatusCode finalize ()=0
 Finalize (from INITIALIZED to CONFIGURED). More...
 
virtual StatusCode terminate ()=0
 Initialization (from CONFIGURED to OFFLINE). More...
 
virtual StatusCode reinitialize ()=0
 Initialization (from INITIALIZED or RUNNING to INITIALIZED, via CONFIGURED). More...
 
virtual StatusCode restart ()=0
 Initialization (from RUNNING to RUNNING, via INITIALIZED). More...
 
virtual Gaudi::StateMachine::State FSMState () const =0
 Get the current state. More...
 
virtual StatusCode sysInitialize ()=0
 Initialization of the Tool. More...
 
virtual StatusCode sysStart ()=0
 Initialization of the Tool. More...
 
virtual StatusCode sysStop ()=0
 Initialization of the Tool. More...
 
virtual StatusCode sysFinalize ()=0
 Finalization of the Tool. More...
 
virtual StatusCode sysReinitialize ()=0
 Initialization of the Tool. More...
 
virtual StatusCode sysRestart ()=0
 Initialization of the Tool. More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual const std::stringname () const =0
 Retrieve the name of the instance. More...
 
- Public Member Functions inherited from IInterface
virtual void * i_cast (const InterfaceID &) const =0
 main cast function More...
 
virtual std::vector< std::stringgetInterfaceNames () const =0
 Returns a vector of strings containing the names of all the implemented interfaces. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)=0
 Set the void** to the pointer to the requested interface of the instance. More...
 
virtual ~IInterface ()=default
 Virtual destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 

Detailed Description

An abstract interface for "histogramming tool".

Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
Date
2004-06-28

Definition at line 31 of file IHistoTool.h.

Member Typedef Documentation

the actual type for histogram identifier (HBOOK style)

Definition at line 38 of file IHistoTool.h.

Member Function Documentation

AIDA::IHistogram1D* IHistoTool::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
titlehistogram title (must be unique within the algorithm)
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins
Returns
pointer to AIDA 1D histogram

Definition at line 382 of file IHistoTool.h.

384  {
385  return book1D( title, low, high, bins );
386  }
virtual AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const =0
book the 1D histogram
AIDA::IHistogram1D* IHistoTool::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
IDunique histogram ID
titlehistogram title (must be unique within the algorithm)
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins
Returns
pointer to AIDA histogram

Definition at line 454 of file IHistoTool.h.

456  {
457  return book1D( ID, title, low, high, bins );
458  }
virtual AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const =0
book the 1D histogram
virtual AIDA::IHistogram1D* IHistoTool::book1D ( const std::string title,
const double  low = 0,
const double  high = 100,
const unsigned long  bins = 100 
) const
pure virtual

book the 1D histogram

The histogram will be assigned a unique identifier

See also
IHistogram1D
Parameters
titlehistogram title (must be unique within the algorithm)
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins
Returns
pointer to AIDA 1D histogram

Implemented in HistoTool.

virtual AIDA::IHistogram1D* IHistoTool::book1D ( const HistoID ID,
const std::string title = "",
const double  low = 0,
const double  high = 100,
const unsigned long  bins = 100 
) const
pure virtual

book the 1D histogram with forced ID

See also
IHistogram1D
Parameters
IDunique histogram ID
titlehistogram title (must be unique within the algorithm)
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins
Returns
pointer to AIDA histogram

Implemented in HistoTool.

virtual AIDA::IHistogram2D* IHistoTool::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
pure virtual

book the 2D histogram

The histogram will be assigned a unique identifier

See also
IHistogram2D
Parameters
titlehistogram title (must be unique within the algorithm)
lowXlow x limit for histogram
highXhigh x limit for histogram
binsXnumber of bins in x
lowYlow y limit for histogram
highYhigh y limit for histogram
binsYnumber of bins in y
Returns
pointer to AIDA 2D histogram

Implemented in HistoTool.

virtual AIDA::IHistogram2D* IHistoTool::book2D ( const HistoID ID,
const std::string title,
const double  lowX = 0,
const double  highX = 100,
const unsigned long  binsX = 100,
const double  lowY = 0,
const double  highY = 100,
const unsigned long  binsY = 100 
) const
pure virtual

book the 2D histogram with forced ID

See also
IHistogram2D
Parameters
IDunique histogram ID
titlehistogram title (must be unique within the algorithm)
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins
Returns
pointer to AIDA histogram

Implemented in HistoTool.

virtual AIDA::IHistogram3D* IHistoTool::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
pure virtual

book the 3D histogram

The histogram will be assigned a unique identifier

See also
IHistogram3D
Parameters
titlehistogram title (must be unique within the algorithm)
lowXlow x limit for histogram
highXhigh x limit for histogram
binsXnumber of bins in x
lowYlow y limit for histogram
highYhigh y limit for histogram
binsYnumber of bins in y
lowZlow y limit for histogram
highZhigh y limit for histogram
binsZnumber of bins in y
Returns
pointer to AIDA 3D histogram

Implemented in HistoTool.

virtual AIDA::IHistogram3D* IHistoTool::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
pure virtual

book the 3D histogram with forced ID

See also
IHistogram3D
Parameters
IDunique histogram ID
titlehistogram title (must be unique within the algorithm)
lowXlow x limit for histogram
highXhigh x limit for histogram
binsXnumber of bins in x
lowYlow y limit for histogram
highYhigh y limit for histogram
binsYnumber of bins in y
lowZlow y limit for histogram
highZhigh y limit for histogram
binsZnumber of bins in y
Returns
pointer to AIDA 3D histogram

Implemented in HistoTool.

IHistoTool::DeclareInterfaceID ( IHistoTool  ,
,
 
)
virtual AIDA::IHistogram1D* IHistoTool::fill ( AIDA::IHistogram1D *  histo,
const double  value,
const double  weight,
const std::string title = "" 
) const
pure virtual

fill the 1D histo with the value and weight

Parameters
histo1D histogram to be filled
valuevalue to be put into the histogram
weightweight to be used
titlehistogram title (to be used for error report)
Returns
pointer to AIDA 1D histogram

Implemented in HistoTool.

virtual AIDA::IHistogram2D* IHistoTool::fill ( AIDA::IHistogram2D *  histo,
const double  valueX,
const double  valueY,
const double  weight,
const std::string title = "" 
) const
pure virtual

fill the 2D histo with the value and weight

Parameters
histo2D histogram to be filled
valueXx value to be put into the histogram
valueYy value to be put into the histogram
weightweight to be used
titlehistogram title (to be used for error report)
Returns
pointer to AIDA 2D histogram

Implemented in HistoTool.

virtual AIDA::IHistogram3D* IHistoTool::fill ( AIDA::IHistogram3D *  histo,
const double  valueX,
const double  valueY,
const double  valueZ,
const double  weight,
const std::string title = "" 
) const
pure virtual

fill the 3D histo with the value and weight

Parameters
histo3D histogram to be filled
valueXx value to be put into the histogram
valueYy value to be put into the histogram
valueZz value to be put into the histogram
weightweight to be used
titlehistogram title (to be used for error report)
Returns
pointer to AIDA 3D histogram

Implemented in HistoTool.

AIDA::IHistogram1D* IHistoTool::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 540 of file IHistoTool.h.

540 { return histo1D( title ); };
virtual AIDA::IHistogram1D * histo1D(const std::string &title) const =0
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL ...
AIDA::IHistogram1D* IHistoTool::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 564 of file IHistoTool.h.

564 { return histo1D( ID ); };
virtual AIDA::IHistogram1D * histo1D(const std::string &title) const =0
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL ...
virtual AIDA::IHistogram1D* IHistoTool::histo1D ( const std::string title) const
pure virtual

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

Implemented in HistoTool.

virtual AIDA::IHistogram1D* IHistoTool::histo1D ( const HistoID ID) const
pure virtual

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

Implemented in HistoTool.

virtual AIDA::IHistogram2D* IHistoTool::histo2D ( const std::string title) const
pure virtual

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

Implemented in HistoTool.

virtual AIDA::IHistogram2D* IHistoTool::histo2D ( const HistoID ID) const
pure virtual

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

Implemented in HistoTool.

virtual AIDA::IHistogram3D* IHistoTool::histo3D ( const std::string title) const
pure virtual

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

Implemented in HistoTool.

virtual AIDA::IHistogram3D* IHistoTool::histo3D ( const HistoID ID) const
pure virtual

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

Implemented in HistoTool.

virtual bool IHistoTool::histoExists ( const std::string title) const
pure virtual

check the existence AND validity of the histogram with given title

Implemented in HistoTool.

virtual bool IHistoTool::histoExists ( const HistoID ID) const
pure virtual

check the existence AND validity of the histogram with given title

Implemented in HistoTool.

AIDA::IHistogram1D* IHistoTool::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
valuevalue to be filled
titlehistogram title (must be unique within the algorithm)
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins
weightweight
Returns
pointer to AIDA 1D histogram

Definition at line 87 of file IHistoTool.h.

89  {
90  return plot1D( value, title, low, high, bins, weight );
91  }
virtual 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 =0
fill the 1D histogram (book on demand)
AIDA::IHistogram1D* IHistoTool::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
valuevalue to be filled
IDhistogram identifier
titlehistogram title (must be unique within the algorithm)
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins
weightweight
Returns
pointer to AIDA histogram

Definition at line 151 of file IHistoTool.h.

153  {
154  return plot1D( value, ID, title, low, high, bins, weight );
155  };
virtual 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 =0
fill the 1D histogram (book on demand)
template<class FUNCTION , class OBJECT >
AIDA::IHistogram1D* IHistoTool::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

plot( sin , // function
v.begin() , v.end() , // sequence
" bla-bla " , // title
-1. , 1.0 , // low and high limits
100 ) // number of bins

The histogram will get a unique integer identifier automatically assigned

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

Note : 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
funcfunction to be plotted
firstbegin of the sequence
lastend of the sequence
titlehistogram title
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins for histogram

Definition at line 633 of file IHistoTool.h.

635  {
636  // retrieve or book the histogram
637  AIDA::IHistogram1D* h = histo1D( title );
638  if ( !h ) {
639  h = book1D( title, low, high, bins );
640  }
641  while ( first != last && h ) {
642  h = fill( h, func( *first ), 1.0, title );
643  ++first;
644  }
645  return h;
646  }
virtual AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const =0
fill the 1D histo with the value and weight
virtual AIDA::IHistogram1D * histo1D(const std::string &title) const =0
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL ...
virtual AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const =0
book the 1D histogram
template<class FUNCTION , class OBJECT >
AIDA::IHistogram1D* IHistoTool::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

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

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

Note : 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.

Note : This method is more efficient that the similar method without forced ID, since the histogram lookup is faster using a numerical ID.

See also
AIDA::IHistogram1D
Parameters
funcfunction to be plotted
firstbegin of the sequence
lastend of the sequence
IDhistogram identifier
titlehistogram title
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins for histogram

Definition at line 698 of file IHistoTool.h.

701  {
702  // retrieve or book the histogram
703  AIDA::IHistogram1D* h = histo1D( ID );
704  if ( !h ) {
705  h = book1D( ID, title, low, high, bins );
706  }
707  while ( first != last && h ) {
708  h = fill( h, func( *first ), 1.0, title );
709  ++first;
710  }
711  return h;
712  }
virtual AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const =0
fill the 1D histo with the value and weight
virtual AIDA::IHistogram1D * histo1D(const std::string &title) const =0
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL ...
virtual AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const =0
book the 1D histogram
template<class FUNCTION , class OBJECT , class WEIGHT >
AIDA::IHistogram1D* IHistoTool::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

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

The histogram will get a unique integer identifier automatically assigned

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

Note : 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
firstbegin of the sequence
lastend of the sequence
titlehistogram title
funcfunction to be plotted
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins for histogram
weightweight function

Definition at line 769 of file IHistoTool.h.

771  {
772  // retrieve or book the histogram
773  AIDA::IHistogram1D* h = histo1D( title );
774  if ( !h ) {
775  h = book1D( title, low, high, bins );
776  }
777  while ( first != last && h ) {
778  h = fill( h, func( *first ), weight( *first ), title );
779  ++first;
780  }
781  return h;
782  }
virtual AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const =0
fill the 1D histo with the value and weight
virtual AIDA::IHistogram1D * histo1D(const std::string &title) const =0
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL ...
virtual AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const =0
book the 1D histogram
template<class FUNCTION , class OBJECT , class WEIGHT >
AIDA::IHistogram1D* IHistoTool::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

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
Attention
no checks for NaN and Finite is 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

Note : 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.

Note : This method is more efficient that the similar method without forced ID, since the histogram lookup is faster using a numerical ID.

See also
AIDA::IHistogram1D
Parameters
firstbegin of the sequence
lastend of the sequence
IDhistogram identifier
titlehistogram title
funcfunction to be plotted
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins for histogram
weightweight function

Definition at line 844 of file IHistoTool.h.

847  {
848  // retrieve or book the histogram
849  AIDA::IHistogram1D* h = histo1D( ID );
850  if ( !h ) {
851  h = book1D( ID, title, low, high, bins );
852  }
853  while ( first != last && h ) {
854  h = fill( h, func( *first ), weight( *first ), title );
855  ++first;
856  }
857  return h;
858  }
virtual AIDA::IHistogram1D * fill(AIDA::IHistogram1D *histo, const double value, const double weight, const std::string &title="") const =0
fill the 1D histo with the value and weight
virtual AIDA::IHistogram1D * histo1D(const std::string &title) const =0
access the EXISTING 1D histogram by title return the pointer to existing 1D histogram or NULL ...
virtual AIDA::IHistogram1D * book1D(const std::string &title, const double low=0, const double high=100, const unsigned long bins=100) const =0
book the 1D histogram
virtual AIDA::IHistogram1D* IHistoTool::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
pure virtual

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.

The histogram will get a unique integer identifier automatically assigned.

See also
AIDA::IHistogram1D
Parameters
valuevalue to be filled
titlehistogram title (must be unique within the algorithm)
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins
weightweight
Returns
pointer to AIDA 1D histogram

Implemented in HistoTool.

virtual AIDA::IHistogram1D* IHistoTool::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
pure virtual

fill the 1D histogram with forced ID assignement (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.
Attention
If the histogram with given ID is already booked through automatic assignement 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.

Note : This method is more efficient that the similar method without forced ID, since the histogram lookup is faster using a numerical ID.

See also
AIDA::IHistogram1D
Parameters
valuevalue to be filled
IDhistogram identifier
titlehistogram title (must be unique within the algorithm)
lowlow limit for histogram
highhigh limit for histogram
binsnumber of bins
weightweight
Returns
pointer to AIDA histogram

Implemented in HistoTool.

virtual AIDA::IHistogram2D* IHistoTool::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
pure virtual

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.

The histogram will get a unique integer identifier automatically assigned

See also
AIDA::IHistogram2D
Parameters
valueXx value to be filled
valueYy value to be filled
titlehistogram title (must be unique within the algorithm)
lowXlow x limit for histogram
highXhigh x limit for histogram
lowYlow y limit for histogram
highYhigh y limit for histogram
binsXnumber of bins in x
binsYnumber of bins in y
weightweight
Returns
pointer to AIDA 2D histogram

Implemented in HistoTool.

virtual AIDA::IHistogram2D* IHistoTool::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
pure virtual

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

Note : This method is more efficient that the similar method without forced ID, since the histogram lookup is faster using a numerical ID.

See also
AIDA::IHistogram2D
Parameters
valueXx value to be filled
valueYy value to be filled
IDHistogram ID to use
titlehistogram title (must be unique within the algorithm)
lowXlow x limit for histogram
highXhigh x limit for histogram
lowYlow y limit for histogram
highYhigh y limit for histogram
binsXnumber of bins in x
binsYnumber of bins in y
weightweight
Returns
pointer to AIDA 2D histogram

Implemented in HistoTool.

virtual AIDA::IHistogram3D* IHistoTool::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
pure virtual

fill the 3D histogram (book on demand)

const double mass1 = ... ;
const double mass2 = ... ;
const double mass3 = ... ;
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.

The histogram will get a unique integer identifier automatically assigned

See also
AIDA::IHistogram3D
Parameters
valueXx value to be filled
valueYy value to be filled
valueZz value to be filled
titlehistogram title (must be unique within the algorithm)
lowXlow x limit for histogram
highXhigh x limit for histogram
lowYlow y limit for histogram
highYhigh y limit for histogram
lowZlow z limit for histogram
highZhigh z limit for histogram
binsXnumber of bins in x
binsYnumber of bins in y
binsZnumber of bins in z
weightweight
Returns
pointer to AIDA 3D histogram

Implemented in HistoTool.

virtual AIDA::IHistogram3D* IHistoTool::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
pure virtual

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

const double mass1 = ... ;
const double mass2 = ... ;
const double mass3 = ... ;
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
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

Note : This method is more efficient that the similar method without forced ID, since the histogram lookup is faster using a numerical ID.

See also
AIDA::IHistogram3D
Parameters
valueXx value to be filled
valueYy value to be filled
valueZz value to be filled
IDHistogram ID to use
titlehistogram title (must be unique within the algorithm)
lowXlow x limit for histogram
highXhigh x limit for histogram
lowYlow y limit for histogram
highYhigh y limit for histogram
lowZlow z limit for histogram
highZhigh z limit for histogram
binsXnumber of bins in x
binsYnumber of bins in y
binsZnumber of bins in z
weightweight
Returns
pointer to AIDA 3D histogram

Implemented in HistoTool.


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