513 edm::LogProblem(
"TotemTimingDQMSource") <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs " 514 "are not valid. Skipping this event.\n" 515 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 516 <<
" fedInfo.isValid = " << fedInfo.
isValid();
523 std::set<uint8_t> boardSet;
524 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
525 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
527 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
528 for (
const auto &digis : *timingDigis) {
532 detId_pot.setChannel(0);
536 for (
const auto &digi : digis) {
541 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
543 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
544 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
546 float boardId = digi.eventInfo().hardwareBoardId() + 0.5 * digi.eventInfo().hardwareSampicId();
548 if (boardSet.find(digi.eventInfo().hardwareId()) == boardSet.end()) {
550 boardSet.insert(digi.eventInfo().hardwareId());
551 std::bitset<16> chMap(digi.eventInfo().channelMap());
552 for (
int i = 0;
i < 16; ++
i) {
559 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
564 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
566 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
567 channelsPerPlane[detId_plane]++;
569 channelsPerPlane[detId_plane] = 0;
576 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
581 unsigned int cellOfMax = std::max_element(digi.samplesBegin(), digi.samplesEnd()) - digi.samplesBegin();
587 ++(lumiCache->hitsCounterMap[detId]);
593 for (
const auto &
rechits : *timingRecHits) {
597 detId_pot.setChannel(0);
601 for (
const auto &rechit :
rechits) {
603 potPlots_[detId_pot].amplitude->Fill(rechit.amplitude());
605 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
606 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
607 float yCorrected = rechit.y();
609 float x_shift = detId.plane();
610 x_shift += (rechit.x() > 2) ? 0.25 : 0;
611 int startBin = hitHistoTmpYAxis->FindBin(yCorrected - 0.5 * rechit.yWidth());
613 for (
int i = 0;
i < numOfBins; ++
i) {
614 potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
615 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
617 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(x_shift,
618 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
623 for (
int i = 0;
i < numOfBins; ++
i)
624 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
625 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
627 potPlots_[detId_pot].recHitTime->Fill(rechit.time());
628 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
633 float x_shift = (rechit.x() > 2) ? 15 : 0;
634 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
637 float yCorrected = rechit.y() +
verticalShiftTop_ - 0.5 * rechit.yWidth() + x_shift;
638 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
639 for (
int i = 0;
i < numOfBins; ++
i)
640 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(startBin +
i));
642 float yCorrected = rechit.y() +
verticalShiftBot_ + 0.5 * rechit.yWidth() + (15 - x_shift);
643 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
644 int totBins = hitProfileHistoTmp->GetNbinsX();
645 for (
int i = 0;
i < numOfBins; ++
i)
646 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(totBins - startBin +
i));
649 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
650 channelsPerPlaneWithTime[detId_plane]++;
652 channelsPerPlaneWithTime[detId_plane] = 0;
656 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.sampicThresholdTime());
657 channelPlots_[detId].tirggerCellTime->Fill(rechit.sampicThresholdTime());
668 for (
const auto &
rechits : *timingRecHits) {
672 detId_pot.setChannel(0);
678 for (
const auto &rechit :
rechits) {
682 for (
const auto &ds : *stripTracks) {
693 rp_x = (
geometry.sensor(plId_V)->translation().x() +
geometry.sensor(plId_U)->translation().x()) / 2;
694 rp_y = (
geometry.sensor(plId_V)->translation().y() +
geometry.sensor(plId_U)->translation().y()) / 2;
699 for (
const auto &striplt : ds) {
700 if (striplt.isValid() && stripId.arm() == detId.arm()) {
706 double x = striplt.x0() - rp_x;
707 double y = striplt.y0() - rp_y;
709 potPlots_[detId_pot].stripTomography210->Fill(
x + detId.plane() * 50,
y + y_shift);
712 potPlots_[detId_pot].stripTomography220->Fill(
x + detId.plane() * 50,
y + y_shift);
725 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
726 plt.second.planesWithDigisSet.clear();
727 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
728 plt.second.planesWithTimeSet.clear();
731 for (
const auto &plt : channelsPerPlane) {
732 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
734 for (
const auto &plt : channelsPerPlaneWithTime) {
735 planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM
static const double LHC_CLOCK_PERIOD_NS
Detector ID class for TOTEM Si strip detectors.
static const int TOTEM_STRIP_MAX_RP_ID
static const int TOTEM_STATION_210
double minimumStripAngleForTomography_
void setChannel(uint32_t channel)
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
std::unordered_map< unsigned int, PlanePlots > planePlots_
edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > tokenRecHit_
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
static const int TOTEM_STATION_220
void setPlane(uint32_t channel)
unsigned int samplesForNoise_
double maximumStripAngleForTomography_
static const int TOTEM_TIMING_TOP_RP_ID
std::unordered_map< unsigned int, PotPlots > potPlots_
static const double SAMPIC_ADC_V
Base class for CTPPS detector IDs.
edm::TimeValue_t timeOfPreviousEvent_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
static const int TOTEM_TIMING_BOT_RP_ID
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geometryToken_
Log< level::Error, true > LogProblem
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...