CMS 3D CMS Logo

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

#include <Phase2OTValidateCluster.cc>

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

Classes

struct  ClusterMEs
 

Public Types

typedef std::map< unsigned int, std::vector< PSimHit > > SimHitsMap
 
typedef std::map< unsigned int, SimTrackSimTracksMap
 
- 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
 

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
 
 Phase2OTValidateCluster (const edm::ParameterSet &)
 
 ~Phase2OTValidateCluster () 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, uint32_t det_it, const std::string &subdir)
 
void fillOTHistos (const edm::Event &iEvent, const std::vector< edm::Handle< edm::PSimHitContainer >> &simHits, const std::map< unsigned int, SimTrack > &simTracks)
 
std::vector< unsigned int > getSimTrackId (const edm::Handle< edm::DetSetVector< PixelDigiSimLink >> &pixelSimLinks, const DetId &detId, unsigned int channel)
 

Private Attributes

edm::EDGetTokenT< Phase2TrackerCluster1DCollectionNewclustersToken_
 
edm::ParameterSet config_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordgeomToken_
 
std::map< std::string, ClusterMEslayerMEs_
 
std::vector< edm::InputTagpSimHitSrc_
 
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
 
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > simITLinksToken_
 
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > simOTLinksToken_
 
double simtrackminpt_
 
edm::EDGetTokenT< edm::SimTrackContainersimTracksToken_
 
const TrackerGeometrytkGeom_ = nullptr
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtopoToken_
 
const TrackerTopologytTopo_ = nullptr
 

Additional Inherited Members

- 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: Validation plots tracker clusters.

Definition at line 50 of file Phase2OTValidateCluster.cc.

Member Typedef Documentation

◆ SimHitsMap

typedef std::map<unsigned int, std::vector<PSimHit> > Phase2OTValidateCluster::SimHitsMap

Definition at line 52 of file Phase2OTValidateCluster.cc.

◆ SimTracksMap

typedef std::map<unsigned int, SimTrack> Phase2OTValidateCluster::SimTracksMap

Definition at line 53 of file Phase2OTValidateCluster.cc.

Constructor & Destructor Documentation

◆ Phase2OTValidateCluster()

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

Definition at line 102 of file Phase2OTValidateCluster.cc.

103  : config_(iConfig),
104  simtrackminpt_(config_.getParameter<double>("SimTrackMinPt")),
106  config_.getParameter<edm::InputTag>("OuterTrackerDigiSimLinkSource"))),
107  simTracksToken_(consumes<edm::SimTrackContainer>(config_.getParameter<edm::InputTag>("simtracks"))),
109  consumes<Phase2TrackerCluster1DCollectionNew>(config_.getParameter<edm::InputTag>("ClusterSource"))),
110  pSimHitSrc_(config_.getParameter<std::vector<edm::InputTag>>("PSimHitSource")),
111  geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
112  topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()) {
113  edm::LogInfo("Phase2OTValidateCluster") << ">>> Construct Phase2OTValidateCluster ";
114  for (const auto& itag : pSimHitSrc_)
115  simHitTokens_.push_back(consumes<edm::PSimHitContainer>(itag));
116 }

References pSimHitSrc_, and simHitTokens_.

◆ ~Phase2OTValidateCluster()

Phase2OTValidateCluster::~Phase2OTValidateCluster ( )
override

Definition at line 118 of file Phase2OTValidateCluster.cc.

118  {
119  // do anything here that needs to be done at desctruction time
120  // (e.g. close files, deallocate resources etc.)
121  edm::LogInfo("Phase2OTValidateCluster") << ">>> Destroy Phase2OTValidateCluster ";
122 }

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 135 of file Phase2OTValidateCluster.cc.

135  {
136  // Getting simHits
137  std::vector<edm::Handle<edm::PSimHitContainer>> simHits;
138  for (const auto& itoken : simHitTokens_) {
140  iEvent.getByToken(itoken, simHitHandle);
141  if (!simHitHandle.isValid())
142  continue;
143  simHits.emplace_back(simHitHandle);
144  }
145  // Get the SimTracks
147  iEvent.getByToken(simTracksToken_, simTracksRaw);
148 
149  // Rearrange the simTracks for ease of use <simTrackID, simTrack>
151  for (edm::SimTrackContainer::const_iterator simTrackIt(simTracksRaw->begin()); simTrackIt != simTracksRaw->end();
152  ++simTrackIt) {
153  if (simTrackIt->momentum().pt() > simtrackminpt_) {
154  simTracks.emplace(simTrackIt->trackId(), *simTrackIt);
155  }
156  }
158 }

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

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 265 of file Phase2OTValidateCluster.cc.

