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)",
419 verbosity_(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
475 auto d = std::make_shared<totemds::Cache>();
476 d->hitDistribution2dMap.reserve(
potPlots_.size());
479 d->hitDistribution2dMap[
plot.first] =
480 std::unique_ptr<TH2F>(
static_cast<TH2F *
>(
plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
511 edm::LogProblem(
"TotemTimingDQMSource") <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs " 512 "are not valid. Skipping this event.\n" 513 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 514 <<
" fedInfo.isValid = " << fedInfo.
isValid();
521 std::set<uint8_t> boardSet;
522 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
523 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
525 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
526 for (
const auto &digis : *timingDigis) {
530 detId_pot.setChannel(0);
534 for (
const auto &digi : digis) {
539 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
541 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
542 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
544 float boardId = digi.eventInfo().hardwareBoardId() + 0.5 * digi.eventInfo().hardwareSampicId();
546 if (boardSet.find(digi.eventInfo().hardwareId()) == boardSet.end()) {
548 boardSet.insert(digi.eventInfo().hardwareId());
549 std::bitset<16> chMap(digi.eventInfo().channelMap());
550 for (
int i = 0;
i < 16; ++
i) {
557 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
562 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
564 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
565 channelsPerPlane[detId_plane]++;
567 channelsPerPlane[detId_plane] = 0;
574 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
579 unsigned int cellOfMax = std::max_element(digi.samplesBegin(), digi.samplesEnd()) - digi.samplesBegin();
585 ++(lumiCache->hitsCounterMap[detId]);
591 for (
const auto &
rechits : *timingRecHits) {
595 detId_pot.setChannel(0);
599 for (
const auto &rechit :
rechits) {
601 potPlots_[detId_pot].amplitude->Fill(rechit.amplitude());
603 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
604 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
605 float yCorrected = rechit.y();
607 float x_shift = detId.plane();
608 x_shift += (rechit.x() > 2) ? 0.25 : 0;
609 int startBin = hitHistoTmpYAxis->FindBin(yCorrected - 0.5 * rechit.yWidth());
611 for (
int i = 0;
i < numOfBins; ++
i) {
612 potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
613 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
615 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(x_shift,
616 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
621 for (
int i = 0;
i < numOfBins; ++
i)
622 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(detId.plane() + 0.25 * (rechit.x() > 2),
623 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
625 potPlots_[detId_pot].recHitTime->Fill(rechit.time());
626 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
631 float x_shift = (rechit.x() > 2) ? 15 : 0;
632 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
635 float yCorrected = rechit.y() +
verticalShiftTop_ - 0.5 * rechit.yWidth() + x_shift;
636 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
637 for (
int i = 0;
i < numOfBins; ++
i)
638 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(startBin +
i));
640 float yCorrected = rechit.y() +
verticalShiftBot_ + 0.5 * rechit.yWidth() + (15 - x_shift);
641 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
642 int totBins = hitProfileHistoTmp->GetNbinsX();
643 for (
int i = 0;
i < numOfBins; ++
i)
644 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(totBins - startBin +
i));
647 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
648 channelsPerPlaneWithTime[detId_plane]++;
650 channelsPerPlaneWithTime[detId_plane] = 0;
654 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.sampicThresholdTime());
655 channelPlots_[detId].tirggerCellTime->Fill(rechit.sampicThresholdTime());
666 for (
const auto &
rechits : *timingRecHits) {
670 detId_pot.setChannel(0);
676 for (
const auto &rechit :
rechits) {
680 for (
const auto &ds : *stripTracks) {
691 rp_x = (
geometry.sensor(plId_V)->translation().x() +
geometry.sensor(plId_U)->translation().x()) / 2;
692 rp_y = (
geometry.sensor(plId_V)->translation().y() +
geometry.sensor(plId_U)->translation().y()) / 2;
697 for (
const auto &striplt : ds) {
698 if (striplt.isValid() && stripId.arm() == detId.arm()) {
704 double x = striplt.x0() - rp_x;
705 double y = striplt.y0() - rp_y;
707 potPlots_[detId_pot].stripTomography210->Fill(
x + detId.plane() * 50,
y + y_shift);
710 potPlots_[detId_pot].stripTomography220->Fill(
x + detId.plane() * 50,
y + y_shift);
723 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
724 plt.second.planesWithDigisSet.clear();
725 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
726 plt.second.planesWithTimeSet.clear();
729 for (
const auto &plt : channelsPerPlane) {
730 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
732 for (
const auto &plt : channelsPerPlaneWithTime) {
733 planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
742 auto lumiCache = luminosityBlockCache(iLumi.
index());
745 *(
plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[
plot.first]);
751 TH2F *hitHistoTmp =
plot.second.digiSentPercentage->getTH2F();
752 TH2F *histoSent =
plot.second.digiSent->getTH2F();
753 TH2F *histoAll =
plot.second.digiAll->getTH2F();
755 hitHistoTmp->Divide(histoSent, histoAll);
756 hitHistoTmp->Scale(100);
757 hitHistoGlobalTmp->Add(hitHistoTmp, 1);
759 plot.second.baseline->Reset();
760 plot.second.noiseRMS->Reset();
761 plot.second.meanAmplitude->Reset();
762 plot.second.cellOfMax->Reset();
763 plot.second.hitRate->Reset();
767 if (chId.
arm() == rpId.
arm() && chId.
rp() == rpId.
rp()) {
768 plot.second.baseline->Fill(chId.
plane(), chId.
channel(), chPlot.second.noiseSamples->getTH1F()->GetMean());
769 plot.second.noiseRMS->Fill(chId.
plane(), chId.
channel(), chPlot.second.noiseSamples->getTH1F()->GetRMS());
770 plot.second.meanAmplitude->Fill(chId.
plane(), chId.
channel(), chPlot.second.amplitude->getTH1F()->GetMean());
771 plot.second.cellOfMax->Fill(chId.
plane(), chId.
channel(), chPlot.second.cellOfMax->getTH1F()->GetMean());
772 auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[chPlot.first];
779 auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[
plot.first];
780 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
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
#define DEFINE_FWK_MODULE(type)
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
bool getData(T &iHolder) const
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 ...