CMS 3D CMS Logo

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

#include <Phase2ITValidateRecHit.cc>

Inheritance diagram for Phase2ITValidateRecHit:
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 &, const edm::EventSetup &) override
 
 Phase2ITValidateRecHit (const edm::ParameterSet &)
 
 ~Phase2ITValidateRecHit () 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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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, const TrackerHitAssociator &associateRecHit, const std::vector< edm::Handle< edm::PSimHitContainer >> &simHits, const std::map< unsigned int, SimTrack > &selectedSimTrackMap)
 

Private Attributes

edm::ParameterSet config_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
std::string geomType_
 
std::map< std::string, RecHitMElayerMEs_
 
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
 
const double simtrackminpt_
 
const edm::EDGetTokenT< edm::SimTrackContainersimTracksToken_
 
const TrackerGeometrytkGeom_ = nullptr
 
const edm::EDGetTokenT< SiPixelRecHitCollectiontokenRecHitsIT_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 
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 >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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 53 of file Phase2ITValidateRecHit.cc.

Constructor & Destructor Documentation

◆ Phase2ITValidateRecHit()

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

Definition at line 100 of file Phase2ITValidateRecHit.cc.

101  : config_(iConfig),
102  trackerHitAssociatorConfig_(iConfig, consumesCollector()),
103  simtrackminpt_(iConfig.getParameter<double>("SimTrackMinPt")),
104  tokenRecHitsIT_(consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("rechitsSrc"))),
105  simTracksToken_(consumes<edm::SimTrackContainer>(iConfig.getParameter<edm::InputTag>("simTracksSrc"))),
106  geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
107  topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) {
108  edm::LogInfo("Phase2ITValidateRecHit") << ">>> Construct Phase2ITValidateRecHit ";
109  for (const auto& itName : config_.getParameter<std::vector<std::string>>("ROUList")) {
110  simHitTokens_.push_back(consumes<std::vector<PSimHit>>(edm::InputTag("g4SimHits", itName)));
111  }
112 }

References config_, edm::ParameterSet::getParameter(), and simHitTokens_.

◆ ~Phase2ITValidateRecHit()

Phase2ITValidateRecHit::~Phase2ITValidateRecHit ( )
override

Definition at line 114 of file Phase2ITValidateRecHit.cc.

114  {
115  edm::LogInfo("Phase2ITValidateRecHit") << ">>> Destroy Phase2ITValidateRecHit ";
116 }

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 118 of file Phase2ITValidateRecHit.cc.

118  {
119  std::vector<edm::Handle<edm::PSimHitContainer>> simHits;
120  for (const auto& itoken : simHitTokens_) {
122  iEvent.getByToken(itoken, simHitHandle);
123  if (!simHitHandle.isValid())
124  continue;
125  simHits.emplace_back(simHitHandle);
126  }
127  // Get the SimTracks and push them in a map of id, SimTrack
129  iEvent.getByToken(simTracksToken_, simTracks);
130 
131  std::map<unsigned int, SimTrack> selectedSimTrackMap;
132  for (const auto& simTrackIt : *simTracks) {
133  if (simTrackIt.momentum().pt() > simtrackminpt_) {
134  selectedSimTrackMap.emplace(simTrackIt.trackId(), simTrackIt);
135  }
136  }
138  fillITHistos(iEvent, associateRecHit, simHits, selectedSimTrackMap);
139 }

References fillITHistos(), iEvent, edm::HandleBase::isValid(), FastTrackerRecHitCombiner_cfi::simHits, simHitTokens_, simtrackminpt_, TrackCandidateProducer_cfi::simTracks, simTracksToken_, and trackerHitAssociatorConfig_.

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 239 of file Phase2ITValidateRecHit.cc.