267  {
268  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
269  edm::LogInfo("Phase2OTValidateCluster") << " Booking Histograms in: " << top_folder;
270 
271  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
272  if (theTkDigiGeomWatcher.check(iSetup)) {
273  for (auto const& det_u : tkGeom_->detUnits()) {
274  //Always check TrackerNumberingBuilder before changing this part
275  if ((det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXB ||
276  det_u->subDetector() == GeomDetEnumerators::SubDetector::P2PXEC))
277  continue; //continue if Pixel
278  uint32_t detId_raw = det_u->geographicalId().rawId();
279  bookLayerHistos(ibooker, detId_raw, top_folder);
280  }
281  }
282 }

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

◆ bookLayerHistos()

void Phase2OTValidateCluster::bookLayerHistos ( DQMStore::IBooker ibooker,
uint32_t  det_it,
const std::string &  subdir 
)
private

Definition at line 285 of file Phase2OTValidateCluster.cc.

285  {
287  if (folderName.empty()) {
288  edm::LogWarning("Phase2OTValidateCluster") << ">>>> Invalid histo_id ";
289  return;
290  }
291 
292  if (layerMEs_.find(folderName) == layerMEs_.end()) {
293  ibooker.cd();
294  edm::LogInfo("Phase2TrackerValidateDigi") << " Booking Histograms in: " << subdir + '/' + folderName;
295  ClusterMEs local_mes;
297  ibooker.setCurrentFolder(subdir + '/' + folderName);
298 
299  local_mes.deltaX_P =
301 
302  local_mes.deltaY_P =
304 
305  // Puting primary digis in a subfolder
306  ibooker.setCurrentFolder(subdir + '/' + folderName + "/PrimarySimHits");
307 
308  local_mes.deltaX_P_primary =
309  phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("Delta_X_Pixel_Primary"), ibooker);
310 
311  local_mes.deltaY_P_primary =
312  phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("Delta_Y_Pixel_Primary"), ibooker);
313  }
314  ibooker.setCurrentFolder(subdir + '/' + folderName);
315 
316  local_mes.deltaX_S =
318 
319  local_mes.deltaY_S =
321 
322  // Puting primary digis in a subfolder
323  ibooker.setCurrentFolder(subdir + '/' + folderName + "/PrimarySimHits");
324 
325  local_mes.deltaX_S_primary =
326  phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("Delta_X_Strip_Primary"), ibooker);
327 
328  local_mes.deltaY_S_primary =
329  phase2tkutil::book1DFromPSet(config_.getParameter<edm::ParameterSet>("Delta_Y_Strip_Primary"), ibooker);
330 
331  layerMEs_.emplace(folderName, local_mes);
332  }
333 }

References phase2tkutil::book1DFromPSet(), dqm::implementation::NavigatorBase::cd(), config_, Phase2OTValidateCluster::ClusterMEs::deltaX_P, Phase2OTValidateCluster::ClusterMEs::deltaX_P_primary, Phase2OTValidateCluster::ClusterMEs::deltaX_S, Phase2OTValidateCluster::ClusterMEs::deltaX_S_primary, Phase2OTValidateCluster::ClusterMEs::deltaY_P, Phase2OTValidateCluster::ClusterMEs::deltaY_P_primary, Phase2OTValidateCluster::ClusterMEs::deltaY_S, Phase2OTValidateCluster::ClusterMEs::deltaY_S_primary, ALCARECODTCalibSynchCosmicsDQM_cff::folderName, TrackerGeometry::getDetectorType(), phase2tkutil::getOTHistoId(), edm::ParameterSet::getParameter(), layerMEs_, TrackerGeometry::Ph2PSP, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, tkGeom_, and tTopo_.

Referenced by bookHistograms().

◆ dqmBeginRun()

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

Reimplemented from DQMEDAnalyzer.

Definition at line 126 of file Phase2OTValidateCluster.cc.

