13 const int HcalTTPDigiProducer::inputs_[] = {30, 66, 4, 44, 4, 44, 0, 68, 0, 68, 16, 48, 16, 48, 6, 46, 6, 46,
14 2, 70, 2, 70, 18, 50, 18, 50, 12, 40, 12, 40, 8, 52, 8, 52, 20, 36,
15 20, 36, 14, 42, 14, 42, 10, 54, 10, 54, 22, 38, 22, 38, 24, 56, 24, 56,
16 32, 60, 32, 60, 28, 64, 28, 64, 26, 58, 26, 58, 34, 62, 34, 62, 30, 66};
26 for (
int i = 0;
i < 4;
i++) {
34 "hits>=%d:hfp%c=%d%chfm%c=%d",
43 throw cms::Exception(
"HcalTTPDigiProducer") <<
"Unable to read logic for technical trigger";
44 }
else if (
calc_[
i] == 6) {
46 throw cms::Exception(
"HcalTTPDigiProducer") <<
"Unable to read logic for technical trigger";
49 throw cms::Exception(
"HcalTTPDigiProducer") <<
"Technical Trigger logic must obey the following format:\n"
50 "\"hits>=[A1]:hfp[B1]=[A2][C]hfm[B2]=[A3]\",\n"
51 "or \"hits>=[A1]\",\n"
52 "with A# >= 0, B# = (</>) and C = (:/|)";
54 throw cms::Exception(
"HcalTTPDigiProducer") <<
"Unable to read logic for technical trigger";
70 edm::LogWarning(
"HcalTTPDigiProducer") <<
"Samples forced to maximum value of 8";
74 edm::LogWarning(
"HcalTTPDigiProducer") <<
"Presamples reset to HF SoI value";
77 produces<HcalTTPDigiCollection>();
90 if ((nP + nM) <
nHits_[bit])
93 return ((nP + nM) >=
nHits_[bit]);
95 if (
pReq_[bit] ==
'>')
96 pOK = (nP >=
nHFp_[bit]);
97 else if (
pReq_[bit] ==
'<')
98 pOK = (nP <=
nHFp_[bit]);
100 if (
mReq_[bit] ==
'>')
101 mOK = (nM >=
nHFm_[bit]);
102 else if (
mReq_[bit] ==
'<')
103 mOK = (nM <=
nHFm_[bit]);
111 edm::LogWarning(
"HcalTTPDigiProducer") <<
"Trigger logic exhausted. Returning false";
118 e.getByToken(
tok_hf_, hfDigiCollection);
126 uint16_t trigInputs[40];
129 for (
int i = 0;
i < 8;
i++) {
132 for (
int j = 0;
j < 5;
j++)
133 trigInputs[
j * 8 +
i] = 0;
149 int offset = (-1 +
id.zside()) / 2;
152 while (
shift >= 16) {
156 if (!(trigInputs[(linSample * 8) +
group] & (1 <<
shift)))
157 (
id.ieta() > 0) ? (nP[linSample]++) : (nM[linSample]++);
158 trigInputs[(linSample * 8) +
group] |= (1 <<
shift);
164 uint8_t trigOutput[8];
165 uint32_t algoDepBits[8];
167 for (
int linSample = 0; linSample < 8; linSample++) {
168 trigOutput[linSample] = 0;
169 algoDepBits[linSample] = 0;
171 for (
int j = 0;
j < 4;
j++)
172 trigOutput[linSample] |= (
decision(nP[linSample], nM[linSample],
j) <<
j);
173 int nT = nP[linSample] + nM[linSample];
178 algoDepBits[linSample] = (nT & 0x7F) | ((nP[linSample] & 0x3F) << 7) | ((nM[linSample] & 0x3F) << 13);
180 (linSample -
presamples_), &trigInputs[linSample * 8], algoDepBits[linSample], trigOutput[linSample]);
183 ttpResult->push_back(ttpDigi);