535 valid &= timingDigis.
isValid();
543 <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs " 544 "are not valid. Skipping this event.\n" 545 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 546 <<
" fedInfo.isValid = " << fedInfo.
isValid();
553 std::set<uint8_t> boardSet;
554 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
555 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
558 for (
const auto &digis : *timingDigis)
563 detId_pot.setChannel(0);
567 for (
const auto &digi : digis)
574 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
576 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
577 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
579 float boardId = digi.getEventInfo().getHardwareBoardId() +
580 0.5 * digi.getEventInfo().getHardwareSampicId();
581 potPlots_[detId_pot].digiSent->Fill(boardId, digi.getHardwareChannelId());
582 if (boardSet.find(digi.getEventInfo().getHardwareId()) == boardSet.end())
585 boardSet.insert(digi.getEventInfo().getHardwareId());
586 std::bitset<16> chMap(digi.getEventInfo().getChannelMap());
587 for (
int i = 0;
i < 16; ++
i)
591 potPlots_[detId_pot].digiAll->Fill(boardId,
i);
596 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
602 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
604 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
605 channelsPerPlane[detId_plane]++;
607 channelsPerPlane[detId_plane] = 0;
614 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
618 digi.getSampleAt(
i));
620 unsigned int cellOfMax =
621 std::max_element(digi.getSamplesBegin(), digi.getSamplesEnd()) -
622 digi.getSamplesBegin();
629 ++(lumiCache->hitsCounterMap[detId]);
635 for (
const auto &
rechits : *timingRecHits)
640 detId_pot.setChannel(0);
644 for (
const auto &rechit :
rechits)
648 potPlots_[detId_pot].amplitude->Fill(rechit.getAmplitude());
651 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
652 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
653 float yCorrected = rechit.getY();
657 float x_shift = detId.plane();
658 x_shift += (rechit.getX()>2)? 0.25 : 0;
659 int startBin = hitHistoTmpYAxis->FindBin( yCorrected - 0.5*rechit.getYWidth() );
661 for (
int i=0;
i<numOfBins; ++
i)
663 potPlots_[detId_pot].hitDistribution2d->Fill(
664 detId.plane() + 0.25 * (rechit.getX()>2),
665 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
666 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(
668 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
674 for (
int i=0;
i<numOfBins; ++
i)
675 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(
676 detId.plane() + 0.25 * (rechit.getX()>2),
677 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
679 potPlots_[detId_pot].recHitTime->Fill(rechit.getT());
680 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
686 float x_shift = (rechit.getX()>2)? 15 : 0;
687 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
691 float yCorrected = rechit.getY()+
verticalShiftTop_-0.5*rechit.getYWidth()+x_shift;
692 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
693 for (
int i=0;
i<numOfBins; ++
i)
694 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(startBin+
i) );
698 float yCorrected = rechit.getY()+
verticalShiftBot_+0.5*rechit.getYWidth()+(15-x_shift);
699 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
700 int totBins = hitProfileHistoTmp->GetNbinsX();
701 for (
int i=0;
i<numOfBins; ++
i)
702 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(totBins-startBin+
i) );
705 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
706 channelsPerPlaneWithTime[detId_plane]++;
708 channelsPerPlaneWithTime[detId_plane] = 0;
713 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
714 channelPlots_[detId].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
725 for (
const auto &rechits : *timingRecHits)
730 detId_pot.setChannel(0);
736 for (
const auto &rechit : rechits)
745 for (
const auto &ds : *stripTracks) {
767 for (
const auto &striplt : ds) {
768 if (striplt.isValid() && stripId.arm() == detId.arm()) {
775 if (stripId.rp() - detId.rp() ==
778 double x = striplt.getX0() - rp_x;
779 double y = striplt.getY0() - rp_y;
782 potPlots_[detId_pot].stripTomography210->Fill(x + detId.plane()*50, y + y_shift);
783 channelPlots_[detId].stripTomography210->Fill(x, y + y_shift);
787 potPlots_[detId_pot].stripTomography220->Fill(x+detId.plane()*50, y + y_shift);
788 channelPlots_[detId].stripTomography220->Fill(x, y + y_shift);
801 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
802 plt.second.planesWithDigisSet.clear();
803 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
804 plt.second.planesWithTimeSet.clear();
807 for (
const auto &plt : channelsPerPlane) {
808 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
810 for (
const auto &plt : channelsPerPlaneWithTime) {
811 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.
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_
LuminosityBlock const & getLuminosityBlock() 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 ...