126  {
128  tkGeom_ = &(*geomHandle);
130  tTopo_ = tTopoHandle.product();
131 }

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

◆ fillDescriptions()

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

Definition at line 349 of file Phase2OTValidateCluster.cc.

349  {
351  //for macro-pixel sensors
352  std::string mptag = "macro-pixel sensor";
353  std::string striptag = "strip sensor";
354  {
356  psd0.add<std::string>("name", "Delta_X_Pixel");
357  psd0.add<std::string>("title", "#Delta X " + mptag + ";Cluster resolution X coordinate [#mum]");
358  psd0.add<bool>("switch", true);
359  psd0.add<double>("xmax", 250);
360  psd0.add<double>("xmin", -250);
361  psd0.add<int>("NxBins", 100);
362  desc.add<edm::ParameterSetDescription>("Delta_X_Pixel", psd0);
363  }
364  {
366  psd0.add<std::string>("name", "Delta_Y_Pixel");
367  psd0.add<std::string>("title", "#Delta Y " + mptag + ";Cluster resolution Y coordinate [#mum]");
368  psd0.add<bool>("switch", true);
369  psd0.add<double>("xmin", -1500);
370  psd0.add<double>("xmax", 1500);
371  psd0.add<int>("NxBins", 100);
372  desc.add<edm::ParameterSetDescription>("Delta_Y_Pixel", psd0);
373  }
374  {
376  psd0.add<std::string>("name", "Delta_X_Pixel_Primary");
377  psd0.add<std::string>("title", "#Delta X " + mptag + ";cluster resolution X coordinate [#mum]");
378  psd0.add<bool>("switch", true);
379  psd0.add<double>("xmin", -250);
380  psd0.add<double>("xmax", 250);
381  psd0.add<int>("NxBins", 100);
382  desc.add<edm::ParameterSetDescription>("Delta_X_Pixel_Primary", psd0);
383  }
384  {
386  psd0.add<std::string>("name", "Delta_Y_Pixel_Primary");
387  psd0.add<std::string>("title", "#Delta Y " + mptag + ";cluster resolution Y coordinate [#mum]");
388  psd0.add<bool>("switch", true);
389  psd0.add<double>("xmin", -500);
390  psd0.add<double>("xmax", 500);
391  psd0.add<int>("NxBins", 100);
392  desc.add<edm::ParameterSetDescription>("Delta_Y_Pixel_Primary", psd0);
393  }
394 
395  //strip sensors
396  {
398  psd0.add<std::string>("name", "Delta_X_Strip");
399  psd0.add<std::string>("title", "#Delta X " + striptag + ";Cluster resolution X coordinate [#mum]");
400  psd0.add<bool>("switch", true);
401  psd0.add<double>("xmin", -250);
402  psd0.add<double>("xmax", 250);
403  psd0.add<int>("NxBins", 100);
404  desc.add<edm::ParameterSetDescription>("Delta_X_Strip", psd0);
405  }
406  {
408  psd0.add<std::string>("name", "Delta_Y_Strip");
409  psd0.add<std::string>("title", "#Delta Y " + striptag + ";Cluster resolution Y coordinate [cm]");
410  psd0.add<double>("xmin", -5.0);
411  psd0.add<bool>("switch", true);
412  psd0.add<double>("xmax", 5.0);
413  psd0.add<int>("NxBins", 100);
414  desc.add<edm::ParameterSetDescription>("Delta_Y_Strip", psd0);
415  }
416  {
418  psd0.add<std::string>("name", "Delta_X_Strip_Primary");
419  psd0.add<std::string>("title", "#Delta X " + striptag + ";Cluster resolution X coordinate [#mum]");
420  psd0.add<bool>("switch", true);
421  psd0.add<double>("xmin", -250);
422  psd0.add<double>("xmax", 250);
423  psd0.add<int>("NxBins", 100);
424  desc.add<edm::ParameterSetDescription>("Delta_X_Strip_Primary", psd0);
425  }
426  {
428  psd0.add<std::string>("name", "Delta_Y_Strip_Primary");
429  psd0.add<std::string>("title", "#Delta Y " + striptag + ";Cluster resolution Y coordinate [cm]");
430  psd0.add<double>("xmin", -5.0);
431  psd0.add<bool>("switch", true);
432  psd0.add<double>("xmax", 5.0);
433  psd0.add<int>("NxBins", 100);
434  desc.add<edm::ParameterSetDescription>("Delta_Y_Strip_Primary", psd0);
435  }
436  desc.add<std::string>("TopFolderName", "TrackerPhase2OTClusterV");
437  desc.add<edm::InputTag>("ClusterSource", edm::InputTag("siPhase2Clusters"));
438  desc.add<edm::InputTag>("OuterTrackerDigiSimLinkSource", edm::InputTag("simSiPixelDigis", "Tracker"));
439  desc.add<edm::InputTag>("simtracks", edm::InputTag("g4SimHits"));
440  desc.add<double>("SimTrackMinPt", 0.0);
441  desc.add<std::vector<edm::InputTag>>("PSimHitSource",
442  {
443  edm::InputTag("g4SimHits:TrackerHitsTIBLowTof"),
444  edm::InputTag("g4SimHits:TrackerHitsTIBHighTof"),
445  edm::InputTag("g4SimHits:TrackerHitsTIDLowTof"),
446  edm::InputTag("g4SimHits:TrackerHitsTIDHighTof"),
447  edm::InputTag("g4SimHits:TrackerHitsTOBLowTof"),
448  edm::InputTag("g4SimHits:TrackerHitsTOBHighTof"),
449  edm::InputTag("g4SimHits:TrackerHitsTECLowTof"),
450  edm::InputTag("g4SimHits:TrackerHitsTECHighTof"),
451  edm::InputTag("g4SimHits:TrackerHitsPixelBarrelLowTof"),
452  edm::InputTag("g4SimHits:TrackerHitsPixelBarrelHighTof"),
453  edm::InputTag("g4SimHits:TrackerHitsPixelEndcapLowTof"),
454  edm::InputTag("g4SimHits:TrackerHitsPixelEndcapHighTof"),
455  });
456  descriptions.add("Phase2OTValidateCluster", desc);
457 }

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

