CMS 3D CMS Logo

SiStripLorentzAnglePCLMonitor.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CalibTracker/SiStripLorentzAnglePCLMonitor
4 // Class: SiStripLorentzAnglePCLMonitor
5 //
13 //
14 // Original Author: musich
15 // Created: Sun, 07 May 2023 16:57:10 GMT
16 //
17 //
18 
19 // system includes
20 #include <string>
21 #include <fmt/format.h>
22 #include <fmt/printf.h>
23 
24 // user include files
53 
54 // ROOT includes
55 #include "TVector3.h"
56 
57 //
58 // class declaration
59 //
60 
62 public:
64  ~SiStripLorentzAnglePCLMonitor() override = default;
65 
66  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
67 
68 private:
69  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
70  void analyze(const edm::Event&, const edm::EventSetup&) override;
71  void dqmBeginRun(edm::Run const&, edm::EventSetup const&) override;
72 
73  std::string moduleLocationType(const uint32_t& mod, const TrackerTopology* tTopo);
74 
75  // ------------ member data ------------
79 
80  // for magnetic field conversion
81  static constexpr float teslaToInverseGeV_ = 2.99792458e-3f;
82 
86  const bool saveHistosMods_;
90 
96 
97  struct OnTrackCluster {
98  uint32_t det;
100  const Trajectory* traj;
105  const Trajectory* trajectory,
106  const reco::Track* track_,
107  const TrajectoryMeasurement& measurement_)
108  : det{detId}, cluster{stripCluster}, traj{trajectory}, track{track_}, measurement{measurement_} {}
109  };
110 };
111 
113  : m_clusterInfo(consumesCollector()),
114  mismatchedBField_{false},
115  mismatchedLatency_{false},
116  folder_(iConfig.getParameter<std::string>("folder")),
117  saveHistosMods_(iConfig.getParameter<bool>("saveHistoMods")),
118  m_tracks_token(consumes<edm::View<reco::Track>>(iConfig.getParameter<edm::InputTag>("Tracks"))),
119  m_association_token(consumes<TrajTrackAssociationCollection>(iConfig.getParameter<edm::InputTag>("Tracks"))),
120  m_tkGeomToken{esConsumes<>()},
121  m_latencyTokenBR{esConsumes<edm::Transition::BeginRun>()},
122  m_topoEsTokenBR{esConsumes<edm::Transition::BeginRun>()},
123  m_tkGeomTokenBR{esConsumes<edm::Transition::BeginRun>()},
124  m_magFieldTokenBR{esConsumes<edm::Transition::BeginRun>()},
125  m_lorentzAngleTokenBR{esConsumes<edm::Transition::BeginRun>()} {}
126 //
127 // member functions
128 //
129 
131  const auto& tkGeom = iSetup.getData(m_tkGeomTokenBR);
132  const auto& magField = iSetup.getData(m_magFieldTokenBR);
133  const auto& lorentzAngle = iSetup.getData(m_lorentzAngleTokenBR);
134  const TrackerTopology* tTopo = &iSetup.getData(m_topoEsTokenBR);
135 
136  // fast cachecd access
137  const auto& theMagField = 1.f / (magField.inverseBzAtOriginInGeV() * teslaToInverseGeV_);
138 
139  if (iHists_.bfield_.empty()) {
141  } else {
143  mismatchedBField_ = true;
144  }
145  }
146 
147  const SiStripLatency* apvlat = &iSetup.getData(m_latencyTokenBR);
148  if (iHists_.apvmode_.empty()) {
150  } else {
152  mismatchedLatency_ = true;
153  }
154  }
155 
156  std::vector<uint32_t> c_rawid;
157  std::vector<float> c_globalZofunitlocalY, c_localB, c_BdotY, c_driftx, c_drifty, c_driftz, c_lorentzAngle;
158 
159  auto dets = tkGeom.detsTIB();
160  //dets.insert(dets.end(), tkGeom.detsTID().begin(), tkGeom.detsTID().end()); // no LA in endcaps
161  dets.insert(dets.end(), tkGeom.detsTOB().begin(), tkGeom.detsTOB().end());
162  //dets.insert(dets.end(), tkGeom.detsTEC().begin(), tkGeom.detsTEC().end()); // no LA in endcaps
163 
164  for (auto det : dets) {
165  auto detid = det->geographicalId().rawId();
166  const StripGeomDetUnit* stripDet = dynamic_cast<const StripGeomDetUnit*>(tkGeom.idToDet(det->geographicalId()));
167  if (stripDet) {
168  c_rawid.push_back(detid);
169  c_globalZofunitlocalY.push_back(stripDet->toGlobal(LocalVector(0, 1, 0)).z());
170  iHists_.orientation_[detid] = (stripDet->toGlobal(LocalVector(0, 1, 0)).z() < 0 ? -1 : 1);
171  const auto locB = magField.inTesla(stripDet->surface().position());
172  c_localB.push_back(locB.mag());
173  c_BdotY.push_back(stripDet->surface().toLocal(locB).y());
174  const auto drift = shallow::drift(stripDet, magField, lorentzAngle);
175  c_driftx.push_back(drift.x());
176  c_drifty.push_back(drift.y());
177  c_driftz.push_back(drift.z());
178  c_lorentzAngle.push_back(lorentzAngle.getLorentzAngle(detid));
179  iHists_.la_db_[detid] = lorentzAngle.getLorentzAngle(detid);
180  iHists_.moduleLocationType_[detid] = this->moduleLocationType(detid, tTopo);
181  }
182  }
183 
184  // Sorted DetId list gives max performance, anything else is worse
185  std::sort(c_rawid.begin(), c_rawid.end());
186 
187  // initialized the hash map
188  m_hash = SiStripHashedDetId(c_rawid);
189 
190  //reserve the size of the vector
191  iHists_.h2_ct_w_m_.reserve(c_rawid.size());
192  iHists_.h2_ct_var2_m_.reserve(c_rawid.size());
193  iHists_.h2_ct_var3_m_.reserve(c_rawid.size());
194 
195  iHists_.h2_t_w_m_.reserve(c_rawid.size());
196  iHists_.h2_t_var2_m_.reserve(c_rawid.size());
197  iHists_.h2_t_var3_m_.reserve(c_rawid.size());
198 }
199 
201  const SiStripDetId detid(mod);
202  std::string subdet = "";
203  unsigned int layer = 0;
204  if (detid.subDetector() == SiStripDetId::TIB) {
205  subdet = "TIB";
206  layer = tTopo->layer(mod);
207  }
208 
209  if (detid.subDetector() == SiStripDetId::TOB) {
210  subdet = "TOB";
211  layer = tTopo->layer(mod);
212  }
213 
214  std::string type = (detid.stereo() ? "s" : "a");
215  std::string d_l_t = Form("%s_L%d%s", subdet.c_str(), layer, type.c_str());
216 
217  if (layer == 0)
218  return subdet;
219  return d_l_t;
220 }
221 
222 // ------------ method called for each event ------------
224  using namespace edm;
225 
226  // return immediately if the field is not consistent!
227  if (mismatchedBField_)
228  return;
229 
230  if (mismatchedLatency_)
231  return;
232 
234  iEvent.getByToken(m_tracks_token, tracks);
235  edm::Handle<TrajTrackAssociationCollection> trajTrackAssociations;
236  iEvent.getByToken(m_association_token, trajTrackAssociations);
237 
238  LogDebug(moduleDescription().moduleName()) << "I AM IN EVENT" << iEvent.id() << std::endl;
239 
240  std::vector<OnTrackCluster> clusters{};
241 
242  // first collect all the clusters
243  for (const auto& assoc : *trajTrackAssociations) {
244  const auto traj = assoc.key.get();
245  const auto track = assoc.val.get();
246 
247  iHists_.h1_["track_pt"]->Fill(track->pt());
248  iHists_.h1_["track_eta"]->Fill(track->eta());
249  iHists_.h1_["track_phi"]->Fill(track->phi());
250  iHists_.h1_["track_validhits"]->Fill(track->numberOfValidHits());
251  iHists_.h1_["track_chi2ndof"]->Fill((track->chi2() / track->ndof()));
252  iHists_.h2_["track_chi2xhits"]->Fill((track->chi2() / track->ndof()), track->numberOfValidHits());
253  iHists_.h2_["track_ptxhits"]->Fill(track->pt(), track->numberOfValidHits());
254  iHists_.h2_["track_etaxhits"]->Fill(track->eta(), track->numberOfValidHits());
255  iHists_.h2_["track_ptxchi2"]->Fill(track->pt(), (track->chi2() / track->ndof()));
256  iHists_.h2_["track_ptxeta"]->Fill(track->pt(), track->eta());
257  iHists_.h2_["track_etaxchi2"]->Fill(track->eta(), (track->chi2() / track->ndof()));
258 
259  edm::LogInfo("SiStripLorentzAnglePCLMonitor")
260  << " track pT()" << track->pt() << " track eta()" << track->eta() << std::endl;
261 
262  for (const auto& meas : traj->measurements()) {
263  const auto& trajState = meas.updatedState();
264  if (!trajState.isValid())
265  continue;
266 
267  // there can be 2 (stereo module), 1 (no stereo module), or 0 (no strip hit) clusters per measurement
268  const auto trechit = meas.recHit()->hit();
269  const auto simple1d = dynamic_cast<const SiStripRecHit1D*>(trechit);
270  const auto simple = dynamic_cast<const SiStripRecHit2D*>(trechit);
271  const auto matched = dynamic_cast<const SiStripMatchedRecHit2D*>(trechit);
272  if (matched) {
273  clusters.emplace_back(matched->monoId(), &matched->monoCluster(), traj, track, meas);
274  clusters.emplace_back(matched->stereoId(), &matched->stereoCluster(), traj, track, meas);
275  } else if (simple) {
276  clusters.emplace_back(simple->geographicalId().rawId(), simple->cluster().get(), traj, track, meas);
277  } else if (simple1d) {
278  clusters.emplace_back(simple1d->geographicalId().rawId(), simple1d->cluster().get(), traj, track, meas);
279  }
280  }
281  }
282 
283  for (const auto clus : clusters) {
284  uint32_t c_nstrips = clus.cluster->amplitudes().size();
285  m_clusterInfo.setCluster(*clus.cluster, clus.det);
286  float c_variance = m_clusterInfo.variance();
287  const auto& trajState = clus.measurement.updatedState();
288  const auto trackDir = trajState.localDirection();
289  float c_localdirx = trackDir.x();
290  float c_localdiry = trackDir.y();
291  float c_localdirz = trackDir.z();
292  const auto hit = clus.measurement.recHit()->hit();
293 
294  // not yet needed (might be used for Backplane correction later on
295  /*
296  const auto& tkGeom = iSetup.getData(m_tkGeomToken);
297  const auto stripDet = dynamic_cast<const StripGeomDetUnit*>(tkGeom.idToDet(hit->geographicalId()));
298  float c_barycenter = stripDet->specificTopology().localPosition(clus.cluster->barycenter()).x();
299  float c_localx = stripDet->toLocal(trajState.globalPosition()).x();
300  float c_rhlocalx = hit->localPosition().x();
301  float c_rhlocalxerr = hit->localPositionError().xx();
302  */
303 
304  const uint32_t mod = hit->geographicalId().rawId();
305 
306  std::string locationtype = iHists_.moduleLocationType_[mod];
307  if (locationtype.empty())
308  return;
309 
310  const auto& hashedIndex = m_hash.hashedIndex(mod);
311 
312  TVector3 localdir(c_localdirx, c_localdiry, c_localdirz);
313  int sign = iHists_.orientation_[mod];
314  float tantheta = TMath::Tan(localdir.Theta());
315  float cosphi = TMath::Cos(localdir.Phi());
316  float theta = localdir.Theta();
317 
318  iHists_.h1_[Form("%s_nstrips", locationtype.c_str())]->Fill(c_nstrips);
319  iHists_.h1_[Form("%s_tanthetatrk", locationtype.c_str())]->Fill(sign * tantheta);
320  iHists_.h1_[Form("%s_cosphitrk", locationtype.c_str())]->Fill(cosphi);
321 
322  // nstrips
323  iHists_.h2_[Form("%s_tanthcosphtrk_nstrip", locationtype.c_str())]->Fill(sign * cosphi * tantheta, c_nstrips);
324  iHists_.h2_[Form("%s_thetatrk_nstrip", locationtype.c_str())]->Fill(sign * theta * cosphi, c_nstrips);
325 
326  // variance for width == 2
327  if (c_nstrips == 2) {
328  iHists_.h1_[Form("%s_variance_w2", locationtype.c_str())]->Fill(c_variance);
329  iHists_.h2_[Form("%s_tanthcosphtrk_var2", locationtype.c_str())]->Fill(sign * cosphi * tantheta, c_variance);
330  iHists_.h2_[Form("%s_thcosphtrk_var2", locationtype.c_str())]->Fill(sign * cosphi * theta, c_variance);
331 
332  // not in PCL
333  if (saveHistosMods_) {
334  iHists_.h2_ct_var2_m_[hashedIndex]->Fill(sign * cosphi * tantheta, c_variance);
335  iHists_.h2_t_var2_m_[hashedIndex]->Fill(sign * cosphi * theta, c_variance);
336  }
337  }
338  // variance for width == 3
339  if (c_nstrips == 3) {
340  iHists_.h1_[Form("%s_variance_w3", locationtype.c_str())]->Fill(c_variance);
341  iHists_.h2_[Form("%s_tanthcosphtrk_var3", locationtype.c_str())]->Fill(sign * cosphi * tantheta, c_variance);
342  iHists_.h2_[Form("%s_thcosphtrk_var3", locationtype.c_str())]->Fill(sign * cosphi * theta, c_variance);
343 
344  // not in PCL
345  if (saveHistosMods_) {
346  iHists_.h2_ct_var3_m_[hashedIndex]->Fill(sign * cosphi * tantheta, c_variance);
347  iHists_.h2_t_var3_m_[hashedIndex]->Fill(sign * cosphi * theta, c_variance);
348  }
349  }
350  // not in PCL
351  if (saveHistosMods_) {
352  iHists_.h2_ct_w_m_[hashedIndex]->Fill(sign * cosphi * tantheta, c_nstrips);
353  iHists_.h2_t_w_m_[hashedIndex]->Fill(sign * cosphi * theta, c_nstrips);
354  }
355  }
356 }
357 
359  edm::Run const& run,
360  edm::EventSetup const& iSetup) {
361  std::string bvalue = (iHists_.bfield_ == "3.8") ? "B-ON" : "B-OFF";
362  std::string folderToBook = fmt::format("{}/{}_{}", folder_, bvalue, iHists_.apvmode_);
363 
364  ibook.setCurrentFolder(folderToBook);
365  edm::LogPrint(moduleDescription().moduleName()) << "booking in " << folderToBook;
366 
367  // prepare track histograms
368  // clang-format off
369  iHists_.h1_["track_pt"] = ibook.book1D("track_pt", "track p_{T};track p_{T} [GeV];n. tracks", 2000, 0, 1000);
370  iHists_.h1_["track_eta"] = ibook.book1D("track_eta", "track #eta;track #eta;n. tracks", 100, -4, 4);
371  iHists_.h1_["track_phi"] = ibook.book1D("track_phi", "track #phi;track #phi;n. tracks", 80, -3.2, 3.2);
372  iHists_.h1_["track_validhits"] =
373  ibook.book1D("track_validhits", "track n. valid hits;track n. valid hits;n. tracks", 50, 0, 50);
374  iHists_.h1_["track_chi2ndof"] =
375  ibook.book1D("track_chi2ndof", "track #chi^{2}/ndf;track #chi^{2}/ndf;n. tracks", 100, 0, 5);
376  iHists_.h2_["track_chi2xhits"] =
377  ibook.book2D("track_chi2xhits_2d",
378  "track track n. hits vs track #chi^{2}/ndf;track #chi^{2};track n. valid hits;tracks",
379  100, 0, 5, 50, 0, 50);
380  iHists_.h2_["track_ptxhits"] = ibook.book2D(
381  "track_ptxhits_2d", "track n. hits vs p_{T};track p_{T} [GeV];track n. valid hits;tracks", 200, 0, 100, 50, 0, 50);
382  iHists_.h2_["track_etaxhits"] = ibook.book2D(
383  "track_etaxhits_2d", "track n. hits vs track #eta;track #eta;track n. valid hits;tracks", 60, -3, 3, 50, 0, 50);
384  iHists_.h2_["track_ptxchi2"] =
385  ibook.book2D("track_ptxchi2_2d",
386  "track #chi^{2}/ndf vs track p_{T};track p_{T} [GeV]; track #chi^{2}/ndf;tracks",
387  200, 0, 100, 100, 0, 5);
388  iHists_.h2_["track_ptxeta"] = ibook.book2D(
389  "track_ptxeta_2d", "track #eta vs track p_{T};track p_{T} [GeV];track #eta;tracks", 200, 0, 100, 60, -3, 3);
390  iHists_.h2_["track_etaxchi2"] = ibook.book2D(
391  "track_etaxchi2_2d", "track #chi^{2}/ndf vs track #eta;track #eta;track #chi^{2};tracks", 60, -3, 3, 100, 0, 5);
392  // clang-format on
393 
394  // fill in the module types
395  iHists_.nlayers_["TIB"] = 4;
396  iHists_.nlayers_["TOB"] = 6;
397  iHists_.modtypes_.push_back("s");
398  iHists_.modtypes_.push_back("a");
399 
400  // prepare type histograms
401  for (auto& layers : iHists_.nlayers_) {
402  std::string subdet = layers.first;
403  for (int l = 1; l <= layers.second; ++l) {
404  ibook.setCurrentFolder(folderToBook + Form("/%s/L%d", subdet.c_str(), l));
405  for (auto& t : iHists_.modtypes_) {
406  // do not fill stereo where there aren't
407  if (l > 2 && t == "s")
408  continue;
409  std::string locType = Form("%s_L%d%s", subdet.c_str(), l, t.c_str());
410 
411  // clang-format off
412  const char* titles = Form("n.strips in %s;n.strips;n. clusters", locType.c_str());
413  iHists_.h1_[Form("%s_nstrips", locType.c_str())] = ibook.book1D(Form("%s_nstrips", locType.c_str()), titles, 20, 0, 20);
414 
415  titles = Form("tan(#theta_{trk}) in %s;tan(#theta_{trk});n. clusters", locType.c_str());
416  iHists_.h1_[Form("%s_tanthetatrk", locType.c_str())] = ibook.book1D(Form("%s_tanthetatrk", locType.c_str()), titles, 300, -1.5, 1.5);
417 
418  titles = Form("cos(#phi_{trk}) in %s;cos(#phi_{trk});n. clusters", locType.c_str());
419  iHists_.h1_[Form("%s_cosphitrk", locType.c_str())] = ibook.book1D(Form("%s_cosphitrk", locType.c_str()), titles, 40, -1, 1);
420 
421  titles = Form("Cluster variance (w=2) in %s;cluster variance (w=2);n. clusters", locType.c_str());
422  iHists_.h1_[Form("%s_variance_w2", locType.c_str())] = ibook.book1D(Form("%s_variance_w2", locType.c_str()), titles, 100, 0, 1);
423 
424  titles = Form("Cluster variance (w=3) in %s;cluster variance (w=3);n. clusters", locType.c_str());
425  iHists_.h1_[Form("%s_variance_w3", locType.c_str())] = ibook.book1D(Form("%s_variance_w3", locType.c_str()), titles, 100, 0, 1);
426 
427  titles = Form("tan(#theta_{trk})cos(#phi_{trk}) vs n. strips in %s;n. strips;tan(#theta_{trk})cos(#phi_{trk});n. clusters", locType.c_str());
428  iHists_.h2_[Form("%s_tanthcosphtrk_nstrip", locType.c_str())] = ibook.book2D(Form("%s_tanthcosphtrk_nstrip", locType.c_str()), titles, 360, -0.9, 0.9, 20, 0, 20);
429 
430  titles = Form("#theta_{trk} vs n. strips in %s;n. strips;#theta_{trk} [rad];n. clusters", locType.c_str());
431  iHists_.h2_[Form("%s_thetatrk_nstrip", locType.c_str())] = ibook.book2D(Form("%s_thetatrk_nstrip", locType.c_str()), titles, 360, -0.9, 0.9, 20, 0, 20);
432 
433  titles = Form("tan(#theta_{trk})cos(#phi_{trk}) vs cluster variance (w=2) in %s;cluster variance (w=2);tan(#theta_{trk})cos(#phi_{trk});n. clusters", locType.c_str());
434  iHists_.h2_[Form("%s_tanthcosphtrk_var2", locType.c_str())] = ibook.book2D(Form("%s_tanthcosphtrk_var2", locType.c_str()), titles, 360, -0.9, 0.9, 50, 0, 1);
435 
436  titles = Form("tan(#theta_{trk})cos(#phi_{trk}) vs cluster variance (w=3) in %s;cluster variance (w=3);tan(#theta_{trk})cos(#phi_{trk});n. clusters", locType.c_str());
437  iHists_.h2_[Form("%s_tanthcosphtrk_var3", locType.c_str())] = ibook.book2D(Form("%s_tanthcosphtrk_var3", locType.c_str()), titles, 360, -0.9, 0.9, 50, 0, 1);
438 
439  titles = Form("#theta_{trk}cos(#phi_{trk}) vs cluster variance (w=2) in %s;cluster variance (w=2);#theta_{trk}cos(#phi_{trk});n. clusters", locType.c_str());
440  iHists_.h2_[Form("%s_thcosphtrk_var2", locType.c_str())] = ibook.book2D(Form("%s_thcosphtrk_var2", locType.c_str()), titles, 360, -0.9, 0.9, 50, 0, 1);
441 
442  titles = Form("#theta_{trk}cos(#phi_{trk}) vs cluster variance (w=3) in %s;cluster variance (w=3);#theta_{trk}cos(#phi_{trk});n. clusters", locType.c_str());
443  iHists_.h2_[Form("%s_thcosphtrk_var3", locType.c_str())] = ibook.book2D(Form("%s_thcosphtrk_var3", locType.c_str()), titles, 360, -0.9, 0.9, 50, 0, 1);
444  // clang-format on
445  }
446  }
447  }
448 
449  // prepare module histograms
450  if (saveHistosMods_) {
451  ibook.setCurrentFolder(folderToBook + "/modules");
452  for (const auto& [mod, locationType] : iHists_.moduleLocationType_) {
453  // histograms for each module
454  iHists_.h1_[Form("%s_%d_nstrips", locationType.c_str(), mod)] =
455  ibook.book1D(Form("%s_%d_nstrips", locationType.c_str(), mod), "", 10, 0, 10);
456  iHists_.h1_[Form("%s_%d_tanthetatrk", locationType.c_str(), mod)] =
457  ibook.book1D(Form("%s_%d_tanthetatrk", locationType.c_str(), mod), "", 40, -1., 1.);
458  iHists_.h1_[Form("%s_%d_cosphitrk", locationType.c_str(), mod)] =
459  ibook.book1D(Form("%s_%d_cosphitrk", locationType.c_str(), mod), "", 40, -1, 1);
460  iHists_.h1_[Form("%s_%d_variance_w2", locationType.c_str(), mod)] =
461  ibook.book1D(Form("%s_%d_variance_w2", locationType.c_str(), mod), "", 20, 0, 1);
462  iHists_.h1_[Form("%s_%d_variance_w3", locationType.c_str(), mod)] =
463  ibook.book1D(Form("%s_%d_variance_w3", locationType.c_str(), mod), "", 20, 0, 1);
464  }
465 
466  int counter{0};
468  for (; iter != m_hash.end(); ++iter) {
469  const auto& locationType = iHists_.moduleLocationType_[(*iter)];
470  iHists_.h2_ct_w_m_.push_back(
471  ibook.book2D(Form("ct_w_m_%s_%d", locationType.c_str(), *iter), "", 90, -0.9, 0.9, 10, 0, 10));
472  iHists_.h2_t_w_m_.push_back(
473  ibook.book2D(Form("t_w_m_%s_%d", locationType.c_str(), *iter), "", 90, -0.9, 0.9, 10, 0, 10));
474  iHists_.h2_ct_var2_m_.push_back(
475  ibook.book2D(Form("ct_var2_m_%s_%d", locationType.c_str(), *iter), "", 90, -0.9, 0.9, 20, 0, 1));
476  iHists_.h2_ct_var3_m_.push_back(
477  ibook.book2D(Form("ct_var3_m_%s_%d", locationType.c_str(), *iter), "", 90, -0.9, 0.9, 20, 0, 1));
478  iHists_.h2_t_var2_m_.push_back(
479  ibook.book2D(Form("t_var2_m_%s_%d", locationType.c_str(), *iter), "", 90, -0.9, 0.9, 20, 0, 1));
480  iHists_.h2_t_var3_m_.push_back(
481  ibook.book2D(Form("t_var3_m_%s_%d", locationType.c_str(), *iter), "", 90, -0.9, 0.9, 20, 0, 1));
482  counter++;
483  }
484  edm::LogPrint(moduleDescription().moduleName())
485  << __PRETTY_FUNCTION__ << " Booked " << counter << " module level histograms!";
486  } // if saveHistoMods
487 }
488 
489 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
492  desc.add<std::string>("folder", "AlCaReco/SiStripLorentzAngle")->setComment("DQM folder to write into");
493  desc.add<bool>("saveHistoMods", false)->setComment("save module level hisotgrams. Warning! takes a lot of space!");
494  desc.add<edm::InputTag>("Tracks", edm::InputTag("SiStripCalCosmics"))->setComment("input track collection");
495  descriptions.addWithDefaultLabel(desc);
496 }
497 
498 // define this as a plug-in
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
static const std::array< std::string, 5 > titles
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleDepRcd > m_lorentzAngleTokenBR
Local3DVector LocalVector
Definition: LocalVector.h:12
std::vector< uint32_t >::const_iterator const_iterator
std::string moduleLocationType(const uint32_t &mod, const TrackerTopology *tTopo)
void setCluster(const SiStripCluster &cluster, int detId)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::string folder_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::vector< dqm::reco::MonitorElement * > h2_ct_var3_m_
std::vector< dqm::reco::MonitorElement * > h2_t_w_m_
T z() const
Definition: PV3DBase.h:61
std::vector< dqm::reco::MonitorElement * > h2_t_var3_m_
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:36
SubDetector subDetector() const
Definition: SiStripDetId.h:105
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_tkGeomTokenBR
LocalPoint toLocal(const GlobalPoint &gp) const
uint32_t hashedIndex(uint32_t det_id)
unsigned int layer(const DetId &id) const
Provides dense hash map in place of DetId.
std::vector< dqm::reco::MonitorElement * > h2_ct_w_m_
SiStripLorentzAngleCalibrationHistograms iHists_
int hashedIndex(int ieta, int iphi)
Definition: EcalPyUtils.cc:36
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
int iEvent
Definition: GenABIO.cc:224
const edm::EDGetTokenT< TrajTrackAssociationCollection > m_association_token
std::map< std::string, dqm::reco::MonitorElement * > h2_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > m_tkGeomToken
uint32_t stereo() const
Definition: SiStripDetId.h:168
const std::string fieldAsString(const float &inputField)
std::vector< dqm::reco::MonitorElement * > h2_t_var2_m_
OnTrackCluster(uint32_t detId, const SiStripCluster *stripCluster, const Trajectory *trajectory, const reco::Track *track_, const TrajectoryMeasurement &measurement_)
double f[11][100]
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
SiStripLorentzAnglePCLMonitor(const edm::ParameterSet &)
const std::string apvModeAsString(const SiStripLatency *latency)
const edm::ESGetToken< SiStripLatency, SiStripLatencyRcd > m_latencyTokenBR
static constexpr auto TOB
Definition: SiStripDetId.h:39
Log< level::Warning, true > LogPrint
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
Log< level::Info, false > LogInfo
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
std::vector< dqm::reco::MonitorElement * > h2_ct_var2_m_
std::map< std::string, dqm::reco::MonitorElement * > h1_
void analyze(const edm::Event &, const edm::EventSetup &) override
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const PositionType & position() 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
void dqmBeginRun(edm::Run const &, edm::EventSetup const &) override
static constexpr auto TIB
Definition: SiStripDetId.h:37
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > m_topoEsTokenBR
const edm::EDGetTokenT< edm::View< reco::Track > > m_tracks_token
HLT enums.
~SiStripLorentzAnglePCLMonitor() override=default
const_iterator end() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
Geom::Theta< T > theta() const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_magFieldTokenBR
Definition: Run.h:45
const_iterator begin() const
#define LogDebug(id)