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