CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
Phase2TrackerMonitorDigi Class Reference

#include <Phase2TrackerMonitorDigi.cc>

Inheritance diagram for Phase2TrackerMonitorDigi:
DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Classes

struct  DigiMEs
 
struct  Ph2DigiCluster
 

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
 
void dqmBeginRun (const edm::Run &iRun, const edm::EventSetup &iSetup) override
 
std::string getHistoId (uint32_t det_id, bool flag)
 
 Phase2TrackerMonitorDigi (const edm::ParameterSet &)
 
 ~Phase2TrackerMonitorDigi () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Public Attributes

MonitorElementRZOccupancyMap
 
MonitorElementRZPositionMap
 
MonitorElementXYOccupancyMap
 
MonitorElementXYPositionMap
 

Private Member Functions

void bookLayerHistos (DQMStore::IBooker &ibooker, unsigned int det_id)
 
void fillDigiClusters (DigiMEs &mes, std::vector< Ph2DigiCluster > &digi_clusters)
 
void fillITPixelDigiHistos (const edm::Handle< edm::DetSetVector< PixelDigi >> handle)
 
void fillOTDigiHistos (const edm::Handle< edm::DetSetVector< Phase2TrackerDigi >> handle)
 

Private Attributes

const bool clsFlag_
 
const edm::ParameterSet config_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
const std::string geomType_
 
const edm::InputTag itPixelDigiSrc_
 
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > itPixelDigiToken_
 
std::map< std::string, DigiMEslayerMEs
 
const edm::InputTag otDigiSrc_
 
const edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > otDigiToken_
 
const bool pixelFlag_
 
const TrackerGeometrytkGeom_ = nullptr
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 
const TrackerTopologytTopo_ = nullptr
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Description: It generates various histograms of digi properties. Manual switching is enabled for each histogram. Seperate Histograms are there for P type and S type sensors of the outer Tracker

Definition at line 48 of file Phase2TrackerMonitorDigi.cc.

Constructor & Destructor Documentation

◆ Phase2TrackerMonitorDigi()

Phase2TrackerMonitorDigi::Phase2TrackerMonitorDigi ( const edm::ParameterSet iConfig)
explicit

Definition at line 116 of file Phase2TrackerMonitorDigi.cc.

References LogDebug.

117  : config_(iConfig),
118  pixelFlag_(config_.getParameter<bool>("PixelPlotFillingFlag")),
119  clsFlag_(config_.getParameter<bool>("StandAloneClusteriserFlag")),
120  geomType_(config_.getParameter<std::string>("GeometryType")),
121  otDigiSrc_(config_.getParameter<edm::InputTag>("OuterTrackerDigiSource")),
122  itPixelDigiSrc_(config_.getParameter<edm::InputTag>("InnerPixelDigiSource")),
125  geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
126  topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) {
127  LogDebug("Phase2TrackerMonitorDigi") << ">>> Construct Phase2TrackerMonitorDigi ";
128 }
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const edm::ParameterSet config_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > itPixelDigiToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
const edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > otDigiToken_
#define LogDebug(id)

◆ ~Phase2TrackerMonitorDigi()

Phase2TrackerMonitorDigi::~Phase2TrackerMonitorDigi ( )
override

Definition at line 133 of file Phase2TrackerMonitorDigi.cc.

References LogDebug.

133  {
134  // do anything here that needs to be done at desctruction time
135  // (e.g. close files, deallocate resources etc.)
136  LogDebug("Phase2TrackerMonitorDigi") << ">>> Destroy Phase2TrackerMonitorDigi ";
137 }
#define LogDebug(id)

Member Function Documentation

◆ analyze()

void Phase2TrackerMonitorDigi::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 146 of file Phase2TrackerMonitorDigi.cc.

References edm::ESWatcher< T >::check(), fillITPixelDigiHistos(), fillOTDigiHistos(), iEvent, itPixelDigiToken_, otDigiToken_, and pixelFlag_.

146  {
147  using namespace edm;
148 
149  // Get digis
150  const auto& pixDigiHandle = iEvent.getHandle(itPixelDigiToken_);
151  const auto& otDigiHandle = iEvent.getHandle(otDigiToken_);
152 
153  // Tracker Topology
154  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
155  if (theTkDigiGeomWatcher.check(iSetup)) {
156  if (pixelFlag_)
157  fillITPixelDigiHistos(pixDigiHandle);
158  else
159  fillOTDigiHistos(otDigiHandle);
160  }
161 }
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > itPixelDigiToken_
void fillOTDigiHistos(const edm::Handle< edm::DetSetVector< Phase2TrackerDigi >> handle)
void fillITPixelDigiHistos(const edm::Handle< edm::DetSetVector< PixelDigi >> handle)
int iEvent
Definition: GenABIO.cc:224
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
HLT enums.
const edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > otDigiToken_

◆ bookHistograms()

void Phase2TrackerMonitorDigi::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 404 of file Phase2TrackerMonitorDigi.cc.

References dqm::implementation::IBooker::book2D(), bookLayerHistos(), dqm::implementation::IBooker::bookProfile2D(), dqm::implementation::NavigatorBase::cd(), config_, TrackerGeometry::detUnits(), fed_dqm_sourceclient-live_cfg::folder_name, edm::ParameterSet::getParameter(), RZOccupancyMap, RZPositionMap, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, tkGeom_, XYOccupancyMap, and XYPositionMap.

