Belle II Software development
ECLChannelMap Class Reference

DB object to store correspondence table of type (Crate id, ShaperDSP id, Channel id) <-> (ECL CellID) More...

#include <ECLChannelMap.h>

Inheritance diagram for ECLChannelMap:

Public Member Functions

 ECLChannelMap ()
 Constructor.
 
const std::vector< int > & getMappingBAR () const
 Get vector of map entries for ECL barrel.
 
const std::vector< int > & getMappingFWD () const
 Get vector of map entries for ECL forward endcap.
 
const std::vector< int > & getMappingBWD () const
 Get vector of map entries for ECL backward endcap.
 
int get (int crate, int shaper, int channel) const
 Get value for specific (crate, shaper, channel)
 
void setMappingVectors (const std::vector< int > &mappingBAR, const std::vector< int > &mappingFWD, const std::vector< int > &mappingBWD)
 Set three vectors of map entries.
 

Private Member Functions

 ClassDef (ECLChannelMap, 1)
 ClassDef.
 

Private Attributes

std::vector< int > m_MappingBAR
 Map entries for ECL barrel.
 
std::vector< int > m_MappingFWD
 Map entries for ECL forward endcap.
 
std::vector< int > m_MappingBWD
 Map entries for ECL backward endcap.
 

Detailed Description

DB object to store correspondence table of type (Crate id, ShaperDSP id, Channel id) <-> (ECL CellID)

Definition at line 51 of file ECLChannelMap.h.

Constructor & Destructor Documentation

◆ ECLChannelMap()

ECLChannelMap ( )
inline

Constructor.

Definition at line 56 of file ECLChannelMap.h.

std::vector< int > m_MappingBWD
Map entries for ECL backward endcap.
std::vector< int > m_MappingFWD
Map entries for ECL forward endcap.
std::vector< int > m_MappingBAR
Map entries for ECL barrel.

Member Function Documentation

◆ get()

int get ( int  crate,
int  shaper,
int  channel 
) const
inline

Get value for specific (crate, shaper, channel)

Definition at line 66 of file ECLChannelMap.h.

67 {
68 using namespace ECL;
69
70 int id;
71 if (crate <= ECL_BARREL_CRATES) {
72 id = (crate - 1) * ECL_BARREL_SHAPERS_IN_CRATE * ECL_CHANNELS_IN_SHAPER
73 + (shaper - 1) * ECL_CHANNELS_IN_SHAPER + (channel - 1);
74 return m_MappingBAR[id];
75 }
76 crate -= ECL_BARREL_CRATES;
77
78 if (crate <= ECL_FWD_CRATES) {
79 id = (crate - 1) * ECL_FWD_SHAPERS_IN_CRATE * ECL_CHANNELS_IN_SHAPER
80 + (shaper - 1) * ECL_CHANNELS_IN_SHAPER + (channel - 1);
81 return m_MappingFWD[id];
82 }
83 crate -= ECL_FWD_CRATES;
84
85 if (crate <= ECL_BKW_CRATES) {
86 id = (crate - 1) * ECL_BKW_SHAPERS_IN_CRATE * ECL_CHANNELS_IN_SHAPER
87 + (shaper - 1) * ECL_CHANNELS_IN_SHAPER + (channel - 1);
88 return m_MappingBWD[id];
89 }
90
91 return -1;
92 }

◆ getMappingBAR()

const std::vector< int > & getMappingBAR ( ) const
inline

Get vector of map entries for ECL barrel.

Definition at line 59 of file ECLChannelMap.h.

59{return m_MappingBAR;}

◆ getMappingBWD()

const std::vector< int > & getMappingBWD ( ) const
inline

Get vector of map entries for ECL backward endcap.

Definition at line 63 of file ECLChannelMap.h.

63{return m_MappingBWD;}

◆ getMappingFWD()

const std::vector< int > & getMappingFWD ( ) const
inline

Get vector of map entries for ECL forward endcap.

Definition at line 61 of file ECLChannelMap.h.

61{return m_MappingFWD;}

◆ setMappingVectors()

void setMappingVectors ( const std::vector< int > &  mappingBAR,
const std::vector< int > &  mappingFWD,
const std::vector< int > &  mappingBWD 
)
inline

Set three vectors of map entries.

Parameters
mappingBARMap entries for barrel.
mappingFWDMap entries for forward endcap.
mappingBWDMap entries for backward endcap.

Definition at line 100 of file ECLChannelMap.h.

103 {
104 using namespace ECL;
105 //== Determine correct vector sizes from ECL-related constants
106 const unsigned int mappingBAR_size = ECL_BARREL_CRATES * ECL_BARREL_SHAPERS_IN_CRATE * ECL_CHANNELS_IN_SHAPER;
107 const unsigned int mappingFWD_size = ECL_FWD_CRATES * ECL_FWD_SHAPERS_IN_CRATE * ECL_CHANNELS_IN_SHAPER;
108 const unsigned int mappingBWD_size = ECL_BKW_CRATES * ECL_BKW_SHAPERS_IN_CRATE * ECL_CHANNELS_IN_SHAPER;
109 //== Compare given vector sizes with the correct ones
110 if (mappingBAR.size() != mappingBAR_size ||
111 mappingFWD.size() != mappingFWD_size ||
112 mappingBWD.size() != mappingBWD_size) {
113 B2FATAL("ECLChannelMap: wrong sizes for mapping vectors. Got ("
114 << mappingBAR.size() << ","
115 << mappingFWD.size() << ","
116 << mappingBWD.size() << "), "
117 << "Expected ("
118 << mappingBAR_size << ","
119 << mappingFWD_size << ","
120 << mappingBWD_size << ")");
121 }
122 //==
123 m_MappingBAR = mappingBAR;
124 m_MappingFWD = mappingFWD;
125 m_MappingBWD = mappingBWD;
126 };

Member Data Documentation

◆ m_MappingBAR

std::vector<int> m_MappingBAR
private

Map entries for ECL barrel.

Definition at line 129 of file ECLChannelMap.h.

◆ m_MappingBWD

std::vector<int> m_MappingBWD
private

Map entries for ECL backward endcap.

Definition at line 131 of file ECLChannelMap.h.

◆ m_MappingFWD

std::vector<int> m_MappingFWD
private

Map entries for ECL forward endcap.

Definition at line 130 of file ECLChannelMap.h.


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