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);
394 verbosity_(ps.getUntrackedParameter<unsigned
int>(
"verbosity", 0)),
409 for (
auto it =
geom->beginSensor();
it !=
geom->endSensor();
it++) {
418 edm::LogProblem(
"DiamondSampicCalibrationDQMSource") <<
"ERROR: no descriptor for detId";
432 for (
auto it =
geom->beginSensor();
it !=
geom->endSensor(); ++
it) {
457 auto d = std::make_shared<totemds::Cache>();
458 d->hitDistribution2dMap.reserve(
potPlots_.size());
461 d->hitDistribution2dMap[
plot.first] =
462 std::unique_ptr<TH2F>(
static_cast<TH2F *
>(
plot.second.hitDistribution2d_lumisection->getTH2F()->Clone()));
490 <<
"ERROR in DiamondSampicDQMSource::analyze > some of the required inputs " 491 "are not valid. Skipping this event.\n" 492 <<
" timingDigis.isValid = " << timingDigis.
isValid() <<
"\n" 493 <<
" fedInfo.isValid = " << fedInfo.
isValid();
500 std::set<uint8_t> boardSet;
501 std::unordered_map<unsigned int, unsigned int> channelsPerPlane;
502 std::unordered_map<unsigned int, unsigned int> channelsPerPlaneWithTime;
504 auto lumiCache = luminosityBlockCache(
event.getLuminosityBlock().index());
506 for (
const auto &digis : *timingDigis) {
510 detId_pot.setChannel(0);
514 for (
const auto &digi : digis) {
522 for (
auto it = digi.samplesBegin();
it != digi.samplesEnd(); ++
it) {
526 float boardId = digi.eventInfo().hardwareBoardId() + 0.5 * digi.eventInfo().hardwareSampicId();
529 if (boardSet.find(digi.eventInfo().hardwareId()) == boardSet.end()) {
531 boardSet.insert(digi.eventInfo().hardwareId());
532 std::bitset<16> chMap(digi.eventInfo().channelMap());
533 for (
int i = 0;
i < 16; ++
i) {
549 if (channelsPerPlane.find(detId_plane) != channelsPerPlane.end())
550 channelsPerPlane[detId_plane]++;
553 channelsPerPlane[detId_plane] = 1;
560 for (
auto it = digi.samplesBegin();
it != digi.samplesEnd(); ++
it)
565 unsigned int cellOfMax = std::max_element(digi.samplesBegin(), digi.samplesEnd()) - digi.samplesBegin();
571 ++(lumiCache->hitsCounterMap[
detId]);
578 for (
const auto &rechits : *timingRecHits) {
582 detId_pot.setChannel(0);
586 for (
const auto &rechit : rechits) {
588 float UFSDShift = 0.0;
589 if (rechit.yWidth() < 3)
592 TH2F *hitHistoTmp =
potPlots_[detId_pot].hitDistribution2d->getTH2F();
593 TAxis *hitHistoTmpYAxis = hitHistoTmp->GetYaxis();
597 for (
int i = 0;
i < numOfBins; ++
i) {
598 potPlots_[detId_pot].hitDistribution2d->Fill(
detId.plane() + UFSDShift,
599 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
601 potPlots_[detId_pot].hitDistribution2d_lumisection->Fill(
detId.plane() + UFSDShift,
602 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
607 for (
int i = 0;
i < numOfBins; ++
i)
608 potPlots_[detId_pot].hitDistribution2dWithTime->Fill(
detId.plane() + UFSDShift,
609 hitHistoTmpYAxis->GetBinCenter(startBin +
i));
611 potPlots_[detId_pot].recHitTime->Fill(rechit.time());
613 potPlots_[detId_pot].amplitude->Fill(rechit.amplitude());
618 TH1F *hitProfileHistoTmp =
planePlots_[detId_plane].hitProfile->getTH1F();
620 0.5 * rechit.xWidth());
621 for (
int i = 0;
i < numOfBins; ++
i)
622 hitProfileHistoTmp->Fill(hitProfileHistoTmp->GetBinCenter(startBin +
i));
624 if (channelsPerPlaneWithTime.find(detId_plane) != channelsPerPlaneWithTime.end())
625 channelsPerPlaneWithTime[detId_plane]++;
628 channelsPerPlaneWithTime[detId_plane] = 1;
632 potPlots_[detId_pot].triggerCellTime->Fill(rechit.sampicThresholdTime());
645 for (
const auto &
tracks : *timingLocalTracks) {
648 detId_pot.setChannel(0);
652 if (!
track.isValid())
657 TH1F *trackHistoInTimeTmp =
potPlots_[detId_pot].trackDistribution->getTH1F();
661 for (
int i = 0;
i < numOfBins; ++
i) {
662 trackHistoInTimeTmp->Fill(trackHistoInTimeTmp->GetBinCenter(startBin +
i));
666 for (
const auto &tracks_far : *timingLocalTracks) {
669 detId_far.setChannel(0);
670 if (detId_near.arm() != detId_far.arm() || detId_near.station() == detId_far.station())
672 for (
const auto &track_far : tracks_far) {
673 if (!
track.isValid())
677 TH2F *trackHistoTmp =
sectorPlots_[detId_far.armId()].trackCorrelation->getTH2F();
678 TAxis *trackHistoTmpXAxis = trackHistoTmp->GetXaxis();
679 TAxis *trackHistoTmpYAxis = trackHistoTmp->GetYaxis();
680 const int startBin_far =
683 for (
int i = 0;
i < numOfBins; ++
i) {
684 for (
int y = 0;
y < numOfBins_far; ++
y) {
685 trackHistoTmp->Fill(trackHistoTmpXAxis->GetBinCenter(startBin +
i),
686 trackHistoTmpYAxis->GetBinCenter(startBin_far +
y));
688 sectorPlots_[detId_far.armId()].trackCorrelationLowMultiplicity->Fill(
689 trackHistoTmpXAxis->GetBinCenter(startBin +
i), trackHistoTmpYAxis->GetBinCenter(startBin_far +
y));
698 plt.second.planesWithDigis->Fill(plt.second.planesWithDigisSet.size());
699 plt.second.planesWithDigisSet.clear();
700 plt.second.planesWithTime->Fill(plt.second.planesWithTimeSet.size());
701 plt.second.planesWithTimeSet.clear();
704 for (
const auto &plt : channelsPerPlane)
705 planePlots_[plt.first].hitMultiplicity->Fill(plt.second);
707 for (
const auto &plt : channelsPerPlaneWithTime)
708 planePlots_[plt.first].hitMultiplicityWithTime->Fill(plt.second);
716 auto lumiCache = luminosityBlockCache(iLumi.
index());
719 *(
plot.second.hitDistribution2d_lumisection->getTH2F()) = *(lumiCache->hitDistribution2dMap[
plot.first]);
722 plot.second.digiSentPercentage->Reset();
725 TH2F *hitHistoTmp =
plot.second.digiSentPercentage->getTH2F();
726 TH2F *histoSent =
plot.second.digiSent->getTH2F();
727 TH2F *histoAll =
plot.second.digiAll->getTH2F();
729 hitHistoTmp->Divide(histoSent, histoAll);
730 hitHistoTmp->Scale(100);
731 hitHistoGlobalTmp->Add(hitHistoTmp, 1);
733 plot.second.baseline->Reset();
734 plot.second.noiseRMS->Reset();
735 plot.second.meanAmplitude->Reset();
736 plot.second.cellOfMax->Reset();
739 TH2F *hitHistoSectorTmp =
sectorPlots_[rpId.
armId()].digiSentPercentage->getTH2F();
740 hitHistoSectorTmp->Add(hitHistoTmp, 1);
744 if (chId.
arm() == rpId.
arm() && chId.
rp() == rpId.
rp()) {
745 plot.second.baseline->Fill(chId.
plane(), chId.
channel(), chPlot.second.noiseSamples->getTH1F()->GetMean());
746 plot.second.noiseRMS->Fill(chId.
plane(), chId.
channel(), chPlot.second.noiseSamples->getTH1F()->GetRMS());
747 plot.second.meanAmplitude->Fill(chId.
plane(), chId.
channel(), chPlot.second.amplitude->getTH1F()->GetMean());
748 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
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
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
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
#define DEFINE_FWK_MODULE(type)
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
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