CMS 3D CMS Logo

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

#include <Phase2ITMonitorRecHit.cc>

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

Classes

struct  RecHitME
 

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
 
 Phase2ITMonitorRecHit (const edm::ParameterSet &)
 
 ~Phase2ITMonitorRecHit () 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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 &)
 

Private Member Functions

void bookLayerHistos (DQMStore::IBooker &ibooker, unsigned int det_id, std::string &subdir)
 
void fillITHistos (const edm::Event &iEvent)
 

Private Attributes

edm::ParameterSet config_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
std::string geomType_
 
MonitorElementglobalRZ_barrel_
 
MonitorElementglobalRZ_endcap_
 
MonitorElementglobalXY_barrel_
 
MonitorElementglobalXY_endcap_
 
std::map< std::string, RecHitMElayerMEs_
 
MonitorElementnumberRecHits_
 
const TrackerGeometrytkGeom_ = nullptr
 
const edm::EDGetTokenT< SiPixelRecHitCollectiontokenRecHitsIT_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 
const TrackerTopologytTopo_ = nullptr
 

Static Private Attributes

static constexpr float million = 1e6
 

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
 
- 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: Plugin for Phase2 RecHit validation

Definition at line 45 of file Phase2ITMonitorRecHit.cc.

Constructor & Destructor Documentation

◆ Phase2ITMonitorRecHit()

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

Definition at line 88 of file Phase2ITMonitorRecHit.cc.

89  : config_(iConfig),
90  tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))),
91  geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
92  topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) {
93  edm::LogInfo("Phase2ITMonitorRecHit") << ">>> Construct Phase2ITMonitorRecHit ";
94 }
const edm::EDGetTokenT< SiPixelRecHitCollection > tokenRecHitsIT_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Log< level::Info, false > LogInfo
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_

◆ ~Phase2ITMonitorRecHit()

Phase2ITMonitorRecHit::~Phase2ITMonitorRecHit ( )
override

Definition at line 96 of file Phase2ITMonitorRecHit.cc.