406  {
407  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
408  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
409 
410  if (theTkDigiGeomWatcher.check(iSetup)) {
411  for (auto const& det_u : tkGeom_->detUnits()) {
412  unsigned int detId_raw = det_u->geographicalId().rawId();
413  bookLayerHistos(ibooker, detId_raw);
414  }
415  }
416  ibooker.cd();
417  std::stringstream folder_name;
418  folder_name << top_folder << "/"
419  << "DigiMonitor";
420  ibooker.setCurrentFolder(folder_name.str());
421 
423  edm::ParameterSet ParametersOcc = config_.getParameter<edm::ParameterSet>("DigiOccupancyPH");
424  if (Parameters.getParameter<bool>("switch"))
425  XYPositionMap = ibooker.book2D("DigiXPosVsYPos",
426  "DigiXPosVsYPos",
427  Parameters.getParameter<int32_t>("Nxbins"),
428  Parameters.getParameter<double>("xmin"),
429  Parameters.getParameter<double>("xmax"),
430  Parameters.getParameter<int32_t>("Nybins"),
431  Parameters.getParameter<double>("ymin"),
432  Parameters.getParameter<double>("ymax"));
433  else
434  XYPositionMap = nullptr;
435 
436  if (Parameters.getParameter<bool>("switch") && ParametersOcc.getParameter<bool>("switch"))
437  XYOccupancyMap = ibooker.bookProfile2D("OccupancyInXY",
438  "OccupancyInXY",
439  Parameters.getParameter<int32_t>("Nxbins"),
440  Parameters.getParameter<double>("xmin"),
441  Parameters.getParameter<double>("xmax"),
442  Parameters.getParameter<int32_t>("Nybins"),
443  Parameters.getParameter<double>("ymin"),
444  Parameters.getParameter<double>("ymax"),
445  ParametersOcc.getParameter<double>("xmin"),
446  ParametersOcc.getParameter<double>("xmax"));
447  else
448  XYOccupancyMap = nullptr;
449 
450  Parameters = config_.getParameter<edm::ParameterSet>("RZPositionMapH");
451  if (Parameters.getParameter<bool>("switch"))
452  RZPositionMap = ibooker.book2D("DigiRPosVsZPos",
453  "DigiRPosVsZPos",
454  Parameters.getParameter<int32_t>("Nxbins"),
455  Parameters.getParameter<double>("xmin"),
456  Parameters.getParameter<double>("xmax"),
457  Parameters.getParameter<int32_t>("Nybins"),
458  Parameters.getParameter<double>("ymin"),
459  Parameters.getParameter<double>("ymax"));
460  else
461  RZPositionMap = nullptr;
462 
463  if (Parameters.getParameter<bool>("switch") && ParametersOcc.getParameter<bool>("switch"))
464  RZOccupancyMap = ibooker.bookProfile2D("OccupancyInRZ",
465  "OccupancyInRZ",
466  Parameters.getParameter<int32_t>("Nxbins"),
467  Parameters.getParameter<double>("xmin"),
468  Parameters.getParameter<double>("xmax"),
469  Parameters.getParameter<int32_t>("Nybins"),
470  Parameters.getParameter<double>("ymin"),
471  Parameters.getParameter<double>("ymax"),
472  ParametersOcc.getParameter<double>("xmin"),
473  ParametersOcc.getParameter<double>("xmax"));
474  else
475  RZOccupancyMap = nullptr;
476 }
const edm::ParameterSet config_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:485
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
const TrackerGeometry * tkGeom_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:32
void bookLayerHistos(DQMStore::IBooker &ibooker, unsigned int det_id)

◆ bookLayerHistos()

void Phase2TrackerMonitorDigi::bookLayerHistos ( DQMStore::IBooker ibooker,
unsigned int  det_id 
)
private

Definition at line 480 of file Phase2TrackerMonitorDigi.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookProfile(), dqm::implementation::NavigatorBase::cd(), Phase2TrackerMonitorDigi::DigiMEs::ChargeOfDigis, Phase2TrackerMonitorDigi::DigiMEs::ChargeOfDigisVsWidth, Phase2TrackerMonitorDigi::DigiMEs::ChargeXYMap, clsFlag_, Phase2TrackerMonitorDigi::DigiMEs::ClusterPositionP, Phase2TrackerMonitorDigi::DigiMEs::ClusterPositionS, Phase2TrackerMonitorDigi::DigiMEs::ClusterWidth, config_, Phase2TrackerMonitorDigi::DigiMEs::DigiOccupancyP, Phase2TrackerMonitorDigi::DigiMEs::DigiOccupancyS, Phase2TrackerMonitorDigi::DigiMEs::EtaOccupancyProfP, Phase2TrackerMonitorDigi::DigiMEs::EtaOccupancyProfS, fed_dqm_sourceclient-live_cfg::folder_name, Phase2TrackerMonitorDigi::DigiMEs::FractionOfOvTBits, Phase2TrackerMonitorDigi::DigiMEs::FractionOfOvTBitsVsEta, getHistoId(), TrackerTopology::getITPixelLayerNumber(), TrackerTopology::getOTLayerNumber(), edm::ParameterSet::getParameter(), submitPVResolutionJobs::key, nano_mu_digi_cff::layer, layerMEs, LogDebug, Phase2TrackerMonitorDigi::DigiMEs::nDigiPerLayer, Phase2TrackerMonitorDigi::DigiMEs::nHitDetsPerLayer, Phase2TrackerMonitorDigi::DigiMEs::NumberOfClustersPerDet, Phase2TrackerMonitorDigi::DigiMEs::NumberOfDigisPerDet, Phase2TrackerMonitorDigi::DigiMEs::NumberOfHitDetectorsPerLayer, pixelFlag_, Phase2TrackerMonitorDigi::DigiMEs::PositionOfDigisP, Phase2TrackerMonitorDigi::DigiMEs::PositionOfDigisS, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TrackerTopology::tidRing(), TrackerTopology::tidWheel(), Phase2TrackerMonitorDigi::DigiMEs::TotalNumberOfDigisPerLayer, funct::true, and tTopo_.

Referenced by bookHistograms().

