244 "sent digis percentage",
"sent digis percentage (sampic);board + 0.5 sampic;channel", 14, -0.5, 6.5, 16, 0, 16);
256 activityPerBX = ibooker.
book1D(
"activity per BX CMS",
title +
" Activity per BX;Event.BX", 3600, -1.5, 3598. + 0.5);
259 ibooker.
book2D(
"digi distribution",
title +
" digi distribution;plane;channel", 10, -0.5, 4.5, 12, 0, 12);
261 dataSamplesRaw = ibooker.
book1D(
"raw Samples",
title +
" Raw Samples; ADC", 256, 0, 256);
263 baseline = ibooker.
book2D(
"baseline",
title +
" baseline (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
264 noiseRMS = ibooker.
book2D(
"noise RMS",
title +
" noise RMS (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
267 ibooker.
book2D(
"digis sent",
title +
" digi sent (sampic);board + 0.5 sampic;channel", 14, -0.5, 6.5, 16, 0, 16);
269 ibooker.
book2D(
"all digis",
title +
" all digis(sampic);board + 0.5 sampic;channel", 14, -0.5, 6.5, 16, 0, 16);
270 digiSentPercentage = ibooker.
book2D(
"sent digis percentage",
271 title +
" sent digis percentage (sampic);board + 0.5 sampic;channel",
279 hitDistribution2d = ibooker.
book2D(
"hits in planes",
280 title +
" hits in planes;plane number;x (mm)",
287 hitDistribution2dWithTime = ibooker.
book2D(
"hits in planes with time",
288 title +
" hits in planes with time;plane number;x (mm)",
295 hitDistribution2d_lumisection = ibooker.
book2D(
"hits in planes lumisection",
296 title +
" hits in planes in the last lumisection;plane number;x (mm)",
304 recHitTime = ibooker.
book1D(
"recHit time",
title +
" time in the recHits; t (ns)", 500, -25, 25);
305 amplitude = ibooker.
book1D(
"amplitude",
title +
" amplitude above baseline; amplitude (V)", 50, 0, 1);
306 tirggerCellTime = ibooker.
book1D(
"trigger cell time",
title +
" Trigger Cell Time; t (ns)", 390, -25, 25);
307 baselineRMS = ibooker.
book2D(
"noise RMS",
title +
" noise RMS (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
309 ibooker.
book2D(
"mean amplitude",
title +
" Mean Amplitude (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
310 cellOfMax = ibooker.
book2D(
"cell of max",
title +
" cell of max (0-23);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
312 hitRate = ibooker.
book2D(
"hit rate",
title +
" hit rate (Hz);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
314 planesWithDigis = ibooker.
book1D(
315 "active planes digis",
title +
" active planes with digis sent (per event);number of active planes", 6, -0.5, 5.5);
316 planesWithTime = ibooker.
book1D(
317 "active planes with time",
title +
" active planes with time (per event);number of active planes", 6, -0.5, 5.5);
323 ibooker.
book2D(
"tomography 210",
324 title +
" tomography (only with time) with strips 210 (all planes);x + 50*plane(mm);y (mm)",
332 ibooker.
book2D(
"tomography 220",
333 title +
" tomography (only with time) with strips 220 (all planes);x + 50*plane(mm);y (mm)",
351 digiDistribution = ibooker.
book1D(
"digi distribution",
title +
" digi distribution;channel", 12, 0, 12);
353 hitProfile = ibooker.
book1D(
"hit distribution with time",
354 title +
" hit distribution (with time);y (+ 15 for x>3) (mm)",
359 hitMultiplicity = ibooker.
book1D(
"channels per plane",
title +
" channels per plane; ch per plane", 13, -0.5, 12.5);
361 hitMultiplicityWithTime = ibooker.
book1D(
362 "channels per plane with time",
title +
" channels per plane with time; ch per plane", 13, -0.5, 12.5);
374 activityPerBX = ibooker.
book1D(
"activity per BX",
title +
" Activity per BX;Event.BX", 1000, -1.5, 998. + 0.5);
375 dataSamplesRaw = ibooker.
book1D(
"raw samples",
title +
" Raw Samples; ADC", 256, 0, 256);
376 cellOfMax = ibooker.
book1D(
"cell of max",
title +
" cell of max; cell", 24, 0, 24);
378 tirggerCellTime = ibooker.
book1D(
"sampic trigger time",
title +
" Sampic Trigger Time; t (ns)", 100, -25, 25);
379 recHitTime = ibooker.
book1D(
"recHit Time",
title +
" recHit Time; t (ns)", 500, -25, 25);
380 amplitude = ibooker.
book1D(
"amplitude",
title +
" amplitude above baseline; amplitude (V)", 50, 0, 1);
381 noiseSamples = ibooker.
book1D(
"noise samples",
title +
" noise samples; V", 50, 0, 1);
383 hitTime = ibooker.
book1D(
"hit time",
title +
"hit time;t - t_previous (us)", 100, 0, 10000);
384 hitRate = ibooker.
book1D(
"hit rate",
title +
"hit rate;rate (Hz)", 100, 0, 10000);
386 stripTomography210 = ibooker.
book2D(
"tomography 210",
387 title +
" tomography with strips 210;x (mm);y (mm)",
394 stripTomography220 = ibooker.
book2D(
"tomography 220",
395 title +
" tomography with strips 220;x (mm);y (mm)",
421 verbosity_(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
477 auto d = std::make_shared<totemds::Cache>();
478 d->hitDistribution2dMap.reserve(
potPlots_.size());
481 d->hitDistribution2dMap[
plot.first] =
482 std::unique_ptr<TH2F>(
static_cast<TH2F *
>(
plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
513 edm::LogProblem(
"TotemTimingDQMSource") <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs " 514 "are not valid. Skipping this event.\n" 515 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 516 <<
" fedInfo.isValid = " << fedInfo.
isValid();
523 std::set<uint8_t> boardSet;
524 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
525 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
527 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
528 for (
const auto &digis : *timingDigis) {
532 detId_pot.setChannel(0);
536 for (
const auto &digi : digis) {
541 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
543 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
544 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
546 float boardId = digi.eventInfo().hardwareBoardId() + 0.5 * digi.eventInfo().hardwareSampicId();
548 if (boardSet.find(digi.eventInfo().hardwareId()) == boardSet.end()) {
550 boardSet.insert(digi.eventInfo().hardwareId());
551 std::bitset<16> chMap(digi.eventInfo().channelMap());
552 for (
int i = 0;
i < 16; ++
i) {
559 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
564 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
566 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
567 channelsPerPlane[detId_plane]++;
569 channelsPerPlane[detId_plane] = 0;
576 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
581 unsigned int cellOfMax = std::max_element(digi.samplesBegin(), digi.samplesEnd()) - digi.samplesBegin();
587 ++(lumiCache->hitsCounterMap[detId]);
593 for (
const auto &
rechits : *timingRecHits) {
597 detId_pot.setChannel(0);
601 for (
const auto &rechit :
rechits) {
603 potPlots_[detId_pot].amplitude->Fill(rechit.amplitude());
605 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
606 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
607 float yCorrected = rechit.y();
609 float x_shift = detId.plane();
610 x_shift += (rechit.x() > 2) ? 0.25 : 0;
611 int startBin = hitHistoTmpYAxis->FindBin(yCorrected - 0.5 * rechit.yWidth());
613 for (
int i = 0;
i < numOfBins; ++
i) {
614 potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
615 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
617 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(x_shift,
618 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
623 for (
int i = 0;
i < numOfBins; ++
i)
624 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
625 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
627 potPlots_[detId_pot].recHitTime->Fill(rechit.time());
628 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
633 float x_shift = (rechit.x() > 2) ? 15 : 0;
634 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
637 float yCorrected = rechit.y() +
verticalShiftTop_ - 0.5 * rechit.yWidth() + x_shift;
638 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
639 for (
int i = 0;
i < numOfBins; ++
i)
640 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(startBin +
i));
642 float yCorrected = rechit.y() +
verticalShiftBot_ + 0.5 * rechit.yWidth() + (15 - x_shift);
643 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
644 int totBins = hitProfileHistoTmp->GetNbinsX();
645 for (
int i = 0;
i < numOfBins; ++
i)
646 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(totBins - startBin +
i));
649 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
650 channelsPerPlaneWithTime[detId_plane]++;
652 channelsPerPlaneWithTime[detId_plane] = 0;
656 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.sampicThresholdTime());
657 channelPlots_[detId].tirggerCellTime->Fill(rechit.sampicThresholdTime());
668 for (
const auto &
rechits : *timingRecHits) {
672 detId_pot.setChannel(0);
678 for (
const auto &rechit :
rechits) {
682 for (
const auto &ds : *stripTracks) {
693 rp_x = (
geometry.sensor(plId_V)->translation().x() +
geometry.sensor(plId_U)->translation().x()) / 2;
694 rp_y = (
geometry.sensor(plId_V)->translation().y() +
geometry.sensor(plId_U)->translation().y()) / 2;
699 for (
const auto &striplt : ds) {
700 if (striplt.isValid() && stripId.arm() == detId.arm()) {
706 double x = striplt.x0() - rp_x;
707 double y = striplt.y0() - rp_y;
709 potPlots_[detId_pot].stripTomography210->Fill(
x + detId.plane() * 50,
y + y_shift);
712 potPlots_[detId_pot].stripTomography220->Fill(
x + detId.plane() * 50,
y + y_shift);
725 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
726 plt.second.planesWithDigisSet.clear();
727 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
728 plt.second.planesWithTimeSet.clear();
731 for (
const auto &plt : channelsPerPlane) {
732 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
734 for (
const auto &plt : channelsPerPlaneWithTime) {
735 planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
744 auto lumiCache = luminosityBlockCache(iLumi.
index());
747 *(
plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[
plot.first]);
753 TH2F *hitHistoTmp =
plot.second.digiSentPercentage->getTH2F();
754 TH2F *histoSent =
plot.second.digiSent->getTH2F();
755 TH2F *histoAll =
plot.second.digiAll->getTH2F();
757 hitHistoTmp->Divide(histoSent, histoAll);
758 hitHistoTmp->Scale(100);
759 hitHistoGlobalTmp->Add(hitHistoTmp, 1);
761 plot.second.baseline->Reset();
762 plot.second.noiseRMS->Reset();
763 plot.second.meanAmplitude->Reset();
764 plot.second.cellOfMax->Reset();
765 plot.second.hitRate->Reset();
769 if (chId.
arm() == rpId.
arm() && chId.
rp() == rpId.
rp()) {
770 plot.second.baseline->Fill(chId.
plane(), chId.
channel(), chPlot.second.noiseSamples->getTH1F()->GetMean());
771 plot.second.noiseRMS->Fill(chId.
plane(), chId.
channel(), chPlot.second.noiseSamples->getTH1F()->GetRMS());
772 plot.second.meanAmplitude->Fill(chId.
plane(), chId.
channel(), chPlot.second.amplitude->getTH1F()->GetMean());
773 plot.second.cellOfMax->Fill(chId.
plane(), chId.
channel(), chPlot.second.cellOfMax->getTH1F()->GetMean());
774 auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[chPlot.first];
781 auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[
plot.first];
782 if (hitsCounterPerLumisection != 0) {
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM
static const double LHC_CLOCK_PERIOD_NS
Detector ID class for TOTEM Si strip detectors.
OptoRx headers and footers.
static const int TOTEM_STRIP_MAX_RP_ID
static const int CTPPS_NEAR_RP_ID
static const int TOTEM_STATION_210
const Translation & translation() const
double minimumStripAngleForTomography_
MonitorElement * recHitTime
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
MonitorElement * planesWithTime
void setChannel(uint32_t channel)
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * recHitTime
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * hitProfile
std::unordered_map< unsigned int, PlanePlots > planePlots_
MonitorElement * meanAmplitude
static const int CTPPS_NUM_OF_ARMS
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
MonitorElement * hitMultiplicityWithTime
plots related to one Diamond detector package
MonitorElement * dataSamplesRaw
MonitorElement * dataSamplesRaw
std::unordered_map< unsigned int, std::unique_ptr< TH2F > > hitDistribution2dMap
edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > tokenRecHit_
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
MonitorElement * hitDistribution2dWithTime
MonitorElement * digiSentPercentage
std::set< unsigned int > planesWithTimeSet
void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
MonitorElement * activityPerBX
static const double TOMOGRAPHY_RESOLUTION_MM
static const double SAMPIC_SAMPLING_PERIOD_NS
plots related to one Diamond channel
static const double SAMPIC_MAX_NUMBER_OF_SAMPLES
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
MonitorElement * cellOfMax
MonitorElement * maxTimeAfterTrigger
MonitorElement * cellOfMax
static const double HIT_RATE_FACTOR
static const int TOTEM_STATION_220
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geometryTokenBeginRun_
static const int CTPPS_FAR_RP_ID
A track fit through a single RP.
MonitorElement * noiseRMS
plots related to the whole system
MonitorElement * hitDistribution2d
static const double DQM_FRACTION_OF_EVENTS
~TotemTimingDQMSource() override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
MonitorElement * baselineRMS
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
MonitorElement * tirggerCellTime
MonitorElement * noiseSamples
void channelName(std::string &name, NameFlag flag=nFull) const
MonitorElement * hitMultiplicity
void planeName(std::string &name, NameFlag flag=nFull) const
static const double SEC_PER_LUMI_SECTION
static const int TOTEM_STRIP_MIN_RP_ID
void setPlane(uint32_t channel)
void rpName(std::string &name, NameFlag flag=nFull) const
unsigned int samplesForNoise_
static const int TOTEM_TIMING_STATION_ID
double maximumStripAngleForTomography_
MonitorElement * amplitude
MonitorElement * digiDistribution
MonitorElement * tirggerCellTime
#define DEFINE_FWK_MODULE(type)
static const int TOTEM_TIMING_TOP_RP_ID
std::unordered_map< unsigned int, PotPlots > potPlots_
const DiamondDimensions & getDiamondDimensions() const
unsigned long long TimeValue_t
std::set< unsigned int > planesWithDigisSet
TotemTimingDQMSource(const edm::ParameterSet &)
std::shared_ptr< totemds::Cache > globalBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const override
MonitorElement * stripTomography210
static const float COS_8_DEG
MonitorElement * activityPerBX
MonitorElement * digiSent
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void setPlane(uint32_t det)
static const double SAMPIC_ADC_V
static const float SIN_8_DEG
MonitorElement * stripTomography210
MonitorElement * stripTomography220
static const int TOTEM_TIMING_NUM_OF_PLANES
Base class for CTPPS detector IDs.
LuminosityBlockIndex index() const
MonitorElement * stripTomography220
MonitorElement * planesWithDigis
edm::TimeValue_t timeOfPreviousEvent_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
static const int TOTEM_TIMING_FED_ID_45
std::unordered_map< unsigned int, unsigned long > hitsCounterMap
MonitorElement * baseline
static const double DISPLAY_RESOLUTION_FOR_HITS_MM
static const int TOTEM_TIMING_BOT_RP_ID
MonitorElement * digiDistribution
static const int TOTEM_TIMING_FED_ID_56
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * digiSentPercentage
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > geometryToken_
static const int TOTEM_TIMING_NUM_OF_CHANNELS
plots related to one Diamond plane
Log< level::Error, true > LogProblem
MonitorElement * amplitude
MonitorElement * hitDistribution2d_lumisection
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...