The Gaudi Framework  master (37c0b60a)
Gaudi::Profile2D Class Reference

#include </builds/gaudi/Gaudi/GaudiCommonSvc/include/GaudiCommonSvc/P2D.h>

Inheritance diagram for Gaudi::Profile2D:
Collaboration diagram for Gaudi::Profile2D:

Public Member Functions

 Profile2D ()
 Default Constructor. More...
 
 Profile2D (TProfile2D *rep)
 Default Constructor with representation object. More...
 
bool fill (double x, double y, double z, double weight) override
 Fill bin content. More...
 
const CLIDclID () const override
 Retrieve reference to class defininition identifier. More...
 
- Public Member Functions inherited from DataObject
 DataObject ()
 Standard Constructor. More...
 
 DataObject (const DataObject &rhs)
 Copy Constructor. More...
 
DataObjectoperator= (const DataObject &rhs)
 Assignment Operator. More...
 
 DataObject (DataObject &&rhs)
 Move Constructor. More...
 
DataObjectoperator= (DataObject &&rhs)
 Move Assignment Operator. 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::stringname () 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 ()
 Retrieve Link manager. More...
 
const LinkManagerlinkMgr () const
 
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::ostreamfillStream (std::ostream &s) const
 Fill the output stream (ASCII) More...
 
- Public Member Functions inherited from Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >
 Generic2D ()=default
 
TObject * representation () const override
 ROOT object implementation. More...
 
void adoptRepresentation (TObject *rep) override
 Adopt ROOT histogram representation. More...
 
void adoptRepresentation (TObject *rep)
 Adopt ROOT histogram representation. More...
 
void adoptRepresentation (TObject *rep)
 Adopt ROOT histogram representation. More...
 
std::string title () const override
 Get the title of the object. More...
 
bool setTitle (const std::string &title) override
 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...
 
AIDA::IAnnotation & annotation () override
 Access annotation object. More...
 
const AIDA::IAnnotation & annotation () const override
 Access annotation object (cons) More...
 
const AIDA::IAxis & xAxis () const override
 Return the X axis. More...
 
const AIDA::IAxis & yAxis () const override
 Return the Y axis. More...
 
virtual int rIndexX (int index) const
 operator methods More...
 
virtual int rIndexY (int index) const
 operator methods More...
 
int entries () const override
 Get the number or all the entries. More...
 
int allEntries () const override
 Get the number or all the entries, both in range and underflow/overflow bins of the IProfile. More...
 
int extraEntries () const override
 Get the number of entries in the underflow and overflow bins. More...
 
double sumBinHeights () const override
 Get the sum of in range bin heights in the IProfile. More...
 
double sumAllBinHeights () const override
 Get the sum of all the bins heights (including underflow and overflow bin). More...
 
double sumExtraBinHeights () const override
 Get the sum of the underflow and overflow bin height. More...
 
double minBinHeight () const override
 Get the minimum height of the in-range bins. More...
 
double maxBinHeight () const override
 Get the maximum height of the in-range bins. More...
 
double binMeanX (int indexX, int indexY) const override
 The weighted mean along x of a given bin. More...
 
double binMeanY (int indexX, int indexY) const override
 The weighted mean along y of a given bin. More...
 
int binEntries (int indexX, int indexY) const override
 The number of entries (ie the number of times fill was called for this bin). More...
 
int binEntries (int indexX, int indexY) const
 
int binEntries (int idX, int idY) const
 
int binEntriesX (int indexX) const override
 Equivalent to projectionX().binEntries(indexX). More...
 
int binEntriesY (int indexY) const override
 Equivalent to projectionY().binEntries(indexY). More...
 
double binHeight (int indexX, int indexY) const override
 Total height of the corresponding bin (ie the sum of the weights in this bin). More...
 
double binHeightX (int indexX) const override
 Equivalent to projectionX().binHeight(indexX). More...
 
double binHeightY (int indexY) const override
 Equivalent to projectionY().binHeight(indexY). More...
 
double binError (int indexX, int indexY) const override
 The error on this bin. More...
 
virtual double binRms (int indexX, int indexY) const
 The spread (RMS) of this bin. More...
 
double meanX () const override
 Returns the mean of the profile, as calculated on filling-time projected on the X axis. More...
 
double meanY () const override
 Returns the mean of the profile, as calculated on filling-time projected on the Y axis. More...
 
double rmsX () const override
 Returns the rms of the profile as calculated on filling-time projected on the X axis. More...
 
double rmsY () const override
 Returns the rms of the profile as calculated on filling-time projected on the Y axis. More...
 
int coordToIndexX (double coordX) const override
 Convenience method, equivalent to xAxis().coordToIndex(coord). More...
 
int coordToIndexY (double coordY) const override
 Convenience method, equivalent to yAxis().coordToIndex(coord). 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...
 
bool add (const AIDA::IProfile2D &h) override
 Modifies this profile by adding the contents of profile to it. More...
 
bool reset () override
 
void * cast (const std::string &className) const override
 Introspection method. More...
 
