248 "sent digis percentage (sampic);board + 0.5 sampic;channel",
249 14, -0.5, 6.5, 16, 0, 16);
262 activityPerBX = ibooker.
book1D(
"activity per BX CMS",
263 title +
" Activity per BX;Event.BX",
264 3600, -1.5, 3598. + 0.5);
266 digiDistribution = ibooker.
book2D(
"digi distribution",
267 title +
" digi distribution;plane;channel",
268 10, -0.5, 4.5, 12, 0, 12);
270 dataSamplesRaw = ibooker.
book1D(
"raw Samples",
271 title +
" Raw Samples; ADC",
274 baseline = ibooker.
book2D(
"baseline",
275 title +
" baseline (V);plane;channel",
276 10, -0.5, 4.5, 12, 0, 12);
277 noiseRMS = ibooker.
book2D(
"noise RMS",
278 title+
" noise RMS (V);plane;channel",
279 10, -0.5, 4.5, 12, 0, 12);
281 digiSent = ibooker.
book2D(
"digis sent",
282 title +
" digi sent (sampic);board + 0.5 sampic;channel",
283 14, -0.5, 6.5, 16, 0, 16);
284 digiAll = ibooker.
book2D(
"all digis",
285 title +
" all digis(sampic);board + 0.5 sampic;channel",
286 14, -0.5, 6.5, 16, 0, 16);
288 title +
" sent digis percentage (sampic);board + 0.5 sampic;channel",
289 14, -0.5, 6.5, 16, 0, 16);
291 hitDistribution2d = ibooker.
book2D(
"hits in planes",
292 title+
" hits in planes;plane number;x (mm)",
294 hitDistribution2dWithTime = ibooker.
book2D(
"hits in planes with time",
295 title+
" hits in planes with time;plane number;x (mm)",
297 hitDistribution2d_lumisection = ibooker.
book2D(
"hits in planes lumisection",
298 title+
" hits in planes in the last lumisection;plane number;x (mm)",
301 recHitTime = ibooker.
book1D(
"recHit time",
302 title +
" time in the recHits; t (ns)", 500, -25, 25);
304 title +
" amplitude above baseline; amplitude (V)", 50, 0, 1);
305 tirggerCellTime = ibooker.
book1D(
"trigger cell time",
306 title +
" Trigger Cell Time; t (ns)", 390, -25, 25);
307 baselineRMS = ibooker.
book2D(
"noise RMS",
308 title +
" noise RMS (V);plane;channel",
309 10, -0.5, 4.5, 12, 0, 12);
310 meanAmplitude = ibooker.
book2D(
"mean amplitude",
311 title +
" Mean Amplitude (V);plane;channel",
312 10, -0.5, 4.5, 12, 0, 12);
313 cellOfMax = ibooker.
book2D(
"cell of max", title +
" cell of max (0-23);plane;channel",
314 10, -0.5, 4.5, 12, 0, 12);
316 hitRate = ibooker.
book2D(
"hit rate", title +
" hit rate (Hz);plane;channel",
317 10, -0.5, 4.5, 12, 0, 12);
319 planesWithDigis = ibooker.
book1D(
"active planes digis",
320 title +
" active planes with digis sent (per event);number of active planes",
322 planesWithTime = ibooker.
book1D(
"active planes with time",
323 title +
" active planes with time (per event);number of active planes",
329 stripTomography210 = ibooker.
book2D(
"tomography 210",
330 title +
" tomography (only with time) with strips 210 (all planes);x + 50*plane(mm);y (mm)",
332 stripTomography220 = ibooker.
book2D(
"tomography 220",
333 title +
" tomography (only with time) with strips 220 (all planes);x + 50*plane(mm);y (mm)",
347 digiDistribution = ibooker.
book1D(
"digi distribution",
348 title +
" digi distribution;channel",
351 hitProfile = ibooker.
book1D(
"hit distribution with time",
352 title+
" hit distribution (with time);y (+ 15 for x>3) (mm)",
355 hitMultiplicity = ibooker.
book1D(
"channels per plane",
356 title +
" channels per plane; ch per plane",
359 hitMultiplicityWithTime = ibooker.
book1D(
"channels per plane with time",
360 title +
" channels per plane with time; ch per plane",
367 : hitsCounterPerLumisection(0)
376 title +
" Activity per BX;Event.BX",
377 1000, -1.5, 998. + 0.5);
379 title +
" Raw Samples; ADC", 256, 0, 256);
381 title +
" cell of max; cell", 24, 0, 24);
384 title +
" Sampic Trigger Time; t (ns)", 100, -25, 25);
386 title +
" recHit Time; t (ns)", 500, -25, 25);
388 title +
" amplitude above baseline; amplitude (V)", 50, 0, 1);
390 title+
" noise samples; V", 50, 0, 1 );
393 title +
"hit time;t - t_previous (us)", 100, 0, 10000);
395 title +
"hit rate;rate (Hz)", 100, 0, 10000);
398 title +
" tomography with strips 210;x (mm);y (mm)",
402 title +
" tomography with strips 220;x (mm);y (mm)",
411 ps.getParameter<
edm::InputTag>(
"tagLocalTrack"))),
413 ps.getParameter<
edm::InputTag>(
"tagDigi"))),
415 ps.getParameter<
edm::InputTag>(
"tagRecHits"))),
419 ps.getParameter<
edm::InputTag>(
"tagFEDInfo"))),
421 ps.getParameter<double>(
"minimumStripAngleForTomography")),
423 ps.getParameter<double>(
"maximumStripAngleForTomography")),
425 ps.getUntrackedParameter<unsigned
int>(
"samplesForNoise", 5)),
426 verbosity_(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
495 plot.second.hitDistribution2d_lumisection->Reset();
525 valid &= timingDigis.
isValid();
533 <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs " 534 "are not valid. Skipping this event.\n" 535 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 536 <<
" fedInfo.isValid = " << fedInfo.
isValid();
543 std::set<uint8_t> boardSet;
544 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
545 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
547 for (
const auto &digis : *timingDigis)
552 detId_pot.setChannel(0);
556 for (
const auto &digi : digis)
563 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
565 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
566 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
568 float boardId = digi.getEventInfo().getHardwareBoardId() +
569 0.5 * digi.getEventInfo().getHardwareSampicId();
570 potPlots_[detId_pot].digiSent->Fill(boardId, digi.getHardwareChannelId());
571 if (boardSet.find(digi.getEventInfo().getHardwareId()) == boardSet.end())
574 boardSet.insert(digi.getEventInfo().getHardwareId());
575 std::bitset<16> chMap(digi.getEventInfo().getChannelMap());
576 for (
int i = 0;
i < 16; ++
i)
580 potPlots_[detId_pot].digiAll->Fill(boardId,
i);
585 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
591 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
593 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
594 channelsPerPlane[detId_plane]++;
596 channelsPerPlane[detId_plane] = 0;
603 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
607 digi.getSampleAt(
i));
609 unsigned int cellOfMax =
610 std::max_element(digi.getSamplesBegin(), digi.getSamplesEnd()) -
611 digi.getSamplesBegin();
624 for (
const auto &
rechits : *timingRecHits)
629 detId_pot.setChannel(0);
633 for (
const auto &rechit :
rechits)
637 potPlots_[detId_pot].amplitude->Fill(rechit.getAmplitude());
640 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
641 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
642 float yCorrected = rechit.getY();
646 float x_shift = detId.plane();
647 x_shift += (rechit.getX()>2)? 0.25 : 0;
648 int startBin = hitHistoTmpYAxis->FindBin( yCorrected - 0.5*rechit.getYWidth() );
650 for (
int i=0;
i<numOfBins; ++
i)
652 potPlots_[detId_pot].hitDistribution2d->Fill(
653 detId.plane() + 0.25 * (rechit.getX()>2),
654 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
655 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(
657 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
663 for (
int i=0;
i<numOfBins; ++
i)
664 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(
665 detId.plane() + 0.25 * (rechit.getX()>2),
666 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
668 potPlots_[detId_pot].recHitTime->Fill(rechit.getT());
669 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
675 float x_shift = (rechit.getX()>2)? 15 : 0;
676 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
680 float yCorrected = rechit.getY()+
verticalShiftTop_-0.5*rechit.getYWidth()+x_shift;
681 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
682 for (
int i=0;
i<numOfBins; ++
i)
683 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(startBin+
i) );
687 float yCorrected = rechit.getY()+
verticalShiftBot_+0.5*rechit.getYWidth()+(15-x_shift);
688 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
689 int totBins = hitProfileHistoTmp->GetNbinsX();
690 for (
int i=0;
i<numOfBins; ++
i)
691 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(totBins-startBin+
i) );
694 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
695 channelsPerPlaneWithTime[detId_plane]++;
697 channelsPerPlaneWithTime[detId_plane] = 0;
702 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
703 channelPlots_[detId].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
714 for (
const auto &
rechits : *timingRecHits)
719 detId_pot.setChannel(0);
725 for (
const auto &rechit :
rechits)
734 for (
const auto &ds : *stripTracks) {
756 for (
const auto &striplt : ds) {
757 if (striplt.isValid() && stripId.arm() == detId.arm()) {
764 if (stripId.rp() - detId.rp() ==
767 double x = striplt.getX0() - rp_x;
768 double y = striplt.getY0() - rp_y;
771 potPlots_[detId_pot].stripTomography210->Fill(x + detId.plane()*50, y + y_shift);
772 channelPlots_[detId].stripTomography210->Fill(x, y + y_shift);
776 potPlots_[detId_pot].stripTomography220->Fill(x+detId.plane()*50, y + y_shift);
777 channelPlots_[detId].stripTomography220->Fill(x, y + y_shift);
790 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
791 plt.second.planesWithDigisSet.clear();
792 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
793 plt.second.planesWithTimeSet.clear();
796 for (
const auto &plt : channelsPerPlane) {
797 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
799 for (
const auto &plt : channelsPerPlaneWithTime) {
800 planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
813 TH2F *hitHistoTmp =
plot.second.digiSentPercentage->getTH2F();
814 TH2F *histoSent =
plot.second.digiSent->getTH2F();
815 TH2F *histoAll =
plot.second.digiAll->getTH2F();
817 hitHistoTmp->Divide(histoSent, histoAll);
818 hitHistoTmp->Scale(100);
819 hitHistoGlobalTmp->Add(hitHistoTmp,1);
821 plot.second.baseline->Reset();
822 plot.second.noiseRMS->Reset();
823 plot.second.meanAmplitude->Reset();
824 plot.second.cellOfMax->Reset();
825 plot.second.hitRate->Reset();
829 if (chId.
arm() == rpId.
arm() && chId.
rp() == rpId.
rp()) {
830 plot.second.baseline->Fill(
832 chPlot.second.noiseSamples->getTH1F()->GetMean());
833 plot.second.noiseRMS->Fill(
835 chPlot.second.noiseSamples->getTH1F()->GetRMS());
836 plot.second.meanAmplitude->Fill(
838 chPlot.second.amplitude->getTH1F()->GetMean());
839 plot.second.cellOfMax->Fill(
841 chPlot.second.cellOfMax->getTH1F()->GetMean());
842 plot.second.hitRate->Fill(
850 if (
plot.second.hitsCounterPerLumisection != 0) {
851 plot.second.hitRate->Fill((
double)
plot.second.hitsCounterPerLumisection *
854 plot.second.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
double minimumStripAngleForTomography_
void channelName(std::string &name, NameFlag flag=nFull) const
MonitorElement * recHitTime
void setChannel(uint32_t channel)
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
std::unordered_map< unsigned int, PlanePlots > planePlots_
static const int CTPPS_NUM_OF_ARMS
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
const DetGeomDesc * getSensorNoThrow(unsigned int id) const
#define DEFINE_FWK_MODULE(type)
plots related to one Diamond detector package
MonitorElement * dataSamplesRaw
edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > tokenRecHit_
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
MonitorElement * digiSentPercentage
std::set< unsigned int > planesWithTimeSet
int bunchCrossing() const
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
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
static const double HIT_RATE_FACTOR
static const int TOTEM_STATION_220
static const int CTPPS_FAR_RP_ID
A track fit through a single RP.
plots related to the whole system
Event setup record containing the real (actual) geometry information.
void endRun(const edm::Run &, const edm::EventSetup &) override
static const double DQM_FRACTION_OF_EVENTS
~TotemTimingDQMSource() override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
MonitorElement * noiseSamples
const DetGeomDesc * getSensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
static const double SEC_PER_LUMI_SECTION
static const int TOTEM_STRIP_MIN_RP_ID
void setPlane(uint32_t channel)
unsigned int samplesForNoise_
static const int TOTEM_TIMING_STATION_ID
double maximumStripAngleForTomography_
Geometrical description of a sensor.
MonitorElement * book1D(Args &&...args)
DDTranslation translation() const
void rpName(std::string &name, NameFlag flag=nFull) const
MonitorElement * tirggerCellTime
static const int TOTEM_TIMING_TOP_RP_ID
std::unordered_map< unsigned int, PotPlots > potPlots_
void Reset()
reset ME (ie. contents, errors, etc)
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
unsigned long long TimeValue_t
std::set< unsigned int > planesWithDigisSet
TotemTimingDQMSource(const edm::ParameterSet &)
The manager class for TOTEM RP geometry.
void setCurrentFolder(const std::string &fullpath)
static const float COS_8_DEG
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
MonitorElement * book2D(Args &&...args)
MonitorElement * activityPerBX
void setPlane(uint32_t det)
static const double SAMPIC_ADC_V
static const float SIN_8_DEG
MonitorElement * stripTomography210
static const int TOTEM_TIMING_NUM_OF_PLANES
Base class for CTPPS detector IDs.
ESHandle< TrackerGeometry > geometry
MonitorElement * stripTomography220
edm::TimeValue_t timeOfPreviousEvent_
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
std::vector< double > params() const
static const int TOTEM_TIMING_FED_ID_45
static const double DISPLAY_RESOLUTION_FOR_HITS_MM
static const int TOTEM_TIMING_BOT_RP_ID
unsigned long hitsCounterPerLumisection
static const int TOTEM_TIMING_FED_ID_56
T const * product() const
void planeName(std::string &name, NameFlag flag=nFull) const
TimeValue_t value() const
edm::Timestamp time() const
static const int TOTEM_TIMING_NUM_OF_CHANNELS
plots related to one Diamond plane
MonitorElement * amplitude
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...