51 Tile::MAX_ROS - 1, Tile::MAX_GAIN);
54 Tile::MAX_ROS, nL1Triggers);
57 Tile::MAX_ROS, nL1Triggers);
60 Tile::MAX_ROS - 1, nL1Triggers);
63 Tile::MAX_ROS - 1, nL1Triggers);
66 Tile::MAX_ROS - 1, nL1Triggers);
69 Tile::MAX_ROS - 1, nL1Triggers);
72 Tile::MAX_ROS - 1, nL1Triggers);
75 Tile::MAX_ROS - 1, nL1Triggers);
78 Tile::MAX_ROS - 1, nL1Triggers);
81 Tile::MAX_ROS - 1, Tile::MAX_GAIN, nL1Triggers);
84 Tile::MAX_ROS - 1, Tile::MAX_GAIN, nL1Triggers);
88 Tile::MAX_DRAWER, 4 );
92 Tile::MAX_ROS, nL1Triggers);
95 Tile::MAX_ROS, nL1Triggers);
105 Tile::MAX_ROS - 1,
MAX_SAMP, nL1Triggers);
109 Tile::MAX_ROS - 1,
MAX_SAMP, nL1Triggers);
112 Tile::MAX_ROS - 1,
MAX_SAMP, nL1Triggers);
138 <<
" LB = " << eventInfo->lumiBlock()
139 <<
" Evt = " << eventInfo->eventNumber()
140 <<
" BCID = " << eventInfo->bcid()
141 <<
" lvl1 = 0x" << std::hex << eventInfo->level1TriggerType() << std::dec;
143 const std::vector<xAOD::EventInfo::StreamTag>& eventStreamTags = eventInfo->streamTags();
144 if (!eventStreamTags.empty()) {
146 for (
const auto& eventStreamTag : eventStreamTags) {
147 msg(
MSG::DEBUG) <<
" " << eventStreamTag.name() <<
"/" << eventStreamTag.type();
155 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};
156 static const int gapScintIndex[6] = {0, 1, 2, 2, 3, 3};
158 std::vector<const CaloCell*> muonCells;
160 std::vector<int> energyBalModPartModule;
161 std::vector<int> energyBalModPartPartition;
163 std::vector<int> timeBalModPartModule;
164 std::vector<int> timeBalModPartPartition;
171 int nCellsOverThreshold[
MAX_PART] = {0};
174 int nBadChannelsOnFly[
MAX_PART] = {0};
177 unsigned int nMaskedChannelsDueDQ[
MAX_PART] = { 0 };
180 unsigned int nMaskedCellsDueDQ[
MAX_PART] = { 0 };
182 std::vector<int> negOccupModule[Tile::MAX_ROS - 1];
183 std::vector<int> negOccupChannel[Tile::MAX_ROS - 1];
185 std::vector<float> timeBal[Tile::MAX_ROS - 1];
186 std::vector<int> timeBalModule[Tile::MAX_ROS - 1];
188 std::vector<float> energyBal[Tile::MAX_ROS - 1];
189 std::vector<int> energyBalModule[Tile::MAX_ROS - 1];
191 std::vector<int> detailOccupModule[Tile::MAX_ROS - 1];
192 std::vector<int> detailOccupChannel[Tile::MAX_ROS - 1];
193 std::vector<float> detailOccupEnergies[Tile::MAX_ROS - 1];
195 std::vector<int> detailOccupGainModule[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
196 std::vector<int> detailOccupGainChannel[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
197 std::vector<float> detailOccupGainEnergies[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
199 std::vector<int> overThrOccupModule[Tile::MAX_ROS - 1];
200 std::vector<int> overThrOccupChannel[Tile::MAX_ROS - 1];
201 std::vector<float> overThrOccupWeight[Tile::MAX_ROS - 1];
203 std::vector<int> overThrOccupGainModule[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
204 std::vector<int> overThrOccupGainChannel[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
205 std::vector<float> overThrOccupGainWeight[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
207 std::vector<int> overThr30GeVOccupModule[Tile::MAX_ROS - 1];
208 std::vector<int> overThr30GeVOccupChannel[Tile::MAX_ROS - 1];
210 std::vector<int> overThr300GeVOccupModule[Tile::MAX_ROS - 1];
211 std::vector<int> overThr300GeVOccupChannel[Tile::MAX_ROS - 1];
213 std::vector<int> eneDiff[Tile::MAX_ROS - 1];
214 std::vector<int> eneDiffChannel[Tile::MAX_ROS - 1];
215 std::vector<int> eneDiffModule[Tile::MAX_ROS - 1];
217 std::vector<int> maskedOnFlyDrawers[Tile::MAX_ROS - 1];
218 std::vector<int> maskedOnFlyChannel[Tile::MAX_ROS - 1];
220 std::vector<int> chanTime[Tile::MAX_ROS - 1];
221 std::vector<int> chanTimeDrawer[Tile::MAX_ROS - 1];
222 std::vector<int> chanTimeChannel[Tile::MAX_ROS - 1];
223 std::vector<int> chanTimeDigitizer[Tile::MAX_ROS - 1];
225 int nChannelsInPartition = 2880;
227 if (
partition > 1) nChannelsInPartition = 2048;
228 detailOccupModule[
partition].reserve(nChannelsInPartition);
229 detailOccupChannel[
partition].reserve(nChannelsInPartition);
230 detailOccupEnergies[
partition].reserve(nChannelsInPartition);
233 std::vector<float> occupEta[
SAMP_ALL];
234 std::vector<float> occupPhi[
SAMP_ALL];
235 std::vector<float> occupEnergy[
SAMP_ALL];
237 std::vector<float> overThrOccupEta[
SAMP_ALL];
238 std::vector<float> overThrOccupPhi[
SAMP_ALL];
240 std::vector<float> sampChanTime[Tile::MAX_ROS - 1][
SAMP_ALL];
241 std::vector<float> sampEnergyDiff[Tile::MAX_ROS - 1][
SAMP_ALL];
242 std::vector<float> sampTimeDiff[Tile::MAX_ROS - 1][
SAMP_ALL];
254 bool isCollision =
true;
268 if (tile_cell == 0)
continue;
280 bool isMaskedChannel1 =
false;
281 bool isMaskedAdc1 =
false;
282 bool isMaskedAdc2 =
false;
289 IdentifierHash hash1 = caloDDE->
onl1();
295 partition1 = ros1 - 1;
298 IdentifierHash hash2 = caloDDE->
onl2();
304 partition2 = ros2 - 1;
319 bool single_PMT = single_PMT_C10 || single_PMT_scin;
326 bool isBadChannel1 = tile_cell->
badch1();
327 bool isBadChannel2 = tile_cell->
badch2();
329 int isCellGood = !tile_cell->
badcell();
336 double time =
cell->time();
337 double eta =
cell->eta();
338 double phi =
cell->phi();
339 double energy1 = tile_cell->
ene1();
340 double energy2 = tile_cell->
ene2();
341 double energyDiff = (single_PMT) ? 0.0 : tile_cell->
eneDiff();
342 double energyRatio = (
energy != 0.0) ? energyDiff/
energy : 0.0;
343 double time1 = tile_cell->
time1();
344 double time2 = tile_cell->
time2();
345 double timeDiff = (single_PMT) ? 0.0 : 2. * tile_cell->
timeDiff();
348 if (single_PMT_scin) {
350 if (tower > 9 && tower < 16) {
351 weight = energyWeight[tower - 10];
355 int gapScintIdx = gapScintIndex[tower - 10];
356 unsigned int partition = (ros1 > 0) ? ros1 - 3 : ros2 - 3;
376 <<
" ch1: " << channel1
377 <<
" gain1: " <<
gain1
378 <<
" qual1: " << (
int)tile_cell->
qual1()
379 <<
" qbit1: " << (
int)tile_cell->
qbit1()
384 <<
" ch2: " << channel2
385 <<
" gain2: " <<
gain2
386 <<
" qual2: " << (
int)tile_cell->
qual2()
387 <<
" qbit2: " << (
int)tile_cell->
qbit2()
388 << ((ros1 != ros2) ?
" ros1 != ros2" :
" ") <<
endmsg;
391 <<
" bad1: " << isBadChannel1
392 <<
" bad2: " << isBadChannel2
393 << ((single_PMT_scin && isBadChannel1 && !isMaskedChannel1)
394 ?
" NEW BAD E-cell" :
" ") <<
endmsg ;
397 <<
" E-cell: " << ((single_PMT_scin) ?
"true" :
"false")
398 <<
" specC10: " << ((single_PMT_C10) ?
"true" :
"false") <<
endmsg;
401 <<
" ediff= " << energyDiff
402 <<
" eratio= " << energyRatio
405 msg(
MSG::VERBOSE) <<
"Time= " << time <<
" = (" << time1 <<
" + " << time2 <<
")/2 "
406 <<
"tdiff= " << timeDiff
407 <<
"\t time[ns]= " << time/
ns <<
endmsg ;
417 int quality1 = (
int)tile_cell->
qual1();
418 int quality2 = (
int)tile_cell->
qual2();
419 if (isBadChannel1 != isBadChannel2 && quality1 != quality2
420 && quality1 < 255 && quality2 < 255) {
421 if (isBadChannel1 && isOkChannel1) dbGain1 = 1 -
gain1;
422 if (isBadChannel2 && isOkChannel2) dbGain2 = 1 -
gain2;
427 isMaskedAdc1 = badChannels->
getAdcStatus(adc1_id).isBad();
432 isMaskedAdc2 = badChannels->
getAdcStatus(adc2_id).isBad();
435 bool channel1MaskedDueDQ(
false);
436 if (isBadChannel1 && isOkChannel1 && !(single_PMT_C10 && channel1 == 4)) {
438 ++nBadChannelsOnFly[partition1];
439 maskedOnFlyDrawers[partition1].push_back(
drawer);
440 maskedOnFlyChannel[partition1].push_back(channel1);
443 channel1MaskedDueDQ =
true;
444 ++nMaskedChannelsDueDQ[partition1];
449 bool channel2MaskedDueDQ(
false);
450 if (isBadChannel2 && isOkChannel2 && !(single_PMT_C10 && channel2 == 4)) {
452 ++nBadChannelsOnFly[partition2];
453 maskedOnFlyDrawers[partition2].push_back(
drawer);
454 maskedOnFlyChannel[partition2].push_back(channel2);
457 channel2MaskedDueDQ =
true;
458 ++nMaskedChannelsDueDQ[partition2];
468 muonCells.push_back(
cell);
471 occupEta[
sample].push_back(eta);
472 occupPhi[
sample].push_back(phi);
476 detailOccupModule[partition1].push_back(
module);
477 detailOccupChannel[partition1].push_back(channel1);
478 detailOccupEnergies[partition1].push_back(energy1 *
weight);
480 detailOccupGainModule[partition1][
gain1].push_back(
module);
481 detailOccupGainChannel[partition1][
gain1].push_back(channel1);
482 detailOccupGainEnergies[partition1][
gain1].push_back(energy1 *
weight);
486 detailOccupModule[partition2].push_back(
module);
487 detailOccupChannel[partition2].push_back(channel2);
488 detailOccupEnergies[partition2].push_back(energy2);
490 detailOccupGainModule[partition2][
gain2].push_back(
module);
491 detailOccupGainChannel[partition2][
gain2].push_back(channel2);
492 detailOccupGainEnergies[partition2][
gain2].push_back(energy2);
496 ++nBadCells[partition1];
497 if (channel1MaskedDueDQ || channel2MaskedDueDQ) {
498 ++nMaskedCellsDueDQ[partition1];
504 negOccupModule[partition1].push_back(
module);
505 negOccupChannel[partition1].push_back(channel1);
509 negOccupModule[partition2].push_back(
module);
510 negOccupChannel[partition2].push_back(channel2);
518 if ((
gain1 == 0) && (energy1 < 1000.)) {
519 ATH_MSG_DEBUG(
"Low energy in LG for time monitoring: " << Tile::getDrawerString(ros1,
drawer)
520 <<
", channel = " << channel1 <<
", energy = " << energy1 <<
", time = " << time1);
522 chanTime[partition1].push_back(time1);
523 chanTimeDrawer[partition1].push_back(
drawer);
524 chanTimeChannel[partition1].push_back(channel1);
525 chanTimeDigitizer[partition1].push_back(
getDigitizer(channel1));
527 sampChanTime[partition1][
sample].push_back(time1);
533 if ((
gain2 == 0) && (energy2 < 1000.)) {
534 ATH_MSG_DEBUG(
"Low energy in LG for time monitoring: " << Tile::getDrawerString(ros2,
drawer)
535 <<
", channel = " << channel2 <<
", energy = " << energy2 <<
", time = " << time2);
537 chanTime[partition2].push_back(time2);
538 chanTimeDrawer[partition2].push_back(
drawer);
539 chanTimeChannel[partition2].push_back(channel2);
540 chanTimeDigitizer[partition2].push_back(
getDigitizer(channel2));
542 sampChanTime[partition2][
sample].push_back(time2);
548 overThrOccupEta[
sample].push_back(eta);
549 overThrOccupPhi[
sample].push_back(phi);
552 overThrOccupModule[partition1].push_back(
module);
553 overThrOccupChannel[partition1].push_back(channel1);
554 overThrOccupWeight[partition1].push_back(
weight);
557 overThrOccupGainModule[partition1][
gain1].push_back(
module);
558 overThrOccupGainChannel[partition1][
gain1].push_back(channel1);
559 overThrOccupGainWeight[partition1][
gain1].push_back(
weight);
562 if (energy1 > 30000.) {
563 overThr30GeVOccupModule[partition1].push_back(
module);
564 overThr30GeVOccupChannel[partition1].push_back(channel1);
566 if (energy1 > 300000.) {
567 overThr300GeVOccupModule[partition1].push_back(
module);
568 overThr300GeVOccupChannel[partition1].push_back(channel1);
574 overThrOccupModule[partition2].push_back(
module);
575 overThrOccupChannel[partition2].push_back(channel2);
576 overThrOccupWeight[partition2].push_back(1.0
F);
579 overThrOccupGainModule[partition2][
gain2].push_back(
module);
580 overThrOccupGainChannel[partition2][
gain2].push_back(channel2);
581 overThrOccupGainWeight[partition2][
gain2].push_back(1.0
F);
584 if (energy2 > 30000.) {
585 overThr30GeVOccupModule[partition2].push_back(
module);
586 overThr30GeVOccupChannel[partition2].push_back(channel2);
588 if (energy2 > 300000.) {
589 overThr300GeVOccupModule[partition2].push_back(
module);
590 overThr300GeVOccupChannel[partition2].push_back(channel2);
598 if ((
gain1 == 0 &&
gain2 == 1 && (energy1 < 2000 || energy2 < 10 || std::abs(energy1 / energy2) > 5))
599 || (
gain1 == 1 &&
gain2 == 0 && (energy2 < 2000 || energy1 < 10 || std::abs(energy2 / energy1) > 5))) {
601 fillEneAndTimeDiff =
false;
605 if (!(isBadChannel1 || isBadChannel2 || single_PMT)) {
608 energyBalModPartModule.push_back(
module);
609 energyBalModPartPartition.push_back(partition1);
615 timeBalModPartModule.push_back(
module);
616 timeBalModPartPartition.push_back(partition1);
619 energyBal[partition1].push_back(energyRatio);
620 energyBalModule[partition1].push_back(
module);
622 eneDiff[partition1].push_back(energyDiff);
623 eneDiffChannel[partition1].push_back(channel1);
624 eneDiffModule[partition1].push_back(
module);
626 eneDiff[partition2].push_back(-1.0 * energyDiff);
627 eneDiffChannel[partition2].push_back(channel2);
628 eneDiffModule[partition2].push_back(
module);
630 if (fillEneAndTimeDiff) {
631 sampEnergyDiff[partition1][
sample].push_back(energyDiff);
637 timeBal[partition1].push_back(timeDiff);
638 timeBalModule[partition1].push_back(
module);
640 if (fillEneAndTimeDiff) {
641 sampTimeDiff[partition1][
sample].push_back(timeDiff);
651 ++nCellsOverThreshold[partition1];
695 <<
" " << nCellsOverThreshold[
PART_LBA]
696 <<
" " << nCellsOverThreshold[
PART_LBC]
697 <<
" " << nCellsOverThreshold[
PART_EBA]
698 <<
" " << nCellsOverThreshold[
PART_EBC]
702 <<
" " << nBadChannelsOnFly[
PART_LBA]
703 <<
" " << nBadChannelsOnFly[
PART_LBC]
704 <<
" " << nBadChannelsOnFly[
PART_EBA]
705 <<
" " << nBadChannelsOnFly[
PART_EBC]
751 fill(
"TileBadCell", monPartition, monBadCells);
755 if (!energyBalModPartPartition.empty()) {
756 for (
int l1TriggerIdx : l1TriggersIndices) {
763 if (!timeBalModPartPartition.empty()) {
764 for (
int l1TriggerIdx : l1TriggersIndices) {
771 unsigned int bcid = eventInfo->bcid();
775 if (!maskedOnFlyDrawers[
partition].empty()) {
781 if (!negOccupModule[
partition].empty()) {
787 if (!energyBalModule[
partition].empty()) {
799 if (!chanTimeDrawer[
partition].empty()) {
804 for (
int l1TriggerIdx : l1TriggersIndices) {
810 if (!detailOccupModule[
partition].empty()) {
814 for (
int l1TriggerIdx : l1TriggersIndices) {
819 if (!overThrOccupModule[
partition].empty()) {
823 for (
int l1TriggerIdx : l1TriggersIndices) {
828 if (!overThr30GeVOccupModule[
partition].empty()) {
831 for (
int l1TriggerIdx : l1TriggersIndices) {
836 if (!overThr300GeVOccupModule[
partition].empty()) {
839 for (
int l1TriggerIdx : l1TriggersIndices) {
848 for (
int l1TriggerIdx : l1TriggersIndices) {
853 for (
unsigned int gain = 0;
gain < Tile::MAX_GAIN; ++
gain) {
858 for (
int l1TriggerIdx : l1TriggersIndices) {
867 for (
int l1TriggerIdx : l1TriggersIndices) {
877 for (
int l1TriggerIdx : l1TriggersIndices) {
889 for (
int l1TriggerIdx : l1TriggersIndices) {
897 for (
int l1TriggerIdx : l1TriggersIndices) {
921 if (moduleCorr[
partition].numberOfPairs() > 0) {
927 for (
int l1TriggerIdx : l1TriggersIndices) {
932 for (
int l1TriggerIdx : l1TriggersIndices) {
942 for (
int l1TriggerIdx : l1TriggersIndices) {
950 if (!occupEnergy[
sample].empty()) {
954 for (
int l1TriggerIdx : l1TriggersIndices) {
960 if (!overThrOccupEta[
sample].empty()) {
963 for (
int l1TriggerIdx : l1TriggersIndices) {
974 return StatusCode::SUCCESS;
985 std::vector<int> drawers[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
986 std::vector<int>
channels[Tile::MAX_ROS - 1][Tile::MAX_GAIN];
988 for (; adc_it != adc_end; ++adc_it) {
989 HWIdentifier adc_id(*adc_it);
1005 for (
unsigned int gain = 0;
gain < Tile::MAX_GAIN; ++
gain) {
1019 const std::vector<int>& l1TriggersIndices)
const {
1021 std::vector<float> timeDifference;
1025 for (
int i = 1;
i <
size; ++
i) {
1028 float z1 =
cells[
i]->z();
1029 float time1 =
cells[
i]->time();
1031 for (
int j = 0; j <
i; ++j) {
1034 float z2 =
cells[j]->z();
1035 float time2 =
cells[j]->time();
1037 float timeMeasured = (
y2 >
y1) ? time1 - time2 : time2 - time1;
1040 float timeExpected =
distance / 300.;
1042 timeDifference.push_back(timeExpected - timeMeasured);
1047 for (
int l1TriggerIdx : l1TriggersIndices) {
1056 static const int channel2digitizer[48] = {8, 8, 8, 8, 8, 8,
1065 return channel2digitizer[
channel];