598 <<
"ERROR in CTPPSDiamondDQMSource::analyze > some of the required inputs are not valid. Skipping this "
600 <<
" diamondVFATStatus.isValid = " << diamondVFATStatus.
isValid() <<
"\n"
601 <<
" pixelTracks.isValid = " <<
pixelTracks.isValid() <<
"\n"
602 <<
" diamondDigis.isValid = " << diamondDigis.
isValid() <<
"\n"
603 <<
" fedInfo.isValid = " << fedInfo.
isValid() <<
"\n"
604 <<
" diamondRecHits.isValid = " << diamondRecHits.
isValid() <<
"\n"
605 <<
" diamondLocalTracks.isValid = " << diamondLocalTracks.
isValid();
620 for (
const auto& digis : *diamondDigis) {
624 for (
const auto& digi : digis) {
626 detId_pot.setChannel(0);
632 if (digi.leadingEdge() != 0 || digi.trailingEdge() != 0) {
634 if (digi.leadingEdge() != 0) {
637 if (digi.leadingEdge() != 0 && digi.trailingEdge() == 0) {
638 ++(
potPlots_[detId_pot].LeadingOnlyCounter);
641 if (digi.leadingEdge() == 0 && digi.trailingEdge() != 0) {
642 ++(
potPlots_[detId_pot].TrailingOnlyCounter);
645 if (digi.leadingEdge() != 0 && digi.trailingEdge() != 0) {
646 ++(
potPlots_[detId_pot].CompleteCounter);
654 if (detId.channel() == 6 || detId.channel() == 7)
656 int verticalIndex = 2 * detId.plane() + (detId.channel() - 6);
657 for (
unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex)
658 if (hptdcErrors.
errorId(hptdcErrorIndex - 1))
659 potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(hptdcErrorIndex, verticalIndex);
661 if (digi.multipleHit())
667 for (
const auto& vfat_status : *diamondVFATStatus) {
671 detId_pot.setChannel(0);
672 for (
const auto&
status : vfat_status) {
681 for (
const auto& optorx : *fedInfo) {
683 potPlots_[detId_pot].ECCheck->Fill((
int)((optorx.lv1() & 0xFF) - ((
unsigned int)
status.ec() & 0xFF)) & 0xFF);
685 (static_cast<uint8_t>((optorx.lv1() & 0xFF) -
status.ec()) < 128))
688 if (detId.channel() == 6 || detId.channel() == 7)
689 potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(16, 2 * detId.plane() + (detId.channel() - 6));
692 <<
"FED " <<
CTPPS_FED_ID_56 <<
": ECError at EV: 0x" << std::hex << optorx.lv1() <<
"\t\tVFAT EC: 0x"
693 << static_cast<unsigned int>(
status.ec()) <<
"\twith ID: " <<
std::dec << detId
697 potPlots_[detId_pot].ECCheck->Fill((
int)((optorx.lv1() & 0xFF) -
status.ec()) & 0xFF);
699 (static_cast<uint8_t>((optorx.lv1() & 0xFF) -
status.ec()) < 128))
702 if (detId.channel() == 6 || detId.channel() == 7)
703 potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(16, 2 * detId.plane() + (detId.channel() - 6));
706 <<
"FED " <<
CTPPS_FED_ID_45 <<
": ECError at EV: 0x" << std::hex << optorx.lv1() <<
"\t\tVFAT EC: 0x"
707 << static_cast<unsigned int>(
status.ec()) <<
"\twith ID: " <<
std::dec << detId
716 std::unordered_map<unsigned int, std::set<unsigned int>> planes;
717 std::unordered_map<unsigned int, std::set<unsigned int>> planes_inclusive;
719 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
720 for (
const auto&
rechits : *diamondRecHits) {
723 detId_pot.setChannel(0);
726 for (
const auto& rechit :
rechits) {
727 planes_inclusive[detId_pot].insert(detId.plane());
731 planes[detId_pot].
insert(detId.plane());
736 float UFSDShift = 0.0;
737 if (rechit.yWidth() < 3)
741 TH2F* hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
742 TAxis* hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
745 for (
int i = 0;
i < numOfBins; ++
i) {
746 hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin +
i));
749 hitHistoTmp = lumiCache->hitDistribution2dMap[detId_pot].get();
750 hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
753 for (
int i = 0;
i < numOfBins; ++
i) {
754 hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin +
i));
758 if (rechit.toT() != 0) {
760 potPlots_[detId_pot].leadingEdgeCumulative_both->Fill(rechit.time() + 25 * rechit.ootIndex());
761 potPlots_[detId_pot].timeOverThresholdCumulativePot->Fill(rechit.toT());
763 TH2F* hitHistoOOTTmp =
potPlots_[detId_pot].hitDistribution2dOOT->getTH2F();
764 TAxis* hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
767 for (
int i = 0;
i < numOfBins; ++
i) {
768 hitHistoOOTTmp->Fill(detId.plane() + 0.25 * rechit.ootIndex(),
769 hitHistoOOTTmpYAxis->GetBinCenter(startBin +
i));
774 TH2F* hitHistoOOTTmp =
potPlots_[detId_pot].hitDistribution2dOOT_le->getTH2F();
775 TAxis* hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
778 for (
int i = 0;
i < numOfBins; ++
i) {
779 hitHistoOOTTmp->Fill(detId.plane() + 0.25 * rechit.ootIndex(),
780 hitHistoOOTTmpYAxis->GetBinCenter(startBin +
i));
785 potPlots_[detId_pot].activity_per_bx.count(rechit.ootIndex()) > 0)
786 potPlots_[detId_pot].activity_per_bx.at(rechit.ootIndex())->
Fill(
event.bunchCrossing());
791 plt.second.activePlanes->Fill(planes[plt.first].size());
792 plt.second.activePlanesInclusive->Fill(planes_inclusive[plt.first].size());
796 for (
const auto&
tracks : *diamondLocalTracks) {
799 detId_pot.setChannel(0);
803 if (!
track.isValid())
812 TH2F* trackHistoOOTTmp =
potPlots_[detId_pot].trackDistributionOOT->getTH2F();
813 TAxis* trackHistoOOTTmpYAxis = trackHistoOOTTmp->GetYaxis();
816 for (
int i = 0;
i < numOfBins; ++
i) {
817 trackHistoOOTTmp->Fill(
track.ootIndex(), trackHistoOOTTmpYAxis->GetBinCenter(startBin +
i));
821 TH1F* trackHistoInTimeTmp =
potPlots_[detId_pot].trackDistribution->getTH1F();
824 for (
int i = 0;
i < numOfBins; ++
i) {
825 trackHistoInTimeTmp->Fill(trackHistoInTimeTmp->GetBinCenter(startBin +
i));
832 for (
const auto&
tracks : *diamondLocalTracks) {
835 detId_pot.setChannel(0);
839 std::set<int> planesInTrackSet;
840 for (
const auto& vec : *diamondRecHits) {
842 if (detid.arm() != detId_pot.arm())
845 for (
const auto&
hit : vec) {
849 planesInTrackSet.insert(detid.plane());
854 if (numOfHits > 0 && numOfHits <= 10 && planesInTrackSet.size() > 2) {
855 for (
int plane = 0; plane < 4; ++plane) {
856 for (
int channel = 0; channel < 12; ++channel) {
857 int map_index = plane * 100 + channel;
858 if (
potPlots_[detId_pot].effDoublecountingChMap.find(map_index) ==
859 potPlots_[detId_pot].effDoublecountingChMap.end()) {
860 potPlots_[detId_pot].effTriplecountingChMap[map_index] = 0;
861 potPlots_[detId_pot].effDoublecountingChMap[map_index] = 0;
866 ++(
potPlots_[detId_pot].effDoublecountingChMap[map_index]);
867 for (
const auto&
rechits : *diamondRecHits) {
869 if (detId_hit == detId) {
870 for (
const auto& rechit :
rechits) {
871 if (
track.containsHit(rechit, 1)) {
873 ++(
potPlots_[detId_pot].effTriplecountingChMap[map_index]);
886 for (
const auto&
rechits : *diamondRecHits) {
889 detId_pot.setChannel(0);
891 for (
const auto& rechit :
rechits) {
894 if (rechit.toT() == 0)
907 for (
const auto& lt : ds) {
908 if (lt.isValid() && pixId.arm() == detId_pot.arm()) {
910 potPlots_[detId_pot].pixelTomographyAll.count(rechit.ootIndex()) > 0 &&
913 .pixelTomographyAll.at(rechit.ootIndex())
951 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
952 for (
const auto& digis : *diamondDigis) {
955 for (
const auto& digi : digis) {
962 if (digi.leadingEdge() != 0) {
963 planePlots_[detId_plane].digiProfileCumulativePerPlane->Fill(detId.channel());
964 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
965 channelsPerPlane[detId_plane]++;
967 channelsPerPlane[detId_plane] = 0;
972 for (
const auto& plt : channelsPerPlane) {
973 planePlots_[plt.first].hit_multiplicity->Fill(plt.second);
977 for (
const auto&
rechits : *diamondRecHits) {
980 for (
const auto& rechit :
rechits) {
983 if (rechit.toT() == 0)
987 TH1F* hitHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
990 for (
int i = 0;
i < numOfBins; ++
i) {
991 hitHistoTmp->Fill(hitHistoTmp->GetBinCenter(startBin +
i));
1005 for (
const auto& lt : ds) {
1011 std::set<CTPPSDiamondDetId> planesWitHits_set;
1012 for (
const auto&
rechits : *diamondRecHits) {
1015 for (
const auto& rechit :
rechits) {
1023 planePlots_[detId_plane].pixelTomography_far->Fill(
1026 planesWitHits_set.insert(detId_plane);
1031 for (
auto& planeId : planesWitHits_set)
1042 for (
const auto& digis : *diamondDigis) {
1044 for (
const auto& digi : digis) {
1050 for (
unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex)
1051 if (hptdcErrors.
errorId(hptdcErrorIndex - 1))
1053 if (digi.multipleHit())
1057 if (digi.leadingEdge() != 0 || digi.trailingEdge() != 0) {
1059 if (digi.leadingEdge() != 0 && digi.trailingEdge() == 0) {
1063 if (digi.leadingEdge() == 0 && digi.trailingEdge() != 0) {
1067 if (digi.leadingEdge() != 0 && digi.trailingEdge() != 0) {
1079 for (
const auto&
rechits : *diamondRecHits) {
1081 for (
const auto& rechit :
rechits) {
1086 channelPlots_[detId].leadingEdgeCumulative_both->Fill(rechit.time() + 25 * rechit.ootIndex());
1087 channelPlots_[detId].TimeOverThresholdCumulativePerChannel->Fill(rechit.toT());
1089 ++(lumiCache->hitsCounterMap[detId]);
1093 channelPlots_[detId].activity_per_bx.count(rechit.ootIndex()) > 0)
1099 for (
const auto&
rechits : *diamondRecHits) {
1101 for (
const auto& rechit :
rechits) {
1117 for (
const auto& lt : ds) {