487 <<
"ERROR in DiamondSampicDQMSource::analyze > some of the required inputs " 488 "are not valid. Skipping this event.\n" 489 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 490 <<
" fedInfo.isValid = " << fedInfo.
isValid();
497 std::set<uint8_t> boardSet;
498 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
499 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
501 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
503 for (
const auto &digis : *timingDigis) {
507 detId_pot.setChannel(0);
511 for (
const auto &digi : digis) {
514 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
519 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it) {
520 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
523 float boardId = digi.eventInfo().hardwareBoardId() + 0.5 * digi.eventInfo().hardwareSampicId();
526 if (boardSet.find(digi.eventInfo().hardwareId()) == boardSet.end()) {
528 boardSet.insert(digi.eventInfo().hardwareId());
529 std::bitset<16> chMap(digi.eventInfo().channelMap());
530 for (
int i = 0;
i < 16; ++
i) {
537 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
544 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
546 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
547 channelsPerPlane[detId_plane]++;
550 channelsPerPlane[detId_plane] = 1;
557 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
562 unsigned int cellOfMax = std::max_element(digi.samplesBegin(), digi.samplesEnd()) - digi.samplesBegin();
568 ++(lumiCache->hitsCounterMap[detId]);
575 for (
const auto &
rechits : *timingRecHits) {
579 detId_pot.setChannel(0);
583 for (
const auto &rechit :
rechits) {
585 float UFSDShift = 0.0;
586 if (rechit.yWidth() < 3)
589 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
590 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
594 for (
int i = 0;
i < numOfBins; ++
i) {
595 potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + UFSDShift,
596 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
598 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(detId.plane() + UFSDShift,
599 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
604 for (
int i = 0;
i < numOfBins; ++
i)
605 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(detId.plane() + UFSDShift,
606 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
608 potPlots_[detId_pot].recHitTime->Fill(rechit.time());
610 potPlots_[detId_pot].amplitude->Fill(rechit.amplitude());
611 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
615 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
617 0.5 * rechit.xWidth());
618 for (
int i = 0;
i < numOfBins; ++
i)
619 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(startBin +
i));
621 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
622 channelsPerPlaneWithTime[detId_plane]++;
625 channelsPerPlaneWithTime[detId_plane] = 1;
629 potPlots_[detId_pot].triggerCellTime->Fill(rechit.sampicThresholdTime());
630 channelPlots_[detId].triggerCellTime->Fill(rechit.sampicThresholdTime());
642 for (
const auto &
tracks : *timingLocalTracks) {
645 detId_pot.setChannel(0);
649 if (!
track.isValid())
654 TH1F *trackHistoInTimeTmp =
potPlots_[detId_pot].trackDistribution->getTH1F();
658 for (
int i = 0;
i < numOfBins; ++
i) {
659 trackHistoInTimeTmp->Fill(trackHistoInTimeTmp->GetBinCenter(startBin +
i));
663 for (
const auto &tracks_far : *timingLocalTracks) {
666 detId_far.setChannel(0);
667 if (detId_near.arm() != detId_far.arm() || detId_near.station() == detId_far.station())
669 for (
const auto &track_far : tracks_far) {
670 if (!
track.isValid())
674 TH2F *trackHistoTmp =
sectorPlots_[detId_far.armId()].trackCorrelation->getTH2F();
675 TAxis *trackHistoTmpXAxis = trackHistoTmp->GetXaxis();
676 TAxis *trackHistoTmpYAxis = trackHistoTmp->GetYaxis();
677 const int startBin_far =
680 for (
int i = 0;
i < numOfBins; ++
i) {
681 for (
int y = 0;
y < numOfBins_far; ++
y) {
682 trackHistoTmp->Fill(trackHistoTmpXAxis->GetBinCenter(startBin +
i),
683 trackHistoTmpYAxis->GetBinCenter(startBin_far +
y));
685 sectorPlots_[detId_far.armId()].trackCorrelationLowMultiplicity->Fill(
686 trackHistoTmpXAxis->GetBinCenter(startBin +
i), trackHistoTmpYAxis->GetBinCenter(startBin_far +
y));
695 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
696 plt.second.planesWithDigisSet.clear();
697 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
698 plt.second.planesWithTimeSet.clear();
701 for (
const auto &plt : channelsPerPlane)
702 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
704 for (
const auto &plt : channelsPerPlaneWithTime)
705 planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
edm::TimeValue_t timeOfPreviousEvent_
void setPlane(uint32_t channel)
void setChannel(uint32_t channel)
std::unordered_map< unsigned int, PlanePlots > planePlots_
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
static const double SAMPIC_ADC_V
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > tokenRecHit_
auto const & tracks
cannot be loose
std::unordered_map< unsigned int, double > horizontalShiftOfDiamond_
unsigned int trackCorrelationThreshold_
edm::EDGetTokenT< edm::DetSetVector< TotemTimingLocalTrack > > tokenTrack_
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
std::unordered_map< unsigned int, PotPlots > potPlots_
unsigned int samplesForNoise_
Log< level::Error, true > LogProblem
std::unordered_map< unsigned int, SectorPlots > sectorPlots_