| # Gaudi Framework, version v20r2
Generated: 18 Jul 2008

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

- Search for |

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Gaudi::Profile1D Class Reference

`#include <P1D.h>`

Inheritance diagram for Gaudi::Profile1D:

[legend]
Collaboration diagram for Gaudi::Profile1D:

[legend]
List of all members.

## Detailed Description

AIDA implementation for 1 D profiles using ROOT TProfile.

Author:
  M.Frank

Definition at line 20 of file P1D.h.

## 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.
## Static Public Member Functions
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)

## 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 55 of file P1D.cpp.

References init(), Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::m_rep, and Profile1D().

Referenced by Profile1D().

    00055                           {
    00056   m_rep = new TProfile();
    00057   init("",false);
    00058 }

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

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

Definition at line 60 of file P1D.cpp.

References init(), Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::m_rep, and Profile1D().

    00060                                         {
    00061   m_rep = rep;
    00062   init(m_rep->GetTitle());
    00063 }

virtual Gaudi::Profile1D::~Profile1D | ( |  | ) | `[inline, virtual]`

Destructor.

Definition at line 30 of file P1D.h.

    00030 {  }

## Member Function Documentation

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

Definition at line 65 of file P1D.cpp.

References Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::axis(), init(), Gaudi::Axis::initialize(), Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::m_classType, Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::m_rep, Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::m_sumEntries, Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::setName(), and Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::setTitle().

Referenced by init(), and Profile1D().

    00065                                                                       {
    00066   m_classType = "IProfile1D";
    00067   setTitle(title);
    00068   setName(title);
    00069   if ( initialize_axis )  {
    00070     axis().initialize(m_rep->GetXaxis(),false);
    00071   }
    00072   m_rep->SetErrorOption("s");
    00073   m_rep->SetDirectory(0);
    00074   m_sumEntries = 0;
    00075 }

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 90 of file P1D.cpp.

References Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::m_rep.

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

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

Definition at line 77 of file P1D.cpp.

References Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::m_rep, Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::m_sumEntries, Gaudi::Generic1D< AIDA::IProfile1D, TProfile >::rIndex(), and setBinContents().

Referenced by setBinContents().

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

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.

References classID(), and clID().

Referenced by clID().

    00035 { return Gaudi::Profile1D::classID(); }

static const CLID& Gaudi::Profile1D::classID | ( |  | ) | `[inline, static]`

Retrieve reference to class definition structure (static access).

Reimplemented from DataObject.

Definition at line 36 of file P1D.h.

References classID(), and CLID_ProfileH.

Referenced by classID(), and clID().

    00036 { return CLID_ProfileH; }

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

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiSvc/v17r1/src/HistogramSvc/P1D.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r2/GaudiSvc/v17r1/src/HistogramSvc/P1D.cpp