490 <<
"ERROR in DiamondSampicDQMSource::analyze > some of the required inputs " 491 "are not valid. Skipping this event.\n" 492 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 493 <<
" fedInfo.isValid = " << fedInfo.
isValid();
500 std::set<uint8_t> boardSet;
501 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
502 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
504 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
506 for (
const auto &digis : *timingDigis) {
510 detId_pot.setChannel(0);
514 for (
const auto &digi : digis) {
517 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
522 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it) {
523 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
526 float boardId = digi.eventInfo().hardwareBoardId() + 0.5 * digi.eventInfo().hardwareSampicId();
529 if (boardSet.find(digi.eventInfo().hardwareId()) == boardSet.end()) {
531 boardSet.insert(digi.eventInfo().hardwareId());
532 std::bitset<16> chMap(digi.eventInfo().channelMap());
533 for (
int i = 0;
i < 16; ++
i) {
540 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
547 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
549 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
550 channelsPerPlane[detId_plane]++;
553 channelsPerPlane[detId_plane] = 1;
560 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
565 unsigned int cellOfMax = std::max_element(digi.samplesBegin(), digi.samplesEnd()) - digi.samplesBegin();
571 ++(lumiCache->hitsCounterMap[detId]);
578 for (
const auto &
rechits : *timingRecHits) {
582 detId_pot.setChannel(0);
586 for (
const auto &rechit :
rechits) {
588 float UFSDShift = 0.0;
589 if (rechit.yWidth() < 3)
592 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
593 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
597 for (
int i = 0;
i < numOfBins; ++
i) {
598 potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + UFSDShift,
599 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
601 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(detId.plane() + UFSDShift,
602 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
607 for (
int i = 0;
i < numOfBins; ++
i)
608 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(detId.plane() + UFSDShift,
609 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
611 potPlots_[detId_pot].recHitTime->Fill(rechit.time());
613 potPlots_[detId_pot].amplitude->Fill(rechit.amplitude());
614 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
618 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
620 0.5 * rechit.xWidth());
621 for (
int i = 0;
i < numOfBins; ++
i)
622 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(startBin +
i));
624 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
625 channelsPerPlaneWithTime[detId_plane]++;
628 channelsPerPlaneWithTime[detId_plane] = 1;
632 potPlots_[detId_pot].triggerCellTime->Fill(rechit.sampicThresholdTime());
633 channelPlots_[detId].triggerCellTime->Fill(rechit.sampicThresholdTime());
645 for (
const auto &
tracks : *timingLocalTracks) {
648 detId_pot.setChannel(0);
652 if (!
track.isValid())
657 TH1F *trackHistoInTimeTmp =
potPlots_[detId_pot].trackDistribution->getTH1F();
661 for (
int i = 0;
i < numOfBins; ++
i) {
662 trackHistoInTimeTmp->Fill(trackHistoInTimeTmp->GetBinCenter(startBin +
i));
666 for (
const auto &tracks_far : *timingLocalTracks) {
669 detId_far.setChannel(0);
670 if (detId_near.arm() != detId_far.arm() || detId_near.station() == detId_far.station())
672 for (
const auto &track_far : tracks_far) {
673 if (!
track.isValid())
677 TH2F *trackHistoTmp =
sectorPlots_[detId_far.armId()].trackCorrelation->getTH2F();
678 TAxis *trackHistoTmpXAxis = trackHistoTmp->GetXaxis();
679 TAxis *trackHistoTmpYAxis = trackHistoTmp->GetYaxis();
680 const int startBin_far =
683 for (
int i = 0;
i < numOfBins; ++
i) {
684 for (
int y = 0;
y < numOfBins_far; ++
y) {
685 trackHistoTmp->Fill(trackHistoTmpXAxis->GetBinCenter(startBin +
i),
686 trackHistoTmpYAxis->GetBinCenter(startBin_far +
y));
688 sectorPlots_[detId_far.armId()].trackCorrelationLowMultiplicity->Fill(
689 trackHistoTmpXAxis->GetBinCenter(startBin +
i), trackHistoTmpYAxis->GetBinCenter(startBin_far +
y));
698 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
699 plt.second.planesWithDigisSet.clear();
700 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
701 plt.second.planesWithTimeSet.clear();
704 for (
const auto &plt : channelsPerPlane)
705 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
707 for (
const auto &plt : channelsPerPlaneWithTime)
708 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_