504 valid &= timingDigis.
isValid();
509 edm::LogProblem(
"TotemTimingDQMSource") <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs " 510 "are not valid. Skipping this event.\n" 511 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 512 <<
" fedInfo.isValid = " << fedInfo.
isValid();
519 std::set<uint8_t> boardSet;
520 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
521 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
524 for (
const auto &digis : *timingDigis) {
528 detId_pot.setChannel(0);
532 for (
const auto &digi : digis) {
537 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
539 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
540 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
542 float boardId = digi.eventInfo().hardwareBoardId() + 0.5 * digi.eventInfo().hardwareSampicId();
543 potPlots_[detId_pot].digiSent->Fill(boardId, digi.hardwareChannelId());
544 if (boardSet.find(digi.eventInfo().hardwareId()) == boardSet.end()) {
546 boardSet.insert(digi.eventInfo().hardwareId());
547 std::bitset<16> chMap(digi.eventInfo().channelMap());
548 for (
int i = 0;
i < 16; ++
i) {
550 potPlots_[detId_pot].digiAll->Fill(boardId,
i);
555 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
560 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
562 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
563 channelsPerPlane[detId_plane]++;
565 channelsPerPlane[detId_plane] = 0;
572 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
577 unsigned int cellOfMax = std::max_element(digi.samplesBegin(), digi.samplesEnd()) - digi.samplesBegin();
583 ++(lumiCache->hitsCounterMap[detId]);
589 for (
const auto &
rechits : *timingRecHits) {
593 detId_pot.setChannel(0);
597 for (
const auto &rechit :
rechits) {
599 potPlots_[detId_pot].amplitude->Fill(rechit.amplitude());
601 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
602 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
603 float yCorrected = rechit.y();
605 float x_shift = detId.plane();
606 x_shift += (rechit.x() > 2) ? 0.25 : 0;
607 int startBin = hitHistoTmpYAxis->FindBin(yCorrected - 0.5 * rechit.yWidth());
609 for (
int i = 0;
i < numOfBins; ++
i) {
610 potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
611 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
612 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(x_shift,
613 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
618 for (
int i = 0;
i < numOfBins; ++
i)
619 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
620 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
622 potPlots_[detId_pot].recHitTime->Fill(rechit.time());
623 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
628 float x_shift = (rechit.x() > 2) ? 15 : 0;
629 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
632 float yCorrected = rechit.y() +
verticalShiftTop_ - 0.5 * rechit.yWidth() + x_shift;
633 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
634 for (
int i = 0;
i < numOfBins; ++
i)
635 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(startBin +
i));
637 float yCorrected = rechit.y() +
verticalShiftBot_ + 0.5 * rechit.yWidth() + (15 - x_shift);
638 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
639 int totBins = hitProfileHistoTmp->GetNbinsX();
640 for (
int i = 0;
i < numOfBins; ++
i)
641 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(totBins - startBin +
i));
644 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
645 channelsPerPlaneWithTime[detId_plane]++;
647 channelsPerPlaneWithTime[detId_plane] = 0;
651 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.sampicThresholdTime());
652 channelPlots_[detId].tirggerCellTime->Fill(rechit.sampicThresholdTime());
663 for (
const auto &rechits : *timingRecHits) {
667 detId_pot.setChannel(0);
673 for (
const auto &rechit : rechits) {
677 for (
const auto &ds : *stripTracks) {
694 for (
const auto &striplt : ds) {
695 if (striplt.isValid() && stripId.arm() == detId.arm()) {
701 double x = striplt.x0() - rp_x;
702 double y = striplt.y0() - rp_y;
704 potPlots_[detId_pot].stripTomography210->Fill(x + detId.plane() * 50, y + y_shift);
705 channelPlots_[detId].stripTomography210->Fill(x, y + y_shift);
707 potPlots_[detId_pot].stripTomography220->Fill(x + detId.plane() * 50, y + y_shift);
708 channelPlots_[detId].stripTomography220->Fill(x, y + y_shift);
720 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
721 plt.second.planesWithDigisSet.clear();
722 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
723 plt.second.planesWithTimeSet.clear();
726 for (
const auto &plt : channelsPerPlane) {
727 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
729 for (
const auto &plt : channelsPerPlaneWithTime) {
730 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
Translation translation() const
double minimumStripAngleForTomography_
void setChannel(uint32_t channel)
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
LuminosityBlockIndex index() const
std::unordered_map< unsigned int, PlanePlots > planePlots_
edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > tokenRecHit_
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
int bunchCrossing() const
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
static const int TOTEM_STATION_220
Event setup record containing the real (actual) geometry information.
void setPlane(uint32_t channel)
unsigned int samplesForNoise_
double maximumStripAngleForTomography_
LuminosityBlock const & getLuminosityBlock() const
static const int TOTEM_TIMING_TOP_RP_ID
std::unordered_map< unsigned int, PotPlots > potPlots_
const DetGeomDesc * sensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
static const double SAMPIC_ADC_V
Base class for CTPPS detector IDs.
ESHandle< TrackerGeometry > geometry
edm::TimeValue_t timeOfPreviousEvent_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
static const int TOTEM_TIMING_BOT_RP_ID
TimeValue_t value() const
edm::Timestamp time() const
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...