241  {
242  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
243  edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << top_folder;
244  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
245  if (theTkDigiGeomWatcher.check(iSetup)) {
246  for (auto const& det_u : tkGeom_->detUnits()) {
247  //Always check TrackerNumberingBuilder before changing this part
248  if (!(det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB ||
249  det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC))
250  continue;
251  unsigned int detId_raw = det_u->geographicalId().rawId();
252  bookLayerHistos(ibooker, detId_raw, top_folder);
253  }
254  }
255 }

References bookLayerHistos(), edm::ESWatcher< T >::check(), config_, TrackerGeometry::detUnits(), edm::ParameterSet::getParameter(), GeomDetEnumerators::P2PXB, GeomDetEnumerators::P2PXEC, AlCaHLTBitMon_QueryRunRegistry::string, and tkGeom_.

◆ bookLayerHistos()

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

Definition at line 257 of file Phase2ITValidateRecHit.cc.

257  {
258  ibooker.cd();
260  if (key.empty())
261  return;
262  if (layerMEs_.find(key) == layerMEs_.end()) {
263  ibooker.cd();
264  RecHitME local_histos;
265  ibooker.setCurrentFolder(subdir + "/" + key);
266  edm::LogInfo("Phase2ITValidateRecHit") << " Booking Histograms in : " << (subdir + "/" + key);
267 
268  local_histos.deltaX = phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaX"), ibooker);
269 
270  local_histos.deltaY = phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("DeltaY"), ibooker);
271 
272  local_histos.pullX = phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("PullX"), ibooker);
273 
274  local_histos.pullY = phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("PullY"), ibooker);
275 
276  local_histos.deltaX_eta =
278 
279  local_histos.deltaY_eta =
281 
282  local_histos.pullX_eta =
284 
285  local_histos.pullY_eta =
287  ibooker.setCurrentFolder(subdir + "/" + key + "/PrimarySimHits");
288  //all histos for Primary particles
289  local_histos.numberRecHitsprimary =
291 
292  local_histos.deltaX_primary =
294 
295  local_histos.deltaY_primary =
297 
298  local_histos.pullX_primary =
300 
301  local_histos.pullY_primary =
303 
304  layerMEs_.emplace(key, local_histos);
305  }
306 }

References phase2tkutil::book1DFromPSet(), phase2tkutil::bookProfile1DFromPSet(), dqm::implementation::NavigatorBase::cd(), config_, Phase2ITValidateRecHit::RecHitME::deltaX, Phase2ITValidateRecHit::RecHitME::deltaX_eta, Phase2ITValidateRecHit::RecHitME::deltaX_primary, Phase2ITValidateRecHit::RecHitME::deltaY, Phase2ITValidateRecHit::RecHitME::deltaY_eta, Phase2ITValidateRecHit::RecHitME::deltaY_primary, phase2tkutil::getITHistoId(), edm::ParameterSet::getParameter(), crabWrapper::key, layerMEs_, Phase2ITValidateRecHit::RecHitME::numberRecHitsprimary, Phase2ITValidateRecHit::RecHitME::pullX, Phase2ITValidateRecHit::RecHitME::pullX_eta, Phase2ITValidateRecHit::RecHitME::pullX_primary, Phase2ITValidateRecHit::RecHitME::pullY, Phase2ITValidateRecHit::RecHitME::pullY_eta, Phase2ITValidateRecHit::RecHitME::pullY_primary, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and tTopo_.

Referenced by bookHistograms().

◆ dqmBeginRun()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 230 of file Phase2ITValidateRecHit.cc.

230  {
232  tkGeom_ = &(*geomHandle);
234  tTopo_ = tTopoHandle.product();
235 }

References geomToken_, edm::EventSetup::getHandle(), edm::ESHandle< T >::product(), tkGeom_, topoToken_, and tTopo_.

◆ fillDescriptions()

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

Definition at line 307 of file Phase2ITValidateRecHit.cc.