480  {
481  int layer;
482  if (pixelFlag_)
484  else
485  layer = tTopo_->getOTLayerNumber(det_id);
486 
487  if (layer < 0)
488  return;
490  std::map<std::string, DigiMEs>::iterator pos = layerMEs.find(key);
491 
492  if (pos == layerMEs.end()) {
493  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
494  std::stringstream folder_name;
495 
496  //For endCap: P-type sensors are present only upto ring 10 for discs 1&2 (TEDD-1) and upto ring 7 for discs 3,4&5 (TEDD-2)
497  bool isPStypeModForTEDD_1 =
498  (!pixelFlag_ && layer > 100 && tTopo_->tidWheel(det_id) < 3 && tTopo_->tidRing(det_id) <= 10) ? true : false;
499  bool isPStypeModForTEDD_2 =
500  (!pixelFlag_ && layer > 100 && tTopo_->tidWheel(det_id) >= 3 && tTopo_->tidRing(det_id) <= 7) ? true : false;
501 
502  bool isPtypeSensor =
503  (pixelFlag_ || (layer < 4 || (layer > 6 && (isPStypeModForTEDD_1 || isPStypeModForTEDD_2)))) ? true : false;
504 
505  ibooker.cd();
506  ibooker.setCurrentFolder(top_folder + "/DigiMonitor/" + key);
507  LogDebug("Phase2TrackerMonitorDigi") << " Booking Histograms in : " << key;
508 
509  std::ostringstream HistoName;
510  DigiMEs local_mes;
511 
512  local_mes.nDigiPerLayer = 0;
513  local_mes.nHitDetsPerLayer = 0;
514 
516  edm::ParameterSet EtaParameters = config_.getParameter<edm::ParameterSet>("EtaH");
517  HistoName.str("");
518  HistoName << "NumberOfDigisPerDet";
519  if (Parameters.getParameter<bool>("switch"))
520  local_mes.NumberOfDigisPerDet = ibooker.book1D(HistoName.str(),
521  HistoName.str(),
522  Parameters.getParameter<int32_t>("Nbins"),
523  Parameters.getParameter<double>("xmin"),
524  Parameters.getParameter<double>("xmax"));
525  else
526  local_mes.NumberOfDigisPerDet = nullptr;
527 
528  Parameters = config_.getParameter<edm::ParameterSet>("TotalNumberOfDigisPerLayerH");
529  HistoName.str("");
530  HistoName << "TotalNumberOfDigisPerLayer";
531  if (Parameters.getParameter<bool>("switch"))
532  local_mes.TotalNumberOfDigisPerLayer = ibooker.book1D(HistoName.str(),
533  HistoName.str(),
534  Parameters.getParameter<int32_t>("Nbins"),
535  Parameters.getParameter<double>("xmin"),
536  Parameters.getParameter<double>("xmax"));
537  else
538  local_mes.TotalNumberOfDigisPerLayer = nullptr;
539 
540  Parameters = config_.getParameter<edm::ParameterSet>("NumberOfHitDetsPerLayerH");
541  HistoName.str("");
542  HistoName << "NumberOfHitDetectorsPerLayer";
543  if (Parameters.getParameter<bool>("switch"))
544  local_mes.NumberOfHitDetectorsPerLayer = ibooker.book1D(HistoName.str(),
545  HistoName.str(),
546  Parameters.getParameter<int32_t>("Nbins"),
547  Parameters.getParameter<double>("xmin"),
548  Parameters.getParameter<double>("xmax"));
549  else
550  local_mes.NumberOfHitDetectorsPerLayer = nullptr;
551 
552  // Plots only for the inner pixel
553  if (pixelFlag_) {
555  HistoName.str("");
556  HistoName << "ChargeXYMap";
557  if (Parameters.getParameter<bool>("switch"))
558  local_mes.ChargeXYMap = ibooker.book2D(HistoName.str(),
559  HistoName.str(),
560  Parameters.getParameter<int32_t>("Nxbins"),
561  Parameters.getParameter<double>("xmin"),
562  Parameters.getParameter<double>("xmax"),
563  Parameters.getParameter<int32_t>("Nybins"),
564  Parameters.getParameter<double>("ymin"),
565  Parameters.getParameter<double>("ymax"));
566  else
567  local_mes.ChargeXYMap = nullptr;
568 
570  HistoName.str("");
571  HistoName << "ChargeOfDigis";
572  if (Parameters.getParameter<bool>("switch"))
573  local_mes.ChargeOfDigis = ibooker.book1D(HistoName.str(),
574  HistoName.str(),
575  Parameters.getParameter<int32_t>("Nbins"),
576  Parameters.getParameter<double>("xmin"),
577  Parameters.getParameter<double>("xmax"));
578  else
579  local_mes.ChargeOfDigis = nullptr;
580 
581  // For standalone clusteriser
582  if (clsFlag_) {
583  edm::ParameterSet WidthParameters = config_.getParameter<edm::ParameterSet>("ClusterWidthH");
584  HistoName.str("");
585  HistoName << "ChargeOfDigisVsWidth";
586  if (Parameters.getParameter<bool>("switch") && WidthParameters.getParameter<bool>("switch"))
587  local_mes.ChargeOfDigisVsWidth = ibooker.book2D(HistoName.str(),
588  HistoName.str(),
589  Parameters.getParameter<int32_t>("Nbins"),
590  Parameters.getParameter<double>("xmin"),
591  Parameters.getParameter<double>("xmax"),
592  WidthParameters.getParameter<int32_t>("Nbins"),
593  WidthParameters.getParameter<double>("xmin"),
594  WidthParameters.getParameter<double>("xmax"));
595  else
596  local_mes.ChargeOfDigisVsWidth = nullptr;
597  }
598  }
599  // For outer tracker modules (S-type histograms)
600  else {
601  Parameters = config_.getParameter<edm::ParameterSet>("DigiOccupancySH");
602  HistoName.str("");
603  HistoName << "DigiOccupancyS";
604  if (Parameters.getParameter<bool>("switch"))
605  local_mes.DigiOccupancyS = ibooker.book1D(HistoName.str(),
606  HistoName.str(),
607  Parameters.getParameter<int32_t>("Nbins"),
608  Parameters.getParameter<double>("xmin"),
609  Parameters.getParameter<double>("xmax"));
610  else
611  local_mes.DigiOccupancyS = nullptr;
612 
613  HistoName.str("");
614  HistoName << "DigiOccupancyVsEtaS";
615  if (Parameters.getParameter<bool>("switch") && EtaParameters.getParameter<bool>("switch"))
616  local_mes.EtaOccupancyProfS = ibooker.bookProfile(HistoName.str(),
617  HistoName.str(),
618  EtaParameters.getParameter<int32_t>("Nbins"),
619  EtaParameters.getParameter<double>("xmin"),
620  EtaParameters.getParameter<double>("xmax"),
621  Parameters.getParameter<double>("xmin"),
622  Parameters.getParameter<double>("xmax"),
623  "");
624  else
625  local_mes.EtaOccupancyProfS = nullptr;
626 
627  Parameters = config_.getParameter<edm::ParameterSet>("PositionOfDigisSH");
628  HistoName.str("");
629  HistoName << "PositionOfDigisS";
630  if (Parameters.getParameter<bool>("switch"))
631  local_mes.PositionOfDigisS = ibooker.book2D(HistoName.str(),
632  HistoName.str(),
633  Parameters.getParameter<int32_t>("Nxbins"),
634  Parameters.getParameter<double>("xmin"),
635  Parameters.getParameter<double>("xmax"),
636  Parameters.getParameter<int32_t>("Nybins"),
637  Parameters.getParameter<double>("ymin"),
638  Parameters.getParameter<double>("ymax"));
639  else
640  local_mes.PositionOfDigisS = nullptr;
641 
642  // For standalone clusteriser
643  if (clsFlag_) {
644  Parameters = config_.getParameter<edm::ParameterSet>("ClusterPositionSH");
645  HistoName.str("");
646  HistoName << "ClusterPositionS";
647  if (Parameters.getParameter<bool>("switch"))
648  local_mes.ClusterPositionS = ibooker.book2D(HistoName.str(),
649  HistoName.str(),
650  Parameters.getParameter<int32_t>("Nxbins"),
651  Parameters.getParameter<double>("xmin"),
652  Parameters.getParameter<double>("xmax"),
653  Parameters.getParameter<int32_t>("Nybins"),
654  Parameters.getParameter<double>("ymin"),
655  Parameters.getParameter<double>("ymax"));
656  else
657  local_mes.ClusterPositionS = nullptr;
658  }
659  // Only for the S-type sensor of PS module
660  // FracOfOverThresholdBits is only available for S-type sensor of PS module
661  if (isPStypeModForTEDD_1 || isPStypeModForTEDD_2) {
662  HistoName.str("");
663  HistoName << "FractionOfOverThresholdDigis";
664  local_mes.FractionOfOvTBits = ibooker.book1D(HistoName.str(), HistoName.str(), 11, -0.05, 1.05);
665 
666  Parameters = config_.getParameter<edm::ParameterSet>("NumberOfDigisPerDetH");
667  HistoName.str("");
668  HistoName << "FractionOfOverThresholdDigisVaEta";
669  if (Parameters.getParameter<bool>("switch") && EtaParameters.getParameter<bool>("switch"))
670  local_mes.FractionOfOvTBitsVsEta = ibooker.bookProfile(HistoName.str(),
671  HistoName.str(),
672  EtaParameters.getParameter<int32_t>("Nbins"),
673  EtaParameters.getParameter<double>("xmin"),
674  EtaParameters.getParameter<double>("xmax"),
675  Parameters.getParameter<double>("xmin"),
676  Parameters.getParameter<double>("xmax"),
677  "");
678  else
679  local_mes.FractionOfOvTBitsVsEta = nullptr;
680  }
681  }
682 
683  // Plots for P-type sensor (Pixel or P-side of PS module)
684  if (isPtypeSensor) {
685  Parameters = config_.getParameter<edm::ParameterSet>("DigiOccupancyPH");
686  HistoName.str("");
687  HistoName << "DigiOccupancyP";
688  if (Parameters.getParameter<bool>("switch"))
689  local_mes.DigiOccupancyP = ibooker.book1D(HistoName.str(),
690  HistoName.str(),
691  Parameters.getParameter<int32_t>("Nbins"),
692  Parameters.getParameter<double>("xmin"),
693  Parameters.getParameter<double>("xmax"));
694  else
695  local_mes.DigiOccupancyP = nullptr;
696 
697  HistoName.str("");
698  HistoName << "DigiOccupancyVsEtaP";
699  if (Parameters.getParameter<bool>("switch") && EtaParameters.getParameter<bool>("switch"))
700  local_mes.EtaOccupancyProfP = ibooker.bookProfile(HistoName.str(),
701  HistoName.str(),
702  EtaParameters.getParameter<int32_t>("Nbins"),
703  EtaParameters.getParameter<double>("xmin"),
704  EtaParameters.getParameter<double>("xmax"),
705  Parameters.getParameter<double>("xmin"),
706  Parameters.getParameter<double>("xmax"),
707  "");
708  else
709  local_mes.EtaOccupancyProfP = nullptr;
710 
711  Parameters = config_.getParameter<edm::ParameterSet>("PositionOfDigisPH");
712  HistoName.str("");
713  HistoName << "PositionOfDigisP";
714  if (Parameters.getParameter<bool>("switch"))
715  local_mes.PositionOfDigisP = ibooker.book2D(HistoName.str(),
716  HistoName.str(),
717  Parameters.getParameter<int32_t>("Nxbins"),
718  Parameters.getParameter<double>("xmin"),
719  Parameters.getParameter<double>("xmax"),
720  Parameters.getParameter<int32_t>("Nybins"),
721  Parameters.getParameter<double>("ymin"),
722  Parameters.getParameter<double>("ymax"));
723  else
724  local_mes.PositionOfDigisP = nullptr;
725 
726  if (clsFlag_) {
727  Parameters = config_.getParameter<edm::ParameterSet>("ClusterPositionPH");
728  HistoName.str("");
729  HistoName << "ClusterPositionP";
730  if (Parameters.getParameter<bool>("switch"))
731  local_mes.ClusterPositionP = ibooker.book2D(HistoName.str(),
732  HistoName.str(),
733  Parameters.getParameter<int32_t>("Nxbins"),
734  Parameters.getParameter<double>("xmin"),
735  Parameters.getParameter<double>("xmax"),
736  Parameters.getParameter<int32_t>("Nybins"),
737  Parameters.getParameter<double>("ymin"),
738  Parameters.getParameter<double>("ymax"));
739  else
740  local_mes.ClusterPositionP = nullptr;
741  }
742  }
743 
744  // Plots for Standalone clusters (Can be switched on from configs)
745  if (clsFlag_) {
746  Parameters = config_.getParameter<edm::ParameterSet>("NumberOfClustersPerDetH");
747  HistoName.str("");
748  HistoName << "NumberOfClustersPerDet";
749  if (Parameters.getParameter<bool>("switch"))
750  local_mes.NumberOfClustersPerDet = ibooker.book1D(HistoName.str(),
751  HistoName.str(),
752  Parameters.getParameter<int32_t>("Nbins"),
753  Parameters.getParameter<double>("xmin"),
754  Parameters.getParameter<double>("xmax"));
755  else
756  local_mes.NumberOfClustersPerDet = nullptr;
757 
758  Parameters = config_.getParameter<edm::ParameterSet>("ClusterWidthH");
759  HistoName.str("");
760  HistoName << "ClusterWidth";
761  if (Parameters.getParameter<bool>("switch"))
762  local_mes.ClusterWidth = ibooker.book1D(HistoName.str(),
763  HistoName.str(),
764  Parameters.getParameter<int32_t>("Nbins"),
765  Parameters.getParameter<double>("xmin"),
766  Parameters.getParameter<double>("xmax"));
767  else
768  local_mes.ClusterWidth = nullptr;
769  }
770 
771  layerMEs.insert(std::make_pair(key, local_mes));
772  }
773 }
const edm::ParameterSet config_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
unsigned int tidWheel(const DetId &id) const
std::map< std::string, DigiMEs > layerMEs
int getITPixelLayerNumber(const DetId &id) const
int getOTLayerNumber(const DetId &id) const
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:408
key
prepare the HTCondor submission files and eventually submit them
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
std::string HistoName
std::vector< AlignmentParameters * > Parameters
Definition: Utilities.h:32
const TrackerTopology * tTopo_
std::string getHistoId(uint32_t det_id, bool flag)
unsigned int tidRing(const DetId &id) const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
#define LogDebug(id)