◆ fillOTHistos()

void Phase2OTValidateCluster::fillOTHistos ( const edm::Event iEvent,
const std::vector< edm::Handle< edm::PSimHitContainer >> &  simHits,
const std::map< unsigned int, SimTrack > &  simTracks 
)
private

Definition at line 160 of file Phase2OTValidateCluster.cc.

162  {
163  // Getting the clusters
165  iEvent.getByToken(clustersToken_, clusterHandle);
166 
167  // Getting PixelDigiSimLinks
169  iEvent.getByToken(simOTLinksToken_, pixelSimLinksHandle);
170 
171  // Number of clusters
172  std::map<std::string, unsigned int> nPrimarySimHits[3];
173  std::map<std::string, unsigned int> nOtherSimHits[3];
174  for (const auto& DSVItr : *clusterHandle) {
175  // Getting the id of detector unit
176  uint32_t rawid = DSVItr.detId();
177  DetId detId(rawid);
178  const GeomDetUnit* geomDetUnit(tkGeom_->idToDetUnit(detId));
179  if (!geomDetUnit)
180  continue;
182 
183  std::string folderkey = phase2tkutil::getOTHistoId(detId, tTopo_);
184  for (const auto& clusterItr : DSVItr) {
185  MeasurementPoint mpCluster(clusterItr.center(), clusterItr.column() + 0.5);
186  Local3DPoint localPosCluster = geomDetUnit->topology().localPosition(mpCluster);
187 
188  // Get simTracks from the cluster
189  std::vector<unsigned int> clusterSimTrackIds;
190  for (unsigned int i(0); i < clusterItr.size(); ++i) {
191  unsigned int channel(Phase2TrackerDigi::pixelToChannel(clusterItr.firstRow() + i, clusterItr.column()));
192  std::vector<unsigned int> simTrackIds(getSimTrackId(pixelSimLinksHandle, detId, channel));
193  for (auto it : simTrackIds) {
194  bool add = true;
195  for (unsigned int j = 0; j < clusterSimTrackIds.size(); ++j) {
196  // only save simtrackids that are not present yet
197  if (it == clusterSimTrackIds.at(j))
198  add = false;
199  }
200  if (add)
201  clusterSimTrackIds.push_back(it);
202  }
203  }
204  std::sort(clusterSimTrackIds.begin(), clusterSimTrackIds.end());
205  const PSimHit* closestSimHit = nullptr;
206  float mind = 1e4;
207  // Get the SimHit
208  for (const auto& psimhitCont : simHits) {
209  for (const auto& simhitIt : *psimhitCont) {
210  if (rawid == simhitIt.detUnitId()) {
211  auto it = std::lower_bound(clusterSimTrackIds.begin(), clusterSimTrackIds.end(), simhitIt.trackId());
212  if (it != clusterSimTrackIds.end() && *it == simhitIt.trackId()) {
213  float dx = simhitIt.localPosition().x() - localPosCluster.x();
214  float dy = simhitIt.localPosition().y() - localPosCluster.y();
215  float dist = std::sqrt(dx * dx + dy * dy);
216  if (!closestSimHit || dist < mind) {
217  mind = dist;
218  closestSimHit = &simhitIt;
219  }
220  }
221  }
222  } //end loop over PSimhitcontainers
223  } //end loop over simHits
224 
225  if (!closestSimHit)
226  continue;
227  // only look at simhits from highpT tracks
228  auto simTrackIt(simTracks.find(closestSimHit->trackId()));
229  if (simTrackIt == simTracks.end())
230  continue;
231 
232  Local3DPoint localPosSimHit(closestSimHit->localPosition());
233  const float deltaX = localPosCluster.x() - localPosSimHit.x();
234  const float deltaY = localPosCluster.y() - localPosSimHit.y();
235 
236  auto layerMEit = layerMEs_.find(folderkey);
237  if (layerMEit == layerMEs_.end())
238  continue;
239 
240  ClusterMEs& local_mes = layerMEit->second;
242  local_mes.deltaX_P->Fill(phase2tkutil::cmtomicron * deltaX);
243  local_mes.deltaY_P->Fill(phase2tkutil::cmtomicron * deltaY);
245  local_mes.deltaX_S->Fill(phase2tkutil::cmtomicron * deltaX);
246  local_mes.deltaY_S->Fill(deltaY);
247  }
248  // Primary particles only
249  if (phase2tkutil::isPrimary(simTrackIt->second, closestSimHit)) {
251  local_mes.deltaX_P_primary->Fill(phase2tkutil::cmtomicron * deltaX);
252  local_mes.deltaY_P_primary->Fill(phase2tkutil::cmtomicron * deltaY);
254  local_mes.deltaX_S_primary->Fill(phase2tkutil::cmtomicron * deltaX);
255  local_mes.deltaY_S_primary->Fill(deltaY);
256  }
257  }
258  }
259  }
260 }

