| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

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

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | List of all members
Gaudi::Profile1D Class Reference

AIDA implementation for 1 D profiles using ROOT TProfile. More...

`#include <P1D.h>`

Inheritance diagram for Gaudi::Profile1D:
[legend]
Collaboration diagram for Gaudi::Profile1D:
[legend]

## Public Member Functions
| Profile1D ()
| Default Constructor.
| Profile1D (TProfile *rep)
| Standard constructor with initialization. The histogram representation will be adopted.
virtual | ~Profile1D ()
| Destructor.
virtual bool | fill (double x, double y, double weight=1.)
| Fill the Profile1D with a value and the corresponding weight.
virtual bool | setBinContents (int i, int entries, double height, double error, double spread, double centre)
virtual const CLID & | clID () const
| Retrieve reference to class defininition identifier.
Public Member Functions inherited from DataObject
| DataObject ()
| Standard Constructor.
| DataObject (const DataObject &)
| Copy Constructor.
virtual | ~DataObject ()
| Standard Destructor.
virtual unsigned long | addRef ()
| Add reference to object.
virtual unsigned long | release ()
| release reference to object
const std::string & | name () const
| Retreive DataObject name. It is the name when registered in the store.
virtual StatusCode | update ()
| Provide empty placeholder for internal object reconfiguration callback.
void | setRegistry (IRegistry *pRegistry)
| Set pointer to Registry.
IRegistry * | registry () const
| Get pointer to Registry.
LinkManager * | linkMgr () const
| Retrieve Link manager.
unsigned char | version () const
| Retrieve version number of this object representation.
void | setVersion (unsigned char vsn)
| Set version number of this object representation.
unsigned long | refCount () const
| Return the refcount.
virtual std::ostream & | fillStream (std::ostream &s) const
| Fill the output stream (ASCII)
Public Member Functions inherited from Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >
| Generic1D ()
| Default constructor.
virtual | ~Generic1D ()
| Default destructor.
virtual const std::string & | userLevelClassType () const
| The AIDA user-level unterface leaf class type.
virtual void * | cast (const std::string &cl) const
| Manual cast by class name.
TObject * | representation () const
| ROOT object implementation.
virtual void | adoptRepresentation (TObject *rep)
| Adopt ROOT histogram representation.
virtual std::string | title () const
| Get the title of the object.
virtual bool | setTitle (const std::string &title)
| Set the title of the object.
std::string | name () const
| object name
bool | setName (const std::string &newName)
| Set the name of the object.
virtual AIDA::IAnnotation & | annotation ()
| Access annotation object.
virtual const AIDA::IAnnotation & | annotation () const
| Access annotation object (cons)
Axis & | axis ()
| Access to axis object.
const Axis & | axis () const
| Get the x axis of the IHistogram1D.
virtual int | entries () const
| Get the number or all the entries.
virtual int | allEntries () const
| Get the number or all the entries, both in range and underflow/overflow bins of the IProfile.
virtual int | extraEntries () const
| Get the number of entries in the underflow and overflow bins.
virtual int | binEntries (int index) const
| Number of entries in the corresponding bin (ie the number of times fill was called for this bin).
virtual double | binRms (int index) const
virtual double | sumBinHeights () const
| Get the sum of in range bin heights in the IProfile.
virtual double | sumAllBinHeights () const
| Get the sum of all the bins heights (including underflow and overflow bin).
virtual double | sumExtraBinHeights () const
| Get the sum of the underflow and overflow bin height.
virtual double | minBinHeight () const
| Get the minimum height of the in-range bins.
virtual double | maxBinHeight () const
| Get the maximum height of the in-range bins.
virtual double | equivalentBinEntries () const
| Number of equivalent entries, i.e. `SUM[ weight ] ^ 2 / SUM[ weight^2 ]`
virtual bool | scale (double scaleFactor)
| Scale the weights and the errors of all the IHistogram's bins (in-range and out-of-range ones) by a given scale factor.
virtual bool | reset ()
| Reset the Histogram; as if just created.
virtual bool | add (const INTERFACE &profile)
| Modifies this IProfile1D by adding the contents of profile to it.
virtual int | rIndex (int index) const
| operator methods
virtual double | binMean (int index) const
| The weighted mean of a bin.
virtual double | binHeight (int index) const
| Total height of the corresponding bin (ie the sum of the weights in this bin).
virtual double | binError (int index) const
| The error of a given bin.
virtual double | mean () const
| The mean of the whole IHistogram1D.
virtual double | rms () const
| The RMS of the whole IHistogram1D.
virtual int | coordToIndex (double coord) const
| Get the bin number corresponding to a given coordinate along the x axis.
virtual int | dimension () const
| Get the Histogram's dimension.
virtual std::ostream & | print (std::ostream &s) const
| Print (ASCII) the histogram into the output stream.
virtual std::ostream & | write (std::ostream &s) const
| Write (ASCII) the histogram table into the output stream.
virtual int | write (const char *file_name) const
| Write (ASCII) the histogram table into a file.
template<>
void * | cast (const std::string &className) const
template<>
int | binEntries (int index) const
template<>
void | adoptRepresentation (TObject *rep)
| Adopt ROOT histogram representation.
template<>
int | binEntries (int index) const
template<>
void * | cast (const std::string &className) const
template<>
void | adoptRepresentation (TObject *rep)
| Adopt ROOT histogram representation.
Public Member Functions inherited from Gaudi::HistogramBase
virtual | ~HistogramBase ()