◆ dqmBeginRun()

void Phase2TrackerMonitorDigi::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
overridevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 139 of file Phase2TrackerMonitorDigi.cc.

References geomToken_, edm::EventSetup::getData(), tkGeom_, topoToken_, and tTopo_.

139  {
140  tkGeom_ = &iSetup.getData(geomToken_);
141  tTopo_ = &iSetup.getData(topoToken_);
142 }
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
const TrackerGeometry * tkGeom_
const TrackerTopology * tTopo_

◆ fillDigiClusters()

void Phase2TrackerMonitorDigi::fillDigiClusters ( DigiMEs mes,
std::vector< Ph2DigiCluster > &  digi_clusters 
)
private

Definition at line 782 of file Phase2TrackerMonitorDigi.cc.

References Phase2TrackerMonitorDigi::DigiMEs::ChargeOfDigisVsWidth, Phase2TrackerMonitorDigi::DigiMEs::ClusterPositionP, Phase2TrackerMonitorDigi::DigiMEs::ClusterPositionS, Phase2TrackerMonitorDigi::DigiMEs::ClusterWidth, dqm::impl::MonitorElement::Fill(), Phase2TrackerMonitorDigi::DigiMEs::NumberOfClustersPerDet, and pixelFlag_.

Referenced by fillITPixelDigiHistos(), and fillOTDigiHistos().