96  {
97  edm::LogInfo("Phase2ITMonitorRecHit") << ">>> Destroy Phase2ITMonitorRecHit ";
98 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 100 of file Phase2ITMonitorRecHit.cc.

References fillITHistos(), and iEvent.

100 { fillITHistos(iEvent); }
int iEvent
Definition: GenABIO.cc:224
void fillITHistos(const edm::Event &iEvent)

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 179 of file Phase2ITMonitorRecHit.cc.

References phase2tkutil::book1DFromPSet(), phase2tkutil::book2DFromPSet(), bookLayerHistos(), dqm::implementation::NavigatorBase::cd(), edm::ESWatcher< T >::check(), config_, TrackerGeometry::detUnits(), DeadROC_duringRun::dir, phase2tkutil::getITHistoId(), edm::ParameterSet::getParameter(), globalRZ_barrel_, globalRZ_endcap_, globalXY_barrel_, globalXY_endcap_, numberRecHits_, GeomDetEnumerators::P2PXB, GeomDetEnumerators::P2PXEC, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, tkGeom_, and tTopo_.

181  {
182  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
183  ibooker.cd();
184  edm::LogInfo("Phase2ITMonitorRecHit") << " Booking Histograms in : " << top_folder;
185  std::string dir = top_folder;
186  ibooker.setCurrentFolder(dir);
187  //Global histos for IT
189  phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalNumberRecHits"), ibooker);
190 
192  phase2tkutil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionXY_PXB"), ibooker);
193 
195  phase2tkutil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_PXB"), ibooker);
196 
198  phase2tkutil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionXY_PXEC"), ibooker);
199 
201  phase2tkutil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_PXEC"), ibooker);
202 
203  //Now book layer wise histos
204  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
205  if (theTkDigiGeomWatcher.check(iSetup)) {
206  for (auto const& det_u : tkGeom_->detUnits()) {
207  //Always check TrackerNumberingBuilder before changing this part
208  if (!(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB ||
209  det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC))
210  continue;
211  unsigned int detId_raw = det_u->geographicalId().rawId();
212  edm::LogInfo("Phase2ITMonitorRecHit") << "Detid:" << detId_raw << "\tsubdet=" << det_u->subDetector()
213  << "\t key=" << phase2tkutil::getITHistoId(detId_raw, tTopo_) << std::endl;
214  bookLayerHistos(ibooker, detId_raw, dir);
215  }
216  }
217 }
const TrackerGeometry * tkGeom_
MonitorElement * globalRZ_barrel_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * book2DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
MonitorElement * globalXY_barrel_
MonitorElement * numberRecHits_
MonitorElement * book1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
Log< level::Info, false > LogInfo
void bookLayerHistos(DQMStore::IBooker &ibooker, unsigned int det_id, std::string &subdir)
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
const TrackerTopology * tTopo_
MonitorElement * globalRZ_endcap_
MonitorElement * globalXY_endcap_

◆ bookLayerHistos()

void Phase2ITMonitorRecHit::bookLayerHistos ( DQMStore::IBooker ibooker,
unsigned int  det_id,
std::string &  subdir 
)
private

Definition at line 219 of file Phase2ITMonitorRecHit.cc.

References phase2tkutil::book1DFromPSet(), phase2tkutil::book2DFromPSet(), phase2tkutil::bookProfile1DFromPSet(), dqm::implementation::NavigatorBase::cd(), Phase2ITMonitorRecHit::RecHitME::clusterSizeX, Phase2ITMonitorRecHit::RecHitME::clusterSizeY, config_, phase2tkutil::getITHistoId(), edm::ParameterSet::getParameter(), Phase2ITMonitorRecHit::RecHitME::globalPosRZ, Phase2ITMonitorRecHit::RecHitME::globalPosXY, crabWrapper::key, layerMEs_, Phase2ITMonitorRecHit::RecHitME::localPosXY, Phase2ITMonitorRecHit::RecHitME::numberRecHits, Phase2ITMonitorRecHit::RecHitME::poserrX, Phase2ITMonitorRecHit::RecHitME::poserrY, Phase2ITMonitorRecHit::RecHitME::posX, Phase2ITMonitorRecHit::RecHitME::posY, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, mkLumiAveragedPlots::subdir, and tTopo_.

Referenced by bookHistograms().

219  {
221  if (key.empty())
222  return;
223  if (layerMEs_.find(key) == layerMEs_.end()) {
224  ibooker.cd();
225  RecHitME local_histos;
226  ibooker.setCurrentFolder(subdir + "/" + key);
227  edm::LogInfo("Phase2ITMonitorRecHit") << " Booking Histograms in : " << (subdir + "/" + key);
228 
229  local_histos.numberRecHits =
230  phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("LocalNumberRecHits"), ibooker);
231 
232  local_histos.posX = phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosX"), ibooker);
233 
234  local_histos.posY = phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("RecHitPosY"), ibooker);
235 
236  local_histos.poserrX =
238 
239  local_histos.poserrY =
241 
242  local_histos.clusterSizeX =
243  phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("LocalClusterSizeX"), ibooker);
244 
245  local_histos.clusterSizeY =
246  phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("LocalClusterSizeY"), ibooker);
247 
248  local_histos.globalPosXY =
249  phase2tkutil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionXY_perlayer"), ibooker);
250 
251  local_histos.globalPosRZ =
252  phase2tkutil::book2DFromPSet(config_.getParameter<edm::ParameterSet>("GlobalPositionRZ_perlayer"), ibooker);
253 
254  local_histos.localPosXY =
256  layerMEs_.emplace(key, local_histos);
257  }
258 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * book2DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * bookProfile1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
MonitorElement * book1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
Log< level::Info, false > LogInfo
std::map< std::string, RecHitME > layerMEs_
const TrackerTopology * tTopo_

◆ dqmBeginRun()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 174 of file Phase2ITMonitorRecHit.cc.

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

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

◆ fillDescriptions()

void Phase2ITMonitorRecHit::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 260 of file Phase2ITMonitorRecHit.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