## Static Public Member Functions
static const CLID & | classID ()
Static Public Member Functions inherited from DataObject
static const CLID & | classID ()
| Retrieve reference to class definition structure (static access)

## Private Types
typedef AIDA::IAnnotation | IAnnotation

## Private Member Functions
void | init (const std::string &title, bool initialize_axis=true)

## Additional Inherited Members
Public Types inherited from Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >
typedef Generic1D< INTERFACE, IMPLEMENTATION > | Base
Protected Attributes inherited from Gaudi::Generic1D< INTERFACE, IMPLEMENTATION >
Axis | m_axis
| Axis member.
AIDA::Annotation | m_annotation
| Object annotations.
IMPLEMENTATION * | m_rep
| Reference to underlying implementation.
std::string | m_classType
int | m_sumEntries
Friends inherited from DataObject

## Detailed Description

AIDA implementation for 1 D profiles using ROOT TProfile.

Author
  M.Frank

Definition at line 20 of file P1D.h.

## Member Typedef Documentation

typedef AIDA::IAnnotation Gaudi::Profile1D::IAnnotation
| private

Definition at line 21 of file P1D.h.

## Constructor & Destructor Documentation

Gaudi::Profile1D::Profile1D | ( |  | ) |

Default Constructor.

Definition at line 74 of file P1D.cpp.

{
m_rep = new TProfile();
init("",false);
}

Gaudi::Profile1D::Profile1D | ( | TProfile * | rep | ) |

Standard constructor with initialization. The histogram representation will be adopted.

Definition at line 79 of file P1D.cpp.

{
m_rep = rep;
init(m_rep->GetTitle());
}

virtual Gaudi::Profile1D::~Profile1D | ( |  | ) |
| inline virtual

Destructor.

Definition at line 30 of file P1D.h.

{ }

## Member Function Documentation

static const CLID& Gaudi::Profile1D::classID | ( |  | ) |
| inline static

Definition at line 36 of file P1D.h.

{ return CLID_ProfileH; }

virtual const CLID& Gaudi::Profile1D::clID | ( |  | ) | const
| inline virtual

Retrieve reference to class defininition identifier.

Reimplemented from DataObject.

Definition at line 35 of file P1D.h.

{ return classID(); }

bool Gaudi::Profile1D::fill | ( | double | x,
|  | double | y,
|  | double | weight = `1.`
| ) |  |
| virtual

Fill the Profile1D with a value and the corresponding weight.

Definition at line 114 of file P1D.cpp.

{
(weight == 1.) ? m_rep->Fill(x,y) : m_rep->Fill(x,y,weight);
return true;
}

void Gaudi::Profile1D::init | ( | const std::string & | title,
|  | bool | initialize_axis = `true`
| ) |  |
| private

Definition at line 84 of file P1D.cpp.

{
m_classType = "IProfile1D";
setTitle(title);
setName(title);
if ( initialize_axis ) {
axis().initialize(m_rep->GetXaxis(),false);
}
//m_rep->SetErrorOption("s");
m_rep->SetDirectory(0);
m_sumEntries = 0;
}

bool Gaudi::Profile1D::setBinContents | ( | int | i,
|  | int | entries,
|  | double | height,
|  | double | error,
|  | double | spread,
|  | double | centre
| ) |  |
| virtual

Definition at line 96 of file P1D.cpp.

{
m_rep->SetBinEntries(rIndex(i), entries );
// set content takes in root height * entries
m_rep->SetBinContent(rIndex(i), height*entries );
// set error takes sqrt of bin sum(w*y**2)
double sumwy2Bin = ( spread*spread + height*height )*entries;
m_rep->SetBinError(rIndex(i), sqrt(sumwy2Bin) );
m_sumEntries += entries;
// not very efficient (but do evey bin since root cannot figure out by himself)
m_rep->SetEntries(m_sumEntries);
return true;
}

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiCommonSvc/src/HistogramSvc/P1D.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v25r0/GaudiCommonSvc/src/HistogramSvc/P1D.cpp