CMS 3D CMS Logo

Phase2TrackerValidateDigi.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Phase2TrackerValidateDigi
4 // Class: Phase2TrackerValidateDigi
5 //
11 //
12 // Author: Suchandra Dutta, Gourab Saha, Suvankar Roy Chowdhury, Subir Sarkar
13 // Date: January 29, 2016
14 //
15 // system include files
16 #include <memory>
18 
21 
24 
31 
38 
42 
43 // DQM Histograming
46 
47 //
48 // constructors
49 //
51  : config_(iConfig),
52  pixelFlag_(config_.getParameter<bool>("PixelPlotFillingFlag")),
53  geomType_(config_.getParameter<std::string>("GeometryType")),
54  otDigiSrc_(config_.getParameter<edm::InputTag>("OuterTrackerDigiSource")),
55  otDigiSimLinkSrc_(config_.getParameter<edm::InputTag>("OuterTrackerDigiSimLinkSource")),
56  itPixelDigiSrc_(config_.getParameter<edm::InputTag>("InnerPixelDigiSource")),
57  itPixelDigiSimLinkSrc_(config_.getParameter<edm::InputTag>("InnerPixelDigiSimLinkSource")),
58  pSimHitSrc_(config_.getParameter<std::vector<edm::InputTag> >("PSimHitSource")),
59  simTrackSrc_(config_.getParameter<edm::InputTag>("SimTrackSource")),
60  simVertexSrc_(config_.getParameter<edm::InputTag>("SimVertexSource")),
61  otDigiToken_(consumes<edm::DetSetVector<Phase2TrackerDigi> >(otDigiSrc_)),
62  otDigiSimLinkToken_(consumes<edm::DetSetVector<PixelDigiSimLink> >(otDigiSimLinkSrc_)),
63  itPixelDigiToken_(consumes<edm::DetSetVector<PixelDigi> >(itPixelDigiSrc_)),
64  itPixelDigiSimLinkToken_(consumes<edm::DetSetVector<PixelDigiSimLink> >(itPixelDigiSimLinkSrc_)),
65  simTrackToken_(consumes<edm::SimTrackContainer>(simTrackSrc_)),
66  simVertexToken_(consumes<edm::SimVertexContainer>(simVertexSrc_)),
67  geomToken_(esConsumes<TrackerGeometry, TrackerDigiGeometryRecord, edm::Transition::BeginRun>()),
68  topoToken_(esConsumes<TrackerTopology, TrackerTopologyRcd, edm::Transition::BeginRun>()),
69  GeVperElectron(3.61E-09), // 1 electron(3.61eV, 1keV(277e, mod 9/06 d.k.
70  cval(30.) {
71  for (const auto& itag : pSimHitSrc_)
72  simHitTokens_.push_back(consumes<edm::PSimHitContainer>(itag));
73 
74  etaCut_ = config_.getParameter<double>("EtaCutOff");
75  ptCut_ = config_.getParameter<double>("PtCutOff");
76  tofUpperCut_ = config_.getParameter<double>("TOFUpperCutOff");
77  tofLowerCut_ = config_.getParameter<double>("TOFLowerCutOff");
78 
79  edm::LogInfo("Phase2TrackerValidateDigi") << ">>> Construct Phase2TrackerValidateDigi ";
80 }
81 
82 //
83 // destructor
84 //
86  // do anything here that needs to be done at desctruction time
87  // (e.g. close files, deallocate resources etc.)
88  edm::LogInfo("Phase2TrackerValidateDigi") << ">>> Destroy Phase2TrackerValidateDigi ";
89 }
90 //
91 // -- DQM Begin Run
93  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
95  if (theTkDigiGeomWatcher.check(iSetup)) {
96  geomHandle = iSetup.getHandle(geomToken_);
97  }
98  if (!geomHandle.isValid())
99  return;
100  tkGeom_ = &(*geomHandle);
101 
103  tTopo_ = tTopoHandle.product();
104 }
105 //
106 // -- Analyze
107 //
109  // Get digis
111  iEvent.getByToken(otDigiToken_, otDigiHandle_);
112 
113  // DigiSimLink
116 
117  // SimTrack
118  iEvent.getByToken(simTrackToken_, simTracks);
119 
120  // SimVertex
121  iEvent.getByToken(simVertexToken_, simVertices);
122 
123  // Fil # of SIM Vertices@
124  nSimVertices->Fill((*simVertices).size());
125  // Loop over Sim Tracks and Fill relevant histograms
126  int nTracks = 0;
127  int nTracksP = 0;
128  int nTracksS = 0;
129  for (edm::SimTrackContainer::const_iterator simTrkItr = simTracks->begin(); simTrkItr != simTracks->end();
130  ++simTrkItr) {
131  if (simTrkItr->charge() == 0)
132  continue;
133  int vtxIndex = simTrkItr->vertIndex();
134  int vtxParent = -1;
135  if (vtxIndex > 0) {
136  SimVertex vtx = (*simVertices)[vtxIndex];
137  if (!vtx.noParent()) {
138  int trkId = vtx.parentIndex();
139  vtxParent = (*simTracks)[matchedSimTrack(simTracks, trkId)].vertIndex();
140  }
141  }
142  int simTk_type = -1;
143  if (vtxIndex == 0 || vtxParent == 0)
144  simTk_type = 1;
145  else
146  simTk_type = 0;
147  nTracks++;
148  if (simTk_type == 1)
149  nTracksP++;
150  else
151  nTracksS++;
152 
153  float simTk_pt = simTrkItr->momentum().pt();
154  float simTk_eta = simTrkItr->momentum().eta();
155  float simTk_phi = simTrkItr->momentum().phi();
156 
157  if (fabs(simTk_eta) < etaCut_)
159  if (simTk_pt > ptCut_)
161  if (fabs(simTk_eta) < etaCut_ && simTk_pt > ptCut_)
163 
164  // initialize
165  for (auto& it : layerMEs) {
166  it.second.nDigis = 0;
167  it.second.nHits = 0;
168  }
169  fillSimHitInfo(iEvent, (*simTrkItr));
170 
171  int nHitCutoff = 2;
172  if (pixelFlag_)
173  nHitCutoff = 1;
174  for (auto& it : layerMEs) {
175  DigiMEs& local_mes = it.second;
176  if (it.second.nHits < nHitCutoff) {
177  if (std::fabs(simTk_eta) < 1.0)
178  local_mes.MissedHitTrackPt->Fill(simTk_pt);
179  if (simTk_pt > ptCut_ && std::fabs(simTk_eta) < 1.0)
180  local_mes.MissedHitTrackEta->Fill(simTk_eta);
181  if (std::fabs(simTk_eta) < 1.0 && simTk_pt > ptCut_)
182  local_mes.MissedHitTrackPhi->Fill(simTk_phi);
183  }
184  }
185  }
187  nSimulatedTracksP->Fill(nTracksP);
188  nSimulatedTracksS->Fill(nTracksS);
189  if (pixelFlag_)
191  else
192  fillOTBXInfo();
193 }
194 
196  int totalHits = 0;
197 
198  unsigned int id = simTrk.trackId();
199  for (const auto& itoken : simHitTokens_) {
201  iEvent.getByToken(itoken, simHitHandle);
202  if (!simHitHandle.isValid())
203  continue;
204  const edm::PSimHitContainer& simHits = (*simHitHandle.product());
205  for (edm::PSimHitContainer::const_iterator isim = simHits.begin(); isim != simHits.end(); ++isim) {
206  if ((*isim).trackId() != id)
207  continue;
208  const PSimHit& simHit = (*isim);
209 
210  if (!isPrimary(simTrk, simHit))
211  continue;
212 
213  unsigned int rawid = (*isim).detUnitId();
214  int layer;
215  if (pixelFlag_)
216  layer = tTopo_->getITPixelLayerNumber(rawid);
217  else
218  layer = tTopo_->getOTLayerNumber(rawid);
219  if (layer < 0)
220  continue;
222  auto pos = layerMEs.find(key);
223  if (pos == layerMEs.end())
224  continue;
225  DigiMEs& local_mes = pos->second;
226 
227  const DetId detId(rawid);
228  float dZ = (*isim).entryPoint().z() - (*isim).exitPoint().z();
229  if (fabs(dZ) <= 0.01)
230  continue;
231 
232  if (DetId(detId).det() != DetId::Detector::Tracker)
233  continue;
234 
235  const GeomDet* geomDet = tkGeom_->idToDet(detId);
236  if (!geomDet)
237  continue;
238  Global3DPoint pdPos = geomDet->surface().toGlobal(isim->localPosition());
239 
240  if (((*isim).tof() - pdPos.mag() / cval) < tofLowerCut_ || ((*isim).tof() - pdPos.mag() / cval) > tofUpperCut_)
241  continue;
242 
244  SimulatedXYPositionMap->Fill(pdPos.x() * 10., pdPos.y() * 10.);
246  SimulatedRZPositionMap->Fill(pdPos.z() * 10., std::hypot(pdPos.x(), pdPos.y()) * 10.);
247 
248  const TrackerGeomDet* geomDetUnit(tkGeom_->idToDetUnit(detId));
249  const Phase2TrackerGeomDetUnit* tkDetUnit = dynamic_cast<const Phase2TrackerGeomDetUnit*>(geomDetUnit);
250  int nColumns = tkDetUnit->specificTopology().ncolumns();
251 
252  float pt = simTrk.momentum().pt();
253  float eta = simTrk.momentum().eta();
254  float phi = simTrk.momentum().phi();
255  totalHits++;
256  pos->second.nHits++;
257 
258  if (local_mes.SimHitDx)
259  local_mes.SimHitDx->Fill(std::fabs((*isim).entryPoint().x() - (*isim).exitPoint().x()));
260  if (local_mes.SimHitDy)
261  local_mes.SimHitDy->Fill(std::fabs((*isim).entryPoint().y() - (*isim).exitPoint().y()));
262  if (local_mes.SimHitDz)
263  local_mes.SimHitDz->Fill(std::fabs((*isim).entryPoint().z() - (*isim).exitPoint().z()));
264 
265  if (SimulatedTOFEtaMap)
266  SimulatedTOFEtaMap->Fill(pdPos.eta(), (*isim).timeOfFlight());
267  if (SimulatedTOFPhiMap)
268  SimulatedTOFPhiMap->Fill(pdPos.phi(), (*isim).timeOfFlight());
269  if (SimulatedTOFRMap)
270  SimulatedTOFRMap->Fill(std::hypot(pdPos.x(), pdPos.y()), (*isim).timeOfFlight());
271  if (SimulatedTOFZMap)
272  SimulatedTOFZMap->Fill(pdPos.z(), (*isim).timeOfFlight());
273 
274  bool digiFlag;
275 
276  if (pixelFlag_)
277  digiFlag = findITPixelDigi(rawid, id);
278  else
279  digiFlag = findOTDigi(rawid, id);
280 
281  if (fabs(eta) < etaCut_) {
282  if (local_mes.SimTrackPt)
283  local_mes.SimTrackPt->Fill(pt);
284  if (digiFlag && local_mes.MatchedTrackPt)
285  local_mes.MatchedTrackPt->Fill(pt);
286  else if (local_mes.MissedDigiTrackPt)
287  local_mes.MissedDigiTrackPt->Fill(pt);
288  }
289  if (pt > ptCut_) {
290  if (local_mes.SimTrackEta)
291  local_mes.SimTrackEta->Fill(eta);
292  if (digiFlag && local_mes.MatchedTrackEta)
293  local_mes.MatchedTrackEta->Fill(eta);
294  else if (local_mes.MissedDigiTrackEta)
295  local_mes.MissedDigiTrackEta->Fill(eta);
296  }
297  if (fabs(eta) < etaCut_ && pt > ptCut_) {
298  if (local_mes.SimTrackPhi)
299  local_mes.SimTrackPhi->Fill(phi);
300  if (digiFlag && local_mes.MatchedTrackPhi)
301  local_mes.MatchedTrackPhi->Fill(phi);
302  else if (local_mes.MissedDigiTrackPhi)
303  local_mes.MissedDigiTrackPhi->Fill(phi);
304  }
305  if (digiFlag) {
306  pos->second.nDigis++;
308  MatchedRZPositionMap->Fill(pdPos.z() * 10., std::hypot(pdPos.x(), pdPos.y()) * 10.);
310  MatchedXYPositionMap->Fill(pdPos.x() * 10., pdPos.y() * 10.);
311  if (nColumns <= 2 && local_mes.MatchedSimHitElossS)
312  local_mes.MatchedSimHitElossS->Fill((*isim).energyLoss() / GeVperElectron);
313  else if (local_mes.MatchedSimHitElossP)
314  local_mes.MatchedSimHitElossP->Fill((*isim).energyLoss() / GeVperElectron);
315  } else {
316  if (local_mes.MissedDigiLocalXposVsYPos)
317  local_mes.MissedDigiLocalXposVsYPos->Fill((*isim).localPosition().x(), (*isim).localPosition().y());
318  if (local_mes.MissedDigiTimeWindow)
319  local_mes.MissedDigiTimeWindow->Fill(std::fabs((*isim).timeOfFlight() - pdPos.mag() / cval));
320  if (nColumns <= 2 && local_mes.MissedDigiSimHitElossS)
321  local_mes.MissedDigiSimHitElossS->Fill((*isim).energyLoss() / GeVperElectron);
322  else if (local_mes.MissedDigiSimHitElossP)
323  local_mes.MissedDigiSimHitElossP->Fill((*isim).energyLoss() / GeVperElectron);
324  }
325  }
326  }
327  return totalHits;
328 }
329 bool Phase2TrackerValidateDigi::findOTDigi(unsigned int detid, unsigned int id) {
330  bool matched = false;
334  if (DSVIter != digis->end()) {
335  for (edm::DetSet<Phase2TrackerDigi>::const_iterator di = DSVIter->begin(); di != DSVIter->end(); di++) {
336  int col = di->column(); // column
337  int row = di->row(); // row
338  unsigned int channel = Phase2TrackerDigi::pixelToChannel(row, col);
339  unsigned int simTkId = getSimTrackId(links, detid, channel);
340  if (simTkId == id) {
341  matched = true;
342  break;
343  }
344  }
345  }
346  return matched;
347 }
348 bool Phase2TrackerValidateDigi::findITPixelDigi(unsigned int detid, unsigned int id) {
349  bool matched = false;
352 
353  edm::DetSetVector<PixelDigi>::const_iterator DSVIter = digis->find(detid);
354  if (DSVIter != digis->end()) {
355  for (edm::DetSet<PixelDigi>::const_iterator di = DSVIter->begin(); di != DSVIter->end(); di++) {
356  int col = di->column(); // column
357  int row = di->row(); // row
358  unsigned int channel = PixelDigi::pixelToChannel(row, col);
359  unsigned int simTkId = getSimTrackId(links, detid, channel);
360  if (simTkId == id) {
361  matched = true;
362  break;
363  }
364  }
365  }
366  return matched;
367 }
368 //
369 // -- Book Histograms
370 //
372  edm::Run const& iRun,
373  edm::EventSetup const& iSetup) {
374  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
375  std::stringstream folder_name;
376 
377  ibooker.cd();
378  folder_name << top_folder << "/"
379  << "SimTrackInfo";
380  ibooker.setCurrentFolder(folder_name.str());
381 
382  edm::LogInfo("Phase2TrackerValidateDigi") << " Booking Histograms in : " << folder_name.str();
383  std::stringstream HistoName;
384 
385  HistoName.str("");
386  HistoName << "NumberOfSimulatedTracks";
387  nSimulatedTracks = ibooker.book1D(HistoName.str(), HistoName.str(), 501, -0.5, 500.5);
388 
389  HistoName.str("");
390  HistoName << "NumberOfSimulatedTracksP";
391  nSimulatedTracksP = ibooker.book1D(HistoName.str(), HistoName.str(), 501, -0.5, 500.5);
392 
393  HistoName.str("");
394  HistoName << "NumberOfSimulatedTracksS";
395  nSimulatedTracksS = ibooker.book1D(HistoName.str(), HistoName.str(), 501, -0.5, 500.5);
396 
397  HistoName.str("");
398  HistoName << "NumberOfSimulatedVertices";
399  nSimVertices = ibooker.book1D(HistoName.str(), HistoName.str(), 101, -0.5, 100.5);
400 
402  HistoName.str("");
403  HistoName << "SimulatedTrackPt";
404  if (Parameters.getParameter<bool>("switch"))
405  SimulatedTrackPt = ibooker.book1D(HistoName.str(),
406  HistoName.str(),
407  Parameters.getParameter<int32_t>("Nbins"),
408  Parameters.getParameter<double>("xmin"),
409  Parameters.getParameter<double>("xmax"));
410  else
411  SimulatedTrackPt = nullptr;
412  /*
413  HistoName.str("");
414  HistoName << "SimulatedTrackPt";
415  SimulatedTrackPt = ibooker.book1D(HistoName.str(),HistoName.str(),
416  Parameters.getParameter<int32_t>("Nbins"),
417  Parameters.getParameter<double>("xmin"),
418  Parameters.getParameter<double>("xmax");*/
419  HistoName.str("");
420  HistoName << "SimulatedTrackPtP";
421  if (Parameters.getParameter<bool>("switch"))
422  SimulatedTrackPtP = ibooker.book1D(HistoName.str(),
423  HistoName.str(),
424  Parameters.getParameter<int32_t>("Nbins"),
425  Parameters.getParameter<double>("xmin"),
426  Parameters.getParameter<double>("xmax"));
427  else
428  SimulatedTrackPtP = nullptr;
429  HistoName.str("");
430  HistoName << "SimulatedTrackPtS";
431  if (Parameters.getParameter<bool>("switch"))
432  SimulatedTrackPtS = ibooker.book1D(HistoName.str(),
433  HistoName.str(),
434  Parameters.getParameter<int32_t>("Nbins"),
435  Parameters.getParameter<double>("xmin"),
436  Parameters.getParameter<double>("xmax"));
437  else
438  SimulatedTrackPtS = nullptr;
439 
441  HistoName.str("");
442  HistoName << "SimulatedTrackEta";
443  if (Parameters.getParameter<bool>("switch"))
444  SimulatedTrackEta = ibooker.book1D(HistoName.str(),
445  HistoName.str(),
446  Parameters.getParameter<int32_t>("Nbins"),
447  Parameters.getParameter<double>("xmin"),
448  Parameters.getParameter<double>("xmax"));
449  else
450  SimulatedTrackEta = nullptr;
451  HistoName.str("");
452  HistoName << "SimulatedTrackEtaP";
453  if (Parameters.getParameter<bool>("switch"))
454  SimulatedTrackEtaP = ibooker.book1D(HistoName.str(),
455  HistoName.str(),
456  Parameters.getParameter<int32_t>("Nbins"),
457  Parameters.getParameter<double>("xmin"),
458  Parameters.getParameter<double>("xmax"));
459  else
460  SimulatedTrackEtaP = nullptr;
461  HistoName.str("");
462  HistoName << "SimulatedTrackEtaS";
463  if (Parameters.getParameter<bool>("switch"))
464  SimulatedTrackEtaS = ibooker.book1D(HistoName.str(),
465  HistoName.str(),
466  Parameters.getParameter<int32_t>("Nbins"),
467  Parameters.getParameter<double>("xmin"),
468  Parameters.getParameter<double>("xmax"));
469  else
470  SimulatedTrackEtaS = nullptr;
471 
473  HistoName.str("");
474  HistoName << "SimulatedTrackPhi";
475  if (Parameters.getParameter<bool>("switch"))
476  SimulatedTrackPhi = ibooker.book1D(HistoName.str(),
477  HistoName.str(),
478  Parameters.getParameter<int32_t>("Nbins"),
479  Parameters.getParameter<double>("xmin"),
480  Parameters.getParameter<double>("xmax"));
481  else
482  SimulatedTrackPhi = nullptr;
483 
484  HistoName.str("");
485  HistoName << "SimulatedTrackPhiP";
486  if (Parameters.getParameter<bool>("switch"))
487  SimulatedTrackPhiP = ibooker.book1D(HistoName.str(),
488  HistoName.str(),
489  Parameters.getParameter<int32_t>("Nbins"),
490  Parameters.getParameter<double>("xmin"),
491  Parameters.getParameter<double>("xmax"));
492  else
493  SimulatedTrackPhiP = nullptr;
494 
495  HistoName.str("");
496  HistoName << "SimulatedTrackPhiS";
497  if (Parameters.getParameter<bool>("switch"))
498  SimulatedTrackPhiS = ibooker.book1D(HistoName.str(),
499  HistoName.str(),
500  Parameters.getParameter<int32_t>("Nbins"),
501  Parameters.getParameter<double>("xmin"),
502  Parameters.getParameter<double>("xmax"));
503  else
504  SimulatedTrackPhiS = nullptr;
505 
506  Parameters = config_.getParameter<edm::ParameterSet>("XYPositionMapH");
507  HistoName.str("");
508  HistoName << "SimulatedXPosVsYPos";
509  if (Parameters.getParameter<bool>("switch"))
510  SimulatedXYPositionMap = ibooker.book2D(HistoName.str(),
511  HistoName.str(),
512  Parameters.getParameter<int32_t>("Nxbins"),
513  Parameters.getParameter<double>("xmin"),
514  Parameters.getParameter<double>("xmax"),
515  Parameters.getParameter<int32_t>("Nybins"),
516  Parameters.getParameter<double>("ymin"),
517  Parameters.getParameter<double>("ymax"));
518  else
519  SimulatedXYPositionMap = nullptr;
520 
521  Parameters = config_.getParameter<edm::ParameterSet>("RZPositionMapH");
522  HistoName.str("");
523  HistoName << "SimulatedRPosVsZPos";
524  if (Parameters.getParameter<bool>("switch"))
525  SimulatedRZPositionMap = ibooker.book2D(HistoName.str(),
526  HistoName.str(),
527  Parameters.getParameter<int32_t>("Nxbins"),
528  Parameters.getParameter<double>("xmin"),
529  Parameters.getParameter<double>("xmax"),
530  Parameters.getParameter<int32_t>("Nybins"),
531  Parameters.getParameter<double>("ymin"),
532  Parameters.getParameter<double>("ymax"));
533  else
534  SimulatedRZPositionMap = nullptr;
535 
536  //add TOF maps
538  HistoName.str("");
539  HistoName << "SimulatedTOFVsEta";
540  if (Parameters.getParameter<bool>("switch"))
541  SimulatedTOFEtaMap = ibooker.book2D(HistoName.str(),
542  HistoName.str(),
543  Parameters.getParameter<int32_t>("Nxbins"),
544  Parameters.getParameter<double>("xmin"),
545  Parameters.getParameter<double>("xmax"),
546  Parameters.getParameter<int32_t>("Nybins"),
547  Parameters.getParameter<double>("ymin"),
548  Parameters.getParameter<double>("ymax"));
549  else
550  SimulatedTOFEtaMap = nullptr;
552  HistoName.str("");
553  HistoName << "SimulatedTOFVsPhi";
554  if (Parameters.getParameter<bool>("switch"))
555  SimulatedTOFPhiMap = ibooker.book2D(HistoName.str(),
556  HistoName.str(),
557  Parameters.getParameter<int32_t>("Nxbins"),
558  Parameters.getParameter<double>("xmin"),
559  Parameters.getParameter<double>("xmax"),
560  Parameters.getParameter<int32_t>("Nybins"),
561  Parameters.getParameter<double>("ymin"),
562  Parameters.getParameter<double>("ymax"));
563  else
564  SimulatedTOFPhiMap = nullptr;
566  HistoName.str("");
567  HistoName << "SimulatedTOFVsR";
568  if (Parameters.getParameter<bool>("switch"))
569  SimulatedTOFRMap = ibooker.book2D(HistoName.str(),
570  HistoName.str(),
571  Parameters.getParameter<int32_t>("Nxbins"),
572  Parameters.getParameter<double>("xmin"),
573  Parameters.getParameter<double>("xmax"),
574  Parameters.getParameter<int32_t>("Nybins"),
575  Parameters.getParameter<double>("ymin"),
576  Parameters.getParameter<double>("ymax"));
577  else
578  SimulatedTOFRMap = nullptr;
580  HistoName.str("");
581  HistoName << "SimulatedTOFVsZ";
582  if (Parameters.getParameter<bool>("switch"))
583  SimulatedTOFZMap = ibooker.book2D(HistoName.str(),
584  HistoName.str(),
585  Parameters.getParameter<int32_t>("Nxbins"),
586  Parameters.getParameter<double>("xmin"),
587  Parameters.getParameter<double>("xmax"),
588  Parameters.getParameter<int32_t>("Nybins"),
589  Parameters.getParameter<double>("ymin"),
590  Parameters.getParameter<double>("ymax"));
591  else
592  SimulatedTOFZMap = nullptr;
593 
594  edm::ESWatcher<TrackerDigiGeometryRecord> theTkDigiGeomWatcher;
595  if (theTkDigiGeomWatcher.check(iSetup)) {
596  for (auto const& det_u : tkGeom_->detUnits()) {
597  unsigned int detId_raw = det_u->geographicalId().rawId();
598  bookLayerHistos(ibooker, detId_raw, pixelFlag_);
599  }
600  }
601  ibooker.cd();
602  folder_name.str("");
603  folder_name << top_folder << "/"
604  << "DigiMonitor";
605  ibooker.setCurrentFolder(folder_name.str());
606 
607  Parameters = config_.getParameter<edm::ParameterSet>("XYPositionMapH");
608  HistoName.str("");
609  HistoName << "MatchedSimXPosVsYPos";
610  if (Parameters.getParameter<bool>("switch"))
611  MatchedXYPositionMap = ibooker.book2D(HistoName.str(),
612  HistoName.str(),
613  Parameters.getParameter<int32_t>("Nxbins"),
614  Parameters.getParameter<double>("xmin"),
615  Parameters.getParameter<double>("xmax"),
616  Parameters.getParameter<int32_t>("Nybins"),
617  Parameters.getParameter<double>("ymin"),
618  Parameters.getParameter<double>("ymax"));
619  else
620  MatchedXYPositionMap = nullptr;
621 
622  Parameters = config_.getParameter<edm::ParameterSet>("RZPositionMapH");
623  HistoName.str("");
624  HistoName << "MatchedSimRPosVsZPos";
625  if (Parameters.getParameter<bool>("switch"))
626  MatchedRZPositionMap = ibooker.book2D(HistoName.str(),
627  HistoName.str(),
628  Parameters.getParameter<int32_t>("Nxbins"),
629  Parameters.getParameter<double>("xmin"),
630  Parameters.getParameter<double>("xmax"),
631  Parameters.getParameter<int32_t>("Nybins"),
632  Parameters.getParameter<double>("ymin"),
633  Parameters.getParameter<double>("ymax"));
634  else
635  MatchedRZPositionMap = nullptr;
636 }
637 //
638 // -- Book Layer Histograms
639 //
640 void Phase2TrackerValidateDigi::bookLayerHistos(DQMStore::IBooker& ibooker, unsigned int det_id, bool flag) {
641  int layer;
642  if (flag)
643  layer = tTopo_->getITPixelLayerNumber(det_id);
644  else
645  layer = tTopo_->getOTLayerNumber(det_id);
646 
647  if (layer < 0)
648  return;
649 
650  std::string key = getHistoId(det_id, flag);
651  std::map<std::string, DigiMEs>::iterator pos = layerMEs.find(key);
652  if (pos == layerMEs.end()) {
653  std::string top_folder = config_.getParameter<std::string>("TopFolderName");
654  std::stringstream folder_name;
655 
656  //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)
657  bool isPStypeModForTEDD_1 =
658  (!pixelFlag_ && layer > 100 && tTopo_->tidWheel(det_id) < 3 && tTopo_->tidRing(det_id) <= 10) ? true : false;
659  bool isPStypeModForTEDD_2 =
660  (!pixelFlag_ && layer > 100 && tTopo_->tidWheel(det_id) >= 3 && tTopo_->tidRing(det_id) <= 7) ? true : false;
661 
662  bool isPtypeSensor =
663  (flag || (layer < 4 || (layer > 6 && (isPStypeModForTEDD_1 || isPStypeModForTEDD_2)))) ? true : false;
664 
665  ibooker.cd();
666  ibooker.setCurrentFolder(top_folder + "/DigiMonitor/" + key);
667  edm::LogInfo("Phase2TrackerValidateDigi") << " Booking Histograms in : " << key;
668 
669  std::ostringstream HistoName;
670  DigiMEs local_mes;
671 
673  HistoName.str("");
674  HistoName << "SimTrackPt";
675  if (Parameters.getParameter<bool>("switch"))
676  local_mes.SimTrackPt = ibooker.book1D(HistoName.str(),
677  HistoName.str(),
678  Parameters.getParameter<int32_t>("Nbins"),
679  Parameters.getParameter<double>("xmin"),
680  Parameters.getParameter<double>("xmax"));
681  else
682  local_mes.SimTrackPt = nullptr;
683  HistoName.str("");
684  HistoName << "MatchedTrackPt";
685  if (Parameters.getParameter<bool>("switch"))
686  local_mes.MatchedTrackPt = ibooker.book1D(HistoName.str(),
687  HistoName.str(),
688  Parameters.getParameter<int32_t>("Nbins"),
689  Parameters.getParameter<double>("xmin"),
690  Parameters.getParameter<double>("xmax"));
691  else
692  local_mes.MatchedTrackPt = nullptr;
693  HistoName.str("");
694  HistoName << "MissedHitTrackPt";
695  if (Parameters.getParameter<bool>("switch"))
696  local_mes.MissedHitTrackPt = ibooker.book1D(HistoName.str(),
697  HistoName.str(),
698  Parameters.getParameter<int32_t>("Nbins"),
699  Parameters.getParameter<double>("xmin"),
700  Parameters.getParameter<double>("xmax"));
701  else
702  local_mes.MissedHitTrackPt = nullptr;
703  HistoName.str("");
704  HistoName << "MissedDigiTrackPt";
705  if (Parameters.getParameter<bool>("switch"))
706  local_mes.MissedDigiTrackPt = ibooker.book1D(HistoName.str(),
707  HistoName.str(),
708  Parameters.getParameter<int32_t>("Nbins"),
709  Parameters.getParameter<double>("xmin"),
710  Parameters.getParameter<double>("xmax"));
711  else
712  local_mes.MissedDigiTrackPt = nullptr;
713 
715  HistoName.str("");
716  HistoName << "SimTrackEta";
717  if (Parameters.getParameter<bool>("switch"))
718  local_mes.SimTrackEta = ibooker.book1D(HistoName.str(),
719  HistoName.str(),
720  Parameters.getParameter<int32_t>("Nbins"),
721  Parameters.getParameter<double>("xmin"),
722  Parameters.getParameter<double>("xmax"));
723  else
724  local_mes.SimTrackEta = nullptr;
725  HistoName.str("");
726  HistoName << "MatchedTrackEta";
727  if (Parameters.getParameter<bool>("switch"))
728  local_mes.MatchedTrackEta = ibooker.book1D(HistoName.str(),
729  HistoName.str(),
730  Parameters.getParameter<int32_t>("Nbins"),
731  Parameters.getParameter<double>("xmin"),
732  Parameters.getParameter<double>("xmax"));
733  else
734  local_mes.MatchedTrackEta = nullptr;
735  HistoName.str("");
736  HistoName << "MissedHitTrackEta";
737  if (Parameters.getParameter<bool>("switch"))
738  local_mes.MissedHitTrackEta = ibooker.book1D(HistoName.str(),
739  HistoName.str(),
740  Parameters.getParameter<int32_t>("Nbins"),
741  Parameters.getParameter<double>("xmin"),
742  Parameters.getParameter<double>("xmax"));
743  else
744  local_mes.MissedHitTrackEta = nullptr;
745  HistoName.str("");
746  HistoName << "MissedDigiTrackEta";
747  if (Parameters.getParameter<bool>("switch"))
748  local_mes.MissedDigiTrackEta = ibooker.book1D(HistoName.str(),
749  HistoName.str(),
750  Parameters.getParameter<int32_t>("Nbins"),
751  Parameters.getParameter<double>("xmin"),
752  Parameters.getParameter<double>("xmax"));
753  else
754  local_mes.MissedDigiTrackEta = nullptr;
755 
757  HistoName.str("");
758  HistoName << "SimTrackPhi";
759  if (Parameters.getParameter<bool>("switch"))
760  local_mes.SimTrackPhi = ibooker.book1D(HistoName.str(),
761  HistoName.str(),
762  Parameters.getParameter<int32_t>("Nbins"),
763  Parameters.getParameter<double>("xmin"),
764  Parameters.getParameter<double>("xmax"));
765  else
766  local_mes.SimTrackPhi = nullptr;
767  HistoName.str("");
768  HistoName << "MatchedTrackPhi";
769  if (Parameters.getParameter<bool>("switch"))
770  local_mes.MatchedTrackPhi = ibooker.book1D(HistoName.str(),
771  HistoName.str(),
772  Parameters.getParameter<int32_t>("Nbins"),
773  Parameters.getParameter<double>("xmin"),
774  Parameters.getParameter<double>("xmax"));
775  else
776  local_mes.MatchedTrackPhi = nullptr;
777  HistoName.str("");
778  HistoName << "MissedHitTrackPhi";
779  if (Parameters.getParameter<bool>("switch"))
780  local_mes.MissedHitTrackPhi = ibooker.book1D(HistoName.str(),
781  HistoName.str(),
782  Parameters.getParameter<int32_t>("Nbins"),
783  Parameters.getParameter<double>("xmin"),
784  Parameters.getParameter<double>("xmax"));
785  else
786  local_mes.MissedHitTrackPhi = nullptr;
787  HistoName.str("");
788  HistoName << "MissedDigiTrackPhi";
789  if (Parameters.getParameter<bool>("switch"))
790  local_mes.MissedDigiTrackPhi = ibooker.book1D(HistoName.str(),
791  HistoName.str(),
792  Parameters.getParameter<int32_t>("Nbins"),
793  Parameters.getParameter<double>("xmin"),
794  Parameters.getParameter<double>("xmax"));
795  else
796  local_mes.MissedDigiTrackPhi = nullptr;
797 
799  if (!flag) {
800  HistoName.str("");
801  HistoName << "MatchedSimHitElossS";
802  if (Parameters.getParameter<bool>("switch"))
803  local_mes.MatchedSimHitElossS = ibooker.book1D(HistoName.str(),
804  HistoName.str(),
805  Parameters.getParameter<int32_t>("Nbins"),
806  Parameters.getParameter<double>("xmin"),
807  Parameters.getParameter<double>("xmax"));
808  else
809  local_mes.MatchedSimHitElossS = nullptr;
810  HistoName.str("");
811  HistoName << "MissedDigiSimHitElossS";
812  if (Parameters.getParameter<bool>("switch"))
813  local_mes.MissedDigiSimHitElossS = ibooker.book1D(HistoName.str(),
814  HistoName.str(),
815  Parameters.getParameter<int32_t>("Nbins"),
816  Parameters.getParameter<double>("xmin"),
817  Parameters.getParameter<double>("xmax"));
818  else
819  local_mes.MissedDigiSimHitElossS = nullptr;
820  }
821  if (isPtypeSensor) {
822  HistoName.str("");
823  HistoName << "MatchedSimHitElossP";
824  if (Parameters.getParameter<bool>("switch"))
825  local_mes.MatchedSimHitElossP = ibooker.book1D(HistoName.str(),
826  HistoName.str(),
827  Parameters.getParameter<int32_t>("Nbins"),
828  Parameters.getParameter<double>("xmin"),
829  Parameters.getParameter<double>("xmax"));
830  else
831  local_mes.MatchedSimHitElossP = nullptr;
832  HistoName.str("");
833  HistoName << "MissedDigiSimHitElossP";
834  if (Parameters.getParameter<bool>("switch"))
835  local_mes.MissedDigiSimHitElossP = ibooker.book1D(HistoName.str(),
836  HistoName.str(),
837  Parameters.getParameter<int32_t>("Nbins"),
838  Parameters.getParameter<double>("xmin"),
839  Parameters.getParameter<double>("xmax"));
840  else
841  local_mes.MissedDigiSimHitElossP = nullptr;
842  }
844  HistoName.str("");
845  HistoName << "SimHitDx";
846  if (Parameters.getParameter<bool>("switch"))
847  local_mes.SimHitDx = ibooker.book1D(HistoName.str(),
848  HistoName.str(),
849  Parameters.getParameter<int32_t>("Nbins"),
850  Parameters.getParameter<double>("xmin"),
851  Parameters.getParameter<double>("xmax"));
852  else
853  local_mes.SimHitDx = nullptr;
854 
856  HistoName.str("");
857  HistoName << "SimHitDy";
858  if (Parameters.getParameter<bool>("switch"))
859  local_mes.SimHitDy = ibooker.book1D(HistoName.str(),
860  HistoName.str(),
861  Parameters.getParameter<int32_t>("Nbins"),
862  Parameters.getParameter<double>("xmin"),
863  Parameters.getParameter<double>("xmax"));
864  else
865  local_mes.SimHitDy = nullptr;
866 
868  HistoName.str("");
869  HistoName << "SimHitDz";
870  if (Parameters.getParameter<bool>("switch"))
871  local_mes.SimHitDz = ibooker.book1D(HistoName.str(),
872  HistoName.str(),
873  Parameters.getParameter<int32_t>("Nbins"),
874  Parameters.getParameter<double>("xmin"),
875  Parameters.getParameter<double>("xmax"));
876  else
877  local_mes.SimHitDz = nullptr;
878 
879  HistoName.str("");
880  HistoName << "BunchXingWindow";
881  local_mes.BunchXTimeBin = ibooker.book1D(HistoName.str(), HistoName.str(), 8, -5.5, 2.5);
882 
883  HistoName.str("");
884  HistoName << "FractionOfOOTPUDigi";
885  local_mes.FractionOfOOTDigis = ibooker.bookProfile(HistoName.str(), HistoName.str(), 8, -5.5, 2.5, 0., 1.0, "s");
886 
887  HistoName.str("");
888  HistoName << "MissedDigiLocalXPosvsYPos";
889  local_mes.MissedDigiLocalXposVsYPos =
890  ibooker.book2D(HistoName.str(), HistoName.str(), 130, -6.5, 6.5, 130, -6.5, 6.5);
891 
893  HistoName.str("");
894  HistoName << "MissedDigiTimeWindow";
895  if (Parameters.getParameter<bool>("switch"))
896  local_mes.MissedDigiTimeWindow = ibooker.book1D(HistoName.str(), HistoName.str(), 100, -0.5, 49.5);
897  else
898  local_mes.MissedDigiTimeWindow = nullptr;
899  local_mes.nDigis = 0;
900  layerMEs.insert(std::make_pair(key, local_mes));
901  }
902 }
903 //
904 // -- Get SimTrack Id
905 //
907  const DetId& detId,
908  unsigned int& channel) {
910 
911  unsigned int simTrkId(0);
912  if (isearch == simLinks->end())
913  return simTrkId;
914 
915  edm::DetSet<PixelDigiSimLink> link_detset = (*simLinks)[detId];
916  // Loop over DigiSimLink in this det unit
917  int iSimLink = 0;
918  for (edm::DetSet<PixelDigiSimLink>::const_iterator it = link_detset.data.begin(); it != link_detset.data.end();
919  it++, iSimLink++) {
920  if (channel == it->channel()) {
921  simTrkId = it->SimTrackId();
922  break;
923  }
924  }
925  return simTrkId;
926 }
929  for (typename edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter = links->begin(); DSViter != links->end();
930  DSViter++) {
931  unsigned int rawid = DSViter->id;
932  DetId detId(rawid);
933  if (DetId(detId).det() != DetId::Detector::Tracker)
934  continue;
935  int layer = tTopo_->getOTLayerNumber(rawid);
936  if (layer < 0)
937  continue;
938  bool flag_ = false;
939  std::string key = getHistoId(rawid, flag_);
940  std::map<std::string, DigiMEs>::iterator pos = layerMEs.find(key);
941  if (pos == layerMEs.end())
942  continue;
943  DigiMEs& local_mes = pos->second;
944  int tot_digi = 0;
945  std::map<int, float> bxMap;
946  for (typename edm::DetSet<PixelDigiSimLink>::const_iterator di = DSViter->begin(); di != DSViter->end(); di++) {
947  tot_digi++;
948  int bx = di->eventId().bunchCrossing();
949  std::map<int, float>::iterator ic = bxMap.find(bx);
950  if (ic == bxMap.end())
951  bxMap[bx] = 1.0;
952  else
953  bxMap[bx] += 1.0;
954  }
955  for (const auto& v : bxMap) {
956  if (tot_digi) {
957  local_mes.BunchXTimeBin->Fill(v.first, v.second);
958  local_mes.FractionOfOOTDigis->Fill(v.first, v.second / tot_digi);
959  }
960  }
961  }
962 }
965  for (typename edm::DetSetVector<PixelDigiSimLink>::const_iterator DSViter = links->begin(); DSViter != links->end();
966  DSViter++) {
967  unsigned int rawid = DSViter->id;
968  DetId detId(rawid);
969  if (DetId(detId).det() != DetId::Detector::Tracker)
970  continue;
971  int layer = tTopo_->getITPixelLayerNumber(rawid);
972  if (layer < 0)
973  continue;
974  bool flag_ = true;
975  std::string key = getHistoId(rawid, flag_);
976  std::map<std::string, DigiMEs>::iterator pos = layerMEs.find(key);
977  if (pos == layerMEs.end())
978  continue;
979  DigiMEs& local_mes = pos->second;
980  int tot_digi = 0;
981  std::map<int, float> bxMap;
982  for (typename edm::DetSet<PixelDigiSimLink>::const_iterator di = DSViter->begin(); di != DSViter->end(); di++) {
983  tot_digi++;
984  int bx = di->eventId().bunchCrossing();
985  std::map<int, float>::iterator ic = bxMap.find(bx);
986  if (ic == bxMap.end())
987  bxMap[bx] = 1.0;
988  else
989  bxMap[bx] += 1.0;
990  }
991  for (const auto& v : bxMap) {
992  if (tot_digi) {
993  local_mes.BunchXTimeBin->Fill(v.first, v.second);
994  local_mes.FractionOfOOTDigis->Fill(v.first, v.second / tot_digi);
995  }
996  }
997  }
998 }
999 //
1000 // -- Get Matched SimTrack
1001 //
1003  edm::SimTrackContainer sim_tracks = (*SimTk.product());
1004  for (unsigned int it = 0; it < sim_tracks.size(); it++) {
1005  if (sim_tracks[it].trackId() == simTrkId) {
1006  return it;
1007  }
1008  }
1009  return -1;
1010 }
1011 //
1012 // -- Check if the SimTrack is _Primary or not
1013 //
1015  bool retval = false;
1016  unsigned int trkId = simTrk.trackId();
1017  if (trkId != simHit.trackId())
1018  return retval;
1019  int vtxIndex = simTrk.vertIndex();
1020  int ptype = simHit.processType();
1021  if ((vtxIndex == 0) && (ptype == 0))
1022  retval = true;
1023  return retval;
1024 }
1025 //
1026 // -- Fill Histogram
1027 //
1029  MonitorElement* th1, MonitorElement* th2, MonitorElement* th3, float val, int primary) {
1030  if (th1)
1031  th1->Fill(val);
1032  if (th2 && primary == 1)
1033  th2->Fill(val);
1034  if (th3 && primary != 1)
1035  th3->Fill(val);
1036 }
1037 //
1038 // -- Fill NHit per Layer Histogram [Need to work on!!!]
1039 //
1040 /*
1041 void Phase2TrackerValidateDigi::fillHitsPerTrack() {
1042  for (const auto& it : layerMEs) {
1043  const DigiMEs& local_mes = it.second;
1044  unsigned int layer = it.first;
1045  int lval;
1046  if (layer < 10)
1047  lval = layer;
1048  else if (layer / 100 == 1)
1049  lval = 100 - (layer + 10);
1050  else if (layer / 100 == 2)
1051  lval = (layer + 10) - 200;
1052  else
1053  lval = 0;
1054  nSimHitsPerTrack->Fill(lval, local_mes.nHits);
1055  }
1056 }
1057 */
1059  if (flag)
1060  return phase2tkutil::getITHistoId(det_id, tTopo_);
1061  else
1062  return phase2tkutil::getOTHistoId(det_id, tTopo_);
1063 }
1064 
1065 //define this as a plug-in
muonTagProbeFilters_cff.matched
matched
Definition: muonTagProbeFilters_cff.py:62
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
Phase2TrackerValidateDigi::GeVperElectron
const float GeVperElectron
Definition: Phase2TrackerValidateDigi.h:151
edm::DetSetVector
Definition: DetSetVector.h:61
Phase2TrackerValidateDigi::DigiMEs::MatchedTrackEta
MonitorElement * MatchedTrackEta
Definition: Phase2TrackerValidateDigi.h:44
PixelDigiCollection.h
dqm::impl::MonitorElement
Definition: MonitorElement.h:98
CoreSimTrack::momentum
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
Phase2TrackerValidateDigi::DigiMEs::MissedHitTrackPhi
MonitorElement * MissedHitTrackPhi
Definition: Phase2TrackerValidateDigi.h:46
Phase2TrackerValidateDigi::getSimTrackId
unsigned int getSimTrackId(const edm::DetSetVector< PixelDigiSimLink > *simLinks, const DetId &detId, unsigned int &channel)
Definition: Phase2TrackerValidateDigi.cc:906
electrons_cff.bool
bool
Definition: electrons_cff.py:393
Phase2TrackerValidateDigi::MatchedRZPositionMap
MonitorElement * MatchedRZPositionMap
Definition: Phase2TrackerValidateDigi.h:89
Phase2TrackerValidateDigi::getHistoId
std::string getHistoId(uint32_t det_id, bool flag)
Definition: Phase2TrackerValidateDigi.cc:1058
SimVertex
Definition: SimVertex.h:5
Phase2TrackerValidateDigi::DigiMEs::MatchedTrackPt
MonitorElement * MatchedTrackPt
Definition: Phase2TrackerValidateDigi.h:42
MessageLogger.h
TrackerGeometry.h
GeomDet
Definition: GeomDet.h:27
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm::ESWatcher< TrackerDigiGeometryRecord >
edm::DetSetVector::end
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
Phase2TrackerValidateDigi::matchedSimTrack
int matchedSimTrack(edm::Handle< edm::SimTrackContainer > &SimTk, unsigned int simTrkId)
Definition: Phase2TrackerValidateDigi.cc:1002
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
edm::DetSet
Definition: DetSet.h:23
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
Phase2TrackerValidateDigi::SimulatedTrackPtP
MonitorElement * SimulatedTrackPtP
Definition: Phase2TrackerValidateDigi.h:77
edm::Run
Definition: Run.h:45
TrackerTopology::getITPixelLayerNumber
int getITPixelLayerNumber(const DetId &id) const
Definition: TrackerTopology.cc:436
TrackerTopology::getOTLayerNumber
int getOTLayerNumber(const DetId &id) const
Definition: TrackerTopology.cc:421
Phase2TrackerValidateDigi::~Phase2TrackerValidateDigi
~Phase2TrackerValidateDigi() override
Definition: Phase2TrackerValidateDigi.cc:85
edm
HLT enums.
Definition: AlignableModifier.h:19
Phase2TrackerValidateDigi::simHitTokens_
std::vector< edm::EDGetTokenT< edm::PSimHitContainer > > simHitTokens_
Definition: Phase2TrackerValidateDigi.h:137
TrackerTopology
Definition: TrackerTopology.h:16
Phase2TrackerValidateDigi::DigiMEs
Definition: Phase2TrackerValidateDigi.h:38
cuy.col
col
Definition: cuy.py:1010
pos
Definition: PixelAliasList.h:18
PSimHitContainer.h
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
TrackerGeomDet
Definition: TrackerGeomDet.h:6
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
PixelDigi
Definition: PixelDigi.h:14
OfflineHarvestingSequence_cosmic.ptype
ptype
Definition: OfflineHarvestingSequence_cosmic.py:7
Phase2TrackerValidateDigi::fillSimHitInfo
int fillSimHitInfo(const edm::Event &iEvent, const SimTrack simTrk)
Definition: Phase2TrackerValidateDigi.cc:195
Phase2TrackerValidateDigi::otDigiHandle_
edm::Handle< edm::DetSetVector< Phase2TrackerDigi > > otDigiHandle_
Definition: Phase2TrackerValidateDigi.h:140
edm::DetSetVector::begin
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
Phase2TrackerValidateDigi::DigiMEs::MissedDigiTrackPhi
MonitorElement * MissedDigiTrackPhi
Definition: Phase2TrackerValidateDigi.h:49
Phase2TrackerValidateDigi::DigiMEs::MatchedTrackPhi
MonitorElement * MatchedTrackPhi
Definition: Phase2TrackerValidateDigi.h:43
Phase2TrackerValidateDigi::DigiMEs::MatchedSimHitElossS
MonitorElement * MatchedSimHitElossS
Definition: Phase2TrackerValidateDigi.h:54
Phase2TrackerValidateDigi::DigiMEs::SimHitDx
MonitorElement * SimHitDx
Definition: Phase2TrackerValidateDigi.h:55
PixelDigi.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
Phase2TrackerValidateDigi::tofLowerCut_
float tofLowerCut_
Definition: Phase2TrackerValidateDigi.h:100
Phase2TrackerValidateDigi::DigiMEs::SimHitDz
MonitorElement * SimHitDz
Definition: Phase2TrackerValidateDigi.h:57
findQualityFiles.v
v
Definition: findQualityFiles.py:179
Phase2TrackerValidateDigi::DigiMEs::BunchXTimeBin
MonitorElement * BunchXTimeBin
Definition: Phase2TrackerValidateDigi.h:58
BeamSpotPI::nTracks
Definition: BeamSpotPayloadInspectorHelper.h:41
edm::Handle< edm::PSimHitContainer >
Phase2TrackerValidateDigi::itPixelDigiHandle_
edm::Handle< edm::DetSetVector< PixelDigi > > itPixelDigiHandle_
Definition: Phase2TrackerValidateDigi.h:139
TrackerTopology::tidRing
unsigned int tidRing(const DetId &id) const
Definition: TrackerTopology.h:218
Phase2TrackerValidateDigi::cval
const float cval
Definition: Phase2TrackerValidateDigi.h:152
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
Phase2TrackerDigi::pixelToChannel
static PackedDigiType pixelToChannel(unsigned int row, unsigned int col)
Definition: Phase2TrackerDigi.h:43
Phase2TrackerValidateDigi::SimulatedTOFZMap
MonitorElement * SimulatedTOFZMap
Definition: Phase2TrackerValidateDigi.h:94
align::Tracker
Definition: StructureType.h:70
TrackerGeometry::idToDetUnit
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
Definition: TrackerGeometry.cc:183
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Phase2TrackerValidateDigi::tkGeom_
const TrackerGeometry * tkGeom_
Definition: Phase2TrackerValidateDigi.h:148
DetId
Definition: DetId.h:17
Phase2TrackerValidateDigi.h
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
MakerMacros.h
TrackerTopology.h
Phase2TrackerValidateDigi::SimulatedTOFPhiMap
MonitorElement * SimulatedTOFPhiMap
Definition: Phase2TrackerValidateDigi.h:92
Phase2TrackerValidateDigi::findITPixelDigi
bool findITPixelDigi(unsigned int detid, unsigned int id)
Definition: Phase2TrackerValidateDigi.cc:348
Phase2TrackerValidateDigi::SimulatedTOFRMap
MonitorElement * SimulatedTOFRMap
Definition: Phase2TrackerValidateDigi.h:93
Phase2TrackerValidateDigi
Definition: Phase2TrackerValidateDigi.h:29
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Phase2TrackerValidateDigi::simVertexToken_
const edm::EDGetTokenT< edm::SimVertexContainer > simVertexToken_
Definition: Phase2TrackerValidateDigi.h:136
TrackerGeometry::detUnits
const DetContainer & detUnits() const override
Returm a vector of all GeomDet.
Definition: TrackerGeometry.h:61
Phase2TrackerValidateDigi::topoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Definition: Phase2TrackerValidateDigi.h:147
Service.h
PVValHelper::eta
Definition: PVValidationHelpers.h:69
rpcPointValidation_cfi.simHit
simHit
Definition: rpcPointValidation_cfi.py:24
Phase2TrackerValidateDigi::SimulatedTrackPhiP
MonitorElement * SimulatedTrackPhiP
Definition: Phase2TrackerValidateDigi.h:79
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
Phase2TrackerValidateDigi::isPrimary
bool isPrimary(const SimTrack &simTrk, const PSimHit &simHit)
Definition: Phase2TrackerValidateDigi.cc:1014
TrackerPhase2DQMUtil.h
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
Phase2TrackerValidateDigi::layerMEs
std::map< std::string, DigiMEs > layerMEs
Definition: Phase2TrackerValidateDigi.h:118
edm::ESHandle< TrackerGeometry >
Phase2TrackerValidateDigi::nSimVertices
MonitorElement * nSimVertices
Definition: Phase2TrackerValidateDigi.h:71
dqm::implementation::NavigatorBase::cd
virtual void cd()
Definition: DQMStore.cc:29
Phase2TrackerValidateDigi::SimulatedTrackPtS
MonitorElement * SimulatedTrackPtS
Definition: Phase2TrackerValidateDigi.h:81
dqm::implementation::IBooker::bookProfile
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:322
Phase2TrackerValidateDigi::DigiMEs::MissedDigiSimHitElossS
MonitorElement * MissedDigiSimHitElossS
Definition: Phase2TrackerValidateDigi.h:52
Phase2TrackerValidateDigi::DigiMEs::MissedHitTrackEta
MonitorElement * MissedHitTrackEta
Definition: Phase2TrackerValidateDigi.h:47
Phase2TrackerValidateDigi::fillOTBXInfo
void fillOTBXInfo()
Definition: Phase2TrackerValidateDigi.cc:927
Phase2TrackerValidateDigi::Phase2TrackerValidateDigi
Phase2TrackerValidateDigi(const edm::ParameterSet &)
Definition: Phase2TrackerValidateDigi.cc:50
Phase2TrackerValidateDigi::simTrackToken_
const edm::EDGetTokenT< edm::SimTrackContainer > simTrackToken_
Definition: Phase2TrackerValidateDigi.h:135
PixelDigi::pixelToChannel
static int pixelToChannel(int row, int col)
Definition: PixelDigi.h:71
Phase2TrackerValidateDigi::DigiMEs::FractionOfOOTDigis
MonitorElement * FractionOfOOTDigis
Definition: Phase2TrackerValidateDigi.h:59
Point3DBase< float, GlobalTag >
Phase2TrackerValidateDigi::DigiMEs::MissedDigiTimeWindow
MonitorElement * MissedDigiTimeWindow
Definition: Phase2TrackerValidateDigi.h:61
Phase2TrackerValidateDigi::DigiMEs::MissedDigiTrackPt
MonitorElement * MissedDigiTrackPt
Definition: Phase2TrackerValidateDigi.h:48
Phase2TrackerValidateDigi::DigiMEs::SimHitDy
MonitorElement * SimHitDy
Definition: Phase2TrackerValidateDigi.h:56
Phase2TrackerValidateDigi::SimulatedRZPositionMap
MonitorElement * SimulatedRZPositionMap
Definition: Phase2TrackerValidateDigi.h:86
PixelGeomDetType.h
Phase2TrackerValidateDigi::nSimulatedTracks
MonitorElement * nSimulatedTracks
Definition: Phase2TrackerValidateDigi.h:67
Phase2TrackerValidateDigi::pixelFlag_
bool pixelFlag_
Definition: Phase2TrackerValidateDigi.h:120
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Phase2TrackerValidateDigi::SimulatedTrackEtaP
MonitorElement * SimulatedTrackEtaP
Definition: Phase2TrackerValidateDigi.h:78
Phase2TrackerValidateDigi::MatchedXYPositionMap
MonitorElement * MatchedXYPositionMap
Definition: Phase2TrackerValidateDigi.h:88
Phase2TrackerValidateDigi::DigiMEs::MissedHitTrackPt
MonitorElement * MissedHitTrackPt
Definition: Phase2TrackerValidateDigi.h:45
funct::true
true
Definition: Factorize.h:173
Phase2TrackerValidateDigi::SimulatedTOFEtaMap
MonitorElement * SimulatedTOFEtaMap
Definition: Phase2TrackerValidateDigi.h:91
TrackerDigiGeometryRecord.h
Phase2TrackerValidateDigi::fillITPixelBXInfo
void fillITPixelBXInfo()
Definition: Phase2TrackerValidateDigi.cc:963
Phase2TrackerDigi.h
Phase2TrackerValidateDigi::DigiMEs::nDigis
int nDigis
Definition: Phase2TrackerValidateDigi.h:63
MonitorElement.h
Phase2TrackerValidateDigi::SimulatedTrackEta
MonitorElement * SimulatedTrackEta
Definition: Phase2TrackerValidateDigi.h:74
Phase2TrackerValidateDigi::otDigiToken_
const edm::EDGetTokenT< edm::DetSetVector< Phase2TrackerDigi > > otDigiToken_
Definition: Phase2TrackerValidateDigi.h:131
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
TrackerGeomDet.h
Phase2TrackerValidateDigi::SimulatedTrackPhiS
MonitorElement * SimulatedTrackPhiS
Definition: Phase2TrackerValidateDigi.h:83
Phase2TrackerValidateDigi::DigiMEs::SimTrackPhi
MonitorElement * SimTrackPhi
Definition: Phase2TrackerValidateDigi.h:41
Phase2TrackerValidateDigi::SimulatedTrackEtaS
MonitorElement * SimulatedTrackEtaS
Definition: Phase2TrackerValidateDigi.h:82
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
fed_dqm_sourceclient-live_cfg.folder_name
folder_name
Definition: fed_dqm_sourceclient-live_cfg.py:42
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
Phase2TrackerValidateDigi::analyze
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
Definition: Phase2TrackerValidateDigi.cc:108
edm::DetSetVector::find
iterator find(det_id_type id)
Definition: DetSetVector.h:264
iEvent
int iEvent
Definition: GenABIO.cc:224
Phase2TrackerValidateDigi::dqmBeginRun
void dqmBeginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
Definition: Phase2TrackerValidateDigi.cc:92
Phase2TrackerValidateDigi::itPixelDigiToken_
const edm::EDGetTokenT< edm::DetSetVector< PixelDigi > > itPixelDigiToken_
Definition: Phase2TrackerValidateDigi.h:133
Phase2TrackerValidateDigi::pSimHitSrc_
std::vector< edm::InputTag > pSimHitSrc_
Definition: Phase2TrackerValidateDigi.h:127
Phase2TrackerValidateDigi::itPixelDigiSimLinkToken_
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > itPixelDigiSimLinkToken_
Definition: Phase2TrackerValidateDigi.h:134
cscdqm::HistoName
std::string HistoName
Definition: CSCDQM_HistoDef.h:32
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
Phase2TrackerValidateDigi::nSimulatedTracksP
MonitorElement * nSimulatedTracksP
Definition: Phase2TrackerValidateDigi.h:68
Phase2TrackerValidateDigi::DigiMEs::MissedDigiLocalXposVsYPos
MonitorElement * MissedDigiLocalXposVsYPos
Definition: Phase2TrackerValidateDigi.h:60
Phase2TrackerValidateDigi::otSimLinkHandle_
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > otSimLinkHandle_
Definition: Phase2TrackerValidateDigi.h:142
edm::EventSetup
Definition: EventSetup.h:57
Phase2TrackerValidateDigi::DigiMEs::SimTrackEta
MonitorElement * SimTrackEta
Definition: Phase2TrackerValidateDigi.h:40
DetSetVector.h
Phase2TrackerValidateDigi::bookLayerHistos
void bookLayerHistos(DQMStore::IBooker &ibooker, unsigned int det_id, bool flag)
Definition: Phase2TrackerValidateDigi.cc:640
Phase2TrackerValidateDigi::DigiMEs::SimTrackPt
MonitorElement * SimTrackPt
Definition: Phase2TrackerValidateDigi.h:39
edm::ESHandleBase::isValid
bool isValid() const
Definition: ESHandle.h:44
Phase2TrackerValidateDigi::SimulatedTrackPhi
MonitorElement * SimulatedTrackPhi
Definition: Phase2TrackerValidateDigi.h:75
Phase2TrackerValidateDigi::DigiMEs::MissedDigiSimHitElossP
MonitorElement * MissedDigiSimHitElossP
Definition: Phase2TrackerValidateDigi.h:51
Phase2TrackerValidateDigi::nSimulatedTracksS
MonitorElement * nSimulatedTracksS
Definition: Phase2TrackerValidateDigi.h:69
InputTag.h
CoreSimTrack::trackId
unsigned int trackId() const
Definition: CoreSimTrack.h:31
DDAxes::phi
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
Phase2TrackerValidateDigi::ptCut_
float ptCut_
Definition: Phase2TrackerValidateDigi.h:98
Phase2TrackerValidateDigi::tTopo_
const TrackerTopology * tTopo_
Definition: Phase2TrackerValidateDigi.h:149
Phase2TrackerDigi
Definition: Phase2TrackerDigi.h:12
GeomDet.h
Phase2TrackerValidateDigi::DigiMEs::MatchedSimHitElossP
MonitorElement * MatchedSimHitElossP
Definition: Phase2TrackerValidateDigi.h:53
Phase2TrackerValidateDigi::simVertices
edm::Handle< edm::SimVertexContainer > simVertices
Definition: Phase2TrackerValidateDigi.h:145
heppy_batch.val
val
Definition: heppy_batch.py:351
std
Definition: JetResolutionObject.h:76
phase2tkutil::getITHistoId
std::string getITHistoId(uint32_t det_id, const TrackerTopology *tTopo)
Definition: TrackerPhase2DQMUtil.cc:2
Phase2TrackerValidateDigi::simHits
edm::Handle< edm::PSimHitContainer > simHits
Definition: Phase2TrackerValidateDigi.h:143
Phase2TrackerValidateDigi::bookHistograms
void bookHistograms(DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
Definition: Phase2TrackerValidateDigi.cc:371
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
edm::SimTrackContainer
std::vector< SimTrack > SimTrackContainer
Definition: SimTrackContainer.h:12
SimTrack
Definition: SimTrack.h:6
ESWatcher.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
dqm::implementation::IBooker::book2D
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:177
electronStore.links
links
Definition: electronStore.py:149
PixelGeomDetUnit.h
Phase2TrackerValidateDigi::itPixelSimLinkHandle_
edm::Handle< edm::DetSetVector< PixelDigiSimLink > > itPixelSimLinkHandle_
Definition: Phase2TrackerValidateDigi.h:141
edm::DetSet::data
collection_type data
Definition: DetSet.h:80
flag_
struct @690 flag_
SimTrack::vertIndex
int vertIndex() const
index of the vertex in the Event container (-1 if no vertex)
Definition: SimTrack.h:30
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Phase2TrackerValidateDigi::fillHistogram
void fillHistogram(MonitorElement *th1, MonitorElement *th2, MonitorElement *th3, float val, int primary)
Definition: Phase2TrackerValidateDigi.cc:1028
dqm::implementation::IBooker
Definition: DQMStore.h:43
Phase2TrackerValidateDigi::DigiMEs::MissedDigiTrackEta
MonitorElement * MissedDigiTrackEta
Definition: Phase2TrackerValidateDigi.h:50
Phase2TrackerValidateDigi::etaCut_
float etaCut_
Definition: Phase2TrackerValidateDigi.h:97
Phase2TrackerDigitizerFwd.h
edm::PSimHitContainer
std::vector< PSimHit > PSimHitContainer
Definition: PSimHitContainer.h:11
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
Phase2TrackerValidateDigi::SimulatedTrackPt
MonitorElement * SimulatedTrackPt
Definition: Phase2TrackerValidateDigi.h:73
Phase2TrackerValidateDigi::config_
edm::ParameterSet config_
Definition: Phase2TrackerValidateDigi.h:117
PSimHit
Definition: PSimHit.h:15
Phase2TrackerValidateDigi::SimulatedXYPositionMap
MonitorElement * SimulatedXYPositionMap
Definition: Phase2TrackerValidateDigi.h:85
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
Parameters
vector< ParameterSet > Parameters
Definition: HLTMuonPlotter.cc:25
Phase2TrackerValidateDigi::otDigiSimLinkToken_
const edm::EDGetTokenT< edm::DetSetVector< PixelDigiSimLink > > otDigiSimLinkToken_
Definition: Phase2TrackerValidateDigi.h:132
crabWrapper.key
key
Definition: crabWrapper.py:19
Phase2TrackerValidateDigi::findOTDigi
bool findOTDigi(unsigned int detid, unsigned int id)
Definition: Phase2TrackerValidateDigi.cc:329
edm::SimVertexContainer
std::vector< SimVertex > SimVertexContainer
Definition: SimVertexContainer.h:12
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Phase2TrackerValidateDigi::simTracks
edm::Handle< edm::SimTrackContainer > simTracks
Definition: Phase2TrackerValidateDigi.h:144
Phase2TrackerValidateDigi::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: Phase2TrackerValidateDigi.h:146
phase2tkutil::getOTHistoId
std::string getOTHistoId(uint32_t det_id, const TrackerTopology *tTopo)
Definition: TrackerPhase2DQMUtil.cc:25
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
Phase2TrackerValidateDigi::tofUpperCut_
float tofUpperCut_
Definition: Phase2TrackerValidateDigi.h:99
TrackerGeometry
Definition: TrackerGeometry.h:14
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31