196 path =
path.substr(
path.find(toReplace) + toReplace.length());
197 path =
"CTPPS/DiamondSampic/" +
path;
215 "sent digis percentage",
"sent digis percentage (sampic);board + 0.5 sampic;channel", 14, -0.5, 6.5, 16, 0, 16);
227 trackCorrelation = ibooker.
book2D(
"tracks correlation near-far",
228 title +
" tracks correlation near-far;x (mm);x (mm)",
235 trackCorrelationLowMultiplicity =
236 ibooker.
book2D(
"tracks correlation with low multiplicity near-far",
237 title +
" tracks correlation with low multiplicity near-far;x (mm);x (mm)",
245 digiSentPercentage = ibooker.
book2D(
"sent digis percentage",
246 title +
" sent digis percentage (sampic);board + 0.5 sampic;channel",
265 ibooker.
book2D(
"digi distribution",
title +
" digi distribution;plane;channel", 10, -0.5, 4.5, 12, 0, 12);
267 hitDistribution2d = ibooker.
book2D(
"hits in planes",
268 title +
" hits in planes;plane number;x (mm)",
275 hitDistribution2dWithTime = ibooker.
book2D(
"hits in planes with time",
276 title +
" hits in planes with time;plane number;x (mm)",
284 recHitTime = ibooker.
book1D(
"recHit time",
title +
" recHit time; t (ns)", 500, -25, 25);
285 trackDistribution = ibooker.
book1D(
289 hitDistribution2d_lumisection =
290 ibooker.
book2D(
"hits in planes lumisection",
291 title +
" hits in planes in the last lumisection;plane number;x (mm)",
298 triggerCellTime = ibooker.
book1D(
"trigger cell time",
title +
" Trigger Cell Time; t (ns)", 390, -25, 25);
299 activityPerBX = ibooker.
book1D(
"activity per BX CMS",
title +
" Activity per BX;Event.BX", 3600, -1.5, 3598. + 0.5);
300 amplitude = ibooker.
book1D(
"amplitude",
title +
" amplitude above baseline; amplitude (V)", 50, 0, 1);
301 baselineRMS = ibooker.
book2D(
"noise RMS",
title +
" noise RMS (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
303 ibooker.
book2D(
"mean amplitude",
title +
" Mean Amplitude (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
304 cellOfMax = ibooker.
book2D(
"cell of max",
title +
" cell of max (0-23);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
308 planesWithDigis = ibooker.
book1D(
"active planes digis",
309 title +
" active planes with digis sent (per event);number of active planes",
313 planesWithTime = ibooker.
book1D(
314 "active planes with time",
title +
" active planes with time (per event);number of active planes", 6, -0.5, 5.5);
316 dataSamplesRaw = ibooker.
book1D(
"raw Samples",
title +
" Raw Samples; ADC", 256, 0, 256);
318 baseline = ibooker.
book2D(
"baseline",
title +
" baseline (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
319 noiseRMS = ibooker.
book2D(
"noise RMS",
title +
" noise RMS (V);plane;channel", 10, -0.5, 4.5, 12, 0, 12);
321 digiSent = ibooker.
book2D(
322 "digis sent",
title +
" digi sent (sampic);board + 0.5 sampic;channel", 14, -0.5, 6.5, 16, 0, 16);
324 ibooker.
book2D(
"all digis",
title +
" all digis(sampic);board + 0.5 sampic;channel", 14, -0.5, 6.5, 16, 0, 16);
325 digiSentPercentage = ibooker.
book2D(
"sent digis percentage",
326 title +
" sent digis percentage (sampic);board + 0.5 sampic;channel",
345 digiDistribution = ibooker.
book1D(
"digi distribution",
title +
" digi distribution;channel", 12, 0, 12);
347 hitProfile = ibooker.
book1D(
"hit distribution with time",
348 title +
" hit distribution (with time);x(mm)",
353 hitMultiplicity = ibooker.
book1D(
"channels per plane",
title +
" channels per plane; ch per plane", 13, -0.5, 12.5);
355 hitMultiplicityWithTime = ibooker.
book1D(
356 "channels per plane with time",
title +
" channels per plane with time; ch per plane", 13, -0.5, 12.5);
368 activityPerBX = ibooker.
book1D(
"activity per BX",
title +
" Activity per BX;Event.BX", 1000, -1.5, 998. + 0.5);
369 dataSamplesRaw = ibooker.
book1D(
"raw samples",
title +
" Raw Samples; ADC", 256, 0, 256);
370 cellOfMax = ibooker.
book1D(
"cell of max",
title +
" cell of max; cell", 24, 0, 24);
372 triggerCellTime = ibooker.
book1D(
"sampic trigger time",
title +
" Sampic Trigger Time; t (ns)", 100, -25, 25);
373 recHitTime = ibooker.
book1D(
"recHit Time",
title +
" recHit Time; t (ns)", 500, -25, 25);
374 amplitude = ibooker.
book1D(
"amplitude",
title +
" amplitude above baseline; amplitude (V)", 50, 0, 1);
375 noiseSamples = ibooker.
book1D(
"noise samples",
title +
" noise samples; V", 50, 0, 1);
391 verbosity_(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
406 for (
auto it =
geom->beginSensor(); it !=
geom->endSensor(); it++) {
415 edm::LogProblem(
"DiamondSampicCalibrationDQMSource") <<
"ERROR: no descriptor for detId";
429 for (
auto it =
geom->beginSensor(); it !=
geom->endSensor(); ++it) {
454 auto d = std::make_shared<totemds::Cache>();
455 d->hitDistribution2dMap.reserve(
potPlots_.size());
458 d->hitDistribution2dMap[
plot.first] =
459 std::unique_ptr<TH2F>(
static_cast<TH2F *
>(
plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
487 <<
"ERROR in DiamondSampicDQMSource::analyze > some of the required inputs " 488 "are not valid. Skipping this event.\n" 489 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 490 <<
" fedInfo.isValid = " << fedInfo.
isValid();
497 std::set<uint8_t> boardSet;
498 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
499 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
501 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
503 for (
const auto &digis : *timingDigis) {
507 detId_pot.setChannel(0);
511 for (
const auto &digi : digis) {
514 potPlots_[detId_pot].digiDistribution->Fill(detId.plane(), detId.channel());
519 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it) {
520 potPlots_[detId_pot].dataSamplesRaw->Fill(*it);
523 float boardId = digi.eventInfo().hardwareBoardId() + 0.5 * digi.eventInfo().hardwareSampicId();
526 if (boardSet.find(digi.eventInfo().hardwareId()) == boardSet.end()) {
528 boardSet.insert(digi.eventInfo().hardwareId());
529 std::bitset<16> chMap(digi.eventInfo().channelMap());
530 for (
int i = 0;
i < 16; ++
i) {
537 potPlots_[detId_pot].planesWithDigisSet.insert(detId.plane());
544 planePlots_[detId_plane].digiDistribution->Fill(detId.channel());
546 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
547 channelsPerPlane[detId_plane]++;
550 channelsPerPlane[detId_plane] = 1;
557 for (
auto it = digi.samplesBegin(); it != digi.samplesEnd(); ++it)
562 unsigned int cellOfMax = std::max_element(digi.samplesBegin(), digi.samplesEnd()) - digi.samplesBegin();
568 ++(lumiCache->hitsCounterMap[detId]);
575 for (
const auto &
rechits : *timingRecHits) {
579 detId_pot.setChannel(0);
583 for (
const auto &rechit :
rechits) {
585 float UFSDShift = 0.0;
586 if (rechit.yWidth() < 3)
589 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
590 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
594 for (
int i = 0;
i < numOfBins; ++
i) {
595 potPlots_[detId_pot].hitDistribution2d->Fill(detId.plane() + UFSDShift,
596 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
598 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(detId.plane() + UFSDShift,
599 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
604 for (
int i = 0;
i < numOfBins; ++
i)
605 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(detId.plane() + UFSDShift,
606 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
608 potPlots_[detId_pot].recHitTime->Fill(rechit.time());
610 potPlots_[detId_pot].amplitude->Fill(rechit.amplitude());
611 potPlots_[detId_pot].planesWithTimeSet.insert(detId.plane());
615 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
617 0.5 * rechit.xWidth());
618 for (
int i = 0;
i < numOfBins; ++
i)
619 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(startBin +
i));
621 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
622 channelsPerPlaneWithTime[detId_plane]++;
625 channelsPerPlaneWithTime[detId_plane] = 1;
629 potPlots_[detId_pot].triggerCellTime->Fill(rechit.sampicThresholdTime());
630 channelPlots_[detId].triggerCellTime->Fill(rechit.sampicThresholdTime());
642 for (
const auto &
tracks : *timingLocalTracks) {
645 detId_pot.setChannel(0);
649 if (!
track.isValid())
654 TH1F *trackHistoInTimeTmp =
potPlots_[detId_pot].trackDistribution->getTH1F();
658 for (
int i = 0;
i < numOfBins; ++
i) {
659 trackHistoInTimeTmp->Fill(trackHistoInTimeTmp->GetBinCenter(startBin +
i));
663 for (
const auto &tracks_far : *timingLocalTracks) {
666 detId_far.setChannel(0);
667 if (detId_near.arm() != detId_far.arm() || detId_near.station() == detId_far.station())
669 for (
const auto &track_far : tracks_far) {
670 if (!
track.isValid())
674 TH2F *trackHistoTmp =
sectorPlots_[detId_far.armId()].trackCorrelation->getTH2F();
675 TAxis *trackHistoTmpXAxis = trackHistoTmp->GetXaxis();
676 TAxis *trackHistoTmpYAxis = trackHistoTmp->GetYaxis();
677 const int startBin_far =
680 for (
int i = 0;
i < numOfBins; ++
i) {
681 for (
int y = 0;
y < numOfBins_far; ++
y) {
682 trackHistoTmp->Fill(trackHistoTmpXAxis->GetBinCenter(startBin +
i),
683 trackHistoTmpYAxis->GetBinCenter(startBin_far +
y));
685 sectorPlots_[detId_far.armId()].trackCorrelationLowMultiplicity->Fill(
686 trackHistoTmpXAxis->GetBinCenter(startBin +
i), trackHistoTmpYAxis->GetBinCenter(startBin_far +
y));
695 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
696 plt.second.planesWithDigisSet.clear();
697 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
698 plt.second.planesWithTimeSet.clear();
701 for (
const auto &plt : channelsPerPlane)
702 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
704 for (
const auto &plt : channelsPerPlaneWithTime)
705 planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
713 auto lumiCache = luminosityBlockCache(iLumi.
index());
716 *(
plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[
plot.first]);
719 plot.second.digiSentPercentage->Reset();
722 TH2F *hitHistoTmp =
plot.second.digiSentPercentage->getTH2F();
723 TH2F *histoSent =
plot.second.digiSent->getTH2F();
724 TH2F *histoAll =
plot.second.digiAll->getTH2F();
726 hitHistoTmp->Divide(histoSent, histoAll);
727 hitHistoTmp->Scale(100);
728 hitHistoGlobalTmp->Add(hitHistoTmp, 1);
730 plot.second.baseline->Reset();
731 plot.second.noiseRMS->Reset();
732 plot.second.meanAmplitude->Reset();
733 plot.second.cellOfMax->Reset();
736 TH2F *hitHistoSectorTmp =
sectorPlots_[rpId.
armId()].digiSentPercentage->getTH2F();
737 hitHistoSectorTmp->Add(hitHistoTmp, 1);
741 if (chId.
arm() == rpId.
arm() && chId.
rp() == rpId.
rp()) {
742 plot.second.baseline->Fill(chId.
plane(), chId.
channel(), chPlot.second.noiseSamples->getTH1F()->GetMean());
743 plot.second.noiseRMS->Fill(chId.
plane(), chId.
channel(), chPlot.second.noiseSamples->getTH1F()->GetRMS());
744 plot.second.meanAmplitude->Fill(chId.
plane(), chId.
channel(), chPlot.second.amplitude->getTH1F()->GetMean());
745 plot.second.cellOfMax->Fill(chId.
plane(), chId.
channel(), chPlot.second.cellOfMax->getTH1F()->GetMean());
OptoRx headers and footers.
const Translation & translation() const
plots related to the whole system
MonitorElement * digiSentPercentage
static const double DISPLAY_RESOLUTION_FOR_HITS_MM
edm::TimeValue_t timeOfPreviousEvent_
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * dataSamplesRaw
void setPlane(uint32_t channel)
void dqmBeginRun(const edm::Run &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
MonitorElement * noiseRMS
void setChannel(uint32_t channel)
std::unordered_map< unsigned int, std::unique_ptr< TH2F > > hitDistribution2dMap
MonitorElement * hitProfile
std::unordered_map< unsigned int, PlanePlots > planePlots_
edm::ESGetToken< CTPPSGeometry, VeryForwardRealGeometryRecord > ctppsGeometryRunToken_
MonitorElement * planesWithDigis
static const double INV_DISPLAY_RESOLUTION_FOR_HITS_MM
std::shared_ptr< totemds::Cache > globalBeginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) const override
MonitorElement * trackCorrelation
MonitorElement * amplitude
MonitorElement * digiSent
void planeName(std::string &name, NameFlag flag=nFull) const
plots related to one Diamond plane
MonitorElement * digiSentPercentage
MonitorElement * amplitude
A track fit through a single RP.
MonitorElement * hitDistribution2dWithTime
Event setup record containing the real (actual) geometry information.
plots related to one Diamond detector package
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
static const double SEC_PER_LUMI_SECTION
MonitorElement * baseline
static const double DQM_FRACTION_OF_EVENTS
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
MonitorElement * activityPerBX
MonitorElement * meanAmplitude
MonitorElement * triggerCellTime
MonitorElement * activityPerBX
edm::EDGetTokenT< std::vector< TotemFEDInfo > > tokenFEDInfo_
static const double HIT_RATE_FACTOR
MonitorElement * cellOfMax
MonitorElement * cellOfMax
~DiamondSampicDQMSource() override
void rpName(std::string &name, NameFlag flag=nFull) const
static const double SAMPIC_ADC_V
MonitorElement * digiDistribution
MonitorElement * maxTimeAfterTrigger
MonitorElement * trackCorrelationLowMultiplicity
MonitorElement * dataSamplesRaw
void armName(std::string &name, NameFlag flag=nFull) const
bool getData(T &iHolder) const
MonitorElement * hitMultiplicityWithTime
const DiamondDimensions & getDiamondDimensions() const
MonitorElement * planesWithTime
unsigned long long TimeValue_t
void channelName(std::string &name, NameFlag flag=nFull) const
std::unordered_map< unsigned int, ChannelPlots > channelPlots_
edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > tokenRecHit_
static bool check(unsigned int raw)
returns true if the raw ID is a PPS-timing one
The manager class for TOTEM RP geometry.
std::set< unsigned int > planesWithTimeSet
MonitorElement * recHitTime
MonitorElement * triggerCellTime
auto const & tracks
cannot be loose
std::unordered_map< unsigned int, double > horizontalShiftOfDiamond_
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * digiSentPercentage
static std::string changePathToSampic(std::string path)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
plots related to one Diamond channel
DiamondSampicDQMSource(const edm::ParameterSet &)
MonitorElement * hitMultiplicity
unsigned int trackCorrelationThreshold_
LuminosityBlockIndex index() const
MonitorElement * recHitTime
std::set< unsigned int > planesWithDigisSet
void bookHistograms(DQMStore::IBooker &, const edm::Run &, const edm::EventSetup &) override
static const double LHC_CLOCK_PERIOD_NS
edm::EDGetTokenT< edm::DetSetVector< TotemTimingLocalTrack > > tokenTrack_
MonitorElement * noiseSamples
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
std::unordered_map< unsigned int, unsigned long > hitsCounterMap
edm::EDGetTokenT< edm::DetSetVector< TotemTimingDigi > > tokenDigi_
MonitorElement * hitDistribution2d_lumisection
void globalEndLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::unordered_map< unsigned int, PotPlots > potPlots_
unsigned int samplesForNoise_
MonitorElement * trackDistribution
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > tokenLocalTrack_
MonitorElement * digiDistribution
Log< level::Error, true > LogProblem
std::unordered_map< unsigned int, SectorPlots > sectorPlots_
MonitorElement * baselineRMS
MonitorElement * hitDistribution2d