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