782  {
783  int nclus = digi_clusters.size();
784  if (mes.NumberOfClustersPerDet)
785  mes.NumberOfClustersPerDet->Fill(nclus);
786  for (auto& iclus : digi_clusters) {
787  if (mes.ClusterWidth)
788  mes.ClusterWidth->Fill(iclus.width);
789  if (pixelFlag_ && mes.ChargeOfDigisVsWidth)
790  mes.ChargeOfDigisVsWidth->Fill(iclus.charge, iclus.width);
791  if (mes.ClusterPositionP)
792  mes.ClusterPositionP->Fill(iclus.position, iclus.column + 1);
793  if (!pixelFlag_ && mes.ClusterPositionS && iclus.column <= 2)
794  mes.ClusterPositionS->Fill(iclus.position, iclus.column + 1);
795  }
796 }

◆ fillITPixelDigiHistos()

void Phase2TrackerMonitorDigi::fillITPixelDigiHistos ( const edm::Handle< edm::DetSetVector< PixelDigi >>  handle)
private

Definition at line 162 of file Phase2TrackerMonitorDigi.cc.

References funct::abs(), gpuClustering::adc, edm::DetSetVector< T >::begin(), Phase2TrackerMonitorDigi::Ph2DigiCluster::charge, Phase2TrackerMonitorDigi::DigiMEs::ChargeOfDigis, Phase2TrackerMonitorDigi::DigiMEs::ChargeXYMap, clsFlag_, cuy::col, Phase2TrackerMonitorDigi::Ph2DigiCluster::column, TauDecayModes::dec, DetId::det(), hcalRecHitTable_cff::detId, Phase2TrackerMonitorDigi::DigiMEs::DigiOccupancyP, edm::DetSetVector< T >::end(), Phase2TrackerMonitorDigi::DigiMEs::EtaOccupancyProfP, dqm::impl::MonitorElement::Fill(), fillDigiClusters(), getHistoId(), TrackerTopology::getITPixelLayerNumber(), runTauDisplay::gp, patZpeak::handle, Matriplex::hypot(), TrackerGeometry::idToDet(), TrackerGeometry::idToDetUnit(), submitPVResolutionJobs::key, nano_mu_digi_cff::layer, layerMEs, Topology::localPosition(), LogDebug, PixelTopology::ncolumns(), Phase2TrackerMonitorDigi::DigiMEs::nDigiPerLayer, Phase2TrackerMonitorDigi::DigiMEs::nHitDetsPerLayer, PixelTopology::nrows(), Phase2TrackerMonitorDigi::DigiMEs::NumberOfDigisPerDet, Phase2TrackerMonitorDigi::DigiMEs::NumberOfHitDetectorsPerLayer, pixelFlag_, Phase2TrackerMonitorDigi::Ph2DigiCluster::position, Phase2TrackerMonitorDigi::DigiMEs::PositionOfDigisP, RZOccupancyMap, RZPositionMap, PixelGeomDetUnit::specificTopology(), AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::surface(), tkGeom_, Surface::toGlobal(), GeomDet::topology(), Phase2TrackerMonitorDigi::DigiMEs::TotalNumberOfDigisPerLayer, align::Tracker, tTopo_, ApeEstimator_cff::width, Phase2TrackerMonitorDigi::Ph2DigiCluster::width, PV3DBase< T, PVType, FrameType >::x(), XYOccupancyMap, XYPositionMap, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by analyze().

