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)),
494 plot.second.hitDistribution2d_lumisection->Reset();
524 valid &= timingDigis.
isValid();
532 <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs " 533 "are not valid. Skipping this event.\n" 534 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 535 <<
" fedInfo.isValid = " << fedInfo.
isValid();
542 std::set<uint8_t> boardSet;
543 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
544 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
546 for (
const auto &digis : *timingDigis)
551 detId_pot.setChannel(0);
555 for (
const auto &digi : digis)
562 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
564 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
565 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
567 float boardId = digi.getEventInfo().getHardwareBoardId() +
568 0.5 * digi.getEventInfo().getHardwareSampicId();
569 potPlots_[detId_pot].digiSent->Fill(boardId, digi.getHardwareChannelId());
570 if (boardSet.find(digi.getEventInfo().getHardwareId()) == boardSet.end())
573 boardSet.insert(digi.getEventInfo().getHardwareId());
574 std::bitset<16> chMap(digi.getEventInfo().getChannelMap());
575 for (
int i = 0;
i < 16; ++
i)
579 potPlots_[detId_pot].digiAll->Fill(boardId,
i);
584 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
590 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
592 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
593 channelsPerPlane[detId_plane]++;
595 channelsPerPlane[detId_plane] = 0;
602 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
606 digi.getSampleAt(
i));
608 unsigned int cellOfMax =
609 std::max_element(digi.getSamplesBegin(), digi.getSamplesEnd()) -
610 digi.getSamplesBegin();
623 for (
const auto &
rechits : *timingRecHits)
628 detId_pot.setChannel(0);
632 for (
const auto &rechit :
rechits)
636 potPlots_[detId_pot].amplitude->Fill(rechit.getAmplitude());
639 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
640 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
641 float yCorrected = rechit.getY();
645 float x_shift = detId.plane();
646 x_shift += (rechit.getX()>2)? 0.25 : 0;
647 int startBin = hitHistoTmpYAxis->FindBin( yCorrected - 0.5*rechit.getYWidth() );
649 for (
int i=0;
i<numOfBins; ++
i)
651 potPlots_[detId_pot].hitDistribution2d->Fill(
652 detId.plane() + 0.25 * (rechit.getX()>2),
653 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
654 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(
656 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
662 for (
int i=0;
i<numOfBins; ++
i)
663 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(
664 detId.plane() + 0.25 * (rechit.getX()>2),
665 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
667 potPlots_[detId_pot].recHitTime->Fill(rechit.getT());
668 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
674 float x_shift = (rechit.getX()>2)? 15 : 0;
675 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
679 float yCorrected = rechit.getY()+
verticalShiftTop_-0.5*rechit.getYWidth()+x_shift;
680 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
681 for (
int i=0;
i<numOfBins; ++
i)
682 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(startBin+
i) );
686 float yCorrected = rechit.getY()+
verticalShiftBot_+0.5*rechit.getYWidth()+(15-x_shift);
687 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
688 int totBins = hitProfileHistoTmp->GetNbinsX();
689 for (
int i=0;
i<numOfBins; ++
i)
690 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(totBins-startBin+
i) );
693 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
694 channelsPerPlaneWithTime[detId_plane]++;
696 channelsPerPlaneWithTime[detId_plane] = 0;
701 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
702 channelPlots_[detId].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
713 for (
const auto &
rechits : *timingRecHits)
718 detId_pot.setChannel(0);
724 for (
const auto &rechit :
rechits)
733 for (
const auto &ds : *stripTracks) {
755 for (
const auto &striplt : ds) {
756 if (striplt.isValid() && stripId.arm() == detId.arm()) {
763 if (stripId.rp() - detId.rp() ==
766 double x = striplt.getX0() - rp_x;
767 double y = striplt.getY0() - rp_y;
770 potPlots_[detId_pot].stripTomography210->Fill(x + detId.plane()*50, y + y_shift);
771 channelPlots_[detId].stripTomography210->Fill(x, y + y_shift);
775 potPlots_[detId_pot].stripTomography220->Fill(x+detId.plane()*50, y + y_shift);
776 channelPlots_[detId].stripTomography220->Fill(x, y + y_shift);
789 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
790 plt.second.planesWithDigisSet.clear();
791 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
792 plt.second.planesWithTimeSet.clear();
795 for (
const auto &plt : channelsPerPlane) {
796 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
798 for (
const auto &plt : channelsPerPlaneWithTime) {
799 planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
812 TH2F *hitHistoTmp =
plot.second.digiSentPercentage->getTH2F();
813 TH2F *histoSent =
plot.second.digiSent->getTH2F();
814 TH2F *histoAll =
plot.second.digiAll->getTH2F();
816 hitHistoTmp->Divide(histoSent, histoAll);
817 hitHistoTmp->Scale(100);
818 hitHistoGlobalTmp->Add(hitHistoTmp,1);
820 plot.second.baseline->Reset();
821 plot.second.noiseRMS->Reset();
822 plot.second.meanAmplitude->Reset();
823 plot.second.cellOfMax->Reset();
824 plot.second.hitRate->Reset();
828 if (chId.
arm() == rpId.
arm() && chId.
rp() == rpId.
rp()) {
829 plot.second.baseline->Fill(
831 chPlot.second.noiseSamples->getTH1F()->GetMean());
832 plot.second.noiseRMS->Fill(
834 chPlot.second.noiseSamples->getTH1F()->GetRMS());
835 plot.second.meanAmplitude->Fill(
837 chPlot.second.amplitude->getTH1F()->GetMean());
838 plot.second.cellOfMax->Fill(
840 chPlot.second.cellOfMax->getTH1F()->GetMean());
841 plot.second.hitRate->Fill(
849 if (
plot.second.hitsCounterPerLumisection != 0) {
850 plot.second.hitRate->Fill((
double)
plot.second.hitsCounterPerLumisection *
853 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
#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 ...