307  {
308  // rechitValidIT
310  {
312  psd0.add<std::string>("name", "Delta_X");
313  psd0.add<std::string>("title", "Delta_X;RecHit resolution X dimension");
314  psd0.add<double>("xmin", -0.2);
315  psd0.add<bool>("switch", true);
316  psd0.add<double>("xmax", 0.2);
317  psd0.add<int>("NxBins", 100);
318  desc.add<edm::ParameterSetDescription>("DeltaX", psd0);
319  }
320  {
322  psd0.add<std::string>("name", "Delta_Y");
323  psd0.add<std::string>("title", "Delta_Y;RecHit resolution Y dimension;");
324  psd0.add<double>("xmin", -0.2);
325  psd0.add<bool>("switch", true);
326  psd0.add<double>("xmax", 0.2);
327  psd0.add<int>("NxBins", 100);
328  desc.add<edm::ParameterSetDescription>("DeltaY", psd0);
329  }
330  {
332  psd0.add<std::string>("name", "Pull_X");
333  psd0.add<std::string>("title", "Pull_X;pull x;");
334  psd0.add<double>("xmin", -4.0);
335  psd0.add<bool>("switch", true);
336  psd0.add<double>("xmax", 4.0);
337  psd0.add<int>("NxBins", 100);
338  desc.add<edm::ParameterSetDescription>("PullX", psd0);
339  }
340  {
342  psd0.add<std::string>("name", "Pull_Y");
343  psd0.add<std::string>("title", "Pull_Y;pull y;");
344  psd0.add<double>("xmin", -4.0);
345  psd0.add<bool>("switch", true);
346  psd0.add<double>("xmax", 4.0);
347  psd0.add<int>("NxBins", 100);
348  desc.add<edm::ParameterSetDescription>("PullY", psd0);
349  }
350  {
352  psd0.add<std::string>("name", "Delta_X_vs_Eta");
353  psd0.add<std::string>("title", "Delta_X_vs_Eta;#eta;#Delta x");
354  psd0.add<double>("ymax", 0.02);
355  psd0.add<int>("NxBins", 82);
356  psd0.add<bool>("switch", true);
357  psd0.add<double>("xmax", 4.1);
358  psd0.add<double>("xmin", -4.1);
359  psd0.add<double>("ymin", -0.02);
360  desc.add<edm::ParameterSetDescription>("DeltaX_eta", psd0);
361  }
362  {
364  psd0.add<std::string>("name", "Delta_Y_vs_Eta");
365  psd0.add<std::string>("title", "Delta_Y_vs_Eta;#eta;#Delta y");
366  psd0.add<double>("ymax", 0.02);
367  psd0.add<int>("NxBins", 82);
368  psd0.add<bool>("switch", true);
369  psd0.add<double>("xmax", 4.1);
370  psd0.add<double>("xmin", -4.1);
371  psd0.add<double>("ymin", -0.02);
372  desc.add<edm::ParameterSetDescription>("DeltaY_eta", psd0);
373  }
374  {
376  psd0.add<std::string>("name", "Pull_X_vs_Eta");
377  psd0.add<std::string>("title", "Pull_X_vs_Eta;#eta;pull x");
378  psd0.add<double>("ymax", 4.0);
379  psd0.add<int>("NxBins", 82);
380  psd0.add<bool>("switch", true);
381  psd0.add<double>("xmax", 4.1);
382  psd0.add<double>("xmin", -4.1);
383  psd0.add<double>("ymin", -4.0);
384  desc.add<edm::ParameterSetDescription>("PullX_eta", psd0);
385  }
386  {
388  psd0.add<std::string>("name", "Pull_Y_vs_Eta");
389  psd0.add<std::string>("title", "Pull_Y_vs_Eta;#eta;pull y");
390  psd0.add<double>("ymax", 4.0);
391  psd0.add<int>("NxBins", 82);
392  psd0.add<bool>("switch", true);
393  psd0.add<double>("xmax", 4.1);
394  psd0.add<double>("xmin", -4.1);
395  psd0.add<double>("ymin", -4.0);
396  desc.add<edm::ParameterSetDescription>("PullY_eta", psd0);
397  }
398  //simhits primary
399  {
401  psd0.add<std::string>("name", "Number_RecHits_matched_PrimarySimTrack");
402  psd0.add<std::string>("title", "Number of RecHits matched to primary SimTrack;;");
403  psd0.add<double>("xmin", 0.0);
404  psd0.add<bool>("switch", true);
405  psd0.add<double>("xmax", 0.0);
406  psd0.add<int>("NxBins", 100);
407  desc.add<edm::ParameterSetDescription>("nRecHits_primary", psd0);
408  }
409  {
411  psd0.add<std::string>("name", "Delta_X_SimHitPrimary");
412  psd0.add<std::string>("title", "Delta_X_SimHitPrimary;#delta x;");
413  psd0.add<double>("xmin", -0.2);
414  psd0.add<bool>("switch", true);
415  psd0.add<double>("xmax", 0.2);
416  psd0.add<int>("NxBins", 100);
417  desc.add<edm::ParameterSetDescription>("DeltaX_primary", psd0);
418  }
419  {
421  psd0.add<std::string>("name", "Delta_Y_SimHitPrimary");
422  psd0.add<std::string>("title", "Delta_Y_SimHitPrimary;#Delta y;");
423  psd0.add<double>("xmin", -0.2);
424  psd0.add<bool>("switch", true);
425  psd0.add<double>("xmax", 0.2);
426  psd0.add<int>("NxBins", 100);
427  desc.add<edm::ParameterSetDescription>("DeltaY_primary", psd0);
428  }
429  {
431  psd0.add<std::string>("name", "Pull_X_SimHitPrimary");
432  psd0.add<std::string>("title", "Pull_X_SimHitPrimary;pull x;");
433  psd0.add<double>("ymax", 4.0);
434  psd0.add<int>("NxBins", 82);
435  psd0.add<bool>("switch", true);
436  psd0.add<double>("xmax", 4.1);
437  psd0.add<double>("xmin", -4.1);
438  psd0.add<double>("ymin", -4.0);
439  desc.add<edm::ParameterSetDescription>("PullX_primary", psd0);
440  }
441  {
443  psd0.add<std::string>("name", "Pull_Y_SimHitPrimary");
444  psd0.add<std::string>("title", "Pull_Y_SimHitPrimary;pull y;");
445  psd0.add<double>("ymax", 4.0);
446  psd0.add<int>("NxBins", 82);
447  psd0.add<bool>("switch", true);
448  psd0.add<double>("xmax", 4.1);
449  psd0.add<double>("xmin", -4.1);
450  psd0.add<double>("ymin", -4.0);
451  desc.add<edm::ParameterSetDescription>("PullY_primary", psd0);
452  }
453  //to be used in TrackerHitAssociator
454  desc.add<bool>("associatePixel", true);
455  desc.add<bool>("associateStrip", false);
456  desc.add<bool>("usePhase2Tracker", true);
457  desc.add<bool>("associateRecoTracks", false);
458  desc.add<bool>("associateHitbySimTrack", true);
459  desc.add<edm::InputTag>("pixelSimLinkSrc", edm::InputTag("simSiPixelDigis", "Pixel"));
460  desc.add<std::vector<std::string>>("ROUList",
461  {
462  "TrackerHitsPixelBarrelLowTof",
463  "TrackerHitsPixelBarrelHighTof",
464  "TrackerHitsPixelEndcapLowTof",
465  "TrackerHitsPixelEndcapHighTof",
466  });
467  //
468  desc.add<edm::InputTag>("simTracksSrc", edm::InputTag("g4SimHits"));
469  desc.add<edm::InputTag>("SimVertexSource", edm::InputTag("g4SimHits"));
470  desc.add<double>("SimTrackMinPt", 2.0);
471  desc.add<edm::InputTag>("rechitsSrc", edm::InputTag("siPixelRecHits"));
472  desc.add<std::string>("TopFolderName", "TrackerPhase2ITRecHitV");
473  desc.add<bool>("Verbosity", false);
474  descriptions.add("Phase2ITValidateRecHit", desc);
475 }

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

