91 hitMinEnergy2Dis_(iConfig.getParameter<double>(
"hitMinimumEnergy2Dis")) {
93 mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
110 std::unordered_map<uint32_t, MTDHit> m_etlHits[4];
111 std::unordered_map<uint32_t, std::set<int> > m_etlTrkPerCell[4];
119 for (
auto const&
simHit : etlSimHits) {
121 LogDebug(
"EtlSimHitsValidation") <<
"SimHit # " <<
index <<
" detId " <<
simHit.detUnitId() <<
" ene " 129 if ((
id.
zside() == -1) && (
id.nDisc() == 1)) {
131 }
else if ((
id.
zside() == -1) && (
id.nDisc() == 2)) {
133 }
else if ((
id.
zside() == 1) && (
id.nDisc() == 1)) {
135 }
else if ((
id.
zside() == 1) && (
id.nDisc() == 2)) {
138 edm::LogWarning(
"EtlSimHitsValidation") <<
"Unknown ETL DetId configuration: " <<
id;
142 m_etlTrkPerCell[idet][
id.rawId()].insert(
simHit.trackId());
144 auto simHitIt = m_etlHits[idet].emplace(
id.
rawId(),
MTDHit()).first;
150 if ((simHitIt->second).time == 0 ||
simHit.tof() < (simHitIt->second).
time) {
153 auto hit_pos =
simHit.localPosition();
154 (simHitIt->second).
x = hit_pos.x();
155 (simHitIt->second).
y = hit_pos.y();
156 (simHitIt->second).
z = hit_pos.z();
158 LogDebug(
"EtlSimHitsValidation") <<
"Registered in idet " << idet;
166 for (
int idet = 0; idet < 4; ++idet) {
168 LogDebug(
"EtlSimHitsValidation") <<
"idet " << idet <<
" #hits " << m_etlHits[idet].size();
170 for (
auto const&
hit : m_etlTrkPerCell[idet]) {
174 for (
auto const&
hit : m_etlHits[idet]) {
182 if (thedet ==
nullptr)
183 throw cms::Exception(
"EtlSimHitsValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" 184 <<
detId.rawId() <<
") is invalid!" <<
std::dec << std::endl;
188 const auto& global_point = thedet->
toGlobal(local_point);
190 if (
detId.discSide() == 1) {
227 "Number of ETL cells with SIM hits (-Z, Single(topo1D)/First(topo2D) disk);N_{ETL cells}",
232 "EtlNhitsZnegD2",
"Number of ETL cells with SIM hits (-Z, Second disk);N_{ETL cells}", 100, 0., 5000.);
234 "Number of ETL cells with SIM hits (+Z, Single(topo1D)/First(topo2D) disk);N_{ETL cells}",
239 "EtlNhitsZposD2",
"Number of ETL cells with SIM hits (+Z, Second Disk);N_{ETL cells}", 100, 0., 5000.);
241 "Number of tracks per ETL sensor (-Z, Single(topo1D)/First(topo2D) disk);N_{trk}",
246 ibook.
book1D(
"EtlNtrkPerCellZnegD2",
"Number of tracks per ETL sensor (-Z, Second disk);N_{trk}", 10, 0., 10.);
248 "Number of tracks per ETL sensor (+Z, Single(topo1D)/First(topo2D) disk);N_{trk}",
253 ibook.
book1D(
"EtlNtrkPerCellZposD2",
"Number of tracks per ETL sensor (+Z, Second disk);N_{trk}", 10, 0., 10.);
255 "EtlHitEnergyZnegD1",
"ETL SIM hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.);
257 ibook.
book1D(
"EtlHitEnergyZnegD2",
"ETL SIM hits energy (-Z, Second disk);E_{SIM} [MeV]", 100, 0., 3.);
259 "EtlHitEnergyZposD1",
"ETL SIM hits energy (+Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.);
261 ibook.
book1D(
"EtlHitEnergyZposD2",
"ETL SIM hits energy (+Z, Second disk);E_{SIM} [MeV]", 100, 0., 3.);
263 "EtlHitTimeZnegD1",
"ETL SIM hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{SIM} [ns]", 100, 0., 25.);
264 meHitTime_[1] = ibook.
book1D(
"EtlHitTimeZnegD2",
"ETL SIM hits ToA (-Z, Second disk);ToA_{SIM} [ns]", 100, 0., 25.);
266 "EtlHitTimeZposD1",
"ETL SIM hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{SIM} [ns]", 100, 0., 25.);
267 meHitTime_[3] = ibook.
book1D(
"EtlHitTimeZposD2",
"ETL SIM hits ToA (+Z, Second disk);ToA_{SIM} [ns]", 100, 0., 25.);
270 "ETL SIM local X (-Z, Single(topo1D)/First(topo2D) disk);X_{SIM}^{LOC} [mm]",
275 ibook.
book1D(
"EtlHitXlocalZnegD2",
"ETL SIM local X (-Z, Second disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.);
277 "ETL SIM local X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM}^{LOC} [mm]",
282 ibook.
book1D(
"EtlHitXlocalZposD2",
"ETL SIM local X (+Z, Second disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.);
285 "ETL SIM local Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{SIM}^{LOC} [mm]",
290 ibook.
book1D(
"EtlHitYlocalZnegD2",
"ETL SIM local Y (-Z, Second Disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.);
292 "ETL SIM local Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM}^{LOC} [mm]",
297 ibook.
book1D(
"EtlHitYlocalZposD2",
"ETL SIM local Y (+Z, Second disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.);
299 "ETL SIM local Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM}^{LOC} [mm]",
304 ibook.
book1D(
"EtlHitZlocalZnegD2",
"ETL SIM local Z (-Z, Second disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16);
306 "ETL SIM local Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM}^{LOC} [mm]",
311 ibook.
book1D(
"EtlHitZlocalZposD2",
"ETL SIM local Z (+Z, Second disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16);
314 ibook.
book2D(
"EtlOccupancyZnegD1",
315 "ETL SIM hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm];Y_{SIM} [cm]",
323 "ETL SIM hits occupancy (-Z, Second disk);X_{SIM} [cm];Y_{SIM} [cm]",
331 ibook.
book2D(
"EtlOccupancyZposD1",
332 "ETL SIM hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm];Y_{SIM} [cm]",
340 "ETL SIM hits occupancy (+Z, Second disk);X_{SIM} [cm];Y_{SIM} [cm]",
349 "EtlHitXZnegD1",
"ETL SIM hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm]", 100, -130., 130.);
350 meHitX_[1] = ibook.
book1D(
"EtlHitXZnegD2",
"ETL SIM hits X (-Z, Second disk);X_{SIM} [cm]", 100, -130., 130.);
352 "EtlHitXZposD1",
"ETL SIM hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm]", 100, -130., 130.);
353 meHitX_[3] = ibook.
book1D(
"EtlHitXZposD2",
"ETL SIM hits X (+Z, Second disk);X_{SIM} [cm]", 100, -130., 130.);
355 "EtlHitYZnegD1",
"ETL SIM hits Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.);
356 meHitY_[1] = ibook.
book1D(
"EtlHitYZnegD2",
"ETL SIM hits Y (-Z, Second disk);Y_{SIM} [cm]", 100, -130., 130.);
358 "EtlHitYZposD1",
"ETL SIM hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.);
359 meHitY_[3] = ibook.
book1D(
"EtlHitYZposD2",
"ETL SIM hits Y (+Z, Second disk);Y_{SIM} [cm]", 100, -130., 130.);
361 "EtlHitZZnegD1",
"ETL SIM hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, -302., -298.);
362 meHitZ_[1] = ibook.
book1D(
"EtlHitZZnegD2",
"ETL SIM hits Z (-Z, Second disk);Z_{SIM} [cm]", 100, -304., -300.);
364 "EtlHitZZposD1",
"ETL SIM hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, 298., 302.);
365 meHitZ_[3] = ibook.
book1D(
"EtlHitZZposD2",
"ETL SIM hits Z (+Z, Second disk);Z_{SIM} [cm]", 100, 300., 304.);
368 "EtlHitPhiZnegD1",
"ETL SIM hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15);
370 ibook.
book1D(
"EtlHitPhiZnegD2",
"ETL SIM hits #phi (-Z, Second disk);#phi_{SIM} [rad]", 100, -3.15, 3.15);
372 "EtlHitPhiZposD1",
"ETL SIM hits #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15);
374 ibook.
book1D(
"EtlHitPhiZposD2",
"ETL SIM hits #phi (+Z, Second disk);#phi_{SIM} [rad]", 100, -3.15, 3.15);
376 "EtlHitEtaZnegD1",
"ETL SIM hits #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM}", 100, -3.2, -1.56);
377 meHitEta_[1] = ibook.
book1D(
"EtlHitEtaZnegD2",
"ETL SIM hits #eta (-Z, Second disk);#eta_{SIM}", 100, -3.2, -1.56);
379 "EtlHitEtaZposD1",
"ETL SIM hits #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM}", 100, 1.56, 3.2);
380 meHitEta_[3] = ibook.
book1D(
"EtlHitEtaZposD2",
"ETL SIM hits #eta (+Z, Second disk);#eta_{SIM}", 100, 1.56, 3.2);
384 "ETL SIM time vs energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV];T_{SIM} [ns]",
391 "EtlHitTvsEZnegD2",
"ETL SIM time vs energy (-Z, Second disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.);
394 "ETL SIM time vs energy (+Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV];T_{SIM} [ns]",
401 "EtlHitTvsEZposD2",
"ETL SIM time vs energy (+Z, Second disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.);
404 "ETL SIM energy vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];E_{SIM} [MeV]",
411 "ETL SIM energy vs #phi (-Z, Second disk);#phi_{SIM} [rad];E_{SIM} [MeV]",
419 "ETL SIM energy vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];E_{SIM} [MeV]",
426 "ETL SIM energy vs #phi (+Z, Second disk);#phi_{SIM} [rad];E_{SIM} [MeV]",
434 "ETL SIM energy vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};E_{SIM} [MeV]",
441 "ETL SIM energy vs #eta (-Z, Second disk);#eta_{SIM};E_{SIM} [MeV]",
449 "ETL SIM energy vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};E_{SIM} [MeV]",
456 "ETL SIM energy vs #eta (+Z, Second disk);#eta_{SIM};E_{SIM} [MeV]",
464 "ETL SIM time vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];T_{SIM} [ns]",
471 "ETL SIM time vs #phi (-Z, Second disk);#phi_{SIM} [rad];T_{SIM} [ns]",
479 "ETL SIM time vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];T_{SIM} [ns]",
486 "ETL SIM time vs #phi (+Z, Second disk);#phi_{SIM} [rad];T_{SIM} [ns]",
494 "ETL SIM time vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]",
501 "EtlHitTvsEtaZnegD2",
"ETL SIM time vs #eta (-Z, Second disk);#eta_{SIM};T_{SIM} [ns]", 50, -3.2, -1.56, 0., 100.);
504 "ETL SIM time vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]",
511 "EtlHitTvsEtaZposD2",
"ETL SIM time vs #eta (+Z, Second disk);#eta_{SIM};T_{SIM} [ns]", 50, 1.56, 3.2, 0., 100.);
520 desc.add<
double>(
"hitMinimumEnergy2Dis", 0.001);
522 descriptions.
add(
"etlSimHitsValid",
desc);
T getParameter(std::string const &) const
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > mtdgeoToken_
MonitorElement * meNhits_[4]
MonitorElement * meHitYlocal_[4]
virtual void setCurrentFolder(std::string const &fullpath)
edm::EDGetTokenT< CrossingFrame< PSimHit > > etlSimHitsToken_
~EtlSimHitsValidation() override
MonitorElement * meOccupancy_[4]
MonitorElement * meHitY_[4]
MonitorElement * meHitTvsEta_[4]
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
constexpr NumType convertUnitsTo(double desiredUnits, NumType val)
MonitorElement * meHitXlocal_[4]
EtlSimHitsValidation(const edm::ParameterSet &)
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())
MonitorElement * meHitTvsPhi_[4]
#define DEFINE_FWK_MODULE(type)
MonitorElement * meHitX_[4]
MonitorElement * meHitEvsEta_[4]
MonitorElement * meHitEta_[4]
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
MonitorElement * meHitTime_[4]
MonitorElement * meHitPhi_[4]
MonitorElement * meHitTvsE_[4]
constexpr NumType convertMmToCm(NumType millimeters)
constexpr uint32_t rawId() const
get the raw id
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void analyze(const edm::Event &, const edm::EventSetup &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Detector identifier class for the Endcap Timing Layer.
MonitorElement * meHitZlocal_[4]
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
const float hitMinEnergy2Dis_
Log< level::Warning, false > LogWarning
MonitorElement * meNtrkPerCell_[4]
MonitorElement * meHitEnergy_[4]
auto makeValid(const U &iOtherHandleType) noexcept(false)
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
const std::string folder_
MonitorElement * meHitEvsPhi_[4]
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdtopoToken_
MonitorElement * meHitZ_[4]