11 const int HcalTTPDigiProducer::inputs_[] = {30, 66, 4, 44, 4, 44, 0, 68, 0, 68, 16, 48, 16, 48, 6, 46, 6, 46,
12 2, 70, 2, 70, 18, 50, 18, 50, 12, 40, 12, 40, 8, 52, 8, 52, 20, 36,
13 20, 36, 14, 42, 14, 42, 10, 54, 10, 54, 22, 38, 22, 38, 24, 56, 24, 56,
14 32, 60, 32, 60, 28, 64, 28, 64, 26, 58, 26, 58, 34, 62, 34, 62, 30, 66};
25 for (
int i = 0;
i < 4;
i++) {
33 "hits>=%d:hfp%c=%d%chfm%c=%d",
42 throw cms::Exception(
"HcalTTPDigiProducer") <<
"Unable to read logic for technical trigger";
43 }
else if (
calc_[
i] == 6) {
45 throw cms::Exception(
"HcalTTPDigiProducer") <<
"Unable to read logic for technical trigger";
48 throw cms::Exception(
"HcalTTPDigiProducer") <<
"Technical Trigger logic must obey the following format:\n"
49 "\"hits>=[A1]:hfp[B1]=[A2][C]hfm[B2]=[A3]\",\n"
50 "or \"hits>=[A1]\",\n"
51 "with A# >= 0, B# = (</>) and C = (:/|)";
53 throw cms::Exception(
"HcalTTPDigiProducer") <<
"Unable to read logic for technical trigger";
69 edm::LogWarning(
"HcalTTPDigiProducer") <<
"Samples forced to maximum value of 8";
73 edm::LogWarning(
"HcalTTPDigiProducer") <<
"Presamples reset to HF SoI value";
76 produces<HcalTTPDigiCollection>();
89 if ((nP + nM) <
nHits_[bit])
92 return ((nP + nM) >=
nHits_[bit]);
94 if (
pReq_[bit] ==
'>')
95 pOK = (nP >=
nHFp_[bit]);
96 else if (
pReq_[bit] ==
'<')
97 pOK = (nP <=
nHFp_[bit]);
99 if (
mReq_[bit] ==
'>')
100 mOK = (nM >=
nHFm_[bit]);
101 else if (
mReq_[bit] ==
'<')
102 mOK = (nM <=
nHFm_[bit]);
110 edm::LogWarning(
"HcalTTPDigiProducer") <<
"Trigger logic exhausted. Returning false";
117 e.getByToken(
tok_hf_, hfDigiCollection);
124 uint16_t trigInputs[40];
127 for (
int i = 0;
i < 8;
i++) {
130 for (
int j = 0;
j < 5;
j++)
131 trigInputs[
j * 8 +
i] = 0;
147 int offset = (-1 +
id.zside()) / 2;
150 while (
shift >= 16) {
154 if (!(trigInputs[(linSample * 8) +
group] & (1 <<
shift)))
155 (
id.ieta() > 0) ? (nP[linSample]++) : (nM[linSample]++);
156 trigInputs[(linSample * 8) +
group] |= (1 <<
shift);
162 uint8_t trigOutput[8];
163 uint32_t algoDepBits[8];
165 for (
int linSample = 0; linSample < 8; linSample++) {
166 trigOutput[linSample] = 0;
167 algoDepBits[linSample] = 0;
169 for (
int j = 0;
j < 4;
j++)
170 trigOutput[linSample] |= (
decision(nP[linSample], nM[linSample],
j) <<
j);
171 int nT = nP[linSample] + nM[linSample];
176 algoDepBits[linSample] = (nT & 0x7F) | ((nP[linSample] & 0x3F) << 7) | ((nM[linSample] & 0x3F) << 13);
178 (linSample -
presamples_), &trigInputs[linSample * 8], algoDepBits[linSample], trigOutput[linSample]);
181 ttpResult->push_back(ttpDigi);