ant
A2 ant: class-based analysis framework
ant::TH2Crystals Class Reference

Base class for A2 Calorimeter display classes. More...

#include <TH2Crystals.h>

+ Inheritance diagram for ant::TH2Crystals:
+ Collaboration diagram for ant::TH2Crystals:

Public Member Functions

 TH2Crystals (const std::string &name="", const std::string &title="")
 Base Constructior. Sets name and title, and links the object into the current ROOT directory (fix for a Bug in TH2Poly) More...
 
virtual ~TH2Crystals ()
 
virtual Double_t GetElement (const UInt_t element) const
 
virtual void SetElement (const UInt_t element, Double_t value)
 
virtual void FillBinNumbers ()
 Fill the number of the TH2Poly bin. Useful for debugging only, I guess. More...
 
virtual void FillElementNumbers ()
 Fill the element numbers. More...
 
virtual void SetElements (const std::vector< Double_t > &pattern)
 Set values of all elements to the ones stored in a std::vector (values ordered by element number) More...
 
virtual void SetElements (const TH1 &h)
 Set values of all elements to the ones stored in a TH1 (values ordered by element number) More...
 
virtual void FillElement (const UInt_t element, const Double_t w)
 
virtual void FillElements (const std::vector< Double_t > &pattern)
 
virtual void FillElements (const TH1 &h)
 
virtual Int_t GetNumberOfElements () const
 Get the number of elements Usually this is the number of bins in the TH2Poly, but not always. More...
 
virtual void ResetElements (const Double_t value=0.0)
 Reset Elements (clear everything) More...
 
virtual void CreateMarker (UInt_t element)
 CreateMarker creates marker at given element. More...
 
virtual void CreateMarker (const TVector2 &p, const int marker_style_black, const int marker_style_white)
 CreateMarker black and white markers at position p with two (different) styles. More...
 
virtual void ClearMarkers ()
 ClearMarkers removes all markers created by CreateMarker. More...
 

Protected Member Functions

virtual void FillElements (const TH2Crystals &h)
 Add the content of another TH2Crystal object, if number of bins match. More...
 
virtual void SetElements (const TH2Crystals &h)
 Replace all values with the content of another TH2Crystal object, if number of bins match. More...
 
void SetMarkerOnBin (Int_t bin)
 
void calcCOG (TGraph *g, double &x, double &y) const
 calcCOG calculates center of gravity More...
 

Protected Attributes

bool draw_glue_pads = false
 

Detailed Description

Base class for A2 Calorimeter display classes.

Constructor & Destructor Documentation

◆ TH2Crystals()

TH2Crystals::TH2Crystals ( const std::string &  name = "",
const std::string &  title = "" 
)

Base Constructior. Sets name and title, and links the object into the current ROOT directory (fix for a Bug in TH2Poly)

Parameters
nameName for the new object
titleTitle for the new object

◆ ~TH2Crystals()

virtual ant::TH2Crystals::~TH2Crystals ( )
inlinevirtual

Member Function Documentation

◆ calcCOG()

void TH2Crystals::calcCOG ( TGraph *  g,
double &  x,
double &  y 
) const
protected

calcCOG calculates center of gravity

Parameters
g
x
y

◆ ClearMarkers()

void TH2Crystals::ClearMarkers ( )
virtual

ClearMarkers removes all markers created by CreateMarker.

◆ CreateMarker() [1/2]

void TH2Crystals::CreateMarker ( UInt_t  element)
virtual

CreateMarker creates marker at given element.

Parameters
element
Returns

Reimplemented in ant::TH2CB.

◆ CreateMarker() [2/2]

void TH2Crystals::CreateMarker ( const TVector2 &  p,
const int  marker_style_black,
const int  marker_style_white 
)
virtual

CreateMarker black and white markers at position p with two (different) styles.

Parameters
pposition
marker_style1style of black marker
marker_style2style of white marker

◆ FillBinNumbers()

void TH2Crystals::FillBinNumbers ( )
virtual

Fill the number of the TH2Poly bin. Useful for debugging only, I guess.

◆ FillElement()

void TH2Crystals::FillElement ( const UInt_t  element,
const Double_t  w 
)
virtual

◆ FillElementNumbers()

void TH2Crystals::FillElementNumbers ( )
virtual

Fill the element numbers.

Reimplemented in ant::TH2CB.

◆ FillElements() [1/3]

void TH2Crystals::FillElements ( const TH2Crystals h)
protectedvirtual

Add the content of another TH2Crystal object, if number of bins match.

Parameters
hThe other TH2Crystals object

This method is kept protected in the base class and gets used by defived classes. This avoids the possibility to add a TAPS to a CB or something like that.

This method is efficient (use of iterators, interating once).

◆ FillElements() [2/3]

void TH2Crystals::FillElements ( const std::vector< Double_t > &  pattern)
virtual

◆ FillElements() [3/3]

void TH2Crystals::FillElements ( const TH1 &  h)
virtual

Reimplemented in ant::TH2CB.

◆ GetElement()

Double_t TH2Crystals::GetElement ( const UInt_t  element) const
virtual

Reimplemented in ant::TH2CB.

◆ GetNumberOfElements()

Int_t TH2Crystals::GetNumberOfElements ( ) const
virtual

Get the number of elements Usually this is the number of bins in the TH2Poly, but not always.

Returns
number of elements

Reimplemented in ant::TH2CB.

◆ ResetElements()

void TH2Crystals::ResetElements ( const Double_t  value = 0.0)
virtual

Reset Elements (clear everything)

Parameters
valueValue to set the elements to (default 0.0)

◆ SetElement()

void TH2Crystals::SetElement ( const UInt_t  element,
Double_t  value 
)
virtual

Reimplemented in ant::TH2CB.

◆ SetElements() [1/3]

void TH2Crystals::SetElements ( const TH2Crystals h)
protectedvirtual

Replace all values with the content of another TH2Crystal object, if number of bins match.

Parameters
hThe other TH2Crystals object

This method is kept protected in the base class and gets used by defived classes. This avoids the possibility to add a TAPS to a CB or something like that.

This method is efficient (use of iterators, interating once).

◆ SetElements() [2/3]

void TH2Crystals::SetElements ( const std::vector< Double_t > &  pattern)
virtual

Set values of all elements to the ones stored in a std::vector (values ordered by element number)

Parameters
patternValues to set. size() has to be equal to number of elements of the detector.

Reimplemented in ant::TH2CB.

◆ SetElements() [3/3]

void TH2Crystals::SetElements ( const TH1 &  h)
virtual

Set values of all elements to the ones stored in a TH1 (values ordered by element number)

Parameters
hThe histogram with the values to set. Number of x-bins (without under-/overflow) has to be equal to number of elements of the detector.

Reimplemented in ant::TH2CB.

◆ SetMarkerOnBin()

void TH2Crystals::SetMarkerOnBin ( Int_t  bin)
protected

Member Data Documentation

◆ draw_glue_pads

bool ant::TH2Crystals::draw_glue_pads = false
protected

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