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