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

The TH2CB class. More...

#include <TH2CB.h>

+ Inheritance diagram for ant::TH2CB:
+ Collaboration diagram for ant::TH2CB:

Public Member Functions

 TH2CB (const std::string &name="", const std::string &title="", bool glue_pads=false)
 
virtual ~TH2CB ()
 
virtual void SetElements (const TH2CB &h)
 
virtual void FillElements (const TH2CB &h)
 
virtual void FillCrystalNumbers ()
 Fill in the crystal numbers. More...
 
void FillMMCNumbers ()
 Fill the Major-Minor-Crystal numbers in. ex: 1/1/1 -> 111 and 14/2/8 -> 1428. More...
 
void FillElementNumbers () override
 Fill in the element numbers. Crystal numers are mapped to element numbers. More...
 
void FillCrystals672 (const std::vector< Double_t > &pattern)
 Fill a hit pattern (unmapped), only containing existing crystals. More...
 
void FillCrystals720 (const std::vector< Double_t > &pattern)
 Fil a hit pattern (unmapped), containing crystals in holes. More...
 
Double_t GetCrystal672 (const UInt_t i) const
 Get value of a crystal (unmapped), only counting exising crystals (no holes) More...
 
Double_t GetCrystal720 (const UInt_t i) const
 Get value of a crystal (unmapped), counting also crystals in holes. More...
 
void SetCrystal672 (const UInt_t i, Double_t value)
 Set the value of a crystal (unmapped), counting only existing crystals (no holes) More...
 
void SetCrystal720 (const UInt_t i, Double_t value)
 Get value of a crystal (unmapped), counting also crystals in holes. More...
 
virtual Double_t GetElement (const UInt_t element) const override
 Get value of an element (mapped) More...
 
virtual void SetElement (const UInt_t element, Double_t value) override
 Set the value of an element (mapped) More...
 
virtual void SetElements (const std::vector< Double_t > &pattern) override
 Fill a hit pattern (mapped), ordered by element numers. More...
 
virtual void SetElements (const TH1 &h) override
 Set values of all elements to the ones stored in a TH1 (values ordered by element number) More...
 
virtual void FillElements (const TH1 &h) override
 
Int_t GetNumberOfElements () const override
 Get the number of elements Crystal Ball also counts crystal positions that are in the hole regions, so there are element indices that do not have a crystal. More...
 
virtual void CreateMarker (UInt_t element) override
 CreateMarker creates marker at given element. More...
 
- Public Member Functions inherited from ant::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) More...
 
virtual ~TH2Crystals ()
 
virtual void FillBinNumbers ()
 Fill the number of the TH2Poly bin. Useful for debugging only, I guess. More...
 
virtual void FillElement (const UInt_t element, const Double_t w)
 
virtual void FillElements (const std::vector< Double_t > &pattern)
 
virtual void ResetElements (const Double_t value=0.0)
 Reset Elements (clear everything) 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...
 

Static Public Member Functions

static Int_t GetBinOfMMC (const UChar_t major, const UChar_t minor, const UChar_t crystal)
 
static Int_t GetVBinOfMMC (const UChar_t major, const UChar_t minor, const UChar_t crystal)
 
static Int_t GetBinOfVBin (const Int_t vbin)
 
static bool IsInHole (const UChar_t a, const UChar_t b, const UChar_t c)
 
static bool IsInHole (const Int_t vbin)
 
static UInt_t GetCrystalOfElement (const UInt_t element)
 Get the crystal number for an element number. More...
 
static UInt_t GetElementOfCrystal (const UInt_t crystal)
 Get the element number for a crystal number. More...
 

Protected Member Functions

virtual void Build ()
 
void MakeLevel (TH2DrawTool &c, const UInt_t n, std::set< Int_t >::const_iterator &nexthole, Int_t &vbins)
 
- Protected Member Functions inherited from ant::TH2Crystals
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
 
- Protected Attributes inherited from ant::TH2Crystals
bool draw_glue_pads = false
 

Detailed Description

The TH2CB class.

A TH2Poly of the Crystal Ball mesh.

cb.png

bin number (bin): Index of a bin in the TH2Poly. [1..n], used to access the individual bins with SetBinContent(bin, value), etc. A bin exists for every physical crystal. There are 672 crystals.

virtual bin number (vbin): A virtual bin number including non-existant crystals in the hole regions, [1..720].

Major-Minior-Crystal Number (MMC): The Crystal Ball is divided into major triganles (20) which again are subdivided into minor triangles (4). Each mintor triangle consists of 9 crystals. The MMC number addesses crystals by their Major-Minor-Crystal indices.

Element Number (element): The crystals are not cabled in the ordering of the crystals. Acqu uses elements.

Constructor & Destructor Documentation

◆ TH2CB()

TH2CB::TH2CB ( const std::string &  name = "",
const std::string &  title = "",
bool  glue_pads = false 
)

◆ ~TH2CB()

virtual ant::TH2CB::~TH2CB ( )
inlinevirtual

Member Function Documentation

◆ Build()

void TH2CB::Build ( )
protectedvirtual

◆ CreateMarker()

void TH2CB::CreateMarker ( UInt_t  element)
overridevirtual

CreateMarker creates marker at given element.

Parameters
element
Returns

Reimplemented from ant::TH2Crystals.

◆ FillCrystalNumbers()

void TH2CB::FillCrystalNumbers ( )
virtual

Fill in the crystal numbers.