162  {
163  const edm::DetSetVector<PixelDigi>* digis = handle.product();
164 
165  for (typename edm::DetSetVector<PixelDigi>::const_iterator DSViter = digis->begin(); DSViter != digis->end();
166  DSViter++) {
167  unsigned int rawid = DSViter->id;
168  LogDebug("Phase2TrackerMonitorDigi") << " Det Id = " << rawid;
169 
170  int layer = tTopo_->getITPixelLayerNumber(rawid);
171 
172  if (layer < 0)
173  continue;
174  const DetId detId(rawid);
175 
177  std::map<std::string, DigiMEs>::iterator pos = layerMEs.find(key);
178 
179  if (pos == layerMEs.end())
180  continue;
181 
183  continue;
184 
185  const GeomDetUnit* gDetUnit = tkGeom_->idToDetUnit(detId);
186  const GeomDet* geomDet = tkGeom_->idToDet(detId);
187 
188  const Phase2TrackerGeomDetUnit* tkDetUnit = dynamic_cast<const Phase2TrackerGeomDetUnit*>(gDetUnit);
189  int nRows = tkDetUnit->specificTopology().nrows();
190  int nColumns = tkDetUnit->specificTopology().ncolumns();
191  if (nRows * nColumns == 0)
192  continue;
193 
194  DigiMEs& local_mes = pos->second;
195 
196  local_mes.nHitDetsPerLayer++;
197 
198  int nDigi = 0;
199  int row_last = -1;
200  int col_last = -1;
201  std::vector<Ph2DigiCluster> digiClusters;
202  for (typename edm::DetSet<PixelDigi>::const_iterator di = DSViter->begin(); di != DSViter->end(); di++) {
203  int col = di->column(); // column
204  int row = di->row(); // row
205  int adc = di->adc(); // digi charge
206  if (geomDet) {
207  MeasurementPoint mp(row + 0.5, col + 0.5);
208  GlobalPoint pdPos = geomDet->surface().toGlobal(gDetUnit->topology().localPosition(mp));
209  if (XYPositionMap)
210  XYPositionMap->Fill(pdPos.x() * 10., pdPos.y() * 10.);
211  if (RZPositionMap)
212  RZPositionMap->Fill(pdPos.z() * 10., std::hypot(pdPos.x(), pdPos.y()) * 10.);
213  }
214  nDigi++;
215  LogDebug("Phase2TrackerMonitorDigi") << " column " << col << " row " << row << std::dec << std::endl;
216  if (local_mes.ChargeXYMap)
217  local_mes.ChargeXYMap->Fill(col, row, adc);
218  if (local_mes.PositionOfDigisP)
219  local_mes.PositionOfDigisP->Fill(row + 1, col + 1);
220  if (local_mes.ChargeOfDigis)
221  local_mes.ChargeOfDigis->Fill(adc);
222  if (clsFlag_) {
223  if (row_last == -1 || abs(row - row_last) != 1 || col != col_last) {
224  Ph2DigiCluster dClus;
225  dClus.position = row + 1;
226  dClus.column = col;
227  dClus.width = 1;
228  dClus.charge = 255;
229  digiClusters.push_back(dClus);
230  } else {
231  int pos = digiClusters.back().position + row + 1;
232  int width = digiClusters.back().width + 1;
233  pos /= width;
234 
235  digiClusters.back().position = pos;
236  digiClusters.back().width += 1;
237  }
238  LogDebug("Phase2TrackerMonitorDigi") << " row " << row << " col " << col << " row_last " << row_last
239  << " col_last " << col_last << " width " << digiClusters.back().width;
240  row_last = row;
241  col_last = col;
242  }
243  }
244  if (local_mes.NumberOfDigisPerDet)
245  local_mes.NumberOfDigisPerDet->Fill(nDigi);
246  if (clsFlag_)
247  fillDigiClusters(local_mes, digiClusters);
248  local_mes.nDigiPerLayer += nDigi;
249  float occupancy = 1.0;
250  if (nRows * nColumns > 0)
251  occupancy = nDigi * 1.0 / (nRows * nColumns);
252  if (geomDet) {
253  GlobalPoint gp = geomDet->surface().toGlobal(
254  gDetUnit->topology().localPosition(MeasurementPoint(nRows / 2.0, nColumns / 2.0)));
255  if (XYOccupancyMap)
256  XYOccupancyMap->Fill(gp.x() * 10., gp.y() * 10, occupancy);
257  if (RZOccupancyMap)
258  RZOccupancyMap->Fill(gp.z() * 10., std::hypot(gp.x(), gp.y()) * 10., occupancy);
259  if (local_mes.EtaOccupancyProfP)
260  local_mes.EtaOccupancyProfP->Fill(gp.eta(), occupancy);
261  }
262 
263  if (local_mes.DigiOccupancyP)
264  local_mes.DigiOccupancyP->Fill(occupancy);
265  }
266  // Fill histograms after loop over digis are complete
267  for (auto& ilayer : layerMEs) {
268  DigiMEs& local_mes = ilayer.second;
269  if (local_mes.TotalNumberOfDigisPerLayer)
270  local_mes.TotalNumberOfDigisPerLayer->Fill(local_mes.nDigiPerLayer);
271  if (local_mes.NumberOfHitDetectorsPerLayer)
272  local_mes.NumberOfHitDetectorsPerLayer->Fill(local_mes.nHitDetsPerLayer);
273  local_mes.nDigiPerLayer = 0;
274  local_mes.nHitDetsPerLayer = 0;
275  }
276 }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:616
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
virtual int ncolumns() const =0
T z() const
Definition: PV3DBase.h:61
virtual const Topology & topology() const
Definition: GeomDet.cc:67
virtual int nrows() const =0
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
std::map< std::string, DigiMEs > layerMEs
void Fill(long long x)
int getITPixelLayerNumber(const DetId &id) const
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
key
prepare the HTCondor submission files and eventually submit them
const TrackerGeomDet * idToDet(DetId) const override
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:316
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
const TrackerGeometry * tkGeom_
Definition: DetId.h:17
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
void fillDigiClusters(DigiMEs &mes, std::vector< Ph2DigiCluster > &digi_clusters)
const TrackerTopology * tTopo_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
std::string getHistoId(uint32_t det_id, bool flag)
col
Definition: cuy.py:1009
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:305
collection_type::const_iterator const_iterator
Definition: DetSet.h:31
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
uint16_t *__restrict__ uint16_t const *__restrict__ adc
#define LogDebug(id)

◆ fillOTDigiHistos()

void Phase2TrackerMonitorDigi::fillOTDigiHistos ( const edm::Handle< edm::DetSetVector< Phase2TrackerDigi >>  handle)
private

Definition at line 277 of file Phase2TrackerMonitorDigi.cc.

