603 <<
"ERROR in CTPPSDiamondDQMSource::analyze > some of the required inputs are not valid. Skipping this "
605 <<
" diamondVFATStatus.isValid = " << diamondVFATStatus.
isValid() <<
"\n"
606 <<
" pixelTracks.isValid = " <<
pixelTracks.isValid() <<
"\n"
607 <<
" diamondDigis.isValid = " << diamondDigis.
isValid() <<
"\n"
608 <<
" fedInfo.isValid = " << fedInfo.
isValid() <<
"\n"
609 <<
" diamondRecHits.isValid = " << diamondRecHits.
isValid() <<
"\n"
610 <<
" diamondLocalTracks.isValid = " << diamondLocalTracks.
isValid();
625 for (
const auto& digis : *diamondDigis) {
629 for (
const auto& digi : digis) {
631 detId_pot.setChannel(0);
637 if (digi.leadingEdge() != 0 || digi.trailingEdge() != 0) {
639 if (digi.leadingEdge() != 0) {
642 if (digi.leadingEdge() != 0 && digi.trailingEdge() == 0) {
643 ++(
potPlots_[detId_pot].LeadingOnlyCounter);
646 if (digi.leadingEdge() == 0 && digi.trailingEdge() != 0) {
647 ++(
potPlots_[detId_pot].TrailingOnlyCounter);
650 if (digi.leadingEdge() != 0 && digi.trailingEdge() != 0) {
651 ++(
potPlots_[detId_pot].CompleteCounter);
659 if (detId.channel() == 6 || detId.channel() == 7)
661 int verticalIndex = 2 * detId.plane() + (detId.channel() - 6);
662 for (
unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex)
663 if (hptdcErrors.
errorId(hptdcErrorIndex - 1))
664 potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(hptdcErrorIndex, verticalIndex);
666 if (digi.multipleHit())
672 for (
const auto& vfat_status : *diamondVFATStatus) {
676 detId_pot.setChannel(0);
677 for (
const auto&
status : vfat_status) {
686 for (
const auto& optorx : *fedInfo) {
688 potPlots_[detId_pot].ECCheck->Fill((
int)((optorx.lv1() & 0xFF) - ((
unsigned int)
status.ec() & 0xFF)) & 0xFF);
690 (static_cast<uint8_t>((optorx.lv1() & 0xFF) -
status.ec()) < 128))
693 if (detId.channel() == 6 || detId.channel() == 7)
694 potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(16, 2 * detId.plane() + (detId.channel() - 6));
697 <<
"FED " <<
CTPPS_FED_ID_56 <<
": ECError at EV: 0x" << std::hex << optorx.lv1() <<
"\t\tVFAT EC: 0x"
698 << static_cast<unsigned int>(
status.ec()) <<
"\twith ID: " <<
std::dec << detId
702 potPlots_[detId_pot].ECCheck->Fill((
int)((optorx.lv1() & 0xFF) -
status.ec()) & 0xFF);
704 (static_cast<uint8_t>((optorx.lv1() & 0xFF) -
status.ec()) < 128))
707 if (detId.channel() == 6 || detId.channel() == 7)
708 potPlots_[detId_pot].HPTDCErrorFlags_2D->Fill(16, 2 * detId.plane() + (detId.channel() - 6));
711 <<
"FED " <<
CTPPS_FED_ID_45 <<
": ECError at EV: 0x" << std::hex << optorx.lv1() <<
"\t\tVFAT EC: 0x"
712 << static_cast<unsigned int>(
status.ec()) <<
"\twith ID: " <<
std::dec << detId
721 std::unordered_map<unsigned int, std::set<unsigned int>> planes;
722 std::unordered_map<unsigned int, std::set<unsigned int>> planes_inclusive;
724 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
725 for (
const auto&
rechits : *diamondRecHits) {
728 detId_pot.setChannel(0);
731 for (
const auto& rechit :
rechits) {
732 planes_inclusive[detId_pot].insert(detId.plane());
736 planes[detId_pot].
insert(detId.plane());
741 float UFSDShift = 0.0;
742 if (rechit.yWidth() < 3)
746 TH2F* hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
747 TAxis* hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
750 for (
int i = 0;
i < numOfBins; ++
i) {
751 hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin +
i));
755 hitHistoTmp = lumiCache->hitDistribution2dMap[detId_pot].get();
756 hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
759 for (
int i = 0;
i < numOfBins; ++
i) {
760 hitHistoTmp->Fill(detId.plane() + UFSDShift, hitHistoTmpYAxis->GetBinCenter(startBin +
i));
765 if (rechit.toT() != 0) {
767 potPlots_[detId_pot].leadingEdgeCumulative_both->Fill(rechit.time() + 25 * rechit.ootIndex());
768 potPlots_[detId_pot].timeOverThresholdCumulativePot->Fill(rechit.toT());
770 TH2F* hitHistoOOTTmp =
potPlots_[detId_pot].hitDistribution2dOOT->getTH2F();
771 TAxis* hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
774 for (
int i = 0;
i < numOfBins; ++
i) {
775 hitHistoOOTTmp->Fill(detId.plane() + 0.25 * rechit.ootIndex(),
776 hitHistoOOTTmpYAxis->GetBinCenter(startBin +
i));
781 TH2F* hitHistoOOTTmp =
potPlots_[detId_pot].hitDistribution2dOOT_le->getTH2F();
782 TAxis* hitHistoOOTTmpYAxis = hitHistoOOTTmp->GetYaxis();
785 for (
int i = 0;
i < numOfBins; ++
i) {
786 hitHistoOOTTmp->Fill(detId.plane() + 0.25 * rechit.ootIndex(),
787 hitHistoOOTTmpYAxis->GetBinCenter(startBin +
i));
792 potPlots_[detId_pot].activity_per_bx.count(rechit.ootIndex()) > 0)
793 potPlots_[detId_pot].activity_per_bx.at(rechit.ootIndex())->
Fill(
event.bunchCrossing());
798 plt.second.activePlanes->Fill(planes[plt.first].size());
799 plt.second.activePlanesInclusive->Fill(planes_inclusive[plt.first].size());
803 for (
const auto&
tracks : *diamondLocalTracks) {
806 detId_pot.setChannel(0);
810 if (!
track.isValid())
819 TH2F* trackHistoOOTTmp =
potPlots_[detId_pot].trackDistributionOOT->getTH2F();
820 TAxis* trackHistoOOTTmpYAxis = trackHistoOOTTmp->GetYaxis();
823 for (
int i = 0;
i < numOfBins; ++
i) {
824 trackHistoOOTTmp->Fill(
track.ootIndex(), trackHistoOOTTmpYAxis->GetBinCenter(startBin +
i));
828 TH1F* trackHistoInTimeTmp =
potPlots_[detId_pot].trackDistribution->getTH1F();
831 for (
int i = 0;
i < numOfBins; ++
i) {
832 trackHistoInTimeTmp->Fill(trackHistoInTimeTmp->GetBinCenter(startBin +
i));
839 for (
const auto&
tracks : *diamondLocalTracks) {
842 detId_pot.setChannel(0);
846 std::set<int> planesInTrackSet;
847 for (
const auto& vec : *diamondRecHits) {
849 if (detid.arm() != detId_pot.arm())
852 for (
const auto&
hit : vec) {
856 planesInTrackSet.insert(detid.plane());
861 if (numOfHits > 0 && numOfHits <= 10 && planesInTrackSet.size() > 2) {
862 for (
int plane = 0; plane < 4; ++plane) {
863 for (
int channel = 0; channel < 12; ++channel) {
864 int map_index = plane * 100 + channel;
865 if (
potPlots_[detId_pot].effDoublecountingChMap.find(map_index) ==
866 potPlots_[detId_pot].effDoublecountingChMap.end()) {
867 potPlots_[detId_pot].effTriplecountingChMap[map_index] = 0;
868 potPlots_[detId_pot].effDoublecountingChMap[map_index] = 0;
873 ++(
potPlots_[detId_pot].effDoublecountingChMap[map_index]);
874 for (
const auto&
rechits : *diamondRecHits) {
876 if (detId_hit == detId) {
877 for (
const auto& rechit :
rechits) {
878 if (
track.containsHit(rechit, 1)) {
880 ++(
potPlots_[detId_pot].effTriplecountingChMap[map_index]);
893 for (
const auto&
rechits : *diamondRecHits) {
896 detId_pot.setChannel(0);
898 for (
const auto& rechit :
rechits) {
901 if (rechit.toT() == 0)
914 for (
const auto& lt : ds) {
915 if (lt.isValid() && pixId.arm() == detId_pot.arm()) {
917 potPlots_[detId_pot].pixelTomographyAll.count(rechit.ootIndex()) > 0 &&
920 .pixelTomographyAll.at(rechit.ootIndex())
958 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
959 for (
const auto& digis : *diamondDigis) {
962 for (
const auto& digi : digis) {
969 if (digi.leadingEdge() != 0) {
970 planePlots_[detId_plane].digiProfileCumulativePerPlane->Fill(detId.channel());
971 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
972 channelsPerPlane[detId_plane]++;
974 channelsPerPlane[detId_plane] = 0;
979 for (
const auto& plt : channelsPerPlane) {
980 planePlots_[plt.first].hit_multiplicity->Fill(plt.second);
984 for (
const auto&
rechits : *diamondRecHits) {
987 for (
const auto& rechit :
rechits) {
990 if (rechit.toT() == 0)
994 TH1F* hitHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
997 for (
int i = 0;
i < numOfBins; ++
i) {
998 hitHistoTmp->Fill(hitHistoTmp->GetBinCenter(startBin +
i));
1012 for (
const auto& lt : ds) {
1018 std::set<CTPPSDiamondDetId> planesWitHits_set;
1019 for (
const auto&
rechits : *diamondRecHits) {
1022 for (
const auto& rechit :
rechits) {
1030 planePlots_[detId_plane].pixelTomography_far->Fill(
1033 planesWitHits_set.insert(detId_plane);
1038 for (
auto& planeId : planesWitHits_set)
1049 for (
const auto& digis : *diamondDigis) {
1051 for (
const auto& digi : digis) {
1057 for (
unsigned short hptdcErrorIndex = 1; hptdcErrorIndex < 16; ++hptdcErrorIndex)
1058 if (hptdcErrors.
errorId(hptdcErrorIndex - 1))
1060 if (digi.multipleHit())
1064 if (digi.leadingEdge() != 0 || digi.trailingEdge() != 0) {
1066 if (digi.leadingEdge() != 0 && digi.trailingEdge() == 0) {
1070 if (digi.leadingEdge() == 0 && digi.trailingEdge() != 0) {
1074 if (digi.leadingEdge() != 0 && digi.trailingEdge() != 0) {
1086 for (
const auto&
rechits : *diamondRecHits) {
1088 for (
const auto& rechit :
rechits) {
1093 channelPlots_[detId].leadingEdgeCumulative_both->Fill(rechit.time() + 25 * rechit.ootIndex());
1094 channelPlots_[detId].TimeOverThresholdCumulativePerChannel->Fill(rechit.toT());
1096 ++(lumiCache->hitsCounterMap[detId]);
1100 channelPlots_[detId].activity_per_bx.count(rechit.ootIndex()) > 0)
1106 for (
const auto&
rechits : *diamondRecHits) {
1108 for (
const auto& rechit :
rechits) {
1124 for (
const auto& lt : ds) {