524 valid &= timingDigis.
isValid();
532 <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs " 533 "are not valid. Skipping this event.\n" 534 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 535 <<
" fedInfo.isValid = " << fedInfo.
isValid();
542 std::set<uint8_t> boardSet;
543 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
544 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
546 for (
const auto &digis : *timingDigis)
551 detId_pot.setChannel(0);
555 for (
const auto &digi : digis)
562 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
564 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
565 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
567 float boardId = digi.getEventInfo().getHardwareBoardId() +
568 0.5 * digi.getEventInfo().getHardwareSampicId();
569 potPlots_[detId_pot].digiSent->Fill(boardId, digi.getHardwareChannelId());
570 if (boardSet.find(digi.getEventInfo().getHardwareId()) == boardSet.end())
573 boardSet.insert(digi.getEventInfo().getHardwareId());
574 std::bitset<16> chMap(digi.getEventInfo().getChannelMap());
575 for (
int i = 0;
i < 16; ++
i)
579 potPlots_[detId_pot].digiAll->Fill(boardId,
i);
584 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
590 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
592 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
593 channelsPerPlane[detId_plane]++;
595 channelsPerPlane[detId_plane] = 0;
602 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
606 digi.getSampleAt(
i));
608 unsigned int cellOfMax =
609 std::max_element(digi.getSamplesBegin(), digi.getSamplesEnd()) -
610 digi.getSamplesBegin();
623 for (
const auto &
rechits : *timingRecHits)
628 detId_pot.setChannel(0);
632 for (
const auto &rechit :
rechits)
636 potPlots_[detId_pot].amplitude->Fill(rechit.getAmplitude());
639 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
640 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
641 float yCorrected = rechit.getY();
645 float x_shift = detId.plane();
646 x_shift += (rechit.getX()>2)? 0.25 : 0;
647 int startBin = hitHistoTmpYAxis->FindBin( yCorrected - 0.5*rechit.getYWidth() );
649 for (
int i=0;
i<numOfBins; ++
i)
651 potPlots_[detId_pot].hitDistribution2d->Fill(
652 detId.plane() + 0.25 * (rechit.getX()>2),
653 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
654 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(
656 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
662 for (
int i=0;
i<numOfBins; ++
i)
663 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(
664 detId.plane() + 0.25 * (rechit.getX()>2),
665 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
667 potPlots_[detId_pot].recHitTime->Fill(rechit.getT());
668 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
674 float x_shift = (rechit.getX()>2)? 15 : 0;
675 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
679 float yCorrected = rechit.getY()+
verticalShiftTop_-0.5*rechit.getYWidth()+x_shift;
680 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
681 for (
int i=0;
i<numOfBins; ++
i)
682 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(startBin+
i) );
686 float yCorrected = rechit.getY()+
verticalShiftBot_+0.5*rechit.getYWidth()+(15-x_shift);
687 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
688 int totBins = hitProfileHistoTmp->GetNbinsX();
689 for (
int i=0;
i<numOfBins; ++
i)
690 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(totBins-startBin+
i) );
693 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
694 channelsPerPlaneWithTime[detId_plane]++;
696 channelsPerPlaneWithTime[detId_plane] = 0;
701 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
702 channelPlots_[detId].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
713 for (
const auto &rechits : *timingRecHits)
718 detId_pot.setChannel(0);
724 for (
const auto &rechit : rechits)
733 for (
const auto &ds : *stripTracks) {
755 for (
const auto &striplt : ds) {
756 if (striplt.isValid() && stripId.arm() == detId.arm()) {
763 if (stripId.rp() - detId.rp() ==
766 double x = striplt.getX0() - rp_x;
767 double y = striplt.getY0() - rp_y;
770 potPlots_[detId_pot].stripTomography210->Fill(x + detId.plane()*50, y + y_shift);
771 channelPlots_[detId].stripTomography210->Fill(x, y + y_shift);
775 potPlots_[detId_pot].stripTomography220->Fill(x+detId.plane()*50, y + y_shift);
776 channelPlots_[detId].stripTomography220->Fill(x, y + y_shift);
789 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
790 plt.second.planesWithDigisSet.clear();
791 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
792 plt.second.planesWithTimeSet.clear();
795 for (
const auto &plt : channelsPerPlane) {
796 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
798 for (
const auto &plt : channelsPerPlaneWithTime) {
799 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 ...