92 hitMinEnergy1Dis_(iConfig.getParameter<double>(
"hitMinimumEnergy1Dis")),
93 hitMinEnergy2Dis_(iConfig.getParameter<double>(
"hitMinimumEnergy2Dis")) {
95 mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
110 const MTDTopology* topology = topologyHandle.product();
112 bool topo1Dis =
false;
113 bool topo2Dis =
false;
123 std::unordered_map<uint32_t, MTDHit> m_etlHits[4];
124 std::unordered_map<uint32_t, std::set<int> > m_etlTrkPerCell[4];
130 for (
auto const&
simHit : etlSimHits) {
137 if (
id.
zside() == -1) {
139 }
else if (
id.
zside() == 1) {
147 if ((
id.
zside() == -1) && (
id.nDisc() == 1)) {
149 }
else if ((
id.
zside() == -1) && (
id.nDisc() == 2)) {
151 }
else if ((
id.
zside() == 1) && (
id.nDisc() == 1)) {
153 }
else if ((
id.
zside() == 1) && (
id.nDisc() == 2)) {
160 m_etlTrkPerCell[idet][
id.rawId()].insert(
simHit.trackId());
162 auto simHitIt = m_etlHits[idet].emplace(
id.rawId(),
MTDHit()).first;
168 if ((simHitIt->second).time == 0 ||
simHit.tof() < (simHitIt->second).
time) {
171 auto hit_pos =
simHit.localPosition();
172 (simHitIt->second).
x = hit_pos.x();
173 (simHitIt->second).
y = hit_pos.y();
174 (simHitIt->second).
z = hit_pos.z();
183 for (
int idet = 0; idet < 4; ++idet) {
184 if (((idet == 1) || (idet == 3)) && (topo1Dis ==
true))
188 for (
auto const&
hit : m_etlTrkPerCell[idet]) {
192 for (
auto const&
hit : m_etlHits[idet]) {
206 if (thedet ==
nullptr)
207 throw cms::Exception(
"EtlSimHitsValidation") <<
"GeographicalID: " << std::hex <<
geoId.rawId() <<
" (" 208 << detId.
rawId() <<
") is invalid!" <<
std::dec << std::endl;
212 const auto& global_point = thedet->
toGlobal(local_point);
214 if (topo2Dis && (detId.
discSide() == 1)) {
251 "Number of ETL cells with SIM hits (-Z, Single(topo1D)/First(topo2D) disk);N_{ETL cells}",
256 "EtlNhitsZnegD2",
"Number of ETL cells with SIM hits (-Z, Second disk);N_{ETL cells}", 100, 0., 5000.);
258 "Number of ETL cells with SIM hits (+Z, Single(topo1D)/First(topo2D) disk);N_{ETL cells}",
263 "EtlNhitsZposD2",
"Number of ETL cells with SIM hits (+Z, Second Disk);N_{ETL cells}", 100, 0., 5000.);
265 "Number of tracks per ETL sensor (-Z, Single(topo1D)/First(topo2D) disk);N_{trk}",
270 ibook.
book1D(
"EtlNtrkPerCellZnegD2",
"Number of tracks per ETL sensor (-Z, Second disk);N_{trk}", 10, 0., 10.);
272 "Number of tracks per ETL sensor (+Z, Single(topo1D)/First(topo2D) disk);N_{trk}",
277 ibook.
book1D(
"EtlNtrkPerCellZposD2",
"Number of tracks per ETL sensor (+Z, Second disk);N_{trk}", 10, 0., 10.);
279 "EtlHitEnergyZnegD1",
"ETL SIM hits energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.);
281 ibook.
book1D(
"EtlHitEnergyZnegD2",
"ETL SIM hits energy (-Z, Second disk);E_{SIM} [MeV]", 100, 0., 3.);
283 "EtlHitEnergyZposD1",
"ETL SIM hits energy (+Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV]", 100, 0., 3.);
285 ibook.
book1D(
"EtlHitEnergyZposD2",
"ETL SIM hits energy (+Z, Second disk);E_{SIM} [MeV]", 100, 0., 3.);
287 "EtlHitTimeZnegD1",
"ETL SIM hits ToA (-Z, Single(topo1D)/First(topo2D) disk);ToA_{SIM} [ns]", 100, 0., 25.);
288 meHitTime_[1] = ibook.
book1D(
"EtlHitTimeZnegD2",
"ETL SIM hits ToA (-Z, Second disk);ToA_{SIM} [ns]", 100, 0., 25.);
290 "EtlHitTimeZposD1",
"ETL SIM hits ToA (+Z, Single(topo1D)/First(topo2D) disk);ToA_{SIM} [ns]", 100, 0., 25.);
291 meHitTime_[3] = ibook.
book1D(
"EtlHitTimeZposD2",
"ETL SIM hits ToA (+Z, Second disk);ToA_{SIM} [ns]", 100, 0., 25.);
294 "ETL SIM local X (-Z, Single(topo1D)/First(topo2D) disk);X_{SIM}^{LOC} [mm]",
299 ibook.
book1D(
"EtlHitXlocalZnegD2",
"ETL SIM local X (-Z, Second disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.);
301 "ETL SIM local X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM}^{LOC} [mm]",
306 ibook.
book1D(
"EtlHitXlocalZposD2",
"ETL SIM local X (+Z, Second disk);X_{SIM}^{LOC} [mm]", 100, -25., 25.);
309 "ETL SIM local Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{SIM}^{LOC} [mm]",
314 ibook.
book1D(
"EtlHitYlocalZnegD2",
"ETL SIM local Y (-Z, Second Disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.);
316 "ETL SIM local Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM}^{LOC} [mm]",
321 ibook.
book1D(
"EtlHitYlocalZposD2",
"ETL SIM local Y (+Z, Second disk);Y_{SIM}^{LOC} [mm]", 100, -48., 48.);
323 "ETL SIM local Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM}^{LOC} [mm]",
328 ibook.
book1D(
"EtlHitZlocalZnegD2",
"ETL SIM local Z (-Z, Second disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16);
330 "ETL SIM local Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM}^{LOC} [mm]",
335 ibook.
book1D(
"EtlHitZlocalZposD2",
"ETL SIM local Z (+Z, Second disk);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16);
338 ibook.
book2D(
"EtlOccupancyZnegD1",
339 "ETL SIM hits occupancy (-Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm];Y_{SIM} [cm]",
347 "ETL SIM hits occupancy (-Z, Second disk);X_{SIM} [cm];Y_{SIM} [cm]",
355 ibook.
book2D(
"EtlOccupancyZposD1",
356 "ETL SIM hits occupancy (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm];Y_{SIM} [cm]",
364 "ETL SIM hits occupancy (+Z, Second disk);X_{SIM} [cm];Y_{SIM} [cm]",
373 "EtlHitXZnegD1",
"ETL SIM hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm]", 100, -130., 130.);
374 meHitX_[1] = ibook.
book1D(
"EtlHitXZnegD2",
"ETL SIM hits X (-Z, Second disk);X_{SIM} [cm]", 100, -130., 130.);
376 "EtlHitXZposD1",
"ETL SIM hits X (+Z, Single(topo1D)/First(topo2D) disk);X_{SIM} [cm]", 100, -130., 130.);
377 meHitX_[3] = ibook.
book1D(
"EtlHitXZposD2",
"ETL SIM hits X (+Z, Second disk);X_{SIM} [cm]", 100, -130., 130.);
379 "EtlHitYZnegD1",
"ETL SIM hits Y (-Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.);
380 meHitY_[1] = ibook.
book1D(
"EtlHitYZnegD2",
"ETL SIM hits Y (-Z, Second disk);Y_{SIM} [cm]", 100, -130., 130.);
382 "EtlHitYZposD1",
"ETL SIM hits Y (+Z, Single(topo1D)/First(topo2D) disk);Y_{SIM} [cm]", 100, -130., 130.);
383 meHitY_[3] = ibook.
book1D(
"EtlHitYZposD2",
"ETL SIM hits Y (+Z, Second disk);Y_{SIM} [cm]", 100, -130., 130.);
385 "EtlHitZZnegD1",
"ETL SIM hits Z (-Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, -302., -298.);
386 meHitZ_[1] = ibook.
book1D(
"EtlHitZZnegD2",
"ETL SIM hits Z (-Z, Second disk);Z_{SIM} [cm]", 100, -304., -300.);
388 "EtlHitZZposD1",
"ETL SIM hits Z (+Z, Single(topo1D)/First(topo2D) disk);Z_{SIM} [cm]", 100, 298., 302.);
389 meHitZ_[3] = ibook.
book1D(
"EtlHitZZposD2",
"ETL SIM hits Z (+Z, Second disk);Z_{SIM} [cm]", 100, 300., 304.);
392 "EtlHitPhiZnegD1",
"ETL SIM hits #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15);
394 ibook.
book1D(
"EtlHitPhiZnegD2",
"ETL SIM hits #phi (-Z, Second disk);#phi_{SIM} [rad]", 100, -3.15, 3.15);
396 "EtlHitPhiZposD1",
"ETL SIM hits #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad]", 100, -3.15, 3.15);
398 ibook.
book1D(
"EtlHitPhiZposD2",
"ETL SIM hits #phi (+Z, Second disk);#phi_{SIM} [rad]", 100, -3.15, 3.15);
400 "EtlHitEtaZnegD1",
"ETL SIM hits #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM}", 100, -3.2, -1.56);
401 meHitEta_[1] = ibook.
book1D(
"EtlHitEtaZnegD2",
"ETL SIM hits #eta (-Z, Second disk);#eta_{SIM}", 100, -3.2, -1.56);
403 "EtlHitEtaZposD1",
"ETL SIM hits #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM}", 100, 1.56, 3.2);
404 meHitEta_[3] = ibook.
book1D(
"EtlHitEtaZposD2",
"ETL SIM hits #eta (+Z, Second disk);#eta_{SIM}", 100, 1.56, 3.2);
408 "ETL SIM time vs energy (-Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV];T_{SIM} [ns]",
415 "EtlHitTvsEZnegD2",
"ETL SIM time vs energy (-Z, Second disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.);
418 "ETL SIM time vs energy (+Z, Single(topo1D)/First(topo2D) disk);E_{SIM} [MeV];T_{SIM} [ns]",
425 "EtlHitTvsEZposD2",
"ETL SIM time vs energy (+Z, Second disk);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.);
428 "ETL SIM energy vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];E_{SIM} [MeV]",
435 "ETL SIM energy vs #phi (-Z, Second disk);#phi_{SIM} [rad];E_{SIM} [MeV]",
443 "ETL SIM energy vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];E_{SIM} [MeV]",
450 "ETL SIM energy vs #phi (+Z, Second disk);#phi_{SIM} [rad];E_{SIM} [MeV]",
458 "ETL SIM energy vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};E_{SIM} [MeV]",
465 "ETL SIM energy vs #eta (-Z, Second disk);#eta_{SIM};E_{SIM} [MeV]",
473 "ETL SIM energy vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};E_{SIM} [MeV]",
480 "ETL SIM energy vs #eta (+Z, Second disk);#eta_{SIM};E_{SIM} [MeV]",
488 "ETL SIM time vs #phi (-Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];T_{SIM} [ns]",
495 "ETL SIM time vs #phi (-Z, Second disk);#phi_{SIM} [rad];T_{SIM} [ns]",
503 "ETL SIM time vs #phi (+Z, Single(topo1D)/First(topo2D) disk);#phi_{SIM} [rad];T_{SIM} [ns]",
510 "ETL SIM time vs #phi (+Z, Second disk);#phi_{SIM} [rad];T_{SIM} [ns]",
518 "ETL SIM time vs #eta (-Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]",
525 "EtlHitTvsEtaZnegD2",
"ETL SIM time vs #eta (-Z, Second disk);#eta_{SIM};T_{SIM} [ns]", 50, -3.2, -1.56, 0., 100.);
528 "ETL SIM time vs #eta (+Z, Single(topo1D)/First(topo2D) disk);#eta_{SIM};T_{SIM} [ns]",
535 "EtlHitTvsEtaZposD2",
"ETL SIM time vs #eta (+Z, Second disk);#eta_{SIM};T_{SIM} [ns]", 50, 1.56, 3.2, 0., 100.);
544 desc.add<
double>(
"hitMinimumEnergy1Dis", 0.1);
545 desc.add<
double>(
"hitMinimumEnergy2Dis", 0.001);
547 descriptions.
add(
"etlSimHitsValid",
desc);
uint8_t geoId(const VFATFrame &frame)
retrieve the GEO information for this channel
int getMTDTopologyMode() const
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]
ETLDetId geographicalId() const
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())
const float hitMinEnergy1Dis_
MonitorElement * meHitTvsPhi_[4]
#define DEFINE_FWK_MODULE(type)
MonitorElement * meHitX_[4]
MonitorElement * meHitEvsEta_[4]
MonitorElement * meHitEta_[4]
ETLDetId::EtlLayout etlLayoutFromTopoMode(const int &topoMode)
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_
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]