Crystal numers count in the same way as the element numbers (ex.: 1/1/1), stating with 0.

◆ FillCrystals672()

void TH2CB::FillCrystals672 ( const std::vector< Double_t > &  pattern)

Fill a hit pattern (unmapped), only containing existing crystals.

Parameters
patternVector of the lenfth 672 (is checked!)
See also
FillCrystals720()

◆ FillCrystals720()

void TH2CB::FillCrystals720 ( const std::vector< Double_t > &  pattern)

Fil a hit pattern (unmapped), containing crystals in holes.

Parameters
patternVector of the lenfth 720 (is checked!)
See also
FillCrystals672()

◆ FillElementNumbers()

void TH2CB::FillElementNumbers ( )
overridevirtual

Fill in the element numbers. Crystal numers are mapped to element numbers.

Reimplemented from ant::TH2Crystals.

◆ FillElements() [1/2]

void TH2CB::FillElements ( const TH2CB h)
virtual

◆ FillElements() [2/2]

void TH2CB::FillElements ( const TH1 &  h)
overridevirtual

Reimplemented from ant::TH2Crystals.

◆ FillMMCNumbers()

void TH2CB::FillMMCNumbers ( )

Fill the Major-Minor-Crystal numbers in. ex: 1/1/1 -> 111 and 14/2/8 -> 1428.

◆ GetBinOfMMC()

Int_t TH2CB::GetBinOfMMC ( const UChar_t  major,
const UChar_t  minor,
const UChar_t  crystal 
)
static

◆ GetBinOfVBin()

Int_t TH2CB::GetBinOfVBin ( const Int_t  vbin)
static

◆ GetCrystal672()

Double_t TH2CB::GetCrystal672 ( const UInt_t  i) const

Get value of a crystal (unmapped), only counting exising crystals (no holes)

Parameters
iCrystal number [0..671]
Returns
Content of the crystal

◆ GetCrystal720()

Double_t TH2CB::GetCrystal720 ( const UInt_t  i) const

Get value of a crystal (unmapped), counting also crystals in holes.

Parameters
iCrystal number, might be in a hole, [0..719]
Returns
Content of the crystal. If the crystal is in a hole, 0.0 ist returend

◆ GetCrystalOfElement()

UInt_t TH2CB::GetCrystalOfElement ( const UInt_t  element)
static

Get the crystal number for an element number.

Parameters
elementThe element number
Returns
crystal number

◆ GetElement()

Double_t TH2CB::GetElement ( const UInt_t  element) const
overridevirtual

Get value of an element (mapped)

Parameters
elementElement number [0..720]
Returns
Content of the crystal, 0 if is inside a hole

Reimplemented from ant::TH2Crystals.

◆ GetElementOfCrystal()

UInt_t TH2CB::GetElementOfCrystal ( const UInt_t  crystal)
static

Get the element number for a crystal number.

Parameters
crystalThe crystal number
Returns
element number

◆ GetNumberOfElements()

Int_t ant::TH2CB::GetNumberOfElements ( ) const
inlineoverridevirtual

Get the number of elements Crystal Ball also counts crystal positions that are in the hole regions, so there are element indices that do not have a crystal.

Returns
Number of elements (720)

Reimplemented from ant::TH2Crystals.

◆ GetVBinOfMMC()

Int_t TH2CB::GetVBinOfMMC ( const UChar_t  major,
const UChar_t  minor,
const UChar_t  crystal 
)
static

◆ IsInHole() [1/2]

bool TH2CB::IsInHole ( const UChar_t  a,
const UChar_t  b,
const UChar_t  c 
)
static

◆ IsInHole() [2/2]

bool TH2CB::IsInHole ( const Int_t  vbin)
static

◆ MakeLevel()

void TH2CB::MakeLevel ( TH2DrawTool c,
const UInt_t  n,
std::set< Int_t >::const_iterator &  nexthole,
Int_t &  vbins 
)
protected

◆ SetCrystal672()

void TH2CB::SetCrystal672 ( const UInt_t  i,
Double_t  value 
)

Set the value of a crystal (unmapped), counting only existing crystals (no holes)

Parameters
iCrystal number [0..671]
valueValue to set it it
See also
SetCrystal720()

◆ SetCrystal720()

void TH2CB::SetCrystal720 ( const UInt_t  i,
Double_t  value 
)

Get value of a crystal (unmapped), counting also crystals in holes.

Parameters
iCrystal number, might be in a hole, [0..719]
valueValue to set it it
See also
SetCrystal672()

◆ SetElement()

void TH2CB::SetElement ( const UInt_t  element,
Double_t  value 
)
overridevirtual

Set the value of an element (mapped)

Parameters
elementElement number [0..720]
valueValue to set it it
See also
SetCrystal720()

Reimplemented from ant::TH2Crystals.

◆ SetElements() [1/3]

void TH2CB::SetElements ( const TH2CB h)
virtual

◆ SetElements() [2/3]

void TH2CB::SetElements ( const std::vector< Double_t > &  pattern)
overridevirtual

Fill a hit pattern (mapped), ordered by element numers.

Parameters
patternVector of the lenfth 720 (is checked!)
See also
FillCrystals720()
FillCrystals672()

Reimplemented from ant::TH2Crystals.

◆ SetElements() [3/3]

void TH2CB::SetElements ( const TH1 &  h)
overridevirtual

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 from ant::TH2Crystals.

Member Data Documentation

◆ draw_glue_pads

bool ant::TH2CB::draw_glue_pads = false
protected

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