References PVValHelper::add(), clustersToken_, phase2tkutil::cmtomicron, Phase2OTValidateCluster::ClusterMEs::deltaX_P, Phase2OTValidateCluster::ClusterMEs::deltaX_P_primary, Phase2OTValidateCluster::ClusterMEs::deltaX_S, Phase2OTValidateCluster::ClusterMEs::deltaX_S_primary, Phase2OTValidateCluster::ClusterMEs::deltaY_P, Phase2OTValidateCluster::ClusterMEs::deltaY_P_primary, Phase2OTValidateCluster::ClusterMEs::deltaY_S, Phase2OTValidateCluster::ClusterMEs::deltaY_S_primary, PVValHelper::dx, PVValHelper::dy, vertexPlots::e4, dqm::impl::MonitorElement::Fill(), TrackerGeometry::getDetectorType(), phase2tkutil::getOTHistoId(), getSimTrackId(), mps_fire::i, TrackerGeometry::idToDetUnit(), iEvent, phase2tkutil::isPrimary(), dqmiolumiharvest::j, layerMEs_, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, TrackerGeometry::Ph2PSP, TrackerGeometry::Ph2PSS, TrackerGeometry::Ph2SS, Phase2TrackerDigi::pixelToChannel(), FastTrackerRecHitCombiner_cfi::simHits, simOTLinksToken_, TrackCandidateProducer_cfi::simTracks, jetUpdater_cfi::sort, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, tkGeom_, tTopo_, PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by analyze().

◆ getSimTrackId()

std::vector< unsigned int > Phase2OTValidateCluster::getSimTrackId ( const edm::Handle< edm::DetSetVector< PixelDigiSimLink >> &  pixelSimLinks,
const DetId detId,
unsigned int  channel 
)
private

