32 for (
int i = 0;
i < (
size_ - 2);
i++) {
33 int gem_chamber = (
i % 16) / 8;
34 theData[
i + 1] = 0x3FFF | (gem_chamber << 14);
55 LogTrace(
"CSCGEMData|CSCRawToDigi") <<
"CSCGEMData.Print";
64 return address - (nPads * etaPart);
69 std::vector<GEMPadDigiCluster>
result;
77 for (
int cluster = 0; cluster <
maxClusters; cluster++) {
79 int gem_layer = (
theData[dataAddr] >> 14) & 0
x1;
80 if (gem_layer == gem_chamber) {
81 int cl_word =
theData[dataAddr] & 0x3fff;
82 int pad =
theData[dataAddr] & 0xff;
84 int cluster_size = (
theData[dataAddr] >> 11) & 0x7;
86 int padInPart =
eta * nPads + pad;
89 <<
"GEMlayer" << gem_layer <<
" cl_word" << dataAddr <<
": 0x" << std::hex << cl_word <<
std::dec 90 <<
" tbin: " <<
i <<
" fiber#: " << (
fiber + 1) <<
" cluster#: " << (cluster + 1)
91 <<
" padInPart: " << padInPart <<
" pad: " << pad <<
" eta: " <<
eta 92 <<
" cluster_size: " << cluster_size << std::endl;
93 std::vector<short unsigned int> pads;
94 for (
int iP = 0; iP <= cluster_size; ++iP)
95 pads.push_back(padInPart + iP);
97 result.push_back(pad_cluster);
150 std::vector<GEMPadDigiCluster>
result;
158 for (
int cluster = 0; cluster <
maxClusters; cluster++) {
160 int gem_layer = (
theData[dataAddr] >> 14) & 0
x1;
161 if (gem_layer == gem_chamber) {
162 int cl_word =
theData[dataAddr] & 0x3fff;
163 int pad =
theData[dataAddr] & 0xff;
165 int cluster_size = (
theData[dataAddr] >> 11) & 0x7;
166 if ((pad < nPads) && (
eta == eta_roll)) {
170 <<
"GEMlayer" << gem_layer <<
" cl_word" << dataAddr <<
": 0x" << std::hex << cl_word <<
std::dec 171 <<
" tbin: " <<
i <<
" fiber#: " << (
fiber + 1) <<
" cluster#: " << (cluster + 1)
172 <<
" padInPart: " << padInPart <<
" pad: " << pad <<
" eta: " <<
eta 173 <<
" cluster_size: " << cluster_size <<
" alctMatchTime: " << alctMatchTime << std::endl;
174 std::vector<short unsigned int> pads;
175 for (
int iP = 0; iP <= cluster_size; ++iP)
176 pads.push_back(padInPart + iP);
179 result.push_back(pad_cluster);
194 if ((gem_chamber < 2) && (
bx <
ntbins_)) {
195 int gem_layer = gem_chamber & 0x1;
196 int cluster_size = digi.
pads().size() - 1;
197 int pad = digi.
pads()[0];
199 int cl_word = (gem_layer << 14) + (pad & 0xff) + ((
eta & 0x7) << 8) + ((cluster_size & 0x7) << 11);
200 int dataAddr = 1 +
bx * 16 + 8 * gem_layer;
203 while (((
theData[dataAddr + cluster_num] & 0x3fff) != 0x3fff) && (cluster_num < 8)) {
207 if (((
theData[dataAddr + cluster_num] & 0x3fff) == 0x3fff) && (cluster_num < 8)) {
208 theData[dataAddr + cluster_num] = cl_word;
const std::vector< uint16_t > & pads() const
void addEtaPadCluster(const GEMPadDigiCluster &digi, int gem_chamber, int eta_roll)
Add and pack GEMPadDigiCluster digis.
static std::atomic< bool > debug
void setAlctMatchTime(int matchWin)
int getPartitionNumber(int address, int nPads) const
std::vector< GEMPadDigiCluster > etaDigis(int gem_chamber, int eta, int correctionToALCTbx) const
std::vector< GEMPadDigiCluster > digis(int gem_chamber) const
CSCGEMData(int ntbins=12, int gem_fibers_mask=0xf)
default constructor
unsigned short theData[8 *2 *32+2]
int getPartitionStripNumber(int address, int nPads, int etaPart) const