115 LogDebug(
"L1TZDCProducer") <<
"L1TZDCProducer::produce function called..." << std::endl;
125 if (zdcDigiCollection.
isValid()) {
133 if (sampleToCenterBXChecked < 0) {
134 edm::LogWarning(
"L1TZDCProducer") <<
"sampleToCenterBX LT 0; Set bx 0 to sample 0 (minimum allowed)" << std::endl;
135 sampleToCenterBXChecked = 0;
136 }
else if (sampleToCenterBXChecked >=
nSamples) {
138 <<
"sampleToCenterBX GE nsamples; Set bx 0 to sample nsamples-1 (maximum allowed)" << std::endl;
139 sampleToCenterBXChecked =
nSamples - 1;
143 unsigned short rawadc[18][10];
157 if (
section == 1 && (channel < 1 || channel > 5))
159 if (
section == 2 && (channel < 1 || channel > 4))
162 int ihitid = (
zside == 1 ? 9 : 0) + (
section == 2 ? 5 : 0) + (channel - 1);
164 for (
int iTS = 0; iTS <
nSamples; iTS++) {
165 unsigned short adc = (
unsigned short)
frame[iTS].
adc();
166 rawadc[ihitid][iTS] =
adc;
170 for (
int ibx = 0; ibx <
nSamples; ibx++) {
171 double cEMP = 0, cEMM = 0, cHDP = 0, cHDM = 0;
172 double sumcEMP = 0, sumcEMM = 0, sumcHDP = 0, sumcHDM = 0;
174 for (
int idet = 0; idet < 5; idet++) {
175 unsigned short EMP = rawadc[idet + 9][ibx];
176 unsigned short EMM = rawadc[idet][ibx];
184 sumcEMP = sumcEMP + cEMP;
185 sumcEMM = sumcEMM + cEMM;
188 for (
int idet = 5; idet < 9; idet++) {
189 unsigned short HDP = rawadc[idet + 9][ibx];
190 unsigned short HDM = rawadc[idet][ibx];
198 sumcHDP = sumcHDP + cHDP;
199 sumcHDM = sumcHDM + cHDM;
201 double sumM = sumcEMM + sumcHDM;
202 double sumP = sumcEMP + sumcHDP;
205 edm::LogInfo(
"L1TZDCProducer") <<
", sumM= " << sumM << std::endl;
206 edm::LogInfo(
"L1TZDCProducer") <<
", sumP= " << sumP << std::endl;
220 if (ibx >= sampleToCenterBXChecked +
bxFirst_ && ibx <= sampleToCenterBXChecked +
bxLast_) {
221 etsumsReduced.push_back(ibx - sampleToCenterBXChecked, CaloTools::etSumP4Demux(tempEtP));
222 etsumsReduced.push_back(ibx - sampleToCenterBXChecked, CaloTools::etSumP4Demux(tempEtM));
228 edm::LogWarning(
"L1TZDCProducer") <<
"zdcDigis not valid; return empty ZDC Et Sum BXCollection" << std::endl;
int zdcLUTIndexHelper(int iDetPos, int iBXPos)
void setType(EtSumType type)
edm::EDPutTokenT< EtSumBxCollection > etToken_
const_iterator end() const
Log< level::Info, false > LogInfo
std::unique_ptr< CaloParamsHelper > params_
const_iterator begin() const
The iterator returned can not safely be used across threads.
edm::EDGetTokenT< QIE10DigiCollection > zdcToken_
boost::transform_iterator< IterHelp, boost::counting_iterator< int > > const_iterator
constexpr Section section() const
get the section
constexpr int32_t channel() const
get the channel
constexpr int32_t zside() const
get the z-side of the cell (1/-1)
Log< level::Warning, false > LogWarning
constexpr int samples() const
total number of samples in the digi
uint16_t *__restrict__ uint16_t const *__restrict__ adc