99 hitMinEnergy_(iConfig.getParameter<double>(
"hitMinimumEnergy")) {
120 std::unordered_map<uint32_t, MTDHit> m_btlHits;
121 std::unordered_map<uint32_t, std::set<int> > m_btlTrkPerCell;
124 for (
auto const&
simHit : *btlSimHitsHandle) {
131 m_btlTrkPerCell[
id.rawId()].insert(
simHit.trackId());
133 auto simHitIt = m_btlHits.emplace(
id.rawId(),
MTDHit()).first;
139 if ((simHitIt->second).time == 0 ||
simHit.tof() < (simHitIt->second).
time) {
142 auto hit_pos =
simHit.entryPoint();
143 (simHitIt->second).
x = hit_pos.x();
144 (simHitIt->second).
y = hit_pos.y();
145 (simHitIt->second).
z = hit_pos.z();
156 for (
auto const&
hit : m_btlTrkPerCell)
159 for (
auto const&
hit : m_btlHits) {
167 if (thedet ==
nullptr)
168 throw cms::Exception(
"BtlSimHitsValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" 169 << detId.
rawId() <<
") is invalid!" <<
std::dec << std::endl;
177 const auto& global_point = thedet->
toGlobal(local_point);
214 meNhits_ = ibook.
book1D(
"BtlNhits",
"Number of BTL cells with SIM hits;N_{BTL cells}", 100, 0., 5000.);
215 meNtrkPerCell_ = ibook.
book1D(
"BtlNtrkPerCell",
"Number of tracks per BTL cell;N_{trk}", 10, 0., 10.);
217 meHitEnergy_ = ibook.
book1D(
"BtlHitEnergy",
"BTL SIM hits energy;E_{SIM} [MeV]", 100, 0., 20.);
218 meHitTime_ = ibook.
book1D(
"BtlHitTime",
"BTL SIM hits ToA;ToA_{SIM} [ns]", 100, 0., 25.);
220 meHitXlocal_ = ibook.
book1D(
"BtlHitXlocal",
"BTL SIM local X;X_{SIM}^{LOC} [mm]", 100, -30., 30.);
221 meHitYlocal_ = ibook.
book1D(
"BtlHitYlocal",
"BTL SIM local Y;Y_{SIM}^{LOC} [mm]", 100, -1.65, 1.65);
222 meHitZlocal_ = ibook.
book1D(
"BtlHitZlocal",
"BTL SIM local z;z_{SIM}^{LOC} [mm]", 100, -2., 2.);
225 "BtlOccupancy",
"BTL SIM hits occupancy;z_{SIM} [cm];#phi_{SIM} [rad]", 130, -260., 260., 200, -3.15, 3.15);
227 meHitX_ = ibook.
book1D(
"BtlHitX",
"BTL SIM hits X;X_{SIM} [cm]", 100, -120., 120.);
228 meHitY_ = ibook.
book1D(
"BtlHitY",
"BTL SIM hits Y;Y_{SIM} [cm]", 100, -120., 120.);
229 meHitZ_ = ibook.
book1D(
"BtlHitZ",
"BTL SIM hits Z;Z_{SIM} [cm]", 100, -260., 260.);
230 meHitPhi_ = ibook.
book1D(
"BtlHitPhi",
"BTL SIM hits #phi;#phi_{SIM} [rad]", 200, -3.15, 3.15);
231 meHitEta_ = ibook.
book1D(
"BtlHitEta",
"BTL SIM hits #eta;#eta_{SIM}", 100, -1.55, 1.55);
234 ibook.
bookProfile(
"BtlHitTvsE",
"BTL SIM time vs energy;E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 20., 0., 100.);
236 "BtlHitEvsPhi",
"BTL SIM energy vs #phi;#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.);
238 ibook.
bookProfile(
"BtlHitEvsEta",
"BTL SIM energy vs #eta;#eta_{SIM};E_{SIM} [MeV]", 50, -1.55, 1.55, 0., 100.);
240 ibook.
bookProfile(
"BtlHitEvsZ",
"BTL SIM energy vs Z;Z_{SIM} [cm];E_{SIM} [MeV]", 50, -260., 260., 0., 100.);
242 "BtlHitTvsPhi",
"BTL SIM time vs #phi;#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.);
244 ibook.
bookProfile(
"BtlHitTvsEta",
"BTL SIM time vs #eta;#eta_{SIM};T_{SIM} [ns]", 50, -1.55, 1.55, 0., 100.);
246 ibook.
bookProfile(
"BtlHitTvsZ",
"BTL SIM time vs Z;Z_{SIM} [cm];T_{SIM} [ns]", 50, -260., 260., 0., 100.);
255 desc.
add<
double>(
"hitMinimumEnergy", 1.);
257 descriptions.
add(
"btlSimHits", desc);
MonitorElement * meHitEta_
T getParameter(std::string const &) const
MonitorElement * meHitZlocal_
MonitorElement * meHitPhi_
edm::EDGetTokenT< edm::PSimHitContainer > btlSimHitsToken_
void analyze(const edm::Event &, const edm::EventSetup &) override
constexpr NumType convertUnitsTo(long double desiredUnits, NumType val)
MonitorElement * meHitXlocal_
MonitorElement * meNtrkPerCell_
CaloTopology const * topology(0)
MonitorElement * bookProfile(Args &&...args)
virtual const Topology & topology() const
const float hitMinEnergy_
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
int getMTDTopologyMode() const
constexpr uint32_t rawId() const
get the raw id
int nrows() const override
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * meNhits_
MonitorElement * meHitEvsPhi_
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
const MTDGeomDet * idToDet(DetId) const override
#define DEFINE_FWK_MODULE(type)
BTLDetId geographicalId(CrysLayout lay) const
void setCurrentFolder(std::string const &fullpath)
const std::string folder_
MonitorElement * meHitEnergy_
MonitorElement * meOccupancy_
virtual const PixelTopology & specificTopology() const
MonitorElement * book1D(Args &&...args)
MonitorElement * meHitEvsEta_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
LocalPoint pixelToModuleLocalPoint(const LocalPoint &plp, int row, int col) const
MonitorElement * meHitEvsZ_
MonitorElement * meHitYlocal_
MonitorElement * meHitTvsPhi_
MonitorElement * meHitTvsE_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~BtlSimHitsValidation() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * book2D(Args &&...args)
BtlSimHitsValidation(const edm::ParameterSet &)
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 * meHitTvsZ_
MonitorElement * meHitTime_
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
constexpr NumType convertMmToCm(NumType millimeters)
int column(unsigned nrows=16) const
MonitorElement * meHitTvsEta_
auto makeValid(const U &iOtherHandleType) noexcept(false)
T const * product() const
int row(unsigned nrows=16) const