◆ fillITHistos()

void Phase2ITValidateRecHit::fillITHistos ( const edm::Event iEvent,
const TrackerHitAssociator associateRecHit,
const std::vector< edm::Handle< edm::PSimHitContainer >> &  simHits,
const std::map< unsigned int, SimTrack > &  selectedSimTrackMap 
)
private

Definition at line 141 of file Phase2ITValidateRecHit.cc.

144  {
145  // Get the RecHits
147  iEvent.getByToken(tokenRecHitsIT_, rechits);
148  if (!rechits.isValid())
149  return;
150  std::map<std::string, unsigned int> nrechitLayerMap_primary;
151  // Loop over modules
152  for (const auto& DSViter : *rechits) {
153  // Get the detector unit's id
154  unsigned int rawid(DSViter.detId());
155  DetId detId(rawid);
156  // Get the geomdet
157  const GeomDetUnit* geomDetunit(tkGeom_->idToDetUnit(detId));
158  if (!geomDetunit)
159  continue;
160  // determine the detector we are in
162  if (nrechitLayerMap_primary.find(key) == nrechitLayerMap_primary.end()) {
163  nrechitLayerMap_primary.emplace(key, DSViter.size());
164  } else {
165  nrechitLayerMap_primary[key] += DSViter.size();
166  }
167  //loop over rechits for a single detId
168  for (const auto& rechit : DSViter) {
169  //GetSimHits
170  const std::vector<SimHitIdpr>& matchedId = associateRecHit.associateHitId(rechit);
171  const PSimHit* simhitClosest = nullptr;
172  float minx = 10000;
173  LocalPoint lp = rechit.localPosition();
174  for (const auto& simHitCol : simHits) {
175  for (const auto& simhitIt : *simHitCol) {
176  if (detId.rawId() != simhitIt.detUnitId())
177  continue;
178  for (const auto& mId : matchedId) {
179  if (simhitIt.trackId() == mId.first) {
180  if (!simhitClosest || abs(simhitIt.localPosition().x() - lp.x()) < minx) {
181  minx = abs(simhitIt.localPosition().x() - lp.x());
182  simhitClosest = &simhitIt;
183  }
184  }
185  }
186  } //end loop over PSimhitcontainers
187  } //end loop over simHits
188  if (!simhitClosest)
189  continue;
190  auto simTrackIt(selectedSimTrackMap.find(simhitClosest->trackId()));
191  bool isPrimary = false;
192  //check if simhit is primary
193  if (simTrackIt != selectedSimTrackMap.end())
194  isPrimary = phase2tkutil::isPrimary(simTrackIt->second, simhitClosest);
195  Local3DPoint simlp(simhitClosest->localPosition());
196  const LocalError& lperr = rechit.localPositionError();
197  double dx = lp.x() - simlp.x();
198  double dy = lp.y() - simlp.y();
199  double pullx = 999.;
200  double pully = 999.;
201  if (lperr.xx())
202  pullx = (lp.x() - simlp.x()) / std::sqrt(lperr.xx());
203  if (lperr.yy())
204  pully = (lp.y() - simlp.y()) / std::sqrt(lperr.yy());
205  float eta = geomDetunit->surface().toGlobal(lp).eta();
206  layerMEs_[key].deltaX->Fill(dx);
207  layerMEs_[key].deltaY->Fill(dy);
208  layerMEs_[key].pullX->Fill(pullx);
209  layerMEs_[key].pullY->Fill(pully);
210  layerMEs_[key].deltaX_eta->Fill(eta, dx);
211  layerMEs_[key].deltaY_eta->Fill(eta, dy);
212  layerMEs_[key].pullX_eta->Fill(eta, pullx);
213  layerMEs_[key].pullY_eta->Fill(eta, pully);
214  if (isPrimary) {
215  layerMEs_[key].deltaX_primary->Fill(dx);
216  layerMEs_[key].deltaY_primary->Fill(dy);
217  layerMEs_[key].pullX_primary->Fill(pullx);
218  layerMEs_[key].pullY_primary->Fill(pully);
219  } else
220  nrechitLayerMap_primary[key]--;
221  } //end loop over rechits of a detId
222  } //End loop over DetSetVector
223 
224  //fill nRecHit counter per layer
225  for (const auto& lme : nrechitLayerMap_primary) {
226  layerMEs_[lme.first].numberRecHitsprimary->Fill(nrechitLayerMap_primary[lme.first]);
227  }
228 }