References funct::abs(), edm::DetSetVector< T >::begin(), Phase2TrackerMonitorDigi::Ph2DigiCluster::charge, clsFlag_, cuy::col, Phase2TrackerMonitorDigi::Ph2DigiCluster::column, TauDecayModes::dec, DetId::det(), hcalRecHitTable_cff::detId, Phase2TrackerMonitorDigi::DigiMEs::DigiOccupancyP, Phase2TrackerMonitorDigi::DigiMEs::DigiOccupancyS, edm::DetSetVector< T >::end(), Phase2TrackerMonitorDigi::DigiMEs::EtaOccupancyProfP, Phase2TrackerMonitorDigi::DigiMEs::EtaOccupancyProfS, dqm::impl::MonitorElement::Fill(), fillDigiClusters(), Phase2TrackerMonitorDigi::DigiMEs::FractionOfOvTBits, Phase2TrackerMonitorDigi::DigiMEs::FractionOfOvTBitsVsEta, getHistoId(), TrackerTopology::getOTLayerNumber(), runTauDisplay::gp, patZpeak::handle, Matriplex::hypot(), TrackerGeometry::idToDet(), TrackerGeometry::idToDetUnit(), submitPVResolutionJobs::key, nano_mu_digi_cff::layer, layerMEs, Topology::localPosition(), LogDebug, PixelTopology::ncolumns(), Phase2TrackerMonitorDigi::DigiMEs::nDigiPerLayer, Phase2TrackerMonitorDigi::DigiMEs::nHitDetsPerLayer, PixelTopology::nrows(), Phase2TrackerMonitorDigi::DigiMEs::NumberOfDigisPerDet, Phase2TrackerMonitorDigi::DigiMEs::NumberOfHitDetectorsPerLayer, pixelFlag_, Phase2TrackerMonitorDigi::Ph2DigiCluster::position, Phase2TrackerMonitorDigi::DigiMEs::PositionOfDigisP, Phase2TrackerMonitorDigi::DigiMEs::PositionOfDigisS, RZOccupancyMap, RZPositionMap, PixelGeomDetUnit::specificTopology(), AlCaHLTBitMon_QueryRunRegistry::string, GeomDet::surface(), tkGeom_, Surface::toGlobal(), GeomDet::topology(), Phase2TrackerMonitorDigi::DigiMEs::TotalNumberOfDigisPerLayer, align::Tracker, tTopo_, ApeEstimator_cff::width, Phase2TrackerMonitorDigi::Ph2DigiCluster::width, PV3DBase< T, PVType, FrameType >::x(), XYOccupancyMap, XYPositionMap, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by analyze().

277  {
278  const edm::DetSetVector<Phase2TrackerDigi>* digis = handle.product();
279 
280  for (typename edm::DetSetVector<Phase2TrackerDigi>::const_iterator DSViter = digis->begin(); DSViter != digis->end();
281  DSViter++) {
282  unsigned int rawid = DSViter->id;
283  DetId detId(rawid);
284  LogDebug("Phase2TrackerMonitorDigi") << " Det Id = " << rawid;
285  int layer = tTopo_->getOTLayerNumber(rawid);
286  if (layer < 0)
287  continue;
289  std::map<std::string, DigiMEs>::iterator pos = layerMEs.find(key);
290  if (pos == layerMEs.end())
291  continue;
292  DigiMEs& local_mes = pos->second;
293 
294  local_mes.nHitDetsPerLayer++;
296  continue;
297 
298  const GeomDetUnit* gDetUnit = tkGeom_->idToDetUnit(detId);
299  const GeomDet* geomDet = tkGeom_->idToDet(detId);
300 
301  const Phase2TrackerGeomDetUnit* tkDetUnit = dynamic_cast<const Phase2TrackerGeomDetUnit*>(gDetUnit);
302  int nRows = tkDetUnit->specificTopology().nrows();
303  int nColumns = tkDetUnit->specificTopology().ncolumns();
304  if (nRows * nColumns == 0)
305  continue;
306 
307  int nDigi = 0;
308  int row_last = -1;
309  int col_last = -1;
310  float frac_ot = 0.;
311  std::vector<Ph2DigiCluster> digiClusters;
312  for (typename edm::DetSet<Phase2TrackerDigi>::const_iterator di = DSViter->begin(); di != DSViter->end(); di++) {
313  int col = di->column(); // column
314  int row = di->row(); // row
315  const DetId detId(rawid);
316 
317  if (geomDet) {
318  MeasurementPoint mp(row + 0.5, col + 0.5);
319  GlobalPoint pdPos = geomDet->surface().toGlobal(gDetUnit->topology().localPosition(mp));
320  if (XYPositionMap)
321  XYPositionMap->Fill(pdPos.x() * 10., pdPos.y() * 10.);
322  if (RZPositionMap)
323  RZPositionMap->Fill(pdPos.z() * 10., std::hypot(pdPos.x(), pdPos.y()) * 10.);
324  }
325  nDigi++;
326  if (di->overThreshold())
327  frac_ot++;
328  LogDebug("Phase2TrackerMonitorDigi") << " column " << col << " row " << row << std::dec << std::endl;
329  if (nColumns > 2 && local_mes.PositionOfDigisP)
330  local_mes.PositionOfDigisP->Fill(row + 1, col + 1);
331  if (nColumns <= 2 && local_mes.PositionOfDigisS)
332  local_mes.PositionOfDigisS->Fill(row + 1, col + 1);
333 
334  if (clsFlag_) {
335  if (row_last == -1 || abs(row - row_last) != 1 || col != col_last) {
336  Ph2DigiCluster dClus;
337  dClus.position = row + 1;
338  dClus.column = col;
339  dClus.width = 1;
340  dClus.charge = 255;
341  digiClusters.push_back(dClus);
342  } else {
343  int pos = digiClusters.back().position + row + 1;
344  int width = digiClusters.back().width + 1;
345  pos /= width;
346 
347  digiClusters.back().position = pos;
348  digiClusters.back().width += 1;
349  }
350  row_last = row;
351  col_last = col;
352  LogDebug("Phase2TrackerMonitorDigi") << " row " << row << " col " << col << " row_last " << row_last
353  << " col_last " << col_last << " width " << digiClusters.back().width;
354  }
355  }
356  if (local_mes.NumberOfDigisPerDet)
357  local_mes.NumberOfDigisPerDet->Fill(nDigi);
358  if (clsFlag_)
359  fillDigiClusters(local_mes, digiClusters);
360  local_mes.nDigiPerLayer += nDigi;
361  if (nDigi)
362  frac_ot /= nDigi;
363  if (local_mes.FractionOfOvTBits && nColumns <= 2)
364  local_mes.FractionOfOvTBits->Fill(frac_ot);
365 
366  float occupancy = 1.0;
367  if (nRows * nColumns > 0)
368  occupancy = nDigi * 1.0 / (nRows * nColumns);
369  if (geomDet) {
370  GlobalPoint gp = geomDet->surface().toGlobal(gDetUnit->topology().localPosition(MeasurementPoint(0.0, 0.0)));
371  if (XYOccupancyMap)
372  XYOccupancyMap->Fill(gp.x() * 10., gp.y() * 10., occupancy);
373  if (RZOccupancyMap)
374  RZOccupancyMap->Fill(gp.z() * 10., std::hypot(gp.x(), gp.y()) * 10., occupancy);
375  if (nColumns > 2) {
376  if (local_mes.DigiOccupancyP)
377  local_mes.DigiOccupancyP->Fill(occupancy);
378  if (local_mes.EtaOccupancyProfP)
379  local_mes.EtaOccupancyProfP->Fill(gp.eta(), occupancy);
380  } else {
381  if (local_mes.DigiOccupancyS)
382  local_mes.DigiOccupancyS->Fill(occupancy);
383  if (local_mes.EtaOccupancyProfS)
384  local_mes.EtaOccupancyProfS->Fill(gp.eta(), occupancy);
385  if (local_mes.FractionOfOvTBitsVsEta)
386  local_mes.FractionOfOvTBitsVsEta->Fill(gp.eta(), frac_ot);
387  }
388  }
389  }
390  // Fill histograms after loop over digis are complete
391  for (auto& ilayer : layerMEs) {
392  DigiMEs& local_mes = ilayer.second;
393  if (local_mes.TotalNumberOfDigisPerLayer)
394  local_mes.TotalNumberOfDigisPerLayer->Fill(local_mes.nDigiPerLayer);
395  if (local_mes.NumberOfHitDetectorsPerLayer)
396  local_mes.NumberOfHitDetectorsPerLayer->Fill(local_mes.nHitDetsPerLayer);
397  local_mes.nDigiPerLayer = 0;
398  local_mes.nHitDetsPerLayer = 0;
399  }
400 }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:616
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
virtual int ncolumns() const =0
T z() const
Definition: PV3DBase.h:61
virtual const Topology & topology() const
Definition: GeomDet.cc:67
virtual int nrows() const =0
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
std::map< std::string, DigiMEs > layerMEs
void Fill(long long x)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
int getOTLayerNumber(const DetId &id) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
key
prepare the HTCondor submission files and eventually submit them
const TrackerGeomDet * idToDet(DetId) const override
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:316
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
const TrackerGeometry * tkGeom_
Definition: DetId.h:17
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
void fillDigiClusters(DigiMEs &mes, std::vector< Ph2DigiCluster > &digi_clusters)
const TrackerTopology * tTopo_
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
std::string getHistoId(uint32_t det_id, bool flag)
col
Definition: cuy.py:1009
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:305
collection_type::const_iterator const_iterator
Definition: DetSet.h:31
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
#define LogDebug(id)

