525 valid &= timingDigis.
isValid();
533 <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs " 534 "are not valid. Skipping this event.\n" 535 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 536 <<
" fedInfo.isValid = " << fedInfo.
isValid();
543 std::set<uint8_t> boardSet;
544 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
545 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
547 for (
const auto &digis : *timingDigis)
552 detId_pot.setChannel(0);
556 for (
const auto &digi : digis)
563 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
565 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
566 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
568 float boardId = digi.getEventInfo().getHardwareBoardId() +
569 0.5 * digi.getEventInfo().getHardwareSampicId();
570 potPlots_[detId_pot].digiSent->Fill(boardId, digi.getHardwareChannelId());
571 if (boardSet.find(digi.getEventInfo().getHardwareId()) == boardSet.end())
574 boardSet.insert(digi.getEventInfo().getHardwareId());
575 std::bitset<16> chMap(digi.getEventInfo().getChannelMap());
576 for (
int i = 0;
i < 16; ++
i)
580 potPlots_[detId_pot].digiAll->Fill(boardId,
i);
585 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
591 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
593 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
594 channelsPerPlane[detId_plane]++;
596 channelsPerPlane[detId_plane] = 0;
603 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
607 digi.getSampleAt(
i));
609 unsigned int cellOfMax =
610 std::max_element(digi.getSamplesBegin(), digi.getSamplesEnd()) -
611 digi.getSamplesBegin();
624 for (
const auto &
rechits : *timingRecHits)
629 detId_pot.setChannel(0);
633 for (
const auto &rechit :
rechits)
637 potPlots_[detId_pot].amplitude->Fill(rechit.getAmplitude());
640 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
641 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
642 float yCorrected = rechit.getY();
646 float x_shift = detId.plane();
647 x_shift += (rechit.getX()>2)? 0.25 : 0;
648 int startBin = hitHistoTmpYAxis->FindBin( yCorrected - 0.5*rechit.getYWidth() );
650 for (
int i=0;
i<numOfBins; ++
i)
652 potPlots_[detId_pot].hitDistribution2d->Fill(
653 detId.plane() + 0.25 * (rechit.getX()>2),
654 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
655 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(
657 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
663 for (
int i=0;
i<numOfBins; ++
i)
664 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(
665 detId.plane() + 0.25 * (rechit.getX()>2),
666 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
668 potPlots_[detId_pot].recHitTime->Fill(rechit.getT());
669 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
675 float x_shift = (rechit.getX()>2)? 15 : 0;
676 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
680 float yCorrected = rechit.getY()+
verticalShiftTop_-0.5*rechit.getYWidth()+x_shift;
681 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
682 for (
int i=0;
i<numOfBins; ++
i)
683 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(startBin+
i) );
687 float yCorrected = rechit.getY()+
verticalShiftBot_+0.5*rechit.getYWidth()+(15-x_shift);
688 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
689 int totBins = hitProfileHistoTmp->GetNbinsX();
690 for (
int i=0;
i<numOfBins; ++
i)
691 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(totBins-startBin+
i) );
694 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
695 channelsPerPlaneWithTime[detId_plane]++;
697 channelsPerPlaneWithTime[detId_plane] = 0;
702 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
703 channelPlots_[detId].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
714 for (
const auto &rechits : *timingRecHits)
719 detId_pot.setChannel(0);
725 for (
const auto &rechit : rechits)
734 for (
const auto &ds : *stripTracks) {
756 for (
const auto &striplt : ds) {
757 if (striplt.isValid() && stripId.arm() == detId.arm()) {
764 if (stripId.rp() - detId.rp() ==
767 double x = striplt.getX0() - rp_x;
768 double y = striplt.getY0() - rp_y;
771 potPlots_[detId_pot].stripTomography210->Fill(x + detId.plane()*50, y + y_shift);
772 channelPlots_[detId].stripTomography210->Fill(x, y + y_shift);
776 potPlots_[detId_pot].stripTomography220->Fill(x+detId.plane()*50, y + y_shift);
777 channelPlots_[detId].stripTomography220->Fill(x, y + y_shift);
790 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
791 plt.second.planesWithDigisSet.clear();
792 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
793 plt.second.planesWithTimeSet.clear();
796 for (
const auto &plt : channelsPerPlane) {
797 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
799 for (
const auto &plt : channelsPerPlaneWithTime) {
800 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_
int bunchCrossing() const
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
static const int TOTEM_STATION_220
Event setup record containing the real (actual) geometry information.
const DetGeomDesc * getSensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
void setPlane(uint32_t channel)
unsigned int samplesForNoise_
double maximumStripAngleForTomography_
DDTranslation translation() const
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.
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 ...