Definition at line 335 of file Phase2OTValidateCluster.cc.

336  {
337  std::vector<unsigned int> retvec;
338  edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter(pixelSimLinks->find(detId));
339  if (DSViter == pixelSimLinks->end())
340  return retvec;
341  for (edm::DetSet<PixelDigiSimLink>::const_iterator it = DSViter->data.begin(); it != DSViter->data.end(); ++it) {
342  if (channel == it->channel()) {
343  retvec.push_back(it->SimTrackId());
344  }
345  }
346  return retvec;
347 }

Referenced by fillOTHistos().

Member Data Documentation

◆ clustersToken_

edm::EDGetTokenT<Phase2TrackerCluster1DCollectionNew> Phase2OTValidateCluster::clustersToken_
private

Definition at line 90 of file Phase2OTValidateCluster.cc.

Referenced by fillOTHistos().

◆ config_

edm::ParameterSet Phase2OTValidateCluster::config_
private

Definition at line 84 of file Phase2OTValidateCluster.cc.

Referenced by bookHistograms(), and bookLayerHistos().

◆ geomToken_

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

Definition at line 92 of file Phase2OTValidateCluster.cc.

Referenced by dqmBeginRun().

◆ layerMEs_

std::map<std::string, ClusterMEs> Phase2OTValidateCluster::layerMEs_
private

Definition at line 82 of file Phase2OTValidateCluster.cc.

Referenced by bookLayerHistos(), and fillOTHistos().

◆ pSimHitSrc_

std::vector<edm::InputTag> Phase2OTValidateCluster::pSimHitSrc_
private

Definition at line 91 of file Phase2OTValidateCluster.cc.

Referenced by Phase2OTValidateCluster().

◆ simHitTokens_

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

Definition at line 86 of file Phase2OTValidateCluster.cc.

Referenced by analyze(), and Phase2OTValidateCluster().

◆ simITLinksToken_

edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > Phase2OTValidateCluster::simITLinksToken_
private

Definition at line 88 of file Phase2OTValidateCluster.cc.

◆ simOTLinksToken_

edm::EDGetTokenT<edm::DetSetVector<PixelDigiSimLink> > Phase2OTValidateCluster::simOTLinksToken_
private

Definition at line 87 of file Phase2OTValidateCluster.cc.

Referenced by fillOTHistos().

◆ simtrackminpt_

double Phase2OTValidateCluster::simtrackminpt_
private

Definition at line 85 of file Phase2OTValidateCluster.cc.

Referenced by analyze().

◆ simTracksToken_

edm::EDGetTokenT<edm::SimTrackContainer> Phase2OTValidateCluster::simTracksToken_
private

Definition at line 89 of file Phase2OTValidateCluster.cc.

Referenced by analyze().

◆ tkGeom_

const TrackerGeometry* Phase2OTValidateCluster::tkGeom_ = nullptr
private

◆ topoToken_

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

Definition at line 93 of file Phase2OTValidateCluster.cc.

Referenced by dqmBeginRun().

◆ tTopo_

const TrackerTopology* Phase2OTValidateCluster::tTopo_ = nullptr
private

