101 hitMinEnergy_(iConfig.getParameter<double>(
"hitMinimumEnergy")) {
103 mtdgeoToken_ = esConsumes<MTDGeometry, MTDDigiGeometryRecord>();
118 const MTDTopology* topology = topologyHandle.product();
123 std::unordered_map<uint32_t, MTDHit> m_btlHits;
124 std::unordered_map<uint32_t, std::set<int> > m_btlTrkPerCell;
127 for (
auto const&
simHit : btlSimHits) {
134 m_btlTrkPerCell[
id.rawId()].insert(
simHit.trackId());
136 auto simHitIt = m_btlHits.emplace(
id.
rawId(),
MTDHit()).first;
142 if ((simHitIt->second).time == 0 ||
simHit.tof() < (simHitIt->second).
time) {
145 auto hit_pos =
simHit.localPosition();
146 (simHitIt->second).
x = hit_pos.x();
147 (simHitIt->second).
y = hit_pos.y();
148 (simHitIt->second).
z = hit_pos.z();
157 if (!m_btlHits.empty())
160 for (
auto const&
hit : m_btlTrkPerCell)
163 for (
auto const&
hit : m_btlHits) {
173 if (thedet ==
nullptr)
174 throw cms::Exception(
"BtlSimHitsValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" 175 <<
detId.rawId() <<
") is invalid!" <<
std::dec << std::endl;
183 const auto& global_point = thedet->
toGlobal(local_point);
225 meNhits_ = ibook.
book1D(
"BtlNhits",
"Number of BTL cells with SIM hits;log_{10}(N_{BTL cells})", 100, 0., 5.25);
226 meNtrkPerCell_ = ibook.
book1D(
"BtlNtrkPerCell",
"Number of tracks per BTL cell;N_{trk}", 10, 0., 10.);
228 meHitEnergy_ = ibook.
book1D(
"BtlHitEnergy",
"BTL SIM hits energy;E_{SIM} [MeV]", 100, 0., 20.);
229 meHitLogEnergy_ = ibook.
book1D(
"BtlHitLogEnergy",
"BTL SIM hits energy;log_{10}(E_{SIM} [MeV])", 200, -6., 3.);
230 meHitTime_ = ibook.
book1D(
"BtlHitTime",
"BTL SIM hits ToA;ToA_{SIM} [ns]", 100, 0., 25.);
232 meHitXlocal_ = ibook.
book1D(
"BtlHitXlocal",
"BTL SIM local X;X_{SIM}^{LOC} [mm]", 100, -30., 30.);
233 meHitYlocal_ = ibook.
book1D(
"BtlHitYlocal",
"BTL SIM local Y;Y_{SIM}^{LOC} [mm]", 100, -1.65, 1.65);
234 meHitZlocal_ = ibook.
book1D(
"BtlHitZlocal",
"BTL SIM local z;z_{SIM}^{LOC} [mm]", 100, -2., 2.);
237 "BtlOccupancy",
"BTL SIM hits occupancy;z_{SIM} [cm];#phi_{SIM} [rad]", 130, -260., 260., 200, -3.15, 3.15);
239 meHitX_ = ibook.
book1D(
"BtlHitX",
"BTL SIM hits X;X_{SIM} [cm]", 100, -120., 120.);
240 meHitY_ = ibook.
book1D(
"BtlHitY",
"BTL SIM hits Y;Y_{SIM} [cm]", 100, -120., 120.);
241 meHitZ_ = ibook.
book1D(
"BtlHitZ",
"BTL SIM hits Z;Z_{SIM} [cm]", 100, -260., 260.);
242 meHitPhi_ = ibook.
book1D(
"BtlHitPhi",
"BTL SIM hits #phi;#phi_{SIM} [rad]", 200, -3.15, 3.15);
243 meHitEta_ = ibook.
book1D(
"BtlHitEta",
"BTL SIM hits #eta;#eta_{SIM}", 100, -1.55, 1.55);
246 ibook.
bookProfile(
"BtlHitTvsE",
"BTL SIM time vs energy;E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 20., 0., 100.);
248 "BtlHitEvsPhi",
"BTL SIM energy vs #phi;#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.);
250 ibook.
bookProfile(
"BtlHitEvsEta",
"BTL SIM energy vs #eta;#eta_{SIM};E_{SIM} [MeV]", 50, -1.55, 1.55, 0., 100.);
252 ibook.
bookProfile(
"BtlHitEvsZ",
"BTL SIM energy vs Z;Z_{SIM} [cm];E_{SIM} [MeV]", 50, -260., 260., 0., 100.);
254 "BtlHitTvsPhi",
"BTL SIM time vs #phi;#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.);
256 ibook.
bookProfile(
"BtlHitTvsEta",
"BTL SIM time vs #eta;#eta_{SIM};T_{SIM} [ns]", 50, -1.55, 1.55, 0., 100.);
258 ibook.
bookProfile(
"BtlHitTvsZ",
"BTL SIM time vs Z;Z_{SIM} [cm];T_{SIM} [ns]", 50, -260., 260., 0., 100.);
267 desc.add<
double>(
"hitMinimumEnergy", 1.);
269 descriptions.
add(
"btlSimHitsValid",
desc);
MonitorElement * meHitEta_
int getMTDTopologyMode() const
MonitorElement * meHitZlocal_
T getParameter(std::string const &) const
MonitorElement * meHitPhi_
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * meHitXlocal_
MonitorElement * meNtrkPerCell_
virtual void setCurrentFolder(std::string const &fullpath)
virtual const Topology & topology() const
const float hitMinEnergy_
virtual const PixelTopology & specificTopology() const
LocalPoint pixelToModuleLocalPoint(const LocalPoint &plp, int row, int col) const
constexpr NumType convertUnitsTo(double desiredUnits, NumType val)
MonitorElement * meNhits_
MonitorElement * meHitEvsPhi_
const std::string folder_
MonitorElement * meHitEnergy_
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 * meOccupancy_
MonitorElement * meHitEvsEta_
#define DEFINE_FWK_MODULE(type)
int nrows() const override
edm::ESGetToken< MTDGeometry, MTDDigiGeometryRecord > mtdgeoToken_
MonitorElement * meHitEvsZ_
MonitorElement * meHitYlocal_
MonitorElement * meHitTvsPhi_
MonitorElement * meNevents_
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
MonitorElement * meHitTvsE_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~BtlSimHitsValidation() override
constexpr NumType convertMmToCm(NumType millimeters)
edm::ESGetToken< MTDTopology, MTDTopologyRcd > mtdtopoToken_
constexpr uint32_t rawId() const
get the raw id
MonitorElement * meHitLogEnergy_
BtlSimHitsValidation(const edm::ParameterSet &)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
void add(std::string const &label, ParameterSetDescription const &psetDescription)
MonitorElement * meHitTvsZ_
MonitorElement * meHitTime_
edm::EDGetTokenT< CrossingFrame< PSimHit > > btlSimHitsToken_
Detector identifier class for the Barrel Timing Layer. The crystal count must start from 0...
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
ESTransientHandle< T > getTransientHandle(const ESGetToken< T, R > &iToken) const
BTLDetId::CrysLayout crysLayoutFromTopoMode(const int &topoMode)
MonitorElement * meHitTvsEta_
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())