◆ getHistoId()

std::string Phase2TrackerMonitorDigi::getHistoId ( uint32_t  det_id,
bool  flag 
)

Definition at line 775 of file Phase2TrackerMonitorDigi.cc.

References RemoveAddSevLevel::flag, phase2tkutil::getITHistoId(), phase2tkutil::getOTHistoId(), and tTopo_.

Referenced by bookLayerHistos(), fillITPixelDigiHistos(), and fillOTDigiHistos().

775  {
776  if (flag)
777  return phase2tkutil::getITHistoId(det_id, tTopo_);
778  else
779  return phase2tkutil::getOTHistoId(det_id, tTopo_);
780 }
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
std::string getOTHistoId(uint32_t det_id, const TrackerTopology *tTopo)
const TrackerTopology * tTopo_

Member Data Documentation

◆ clsFlag_

const bool Phase2TrackerMonitorDigi::clsFlag_
private

◆ config_

const edm::ParameterSet Phase2TrackerMonitorDigi::config_
private

Definition at line 98 of file Phase2TrackerMonitorDigi.cc.

Referenced by bookHistograms(), and bookLayerHistos().

◆ geomToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> Phase2TrackerMonitorDigi::geomToken_
private

Definition at line 107 of file Phase2TrackerMonitorDigi.cc.

Referenced by dqmBeginRun().

◆ geomType_

const std::string Phase2TrackerMonitorDigi::geomType_
private

Definition at line 102 of file Phase2TrackerMonitorDigi.cc.

◆ itPixelDigiSrc_

const edm::InputTag Phase2TrackerMonitorDigi::itPixelDigiSrc_
private

Definition at line 104 of file Phase2TrackerMonitorDigi.cc.

◆ itPixelDigiToken_

const edm::EDGetTokenT<edm::DetSetVector<PixelDigi> > Phase2TrackerMonitorDigi::itPixelDigiToken_
private

Definition at line 106 of file Phase2TrackerMonitorDigi.cc.

Referenced by analyze().

◆ layerMEs

std::map<std::string, DigiMEs> Phase2TrackerMonitorDigi::layerMEs
private

◆ otDigiSrc_

const edm::InputTag Phase2TrackerMonitorDigi::otDigiSrc_
private

Definition at line 103 of file Phase2TrackerMonitorDigi.cc.

◆ otDigiToken_

const edm::EDGetTokenT<edm::DetSetVector<Phase2TrackerDigi> > Phase2TrackerMonitorDigi::otDigiToken_
private

Definition at line 105 of file Phase2TrackerMonitorDigi.cc.

Referenced by analyze().

◆ pixelFlag_

const bool Phase2TrackerMonitorDigi::pixelFlag_
private

◆ RZOccupancyMap

MonitorElement* Phase2TrackerMonitorDigi::RZOccupancyMap

◆ RZPositionMap

MonitorElement* Phase2TrackerMonitorDigi::RZPositionMap

◆ tkGeom_

const TrackerGeometry* Phase2TrackerMonitorDigi::tkGeom_ = nullptr
private

◆ topoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> Phase2TrackerMonitorDigi::topoToken_
private

Definition at line 108 of file Phase2TrackerMonitorDigi.cc.

Referenced by dqmBeginRun().

◆ tTopo_

const TrackerTopology* Phase2TrackerMonitorDigi::tTopo_ = nullptr
private

◆ XYOccupancyMap

MonitorElement* Phase2TrackerMonitorDigi::XYOccupancyMap

◆ XYPositionMap

MonitorElement* Phase2TrackerMonitorDigi::XYPositionMap