599 <<
"ERROR in CTPPSDiamondDQMSource::analyze > some of the required inputs are not valid. Skipping this "
601 <<
" diamondVFATStatus.isValid = " << diamondVFATStatus.
isValid() <<
"\n"
602 <<
" pixelTracks.isValid = " <<
pixelTracks.isValid() <<
"\n"
603 <<
" diamondDigis.isValid = " << diamondDigis.
isValid() <<
"\n"
604 <<
" fedInfo.isValid = " << fedInfo.
isValid() <<
"\n"
605 <<
" diamondRecHits.isValid = " << diamondRecHits.
isValid() <<
"\n"
606 <<
" diamondLocalTracks.isValid = " << diamondLocalTracks.
isValid();
621 for (
const auto& digis : *diamondDigis) {
625 for (
const auto& digi : digis) {
627 detId_pot.setChannel(0);
633 if (digi.leadingEdge() != 0 || digi.trailingEdge() != 0) {
635 if (digi.leadingEdge() != 0) {
638 if (digi.leadingEdge() != 0 && digi.trailingEdge() == 0) {
639 ++(
potPlots_[detId_pot].LeadingOnlyCounter);
642 if (digi.leadingEdge() == 0 && digi.trailingEdge() != 0) {
643 ++(
potPlots_[detId_pot].TrailingOnlyCounter);
646 if (digi.leadingEdge() != 0 && digi.trailingEdge() != 0) {
647 ++(
potPlots_[detId_pot].CompleteCounter);
655 if (detId.channel() == 6 || detId.channel() == 7)
657 int verticalIndex = 2 * detId.plane() + (detId.channel() - 6);
658 for (
unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex)
659 if (hptdcErrors.
errorId(hptdcErrorIndex - 1))
660 potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(hptdcErrorIndex, verticalIndex);
662 if (digi.multipleHit())
668 for (
const auto& vfat_status : *diamondVFATStatus) {
672 detId_pot.setChannel(0);
673 for (
const auto&
status : vfat_status) {
682 for (
const auto& optorx : *fedInfo) {
684 potPlots_[detId_pot].ECCheck->Fill((
int)((optorx.lv1() & 0xFF) - ((
unsigned int)
status.ec() & 0xFF)) & 0xFF);
686 (static_cast<uint8_t>((optorx.lv1() & 0xFF) -
status.ec()) < 128))
689 if (detId.channel() == 6 || detId.channel() == 7)
690 potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(16, 2 * detId.plane() + (detId.channel() - 6));
693 <<
"FED " <<
CTPPS_FED_ID_56 <<
": ECError at EV: 0x" << std::hex << optorx.lv1() <<
"\t\tVFAT EC: 0x"
694 << static_cast<unsigned int>(
status.ec()) <<
"\twith ID: " <<
std::dec << detId
698 potPlots_[detId_pot].ECCheck->Fill((
int)((optorx.lv1() & 0xFF) -
status.ec()) & 0xFF);
700 (static_cast<uint8_t>((optorx.lv1() & 0xFF) -
status.ec()) < 128))
703 if (detId.channel() == 6 || detId.channel() == 7)
704 potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(16, 2 * detId.plane() + (detId.channel() - 6));
707 <<
"FED " <<
CTPPS_FED_ID_45 <<
": ECError at EV: 0x" << std::hex << optorx.lv1() <<
"\t\tVFAT EC: 0x"
708 << static_cast<unsigned int>(
status.ec()) <<
"\twith ID: " <<
std::dec << detId
717 std::unordered_map<unsigned int, std::set<unsigned int>> planes;
718 std::unordered_map<unsigned int, std::set<unsigned int>> planes_inclusive;
720 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
721 for (
const auto&
rechits : *diamondRecHits) {
724 detId_pot.setChannel(0);
727 for (
const auto& rechit :
rechits) {
728 planes_inclusive[detId_pot].insert(detId.plane());
732 planes[detId_pot].
insert(detId.plane());
737 float UFSDShift = 0.0;
738 if (rechit.yWidth() < 3)
742 TH2F* hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
743 TAxis* hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
746 for (
int i = 0;
i < numOfBins; ++
i) {
747 hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin +
i));
750 hitHistoTmp = lumiCache->hitDistribution2dMap[detId_pot].get();
751 hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
754 for (
int i = 0;
i < numOfBins; ++
i) {
755 hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin +
i));
759 if (rechit.toT() != 0) {
761 potPlots_[detId_pot].leadingEdgeCumulative_both->Fill(rechit.time() + 25 * rechit.ootIndex());
762 potPlots_[detId_pot].timeOverThresholdCumulativePot->Fill(rechit.toT());
764 TH2F* hitHistoOOTTmp =
potPlots_[detId_pot].hitDistribution2dOOT->getTH2F();
765 TAxis* hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
768 for (
int i = 0;
i < numOfBins; ++
i) {
769 hitHistoOOTTmp->Fill(detId.plane() + 0.25 * rechit.ootIndex(),
770 hitHistoOOTTmpYAxis->GetBinCenter(startBin +
i));
775 TH2F* hitHistoOOTTmp =
potPlots_[detId_pot].hitDistribution2dOOT_le->getTH2F();
776 TAxis* hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
779 for (
int i = 0;
i < numOfBins; ++
i) {
780 hitHistoOOTTmp->Fill(detId.plane() + 0.25 * rechit.ootIndex(),
781 hitHistoOOTTmpYAxis->GetBinCenter(startBin +
i));
786 potPlots_[detId_pot].activity_per_bx.count(rechit.ootIndex()) > 0)
787 potPlots_[detId_pot].activity_per_bx.at(rechit.ootIndex())->
Fill(
event.bunchCrossing());
792 plt.second.activePlanes->Fill(planes[plt.first].size());
793 plt.second.activePlanesInclusive->Fill(planes_inclusive[plt.first].size());
797 for (
const auto&
tracks : *diamondLocalTracks) {
800 detId_pot.setChannel(0);
804 if (!
track.isValid())
813 TH2F* trackHistoOOTTmp =
potPlots_[detId_pot].trackDistributionOOT->getTH2F();
814 TAxis* trackHistoOOTTmpYAxis = trackHistoOOTTmp->GetYaxis();
817 for (
int i = 0;
i < numOfBins; ++
i) {
818 trackHistoOOTTmp->Fill(
track.ootIndex(), trackHistoOOTTmpYAxis->GetBinCenter(startBin +
i));
822 TH1F* trackHistoInTimeTmp =
potPlots_[detId_pot].trackDistribution->getTH1F();
825 for (
int i = 0;
i < numOfBins; ++
i) {
826 trackHistoInTimeTmp->Fill(trackHistoInTimeTmp->GetBinCenter(startBin +
i));
833 for (
const auto&
tracks : *diamondLocalTracks) {
836 detId_pot.setChannel(0);
840 std::set<int> planesInTrackSet;
841 for (
const auto& vec : *diamondRecHits) {
843 if (detid.arm() != detId_pot.arm())
846 for (
const auto&
hit : vec) {
850 planesInTrackSet.insert(detid.plane());
855 if (numOfHits > 0 && numOfHits <= 10 && planesInTrackSet.size() > 2) {
856 for (
int plane = 0; plane < 4; ++plane) {
857 for (
int channel = 0; channel < 12; ++channel) {
858 int map_index = plane * 100 + channel;
859 if (
potPlots_[detId_pot].effDoublecountingChMap.find(map_index) ==
860 potPlots_[detId_pot].effDoublecountingChMap.end()) {
861 potPlots_[detId_pot].effTriplecountingChMap[map_index] = 0;
862 potPlots_[detId_pot].effDoublecountingChMap[map_index] = 0;
867 ++(
potPlots_[detId_pot].effDoublecountingChMap[map_index]);
868 for (
const auto&
rechits : *diamondRecHits) {
870 if (detId_hit == detId) {
871 for (
const auto& rechit :
rechits) {
872 if (
track.containsHit(rechit, 1)) {
874 ++(
potPlots_[detId_pot].effTriplecountingChMap[map_index]);
887 for (
const auto&
rechits : *diamondRecHits) {
890 detId_pot.setChannel(0);
892 for (
const auto& rechit :
rechits) {
895 if (rechit.toT() == 0)
908 for (
const auto& lt : ds) {
909 if (lt.isValid() && pixId.arm() == detId_pot.arm()) {
911 potPlots_[detId_pot].pixelTomographyAll.count(rechit.ootIndex()) > 0 &&
914 .pixelTomographyAll.at(rechit.ootIndex())
952 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
953 for (
const auto& digis : *diamondDigis) {
956 for (
const auto& digi : digis) {
963 if (digi.leadingEdge() != 0) {
964 planePlots_[detId_plane].digiProfileCumulativePerPlane->Fill(detId.channel());
965 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
966 channelsPerPlane[detId_plane]++;
968 channelsPerPlane[detId_plane] = 0;
973 for (
const auto& plt : channelsPerPlane) {
974 planePlots_[plt.first].hit_multiplicity->Fill(plt.second);
978 for (
const auto&
rechits : *diamondRecHits) {
981 for (
const auto& rechit :
rechits) {
984 if (rechit.toT() == 0)
988 TH1F* hitHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
991 for (
int i = 0;
i < numOfBins; ++
i) {
992 hitHistoTmp->Fill(hitHistoTmp->GetBinCenter(startBin +
i));
1006 for (
const auto& lt : ds) {
1012 std::set<CTPPSDiamondDetId> planesWitHits_set;
1013 for (
const auto&
rechits : *diamondRecHits) {
1016 for (
const auto& rechit :
rechits) {
1024 planePlots_[detId_plane].pixelTomography_far->Fill(
1027 planesWitHits_set.insert(detId_plane);
1032 for (
auto& planeId : planesWitHits_set)
1043 for (
const auto& digis : *diamondDigis) {
1045 for (
const auto& digi : digis) {
1051 for (
unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex)
1052 if (hptdcErrors.
errorId(hptdcErrorIndex - 1))
1054 if (digi.multipleHit())
1058 if (digi.leadingEdge() != 0 || digi.trailingEdge() != 0) {
1060 if (digi.leadingEdge() != 0 && digi.trailingEdge() == 0) {
1064 if (digi.leadingEdge() == 0 && digi.trailingEdge() != 0) {
1068 if (digi.leadingEdge() != 0 && digi.trailingEdge() != 0) {
1080 for (
const auto&
rechits : *diamondRecHits) {
1082 for (
const auto& rechit :
rechits) {
1087 channelPlots_[detId].leadingEdgeCumulative_both->Fill(rechit.time() + 25 * rechit.ootIndex());
1088 channelPlots_[detId].TimeOverThresholdCumulativePerChannel->Fill(rechit.toT());
1090 ++(lumiCache->hitsCounterMap[detId]);
1094 channelPlots_[detId].activity_per_bx.count(rechit.ootIndex()) > 0)
1100 for (
const auto&
rechits : *diamondRecHits) {
1102 for (
const auto& rechit :
rechits) {
1118 for (
const auto& lt : ds) {