50 Tile::MAX_ROS - 1, Tile::MAX_GAIN);
53 Tile::MAX_ROS, nL1Triggers);
56 Tile::MAX_ROS, nL1Triggers);
59 Tile::MAX_ROS - 1, nL1Triggers);
62 Tile::MAX_ROS - 1, nL1Triggers);
65 Tile::MAX_ROS - 1, nL1Triggers);
68 Tile::MAX_ROS - 1, nL1Triggers);
71 Tile::MAX_ROS - 1, nL1Triggers);
74 Tile::MAX_ROS - 1, nL1Triggers);
77 Tile::MAX_ROS - 1, nL1Triggers);
80 Tile::MAX_ROS - 1, Tile::MAX_GAIN, nL1Triggers);
83 Tile::MAX_ROS - 1, Tile::MAX_GAIN, nL1Triggers);
87 Tile::MAX_DRAWER, 4 );
91 Tile::MAX_ROS, nL1Triggers);
94 Tile::MAX_ROS, nL1Triggers);
104 Tile::MAX_ROS - 1,
MAX_SAMP, nL1Triggers);
108 Tile::MAX_ROS - 1,
MAX_SAMP, nL1Triggers);
111 Tile::MAX_ROS - 1,
MAX_SAMP, nL1Triggers);
139 <<
" BCID = " << eventInfo->
bcid()
142 const std::vector<xAOD::EventInfo::StreamTag>& eventStreamTags = eventInfo->
streamTags();
143 if (!eventStreamTags.empty()) {
145 for (
const auto& eventStreamTag : eventStreamTags) {
146 msg(
MSG::DEBUG) <<
" " << eventStreamTag.name() <<
"/" << eventStreamTag.type();
154 static const float energyWeight[6] = {1.f/3.f, 1.f/6.f, 1.f/11.f, 1.f/11.f, 1.f/28.f, 1.f/28.f};
155 static const int gapScintIndex[6] = {0, 1, 2, 2, 3, 3};
157 std::vector<const CaloCell*> muonCells;
159 std::vector<int> energyBalModPartModule;
160 std::vector<int> energyBalModPartPartition;
162 std::vector<int> timeBalModPartModule;
163 std::vector<int> timeBalModPartPartition;
170 int nCellsOverThreshold[
MAX_PART] = {0};
173 int nBadChannelsOnFly[
MAX_PART] = {0};
176 unsigned int nMaskedChannelsDueDQ[
MAX_PART] = { 0 };
179 unsigned int nMaskedCellsDueDQ[
MAX_PART] = { 0 };
181 std::vector<int> negOccupModule[Tile::MAX_ROS - 1];
182 std::vector<int> negOccupChannel[Tile::MAX_ROS - 1];
184 std::vector<float> timeBal[Tile::MAX_ROS - 1];
185 std::vector<int> timeBalModule[Tile::MAX_ROS - 1];
187 std::vector<float> energyBal[Tile::MAX_ROS - 1];
188 std::vector<int> energyBalModule[Tile::MAX_ROS - 1];
190 std::vector<int> detailOccupModule[Tile::MAX_ROS - 1];
191 std::vector<int> detailOccupChannel[Tile::MAX_ROS - 1];
192 std::vector<float> detailOccupEnergies[Tile::MAX_ROS - 1];
194 std::vector<int> detailOccupGainModule[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
195 std::vector<int> detailOccupGainChannel[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
196 std::vector<float> detailOccupGainEnergies[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
198 std::vector<int> overThrOccupModule[Tile::MAX_ROS - 1];
199 std::vector<int> overThrOccupChannel[Tile::MAX_ROS - 1];
200 std::vector<float> overThrOccupWeight[Tile::MAX_ROS - 1];
202 std::vector<int> overThrOccupGainModule[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
203 std::vector<int> overThrOccupGainChannel[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
204 std::vector<float> overThrOccupGainWeight[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
206 std::vector<int> overThr30GeVOccupModule[Tile::MAX_ROS - 1];
207 std::vector<int> overThr30GeVOccupChannel[Tile::MAX_ROS - 1];
209 std::vector<int> overThr300GeVOccupModule[Tile::MAX_ROS - 1];
210 std::vector<int> overThr300GeVOccupChannel[Tile::MAX_ROS - 1];
212 std::vector<int> eneDiff[Tile::MAX_ROS - 1];
213 std::vector<int> eneDiffChannel[Tile::MAX_ROS - 1];
214 std::vector<int> eneDiffModule[Tile::MAX_ROS - 1];
216 std::vector<int> maskedOnFlyDrawers[Tile::MAX_ROS - 1];
217 std::vector<int> maskedOnFlyChannel[Tile::MAX_ROS - 1];
219 std::vector<int> chanTime[Tile::MAX_ROS - 1];
220 std::vector<int> chanTimeDrawer[Tile::MAX_ROS - 1];
221 std::vector<int> chanTimeChannel[Tile::MAX_ROS - 1];
222 std::vector<int> chanTimeDigitizer[Tile::MAX_ROS - 1];
224 int nChannelsInPartition = 2880;
226 if (
partition > 1) nChannelsInPartition = 2048;
227 detailOccupModule[
partition].reserve(nChannelsInPartition);
228 detailOccupChannel[
partition].reserve(nChannelsInPartition);
229 detailOccupEnergies[
partition].reserve(nChannelsInPartition);
232 std::vector<float> occupEta[
SAMP_ALL];
233 std::vector<float> occupPhi[
SAMP_ALL];
234 std::vector<float> occupEnergy[
SAMP_ALL];
236 std::vector<float> overThrOccupEta[
SAMP_ALL];
237 std::vector<float> overThrOccupPhi[
SAMP_ALL];
239 std::vector<float> sampChanTime[Tile::MAX_ROS - 1][
SAMP_ALL];
240 std::vector<float> sampEnergyDiff[Tile::MAX_ROS - 1][
SAMP_ALL];
241 std::vector<float> sampTimeDiff[Tile::MAX_ROS - 1][
SAMP_ALL];
253 bool isCollision =
true;
264 if (tile_cell == 0)
continue;
276 bool isMaskedChannel1 =
false;
277 bool isMaskedAdc1 =
false;
278 bool isMaskedAdc2 =
false;
285 IdentifierHash hash1 = caloDDE->
onl1();
291 partition1 = ros1 - 1;
294 IdentifierHash hash2 = caloDDE->
onl2();
300 partition2 = ros2 - 1;
315 bool single_PMT = single_PMT_C10 || single_PMT_scin;
322 bool isBadChannel1 = tile_cell->
badch1();
323 bool isBadChannel2 = tile_cell->
badch2();
325 int isCellGood = !tile_cell->
badcell();
332 double time =
cell->time();
333 double eta =
cell->eta();
334 double phi =
cell->phi();
335 double energy1 = tile_cell->
ene1();
336 double energy2 = tile_cell->
ene2();
337 double energyDiff = (single_PMT) ? 0.0 : tile_cell->
eneDiff();
338 double energyRatio = (
energy != 0.0) ? energyDiff/
energy : 0.0;
339 double time1 = tile_cell->
time1();
340 double time2 = tile_cell->
time2();
341 double timeDiff = (single_PMT) ? 0.0 : 2. * tile_cell->
timeDiff();
344 if (single_PMT_scin) {
346 if (tower > 9 && tower < 16) {
347 weight = energyWeight[tower - 10];
351 int gapScintIdx = gapScintIndex[tower - 10];
352 unsigned int partition = (ros1 > 0) ? ros1 - 3 : ros2 - 3;
372 <<
" ch1: " << channel1
373 <<
" gain1: " <<
gain1
374 <<
" qual1: " << (
int)tile_cell->
qual1()
375 <<
" qbit1: " << (
int)tile_cell->
qbit1()
380 <<
" ch2: " << channel2
381 <<
" gain2: " <<
gain2
382 <<
" qual2: " << (
int)tile_cell->
qual2()
383 <<
" qbit2: " << (
int)tile_cell->
qbit2()
384 << ((ros1 != ros2) ?
" ros1 != ros2" :
" ") <<
endmsg;
387 <<
" bad1: " << isBadChannel1
388 <<
" bad2: " << isBadChannel2
389 << ((single_PMT_scin && isBadChannel1 && !isMaskedChannel1)
390 ?
" NEW BAD E-cell" :
" ") <<
endmsg ;
393 <<
" E-cell: " << ((single_PMT_scin) ?
"true" :
"false")
394 <<
" specC10: " << ((single_PMT_C10) ?
"true" :
"false") <<
endmsg;
397 <<
" ediff= " << energyDiff
398 <<
" eratio= " << energyRatio
401 msg(
MSG::VERBOSE) <<
"Time= " << time <<
" = (" << time1 <<
" + " << time2 <<
")/2 "
402 <<
"tdiff= " << timeDiff
403 <<
"\t time[ns]= " << time/
ns <<
endmsg ;
413 int quality1 = (
int)tile_cell->
qual1();
414 int quality2 = (
int)tile_cell->
qual2();
415 if (isBadChannel1 != isBadChannel2 && quality1 != quality2
416 && quality1 < 255 && quality2 < 255) {
417 if (isBadChannel1 && isOkChannel1) dbGain1 = 1 -
gain1;
418 if (isBadChannel2 && isOkChannel2) dbGain2 = 1 -
gain2;
423 isMaskedAdc1 = badChannels->
getAdcStatus(adc1_id).isBad();
428 isMaskedAdc2 = badChannels->
getAdcStatus(adc2_id).isBad();
431 bool channel1MaskedDueDQ(
false);
432 if (isBadChannel1 && isOkChannel1 && !(single_PMT_C10 && channel1 == 4)) {
434 ++nBadChannelsOnFly[partition1];
435 maskedOnFlyDrawers[partition1].push_back(
drawer);
436 maskedOnFlyChannel[partition1].push_back(channel1);
439 channel1MaskedDueDQ =
true;
440 ++nMaskedChannelsDueDQ[partition1];
445 bool channel2MaskedDueDQ(
false);
446 if (isBadChannel2 && isOkChannel2 && !(single_PMT_C10 && channel2 == 4)) {
448 ++nBadChannelsOnFly[partition2];
449 maskedOnFlyDrawers[partition2].push_back(
drawer);
450 maskedOnFlyChannel[partition2].push_back(channel2);
453 channel2MaskedDueDQ =
true;
454 ++nMaskedChannelsDueDQ[partition2];
464 muonCells.push_back(
cell);
467 occupEta[
sample].push_back(eta);
468 occupPhi[
sample].push_back(phi);
472 detailOccupModule[partition1].push_back(
module);
473 detailOccupChannel[partition1].push_back(channel1);
474 detailOccupEnergies[partition1].push_back(energy1 *
weight);
476 detailOccupGainModule[partition1][
gain1].push_back(
module);
477 detailOccupGainChannel[partition1][
gain1].push_back(channel1);
478 detailOccupGainEnergies[partition1][
gain1].push_back(energy1 *
weight);
482 detailOccupModule[partition2].push_back(
module);
483 detailOccupChannel[partition2].push_back(channel2);
484 detailOccupEnergies[partition2].push_back(energy2);
486 detailOccupGainModule[partition2][
gain2].push_back(
module);
487 detailOccupGainChannel[partition2][
gain2].push_back(channel2);
488 detailOccupGainEnergies[partition2][
gain2].push_back(energy2);
492 ++nBadCells[partition1];
493 if (channel1MaskedDueDQ || channel2MaskedDueDQ) {
494 ++nMaskedCellsDueDQ[partition1];
500 negOccupModule[partition1].push_back(
module);
501 negOccupChannel[partition1].push_back(channel1);
505 negOccupModule[partition2].push_back(
module);
506 negOccupChannel[partition2].push_back(channel2);
514 if ((
gain1 == 0) && (energy1 < 1000.)) {
515 ATH_MSG_DEBUG(
"Low energy in LG for time monitoring: " << Tile::getDrawerString(ros1,
drawer)
516 <<
", channel = " << channel1 <<
", energy = " << energy1 <<
", time = " << time1);
518 chanTime[partition1].push_back(time1);
519 chanTimeDrawer[partition1].push_back(
drawer);
520 chanTimeChannel[partition1].push_back(channel1);
521 chanTimeDigitizer[partition1].push_back(
getDigitizer(channel1));
523 sampChanTime[partition1][
sample].push_back(time1);
529 if ((
gain2 == 0) && (energy2 < 1000.)) {
530 ATH_MSG_DEBUG(
"Low energy in LG for time monitoring: " << Tile::getDrawerString(ros2,
drawer)
531 <<
", channel = " << channel2 <<
", energy = " << energy2 <<
", time = " << time2);
533 chanTime[partition2].push_back(time2);
534 chanTimeDrawer[partition2].push_back(
drawer);
535 chanTimeChannel[partition2].push_back(channel2);
536 chanTimeDigitizer[partition2].push_back(
getDigitizer(channel2));
538 sampChanTime[partition2][
sample].push_back(time2);
544 overThrOccupEta[
sample].push_back(eta);
545 overThrOccupPhi[
sample].push_back(phi);
548 overThrOccupModule[partition1].push_back(
module);
549 overThrOccupChannel[partition1].push_back(channel1);
550 overThrOccupWeight[partition1].push_back(
weight);
553 overThrOccupGainModule[partition1][
gain1].push_back(
module);
554 overThrOccupGainChannel[partition1][
gain1].push_back(channel1);
555 overThrOccupGainWeight[partition1][
gain1].push_back(
weight);
558 if (energy1 > 30000.) {
559 overThr30GeVOccupModule[partition1].push_back(
module);
560 overThr30GeVOccupChannel[partition1].push_back(channel1);
562 if (energy1 > 300000.) {
563 overThr300GeVOccupModule[partition1].push_back(
module);
564 overThr300GeVOccupChannel[partition1].push_back(channel1);
570 overThrOccupModule[partition2].push_back(
module);
571 overThrOccupChannel[partition2].push_back(channel2);
572 overThrOccupWeight[partition2].push_back(1.0
F);
575 overThrOccupGainModule[partition2][
gain2].push_back(
module);
576 overThrOccupGainChannel[partition2][
gain2].push_back(channel2);
577 overThrOccupGainWeight[partition2][
gain2].push_back(1.0
F);
580 if (energy2 > 30000.) {
581 overThr30GeVOccupModule[partition2].push_back(
module);
582 overThr30GeVOccupChannel[partition2].push_back(channel2);
584 if (energy2 > 300000.) {
585 overThr300GeVOccupModule[partition2].push_back(
module);
586 overThr300GeVOccupChannel[partition2].push_back(channel2);
594 if ((
gain1 == 0 &&
gain2 == 1 && (energy1 < 2000 || energy2 < 10 || std::abs(energy1 / energy2) > 5))
595 || (
gain1 == 1 &&
gain2 == 0 && (energy2 < 2000 || energy1 < 10 || std::abs(energy2 / energy1) > 5))) {
597 fillEneAndTimeDiff =
false;
601 if (!(isBadChannel1 || isBadChannel2 || single_PMT)) {
604 energyBalModPartModule.push_back(
module);
605 energyBalModPartPartition.push_back(partition1);
611 timeBalModPartModule.push_back(
module);
612 timeBalModPartPartition.push_back(partition1);
615 energyBal[partition1].push_back(energyRatio);
616 energyBalModule[partition1].push_back(
module);
618 eneDiff[partition1].push_back(energyDiff);
619 eneDiffChannel[partition1].push_back(channel1);
620 eneDiffModule[partition1].push_back(
module);
622 eneDiff[partition2].push_back(-1.0 * energyDiff);
623 eneDiffChannel[partition2].push_back(channel2);
624 eneDiffModule[partition2].push_back(
module);
626 if (fillEneAndTimeDiff) {
627 sampEnergyDiff[partition1][
sample].push_back(energyDiff);
633 timeBal[partition1].push_back(timeDiff);
634 timeBalModule[partition1].push_back(
module);
636 if (fillEneAndTimeDiff) {
637 sampTimeDiff[partition1][
sample].push_back(timeDiff);
647 ++nCellsOverThreshold[partition1];
691 <<
" " << nCellsOverThreshold[
PART_LBA]
692 <<
" " << nCellsOverThreshold[
PART_LBC]
693 <<
" " << nCellsOverThreshold[
PART_EBA]
694 <<
" " << nCellsOverThreshold[
PART_EBC]
698 <<
" " << nBadChannelsOnFly[
PART_LBA]
699 <<
" " << nBadChannelsOnFly[
PART_LBC]
700 <<
" " << nBadChannelsOnFly[
PART_EBA]
701 <<
" " << nBadChannelsOnFly[
PART_EBC]
747 fill(
"TileBadCell", monPartition, monBadCells);
751 if (!energyBalModPartPartition.empty()) {
752 for (
int l1TriggerIdx : l1TriggersIndices) {
759 if (!timeBalModPartPartition.empty()) {
760 for (
int l1TriggerIdx : l1TriggersIndices) {
767 unsigned int bcid = eventInfo->
bcid();
800 for (
int l1TriggerIdx : l1TriggersIndices) {
810 for (
int l1TriggerIdx : l1TriggersIndices) {
819 for (
int l1TriggerIdx : l1TriggersIndices) {
827 for (
int l1TriggerIdx : l1TriggersIndices) {
835 for (
int l1TriggerIdx : l1TriggersIndices) {
844 for (
int l1TriggerIdx : l1TriggersIndices) {
849 for (
unsigned int gain = 0;
gain < Tile::MAX_GAIN; ++
gain) {
854 for (
int l1TriggerIdx : l1TriggersIndices) {
863 for (
int l1TriggerIdx : l1TriggersIndices) {
873 for (
int l1TriggerIdx : l1TriggersIndices) {
885 for (
int l1TriggerIdx : l1TriggersIndices) {
893 for (
int l1TriggerIdx : l1TriggersIndices) {
917 if (moduleCorr[
partition].numberOfPairs() > 0) {
923 for (
int l1TriggerIdx : l1TriggersIndices) {
928 for (
int l1TriggerIdx : l1TriggersIndices) {
938 for (
int l1TriggerIdx : l1TriggersIndices) {
950 for (
int l1TriggerIdx : l1TriggersIndices) {
959 for (
int l1TriggerIdx : l1TriggersIndices) {
970 return StatusCode::SUCCESS;
981 std::vector<int> drawers[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
982 std::vector<int>
channels[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
984 for (; adc_it != adc_end; ++adc_it) {
985 HWIdentifier adc_id(*adc_it);
1001 for (
unsigned int gain = 0;
gain < Tile::MAX_GAIN; ++
gain) {
1015 const std::vector<int>& l1TriggersIndices)
const {
1017 std::vector<float> timeDifference;
1021 for (
int i = 1;
i <
size; ++
i) {
1024 float z1 =
cells[
i]->z();
1025 float time1 =
cells[
i]->time();
1027 for (
int j = 0; j <
i; ++j) {
1030 float z2 =
cells[j]->z();
1031 float time2 =
cells[j]->time();
1033 float timeMeasured = (
y2 >
y1) ? time1 - time2 : time2 - time1;
1036 float timeExpected =
distance / 300.;
1038 timeDifference.push_back(timeExpected - timeMeasured);
1043 for (
int l1TriggerIdx : l1TriggersIndices) {
1052 static const int channel2digitizer[48] = {8, 8, 8, 8, 8, 8,
1061 return channel2digitizer[
channel];