260  {
261  // rechitMonitorIT
263  {
265  psd0.add<std::string>("name", "NumberRecHits");
266  psd0.add<std::string>("title", "NumberRecHits;Number of RecHits;");
267  psd0.add<double>("xmin", 0.0);
268  psd0.add<bool>("switch", true);
269  psd0.add<double>("xmax", 250000.0);
270  psd0.add<int>("NxBins", 250);
271  desc.add<edm::ParameterSetDescription>("GlobalNumberRecHits", psd0);
272  }
273  {
275  psd0.add<std::string>("name", "Global_Position_RZ_IT_barrel");
276  psd0.add<std::string>("title", "Global_Position_RZ_IT_barrel;z [mm];r [mm]");
277  psd0.add<double>("ymax", 300.0);
278  psd0.add<int>("NxBins", 1500);
279  psd0.add<int>("NyBins", 300);
280  psd0.add<bool>("switch", true);
281  psd0.add<double>("xmax", 3000.0);
282  psd0.add<double>("xmin", -3000.0);
283  psd0.add<double>("ymin", 0.0);
284  desc.add<edm::ParameterSetDescription>("GlobalPositionRZ_PXB", psd0);
285  }
286  {
288  psd0.add<std::string>("name", "Global_Position_XY_IT_barrel");
289  psd0.add<std::string>("title", "Global_Position_XY_IT_barrel;x [mm];y [mm];");
290  psd0.add<double>("ymax", 300.0);
291  psd0.add<int>("NxBins", 600);
292  psd0.add<int>("NyBins", 600);
293  psd0.add<bool>("switch", true);
294  psd0.add<double>("xmax", 300.0);
295  psd0.add<double>("xmin", -300.0);
296  psd0.add<double>("ymin", -300.0);
297  desc.add<edm::ParameterSetDescription>("GlobalPositionXY_PXB", psd0);
298  }
299  {
301  psd0.add<std::string>("name", "Global_Position_RZ_IT_endcap");
302  psd0.add<std::string>("title", "Global_Position_RZ_IT_endcap;z [mm];r [mm]");
303  psd0.add<double>("ymax", 300.0);
304  psd0.add<int>("NxBins", 1500);
305  psd0.add<int>("NyBins", 300);
306  psd0.add<bool>("switch", true);
307  psd0.add<double>("xmax", 3000.0);
308  psd0.add<double>("xmin", -3000.0);
309  psd0.add<double>("ymin", 0.0);
310  desc.add<edm::ParameterSetDescription>("GlobalPositionRZ_PXEC", psd0);
311  }
312  {
314  psd0.add<std::string>("name", "Global_Position_XY_IT_endcap");
315  psd0.add<std::string>("title", "Global_Position_XY_IT_endcap; x [mm]; y [mm]");
316  psd0.add<double>("ymax", 300.0);
317  psd0.add<int>("NxBins", 600);
318  psd0.add<int>("NyBins", 600);
319  psd0.add<bool>("switch", true);
320  psd0.add<double>("xmax", 300.0);
321  psd0.add<double>("xmin", -300.0);
322  psd0.add<double>("ymin", -300.0);
323  desc.add<edm::ParameterSetDescription>("GlobalPositionXY_PXEC", psd0);
324  }
325  //Per layer/ring histos
326  {
328  psd0.add<std::string>("name", "LocalNumberRecHits");
329  psd0.add<std::string>("title", "NumberRecHits;Number of RecHits;");
330  psd0.add<double>("xmin", 0.0);
331  psd0.add<bool>("switch", true);
332  psd0.add<double>("xmax", 150000.0);
333  psd0.add<int>("NxBins", 150);
334  desc.add<edm::ParameterSetDescription>("LocalNumberRecHits", psd0);
335  }
336  {
338  psd0.add<std::string>("name", "Global_Position_RZ");
339  psd0.add<std::string>("title", "Global_Position_RZ;z [mm];r [mm]");
340  psd0.add<double>("ymax", 300.0);
341  psd0.add<int>("NxBins", 1500);
342  psd0.add<int>("NyBins", 300);
343  psd0.add<bool>("switch", false);
344  psd0.add<double>("xmax", 3000.0);
345  psd0.add<double>("xmin", -3000.0);
346  psd0.add<double>("ymin", 0.0);
347  desc.add<edm::ParameterSetDescription>("GlobalPositionRZ_perlayer", psd0);
348  }
349  {
351  psd0.add<std::string>("name", "Global_Position_XY");
352  psd0.add<std::string>("title", "Global_Position_XY;x [mm]; y[mm]");
353  psd0.add<double>("ymax", 300.0);
354  psd0.add<int>("NxBins", 600);
355  psd0.add<int>("NyBins", 600);
356  psd0.add<bool>("switch", false);
357  psd0.add<double>("xmax", 300.0);
358  psd0.add<double>("xmin", -300.0);
359  psd0.add<double>("ymin", -300.0);
360  desc.add<edm::ParameterSetDescription>("GlobalPositionXY_perlayer", psd0);
361  }
362  {
364  psd0.add<std::string>("name", "Local_Position_XY");
365  psd0.add<std::string>("title", "Local_Position_XY; x; y");
366  psd0.add<double>("ymax", 0.0);
367  psd0.add<int>("NxBins", 500);
368  psd0.add<int>("NyBins", 500);
369  psd0.add<bool>("switch", true);
370  psd0.add<double>("xmax", 0.0);
371  psd0.add<double>("xmin", 0.0);
372  psd0.add<double>("ymin", 0.0);
373  desc.add<edm::ParameterSetDescription>("LocalPositionXY", psd0);
374  }
375  {
377  psd0.add<std::string>("name", "Cluster_SizeX");
378  psd0.add<std::string>("title", "Cluster_SizeX; cluster size x;");
379  psd0.add<double>("xmin", -0.5);
380  psd0.add<bool>("switch", true);
381  psd0.add<double>("xmax", 20.5);
382  psd0.add<int>("NxBins", 21);
383  desc.add<edm::ParameterSetDescription>("LocalClusterSizeX", psd0);
384  }
385  {
387  psd0.add<std::string>("name", "Cluster_SizeY");
388  psd0.add<std::string>("title", "Cluster_SizeY;cluster size y;");
389  psd0.add<double>("xmin", -0.5);
390  psd0.add<bool>("switch", true);
391  psd0.add<double>("xmax", 25.5);
392  psd0.add<int>("NxBins", 26);
393  desc.add<edm::ParameterSetDescription>("LocalClusterSizeY", psd0);
394  }
395  {
397  psd0.add<std::string>("name", "RecHit_X");
398  psd0.add<std::string>("title", "RecHit_X;RecHit position X dimension;");
399  psd0.add<double>("xmin", -2.5);
400  psd0.add<bool>("switch", true);
401  psd0.add<double>("xmax", 2.5);
402  psd0.add<int>("NxBins", 100);
403  desc.add<edm::ParameterSetDescription>("RecHitPosX", psd0);
404  }
405  {
407  psd0.add<std::string>("name", "RecHit_Y");
408  psd0.add<std::string>("title", "RecHit_Y;RecHit position X dimension;");
409  psd0.add<double>("xmin", -2.5);
410  psd0.add<bool>("switch", true);
411  psd0.add<double>("xmax", 2.5);
412  psd0.add<int>("NxBins", 100);
413  desc.add<edm::ParameterSetDescription>("RecHitPosY", psd0);
414  }
415  {
417  psd0.add<std::string>("name", "RecHit_X_error_Vs_eta");
418  psd0.add<std::string>("title", "RecHit_X_error_Vs_eta;#eta;x error [#mum]");
419  psd0.add<bool>("switch", true);
420  psd0.add<int>("NxBins", 82);
421  psd0.add<double>("xmax", 4.1);
422  psd0.add<double>("xmin", -4.1);
423  psd0.add<double>("ymax", 10.0);
424  psd0.add<double>("ymin", 0.);
425  desc.add<edm::ParameterSetDescription>("RecHitPosErrorX_Eta", psd0);
426  }
427  {
429  psd0.add<std::string>("name", "RecHit_Y_error_Vs_eta");
430  psd0.add<std::string>("title", "RecHit_Y_error_Vs_eta;#eta;y error [#mum]");
431  psd0.add<bool>("switch", true);
432  psd0.add<int>("NxBins", 82);
433  psd0.add<double>("xmax", 4.1);
434  psd0.add<double>("xmin", -4.1);
435  psd0.add<double>("ymax", 10.0);
436  psd0.add<double>("ymin", 0.);
437  desc.add<edm::ParameterSetDescription>("RecHitPosErrorY_Eta", psd0);
438  }
439  desc.add<std::string>("TopFolderName", "TrackerPhase2ITRecHit");
440  desc.add<edm::InputTag>("rechitsSrc", edm::InputTag("siPixelRecHits"));
441  descriptions.add("Phase2ITMonitorRecHit", desc);
442 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ fillITHistos()

void Phase2ITMonitorRecHit::fillITHistos ( const edm::Event iEvent)
private

Definition at line 102 of file Phase2ITMonitorRecHit.cc.

References hcalRecHitTable_cff::detId, PVValHelper::eta, dqm::impl::MonitorElement::Fill(), phase2tkutil::getITHistoId(), globalRZ_barrel_, globalRZ_endcap_, globalXY_barrel_, globalXY_endcap_, TrackerGeometry::idToDetUnit(), iEvent, crabWrapper::key, layerMEs_, million, numberRecHits_, GeomDetEnumerators::P2PXB, GeomDetEnumerators::P2PXEC, PV3DBase< T, PVType, FrameType >::perp(), RecoTauValidation_cfi::posX, RecoTauValidation_cfi::posY, HI_PhotonSkim_cff::rechits, AlCaHLTBitMon_QueryRunRegistry::string, tkGeom_, tokenRecHitsIT_, tTopo_, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by analyze().

102  {
103  // Get the RecHits
104  const auto& rechits = iEvent.getHandle(tokenRecHitsIT_);
105  if (!rechits.isValid())
106  return;
107  std::map<std::string, unsigned int> nrechitLayerMap;
108  unsigned long int nTotrechitsinevt = 0;
109  // Loop over modules
110  for (const auto& DSViter : *rechits) {
111  // Get the detector id
112  unsigned int rawid(DSViter.detId());
113  DetId detId(rawid);
114  // Get the geomdet
115  const GeomDetUnit* geomDetunit(tkGeom_->idToDetUnit(detId));
116  if (!geomDetunit)
117  continue;
119  nTotrechitsinevt += DSViter.size();
120  auto counterDet = nrechitLayerMap.find(key);
121  if (nrechitLayerMap.find(key) == nrechitLayerMap.end()) {
122  nrechitLayerMap.emplace(key, DSViter.size());
123  } else
124  counterDet->second += DSViter.size();
125 
126  //loop over rechits for a single detId
127  for (const auto& rechit : DSViter) {
128  LocalPoint lp = rechit.localPosition();
129  Global3DPoint globalPos = geomDetunit->surface().toGlobal(lp);
130  //in mm
131  double gx = globalPos.x() * 10.;
132  double gy = globalPos.y() * 10.;
133  double gz = globalPos.z() * 10.;
134  double gr = globalPos.perp() * 10.;
135  //Fill global positions
136  if (geomDetunit->subDetector() == GeomDetEnumerators::SubDetector::P2PXB) {
137  globalXY_barrel_->Fill(gx, gy);
138  globalRZ_barrel_->Fill(gz, gr);
139  } else if (geomDetunit->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC) {
140  globalXY_endcap_->Fill(gx, gy);
141  globalRZ_endcap_->Fill(gz, gr);
142  }
143  //layer wise histo
144  if (layerMEs_[key].clusterSizeX)
145  layerMEs_[key].clusterSizeX->Fill(rechit.cluster()->sizeX());
146  if (layerMEs_[key].clusterSizeY)
147  layerMEs_[key].clusterSizeY->Fill(rechit.cluster()->sizeY());
148  if (layerMEs_[key].globalPosXY)
149  layerMEs_[key].globalPosXY->Fill(gx, gy);
150  if (layerMEs_[key].globalPosRZ)
151  layerMEs_[key].globalPosRZ->Fill(gz, gr);
152  if (layerMEs_[key].localPosXY)
153  layerMEs_[key].localPosXY->Fill(lp.x(), lp.y());
154  if (layerMEs_[key].posX)
155  layerMEs_[key].posX->Fill(lp.x());
156  if (layerMEs_[key].posY)
157  layerMEs_[key].posY->Fill(lp.y());
158  float eta = geomDetunit->surface().toGlobal(lp).eta();
159  if (layerMEs_[key].poserrX)
160  layerMEs_[key].poserrX->Fill(eta, million * rechit.localPositionError().xx());
161  if (layerMEs_[key].poserrY)
162  layerMEs_[key].poserrY->Fill(eta, million * rechit.localPositionError().yy());
163  } //end loop over rechits of a detId
164  } //End loop over DetSetVector
165 
166  //fill nRecHits per event
167  numberRecHits_->Fill(nTotrechitsinevt);
168  //fill nRecHit counter per layer
169  for (const auto& lme : nrechitLayerMap)
170  if (layerMEs_[lme.first].numberRecHits)
171  layerMEs_[lme.first].numberRecHits->Fill(lme.second);
172 }
const TrackerGeometry * tkGeom_
const edm::EDGetTokenT< SiPixelRecHitCollection > tokenRecHitsIT_
MonitorElement * globalRZ_barrel_
T perp() const
Definition: PV3DBase.h:69
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
T z() const
Definition: PV3DBase.h:61
static constexpr float million
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
MonitorElement * globalXY_barrel_
void Fill(long long x)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
MonitorElement * numberRecHits_
int iEvent
Definition: GenABIO.cc:224
Definition: DetId.h:17
std::map< std::string, RecHitME > layerMEs_
const TrackerTopology * tTopo_
MonitorElement * globalRZ_endcap_
MonitorElement * globalXY_endcap_

Member Data Documentation

◆ config_

edm::ParameterSet Phase2ITMonitorRecHit::config_
private

Definition at line 58 of file Phase2ITMonitorRecHit.cc.

Referenced by bookHistograms(), and bookLayerHistos().

◆ geomToken_

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

Definition at line 61 of file Phase2ITMonitorRecHit.cc.

Referenced by dqmBeginRun().

◆ geomType_

std::string Phase2ITMonitorRecHit::geomType_
private

Definition at line 59 of file Phase2ITMonitorRecHit.cc.

◆ globalRZ_barrel_

MonitorElement* Phase2ITMonitorRecHit::globalRZ_barrel_
private

Definition at line 69 of file Phase2ITMonitorRecHit.cc.

Referenced by bookHistograms(), and fillITHistos().

◆ globalRZ_endcap_

MonitorElement* Phase2ITMonitorRecHit::globalRZ_endcap_
private

Definition at line 70 of file Phase2ITMonitorRecHit.cc.

Referenced by bookHistograms(), and fillITHistos().

◆ globalXY_barrel_

MonitorElement* Phase2ITMonitorRecHit::globalXY_barrel_
private

Definition at line 67 of file Phase2ITMonitorRecHit.cc.

Referenced by bookHistograms(), and fillITHistos().

◆ globalXY_endcap_

MonitorElement* Phase2ITMonitorRecHit::globalXY_endcap_
private

Definition at line 68 of file Phase2ITMonitorRecHit.cc.

Referenced by bookHistograms(), and fillITHistos().

◆ layerMEs_

std::map<std::string, RecHitME> Phase2ITMonitorRecHit::layerMEs_
private

Definition at line 84 of file Phase2ITMonitorRecHit.cc.

Referenced by bookLayerHistos(), and fillITHistos().

◆ million

constexpr float Phase2ITMonitorRecHit::million = 1e6
staticprivate

Definition at line 65 of file Phase2ITMonitorRecHit.cc.

Referenced by fillITHistos().

◆ numberRecHits_

MonitorElement* Phase2ITMonitorRecHit::numberRecHits_
private

Definition at line 66 of file Phase2ITMonitorRecHit.cc.

Referenced by bookHistograms(), and fillITHistos().

◆ tkGeom_

const TrackerGeometry* Phase2ITMonitorRecHit::tkGeom_ = nullptr
private

Definition at line 63 of file Phase2ITMonitorRecHit.cc.

Referenced by bookHistograms(), dqmBeginRun(), and fillITHistos().

◆ tokenRecHitsIT_

const edm::EDGetTokenT<SiPixelRecHitCollection> Phase2ITMonitorRecHit::tokenRecHitsIT_
private

Definition at line 60 of file Phase2ITMonitorRecHit.cc.

Referenced by fillITHistos().

◆ topoToken_

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

Definition at line 62 of file Phase2ITMonitorRecHit.cc.

Referenced by dqmBeginRun().

◆ tTopo_

const TrackerTopology* Phase2ITMonitorRecHit::tTopo_ = nullptr
private