References funct::abs(), TrackerHitAssociator::associateHitId(), PVValHelper::dx, PVValHelper::dy, PVValHelper::eta, phase2tkutil::getITHistoId(), TrackerGeometry::idToDetUnit(), iEvent, phase2tkutil::isPrimary(), crabWrapper::key, layerMEs_, PSimHit::localPosition(), HI_PhotonSkim_cff::rechits, FastTrackerRecHitCombiner_cfi::simHits, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, tkGeom_, tokenRecHitsIT_, PSimHit::trackId(), tTopo_, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by analyze().

Member Data Documentation

◆ config_

edm::ParameterSet Phase2ITValidateRecHit::config_
private

◆ geomToken_

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

Definition at line 77 of file Phase2ITValidateRecHit.cc.

Referenced by dqmBeginRun().

◆ geomType_

std::string Phase2ITValidateRecHit::geomType_
private

Definition at line 73 of file Phase2ITValidateRecHit.cc.

◆ layerMEs_

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

Definition at line 97 of file Phase2ITValidateRecHit.cc.

Referenced by bookLayerHistos(), and fillITHistos().

◆ simHitTokens_

std::vector<edm::EDGetTokenT<edm::PSimHitContainer> > Phase2ITValidateRecHit::simHitTokens_
private

Definition at line 76 of file Phase2ITValidateRecHit.cc.

