30 for (
int i = 0;
i < (
size_ - 2);
i++) {
31 int gem_chamber = (
i % 16) / 8;
32 theData[
i + 1] = 0x3FFF | (gem_chamber << 14);
53 LogTrace(
"CSCGEMData|CSCRawToDigi") <<
"CSCGEMData.Print";
62 return address - (nPads * etaPart);
67 std::vector<GEMPadDigiCluster>
result;
74 for (
int fiber = 0; fiber < nGEMs; fiber++) {
75 for (
int cluster = 0; cluster <
maxClusters; cluster++) {
76 int dataAddr = 1 + (
i * nGEMs + fiber) *
maxClusters + cluster;
77 int gem_layer = (
theData[dataAddr] >> 14) & 0
x1;
78 if (gem_layer == gem_chamber) {
79 int cl_word =
theData[dataAddr] & 0x3fff;
80 int pad =
theData[dataAddr] & 0xff;
82 int cluster_size = (
theData[dataAddr] >> 11) & 0x7;
84 int padInPart =
eta * nPads + pad;
87 <<
"GEMlayer" << gem_layer <<
" cl_word" << dataAddr <<
": 0x" << std::hex << cl_word <<
std::dec 88 <<
" tbin: " <<
i <<
" fiber#: " << (fiber + 1) <<
" cluster#: " << (cluster + 1)
89 <<
" padInPart: " << padInPart <<
" pad: " << pad <<
" eta: " <<
eta 90 <<
" cluster_size: " << cluster_size << std::endl;
91 std::vector<short unsigned int> pads;
92 for (
int iP = 0; iP <= cluster_size; ++iP)
93 pads.push_back(padInPart + iP);
95 result.push_back(pad_cluster);
148 std::vector<GEMPadDigiCluster>
result;
155 for (
int fiber = 0; fiber < nGEMs; fiber++) {
156 for (
int cluster = 0; cluster <
maxClusters; cluster++) {
157 int dataAddr = 1 + (
i * nGEMs + fiber) *
maxClusters + cluster;
158 int gem_layer = (
theData[dataAddr] >> 14) & 0
x1;
159 if (gem_layer == gem_chamber) {
160 int cl_word =
theData[dataAddr] & 0x3fff;
161 int pad =
theData[dataAddr] & 0xff;
163 int cluster_size = (
theData[dataAddr] >> 11) & 0x7;
164 if ((pad < nPads) && (
eta == eta_roll)) {
168 <<
"GEMlayer" << gem_layer <<
" cl_word" << dataAddr <<
": 0x" << std::hex << cl_word <<
std::dec 169 <<
" tbin: " <<
i <<
" fiber#: " << (fiber + 1) <<
" cluster#: " << (cluster + 1)
170 <<
" padInPart: " << padInPart <<
" pad: " << pad <<
" eta: " <<
eta 171 <<
" cluster_size: " << cluster_size << std::endl;
172 std::vector<short unsigned int> pads;
173 for (
int iP = 0; iP <= cluster_size; ++iP)
174 pads.push_back(padInPart + iP);
176 result.push_back(pad_cluster);
191 if ((gem_chamber < 2) && (
bx <
ntbins_)) {
192 int gem_layer = gem_chamber & 0x1;
193 int cluster_size = digi.
pads().size() - 1;
194 int pad = digi.
pads()[0];
196 int cl_word = (gem_layer << 14) + (pad & 0xff) + ((
eta & 0x7) << 8) + ((cluster_size & 0x7) << 11);
197 int dataAddr = 1 +
bx * 16 + 8 * gem_layer;
200 while (((
theData[dataAddr + cluster_num] & 0x3fff) != 0x3fff) && (cluster_num < 8)) {
204 if (((
theData[dataAddr + cluster_num] & 0x3fff) == 0x3fff) && (cluster_num < 8)) {
205 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
int getPartitionNumber(int address, int nPads) 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
std::vector< GEMPadDigiCluster > etaDigis(int gem_chamber, int eta) const