101 hitMinEnergy_(iConfig.getParameter<double>(
"hitMinimumEnergy")) {
126 std::unordered_map<uint32_t, MTDHit> m_btlSimHits;
127 for (
auto const&
simHit : btlSimHits) {
134 auto simHitIt = m_btlSimHits.emplace(
id.rawId(),
MTDHit()).first;
140 if ((simHitIt->second).time == 0 ||
simHit.tof() < (simHitIt->second).
time) {
143 auto hit_pos =
simHit.entryPoint();
144 (simHitIt->second).x_local = hit_pos.x();
145 (simHitIt->second).y_local = hit_pos.y();
146 (simHitIt->second).z_local = hit_pos.z();
153 unsigned int n_reco_btl = 0;
155 for (
const auto&
recHit : *btlRecHitsHandle) {
159 if (thedet ==
nullptr)
160 throw cms::Exception(
"BtlRecHitsValidation") <<
"GeographicalID: " << std::hex << geoId.
rawId() <<
" (" 161 << detId.
rawId() <<
") is invalid!" <<
std::dec << std::endl;
167 const auto& global_point = thedet->
toGlobal(local_point);
190 float time_res =
recHit.time() - m_btlSimHits[detId.
rawId()].time;
191 float energy_res =
recHit.energy() - m_btlSimHits[detId.
rawId()].energy;
216 meNhits_ = ibook.
book1D(
"BtlNhits",
"Number of BTL RECO hits;log_{10}(N_{RECO})", 100, 0., 5.25);
218 meHitEnergy_ = ibook.
book1D(
"BtlHitEnergy",
"BTL RECO hits energy;E_{RECO} [MeV]", 100, 0., 20.);
219 meHitTime_ = ibook.
book1D(
"BtlHitTime",
"BTL RECO hits ToA;ToA_{RECO} [ns]", 100, 0., 25.);
222 "BtlOccupancy",
"BTL RECO hits occupancy;Z_{RECO} [cm]; #phi_{RECO} [rad]", 65, -260., 260., 126, -3.15, 3.15);
224 meHitX_ = ibook.
book1D(
"BtlHitX",
"BTL RECO hits X;X_{RECO} [cm]", 60, -120., 120.);
225 meHitY_ = ibook.
book1D(
"BtlHitY",
"BTL RECO hits Y;Y_{RECO} [cm]", 60, -120., 120.);
226 meHitZ_ = ibook.
book1D(
"BtlHitZ",
"BTL RECO hits Z;Z_{RECO} [cm]", 100, -260., 260.);
227 meHitPhi_ = ibook.
book1D(
"BtlHitPhi",
"BTL RECO hits #phi;#phi_{RECO} [rad]", 126, -3.15, 3.15);
228 meHitEta_ = ibook.
book1D(
"BtlHitEta",
"BTL RECO hits #eta;#eta_{RECO}", 100, -1.55, 1.55);
231 ibook.
bookProfile(
"BtlHitTvsE",
"BTL RECO ToA vs energy;E_{RECO} [MeV];ToA_{RECO} [ns]", 50, 0., 20., 0., 100.);
233 "BtlHitEvsPhi",
"BTL RECO energy vs #phi;#phi_{RECO} [rad];E_{RECO} [MeV]", 50, -3.15, 3.15, 0., 100.);
235 "BtlHitEvsEta",
"BTL RECO energy vs #eta;#eta_{RECO};E_{RECO} [MeV]", 50, -1.55, 1.55, 0., 100.);
237 ibook.
bookProfile(
"BtlHitEvsZ",
"BTL RECO energy vs Z;Z_{RECO} [cm];E_{RECO} [MeV]", 50, -260., 260., 0., 100.);
239 "BtlHitTvsPhi",
"BTL RECO ToA vs #phi;#phi_{RECO} [rad];ToA_{RECO} [ns]", 50, -3.15, 3.15, 0., 100.);
241 ibook.
bookProfile(
"BtlHitTvsEta",
"BTL RECO ToA vs #eta;#eta_{RECO};ToA_{RECO} [ns]", 50, -1.6, 1.6, 0., 100.);
243 ibook.
bookProfile(
"BtlHitTvsZ",
"BTL RECO ToA vs Z;Z_{RECO} [cm];ToA_{RECO} [ns]", 50, -260., 260., 0., 100.);
245 meTimeRes_ = ibook.
book1D(
"BtlTimeRes",
"BTL time resolution;T_{RECO} - T_{SIM} [ns]", 100, -0.5, 0.5);
246 meEnergyRes_ = ibook.
book1D(
"BtlEnergyRes",
"BTL energy resolution;E_{RECO} - E_{SIM} [MeV]", 100, -0.5, 0.5);
249 "BtlTresvsE",
"BTL time resolution vs E;E_{SIM} [MeV];T_{RECO}-T_{SIM} [ns]", 50, 0., 20., 0., 100.);
251 "BtlEresvsE",
"BTL energy resolution vs E;E_{SIM} [MeV];E_{RECO}-E_{SIM} [MeV]", 50, 0., 20., 0., 100.);
261 desc.
add<
double>(
"hitMinimumEnergy", 1.);
263 descriptions.
add(
"btlRecHits", desc);
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
T getParameter(std::string const &) const
MonitorElement * meHitEnergy_
const std::string folder_
constexpr NumType convertUnitsTo(long double desiredUnits, NumType val)
CaloTopology const * topology(0)
MonitorElement * meHitEvsZ_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
virtual const Topology & topology() const
void setCurrentFolder(std::string const &fullpath)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
MonitorElement * meHitPhi_
int getMTDTopologyMode() const
constexpr uint32_t rawId() const
get the raw id
MonitorElement * meNhits_
BtlRecHitsValidation(const edm::ParameterSet &)
MonitorElement * meEnergyRes_
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * meHitTime_
int nrows() const override
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * meOccupancy_
MonitorElement * meHitEta_
Handle< PROD > getHandle(EDGetTokenT< PROD > token) const
const MTDGeomDet * idToDet(DetId) const override
#define DEFINE_FWK_MODULE(type)
BTLDetId geographicalId(CrysLayout lay) const
MonitorElement * meHitTvsPhi_
MonitorElement * meEresvsE_
MonitorElement * meTimeRes_
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, char const *option="s")
MonitorElement * meHitEvsPhi_
virtual const PixelTopology & specificTopology() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
LocalPoint pixelToModuleLocalPoint(const LocalPoint &plp, int row, int col) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
example_stream void bookHistograms(DQMStore::IBooker &,@example_stream edm::Run const &,@example_stream edm::EventSetup const &) override
edm::EDGetTokenT< FTLRecHitCollection > btlRecHitsToken_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
~BtlRecHitsValidation() override
MonitorElement * meTresvsE_
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...
edm::EDGetTokenT< CrossingFrame< PSimHit > > btlSimHitsToken_
int column(unsigned nrows=16) const
MonitorElement * meHitTvsE_
const float hitMinEnergy_
auto makeValid(const U &iOtherHandleType) noexcept(false)
MonitorElement * meHitEvsEta_
T const * product() const
MonitorElement * meHitTvsEta_
MonitorElement * meHitTvsZ_
int row(unsigned nrows=16) const