Referenced by analyze(), and Phase2ITValidateRecHit().

◆ simtrackminpt_

const double Phase2ITValidateRecHit::simtrackminpt_
private

Definition at line 72 of file Phase2ITValidateRecHit.cc.

Referenced by analyze().

◆ simTracksToken_

const edm::EDGetTokenT<edm::SimTrackContainer> Phase2ITValidateRecHit::simTracksToken_
private

Definition at line 75 of file Phase2ITValidateRecHit.cc.

Referenced by analyze().

◆ tkGeom_

const TrackerGeometry* Phase2ITValidateRecHit::tkGeom_ = nullptr
private

Definition at line 79 of file Phase2ITValidateRecHit.cc.

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

◆ tokenRecHitsIT_

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

Definition at line 74 of file Phase2ITValidateRecHit.cc.

Referenced by fillITHistos().

◆ topoToken_

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

Definition at line 78 of file Phase2ITValidateRecHit.cc.

Referenced by dqmBeginRun().

◆ trackerHitAssociatorConfig_

TrackerHitAssociator::Config Phase2ITValidateRecHit::trackerHitAssociatorConfig_
private

Definition at line 71 of file Phase2ITValidateRecHit.cc.

Referenced by analyze().

◆ tTopo_

const TrackerTopology* Phase2ITValidateRecHit::tTopo_ = nullptr
private

