CMS 3D CMS Logo

EtlLocalRecoValidation.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Validation/MtdValidation
4 // Class: EtlLocalRecoValidation
5 //
14 #include <string>
15 
20 
23 
30 
34 
41 
42 struct MTDHit {
43  float energy;
44  float time;
45  float x_local;
46  float y_local;
47  float z_local;
48 };
49 
51 public:
53  ~EtlLocalRecoValidation() override;
54 
55  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
56 
57 private:
58  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
59 
60  void analyze(const edm::Event&, const edm::EventSetup&) override;
61 
62  bool isSameCluster(const FTLCluster&, const FTLCluster&);
63 
64  // ------------ member data ------------
65 
67  const float hitMinEnergy1Dis_;
68  const float hitMinEnergy2Dis_;
69  const bool optionalPlots_;
71  const double hitMinAmplitude_;
72 
78 
81 
82  // --- histograms declaration
83 
88 
90 
94 
100 
106 
114 
119 
133 
135 
136  // --- UncalibratedRecHits histograms
137 
138  static constexpr int nBinsQ_ = 20;
139  static constexpr float binWidthQ_ = 1.3; // in MIP units
140 
142 
143  static constexpr int nBinsEta_ = 26;
144  static constexpr float binWidthEta_ = 0.05;
145  static constexpr float etaMin_ = 1.65;
146 
148 };
149 
151  return clu1.id() == clu2.id() && clu1.size() == clu2.size() && clu1.x() == clu2.x() && clu1.y() == clu2.y() &&
152  clu1.time() == clu2.time();
153 }
154 
155 // ------------ constructor and destructor --------------
157  : folder_(iConfig.getParameter<std::string>("folder")),
158  hitMinEnergy1Dis_(iConfig.getParameter<double>("hitMinimumEnergy1Dis")),
159  hitMinEnergy2Dis_(iConfig.getParameter<double>("hitMinimumEnergy2Dis")),
160  optionalPlots_(iConfig.getParameter<bool>("optionalPlots")),
161  uncalibRecHitsPlots_(iConfig.getParameter<bool>("UncalibRecHitsPlots")),
162  hitMinAmplitude_(iConfig.getParameter<double>("HitMinimumAmplitude")) {
163  etlRecHitsToken_ = consumes<FTLRecHitCollection>(iConfig.getParameter<edm::InputTag>("recHitsTag"));
166  consumes<FTLUncalibratedRecHitCollection>(iConfig.getParameter<edm::InputTag>("uncalibRecHitsTag"));
167  etlSimHitsToken_ = consumes<CrossingFrame<PSimHit> >(iConfig.getParameter<edm::InputTag>("simHitsTag"));
168  etlRecCluToken_ = consumes<FTLClusterCollection>(iConfig.getParameter<edm::InputTag>("recCluTag"));
169  mtdTrackingHitToken_ = consumes<MTDTrackingDetSetVector>(iConfig.getParameter<edm::InputTag>("trkHitTag"));
170 
171  mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
172  mtdtopoToken_ = esConsumes<MTDTopology, MTDTopologyRcd>();
173 }
174 
176 
177 // ------------ method called for each event ------------
179  using namespace edm;
180  using namespace std;
181  using namespace geant_units::operators;
182 
183  auto geometryHandle = iSetup.getTransientHandle(mtdgeoToken_);
184  const MTDGeometry* geom = geometryHandle.product();
185 
186  auto topologyHandle = iSetup.getTransientHandle(mtdtopoToken_);
187  const MTDTopology* topology = topologyHandle.product();
188 
189  bool topo1Dis = false;
190  bool topo2Dis = false;
192  topo1Dis = true;
193  } else {
194  topo2Dis = true;
195  }
196 
197  auto etlRecHitsHandle = makeValid(iEvent.getHandle(etlRecHitsToken_));
198  auto etlSimHitsHandle = makeValid(iEvent.getHandle(etlSimHitsToken_));
199  auto etlRecCluHandle = makeValid(iEvent.getHandle(etlRecCluToken_));
200  auto mtdTrkHitHandle = makeValid(iEvent.getHandle(mtdTrackingHitToken_));
201  MixCollection<PSimHit> etlSimHits(etlSimHitsHandle.product());
202 
203 #ifdef EDM_ML_DEBUG
204  for (const auto& hits : *mtdTrkHitHandle) {
205  if (MTDDetId(hits.id()).mtdSubDetector() == MTDDetId::MTDType::ETL) {
206  LogDebug("EtlLocalRecoValidation") << "MTD cluster DetId " << hits.id() << " # cluster " << hits.size();
207  for (const auto& hit : hits) {
208  LogDebug("EtlLocalRecoValidation")
209  << "MTD_TRH: " << hit.localPosition().x() << "," << hit.localPosition().y() << " : "
210  << hit.localPositionError().xx() << "," << hit.localPositionError().yy() << " : " << hit.time() << " : "
211  << hit.timeError();
212  }
213  }
214  }
215 #endif
216 
217  // --- Loop over the ETL SIM hits
218  std::unordered_map<uint32_t, MTDHit> m_etlSimHits[4];
219  for (auto const& simHit : etlSimHits) {
220  // --- Use only hits compatible with the in-time bunch-crossing
221  if (simHit.tof() < 0 || simHit.tof() > 25.)
222  continue;
223 
224  ETLDetId id = simHit.detUnitId();
225 
226  int idet = -1;
227 
228  if ((id.zside() == -1) && (id.nDisc() == 1))
229  idet = 0;
230  else if ((id.zside() == -1) && (id.nDisc() == 2))
231  idet = 1;
232  else if ((id.zside() == 1) && (id.nDisc() == 1))
233  idet = 2;
234  else if ((id.zside() == 1) && (id.nDisc() == 2))
235  idet = 3;
236  else
237  continue;
238 
239  auto simHitIt = m_etlSimHits[idet].emplace(id.rawId(), MTDHit()).first;
240 
241  // --- Accumulate the energy (in MeV) of SIM hits in the same detector cell
242  (simHitIt->second).energy += convertUnitsTo(0.001_MeV, simHit.energyLoss());
243 
244  // --- Get the time of the first SIM hit in the cell
245  if ((simHitIt->second).time == 0 || simHit.tof() < (simHitIt->second).time) {
246  (simHitIt->second).time = simHit.tof();
247 
248  auto hit_pos = simHit.entryPoint();
249  (simHitIt->second).x_local = hit_pos.x();
250  (simHitIt->second).y_local = hit_pos.y();
251  (simHitIt->second).z_local = hit_pos.z();
252  }
253 
254  } // simHit loop
255 
256  // --- Loop over the ELT RECO hits
257  unsigned int n_reco_etl[4] = {0, 0, 0, 0};
258  for (const auto& recHit : *etlRecHitsHandle) {
259  double weight = 1.0;
260  ETLDetId detId = recHit.id();
261  DetId geoId = detId.geographicalId();
262  const MTDGeomDet* thedet = geom->idToDet(geoId);
263  if (thedet == nullptr)
264  throw cms::Exception("EtlLocalRecoValidation") << "GeographicalID: " << std::hex << geoId.rawId() << " ("
265  << detId.rawId() << ") is invalid!" << std::dec << std::endl;
266  const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology());
267  const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());
268 
269  Local3DPoint local_point(topo.localX(recHit.row()), topo.localY(recHit.column()), 0.);
270  const auto& global_point = thedet->toGlobal(local_point);
271 
272  int idet = 999;
273 
274  if (topo1Dis) {
275  if (detId.zside() == -1) {
276  idet = 0;
277  } else if (detId.zside() == 1) {
278  idet = 2;
279  } else {
280  continue;
281  }
282  }
283 
284  if (topo2Dis) {
285  if (detId.discSide() == 1) {
286  weight = -weight;
287  }
288  if ((detId.zside() == -1) && (detId.nDisc() == 1)) {
289  idet = 0;
290  } else if ((detId.zside() == -1) && (detId.nDisc() == 2)) {
291  idet = 1;
292  } else if ((detId.zside() == 1) && (detId.nDisc() == 1)) {
293  idet = 2;
294  } else if ((detId.zside() == 1) && (detId.nDisc() == 2)) {
295  idet = 3;
296  } else {
297  continue;
298  }
299  }
300 
301  // --- Fill the histograms
302 
303  meHitEnergy_[idet]->Fill(recHit.energy());
304  meHitTime_[idet]->Fill(recHit.time());
305  meHitTimeError_[idet]->Fill(recHit.timeError());
306 
307  meOccupancy_[idet]->Fill(global_point.x(), global_point.y(), weight);
308 
309  if (optionalPlots_) {
310  if ((idet == 0) || (idet == 1)) {
311  meLocalOccupancy_[0]->Fill(local_point.x(), local_point.y());
312  meHitXlocal_[0]->Fill(local_point.x());
313  meHitYlocal_[0]->Fill(local_point.y());
314  }
315  if ((idet == 2) || (idet == 3)) {
316  meLocalOccupancy_[1]->Fill(local_point.x(), local_point.y());
317  meHitXlocal_[1]->Fill(local_point.x());
318  meHitYlocal_[1]->Fill(local_point.y());
319  }
320  }
321  meHitX_[idet]->Fill(global_point.x());
322  meHitY_[idet]->Fill(global_point.y());
323  meHitZ_[idet]->Fill(global_point.z());
324  meHitPhi_[idet]->Fill(global_point.phi());
325  meHitEta_[idet]->Fill(global_point.eta());
326  meHitTvsE_[idet]->Fill(recHit.energy(), recHit.time());
327  meHitEvsPhi_[idet]->Fill(global_point.phi(), recHit.energy());
328  meHitEvsEta_[idet]->Fill(global_point.eta(), recHit.energy());
329  meHitTvsPhi_[idet]->Fill(global_point.phi(), recHit.time());
330  meHitTvsEta_[idet]->Fill(global_point.eta(), recHit.time());
331 
332  // Resolution histograms
333  if (m_etlSimHits[idet].count(detId.rawId()) == 1) {
334  if ((topo1Dis && m_etlSimHits[idet][detId.rawId()].energy > hitMinEnergy1Dis_) ||
335  (topo2Dis && m_etlSimHits[idet][detId.rawId()].energy > hitMinEnergy2Dis_)) {
336  float time_res = recHit.time() - m_etlSimHits[idet][detId.rawId()].time;
337  float energy_res = recHit.energy() - m_etlSimHits[idet][detId.rawId()].energy;
338 
339  meTimeRes_->Fill(time_res);
340  meEnergyRes_->Fill(energy_res);
341 
342  meTPullvsEta_->Fill(std::abs(global_point.eta()), time_res / recHit.timeError());
343  meTPullvsE_->Fill(m_etlSimHits[idet][detId.rawId()].energy, time_res / recHit.timeError());
344  }
345  }
346 
347  n_reco_etl[idet]++;
348  } // recHit loop
349 
350  if (topo1Dis) {
351  meNhits_[0]->Fill(n_reco_etl[0]);
352  meNhits_[2]->Fill(n_reco_etl[2]);
353  }
354 
355  if (topo2Dis) {
356  for (int i = 0; i < 4; i++) {
357  meNhits_[i]->Fill(n_reco_etl[i]);
358  }
359  }
360 
361  // --- Loop over the ETL RECO clusters ---
362  for (const auto& DetSetClu : *etlRecCluHandle) {
363  for (const auto& cluster : DetSetClu) {
364  double weight = 1.0;
365  if (topo1Dis) {
366  if (cluster.energy() < hitMinEnergy1Dis_)
367  continue;
368  }
369  if (topo2Dis) {
370  if (cluster.energy() < hitMinEnergy2Dis_)
371  continue;
372  }
373  ETLDetId cluId = cluster.id();
374  DetId detIdObject(cluId);
375  const auto& genericDet = geom->idToDetUnit(detIdObject);
376  if (genericDet == nullptr) {
377  throw cms::Exception("EtlLocalRecoValidation")
378  << "GeographicalID: " << std::hex << cluId << " is invalid!" << std::dec << std::endl;
379  }
380  const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(genericDet->topology());
381  const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());
382 
383  Local3DPoint local_point(topo.localX(cluster.x()), topo.localY(cluster.y()), 0.);
384  const auto& global_point = genericDet->toGlobal(local_point);
385 
386  int idet = 999;
387 
388  if (topo1Dis) {
389  if (cluId.zside() == -1) {
390  idet = 0;
391  } else if (cluId.zside() == 1) {
392  idet = 2;
393  } else {
394  continue;
395  }
396  }
397 
398  if (topo2Dis) {
399  if (cluId.discSide() == 1) {
400  weight = -weight;
401  }
402  if ((cluId.zside() == -1) && (cluId.nDisc() == 1)) {
403  idet = 0;
404  } else if ((cluId.zside() == -1) && (cluId.nDisc() == 2)) {
405  idet = 1;
406  } else if ((cluId.zside() == 1) && (cluId.nDisc() == 1)) {
407  idet = 2;
408  } else if ((cluId.zside() == 1) && (cluId.nDisc() == 2)) {
409  idet = 3;
410  } else {
411  continue;
412  }
413  }
414 
415  meCluEnergy_[idet]->Fill(cluster.energy());
416  meCluTime_[idet]->Fill(cluster.time());
417  meCluTimeError_[idet]->Fill(cluster.timeError());
418  meCluPhi_[idet]->Fill(global_point.phi());
419  meCluEta_[idet]->Fill(global_point.eta());
420  meCluOccupancy_[idet]->Fill(global_point.x(), global_point.y(), weight);
421  meCluHits_[idet]->Fill(cluster.size());
422 
423  // --- Get the SIM hits associated to the cluster and calculate
424  // the cluster SIM energy, time and position
425 
426  double cluEneSIM = 0.;
427  double cluTimeSIM = 0.;
428  double cluLocXSIM = 0.;
429  double cluLocYSIM = 0.;
430  double cluLocZSIM = 0.;
431 
432  for (int ihit = 0; ihit < cluster.size(); ++ihit) {
433  int hit_row = cluster.minHitRow() + cluster.hitOffset()[ihit * 2];
434  int hit_col = cluster.minHitCol() + cluster.hitOffset()[ihit * 2 + 1];
435 
436  // Match the RECO hit to the corresponding SIM hit
437  for (const auto& recHit : *etlRecHitsHandle) {
438  ETLDetId hitId(recHit.id().rawId());
439 
440  if (m_etlSimHits[idet].count(hitId.rawId()) == 0)
441  continue;
442 
443  // Check the hit position
444  if (hitId.zside() != cluId.zside() || hitId.mtdRR() != cluId.mtdRR() || hitId.module() != cluId.module() ||
445  recHit.row() != hit_row || recHit.column() != hit_col)
446  continue;
447 
448  // Check the hit energy and time
449  if (recHit.energy() != cluster.hitENERGY()[ihit] || recHit.time() != cluster.hitTIME()[ihit])
450  continue;
451 
452  // SIM hit's position in the module reference frame
453  Local3DPoint local_point_sim(convertMmToCm(m_etlSimHits[idet][recHit.id().rawId()].x_local),
454  convertMmToCm(m_etlSimHits[idet][recHit.id().rawId()].y_local),
455  convertMmToCm(m_etlSimHits[idet][recHit.id().rawId()].z_local));
456 
457  // Calculate the SIM cluster's position in the module reference frame
458  cluLocXSIM += local_point_sim.x() * m_etlSimHits[idet][recHit.id().rawId()].energy;
459  cluLocYSIM += local_point_sim.y() * m_etlSimHits[idet][recHit.id().rawId()].energy;
460  cluLocZSIM += local_point_sim.z() * m_etlSimHits[idet][recHit.id().rawId()].energy;
461 
462  // Calculate the SIM cluster energy and time
463  cluEneSIM += m_etlSimHits[idet][recHit.id().rawId()].energy;
464  cluTimeSIM += m_etlSimHits[idet][recHit.id().rawId()].time * m_etlSimHits[idet][recHit.id().rawId()].energy;
465 
466  break;
467 
468  } // recHit loop
469 
470  } // ihit loop
471 
472  // Find the MTDTrackingRecHit corresponding to the cluster
473  MTDTrackingRecHit* comp(nullptr);
474  bool matchClu = false;
475  const auto& trkHits = (*mtdTrkHitHandle)[detIdObject];
476  for (const auto& trkHit : trkHits) {
477  if (isSameCluster(trkHit.mtdCluster(), cluster)) {
478  comp = trkHit.clone();
479  matchClu = true;
480  break;
481  }
482  }
483  if (!matchClu) {
484  edm::LogWarning("BtlLocalRecoValidation")
485  << "No valid TrackingRecHit corresponding to cluster, detId = " << detIdObject.rawId();
486  }
487 
488  // --- Fill the cluster resolution histograms
489  int iside = (cluId.zside() == -1 ? 0 : 1);
490  if (cluTimeSIM > 0. && cluEneSIM > 0.) {
491  cluTimeSIM /= cluEneSIM;
492 
493  Local3DPoint cluLocalPosSIM(cluLocXSIM / cluEneSIM, cluLocYSIM / cluEneSIM, cluLocZSIM / cluEneSIM);
494  const auto& cluGlobalPosSIM = genericDet->toGlobal(cluLocalPosSIM);
495 
496  float time_res = cluster.time() - cluTimeSIM;
497  float energy_res = cluster.energy() - cluEneSIM;
498  float x_res = global_point.x() - cluGlobalPosSIM.x();
499  float y_res = global_point.y() - cluGlobalPosSIM.y();
500  float z_res = global_point.z() - cluGlobalPosSIM.z();
501 
502  meCluTimeRes_[iside]->Fill(time_res);
503  meCluEnergyRes_[iside]->Fill(energy_res);
504  meCluXRes_[iside]->Fill(x_res);
505  meCluYRes_[iside]->Fill(y_res);
506  meCluZRes_[iside]->Fill(z_res);
507 
508  meCluTPullvsEta_[iside]->Fill(cluGlobalPosSIM.eta(), time_res / cluster.timeError());
509  meCluTPullvsE_[iside]->Fill(cluEneSIM, time_res / cluster.timeError());
510 
511  if (optionalPlots_) {
512  if (matchClu && comp != nullptr) {
513  meCluXPull_[iside]->Fill(x_res / std::sqrt(comp->globalPositionError().cxx()));
514  meCluYPull_[iside]->Fill(y_res / std::sqrt(comp->globalPositionError().cyy()));
515  meCluXLocalErr_[iside]->Fill(std::sqrt(comp->localPositionError().xx()));
516  meCluYLocalErr_[iside]->Fill(std::sqrt(comp->localPositionError().yy()));
517  }
518  meCluYXLocal_[iside]->Fill(local_point.x(), local_point.y());
519  meCluYXLocalSim_[iside]->Fill(cluLocalPosSIM.x(), cluLocalPosSIM.y());
520  }
521 
522  } // if ( cluTimeSIM > 0. && cluEneSIM > 0. )
523  else {
524  meUnmatchedCluEnergy_[iside]->Fill(std::log10(cluster.energy()));
525  }
526 
527  } // cluster loop
528 
529  } // DetSetClu loop
530 
531  // --- Loop over the ETL Uncalibrated RECO hits
532  if (uncalibRecHitsPlots_) {
533  auto etlUncalibRecHitsHandle = makeValid(iEvent.getHandle(etlUncalibRecHitsToken_));
534 
535  for (const auto& uRecHit : *etlUncalibRecHitsHandle) {
536  ETLDetId detId = uRecHit.id();
537 
538  int idet = detId.zside() + detId.nDisc();
539 
540  // --- Skip UncalibratedRecHits not matched to SimHits
541  if (m_etlSimHits[idet].count(detId.rawId()) != 1)
542  continue;
543 
544  DetId geoId = detId.geographicalId();
545  const MTDGeomDet* thedet = geom->idToDet(geoId);
546  if (thedet == nullptr)
547  throw cms::Exception("EtlLocalRecoValidation") << "GeographicalID: " << std::hex << geoId.rawId() << " ("
548  << detId.rawId() << ") is invalid!" << std::dec << std::endl;
549 
550  const ProxyMTDTopology& topoproxy = static_cast<const ProxyMTDTopology&>(thedet->topology());
551  const RectangularMTDTopology& topo = static_cast<const RectangularMTDTopology&>(topoproxy.specificTopology());
552 
553  Local3DPoint local_point(topo.localX(uRecHit.row()), topo.localY(uRecHit.column()), 0.);
554  const auto& global_point = thedet->toGlobal(local_point);
555 
556  // --- Fill the histograms
557 
558  if (uRecHit.amplitude().first < hitMinAmplitude_)
559  continue;
560 
561  float time_res = uRecHit.time().first - m_etlSimHits[idet][detId.rawId()].time;
562 
563  int iside = (detId.zside() == -1 ? 0 : 1);
564 
565  // amplitude histograms
566 
567  int qBin = (int)(uRecHit.amplitude().first / binWidthQ_);
568  if (qBin > nBinsQ_ - 1)
569  qBin = nBinsQ_ - 1;
570 
571  meTimeResQ_[iside][qBin]->Fill(time_res);
572 
573  // eta histograms
574 
575  int etaBin = (int)((fabs(global_point.eta()) - etaMin_) / binWidthEta_);
576  if (etaBin < 0)
577  etaBin = 0;
578  else if (etaBin > nBinsEta_ - 1)
579  etaBin = nBinsEta_ - 1;
580 
581  meTimeResEta_[iside][etaBin]->Fill(time_res);
582 
583  } // uRecHit loop
584  }
585 }
586 
587 // ------------ method for histogram booking ------------
589  edm::Run const& run,
590  edm::EventSetup const& iSetup) {
591  ibook.setCurrentFolder(folder_);
592 
593  // --- histograms booking
594 
595  meNhits_[0] = ibook.book1D(
596  "EtlNhitsZnegD1", "Number of ETL RECO hits (-Z, Single(topo1D)/First(topo2D) disk);N_{RECO}", 100, 0., 5000.);
597  meNhits_[1] = ibook.book1D("EtlNhitsZnegD2", "Number of ETL RECO hits (-Z, Second disk);N_{RECO}", 100, 0., 5000.);
598  meNhits_[2] = ibook.book1D(
599  "EtlNhitsZposD1", "Number of ETL RECO hits (+Z, Single(topo1D)/First(topo2D) disk);N_{RECO}", 100, 0., 5000.);
600  meNhits_[3] = ibook.book1D("EtlNhitsZposD2", "Number of ETL RECO hits (+Z, Second disk);N_{RECO}", 100, 0., 5000.);
601  meHitEnergy_[0] = ibook.book1D(
602  "EtlHitEnergyZnegD1", "ETL RECO hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{RECO} [MeV]", 100, 0., 3.);
603  meHitEnergy_[1] =
604  ibook.book1D("EtlHitEnergyZnegD2", "ETL RECO hits energy (-Z, Second disk);E_{RECO} [MeV]", 100, 0., 3.);
605  meHitEnergy_[2] = ibook.book1D(
606  "EtlHitEnergyZposD1", "ETL RECO hits energy (+Z, Single(topo1D)/First(topo2D) disk);E_{RECO} [MeV]", 100, 0., 3.);
607  meHitEnergy_[3] =
608  ibook.book1D("EtlHitEnergyZposD2", "ETL RECO hits energy (+Z, Second disk);E_{RECO} [MeV]", 100, 0., 3.);
609  meHitTime_[0] = ibook.book1D(
610  "EtlHitTimeZnegD1", "ETL RECO hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{RECO} [ns]", 100, 0., 25.);
611  meHitTime_[1] = ibook.book1D("EtlHitTimeZnegD2", "ETL RECO hits ToA (-Z, Second disk);ToA_{RECO} [ns]", 100, 0., 25.);
612  meHitTime_[2] = ibook.book1D(
613  "EtlHitTimeZposD1", "ETL RECO hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{RECO} [ns]", 100, 0., 25.);
614  meHitTime_[3] = ibook.book1D("EtlHitTimeZposD2", "ETL RECO hits ToA (+Z, Second disk);ToA_{RECO} [ns]", 100, 0., 25.);
615  meHitTimeError_[0] =
616  ibook.book1D("EtlHitTimeErrorZnegD1",
617  "ETL RECO hits ToA error (-Z, Single(topo1D)/First(topo2D) disk);#sigma^{ToA}_{RECO} [ns]",
618  50,
619  0.,
620  0.1);
621  meHitTimeError_[1] = ibook.book1D(
622  "EtlHitTimeErrorZnegD2", "ETL RECO hits ToA error(-Z, Second disk);#sigma^{ToA}_{RECO} [ns]", 50, 0., 0.1);
623  meHitTimeError_[2] =
624  ibook.book1D("EtlHitTimeErrorZposD1",
625  "ETL RECO hits ToA error (+Z, Single(topo1D)/First(topo2D) disk);#sigma^{ToA}_{RECO} [ns]",
626  50,
627  0.,
628  0.1);
629  meHitTimeError_[3] = ibook.book1D(
630  "EtlHitTimeErrorZposD2", "ETL RECO hits ToA error(+Z, Second disk);#sigma^{ToA}_{RECO} [ns]", 50, 0., 0.1);
631 
632  meOccupancy_[0] =
633  ibook.book2D("EtlOccupancyZnegD1",
634  "ETL RECO hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{RECO} [cm];Y_{RECO} [cm]",
635  135,
636  -135.,
637  135.,
638  135,
639  -135.,
640  135.);
641  meOccupancy_[1] = ibook.book2D("EtlOccupancyZnegD2",
642  "ETL RECO hits occupancy (-Z, Second disk);X_{RECO} [cm];Y_{RECO} [cm]",
643  135,
644  -135.,
645  135.,
646  135,
647  -135.,
648  135.);
649  meOccupancy_[2] =
650  ibook.book2D("EtlOccupancyZposD1",
651  "ETL RECO hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{RECO} [cm];Y_{RECO} [cm]",
652  135,
653  -135.,
654  135.,
655  135,
656  -135.,
657  135.);
658  meOccupancy_[3] = ibook.book2D("EtlOccupancyZposD2",
659  "ETL RECO hits occupancy (+Z, Second disk);X_{RECO} [cm];Y_{RECO} [cm]",
660  135,
661  -135.,
662  135.,
663  135,
664  -135.,
665  135.);
666  if (optionalPlots_) {
667  meLocalOccupancy_[0] = ibook.book2D("EtlLocalOccupancyZneg",
668  "ETL RECO hits local occupancy (-Z);X_{RECO} [cm];Y_{RECO} [cm]",
669  100,
670  -2.2,
671  2.2,
672  50,
673  -1.1,
674  1.1);
675  meLocalOccupancy_[1] = ibook.book2D("EtlLocalOccupancyZpos",
676  "ETL RECO hits local occupancy (+Z);X_{RECO} [cm];Y_{RECO} [cm]",
677  100,
678  -2.2,
679  2.2,
680  50,
681  -1.1,
682  1.1);
683  meHitXlocal_[0] = ibook.book1D("EtlHitXlocalZneg", "ETL RECO local X (-Z);X_{RECO}^{LOC} [cm]", 100, -2.2, 2.2);
684  meHitXlocal_[1] = ibook.book1D("EtlHitXlocalZpos", "ETL RECO local X (+Z);X_{RECO}^{LOC} [cm]", 100, -2.2, 2.2);
685  meHitYlocal_[0] = ibook.book1D("EtlHitYlocalZneg", "ETL RECO local Y (-Z);Y_{RECO}^{LOC} [cm]", 50, -1.1, 1.1);
686  meHitYlocal_[1] = ibook.book1D("EtlHitYlocalZpos", "ETL RECO local Y (-Z);Y_{RECO}^{LOC} [cm]", 50, -1.1, 1.1);
687  }
688  meHitX_[0] = ibook.book1D(
689  "EtlHitXZnegD1", "ETL RECO hits X (-Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]", 100, -130., 130.);
690  meHitX_[1] = ibook.book1D("EtlHitXZnegD2", "ETL RECO hits X (-Z, Second Disk);X_{RECO} [cm]", 100, -130., 130.);
691  meHitX_[2] = ibook.book1D(
692  "EtlHitXZposD1", "ETL RECO hits X (+Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]", 100, -130., 130.);
693  meHitX_[3] = ibook.book1D("EtlHitXZposD2", "ETL RECO hits X (+Z, Second Disk);X_{RECO} [cm]", 100, -130., 130.);
694  meHitY_[0] = ibook.book1D(
695  "EtlHitYZnegD1", "ETL RECO hits Y (-Z, Single(topo1D)/First(topo2D) Disk);Y_{RECO} [cm]", 100, -130., 130.);
696  meHitY_[1] = ibook.book1D("EtlHitYZnegD2", "ETL RECO hits Y (-Z, Second Disk);Y_{RECO} [cm]", 100, -130., 130.);
697  meHitY_[2] = ibook.book1D(
698  "EtlHitYZposD1", "ETL RECO hits Y (+Z, Single(topo1D)/First(topo2D) Disk);Y_{RECO} [cm]", 100, -130., 130.);
699  meHitY_[3] = ibook.book1D("EtlHitYZposD2", "ETL RECO hits Y (+Z, Second Disk);Y_{RECO} [cm]", 100, -130., 130.);
700  meHitZ_[0] = ibook.book1D(
701  "EtlHitZZnegD1", "ETL RECO hits Z (-Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, -302., -298.);
702  meHitZ_[1] = ibook.book1D("EtlHitZZnegD2", "ETL RECO hits Z (-Z, Second Disk);Z_{RECO} [cm]", 100, -304., -300.);
703  meHitZ_[2] = ibook.book1D(
704  "EtlHitZZposD1", "ETL RECO hits Z (+Z, Single(topo1D)/First(topo2D) Disk);Z_{RECO} [cm]", 100, 298., 302.);
705  meHitZ_[3] = ibook.book1D("EtlHitZZposD2", "ETL RECO hits Z (+Z, Second Disk);Z_{RECO} [cm]", 100, 300., 304.);
706  meHitPhi_[0] = ibook.book1D(
707  "EtlHitPhiZnegD1", "ETL RECO hits #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2);
708  meHitPhi_[1] =
709  ibook.book1D("EtlHitPhiZnegD2", "ETL RECO hits #phi (-Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2);
710  meHitPhi_[2] = ibook.book1D(
711  "EtlHitPhiZposD1", "ETL RECO hits #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2);
712  meHitPhi_[3] =
713  ibook.book1D("EtlHitPhiZposD2", "ETL RECO hits #phi (+Z, Second Disk);#phi_{RECO} [rad]", 100, -3.2, 3.2);
714  meHitEta_[0] = ibook.book1D(
715  "EtlHitEtaZnegD1", "ETL RECO hits #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, -3.2, -1.56);
716  meHitEta_[1] = ibook.book1D("EtlHitEtaZnegD2", "ETL RECO hits #eta (-Z, Second Disk);#eta_{RECO}", 100, -3.2, -1.56);
717  meHitEta_[2] = ibook.book1D(
718  "EtlHitEtaZposD1", "ETL RECO hits #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.56, 3.2);
719  meHitEta_[3] = ibook.book1D("EtlHitEtaZposD2", "ETL RECO hits #eta (+Z, Second Disk);#eta_{RECO}", 100, 1.56, 3.2);
720  meTimeRes_ = ibook.book1D("EtlTimeRes", "ETL time resolution;T_{RECO}-T_{SIM}", 100, -0.5, 0.5);
721  meEnergyRes_ = ibook.book1D("EtlEnergyRes", "ETL energy resolution;E_{RECO}-E_{SIM}", 100, -0.5, 0.5);
722  meHitTvsE_[0] = ibook.bookProfile(
723  "EtlHitTvsEZnegD1",
724  "ETL RECO time vs energy (-Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV];ToA_{RECO} [ns]",
725  50,
726  0.,
727  2.,
728  0.,
729  100.);
730  meHitTvsE_[1] = ibook.bookProfile("EtlHitTvsEZnegD2",
731  "ETL RECO time vs energy (-Z, Second Disk);E_{RECO} [MeV];ToA_{RECO} [ns]",
732  50,
733  0.,
734  2.,
735  0.,
736  100.);
737  meHitTvsE_[2] = ibook.bookProfile(
738  "EtlHitTvsEZposD1",
739  "ETL RECO time vs energy (+Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV];ToA_{RECO} [ns]",
740  50,
741  0.,
742  2.,
743  0.,
744  100.);
745  meHitTvsE_[3] = ibook.bookProfile("EtlHitTvsEZposD2",
746  "ETL RECO time vs energy (+Z, Second Disk);E_{RECO} [MeV];ToA_{RECO} [ns]",
747  50,
748  0.,
749  2.,
750  0.,
751  100.);
752  meHitEvsPhi_[0] = ibook.bookProfile(
753  "EtlHitEvsPhiZnegD1",
754  "ETL RECO energy vs #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];E_{RECO} [MeV]",
755  50,
756  -3.2,
757  3.2,
758  0.,
759  100.);
760  meHitEvsPhi_[1] = ibook.bookProfile("EtlHitEvsPhiZnegD2",
761  "ETL RECO energy vs #phi (-Z, Second Disk);#phi_{RECO} [rad];E_{RECO} [MeV]",
762  50,
763  -3.2,
764  3.2,
765  0.,
766  100.);
767  meHitEvsPhi_[2] = ibook.bookProfile(
768  "EtlHitEvsPhiZposD1",
769  "ETL RECO energy vs #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];E_{RECO} [MeV]",
770  50,
771  -3.2,
772  3.2,
773  0.,
774  100.);
775  meHitEvsPhi_[3] = ibook.bookProfile("EtlHitEvsPhiZposD2",
776  "ETL RECO energy vs #phi (+Z, Second Disk);#phi_{RECO} [rad];E_{RECO} [MeV]",
777  50,
778  -3.2,
779  3.2,
780  0.,
781  100.);
782  meHitEvsEta_[0] =
783  ibook.bookProfile("EtlHitEvsEtaZnegD1",
784  "ETL RECO energy vs #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};E_{RECO} [MeV]",
785  50,
786  -3.2,
787  -1.56,
788  0.,
789  100.);
790  meHitEvsEta_[1] = ibook.bookProfile("EtlHitEvsEtaZnegD2",
791  "ETL RECO energy vs #eta (-Z, Second Disk);#eta_{RECO};E_{RECO} [MeV]",
792  50,
793  -3.2,
794  -1.56,
795  0.,
796  100.);
797  meHitEvsEta_[2] =
798  ibook.bookProfile("EtlHitEvsEtaZposD1",
799  "ETL RECO energy vs #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};E_{RECO} [MeV]",
800  50,
801  1.56,
802  3.2,
803  0.,
804  100.);
805  meHitEvsEta_[3] = ibook.bookProfile("EtlHitEvsEtaZposD2",
806  "ETL RECO energy vs #eta (+Z, Second Disk);#eta_{RECO};E_{RECO} [MeV]",
807  50,
808  1.56,
809  3.2,
810  0.,
811  100.);
812  meHitTvsPhi_[0] = ibook.bookProfile(
813  "EtlHitTvsPhiZnegD1",
814  "ETL RECO time vs #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]",
815  50,
816  -3.2,
817  3.2,
818  0.,
819  100.);
820  meHitTvsPhi_[1] = ibook.bookProfile("EtlHitTvsPhiZnegD2",
821  "ETL RECO time vs #phi (-Z, Second Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]",
822  50,
823  -3.2,
824  3.2,
825  0.,
826  100.);
827  meHitTvsPhi_[2] = ibook.bookProfile(
828  "EtlHitTvsPhiZposD1",
829  "ETL RECO time vs #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]",
830  50,
831  -3.2,
832  3.2,
833  0.,
834  100.);
835  meHitTvsPhi_[3] = ibook.bookProfile("EtlHitTvsPhiZposD2",
836  "ETL RECO time vs #phi (+Z, Second Disk);#phi_{RECO} [rad];ToA_{RECO} [ns]",
837  50,
838  -3.2,
839  3.2,
840  0.,
841  100.);
842  meHitTvsEta_[0] =
843  ibook.bookProfile("EtlHitTvsEtaZnegD1",
844  "ETL RECO time vs #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};ToA_{RECO} [ns]",
845  50,
846  -3.2,
847  -1.56,
848  0.,
849  100.);
850  meHitTvsEta_[1] = ibook.bookProfile("EtlHitTvsEtaZnegD2",
851  "ETL RECO time vs #eta (-Z, Second Disk);#eta_{RECO};ToA_{RECO} [ns]",
852  50,
853  -3.2,
854  -1.56,
855  0.,
856  100.);
857  meHitTvsEta_[2] =
858  ibook.bookProfile("EtlHitTvsEtaZposD1",
859  "ETL RECO time vs #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO};ToA_{RECO} [ns]",
860  50,
861  1.56,
862  3.2,
863  0.,
864  100.);
865  meHitTvsEta_[3] = ibook.bookProfile("EtlHitTvsEtaZposD2",
866  "ETL RECO time vs #eta (+Z, Second Disk);#eta_{RECO};ToA_{RECO} [ns]",
867  50,
868  1.56,
869  3.2,
870  0.,
871  100.);
872  meTPullvsE_ = ibook.bookProfile(
873  "EtlTPullvsE", "ETL time pull vs E;E_{SIM} [MeV];(T_{RECO}-T_{SIM})/#sigma_{T_{RECO}}", 20, 0., 2., -5., 5., "S");
874  meTPullvsEta_ = ibook.bookProfile("EtlTPullvsEta",
875  "ETL time pull vs #eta;|#eta_{RECO}|;(T_{RECO}-T_{SIM})/#sigma_{T_{RECO}}",
876  26,
877  1.65,
878  3.0,
879  -5.,
880  5.,
881  "S");
882  meCluTime_[0] =
883  ibook.book1D("EtlCluTimeZnegD1", "ETL cluster ToA (-Z, Single(topo1D)/First(topo2D) Disk);ToA [ns]", 250, 0, 25);
884  meCluTime_[1] = ibook.book1D("EtlCluTimeZnegD2", "ETL cluster ToA (-Z, Second Disk);ToA [ns]", 250, 0, 25);
885  meCluTime_[2] =
886  ibook.book1D("EtlCluTimeZposD1", "ETL cluster ToA (+Z, Single(topo1D)/First(topo2D) Disk);ToA [ns]", 250, 0, 25);
887  meCluTime_[3] = ibook.book1D("EtlCluTimeZposD2", "ETL cluster ToA (+Z, Second Disk);ToA [ns]", 250, 0, 25);
888  meCluTimeError_[0] = ibook.book1D("EtlCluTimeErrosZnegD1",
889  "ETL cluster time error (-Z, Single(topo1D)/First(topo2D) Disk);#sigma_{t} [ns]",
890  100,
891  0,
892  0.1);
893  meCluTimeError_[1] =
894  ibook.book1D("EtlCluTimeErrorZnegD2", "ETL cluster time error (-Z, Second Disk);#sigma_{t} [ns]", 100, 0, 0.1);
895  meCluTimeError_[2] = ibook.book1D("EtlCluTimeErrorZposD1",
896  "ETL cluster time error (+Z, Single(topo1D)/First(topo2D) Disk);#sigma_{t} [ns]",
897  100,
898  0,
899  0.1);
900  meCluTimeError_[3] =
901  ibook.book1D("EtlCluTimeErrorZposD2", "ETL cluster time error (+Z, Second Disk);#sigma_{t} [ns]", 100, 0, 0.1);
902  meCluEnergy_[0] = ibook.book1D(
903  "EtlCluEnergyZnegD1", "ETL cluster energy (-Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV]", 100, 0, 10);
904  meCluEnergy_[1] =
905  ibook.book1D("EtlCluEnergyZnegD2", "ETL cluster energy (-Z, Second Disk);E_{RECO} [MeV]", 100, 0, 10);
906  meCluEnergy_[2] = ibook.book1D(
907  "EtlCluEnergyZposD1", "ETL cluster energy (+Z, Single(topo1D)/First(topo2D) Disk);E_{RECO} [MeV]", 100, 0, 10);
908  meCluEnergy_[3] =
909  ibook.book1D("EtlCluEnergyZposD2", "ETL cluster energy (+Z, Second Disk);E_{RECO} [MeV]", 100, 0, 10);
910  meCluPhi_[0] = ibook.book1D(
911  "EtlCluPhiZnegD1", "ETL cluster #phi (-Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2);
912  meCluPhi_[1] =
913  ibook.book1D("EtlCluPhiZnegD2", "ETL cluster #phi (-Z, Second Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2);
914  meCluPhi_[2] = ibook.book1D(
915  "EtlCluPhiZposD1", "ETL cluster #phi (+Z, Single(topo1D)/First(topo2D) Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2);
916  meCluPhi_[3] =
917  ibook.book1D("EtlCluPhiZposD2", "ETL cluster #phi (+Z, Second Disk);#phi_{RECO} [rad]", 126, -3.2, 3.2);
918  meCluEta_[0] = ibook.book1D(
919  "EtlCluEtaZnegD1", "ETL cluster #eta (-Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, -3.2, -1.4);
920  meCluEta_[1] = ibook.book1D("EtlCluEtaZnegD2", "ETL cluster #eta (-Z, Second Disk);#eta_{RECO}", 100, -3.2, -1.4);
921  meCluEta_[2] = ibook.book1D(
922  "EtlCluEtaZposD1", "ETL cluster #eta (+Z, Single(topo1D)/First(topo2D) Disk);#eta_{RECO}", 100, 1.4, 3.2);
923  meCluEta_[3] = ibook.book1D("EtlCluEtaZposD2", "ETL cluster #eta (+Z, Second Disk);#eta_{RECO}", 100, 1.4, 3.2);
924  meCluHits_[0] = ibook.book1D(
925  "EtlCluHitNumberZnegD1", "ETL hits per cluster (-Z, Single(topo1D)/First(topo2D) Disk);Cluster size", 10, 0, 10);
926  meCluHits_[1] =
927  ibook.book1D("EtlCluHitNumberZnegD2", "ETL hits per cluster (-Z, Second Disk);Cluster size", 10, 0, 10);
928  meCluHits_[2] = ibook.book1D(
929  "EtlCluHitNumberZposD1", "ETL hits per cluster (+Z, Single(topo1D)/First(topo2D) Disk);Cluster size", 10, 0, 10);
930  meCluHits_[3] =
931  ibook.book1D("EtlCluHitNumberZposD2", "ETL hits per cluster (+Z, Second Disk);Cluster size", 10, 0, 10);
932  meCluOccupancy_[0] =
933  ibook.book2D("EtlCluOccupancyZnegD1",
934  "ETL cluster X vs Y (-Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]; Y_{RECO} [cm]",
935  100,
936  -150.,
937  150.,
938  100,
939  -150,
940  150);
941  meCluOccupancy_[1] = ibook.book2D("EtlCluOccupancyZnegD2",
942  "ETL cluster X vs Y (-Z, Second Disk);X_{RECO} [cm]; Y_{RECO} [cm]",
943  100,
944  -150.,
945  150.,
946  100,
947  -150,
948  150);
949  meCluOccupancy_[2] =
950  ibook.book2D("EtlCluOccupancyZposD1",
951  "ETL cluster X vs Y (+Z, Single(topo1D)/First(topo2D) Disk);X_{RECO} [cm]; Y_{RECO} [cm]",
952  100,
953  -150.,
954  150.,
955  100,
956  -150,
957  150);
958  meCluOccupancy_[3] = ibook.book2D("EtlCluOccupancyZposD2",
959  "ETL cluster X vs Y (+Z, Second Disk);X_{RECO} [cm]; Y_{RECO} [cm]",
960  100,
961  -150.,
962  150.,
963  100,
964  -150,
965  150);
966 
967  meCluTimeRes_[0] =
968  ibook.book1D("EtlCluTimeResZneg", "ETL cluster time resolution (-Z);T_{RECO}-T_{SIM} [ns]", 100, -0.5, 0.5);
969  meCluTimeRes_[1] =
970  ibook.book1D("EtlCluTimeResZpos", "ETL cluster time resolution (+Z);T_{RECO}-T_{SIM} [MeV]", 100, -0.5, 0.5);
971  meCluEnergyRes_[0] =
972  ibook.book1D("EtlCluEnergyResZneg", "ETL cluster energy resolution (-Z);E_{RECO}-E_{SIM}", 100, -0.5, 0.5);
973  meCluEnergyRes_[1] =
974  ibook.book1D("EtlCluEnergyResZpos", "ETL cluster energy resolution (+Z);E_{RECO}-E_{SIM}", 100, -0.5, 0.5);
975 
976  meCluTPullvsE_[0] =
977  ibook.bookProfile("EtlCluTPullvsEZneg",
978  "ETL cluster time pull vs E (-Z);E_{SIM} [MeV];(T_{RECO}-T_{SIM})/#sigma_{T_{RECO}}",
979  25,
980  0.,
981  0.5,
982  -5.,
983  5.,
984  "S");
985  meCluTPullvsE_[1] =
986  ibook.bookProfile("EtlCluTPullvsEZpos",
987  "ETL cluster time pull vs E (+Z);E_{SIM} [MeV];(T_{RECO}-T_{SIM})/#sigma_{T_{RECO}}",
988  25,
989  0.,
990  0.5,
991  -5.,
992  5.,
993  "S");
994  meCluTPullvsEta_[0] =
995  ibook.bookProfile("EtlCluTPullvsEtaZneg",
996  "ETL cluster time pull vs #eta (-Z);|#eta_{RECO}|;(T_{RECO}-T_{SIM})/#sigma_{T_{RECO}}",
997  30,
998  -3.,
999  -1.65,
1000  -5.,
1001  5.,
1002  "S");
1003  meCluTPullvsEta_[1] =
1004  ibook.bookProfile("EtlCluTPullvsEtaZpos",
1005  "ETL cluster time pull vs #eta (+Z);|#eta_{RECO}|;(T_{RECO}-T_{SIM})/#sigma_{T_{RECO}}",
1006  30,
1007  1.65,
1008  3.,
1009  -5.,
1010  5.,
1011  "S");
1012  meCluXRes_[0] = ibook.book1D("EtlCluXResZneg", "ETL cluster X resolution (-Z);X_{RECO}-X_{SIM} [cm]", 100, -0.1, 0.1);
1013  meCluXRes_[1] = ibook.book1D("EtlCluXResZpos", "ETL cluster X resolution (+Z);X_{RECO}-X_{SIM} [cm]", 100, -0.1, 0.1);
1014  meCluYRes_[0] = ibook.book1D("EtlCluYResZneg", "ETL cluster Y resolution (-Z);Y_{RECO}-Y_{SIM} [cm]", 100, -0.1, 0.1);
1015  meCluYRes_[1] = ibook.book1D("EtlCluYResZpos", "ETL cluster Y resolution (+Z);Y_{RECO}-Y_{SIM} [cm]", 100, -0.1, 0.1);
1016  meCluZRes_[0] =
1017  ibook.book1D("EtlCluZResZneg", "ETL cluster Z resolution (-Z);Z_{RECO}-Z_{SIM} [cm]", 100, -0.003, 0.003);
1018  meCluZRes_[1] =
1019  ibook.book1D("EtlCluZResZpos", "ETL cluster Z resolution (+Z);Z_{RECO}-Z_{SIM} [cm]", 100, -0.003, 0.003);
1020  if (optionalPlots_) {
1021  meCluXPull_[0] =
1022  ibook.book1D("EtlCluXPullZneg", "ETL cluster X pull (-Z);X_{RECO}-X_{SIM}/sigmaX_[RECO] [cm]", 100, -5., 5.);
1023  meCluXPull_[1] =
1024  ibook.book1D("EtlCluXPullZpos", "ETL cluster X pull (+Z);X_{RECO}-X_{SIM}/sigmaX_[RECO] [cm]", 100, -5., 5.);
1025  meCluYPull_[0] =
1026  ibook.book1D("EtlCluYPullZneg", "ETL cluster Y pull (-Z);Y_{RECO}-Y_{SIM}/sigmaY_[RECO] [cm]", 100, -5., 5.);
1027  meCluYPull_[1] =
1028  ibook.book1D("EtlCluYPullZpos", "ETL cluster Y pull (+Z);Y_{RECO}-Y_{SIM}/sigmaY_[RECO] [cm]", 100, -5., 5.);
1029  meCluYXLocal_[0] = ibook.book2D("EtlCluYXLocalZneg",
1030  "ETL cluster local Y vs X (-Z);X^{local}_{RECO} [cm];Y^{local}_{RECO} [cm]",
1031  100,
1032  -2.2,
1033  2.2,
1034  100,
1035  -1.1,
1036  1.1);
1037  meCluYXLocal_[1] = ibook.book2D("EtlCluYXLocalZpos",
1038  "ETL cluster local Y vs X (+Z);X^{local}_{RECO} [cm];Y^{local}_{RECO} [cm]",
1039  100,
1040  -2.2,
1041  2.2,
1042  100,
1043  -1.1,
1044  1.1);
1045  meCluYXLocalSim_[0] = ibook.book2D("EtlCluYXLocalSimZneg",
1046  "ETL cluster local Y vs X (-Z);X^{local}_{SIM} [cm];Y^{local}_{SIM} [cm]",
1047  200,
1048  -2.2,
1049  2.2,
1050  200,
1051  -1.1,
1052  1.1);
1053  meCluYXLocalSim_[1] = ibook.book2D("EtlCluYXLocalSimZpos",
1054  "ETL cluster local Y vs X (+Z);X^{local}_{SIM} [cm];Y^{local}_{SIM} [cm]",
1055  200,
1056  -2.2,
1057  2.2,
1058  200,
1059  -1.1,
1060  1.1);
1061  meCluXLocalErr_[0] =
1062  ibook.book1D("EtlCluXLocalErrNeg", "ETL cluster X local error (-Z);sigmaX_{RECO,loc} [cm]", 50, 0., 0.2);
1063  meCluXLocalErr_[1] =
1064  ibook.book1D("EtlCluXLocalErrPos", "ETL cluster X local error (+Z);sigmaX_{RECO,loc} [cm]", 50, 0., 0.2);
1065  meCluYLocalErr_[0] =
1066  ibook.book1D("EtlCluYLocalErrNeg", "ETL cluster Y local error (-Z);sigmaY_{RECO,loc} [cm]", 50., 0., 0.2);
1067  meCluYLocalErr_[1] =
1068  ibook.book1D("EtlCluYLocalErrPos", "ETL cluster Y local error (+Z);sigmaY_{RECO,loc} [cm]", 50, 0., 0.2);
1069  }
1070  meUnmatchedCluEnergy_[0] = ibook.book1D(
1071  "EtlUnmatchedCluEnergyNeg", "ETL unmatched cluster log10(energy) (-Z);log10(E_{RECO} [MeV])", 5, -3, 2);
1072  meUnmatchedCluEnergy_[1] = ibook.book1D(
1073  "EtlUnmatchedCluEnergyPos", "ETL unmatched cluster log10(energy) (+Z);log10(E_{RECO} [MeV])", 5, -3, 2);
1074 
1075  // --- UncalibratedRecHits histograms
1076 
1077  if (uncalibRecHitsPlots_) {
1078  const std::string det_name[2] = {"ETL-", "ETL+"};
1079  for (unsigned int iside = 0; iside < 2; ++iside) {
1080  for (unsigned int ihistoQ = 0; ihistoQ < nBinsQ_; ++ihistoQ) {
1081  std::string hname = Form("TimeResQ_%d_%d", iside, ihistoQ);
1082  std::string htitle =
1083  Form("%s time resolution (Q bin = %d);T_{RECO} - T_{SIM} [ns]", det_name[iside].data(), ihistoQ);
1084  meTimeResQ_[iside][ihistoQ] = ibook.book1D(hname, htitle, 200, -0.5, 0.5);
1085 
1086  } // ihistoQ loop
1087 
1088  for (unsigned int ihistoEta = 0; ihistoEta < nBinsEta_; ++ihistoEta) {
1089  std::string hname = Form("TimeResEta_%d_%d", iside, ihistoEta);
1090  std::string htitle =
1091  Form("%s time resolution (|#eta| bin = %d);T_{RECO} - T_{SIM} [ns]", det_name[iside].data(), ihistoEta);
1092  meTimeResEta_[iside][ihistoEta] = ibook.book1D(hname, htitle, 200, -0.5, 0.5);
1093 
1094  } // ihistoEta loop
1095  }
1096  }
1097 }
1098 
1099 // ------------ method fills 'descriptions' with the allowed parameters for the module ------------
1102 
1103  desc.add<std::string>("folder", "MTD/ETL/LocalReco");
1104  desc.add<edm::InputTag>("recHitsTag", edm::InputTag("mtdRecHits", "FTLEndcap"));
1105  desc.add<edm::InputTag>("uncalibRecHitsTag", edm::InputTag("mtdUncalibratedRecHits", "FTLEndcap"));
1106  desc.add<edm::InputTag>("simHitsTag", edm::InputTag("mix", "g4SimHitsFastTimerHitsEndcap"));
1107  desc.add<edm::InputTag>("recCluTag", edm::InputTag("mtdClusters", "FTLEndcap"));
1108  desc.add<edm::InputTag>("trkHitTag", edm::InputTag("mtdTrackingRecHits"));
1109  desc.add<double>("hitMinimumEnergy1Dis", 1.); // [MeV]
1110  desc.add<double>("hitMinimumEnergy2Dis", 0.001); // [MeV]
1111  desc.add<bool>("optionalPlots", false);
1112  desc.add<bool>("UncalibRecHitsPlots", false);
1113  desc.add<double>("HitMinimumAmplitude", 0.33); // [MIP]
1114 
1115  descriptions.add("etlLocalRecoValid", desc);
1116 }
1117 
uint8_t geoId(const VFATFrame &frame)
retrieve the GEO information for this channel
int getMTDTopologyMode() const
Definition: MTDTopology.h:27
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< FTLUncalibratedRecHitCollection > etlUncalibRecHitsToken_
edm::EDGetTokenT< CrossingFrame< PSimHit > > etlSimHitsToken_
std::string folder_
float x() const
Definition: FTLCluster.h:120
int size() const
Definition: FTLCluster.h:141
MonitorElement * meCluXRes_[2]
bool isSameCluster(const FTLCluster &, const FTLCluster &)
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * meHitTime_[4]
T z() const
Definition: PV3DBase.h:61
virtual const Topology & topology() const
Definition: GeomDet.cc:67
MonitorElement * meOccupancy_[4]
MonitorElement * meCluYLocalErr_[2]
MonitorElement * meCluTPullvsEta_[2]
virtual const PixelTopology & specificTopology() const
MonitorElement * meCluTimeError_[4]
static constexpr float etaMin_
MonitorElement * meCluOccupancy_[4]
MonitorElement * meCluTime_[4]
MonitorElement * meNhits_[4]
Definition: weight.py:1
MonitorElement * meUnmatchedCluEnergy_[2]
MonitorElement * meTimeResEta_[2][nBinsEta_]
int zside(DetId const &)
MonitorElement * meHitTvsE_[4]
MonitorElement * meCluEnergy_[4]
ETLDetId geographicalId() const
Definition: ETLDetId.h:110
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
constexpr NumType convertUnitsTo(double desiredUnits, NumType val)
Definition: GeantUnits.h:73
EtlLocalRecoValidation(const edm::ParameterSet &)
void Fill(long long x)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
MonitorElement * meHitEvsEta_[4]
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdtopoToken_
float y() const
Definition: FTLCluster.h:125
MonitorElement * meHitTvsEta_[4]
MonitorElement * meCluTimeRes_[2]
int iEvent
Definition: GenABIO.cc:224
MonitorElement * meCluHits_[4]
MonitorElement * meHitPhi_[4]
float localX(const float mpX) const override
edm::EDGetTokenT< FTLRecHitCollection > etlRecHitsToken_
MonitorElement * meHitEta_[4]
edm::EDGetTokenT< MTDTrackingDetSetVector > mtdTrackingHitToken_
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
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
T sqrt(T t)
Definition: SSEVec.h:19
MonitorElement * meCluXPull_[2]
int module() const
Definition: ETLDetId.h:105
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MonitorElement * meHitTimeError_[4]
static constexpr int nBinsEta_
int mtdRR() const
Definition: MTDDetId.h:64
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > mtdgeoToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ETLDetId::EtlLayout etlLayoutFromTopoMode(const int &topoMode)
float localY(const float mpY) const override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
MonitorElement * meHitYlocal_[2]
Definition: DetId.h:17
const DetId & id() const
Definition: FTLCluster.h:178
MonitorElement * meTimeResQ_[2][nBinsQ_]
MonitorElement * meCluZRes_[2]
constexpr NumType convertMmToCm(NumType millimeters)
Definition: angle_units.h:44
MonitorElement * meLocalOccupancy_[2]
int discSide() const
Definition: ETLDetId.h:119
MonitorElement * meCluYXLocal_[2]
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
MonitorElement * meCluYXLocalSim_[2]
A 2D TrackerRecHit with time and time error information.
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 add(std::string const &label, ParameterSetDescription const &psetDescription)
int zside() const
Definition: MTDDetId.h:61
static constexpr float binWidthEta_
Detector identifier class for the Endcap Timing Layer.
Definition: ETLDetId.h:15
void analyze(const edm::Event &, const edm::EventSetup &) override
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int nDisc() const
Definition: ETLDetId.h:124
edm::EDGetTokenT< FTLClusterCollection > etlRecCluToken_
MonitorElement * meHitTvsPhi_[4]
MonitorElement * meCluXLocalErr_[2]
MonitorElement * meHitEvsPhi_[4]
MonitorElement * meCluYPull_[2]
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:162
static constexpr float binWidthQ_
float time() const
Definition: FTLCluster.h:130
MonitorElement * meCluTPullvsE_[2]
MonitorElement * meHitEnergy_[4]
MonitorElement * meHitXlocal_[2]
Log< level::Warning, false > LogWarning
MonitorElement * meCluYRes_[2]
auto makeValid(const U &iOtherHandleType) noexcept(false)
Definition: ValidHandle.h:52
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
static constexpr int nBinsQ_
Definition: Run.h:45
#define LogDebug(id)
MonitorElement * meCluEnergyRes_[2]