14 LogDebug(
"MuonME0DigisValidation") <<
"Info: Loading Geometry information\n";
17 unsigned int nregion = 2;
19 edm::LogInfo(
"MuonME0DigisValidation") <<
"+++ Info : # of region: " << nregion << std::endl;
21 LogDebug(
"MuonME0DigisValidation") <<
"+++ Info : finish to get geometry information from ES.\n";
23 num_evts = ibooker.
book1D(
"num_evts",
"Number of events; ; Number of events", 1, 0, 2);
26 ibooker.
book1D(
"me0_strip_dg_x_local_tot",
"Local X; X_{local} [cm]; Entries", 60, -30.0, +30.0);
28 ibooker.
book1D(
"me0_strip_dg_y_local_tot",
"Local Y; Y_{local} [cm]; Entries", 100, -50.0, +50.0);
32 ibooker.
book1D(
"me0_strip_dg_dx_local_tot",
"Local DeltaX; #Delta X_{local} [cm]; Entries", 50, -0.1, +0.1);
34 ibooker.
book1D(
"me0_strip_dg_dy_local_tot",
"Local DeltaY; #Delta Y_{local} [cm]; Entries", 500, -10.0, +10.0);
36 "me0_strip_dg_dphi_global_tot",
"Global DeltaPhi; #Delta #phi_{global} [rad]; Entries", 50, -0.01, +0.01);
38 ibooker.
book1D(
"me0_strip_dg_dtime_tot",
"DeltaToF; #Delta ToF [ns]; Entries", 50, -5, +5);
41 "Global DeltaPhi vs. Phi; #phi_{global} [rad]; #Delta " 42 "#phi_{global} [rad]",
53 float bins[] = {62.3, 70.0, 77.7, 87.1, 96.4, 108.2, 119.9, 134.7, 149.5};
54 int binnum =
sizeof(
bins) /
sizeof(
float) - 1;
57 ibooker.
book1D(
"me0_strip_dg_bkg_radius_tot",
"Total neutron background; Radius [cm]; Entries", binnum,
bins);
59 "me0_strip_dg_bkgElePos_radius",
"Neutron background: electrons+positrons; Radius [cm]; Entries", binnum,
bins);
61 "me0_strip_dg_bkgNeutral_radius",
"Neutron background: gammas+neutrons; Radius [cm]; Entries", binnum,
bins);
64 "Total expected neutron background; Radius [cm]; Hit Rate [Hz/cm^{2}]",
68 "Expected neutron background: electrons+positrons; Radius " 69 "[cm]; Hit Rate [Hz/cm^{2}]",
73 "Expected neutron background: gammas+neutrons; Radius " 74 "[cm]; Hit Rate [Hz/cm^{2}]",
78 std::vector<double> neuBkg, eleBkg;
79 neuBkg.push_back(899644.0);
80 neuBkg.push_back(-30841.0);
81 neuBkg.push_back(441.28);
82 neuBkg.push_back(-3.3405);
83 neuBkg.push_back(0.0140588);
84 neuBkg.push_back(-3.11473
e-05);
85 neuBkg.push_back(2.83736
e-08);
86 eleBkg.push_back(4.68590
e+05);
87 eleBkg.push_back(-1.63834
e+04);
88 eleBkg.push_back(2.35700
e+02);
89 eleBkg.push_back(-1.77706
e+00);
90 eleBkg.push_back(7.39960
e-03);
91 eleBkg.push_back(-1.61448
e-05);
92 eleBkg.push_back(1.44368
e-08);
99 double pos_helper = 1.0;
100 for (
int j = 0;
j < 7; ++
j) {
101 neutral += neuBkg[
j] * pos_helper;
102 charged += eleBkg[
j] * pos_helper;
111 for (
unsigned int region_num = 0; region_num < nregion; region_num++) {
114 for (
unsigned int layer_num = 0; layer_num < 6; layer_num++) {
128 layerLabel[layer_num] +
" ; #Delta X_{local} [cm]; Entries";
130 layerLabel[layer_num] +
" ; #Delta Y_{local} [cm]; Entries";
131 std::string hist_label_for_dphi_global =
"Global DeltaPhi: region" +
regionLabel[region_num] +
" layer " +
132 layerLabel[layer_num] +
" ; #Delta #phi_{global} [rad]; Entries";
135 "Denominator: region" +
regionLabel[region_num] +
" layer " +
layerLabel[layer_num] +
" ; #eta; Entries";
137 "Numerator: region" +
regionLabel[region_num] +
" layer " +
layerLabel[layer_num] +
" ; #eta; Entries";
141 BookHistXY(ibooker,
"me0_strip_dg_Muon",
"Digi Muon", region_num, layer_num);
144 ibooker.
book1D(hist_name_for_dx_local.c_str(), hist_label_for_dx_local.c_str(), 50, -0.1, +0.1);
146 ibooker.
book1D(hist_name_for_dy_local.c_str(), hist_label_for_dy_local.c_str(), 500, -10.0, +10.0);
148 ibooker.
book1D(hist_name_for_dphi_global.c_str(), hist_label_for_dphi_global.c_str(), 50, -0.01, +0.01);
151 ibooker.
book1D(hist_name_for_den_eta, hist_label_for_den_eta, 12, 1.8, 3.0);
153 ibooker.
book1D(hist_name_for_num_eta, hist_label_for_num_eta, 12, 1.8, 3.0);
170 edm::LogError(
"ME0DigisValidation") <<
"Cannot get ME0Hits/ME0Digis by Token simInputTagToken";
175 bool toBeCounted1 =
true;
181 if (gdet ==
nullptr) {
182 edm::LogWarning(
"ME0DigisValidation") <<
"Getting DetId failed. Discard this gem strip hit. Maybe it comes " 183 "from unmatched geometry.";
194 for (digiItr = (*cItr).second.first; digiItr != (*cItr).second.second; ++digiItr) {
205 int isPrompt = digiItr->prompt();
219 int layer_num =
layer - 1;
221 bool toBeCounted2 =
true;
227 for (
auto hits = ME0Hits->begin();
hits != ME0Hits->end();
hits++) {
228 int particleType_sh =
hits->particleType();
229 int evtId_sh =
hits->eventId().event();
230 int bx_sh =
hits->eventId().bunchCrossing();
231 int procType_sh =
hits->processType();
233 if (!(
abs(particleType_sh) == 13 && evtId_sh == 0 && bx_sh == 0 && procType_sh == 0))
237 int region_sh =
id.region();
238 int layer_sh =
id.layer();
239 int chamber_sh =
id.chamber();
240 int roll_sh =
id.roll();
242 int region_sh_num = 0;
245 else if (region_sh == 1)
247 int layer_sh_num = layer_sh - 1;
260 float dx_loc = lp_sh.
x() - lp.x();
261 float dy_loc = lp_sh.
y() - lp.y();
262 float dphi_glob = gp_sh.
phi() -
gp.phi();
263 float deta_glob = gp_sh.
eta() -
gp.eta();
268 float timeOfFlight_sh =
hits->tof();
271 float centralTOF(centralGP.mag() / 29.98);
272 float timeOfFlight_sh_corr = timeOfFlight_sh - centralTOF;
289 toBeCounted2 =
false;
293 toBeCounted1 =
false;
MonitorElement * me0_strip_dg_num_eta[2][6]
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
MonitorElement * me0_strip_dg_den_eta_tot
virtual void setCurrentFolder(std::string const &fullpath)
MonitorElement * me0_strip_exp_bkgElePos_rad
edm::ESGetToken< ME0Geometry, MuonGeometryRecord > geomToken_
std::vector< std::string > regionLabel
Geom::Phi< T > phi() const
MonitorElement * me0_strip_dg_num_eta_tot
Log< level::Error, false > LogError
MonitorElement * me0_strip_dg_x_local_tot
MonitorElement * me0_strip_dg_dphi_global_Muon[2][6]
MonitorElement * me0_strip_dg_y_local_tot
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
const GeomDet * idToDet(DetId) const override
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
MonitorElement * num_evts
MonitorElement * me0_strip_dg_zr_tot_Muon[2]
MonitorElement * me0_strip_dg_dtime_tot_Muon
MonitorElement * me0_strip_dg_xy[2][6]
Abs< T >::type abs(const T &t)
MonitorElement * me0_strip_dg_dphi_global_tot_Muon
MonitorElement * me0_strip_dg_xy_Muon[2][6]
MonitorElement * me0_strip_dg_dy_local_tot_Muon
ME0DigisValidation(const edm::ParameterSet &)
~ME0DigisValidation() override
MonitorElement * me0_strip_dg_dy_local_Muon[2][6]
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
MonitorElement * me0_strip_dg_bkgNeutral_rad
Log< level::Info, false > LogInfo
const Plane & surface() const
The nominal surface of the GeomDet.
MonitorElement * me0_strip_exp_bkgNeutral_rad
MonitorElement * me0_strip_dg_dx_local_tot_Muon
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
edm::EDGetToken InputTagToken_Digi
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
std::vector< DigiType >::const_iterator const_iterator
MonitorElement * me0_strip_dg_time_tot
edm::EDGetToken InputTagToken_
MonitorElement * me0_strip_dg_bkg_rad_tot
MonitorElement * me0_strip_dg_den_eta[2][6]
std::vector< std::string > layerLabel
MonitorElement * me0_strip_dg_bkgElePos_rad
MonitorElement * me0_strip_exp_bkg_rad_tot
MonitorElement * me0_strip_dg_dphi_vs_phi_global_tot_Muon
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
void analyze(const edm::Event &e, const edm::EventSetup &) override
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
MonitorElement * me0_strip_dg_zr_tot[2]
double timeOfFlight(DetId id, const CaloGeometry *geo, bool debug=false)
MonitorElement * me0_strip_dg_dx_local_Muon[2][6]