Definition at line 80 of file Phase2ITValidateRecHit.cc.

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

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
phase2tkutil::book1DFromPSet
MonitorElement * book1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
Definition: TrackerPhase2DQMUtil.cc:50
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
GeomDet
Definition: GeomDet.h:27
edm::ESWatcher< TrackerDigiGeometryRecord >
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
Phase2ITValidateRecHit::tokenRecHitsIT_
const edm::EDGetTokenT< SiPixelRecHitCollection > tokenRecHitsIT_
Definition: Phase2ITValidateRecHit.cc:74
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
FastTrackerRecHitCombiner_cfi.simHits
simHits
Definition: FastTrackerRecHitCombiner_cfi.py:5
TrackCandidateProducer_cfi.simTracks
simTracks
Definition: TrackCandidateProducer_cfi.py:15
Phase2ITValidateRecHit::fillITHistos
void fillITHistos(const edm::Event &iEvent, const TrackerHitAssociator &associateRecHit, const std::vector< edm::Handle< edm::PSimHitContainer >> &simHits, const std::map< unsigned int, SimTrack > &selectedSimTrackMap)
Definition: Phase2ITValidateRecHit.cc:141
Phase2ITValidateRecHit::config_
edm::ParameterSet config_
Definition: Phase2ITValidateRecHit.cc:70
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< edm::PSimHitContainer >
Phase2ITValidateRecHit::tTopo_
const TrackerTopology * tTopo_
Definition: Phase2ITValidateRecHit.cc:80
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: TrackerGeometry.cc:183
DetId
Definition: DetId.h:17
Phase2ITValidateRecHit::layerMEs_
std::map< std::string, RecHitME > layerMEs_
Definition: Phase2ITValidateRecHit.cc:97
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
TrackerGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: TrackerGeometry.h:61
PVValHelper::eta
Definition: PVValidationHelpers.h:69
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
edm::ESHandle< TrackerGeometry >
PSimHit::localPosition
Local3DPoint localPosition() const
Definition: PSimHit.h:52
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
Phase2ITValidateRecHit::tkGeom_
const TrackerGeometry * tkGeom_
Definition: Phase2ITValidateRecHit.cc:79
HI_PhotonSkim_cff.rechits
rechits
Definition: HI_PhotonSkim_cff.py:76
Point3DBase< float, LocalTag >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Phase2ITValidateRecHit::simHitTokens_
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
Definition: Phase2ITValidateRecHit.cc:76
edm::ParameterSet
Definition: ParameterSet.h:47
Phase2ITValidateRecHit::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: Phase2ITValidateRecHit.cc:77
LocalError
Definition: LocalError.h:12
phase2tkutil::isPrimary
bool isPrimary(const SimTrack &simTrk, const PSimHit *simHit)
Definition: TrackerPhase2ValidationUtil.cc:2
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
Phase2ITValidateRecHit::simtrackminpt_
const double simtrackminpt_
Definition: Phase2ITValidateRecHit.cc:72
Phase2ITValidateRecHit::bookLayerHistos
void bookLayerHistos(DQMStore::IBooker &ibooker, unsigned int det_id, std::string &subdir)
Definition: Phase2ITValidateRecHit.cc:257
PVValHelper::dy
Definition: PVValidationHelpers.h:49
TrackerHitAssociator
Definition: TrackerHitAssociator.h:55
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
phase2tkutil::getITHistoId
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
Definition: TrackerPhase2DQMUtil.cc:2
Phase2ITValidateRecHit::trackerHitAssociatorConfig_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
Definition: Phase2ITValidateRecHit.cc:71
phase2tkutil::bookProfile1DFromPSet
MonitorElement * bookProfile1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
Definition: TrackerPhase2DQMUtil.cc:77
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PSimHit::trackId
unsigned int trackId() const
Definition: PSimHit.h:106
GeomDetEnumerators::P2PXB
Definition: GeomDetEnumerators.h:27
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Phase2ITValidateRecHit::simTracksToken_
const edm::EDGetTokenT< edm::SimTrackContainer > simTracksToken_
Definition: Phase2ITValidateRecHit.cc:75
PSimHit
Definition: PSimHit.h:15
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
crabWrapper.key
key
Definition: crabWrapper.py:19
TrackerHitAssociator::associateHitId
std::vector< SimHitIdpr > associateHitId(const TrackingRecHit &thit) const
Definition: TrackerHitAssociator.cc:332
edm::InputTag
Definition: InputTag.h:15
PVValHelper::dx
Definition: PVValidationHelpers.h:48
Phase2ITValidateRecHit::topoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Definition: Phase2ITValidateRecHit.cc:78
GeomDetEnumerators::P2PXEC
Definition: GeomDetEnumerators.h:28