221 DQM_FRACTION_OF_EVENTS / SEC_PER_LUMI_SECTION;
224 1. / DISPLAY_RESOLUTION_FOR_HITS_MM;
254 digiSentPercentage = ibooker.
book2D(
"sent digis percentage",
255 "sent digis percentage (sampic);board + 0.5 sampic;channel",
256 14, -0.5, 6.5, 16, 0, 16);
269 activityPerBX = ibooker.
book1D(
"activity per BX CMS",
270 title +
" Activity per BX;Event.BX",
271 3600, -1.5, 3598. + 0.5);
273 digiDistribution = ibooker.
book2D(
"digi distribution",
274 title +
" digi distribution;plane;channel",
275 10, -0.5, 4.5, 12, 0, 12);
277 dataSamplesRaw = ibooker.
book1D(
"raw Samples",
278 title +
" Raw Samples; ADC",
281 baseline = ibooker.
book2D(
"baseline",
282 title +
" baseline (V);plane;channel",
283 10, -0.5, 4.5, 12, 0, 12);
284 noiseRMS = ibooker.
book2D(
"noise RMS",
285 title+
" noise RMS (V);plane;channel",
286 10, -0.5, 4.5, 12, 0, 12);
288 digiSent = ibooker.
book2D(
"digis sent",
289 title +
" digi sent (sampic);board + 0.5 sampic;channel",
290 14, -0.5, 6.5, 16, 0, 16);
291 digiAll = ibooker.
book2D(
"all digis",
292 title +
" all digis(sampic);board + 0.5 sampic;channel",
293 14, -0.5, 6.5, 16, 0, 16);
294 digiSentPercentage = ibooker.
book2D(
"sent digis percentage",
295 title +
" sent digis percentage (sampic);board + 0.5 sampic;channel",
296 14, -0.5, 6.5, 16, 0, 16);
298 hitDistribution2d = ibooker.
book2D(
"hits in planes",
299 title+
" hits in planes;plane number;x (mm)",
300 18, -0.5, 4, 15.*INV_DISPLAY_RESOLUTION_FOR_HITS_MM, 0, 15 );
301 hitDistribution2dWithTime = ibooker.
book2D(
"hits in planes with time",
302 title+
" hits in planes with time;plane number;x (mm)",
303 18, -0.5, 4, 15.*INV_DISPLAY_RESOLUTION_FOR_HITS_MM, 0, 15 );
304 hitDistribution2d_lumisection = ibooker.
book2D(
"hits in planes lumisection",
305 title+
" hits in planes in the last lumisection;plane number;x (mm)",
306 18, -0.5, 4, 15.*INV_DISPLAY_RESOLUTION_FOR_HITS_MM, 0, 15 );
308 recHitTime = ibooker.
book1D(
"recHit time",
309 title +
" time in the recHits; t (ns)", 500, -25, 25);
311 title +
" amplitude above baseline; amplitude (V)", 50, 0, 1);
312 tirggerCellTime = ibooker.
book1D(
"trigger cell time",
313 title +
" Trigger Cell Time; t (ns)", 390, -25, 25);
314 baselineRMS = ibooker.
book2D(
"noise RMS",
315 title +
" noise RMS (V);plane;channel",
316 10, -0.5, 4.5, 12, 0, 12);
317 meanAmplitude = ibooker.
book2D(
"mean amplitude",
318 title +
" Mean Amplitude (V);plane;channel",
319 10, -0.5, 4.5, 12, 0, 12);
320 cellOfMax = ibooker.
book2D(
"cell of max", title +
" cell of max (0-23);plane;channel",
321 10, -0.5, 4.5, 12, 0, 12);
323 hitRate = ibooker.
book2D(
"hit rate", title +
" hit rate (Hz);plane;channel",
324 10, -0.5, 4.5, 12, 0, 12);
326 planesWithDigis = ibooker.
book1D(
"active planes digis",
327 title +
" active planes with digis sent (per event);number of active planes",
329 planesWithTime = ibooker.
book1D(
"active planes with time",
330 title +
" active planes with time (per event);number of active planes",
336 stripTomography210 = ibooker.
book2D(
"tomography 210",
337 title +
" tomography (only with time) with strips 210 (all planes);x + 50*plane(mm);y (mm)",
338 190/TOMOGRAPHY_RESOLUTION_MM, -20, 170, 25/TOMOGRAPHY_RESOLUTION_MM, 0, 25);
339 stripTomography220 = ibooker.
book2D(
"tomography 220",
340 title +
" tomography (only with time) with strips 220 (all planes);x + 50*plane(mm);y (mm)",
341 190/TOMOGRAPHY_RESOLUTION_MM, -20, 170, 25/TOMOGRAPHY_RESOLUTION_MM, 0, 25);
354 digiDistribution = ibooker.
book1D(
"digi distribution",
355 title +
" digi distribution;channel",
358 hitProfile = ibooker.
book1D(
"hit distribution with time",
359 title+
" hit distribution (with time);y (+ 15 for x>3) (mm)",
360 30.*INV_DISPLAY_RESOLUTION_FOR_HITS_MM, 0, 30 );
362 hitMultiplicity = ibooker.
book1D(
"channels per plane",
363 title +
" channels per plane; ch per plane",
366 hitMultiplicityWithTime = ibooker.
book1D(
"channels per plane with time",
367 title +
" channels per plane with time; ch per plane",
381 activityPerBX = ibooker.
book1D(
"activity per BX",
382 title +
" Activity per BX;Event.BX",
383 1000, -1.5, 998. + 0.5);
384 dataSamplesRaw = ibooker.
book1D(
"raw samples",
385 title +
" Raw Samples; ADC", 256, 0, 256);
386 cellOfMax = ibooker.
book1D(
"cell of max",
387 title +
" cell of max; cell", 24, 0, 24);
389 tirggerCellTime = ibooker.
book1D(
"sampic trigger time",
390 title +
" Sampic Trigger Time; t (ns)", 100, -25, 25);
391 recHitTime = ibooker.
book1D(
"recHit Time",
392 title +
" recHit Time; t (ns)", 500, -25, 25);
394 title +
" amplitude above baseline; amplitude (V)", 50, 0, 1);
395 noiseSamples = ibooker.
book1D(
"noise samples",
396 title+
" noise samples; V", 50, 0, 1 );
398 hitTime = ibooker.
book1D(
"hit time",
399 title +
"hit time;t - t_previous (us)", 100, 0, 10000);
400 hitRate = ibooker.
book1D(
"hit rate",
401 title +
"hit rate;rate (Hz)", 100, 0, 10000);
403 stripTomography210 = ibooker.
book2D(
"tomography 210",
404 title +
" tomography with strips 210;x (mm);y (mm)",
405 20/TOMOGRAPHY_RESOLUTION_MM, -20, 20,
406 25/TOMOGRAPHY_RESOLUTION_MM, 0, 25);
407 stripTomography220 = ibooker.
book2D(
"tomography 220",
408 title +
" tomography with strips 220;x (mm);y (mm)",
409 20/TOMOGRAPHY_RESOLUTION_MM, -20, 20,
410 25/TOMOGRAPHY_RESOLUTION_MM, 0, 25);
417 ps.getParameter<
edm::InputTag>(
"tagLocalTrack"))),
419 ps.getParameter<
edm::InputTag>(
"tagDigi"))),
421 ps.getParameter<
edm::InputTag>(
"tagRecHits"))),
425 ps.getParameter<
edm::InputTag>(
"tagFEDInfo"))),
426 minimumStripAngleForTomography_(
427 ps.getParameter<double>(
"minimumStripAngleForTomography")),
428 maximumStripAngleForTomography_(
429 ps.getParameter<double>(
"maximumStripAngleForTomography")),
431 ps.getUntrackedParameter<unsigned
int>(
"samplesForNoise", 5)),
432 verbosity_(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
433 timeOfPreviousEvent_(0) {}
497 std::shared_ptr<totemds::Cache>
501 auto d = std::make_shared<totemds::Cache>();
502 d->hitDistribution2dMap.reserve(
potPlots_.size());
504 d->hitDistribution2dMap[
plot.first] = std::unique_ptr<TH2F>(
static_cast<TH2F*
>(
plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
535 valid &= timingDigis.
isValid();
543 <<
"ERROR in TotemTimingDQMSource::analyze > some of the required inputs " 544 "are not valid. Skipping this event.\n" 545 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 546 <<
" fedInfo.isValid = " << fedInfo.
isValid();
553 std::set<uint8_t> boardSet;
554 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
555 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
558 for (
const auto &digis : *timingDigis)
563 detId_pot.setChannel(0);
567 for (
const auto &digi : digis)
574 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
576 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
577 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
579 float boardId = digi.getEventInfo().getHardwareBoardId() +
580 0.5 * digi.getEventInfo().getHardwareSampicId();
581 potPlots_[detId_pot].digiSent->Fill(boardId, digi.getHardwareChannelId());
582 if (boardSet.find(digi.getEventInfo().getHardwareId()) == boardSet.end())
585 boardSet.insert(digi.getEventInfo().getHardwareId());
586 std::bitset<16> chMap(digi.getEventInfo().getChannelMap());
587 for (
int i = 0;
i < 16; ++
i)
591 potPlots_[detId_pot].digiAll->Fill(boardId,
i);
596 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
602 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
604 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
605 channelsPerPlane[detId_plane]++;
607 channelsPerPlane[detId_plane] = 0;
614 for (
auto it = digi.getSamplesBegin(); it != digi.getSamplesEnd(); ++it)
618 digi.getSampleAt(
i));
620 unsigned int cellOfMax =
621 std::max_element(digi.getSamplesBegin(), digi.getSamplesEnd()) -
622 digi.getSamplesBegin();
629 ++(lumiCache->hitsCounterMap[detId]);
635 for (
const auto &
rechits : *timingRecHits)
640 detId_pot.setChannel(0);
644 for (
const auto &rechit :
rechits)
648 potPlots_[detId_pot].amplitude->Fill(rechit.getAmplitude());
651 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
652 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
653 float yCorrected = rechit.getY();
657 float x_shift = detId.plane();
658 x_shift += (rechit.getX()>2)? 0.25 : 0;
659 int startBin = hitHistoTmpYAxis->FindBin( yCorrected - 0.5*rechit.getYWidth() );
661 for (
int i=0;
i<numOfBins; ++
i)
663 potPlots_[detId_pot].hitDistribution2d->Fill(
664 detId.plane() + 0.25 * (rechit.getX()>2),
665 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
666 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(
668 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
674 for (
int i=0;
i<numOfBins; ++
i)
675 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(
676 detId.plane() + 0.25 * (rechit.getX()>2),
677 hitHistoTmpYAxis->GetBinCenter(startBin+
i) );
679 potPlots_[detId_pot].recHitTime->Fill(rechit.getT());
680 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
686 float x_shift = (rechit.getX()>2)? 15 : 0;
687 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
691 float yCorrected = rechit.getY()+
verticalShiftTop_-0.5*rechit.getYWidth()+x_shift;
692 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
693 for (
int i=0;
i<numOfBins; ++
i)
694 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(startBin+
i) );
698 float yCorrected = rechit.getY()+
verticalShiftBot_+0.5*rechit.getYWidth()+(15-x_shift);
699 int startBin = hitProfileHistoTmp->FindBin(yCorrected);
700 int totBins = hitProfileHistoTmp->GetNbinsX();
701 for (
int i=0;
i<numOfBins; ++
i)
702 hitProfileHistoTmp->Fill( hitProfileHistoTmp->GetBinCenter(totBins-startBin+
i) );
705 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
706 channelsPerPlaneWithTime[detId_plane]++;
708 channelsPerPlaneWithTime[detId_plane] = 0;
713 potPlots_[detId_pot].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
714 channelPlots_[detId].tirggerCellTime->Fill(rechit.getSampicThresholdTime());
725 for (
const auto &
rechits : *timingRecHits)
730 detId_pot.setChannel(0);
736 for (
const auto &rechit :
rechits)
745 for (
const auto &ds : *stripTracks) {
767 for (
const auto &striplt : ds) {
768 if (striplt.isValid() && stripId.arm() == detId.arm()) {
775 if (stripId.rp() - detId.rp() ==
778 double x = striplt.getX0() - rp_x;
779 double y = striplt.getY0() - rp_y;
782 potPlots_[detId_pot].stripTomography210->Fill(x + detId.plane()*50, y + y_shift);
783 channelPlots_[detId].stripTomography210->Fill(x, y + y_shift);
787 potPlots_[detId_pot].stripTomography220->Fill(x+detId.plane()*50, y + y_shift);
788 channelPlots_[detId].stripTomography220->Fill(x, y + y_shift);
801 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
802 plt.second.planesWithDigisSet.clear();
803 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
804 plt.second.planesWithTimeSet.clear();
807 for (
const auto &plt : channelsPerPlane) {
808 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
810 for (
const auto &plt : channelsPerPlaneWithTime) {
811 planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
821 auto lumiCache = luminosityBlockCache(iLumi.
index());
823 *(
plot.second.hitDistribution2d_lumisection->getTH2F())=*(lumiCache->hitDistribution2dMap[
plot.first]);
828 for (
auto &
plot : potPlots_) {
829 TH2F *hitHistoTmp =
plot.second.digiSentPercentage->getTH2F();
830 TH2F *histoSent =
plot.second.digiSent->getTH2F();
831 TH2F *histoAll =
plot.second.digiAll->getTH2F();
833 hitHistoTmp->Divide(histoSent, histoAll);
834 hitHistoTmp->Scale(100);
835 hitHistoGlobalTmp->Add(hitHistoTmp,1);
837 plot.second.baseline->Reset();
838 plot.second.noiseRMS->Reset();
839 plot.second.meanAmplitude->Reset();
840 plot.second.cellOfMax->Reset();
841 plot.second.hitRate->Reset();
845 if (chId.
arm() == rpId.
arm() && chId.
rp() == rpId.
rp()) {
846 plot.second.baseline->Fill(
848 chPlot.second.noiseSamples->getTH1F()->GetMean());
849 plot.second.noiseRMS->Fill(
851 chPlot.second.noiseSamples->getTH1F()->GetRMS());
852 plot.second.meanAmplitude->Fill(
854 chPlot.second.amplitude->getTH1F()->GetMean());
855 plot.second.cellOfMax->Fill(
857 chPlot.second.cellOfMax->getTH1F()->GetMean());
858 auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[chPlot.first];
859 plot.second.hitRate->Fill(
867 auto hitsCounterPerLumisection = lumiCache->hitsCounterMap[
plot.first];
868 if (hitsCounterPerLumisection != 0) {
869 plot.second.hitRate->Fill((
double)hitsCounterPerLumisection *
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
Translation translation() const
double minimumStripAngleForTomography_
void channelName(std::string &name, NameFlag flag=nFull) const
void setChannel(uint32_t channel)
void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
LuminosityBlockIndex index() const
std::unordered_map< unsigned int, PlanePlots > planePlots_
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
static const int CTPPS_NUM_OF_ARMS
const DetGeomDesc * getSensorNoThrow(unsigned int id) const
plots related to one Diamond detector package
edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > tokenRecHit_
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
MonitorElement * digiSentPercentage
std::set< unsigned int > planesWithTimeSet
int bunchCrossing() const
void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
static const double TOMOGRAPHY_RESOLUTION_MM
std::unordered_map< unsigned int, unsigned long > hitsCounterMap
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
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
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
Event setup record containing the real (actual) geometry information.
std::unordered_map< unsigned int, std::unique_ptr< TH2F > > hitDistribution2dMap
void endRun(const edm::Run &, const edm::EventSetup &) override
static const double DQM_FRACTION_OF_EVENTS
~TotemTimingDQMSource() override
const DetGeomDesc * getSensor(unsigned int id) const
returns geometry of a detector performs necessary checks, returns NULL if fails
#define DEFINE_FWK_MODULE(type)
static const double SEC_PER_LUMI_SECTION
void setCurrentFolder(std::string const &fullpath)
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)
void rpName(std::string &name, NameFlag flag=nFull) const
LuminosityBlock const & getLuminosityBlock() const
static const int TOTEM_TIMING_TOP_RP_ID
std::unordered_map< unsigned int, PotPlots > potPlots_
void Reset()
reset ME (ie. contents, errors, etc)
unsigned long long TimeValue_t
std::set< unsigned int > planesWithDigisSet
TotemTimingDQMSource(const edm::ParameterSet &)
The manager class for TOTEM RP geometry.
static const float COS_8_DEG
MonitorElement * book2D(Args &&...args)
void setPlane(uint32_t det)
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
static const double SAMPIC_ADC_V
static const float SIN_8_DEG
static const int TOTEM_TIMING_NUM_OF_PLANES
Base class for CTPPS detector IDs.
ESHandle< TrackerGeometry > geometry
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
static const int TOTEM_TIMING_FED_ID_56
T const * product() const
void planeName(std::string &name, NameFlag flag=nFull) const
std::shared_ptr< totemds::Cache > globalBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const override
TimeValue_t value() const
edm::Timestamp time() const
static const int TOTEM_TIMING_NUM_OF_CHANNELS
plots related to one Diamond plane
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...