Project
Loading...
Searching...
No Matches
o2::emcal::BadChannelMap Class Reference

CCDB container for masked cells in EMCAL. More...

#include <BadChannelMap.h>

Public Types

enum class  MaskType_t : char { GOOD_CELL , BAD_CELL , WARM_CELL , DEAD_CELL }
 Definition of mask types in the bad channel map. More...
 

Public Member Functions

 BadChannelMap ()=default
 Constructor.
 
 ~BadChannelMap ()=default
 Destructor.
 
BadChannelMapoperator+= (const BadChannelMap &rhs)
 Add bad channel map to this bad channel map.
 
bool operator== (const BadChannelMap &other) const
 Comparison of two bad channel maps.
 
void addBadChannel (unsigned short channelID, MaskType_t mask)
 Add bad cell to the container.
 
MaskType_t getChannelStatus (unsigned short channelID) const
 Get the status of a certain cell.
 
TH2 * getHistogramRepresentation () const
 Convert map into 2D histogram representation.
 
void PrintStream (std::ostream &stream) const
 Print bad channels on a given stream.
 

Detailed Description

CCDB container for masked cells in EMCAL.

Author
Markus Fasel <>, Oak Ridge National Laboratory
Since
June 25th, 2019

The EMCAL Bad Channel Map

The bad channel map contains channels which are found to be bad, dead or problematic during the calibration process and need to be masked so they are not considered in the clusterization or other analysis processes. Cells can be either bad, meaning that the spectra shape is so much distorted that recovery is not possible, dead, meaning that no signal is seen over a large datasample, or warm, indicating that the cell might be recovered by recalibration of the energy.

Bad channels can be added via

bcm.addBadChannel(1234, o2::emcal::BadChannelMap::MaskStatus_t::BAD_CELL);
CCDB container for masked cells in EMCAL.
void addBadChannel(unsigned short channelID, MaskType_t mask)
Add bad cell to the container.

The cell container stores only bad or warm cells, good cells are ignored. However the function addBadChannel also updates the container with a new channel status - calling addBadChannel with the status GOOD_CELL for a cell which is stored in the container the cell is removed.

Reading the channel status is done via

auto status = bcm.getChannelStatus(1234); // returning BAD_CELL in this case
MaskType_t getChannelStatus(unsigned short channelID) const
Get the status of a certain cell.

Calling getChannelStatus for cells not registered in the container will return the status GOOD_CELL.

For visualization a histogram with the cell status as function of column and row can be created on the fly from the bad channel map. As the histogram is reated dynamically from the absolute cell ID an instance of the EMCAL Geometry is required - otherwise an empty histogram is created.

The bad channel map can be created from multiple bad channel maps using the operator +=. This allows for the combination of the bad channel map from multiple time slices. For cells present in both bad channel maps always the worst case condition (BAD_CELL) is assumed.

Definition at line 71 of file BadChannelMap.h.

Member Enumeration Documentation

◆ MaskType_t

Definition of mask types in the bad channel map.

Enumerator
GOOD_CELL 

GOOD cell, can be used without problems.

BAD_CELL 

Bad cell, must be excluded.

WARM_CELL 

Warm cell, to be used with care.

DEAD_CELL 

Dead cell, no data obtained.

Definition at line 76 of file BadChannelMap.h.

Constructor & Destructor Documentation

◆ BadChannelMap()

o2::emcal::BadChannelMap::BadChannelMap ( )
default

Constructor.

◆ ~BadChannelMap()

o2::emcal::BadChannelMap::~BadChannelMap ( )
default

Destructor.

Member Function Documentation

◆ addBadChannel()

void BadChannelMap::addBadChannel ( unsigned short  channelID,
MaskType_t  mask 
)

Add bad cell to the container.

Parameters
channelIDAbsolute ID of the bad channel
masktype of the bad channel
Exceptions
CalibContainerIndexExceptionin case the cell ID exceeds the range of cells in EMCAL

Adding new bad channel to the container. In case a cell with the same ID is already present in the container, the mask status is updated. Otherwise it is added.

Only bad or warm cells are added to the container. In case the mask type is GOOD_CELL, the entry is removed from the container if present before, otherwise the cell is ignored.

Definition at line 24 of file BadChannelMap.cxx.

◆ getChannelStatus()

BadChannelMap::MaskType_t BadChannelMap::getChannelStatus ( unsigned short  channelID) const

Get the status of a certain cell.

Parameters
channelIDchannel for which to obtain the channel status
Returns
Mask status of the cell (GOOD_CELL if not registered)
Exceptions
CalibContainerIndexExceptionin case the cell ID exceeds the range of cells in EMCAL

Provide the mask status of a cell. In case the cell is registered in the container the mask status registered is returned, otherwise the cell is handled as GOOD_CELL

Definition at line 53 of file BadChannelMap.cxx.

◆ getHistogramRepresentation()

TH2 * BadChannelMap::getHistogramRepresentation ( ) const

Convert map into 2D histogram representation.

Returns
Histogram representation of the bad channel map

Convert bad channel map into a 2D map with col-row dimensions. Entries in the histogram are:

  • 0: GOOD_CELL
  • 1: BAD_CELL
  • 2: WARM_CELL

Attention: The histogram is created on the fly using the mapping in o2::emcal::Geometry. In order to get the representation, a geometry instance must be available.

Definition at line 69 of file BadChannelMap.cxx.

◆ operator+=()

BadChannelMap & BadChannelMap::operator+= ( const BadChannelMap rhs)

Add bad channel map to this bad channel map.

Parameters
rhsBad channel map to be added to this bad channel map
Returns
Reference to the combined bad channel map

Adding bad channels of another bad channel map to this bad channel map. In case the cell is present in both maps, the most severe condition is assumed.

Definition at line 97 of file BadChannelMap.cxx.

◆ operator==()

bool BadChannelMap::operator== ( const BadChannelMap other) const

Comparison of two bad channel maps.

Returns
true if the bad channel maps are identical, false otherwise

Testing two bad channel maps for equalness. Bad channel maps are considered identical if the content is identical (same channels and same channel status for all cells).

Definition at line 122 of file BadChannelMap.cxx.

◆ PrintStream()

void BadChannelMap::PrintStream ( std::ostream &  stream) const

Print bad channels on a given stream.

Parameters
streamStream on which the bad channel map is printed on

Printing all bad channels store in the bad channel map on the stream. Printing also the channel status (BAD_CELL/WARM_CELL).

The function is called in the operator<< providing direct access to protected members. Explicit calls by the users is normally not necessary.

Definition at line 127 of file BadChannelMap.cxx.


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