void * cast (const std::string &className) const
 
void * cast (const std::string &className) const
 
const std::stringuserLevelClassType () const
 The AIDA user-level unterface leaf class type. More...
 
int dimension () const override
 Get the Histogram's dimension. More...
 
std::ostreamprint (std::ostream &s) const override
 Print (ASCII) the histogram into the output stream. More...
 
std::ostreamwrite (std::ostream &s) const override
 Write (ASCII) the histogram table into the output stream. More...
 
int write (const char *file_name) const override
 Write (ASCII) the histogram table into a file. More...
 
- Public Member Functions inherited from Gaudi::HistogramBase
virtual TObject * representation () const =0
 ROOT object implementation. More...
 
virtual ~HistogramBase ()=default
 

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 Attributes

std::mutex m_fillSerialization
 

Friends

void reset (Profile2D &h)
 
void to_json (nlohmann::json &j, Profile2D const &p)
 conversion to json via nlohmann library More...
 

Additional Inherited Members

- Public Types inherited from Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >
typedef Generic2D< AIDA::IProfile2D, TProfile2D > Base
 
- Protected Member Functions inherited from Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >
 Generic2D (TProfile2D *p)
 constructor More...
 
- Protected Attributes inherited from Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >
Axis m_xAxis
 X axis member. More...
 
Axis m_yAxis
 Y axis member. More...
 
AIDA::Annotation m_annotation
 Object annotations. More...
 
std::unique_ptr< TProfile2D > m_rep
 Reference to underlying implementation. More...
 
std::string m_classType
 class type More...
 
int m_sumEntries
 cache sumEntries (allEntries) when setting contents since Root can't compute by himself More...
 

Detailed Description

AIDA implementation for 2 D profiles using ROOT TProfile2D

Author
M.Frank

Definition at line 31 of file P2D.h.

Constructor & Destructor Documentation

◆ Profile2D() [1/2]

Gaudi::Profile2D::Profile2D ( )
inline

Default Constructor.

Definition at line 34 of file P2D.h.

34  : Base( new TProfile2D() ) {
35  m_classType = "IProfile2D";
36  m_rep->SetErrorOption( "s" );
37  m_rep->SetDirectory( nullptr );
38  }

◆ Profile2D() [2/2]

Gaudi::Profile2D::Profile2D ( TProfile2D *  rep)

Default Constructor with representation object.

Definition at line 88 of file P2D.cpp.

88  {
89  m_classType = "IProfile2D";
90  rep->SetDirectory( nullptr );
91  adoptRepresentation( rep );
92  m_sumEntries = 0;
93 }

Member Function Documentation

◆ classID()

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

Definition at line 54 of file P2D.h.

54 { return CLID_ProfileH2; }

◆ clID()

const CLID& Gaudi::Profile2D::clID ( ) const
inlineoverridevirtual

Retrieve reference to class defininition identifier.

Reimplemented from DataObject.

Definition at line 53 of file P2D.h.

53 { return classID(); }

◆ fill()

bool Gaudi::Profile2D::fill ( double  x,
double  y,
double  z,
double  weight 
)
inlineoverride

Fill bin content.

Definition at line 43 of file P2D.h.

43  {
44  // avoid race conditions when filling the profile
45  auto guard = std::scoped_lock{ m_fillSerialization };
46  m_rep->Fill( x, y, z, weight );
47  return true;
48  }

Friends And Related Function Documentation

◆ reset

void reset ( Profile2D h)
friend

Definition at line 49 of file P2D.h.

49 { h.reset(); }

◆ to_json

void to_json ( nlohmann::json &  j,
Profile2D const &  p 
)
friend

conversion to json via nlohmann library

Definition at line 51 of file P2D.h.

51 { j = *p.m_rep.get(); }

Member Data Documentation

◆ m_fillSerialization

std::mutex Gaudi::Profile2D::m_fillSerialization
private

Definition at line 57 of file P2D.h.


The documentation for this class was generated from the following files:
Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::Base
Generic2D< AIDA::IProfile2D, TProfile2D > Base
Definition: Generic2D.h:48
Gaudi::Profile2D::classID
static const CLID & classID()
Definition: P2D.h:54
Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::adoptRepresentation
void adoptRepresentation(TObject *rep) override
Adopt ROOT histogram representation.
ProduceConsume.j
j
Definition: ProduceConsume.py:104
AlgSequencer.h
h
Definition: AlgSequencer.py:31
Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::m_classType
std::string m_classType
class type
Definition: Generic2D.h:164
Gaudi::Profile2D::m_fillSerialization
std::mutex m_fillSerialization
Definition: P2D.h:57
Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::m_rep
std::unique_ptr< TProfile2D > m_rep
Reference to underlying implementation.
Definition: Generic2D.h:162
Gaudi::Generic2D< AIDA::IProfile2D, TProfile2D >::m_sumEntries
int m_sumEntries
cache sumEntries (allEntries) when setting contents since Root can't compute by himself
Definition: Generic2D.h:166