102 hitMinEnergy_(iConfig.getParameter<double>(
"hitMinimumEnergy")) {
124 std::unordered_map<uint32_t, MTDHit> m_btlHits;
125 std::unordered_map<uint32_t, std::set<int> > m_btlTrkPerCell;
128 for (
auto const&
simHit : btlSimHits) {
135 m_btlTrkPerCell[
id.rawId()].insert(
simHit.trackId());
137 auto simHitIt = m_btlHits.emplace(
id.rawId(),
MTDHit()).first;
143 if ((simHitIt->second).time == 0 ||
simHit.tof() < (simHitIt->second).
time) {
146 auto hit_pos =
simHit.entryPoint();
147 (simHitIt->second).
x = hit_pos.x();
148 (simHitIt->second).
y = hit_pos.y();
149 (simHitIt->second).
z = hit_pos.z();
158 if (!m_btlHits.empty())
161 for (
auto const&
hit : m_btlTrkPerCell)
164 for (
auto const&
hit : m_btlHits) {
174 if (thedet ==
nullptr)
175 throw cms::Exception(
"BtlSimHitsValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" 176 << detId.
rawId() <<
") is invalid!" <<
std::dec << std::endl;
184 const auto& global_point = thedet->
toGlobal(local_point);
226 meNhits_ = ibook.
book1D(
"BtlNhits",
"Number of BTL cells with SIM hits;log_{10}(N_{BTL cells})", 100, 0., 5.25);
227 meNtrkPerCell_ = ibook.
book1D(
"BtlNtrkPerCell",
"Number of tracks per BTL cell;N_{trk}", 10, 0., 10.);
229 meHitEnergy_ = ibook.
book1D(
"BtlHitEnergy",
"BTL SIM hits energy;E_{SIM} [MeV]", 100, 0., 20.);
230 meHitLogEnergy_ = ibook.
book1D(
"BtlHitLogEnergy",
"BTL SIM hits energy;log_{10}(E_{SIM} [MeV])", 200, -6., 3.);
231 meHitTime_ = ibook.
book1D(
"BtlHitTime",
"BTL SIM hits ToA;ToA_{SIM} [ns]", 100, 0., 25.);
233 meHitXlocal_ = ibook.
book1D(
"BtlHitXlocal",
"BTL SIM local X;X_{SIM}^{LOC} [mm]", 100, -30., 30.);
234 meHitYlocal_ = ibook.
book1D(
"BtlHitYlocal",
"BTL SIM local Y;Y_{SIM}^{LOC} [mm]", 100, -1.65, 1.65);
235 meHitZlocal_ = ibook.
book1D(
"BtlHitZlocal",
"BTL SIM local z;z_{SIM}^{LOC} [mm]", 100, -2., 2.);
238 "BtlOccupancy",
"BTL SIM hits occupancy;z_{SIM} [cm];#phi_{SIM} [rad]", 130, -260., 260., 200, -3.15, 3.15);
240 meHitX_ = ibook.
book1D(
"BtlHitX",
"BTL SIM hits X;X_{SIM} [cm]", 100, -120., 120.);
241 meHitY_ = ibook.
book1D(
"BtlHitY",
"BTL SIM hits Y;Y_{SIM} [cm]", 100, -120., 120.);
242 meHitZ_ = ibook.
book1D(
"BtlHitZ",
"BTL SIM hits Z;Z_{SIM} [cm]", 100, -260., 260.);
243 meHitPhi_ = ibook.
book1D(
"BtlHitPhi",
"BTL SIM hits #phi;#phi_{SIM} [rad]", 200, -3.15, 3.15);
244 meHitEta_ = ibook.
book1D(
"BtlHitEta",
"BTL SIM hits #eta;#eta_{SIM}", 100, -1.55, 1.55);
247 ibook.
bookProfile(
"BtlHitTvsE",
"BTL SIM time vs energy;E_{SIM} [MeV];T_{SIM} [ns]", 50, 0., 20., 0., 100.);
249 "BtlHitEvsPhi",
"BTL SIM energy vs #phi;#phi_{SIM} [rad];E_{SIM} [MeV]", 50, -3.15, 3.15, 0., 100.);
251 ibook.
bookProfile(
"BtlHitEvsEta",
"BTL SIM energy vs #eta;#eta_{SIM};E_{SIM} [MeV]", 50, -1.55, 1.55, 0., 100.);
253 ibook.
bookProfile(
"BtlHitEvsZ",
"BTL SIM energy vs Z;Z_{SIM} [cm];E_{SIM} [MeV]", 50, -260., 260., 0., 100.);
255 "BtlHitTvsPhi",
"BTL SIM time vs #phi;#phi_{SIM} [rad];T_{SIM} [ns]", 50, -3.15, 3.15, 0., 100.);
257 ibook.
bookProfile(
"BtlHitTvsEta",
"BTL SIM time vs #eta;#eta_{SIM};T_{SIM} [ns]", 50, -1.55, 1.55, 0., 100.);
259 ibook.
bookProfile(
"BtlHitTvsZ",
"BTL SIM time vs Z;Z_{SIM} [cm];T_{SIM} [ns]", 50, -260., 260., 0., 100.);
268 desc.
add<
double>(
"hitMinimumEnergy", 1.);
270 descriptions.
add(
"btlSimHits", desc);
MonitorElement * meHitEta_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
MonitorElement * meHitZlocal_
MonitorElement * meHitPhi_
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)
virtual const Topology & topology() const
void setCurrentFolder(std::string const &fullpath)
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
const std::string folder_
MonitorElement * meHitEnergy_
MonitorElement * meOccupancy_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
virtual const PixelTopology & specificTopology() const
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 * meNevents_
MonitorElement * meHitTvsE_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
~BtlSimHitsValidation() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
MonitorElement * meHitLogEnergy_
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_
edm::EDGetTokenT< CrossingFrame< PSimHit > > btlSimHitsToken_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
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