12#include <ecl/dataobjects/ECLElementNumbers.h>
15#include <framework/logging/Logger.h>
27 ECL_BARREL_SHAPERS_IN_CRATE = 12,
28 ECL_FWD_SHAPERS_IN_CRATE = 10,
29 ECL_BKW_SHAPERS_IN_CRATE = 8,
30 ECL_TOTAL_SHAPERS = 576,
31 ECL_FINESSES_IN_COPPER = 2,
32 ECL_CHANNELS_IN_SHAPER = 16,
34 ECL_BARREL_CRATES = 36,
38 ECL_BARREL_COPPERS = 18,
39 ECL_ENDCAP_COPPERS = 8,
66 int get(
int crate,
int shaper,
int channel)
const
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);
76 crate -= ECL_BARREL_CRATES;
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);
83 crate -= ECL_FWD_CRATES;
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);
101 const std::vector<int>& mappingFWD,
102 const std::vector<int>& mappingBWD)
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;
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() <<
"), "
118 << mappingBAR_size <<
","
119 << mappingFWD_size <<
","
120 << mappingBWD_size <<
")");
DB object to store correspondence table of type (Crate id, ShaperDSP id, Channel id) <-> (ECL CellID)
std::vector< int > m_MappingBWD
Map entries for ECL backward endcap.
int get(int crate, int shaper, int channel) const
Get value for specific (crate, shaper, channel)
const std::vector< int > & getMappingBWD() const
Get vector of map entries for ECL backward endcap.
const std::vector< int > & getMappingFWD() const
Get vector of map entries for ECL forward endcap.
void setMappingVectors(const std::vector< int > &mappingBAR, const std::vector< int > &mappingFWD, const std::vector< int > &mappingBWD)
Set three vectors of map entries.
ECLChannelMap()
Constructor.
ClassDef(ECLChannelMap, 1)
ClassDef.
const std::vector< int > & getMappingBAR() const
Get vector of map entries for ECL barrel.
std::vector< int > m_MappingFWD
Map entries for ECL forward endcap.
std::vector< int > m_MappingBAR
Map entries for ECL barrel.
const int c_NCrystals
Number of crystals.
const int c_NCrystalsBackward
Number of crystals in the backward ECL.
const int c_NCrystalsBarrel
Number of crystals in the barrel ECL.
const int c_NCrystalsForward
Number of crystals in the forward ECL.
Abstract base class for different kinds of events.