All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Gaudi::Profile1D Class Reference

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

#include <src/HistogramSvc/P1D.h>

Inheritance diagram for Gaudi::Profile1D:
Collaboration diagram for Gaudi::Profile1D:

Public Member Functions

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

Static Public Member Functions

static const CLIDclassID ()
 
- Static Public Member Functions inherited from DataObject
static const CLIDclassID ()
 Retrieve reference to class definition structure (static access) More...
 

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. More...
 
AIDA::Annotation m_annotation
 Object annotations. More...
 
IMPLEMENTATION * m_rep
 Reference to underlying implementation. More...
 
std::string m_classType
 
int m_sumEntries
 

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.

74  {
75  m_rep = new TProfile();
76  init("",false);
77 }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
void init(const std::string &title, bool initialize_axis=true)
Definition: P1D.cpp:84
Gaudi::Profile1D::Profile1D ( TProfile *  rep)

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

Definition at line 79 of file P1D.cpp.

79  {
80  m_rep = rep;
81  init(m_rep->GetTitle());
82 }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
void init(const std::string &title, bool initialize_axis=true)
Definition: P1D.cpp:84
virtual Gaudi::Profile1D::~Profile1D ( )
inlinevirtual

Destructor.

Definition at line 30 of file P1D.h.

30 { }

Member Function Documentation

static const CLID& Gaudi::Profile1D::classID ( )
inlinestatic

Definition at line 36 of file P1D.h.

36 { return CLID_ProfileH; }
virtual const CLID& Gaudi::Profile1D::clID ( ) const
inlinevirtual

Retrieve reference to class defininition identifier.

Reimplemented from DataObject.

Definition at line 35 of file P1D.h.

35 { return classID(); }
static const CLID & classID()
Definition: P1D.h:36
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.

114  {
115  (weight == 1.) ? m_rep->Fill(x,y) : m_rep->Fill(x,y,weight);
116  return true;
117 }
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
void Gaudi::Profile1D::init ( const std::string &  title,
bool  initialize_axis = true 
)
private

Definition at line 84 of file P1D.cpp.

84  {
85  m_classType = "IProfile1D";
86  setTitle(title);
87  setName(title);
88  if ( initialize_axis ) {
89  axis().initialize(m_rep->GetXaxis(),false);
90  }
91  //m_rep->SetErrorOption("s");
92  m_rep->SetDirectory(0);
93  m_sumEntries = 0;
94 }
virtual std::string title() const
Get the title of the object.
Definition: Generic1D.h:45
std::string m_classType
Definition: Generic1D.h:121
Axis & axis()
Access to axis object.
Definition: Generic1D.h:57
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
void initialize(TAxis *itaxi, bool)
Definition: Axis.h:71
virtual bool setTitle(const std::string &title)
Set the title of the object.
Definition: Generic1D.h:127
bool setName(const std::string &newName)
Set the name of the object.
Definition: Generic1D.h:137
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.

96  {
97  m_rep->SetBinEntries(rIndex(i), entries );
98  // set content takes in root height * entries
99  m_rep->SetBinContent(rIndex(i), height*entries );
100  // set error takes sqrt of bin sum(w*y**2)
101  double sumwy2Bin = ( spread*spread + height*height )*entries;
102  m_rep->SetBinError(rIndex(i), sqrt(sumwy2Bin) );
104  // not very efficient (but do evey bin since root cannot figure out by himself)
105  m_rep->SetEntries(m_sumEntries);
106  return true;
107 }
virtual int entries() const
Get the number or all the entries.
Definition: Generic1D.h:62
IMPLEMENTATION * m_rep
Reference to underlying implementation.
Definition: Generic1D.h:119
virtual int rIndex(int index) const
operator methods
Definition: Generic1D.h:91
list i
Definition: ana.py:128

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