Definition at line 95 of file Phase2OTValidateCluster.cc.

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

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::DetSetVector
Definition: DetSetVector.h:61
Point2DBase
Definition: Point2DBase.h:9
phase2tkutil::book1DFromPSet
MonitorElement * book1DFromPSet(const edm::ParameterSet &hpars, DQMStore::IBooker &ibooker)
Definition: TrackerPhase2DQMUtil.cc:50
mps_fire.i
i
Definition: mps_fire.py:428
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
GeomDet
Definition: GeomDet.h:27
edm::ESWatcher< TrackerDigiGeometryRecord >
Phase2OTValidateCluster::simTracksToken_
edm::EDGetTokenT< edm::SimTrackContainer > simTracksToken_
Definition: Phase2OTValidateCluster.cc:89
TrackerGeometry::ModuleType::Ph2SS
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
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
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
TrackerGeometry::getDetectorType
ModuleType getDetectorType(DetId) const
Definition: TrackerGeometry.cc:247
edm::Handle< edm::PSimHitContainer >
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
Phase2TrackerDigi::pixelToChannel
static PackedDigiType pixelToChannel(unsigned int row, unsigned int col)
Definition: Phase2TrackerDigi.h:43
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
Phase2OTValidateCluster::pSimHitSrc_
std::vector< edm::InputTag > pSimHitSrc_
Definition: Phase2OTValidateCluster.cc:91
Phase2OTValidateCluster::SimTracksMap
std::map< unsigned int, SimTrack > SimTracksMap
Definition: Phase2OTValidateCluster.cc:53
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
Phase2OTValidateCluster::tkGeom_
const TrackerGeometry * tkGeom_
Definition: Phase2OTValidateCluster.cc:94
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
TrackerGeometry::ModuleType
ModuleType
Definition: TrackerGeometry.h:29
edm::ESHandle< TrackerGeometry >
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
Phase2OTValidateCluster::fillOTHistos
void fillOTHistos(const edm::Event &iEvent, const std::vector< edm::Handle< edm::PSimHitContainer >> &simHits, const std::map< unsigned int, SimTrack > &simTracks)
Definition: Phase2OTValidateCluster.cc:160
Phase2OTValidateCluster::config_
edm::ParameterSet config_
Definition: Phase2OTValidateCluster.cc:84
Point3DBase< float, LocalTag >
Phase2OTValidateCluster::simOTLinksToken_
edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > simOTLinksToken_
Definition: Phase2OTValidateCluster.cc:87
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
Phase2OTValidateCluster::topoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Definition: Phase2OTValidateCluster.cc:93
edm::ParameterSet
Definition: ParameterSet.h:47
Phase2OTValidateCluster::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: Phase2OTValidateCluster.cc:92
Phase2OTValidateCluster::tTopo_
const TrackerTopology * tTopo_
Definition: Phase2OTValidateCluster.cc:95
phase2tkutil::isPrimary
bool isPrimary(const SimTrack &simTrk, const PSimHit *simHit)
Definition: TrackerPhase2ValidationUtil.cc:2
PVValHelper::add
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
Definition: PVValidationHelpers.cc:12
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
Phase2OTValidateCluster::bookLayerHistos
void bookLayerHistos(DQMStore::IBooker &ibooker, uint32_t det_it, const std::string &subdir)
Definition: Phase2OTValidateCluster.cc:285
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:155
PVValHelper::dy
Definition: PVValidationHelpers.h:50
phase2tkutil::cmtomicron
static constexpr float cmtomicron
Definition: TrackerPhase2ValidationUtil.h:9
TrackerGeometry::ModuleType::Ph2PSS
Phase2OTValidateCluster::simtrackminpt_
double simtrackminpt_
Definition: Phase2OTValidateCluster.cc:85
ALCARECODTCalibSynchCosmicsDQM_cff.folderName
folderName
Definition: ALCARECODTCalibSynchCosmicsDQM_cff.py:9
Phase2OTValidateCluster::clustersToken_
edm::EDGetTokenT< Phase2TrackerCluster1DCollectionNew > clustersToken_
Definition: Phase2OTValidateCluster.cc:90
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
Phase2OTValidateCluster::simHitTokens_
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
Definition: Phase2OTValidateCluster.cc:86
Phase2OTValidateCluster::layerMEs_
std::map< std::string, ClusterMEs > layerMEs_
Definition: Phase2OTValidateCluster.cc:82
Phase2OTValidateCluster::getSimTrackId
std::vector< unsigned int > getSimTrackId(const edm::Handle< edm::DetSetVector< PixelDigiSimLink >> &pixelSimLinks, const DetId &detId, unsigned int channel)
Definition: Phase2OTValidateCluster.cc:335
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GeomDetEnumerators::P2PXB
Definition: GeomDetEnumerators.h:27
PSimHit
Definition: PSimHit.h:15
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
PVValHelper::dx
Definition: PVValidationHelpers.h:49
vertexPlots.e4
e4
Definition: vertexPlots.py:64
phase2tkutil::getOTHistoId
std::string getOTHistoId(uint32_t det_id, const TrackerTopology *tTopo)
Definition: TrackerPhase2DQMUtil.cc:25
TrackerGeometry::ModuleType::Ph2PSP
GeomDetEnumerators::P2PXEC
Definition: GeomDetEnumerators.h:28
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31