CMS 3D CMS Logo

SiStripHitEfficiencyWorker.cc
Go to the documentation of this file.
1 // Package: CalibTracker/SiStripHitEfficiency
3 // Class: SiStripHitEfficiencyWorker
4 // Original Author: Pieter David
5 //
6 // Adapted from HitEff (Keith Ulmer -- University of Colorado, keith.ulmer@colorado.edu
7 // SiStripHitEffFromCalibTree (Christopher Edelmaier)
9 
59 
61 public:
62  explicit SiStripHitEfficiencyWorker(const edm::ParameterSet& conf);
63  ~SiStripHitEfficiencyWorker() override = default;
64  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
65 
66 private:
67  void beginJob(); // TODO remove
68  void endJob(); // TODO remove
69  void bookHistograms(DQMStore::IBooker& booker, const edm::Run& run, const edm::EventSetup& setup) override;
70  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
71  void fillForTraj(const TrajectoryAtInvalidHit& tm,
72  const TrackerTopology* tTopo,
73  const TrackerGeometry* tkgeom,
74  const StripClusterParameterEstimator& stripCPE,
75  const SiStripQuality& stripQuality,
76  const DetIdCollection& fedErrorIds,
77  const edm::Handle<edm::DetSetVector<SiStripRawDigi>>& commonModeDigis,
78  const edmNew::DetSetVector<SiStripCluster>& theClusters,
79  int bunchCrossing,
80  float instLumi,
81  float PU,
82  bool highPurity);
83 
84  // ----------member data ---------------------------
85 
86  // event data tokens
95 
96  // event setup tokens
106 
107  // configurable parameters
109  unsigned int layers_;
110  bool DEBUG_;
111  bool addLumi_;
114  unsigned int trackMultiplicityCut_;
119  float resXSig_;
123  int bunchX_;
126  unsigned int nTEClayers_;
127 
128  // output file
129  std::set<uint32_t> badModules_;
130 
131  // counters
133 
134  struct EffME1 {
135  EffME1() : hTotal(nullptr), hFound(nullptr) {}
137 
138  void fill(double x, bool found, float weight = 1.) {
139  hTotal->Fill(x, weight);
140  if (found) {
141  hFound->Fill(x, weight);
142  }
143  }
144 
146  };
147  struct EffTkMap {
148  EffTkMap() : hTotal(nullptr), hFound(nullptr) {}
149  EffTkMap(std::unique_ptr<TkHistoMap>&& total, std::unique_ptr<TkHistoMap>&& found)
150  : hTotal(std::move(total)), hFound(std::move(found)) {}
151 
152  void fill(uint32_t id, bool found, float weight = 1.) {
153  hTotal->fill(id, weight);
154  if (found) {
155  hFound->fill(id, weight);
156  }
157  }
158 
159  std::unique_ptr<TkHistoMap> hTotal, hFound;
160  };
161 
167  std::vector<MonitorElement*> h_resolution;
168  std::vector<EffME1> h_layer_vsLumi;
169  std::vector<EffME1> h_layer_vsBx;
170  std::vector<EffME1> h_layer_vsPU;
171  std::vector<EffME1> h_layer_vsCM;
172  std::vector<MonitorElement*> h_hotcold;
173 
175 };
176 
177 //
178 // constructors and destructor
179 //
180 
182  : scalerToken_(consumes<LumiScalersCollection>(conf.getParameter<edm::InputTag>("lumiScalers"))),
183  commonModeToken_(mayConsume<edm::DetSetVector<SiStripRawDigi>>(conf.getParameter<edm::InputTag>("commonMode"))),
184  combinatorialTracks_token_(
185  consumes<reco::TrackCollection>(conf.getParameter<edm::InputTag>("combinatorialTracks"))),
186  trajectories_token_(consumes<std::vector<Trajectory>>(conf.getParameter<edm::InputTag>("trajectories"))),
187  trajTrackAsso_token_(consumes<TrajTrackAssociationCollection>(conf.getParameter<edm::InputTag>("trajectories"))),
188  clusters_token_(
189  consumes<edmNew::DetSetVector<SiStripCluster>>(conf.getParameter<edm::InputTag>("siStripClusters"))),
190  digis_token_(consumes<DetIdCollection>(conf.getParameter<edm::InputTag>("siStripDigis"))),
191  trackerEvent_token_(consumes<MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent"))),
192  tTopoToken_(esConsumes()),
193  tkGeomToken_(esConsumes()),
194  stripCPEToken_(esConsumes(edm::ESInputTag{"", "StripCPEfromTrackAngle"})),
195  stripQualityToken_(esConsumes()),
196  magFieldToken_(esConsumes()),
197  measTrackerToken_(esConsumes()),
198  chi2EstimatorToken_(esConsumes(edm::ESInputTag{"", "Chi2"})),
199  propagatorToken_(esConsumes(edm::ESInputTag{"", "PropagatorWithMaterial"})),
200  tkDetMapToken_(esConsumes<edm::Transition::BeginRun>()),
201  dqmDir_(conf.getParameter<std::string>("dqmDir")),
202  layers_(conf.getParameter<int>("Layer")),
203  DEBUG_(conf.getUntrackedParameter<bool>("Debug", false)),
204  addLumi_(conf.getUntrackedParameter<bool>("addLumi", false)),
205  addCommonMode_(conf.getUntrackedParameter<bool>("addCommonMode", false)),
206  cutOnTracks_(conf.getParameter<bool>("cutOnTracks")),
207  trackMultiplicityCut_(conf.getParameter<unsigned int>("trackMultiplicity")),
208  useFirstMeas_(conf.getParameter<bool>("useFirstMeas")),
209  useLastMeas_(conf.getParameter<bool>("useLastMeas")),
210  useAllHitsFromTracksWithMissingHits_(conf.getParameter<bool>("useAllHitsFromTracksWithMissingHits")),
211  clusterMatchingMethod_(conf.getParameter<int>("ClusterMatchingMethod")),
212  resXSig_(conf.getParameter<double>("ResXSig")),
213  clusterTracjDist_(conf.getParameter<double>("ClusterTrajDist")),
214  stripsApvEdge_(conf.getParameter<double>("StripsApvEdge")),
215  useOnlyHighPurityTracks_(conf.getParameter<bool>("UseOnlyHighPurityTracks")),
216  bunchX_(conf.getUntrackedParameter<int>("BunchCrossing", 0)),
217  showRings_(conf.getUntrackedParameter<bool>("ShowRings", false)),
218  showTOB6TEC9_(conf.getUntrackedParameter<bool>("ShowTOB6TEC9", false)) {
219  nTEClayers_ = (showRings_ ? 7 : 9); // number of rings or wheels
220 
221  const std::string badModulesFile = conf.getUntrackedParameter<std::string>("BadModulesFile", "");
222  if (!badModulesFile.empty()) {
223  std::ifstream badModules_file(badModulesFile);
224  uint32_t badmodule_detid;
225  int mods, fiber1, fiber2, fiber3;
226  if (badModules_file.is_open()) {
228  while (getline(badModules_file, line)) {
229  if (badModules_file.eof())
230  continue;
231  std::stringstream ss(line);
232  ss >> badmodule_detid >> mods >> fiber1 >> fiber2 >> fiber3;
233  if (badmodule_detid != 0 && mods == 1 && (fiber1 == 1 || fiber2 == 1 || fiber3 == 1))
234  badModules_.insert(badmodule_detid);
235  }
236  badModules_file.close();
237  }
238  }
239  if (!badModules_.empty())
240  LogDebug("SiStripHitEfficiencyWorker") << "Remove additionnal bad modules from the analysis: ";
241  for (const auto badMod : badModules_) {
242  LogDebug("SiStripHitEfficiencyWorker") << " " << badMod;
243  }
244 }
245 
247  // TODO convert to counters, or simply remove?
248  events = 0;
249  EventTrackCKF = 0;
250 }
251 
253  const edm::Run& run,
254  const edm::EventSetup& setup) {
255  booker.setCurrentFolder(fmt::format("{}/EventInfo", dqmDir_));
256  h_bx = booker.book1D("bx", "bx", 3600, 0, 3600);
257  h_instLumi = booker.book1D("instLumi", "inst. lumi.", 250, 0, 25000);
258  h_PU = booker.book1D("PU", "PU", 200, 0, 200);
259  h_nTracks = booker.book1D("ntracks", "n.tracks;n. tracks;n.events", 500, -0.5, 499.5);
260  h_nTracksVsPU = booker.bookProfile("nTracksVsPU", "n. tracks vs PU; PU; n.tracks ", 200, 0, 200, 500, -0.5, 499.5);
261 
262  booker.setCurrentFolder(dqmDir_);
263  h_goodLayer = EffME1(booker.book1D("goodlayer_total", "goodlayer_total", 35, 0., 35.),
264  booker.book1D("goodlayer_found", "goodlayer_found", 35, 0., 35.));
265  h_allLayer = EffME1(booker.book1D("alllayer_total", "alllayer_total", 35, 0., 35.),
266  booker.book1D("alllayer_found", "alllayer_found", 35, 0., 35.));
267 
268  h_layer = EffME1(
269  booker.book1D(
270  "layer_found", "layer_found", bounds::k_END_OF_LAYERS, 0., static_cast<float>(bounds::k_END_OF_LAYERS)),
271  booker.book1D(
272  "layer_total", "layer_total", bounds::k_END_OF_LAYERS, 0., static_cast<float>(bounds::k_END_OF_LAYERS)));
273 
274  for (int layer = 1; layer != bounds::k_END_OF_LAYERS; ++layer) {
275  const auto lyrName = ::layerName(layer, showRings_, nTEClayers_);
276 
277  // book resolutions
278  booker.setCurrentFolder(fmt::format("{}/Resolutions", dqmDir_));
279  auto ihres = booker.book1D(Form("resol_layer_%i", layer), lyrName, 125, -125., 125.);
280  ihres->setAxisTitle("trajX-clusX [strip unit]");
281  h_resolution.push_back(ihres);
282 
283  // book plots vs Lumi
284  booker.setCurrentFolder(fmt::format("{}/VsLumi", dqmDir_));
285  h_layer_vsLumi.push_back(EffME1(booker.book1D(Form("layertotal_vsLumi_layer_%i", layer), lyrName, 100, 0, 25000),
286  booker.book1D(Form("layerfound_vsLumi_layer_%i", layer), lyrName, 100, 0, 25000)));
287 
288  // book plots vs Lumi
289  booker.setCurrentFolder(fmt::format("{}/VsPu", dqmDir_));
290  h_layer_vsPU.push_back(EffME1(booker.book1D(Form("layertotal_vsPU_layer_%i", layer), lyrName, 45, 0, 90),
291  booker.book1D(Form("layerfound_vsPU_layer_%i", layer), lyrName, 45, 0, 90)));
292  if (addCommonMode_) {
293  // book plots for common mode
294  booker.setCurrentFolder(fmt::format("{}/CommonMode", dqmDir_));
295  h_layer_vsCM.push_back(EffME1(booker.book1D(Form("layertotal_vsCM_layer_%i", layer), lyrName, 20, 0, 400),
296  booker.book1D(Form("layerfound_vsCM_layer_%i", layer), lyrName, 20, 0, 400)));
297  }
298 
299  // book plots vs Lumi
300  booker.setCurrentFolder(fmt::format("{}/VsBx", dqmDir_));
301  h_layer_vsBx.push_back(EffME1(
302  booker.book1D(Form("totalVsBx_layer%i", layer), Form("layer %i (%s)", layer, lyrName.c_str()), 3565, 0, 3565),
303  booker.book1D(Form("foundVsBx_layer%i", layer), Form("layer %i (%s)", layer, lyrName.c_str()), 3565, 0, 3565)));
304 
305  // book hot and cold
306  booker.setCurrentFolder(fmt::format("{}/MissingHits", dqmDir_));
307  if (layer <= bounds::k_LayersAtTOBEnd) {
308  const bool isTIB = layer <= bounds::k_LayersAtTIBEnd;
309  const auto partition = (isTIB ? "TIB" : "TOB");
310  const auto yMax = (isTIB ? 100 : 120);
311 
312  const auto tit = Form("%s%i: Map of missing hits", partition, (isTIB ? layer : layer - bounds::k_LayersAtTIBEnd));
313 
314  auto ihhotcold = booker.book2D(tit, tit, 100, -1, 361, 100, -yMax, yMax);
315  ihhotcold->setAxisTitle("#phi [deg]", 1);
316  ihhotcold->setBinLabel(1, "360", 1);
317  ihhotcold->setBinLabel(50, "180", 1);
318  ihhotcold->setBinLabel(100, "0", 1);
319  ihhotcold->setAxisTitle("Global Z [cm]", 2);
320  ihhotcold->setOption("colz");
321  h_hotcold.push_back(ihhotcold);
322  } else {
323  const bool isTID = layer <= bounds::k_LayersAtTIDEnd;
324  const auto partitions =
325  (isTID ? std::vector<std::string>{"TID-", "TID+"} : std::vector<std::string>{"TEC-", "TEC+"});
326  const auto axMax = (isTID ? 100 : 120);
327  for (const auto& part : partitions) {
328  const auto tit = Form("%s%i: Map of missing hits",
329  part.c_str(),
330  (isTID ? layer - bounds::k_LayersAtTOBEnd : layer - bounds::k_LayersAtTIDEnd));
331 
332  auto ihhotcold = booker.book2D(tit, tit, 100, -axMax, axMax, 100, -axMax, axMax);
333  ihhotcold->setAxisTitle("Global Y", 1);
334  ihhotcold->setBinLabel(1, "+Y", 1);
335  ihhotcold->setBinLabel(50, "0", 1);
336  ihhotcold->setBinLabel(100, "-Y", 1);
337  ihhotcold->setAxisTitle("Global X", 2);
338  ihhotcold->setBinLabel(1, "-X", 2);
339  ihhotcold->setBinLabel(50, "0", 2);
340  ihhotcold->setBinLabel(100, "+X", 2);
341  ihhotcold->setOption("colz");
342  h_hotcold.push_back(ihhotcold);
343  }
344  }
345  }
346 
347  // come back to the main folder
348  booker.setCurrentFolder(dqmDir_);
349  const auto tkDetMapFolder = fmt::format("{}/TkDetMaps", dqmDir_);
350 
351  const TkDetMap* tkDetMap = &setup.getData(tkDetMapToken_);
352  h_module =
353  EffTkMap(std::make_unique<TkHistoMap>(tkDetMap, booker, tkDetMapFolder, "perModule_total", 0, false, true),
354  std::make_unique<TkHistoMap>(tkDetMap, booker, tkDetMapFolder, "perModule_found", 0, false, true));
355 }
356 
358  const auto tTopo = &es.getData(tTopoToken_);
359 
360  // bool DEBUG_ = false;
361 
362  LogDebug("SiStripHitEfficiencyWorker") << "beginning analyze from HitEff";
363 
364  // Step A: Get Inputs
365 
366  // Luminosity informations
368  float instLumi = 0;
369  float PU = 0;
370  if (addLumi_) {
371  e.getByToken(scalerToken_, lumiScalers);
372  if (lumiScalers->begin() != lumiScalers->end()) {
373  instLumi = lumiScalers->begin()->instantLumi();
374  PU = lumiScalers->begin()->pileup();
375  }
376  }
377  h_bx->Fill(e.bunchCrossing());
379  h_PU->Fill(PU);
380 
382  if (addCommonMode_)
383  e.getByToken(commonModeToken_, commonModeDigis);
384 
386  e.getByToken(combinatorialTracks_token_, tracksCKF);
387 
388  edm::Handle<std::vector<Trajectory>> TrajectoryCollectionCKF;
389  e.getByToken(trajectories_token_, TrajectoryCollectionCKF);
390 
391  edm::Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle;
392  e.getByToken(trajTrackAsso_token_, trajTrackAssociationHandle);
393 
395  e.getByToken(clusters_token_, theClusters);
396 
397  edm::Handle<DetIdCollection> fedErrorIds;
398  e.getByToken(digis_token_, fedErrorIds);
399 
402 
403  const auto tkgeom = &es.getData(tkGeomToken_);
404  const auto& stripcpe = es.getData(stripCPEToken_);
405  const auto& stripQuality = es.getData(stripQualityToken_);
406  const auto& magField = es.getData(magFieldToken_);
407  const auto& measTracker = es.getData(measTrackerToken_);
408  const auto& chi2Estimator = es.getData(chi2EstimatorToken_);
409  const auto& prop = es.getData(propagatorToken_);
410 
411  ++events;
412 
413  // Tracking
414  LogDebug("SiStripHitEfficiencyWorker") << "number ckf tracks found = " << tracksCKF->size();
415 
416  h_nTracks->Fill(tracksCKF->size());
417  h_nTracksVsPU->Fill(PU, tracksCKF->size());
418 
419  if (!tracksCKF->empty()) {
420  if (cutOnTracks_ && (tracksCKF->size() >= trackMultiplicityCut_))
421  return;
422  if (cutOnTracks_)
423  LogDebug("SiStripHitEfficiencyWorker")
424  << "starting checking good event with < " << trackMultiplicityCut_ << " tracks";
425 
426  ++EventTrackCKF;
427 
428  // actually should do a loop over all the tracks in the event here
429 
430  // Looping over traj-track associations to be able to get traj & track informations
431  for (const auto& trajTrack : *trajTrackAssociationHandle) {
432  // for each track, fill some variables such as number of hits and momentum
433 
434  const bool highPurity = trajTrack.val->quality(reco::TrackBase::TrackQuality::highPurity);
435  auto TMeas = trajTrack.key->measurements();
436 
437  const bool hasMissingHits = std::any_of(std::begin(TMeas), std::end(TMeas), [](const auto& tm) {
438  return tm.recHit()->getType() == TrackingRecHit::Type::missing;
439  });
440 
441  // Loop on each measurement and take it into consideration
442  //--------------------------------------------------------
443  for (auto itm = TMeas.cbegin(); itm != TMeas.cend(); ++itm) {
444  const auto theInHit = (*itm).recHit();
445 
446  LogDebug("SiStripHitEfficiencyWorker") << "theInHit is valid = " << theInHit->isValid();
447 
448  unsigned int iidd = theInHit->geographicalId().rawId();
449 
450  unsigned int TKlayers = ::checkLayer(iidd, tTopo);
451 
452  // do not bother with pixel hits
453  if (DetId(iidd).subdetId() < SiStripSubdetector::TIB)
454  continue;
455 
456  LogDebug("SiStripHitEfficiencyWorker") << "TKlayer from trajectory: " << TKlayers << " from module = " << iidd
457  << " matched/stereo/rphi = " << ((iidd & 0x3) == 0) << "/"
458  << ((iidd & 0x3) == 1) << "/" << ((iidd & 0x3) == 2);
459 
460  // Test first and last points of the trajectory
461  // the list of measurements starts from outer layers !!! This could change -> should add a check
462  if ((!useFirstMeas_ && (itm == (TMeas.end() - 1))) || (!useLastMeas_ && (itm == (TMeas.begin()))) ||
463  // In case of missing hit in the track, check whether to use the other hits or not.
464  (!useAllHitsFromTracksWithMissingHits_ && hasMissingHits &&
465  theInHit->getType() != TrackingRecHit::Type::missing))
466  continue;
467  // If Trajectory measurement from TOB 6 or TEC 9, skip it because it's always valid they are filled later
468  if (TKlayers == bounds::k_LayersAtTOBEnd || TKlayers == bounds::k_LayersAtTECEnd) {
469  LogDebug("SiStripHitEfficiencyWorker") << "skipping original TM for TOB 6 or TEC 9";
470  continue;
471  }
472 
473  std::vector<TrajectoryAtInvalidHit> TMs;
474 
475  // Make AnalyticalPropagat // TODO where to save these?or to use in TAVH constructor
477 
478  // for double sided layers check both sensors--if no hit was found on either sensor surface,
479  // the trajectory measurements only have one invalid hit entry on the matched surface
480  // so get the TrajectoryAtInvalidHit for both surfaces and include them in the study
481  if (::isDoubleSided(iidd, tTopo) && ((iidd & 0x3) == 0)) {
482  // do hit eff check twice--once for each sensor
483  //add a TM for each surface
484  TMs.emplace_back(*itm, tTopo, tkgeom, propagator, 1);
485  TMs.emplace_back(*itm, tTopo, tkgeom, propagator, 2);
486  } else if (::isDoubleSided(iidd, tTopo) && (!::check2DPartner(iidd, TMeas))) {
487  // if only one hit was found the trajectory measurement is on that sensor surface, and the other surface from
488  // the matched layer should be added to the study as well
489  TMs.emplace_back(*itm, tTopo, tkgeom, propagator, 1);
490  TMs.emplace_back(*itm, tTopo, tkgeom, propagator, 2);
491  LogDebug("SiStripHitEfficiencyWorker") << " found a hit with a missing partner";
492  } else {
493  //only add one TM for the single surface and the other will be added in the next iteration
494  TMs.emplace_back(*itm, tTopo, tkgeom, propagator);
495  }
496 
498  //Now check for tracks at TOB6 and TEC9
499 
500  // to make sure we only propagate on the last TOB5 hit check the next entry isn't also in TOB5
501  // to avoid bias, make sure the TOB5 hit is valid (an invalid hit on TOB5 could only exist with a valid hit on TOB6)
502  const auto nextId = (itm + 1 != TMeas.end()) ? (itm + 1)->recHit()->geographicalId() : DetId{}; // null if last
503 
504  if (TKlayers == 9 && theInHit->isValid() && !((!nextId.null()) && (::checkLayer(nextId.rawId(), tTopo) == 9))) {
505  // if ( TKlayers==9 && itm==TMeas.rbegin()) {
506  // if ( TKlayers==9 && (itm==TMeas.back()) ) { // to check for only the last entry in the trajectory for propagation
507  const DetLayer* tob6 = measTracker.geometricSearchTracker()->tobLayers().back();
508  const LayerMeasurements theLayerMeasurements{measTracker, *measurementTrackerEvent};
509  const TrajectoryStateOnSurface tsosTOB5 = itm->updatedState();
510  const auto tmp = theLayerMeasurements.measurements(*tob6, tsosTOB5, prop, chi2Estimator);
511 
512  if (!tmp.empty()) {
513  LogDebug("SiStripHitEfficiencyWorker") << "size of TM from propagation = " << tmp.size();
514 
515  // take the last of the TMs, which is always an invalid hit
516  // if no detId is available, ie detId==0, then no compatible layer was crossed
517  // otherwise, use that TM for the efficiency measurement
518  const auto& tob6TM = tmp.back();
519  const auto& tob6Hit = tob6TM.recHit();
520  if (tob6Hit->geographicalId().rawId() != 0) {
521  LogDebug("SiStripHitEfficiencyWorker") << "tob6 hit actually being added to TM vector";
522  TMs.emplace_back(tob6TM, tTopo, tkgeom, propagator);
523  }
524  }
525  }
526 
527  // same for TEC8
528  if (TKlayers == 21 && theInHit->isValid() &&
529  !((!nextId.null()) && (::checkLayer(nextId.rawId(), tTopo) == 21))) {
530  const DetLayer* tec9pos = measTracker.geometricSearchTracker()->posTecLayers().back();
531  const DetLayer* tec9neg = measTracker.geometricSearchTracker()->negTecLayers().back();
532 
533  const LayerMeasurements theLayerMeasurements{measTracker, *measurementTrackerEvent};
534  const TrajectoryStateOnSurface tsosTEC9 = itm->updatedState();
535 
536  // check if track on positive or negative z
537  if (!(iidd == SiStripSubdetector::TEC))
538  LogDebug("SiStripHitEfficiencyWorker") << "there is a problem with TEC 9 extrapolation";
539 
540  //LogDebug("SiStripHitEfficiencyWorker") << " tec9 id = " << iidd << " and side = " << tTopo->tecSide(iidd) ;
541  std::vector<TrajectoryMeasurement> tmp;
542  if (tTopo->tecSide(iidd) == 1) {
543  tmp = theLayerMeasurements.measurements(*tec9neg, tsosTEC9, prop, chi2Estimator);
544  //LogDebug("SiStripHitEfficiencyWorker") << "on negative side" ;
545  }
546  if (tTopo->tecSide(iidd) == 2) {
547  tmp = theLayerMeasurements.measurements(*tec9pos, tsosTEC9, prop, chi2Estimator);
548  //LogDebug("SiStripHitEfficiencyWorker") << "on positive side" ;
549  }
550 
551  if (!tmp.empty()) {
552  // take the last of the TMs, which is always an invalid hit
553  // if no detId is available, ie detId==0, then no compatible layer was crossed
554  // otherwise, use that TM for the efficiency measurement
555  const auto& tec9TM = tmp.back();
556  const auto& tec9Hit = tec9TM.recHit();
557 
558  const unsigned int tec9id = tec9Hit->geographicalId().rawId();
559  LogDebug("SiStripHitEfficiencyWorker")
560  << "tec9id = " << tec9id << " is Double sided = " << ::isDoubleSided(tec9id, tTopo)
561  << " and 0x3 = " << (tec9id & 0x3);
562 
563  if (tec9Hit->geographicalId().rawId() != 0) {
564  LogDebug("SiStripHitEfficiencyWorker") << "tec9 hit actually being added to TM vector";
565  // in tec the hit can be single or doubled sided. whenever the invalid hit at the end of vector of TMs is
566  // double sided it is always on the matched surface, so we need to split it into the true sensor surfaces
567  if (::isDoubleSided(tec9id, tTopo)) {
568  TMs.emplace_back(tec9TM, tTopo, tkgeom, propagator, 1);
569  TMs.emplace_back(tec9TM, tTopo, tkgeom, propagator, 2);
570  } else
571  TMs.emplace_back(tec9TM, tTopo, tkgeom, propagator);
572  }
573  } //else LogDebug("SiStripHitEfficiencyWorker") << "tec9 tmp empty" ;
574  }
575 
576  for (const auto& tm : TMs) {
577  fillForTraj(tm,
578  tTopo,
579  tkgeom,
580  stripcpe,
581  stripQuality,
582  *fedErrorIds,
583  commonModeDigis,
584  *theClusters,
585  e.bunchCrossing(),
586  instLumi,
587  PU,
588  highPurity);
589  }
590  LogDebug("SiStripHitEfficiencyWorker") << "After looping over TrajAtValidHit list";
591  }
592  LogDebug("SiStripHitEfficiencyWorker") << "end TMeasurement loop";
593  }
594  LogDebug("SiStripHitEfficiencyWorker") << "end of trajectories loop";
595  }
596 }
597 
599  const TrackerTopology* tTopo,
600  const TrackerGeometry* tkgeom,
601  const StripClusterParameterEstimator& stripCPE,
602  const SiStripQuality& stripQuality,
603  const DetIdCollection& fedErrorIds,
604  const edm::Handle<edm::DetSetVector<SiStripRawDigi>>& commonModeDigis,
605  const edmNew::DetSetVector<SiStripCluster>& theClusters,
606  int bunchCrossing,
607  float instLumi,
608  float PU,
609  bool highPurity) {
610  // --> Get trajectory from combinatedStat& e
611  const auto iidd = tm.monodet_id();
612  LogDebug("SiStripHitEfficiencyWorker") << "setting iidd = " << iidd << " before checking efficiency and ";
613 
614  const auto xloc = tm.localX();
615  const auto yloc = tm.localY();
616 
617  const auto xErr = tm.localErrorX();
618  const auto yErr = tm.localErrorY();
619 
620  int TrajStrip = -1;
621 
622  // reget layer from iidd here, to account for TOB 6 and TEC 9 TKlayers being off
623  const auto TKlayers = ::checkLayer(iidd, tTopo);
624 
625  const bool withinAcceptance =
626  tm.withinAcceptance() && (!::isInBondingExclusionZone(iidd, TKlayers, yloc, yErr, tTopo));
627 
628  if ( // (TKlayers > 0) && // FIXME confirm this
629  ((layers_ == TKlayers) ||
630  (layers_ == bounds::k_LayersStart))) { // Look at the layer not used to reconstruct the track
631  LogDebug("SiStripHitEfficiencyWorker") << "Looking at layer under study";
632  unsigned int ModIsBad = 2;
633  unsigned int SiStripQualBad = 0;
634  float commonMode = -100;
635 
636  // RPhi RecHit Efficiency
637 
638  if (!theClusters.empty()) {
639  LogDebug("SiStripHitEfficiencyWorker") << "Checking clusters with size = " << theClusters.size();
640  std::vector<::ClusterInfo> VCluster_info; //fill with X residual, X residual pull, local X
641  const auto idsv = theClusters.find(iidd);
642  if (idsv != theClusters.end()) {
643  //if (DEBUG_) LogDebug("SiStripHitEfficiencyWorker") << "the ID from the dsv = " << dsv.id() ;
644  LogDebug("SiStripHitEfficiencyWorker")
645  << "found (ClusterId == iidd) with ClusterId = " << idsv->id() << " and iidd = " << iidd;
646  const auto stripdet = dynamic_cast<const StripGeomDetUnit*>(tkgeom->idToDetUnit(DetId(iidd)));
647  const StripTopology& Topo = stripdet->specificTopology();
648 
649  float hbedge = 0.0;
650  float htedge = 0.0;
651  float hapoth = 0.0;
652  float uylfac = 0.0;
653  float uxlden = 0.0;
654  if (TKlayers > bounds::k_LayersAtTOBEnd) {
655  const BoundPlane& plane = stripdet->surface();
656  const TrapezoidalPlaneBounds* trapezoidalBounds(
657  dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
658  std::array<const float, 4> const& parameterTrap = (*trapezoidalBounds).parameters(); // el bueno aqui
659  hbedge = parameterTrap[0];
660  htedge = parameterTrap[1];
661  hapoth = parameterTrap[3];
662  uylfac = (htedge - hbedge) / (htedge + hbedge) / hapoth;
663  uxlden = 1 + yloc * uylfac;
664  }
665 
666  // Need to know position of trajectory in strip number for selecting the right APV later
667  if (TrajStrip == -1) {
668  int nstrips = Topo.nstrips();
669  float pitch = stripdet->surface().bounds().width() / nstrips;
670  TrajStrip = xloc / pitch + nstrips / 2.0;
671  // Need additionnal corrections for endcap
672  if (TKlayers > bounds::k_LayersAtTOBEnd) {
673  const float TrajLocXMid = xloc / (1 + (htedge - hbedge) * yloc / (htedge + hbedge) /
674  hapoth); // radialy extrapolated x loc position at middle
675  TrajStrip = TrajLocXMid / pitch + nstrips / 2.0;
676  }
677  //LogDebug("SiStripHitEfficiency")<<" Layer "<<TKlayers<<" TrajStrip: "<<nstrips<<" "<<pitch<<" "<<TrajStrip;;
678  }
679 
680  for (const auto& clus : *idsv) {
682  float res = (parameters.first.x() - xloc);
683  float sigma = ::checkConsistency(parameters, xloc, xErr);
684  // The consistency is probably more accurately measured with the Chi2MeasurementEstimator. To use it
685  // you need a TransientTrackingRecHit instead of the cluster
686  //theEstimator= new Chi2MeasurementEstimator(30);
687  //const Chi2MeasurementEstimator *theEstimator(100);
688  //theEstimator->estimate(tm.tsos(), TransientTrackingRecHit);
689 
690  if (TKlayers > bounds::k_LayersAtTOBEnd) {
691  res = parameters.first.x() - xloc / uxlden; // radialy extrapolated x loc position at middle
692  sigma = abs(res) / sqrt(parameters.second.xx() + xErr * xErr / uxlden / uxlden +
693  yErr * yErr * xloc * xloc * uylfac * uylfac / uxlden / uxlden / uxlden / uxlden);
694  }
695 
696  VCluster_info.emplace_back(res, sigma, parameters.first.x());
697 
698  LogDebug("SiStripHitEfficiencyWorker") << "Have ID match. residual = " << res << " res sigma = " << sigma;
699  //LogDebug("SiStripHitEfficiencyWorker")
700  // << "trajectory measurement compatability estimate = " << (*itm).estimate() ;
701  LogDebug("SiStripHitEfficiencyWorker")
702  << "hit position = " << parameters.first.x() << " hit error = " << sqrt(parameters.second.xx())
703  << " trajectory position = " << xloc << " traj error = " << xErr;
704  }
705  }
706  ::ClusterInfo finalCluster{1000.0, 1000.0, 0.0};
707  if (!VCluster_info.empty()) {
708  LogDebug("SiStripHitEfficiencyWorker") << "found clusters > 0";
709  if (VCluster_info.size() > 1) {
710  //get the smallest one
711  for (const auto& res : VCluster_info) {
712  if (std::abs(res.xResidualPull) < std::abs(finalCluster.xResidualPull)) {
713  finalCluster = res;
714  }
715  LogDebug("SiStripHitEfficiencyWorker")
716  << "iresidual = " << res.xResidual << " isigma = " << res.xResidualPull
717  << " and FinalRes = " << finalCluster.xResidual;
718  }
719  } else {
720  finalCluster = VCluster_info[0];
721  }
722  VCluster_info.clear();
723  }
724 
725  LogDebug("SiStripHitEfficiencyWorker") << "Final residual in X = " << finalCluster.xResidual << "+-"
726  << (finalCluster.xResidual / finalCluster.xResidualPull);
727  LogDebug("SiStripHitEfficiencyWorker")
728  << "Checking location of trajectory: abs(yloc) = " << abs(yloc) << " abs(xloc) = " << abs(xloc);
729 
730  //
731  // fill ntuple varibles
732 
733  //if ( stripQuality->IsModuleBad(iidd) )
734  if (stripQuality.getBadApvs(iidd) != 0) {
735  SiStripQualBad = 1;
736  LogDebug("SiStripHitEfficiencyWorker") << "strip is bad from SiStripQuality";
737  } else {
738  SiStripQualBad = 0;
739  LogDebug("SiStripHitEfficiencyWorker") << "strip is good from SiStripQuality";
740  }
741 
742  //check for FED-detected errors and include those in SiStripQualBad
743  for (unsigned int ii = 0; ii < fedErrorIds.size(); ii++) {
744  if (iidd == fedErrorIds[ii].rawId())
745  SiStripQualBad = 1;
746  }
747 
748  // CM of APV crossed by traj
749  if (addCommonMode_)
750  if (commonModeDigis.isValid() && TrajStrip >= 0 && TrajStrip <= 768) {
751  const auto digiframe = commonModeDigis->find(iidd);
752  if (digiframe != commonModeDigis->end())
753  if ((unsigned)TrajStrip / sistrip::STRIPS_PER_APV < digiframe->data.size())
754  commonMode = digiframe->data.at(TrajStrip / sistrip::STRIPS_PER_APV).adc();
755  }
756 
757  LogDebug("SiStripHitEfficiencyWorker") << "before check good";
758 
759  if (finalCluster.xResidualPull < 999.0) { //could make requirement on track/hit consistency, but for
760  //now take anything with a hit on the module
761  LogDebug("SiStripHitEfficiencyWorker")
762  << "hit being counted as good " << finalCluster.xResidual << " FinalRecHit " << iidd << " TKlayers "
763  << TKlayers << " xloc " << xloc << " yloc " << yloc << " module " << iidd
764  << " matched/stereo/rphi = " << ((iidd & 0x3) == 0) << "/" << ((iidd & 0x3) == 1) << "/"
765  << ((iidd & 0x3) == 2);
766  ModIsBad = 0;
767  } else {
768  LogDebug("SiStripHitEfficiencyWorker")
769  << "hit being counted as bad ######### Invalid RPhi FinalResX " << finalCluster.xResidual
770  << " FinalRecHit " << iidd << " TKlayers " << TKlayers << " xloc " << xloc << " yloc " << yloc
771  << " module " << iidd << " matched/stereo/rphi = " << ((iidd & 0x3) == 0) << "/" << ((iidd & 0x3) == 1)
772  << "/" << ((iidd & 0x3) == 2);
773  ModIsBad = 1;
774  LogDebug("SiStripHitEfficiencyWorker")
775  << " RPhi Error " << sqrt(xErr * xErr + yErr * yErr) << " ErrorX " << xErr << " yErr " << yErr;
776  }
777 
778  LogDebug("SiStripHitEfficiencyWorker")
779  << "To avoid them staying unused: ModIsBad=" << ModIsBad << ", SiStripQualBad=" << SiStripQualBad
780  << ", commonMode=" << commonMode << ", highPurity=" << highPurity
781  << ", withinAcceptance=" << withinAcceptance;
782 
783  unsigned int layer = TKlayers;
784  if (showRings_ && layer > bounds::k_LayersAtTOBEnd) { // use rings instead of wheels
785  if (layer <= bounds::k_LayersAtTIDEnd) { // TID
786  layer = bounds::k_LayersAtTOBEnd +
787  tTopo->tidRing(iidd); // ((iidd >> 9) & 0x3); // 3 disks and also 3 rings -> use the same container
788  } else { // TEC
789  layer = bounds::k_LayersAtTIDEnd + tTopo->tecRing(iidd); // ((iidd >> 5) & 0x7);
790  }
791  }
792  unsigned int layerWithSide = layer;
793  if (layer > bounds::k_LayersAtTOBEnd && layer <= bounds::k_LayersAtTIDEnd) {
794  const auto side = tTopo->tidSide(iidd); //(iidd >> 13) & 0x3; // TID
795  if (side == 2)
796  layerWithSide = layer + 3;
797  } else if (layer > bounds::k_LayersAtTIDEnd) {
798  const auto side = tTopo->tecSide(iidd); // (iidd >> 18) & 0x3; // TEC
799  if (side == 1) {
800  layerWithSide = layer + 3;
801  } else if (side == 2) {
802  layerWithSide = layer + 3 + (showRings_ ? 7 : 9);
803  }
804  }
805 
806  if ((bunchX_ > 0 && bunchX_ != bunchCrossing) || (!withinAcceptance) ||
808  (!showTOB6TEC9_ && (TKlayers == bounds::k_LayersAtTOBEnd || TKlayers == bounds::k_LayersAtTECEnd)) ||
809  (badModules_.end() != badModules_.find(iidd)))
810  return;
811 
812  const bool badquality = (SiStripQualBad == 1);
813 
814  //Now that we have a good event, we need to look at if we expected it or not, and the location
815  //if we didn't
816  //Fill the missing hit information first
817  bool badflag = false; // true for hits that are expected but not found
818  if (resXSig_ < 0) {
819  if (ModIsBad == 1)
820  badflag = true; // isBad set to false in the tree when resxsig<999.0
821  } else {
822  if (ModIsBad == 1 || finalCluster.xResidualPull > resXSig_)
823  badflag = true;
824  }
825 
826  // Conversion of positions in strip unit
827  int nstrips = -9;
828  float Pitch = -9.0;
829  const StripGeomDetUnit* stripdet = nullptr;
830  if (finalCluster.xResidualPull ==
831  1000.0) { // special treatment, no GeomDetUnit associated in some cases when no cluster found
832  Pitch = 0.0205; // maximum
833  nstrips = 768; // maximum
834  } else {
835  stripdet = dynamic_cast<const StripGeomDetUnit*>(tkgeom->idToDetUnit(iidd));
836  const StripTopology& Topo = stripdet->specificTopology();
837  nstrips = Topo.nstrips();
838  Pitch = stripdet->surface().bounds().width() / Topo.nstrips();
839  }
840  double stripTrajMid = xloc / Pitch + nstrips / 2.0;
841  double stripCluster = finalCluster.xLocal / Pitch + nstrips / 2.0;
842  // For trapezoidal modules: extrapolation of x trajectory position to the y middle of the module
843  // for correct comparison with cluster position
844  if (stripdet && layer > bounds::k_LayersAtTOBEnd) {
845  const auto& trapezoidalBounds = dynamic_cast<const TrapezoidalPlaneBounds&>(stripdet->surface().bounds());
846  std::array<const float, 4> const& parameters = trapezoidalBounds.parameters();
847  const float hbedge = parameters[0];
848  const float htedge = parameters[1];
849  const float hapoth = parameters[3];
850  const float TrajLocXMid = xloc / (1 + (htedge - hbedge) * yloc / (htedge + hbedge) /
851  hapoth); // radialy extrapolated x loc position at middle
852  stripTrajMid = TrajLocXMid / Pitch + nstrips / 2.0;
853  }
854 
855  if ((!badquality) && (layer < h_resolution.size())) {
856  LogDebug("SiStripHitEfficiencyWorker")
857  << "layer " << layer << " vector index " << layer - 1 << " before filling h_resolution" << std::endl;
858  h_resolution[layer - 1]->Fill(finalCluster.xResidualPull != 1000.0 ? stripTrajMid - stripCluster : 1000);
859  }
860 
861  // New matching methods
862  if (clusterMatchingMethod_ >= 1) {
863  badflag = false;
864  if (finalCluster.xResidualPull == 1000.0) {
865  LogDebug("SiStripHitEfficiencyWorker") << "Marking bad for resxsig=1000";
866  badflag = true;
867  } else {
869  // check the distance between cluster and trajectory position
870  if (std::abs(stripCluster - stripTrajMid) > clusterTracjDist_) {
871  LogDebug("SiStripHitEfficiencyWorker") << "Marking bad for cluster-to-traj distance";
872  badflag = true;
873  }
874  }
876  // cluster and traj have to be in the same APV (don't take edges into accounts)
877  const int tapv = (int)stripTrajMid / sistrip::STRIPS_PER_APV;
878  const int capv = (int)stripCluster / sistrip::STRIPS_PER_APV;
879  float stripInAPV = stripTrajMid - tapv * sistrip::STRIPS_PER_APV;
880  if (stripInAPV < stripsApvEdge_ || stripInAPV > sistrip::STRIPS_PER_APV - stripsApvEdge_) {
881  LogDebug("SiStripHitEfficiencyWorker") << "Too close to the edge: " << stripInAPV;
882  return;
883  }
884  if (tapv != capv) {
885  LogDebug("SiStripHitEfficiencyWorker") << "Marking bad for tapv!=capv";
886  badflag = true;
887  }
888  }
889  }
890  }
891  if (!badquality) {
892  LogDebug("SiStripHitEfficiencyWorker")
893  << "Filling measurement for " << iidd << " in layer " << layer << " histograms with bx=" << bunchCrossing
894  << ", lumi=" << instLumi << ", PU=" << PU << "; bad flag=" << badflag;
895 
896  // hot/cold maps of hits that are expected but not found
897  if (badflag) {
898  if (layer > bounds::k_LayersStart && layer <= bounds::k_LayersAtTIBEnd) {
899  //We are in the TIB
900  float phi = ::calcPhi(tm.globalX(), tm.globalY());
901  h_hotcold[layer - 1]->Fill(360. - phi, tm.globalZ(), 1.);
902  } else if (layer > bounds::k_LayersAtTIBEnd && layer <= bounds::k_LayersAtTOBEnd) {
903  //We are in the TOB
904  float phi = ::calcPhi(tm.globalX(), tm.globalY());
905  h_hotcold[layer - 1]->Fill(360. - phi, tm.globalZ(), 1.);
906  } else if (layer > bounds::k_LayersAtTOBEnd && layer <= bounds::k_LayersAtTIDEnd) {
907  //We are in the TID
908  //There are 2 different maps here
909  int side = tTopo->tidSide(iidd);
910  if (side == 1)
911  h_hotcold[(layer - 1) + (layer - 11)]->Fill(-tm.globalY(), tm.globalX(), 1.);
912  else if (side == 2)
913  h_hotcold[(layer - 1) + (layer - 10)]->Fill(-tm.globalY(), tm.globalX(), 1.);
914  } else if (layer > bounds::k_LayersAtTIDEnd) {
915  //We are in the TEC
916  //There are 2 different maps here
917  int side = tTopo->tecSide(iidd);
918  if (side == 1)
919  h_hotcold[(layer + 2) + (layer - 14)]->Fill(-tm.globalY(), tm.globalX(), 1.);
920  else if (side == 2)
921  h_hotcold[(layer + 2) + (layer - 13)]->Fill(-tm.globalY(), tm.globalX(), 1.);
922  }
923  }
924 
925  LogDebug("SiStripHitEfficiencyWorker")
926  << "layer " << layer << " vector index " << layer - 1 << " before filling h_layer_vsSmthg" << std::endl;
927  h_layer_vsBx[layer - 1].fill(bunchCrossing, !badflag);
928  if (addLumi_) {
929  h_layer_vsLumi[layer - 1].fill(instLumi, !badflag);
930  h_layer_vsPU[layer - 1].fill(PU, !badflag);
931  }
932  if (addCommonMode_) {
933  h_layer_vsCM[layer - 1].fill(commonMode, !badflag);
934  }
935  h_goodLayer.fill(layerWithSide, !badflag);
936 
937  // efficiency with bad modules excluded
938  if (TKlayers) {
939  h_module.fill(iidd, !badflag);
940  }
941  }
942  // efficiency without bad modules excluded
943  h_allLayer.fill(layerWithSide, !badflag);
944 
945  /* Used in SiStripHitEffFromCalibTree:
946  * run -> "run" -> run // e.id().run()
947  * event -> "event" -> evt // e.id().event()
948  * ModIsBad -> "ModIsBad" -> isBad
949  * SiStripQualBad -> "SiStripQualBad"" -> quality
950  * Id -> "Id" -> id // iidd
951  * withinAcceptance -> "withinAcceptance" -> accept
952  * whatlayer -> "layer" -> layer_wheel // Tklayers
953  * highPurity -> "highPurity" -> highPurity
954  * TrajGlbX -> "TrajGlbX" -> x // tm.globalX()
955  * TrajGlbY -> "TrajGlbY" -> y // tm.globalY()
956  * TrajGlbZ -> "TrajGlbZ" -> z // tm.globalZ()
957  * ResXSig -> "ResXSig" -> resxsig // finalCluster.xResidualPull;
958  * TrajLocX -> "TrajLocX" -> TrajLocX // xloc
959  * TrajLocY -> "TrajLocY" -> TrajLocY // yloc
960  * ClusterLocX -> "ClusterLocX" -> ClusterLocX // finalCluster.xLocal
961  * bunchx -> "bunchx" -> bx // e.bunchCrossing()
962  * instLumi -> "instLumi" -> instLumi ## if addLumi_
963  * PU -> "PU" -> PU ## if addLumi_
964  * commonMode -> "commonMode" -> CM ## if addCommonMode_ / _useCM
965  */
966  LogDebug("SiStripHitEfficiencyWorker") << "after good location check";
967  }
968  LogDebug("SiStripHitEfficiencyWorker") << "after list of clusters";
969  }
970  LogDebug("SiStripHitEfficiencyWorker") << "After layers=TKLayers if with TKlayers=" << TKlayers
971  << ", layers=" << layers_;
972 }
973 
975  LogDebug("SiStripHitEfficiencyWorker") << " Events Analysed " << events;
976  LogDebug("SiStripHitEfficiencyWorker") << " Number Of Tracked events " << EventTrackCKF;
977 }
978 
981  desc.add<std::string>("dqmDir", "AlCaReco/SiStripHitEfficiency");
982  desc.add<bool>("UseOnlyHighPurityTracks", true);
983  desc.add<bool>("cutOnTracks", false);
984  desc.add<bool>("useAllHitsFromTracksWithMissingHits", false);
985  desc.add<bool>("useFirstMeas", false);
986  desc.add<bool>("useLastMeas", false);
987  desc.add<double>("ClusterTrajDist", 64.0);
988  desc.add<double>("ResXSig", -1);
989  desc.add<double>("StripsApvEdge", 10.0);
990  desc.add<edm::InputTag>("combinatorialTracks", edm::InputTag{"generalTracks"});
991  desc.add<edm::InputTag>("commonMode", edm::InputTag{"siStripDigis", "CommonMode"});
992  desc.add<edm::InputTag>("lumiScalers", edm::InputTag{"scalersRawToDigi"});
993  desc.add<edm::InputTag>("siStripClusters", edm::InputTag{"siStripClusters"});
994  desc.add<edm::InputTag>("siStripDigis", edm::InputTag{"siStripDigis"});
995  desc.add<edm::InputTag>("trackerEvent", edm::InputTag{"MeasurementTrackerEvent"});
996  desc.add<edm::InputTag>("trajectories", edm::InputTag{"generalTracks"});
997  desc.add<int>("ClusterMatchingMethod", 0);
998  desc.add<int>("Layer", 0);
999  desc.add<unsigned int>("trackMultiplicity", 100);
1000  desc.addUntracked<bool>("Debug", false);
1001  desc.addUntracked<bool>("ShowRings", false);
1002  desc.addUntracked<bool>("ShowTOB6TEC9", false);
1003  desc.addUntracked<bool>("addCommonMode", false);
1004  desc.addUntracked<bool>("addLumi", true);
1005  desc.addUntracked<int>("BunchCrossing", 0);
1006  desc.addUntracked<std::string>("BadModulesFile", "");
1007  descriptions.addWithDefaultLabel(desc);
1008 }
1009 
std::pair< LocalPoint, LocalError > LocalValues
const edm::ESGetToken< MeasurementTracker, CkfComponentsRecord > measTrackerToken_
virtual int nstrips() const =0
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
void fill(double x, bool found, float weight=1.)
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
constexpr char const * layerName[numberOfLayers]
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
std::vector< MonitorElement * > h_resolution
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
EffME1(MonitorElement *total, MonitorElement *found)
const edm::EDGetTokenT< std::vector< Trajectory > > trajectories_token_
std::vector< MonitorElement * > h_hotcold
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
void bookHistograms(DQMStore::IBooker &booker, const edm::Run &run, const edm::EventSetup &setup) override
unsigned int tidSide(const DetId &id) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
unsigned int monodet_id() const
Definition: weight.py:1
const edm::EDGetTokenT< DetIdCollection > digis_token_
unsigned int tecRing(const DetId &id) const
ring id
Definition: Electron.h:6
missing
Definition: combine.py:5
const edm::EDGetTokenT< MeasurementTrackerEvent > trackerEvent_token_
constexpr std::array< uint8_t, layerIndexSize > layer
const_iterator end(bool update=false) const
~SiStripHitEfficiencyWorker() override=default
void Fill(long long x)
const edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapToken_
void fillForTraj(const TrajectoryAtInvalidHit &tm, const TrackerTopology *tTopo, const TrackerGeometry *tkgeom, const StripClusterParameterEstimator &stripCPE, const SiStripQuality &stripQuality, const DetIdCollection &fedErrorIds, const edm::Handle< edm::DetSetVector< SiStripRawDigi >> &commonModeDigis, const edmNew::DetSetVector< SiStripCluster > &theClusters, int bunchCrossing, float instLumi, float PU, bool highPurity)
const edm::ESGetToken< StripClusterParameterEstimator, TkStripCPERecord > stripCPEToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > propagatorToken_
const edm::ESGetToken< Chi2MeasurementEstimatorBase, TrackingComponentsRecord > chi2EstimatorToken_
unsigned int tecSide(const DetId &id) const
EffTkMap(std::unique_ptr< TkHistoMap > &&total, std::unique_ptr< TkHistoMap > &&found)
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:399
T sqrt(T t)
Definition: SSEVec.h:19
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
ii
Definition: cuy.py:589
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magFieldToken_
SiStripHitEfficiencyWorker(const edm::ParameterSet &conf)
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: DetId.h:17
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
size_type size() const
const edm::EDGetTokenT< TrajTrackAssociationCollection > trajTrackAsso_token_
Constants and enumerated types for FED/FEC systems.
part
Definition: HCALResponse.h:20
virtual const std::array< const float, 4 > parameters() const
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:212
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusters_token_
fixed size matrix
HLT enums.
const_iterator find(id_type i, bool update=false) const
size_type size() const
Definition: EDCollection.h:82
static const uint16_t STRIPS_PER_APV
const edm::EDGetTokenT< reco::TrackCollection > combinatorialTracks_token_
const edm::ESGetToken< SiStripQuality, SiStripQualityRcd > stripQualityToken_
const edm::EDGetTokenT< LumiScalersCollection > scalerToken_
unsigned int tidRing(const DetId &id) const
std::vector< LumiScalers > LumiScalersCollection
Definition: LumiScalers.h:144
void fill(uint32_t id, bool found, float weight=1.)
const edm::EDGetTokenT< edm::DetSetVector< SiStripRawDigi > > commonModeToken_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
A Digi for the silicon strip detector, containing only adc information, and suitable for storing raw ...
tmp
align.sh
Definition: createJobs.py:716
virtual float width() const =0
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45
#define LogDebug(id)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
short getBadApvs(uint32_t detid) const
const Bounds & bounds() const
Definition: Surface.h:87