91 hitMinEnergy_(iConfig.getParameter<double>(
"hitMinimumEnergy")) {
108 std::unordered_map<uint32_t, MTDHit> m_etlHits[2];
109 std::unordered_map<uint32_t, std::set<int> > m_etlTrkPerCell[2];
112 for (
auto const&
simHit : *etlSimHitsHandle) {
119 int idet = (
id.zside() + 1) / 2;
121 m_etlTrkPerCell[idet][
id.rawId()].insert(
simHit.trackId());
123 auto simHitIt = m_etlHits[idet].emplace(
id.rawId(),
MTDHit()).first;
129 if ((simHitIt->second).time == 0 ||
simHit.tof() < (simHitIt->second).
time) {
132 auto hit_pos =
simHit.entryPoint();
133 (simHitIt->second).
x = hit_pos.x();
134 (simHitIt->second).
y = hit_pos.y();
135 (simHitIt->second).
z = hit_pos.z();
144 for (
int idet = 0; idet < 2; ++idet) {
147 for (
auto const&
hit : m_etlTrkPerCell[idet])
150 for (
auto const&
hit : m_etlHits[idet]) {
159 if (thedet ==
nullptr)
160 throw cms::Exception(
"EtlSimHitsValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" 161 << detId.
rawId() <<
") is invalid!" <<
std::dec << std::endl;
165 const auto& global_point = thedet->
toGlobal(local_point);
203 meNhits_[1] = ibook.
book1D(
"EtlNhitsZpos",
"Number of ETL cells with SIM hits (+Z);N_{ETL cells}", 100, 0., 5000.);
204 meNhits_[0] = ibook.
book1D(
"EtlNhitsZneg",
"Number of ETL cells with SIM hits (-Z);N_{ETL cells}", 100, 0., 5000.);
205 meNtrkPerCell_[1] = ibook.
book1D(
"EtlNtrkPerCellZpos",
"Number of tracks per ETL sensor (+Z);N_{trk}", 10, 0., 10.);
206 meNtrkPerCell_[0] = ibook.
book1D(
"EtlNtrkPerCellZneg",
"Number of tracks per ETL sensor (-Z);N_{trk}", 10, 0., 10.);
208 meHitEnergy_[1] = ibook.
book1D(
"EtlHitEnergyZpos",
"ETL SIM hits energy (+Z);E_{SIM} [MeV]", 100, 0., 3.);
209 meHitEnergy_[0] = ibook.
book1D(
"EtlHitEnergyZneg",
"ETL SIM hits energy (-Z);E_{SIM} [MeV]", 100, 0., 3.);
210 meHitTime_[1] = ibook.
book1D(
"EtlHitTimeZpos",
"ETL SIM hits ToA (+Z);ToA_{SIM} [ns]", 100, 0., 25.);
211 meHitTime_[0] = ibook.
book1D(
"EtlHitTimeZneg",
"ETL SIM hits ToA (-Z);ToA_{SIM} [ns]", 100, 0., 25.);
213 meHitXlocal_[1] = ibook.
book1D(
"EtlHitXlocalZpos",
"ETL SIM local X (+Z);X_{SIM}^{LOC} [mm]", 100, -25., 25.);
214 meHitXlocal_[0] = ibook.
book1D(
"EtlHitXlocalZneg",
"ETL SIM local X (-Z);X_{SIM}^{LOC} [mm]", 100, -25., 25.);
215 meHitYlocal_[1] = ibook.
book1D(
"EtlHitYlocalZpos",
"ETL SIM local Y (+Z);Y_{SIM}^{LOC} [mm]", 100, -48., 48.);
216 meHitYlocal_[0] = ibook.
book1D(
"EtlHitYlocalZneg",
"ETL SIM local Y (-Z);Y_{SIM}^{LOC} [mm]", 100, -48., 48.);
217 meHitZlocal_[1] = ibook.
book1D(
"EtlHitZlocalZpos",
"ETL SIM local Z (+Z);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16);
218 meHitZlocal_[0] = ibook.
book1D(
"EtlHitZlocalZneg",
"ETL SIM local Z (-Z);Z_{SIM}^{LOC} [mm]", 80, -0.16, 0.16);
221 "EtlOccupancyZpos",
"ETL SIM hits occupancy (+Z);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.);
223 "EtlOccupancyZneg",
"ETL SIM hits occupancy (-Z);X_{SIM} [cm];Y_{SIM} [cm]", 135, -135., 135., 135, -135., 135.);
225 meHitX_[1] = ibook.
book1D(
"EtlHitXZpos",
"ETL SIM hits X (+Z);X_{SIM} [cm]", 100, -130., 130.);
226 meHitX_[0] = ibook.
book1D(
"EtlHitXZneg",
"ETL SIM hits X (-Z);X_{SIM} [cm]", 100, -130., 130.);
227 meHitY_[1] = ibook.
book1D(
"EtlHitYZpos",
"ETL SIM hits Y (+Z);Y_{SIM} [cm]", 100, -130., 130.);
228 meHitY_[0] = ibook.
book1D(
"EtlHitYZneg",
"ETL SIM hits Y (-Z);Y_{SIM} [cm]", 100, -130., 130.);
229 meHitZ_[1] = ibook.
book1D(
"EtlHitZZpos",
"ETL SIM hits Z (+Z);Z_{SIM} [cm]", 100, 303.4, 304.2);
230 meHitZ_[0] = ibook.
book1D(
"EtlHitZZneg",
"ETL SIM hits Z (-Z);Z_{SIM} [cm]", 100, -304.2, -303.4);
232 meHitPhi_[1] = ibook.
book1D(
"EtlHitPhiZpos",
"ETL SIM hits #phi (+Z);#phi_{SIM} [rad]", 100, -3.15, 3.15);
233 meHitPhi_[0] = ibook.
book1D(
"EtlHitPhiZneg",
"ETL SIM hits #phi (-Z);#phi_{SIM} [rad]", 100, -3.15, 3.15);
234 meHitEta_[1] = ibook.
book1D(
"EtlHitEtaZpos",
"ETL SIM hits #eta (+Z);#eta_{SIM}", 100, 1.56, 3.2);
235 meHitEta_[0] = ibook.
book1D(
"EtlHitEtaZneg",
"ETL SIM hits #eta (-Z);#eta_{SIM}", 100, -3.2, -1.56);
238 "EtlHitTvsEZpos",
"ETL SIM time vs energy (+Z);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.);
240 "EtlHitTvsEZneg",
"ETL SIM time vs energy (-Z);E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 2., 0., 100.);
242 "EtlHitEvsPhiZpos",
"ETL SIM energy vs #phi (+Z);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.);
244 "EtlHitEvsPhiZneg",
"ETL SIM energy vs #phi (-Z);#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.);
246 "EtlHitEvsEtaZpos",
"ETL SIM energy vs #eta (+Z);#eta_{SIM};E_{SIM} [MeV]", 50, 1.56, 3.2, 0., 100.);
248 "EtlHitEvsEtaZneg",
"ETL SIM energy vs #eta (-Z);#eta_{SIM};E_{SIM} [MeV]", 50, -3.2, -1.56, 0., 100.);
250 "EtlHitTvsPhiZpos",
"ETL SIM time vs #phi (+Z);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.);
252 "EtlHitTvsPhiZneg",
"ETL SIM time vs #phi (-Z);#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.);
254 "EtlHitTvsEtaZpos",
"ETL SIM time vs #eta (+Z);#eta_{SIM};T_{SIM} [ns]", 50, 1.56, 3.2, 0., 100.);
256 "EtlHitTvsEtaZneg",
"ETL SIM time vs #eta (-Z);#eta_{SIM};T_{SIM} [ns]", 50, -3.2, -1.56, 0., 100.);
265 desc.
add<
double>(
"hitMinimumEnergy", 0.1);
267 descriptions.
add(
"etlSimHits", desc);
T getParameter(std::string const &) const
MonitorElement * meHitTime_[2]
MonitorElement * meHitXlocal_[2]
constexpr NumType convertUnitsTo(long double desiredUnits, NumType val)
MonitorElement * meHitTvsPhi_[2]
MonitorElement * bookProfile(Args &&...args)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
edm::EDGetTokenT< edm::PSimHitContainer > etlSimHitsToken_
MonitorElement * meNtrkPerCell_[2]
MonitorElement * meHitZ_[2]
MonitorElement * meHitEvsPhi_[2]
constexpr uint32_t rawId() const
get the raw id
MonitorElement * meHitEnergy_[2]
~EtlSimHitsValidation() override
MonitorElement * meHitZlocal_[2]
MonitorElement * meHitY_[2]
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * meHitEta_[2]
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
const MTDGeomDet * idToDet(DetId) const override
EtlSimHitsValidation(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
void setCurrentFolder(std::string const &fullpath)
ETLDetId geographicalId() const
MonitorElement * book1D(Args &&...args)
MonitorElement * meHitYlocal_[2]
MonitorElement * meHitTvsEta_[2]
ParameterDescriptionBase * add(U const &iLabel, T const &value)
MonitorElement * meOccupancy_[2]
MonitorElement * meHitTvsE_[2]
MonitorElement * meHitX_[2]
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * book2D(Args &&...args)
void analyze(const edm::Event &, const edm::EventSetup &) override
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
void add(std::string const &label, ParameterSetDescription const &psetDescription)
MonitorElement * meHitPhi_[2]
MonitorElement * meHitEvsEta_[2]
MonitorElement * meNhits_[2]
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Detector identifier class for the Endcap Timing Layer.
constexpr NumType convertMmToCm(NumType millimeters)
auto makeValid(const U &iOtherHandleType) noexcept(false)
const std::string folder_
T const * product() const
const float hitMinEnergy_