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);
172 edm::LogError(
"ME0DigisValidation") <<
"Cannot get ME0Hits/ME0Digis by Token simInputTagToken";
177 bool toBeCounted1 =
true;
183 if (gdet ==
nullptr) {
184 edm::LogWarning(
"ME0DigisValidation") <<
"Getting DetId failed. Discard this gem strip hit. Maybe it comes " 185 "from unmatched geometry.";
190 int region = (
int)
id.region();
191 int layer = (
int)
id.layer();
193 int roll = (
int)
id.roll();
196 for (digiItr = (*cItr).second.first; digiItr != (*cItr).second.second; ++digiItr) {
201 float g_r = (
float)gp.perp();
202 float g_x = (
float)gp.x();
203 float g_y = (
float)gp.y();
204 float g_z = (
float)gp.z();
207 int isPrompt = digiItr->prompt();
219 else if (region == 1)
221 int layer_num = layer - 1;
223 bool toBeCounted2 =
true;
225 if (isPrompt == 1 &&
abs(particleType) == 13) {
229 for (
auto hits = ME0Hits->begin();
hits != ME0Hits->end();
hits++) {
230 int particleType_sh =
hits->particleType();
231 int evtId_sh =
hits->eventId().event();
232 int bx_sh =
hits->eventId().bunchCrossing();
233 int procType_sh =
hits->processType();
235 if (!(
abs(particleType_sh) == 13 && evtId_sh == 0 && bx_sh == 0 && procType_sh == 0))
239 int region_sh =
id.region();
240 int layer_sh =
id.layer();
241 int chamber_sh =
id.chamber();
242 int roll_sh =
id.roll();
244 int region_sh_num = 0;
247 else if (region_sh == 1)
249 int layer_sh_num = layer_sh - 1;
259 if (!(region == region_sh && layer == layer_sh && chamber == chamber_sh && roll == roll_sh))
262 float dx_loc = lp_sh.
x() - lp.x();
263 float dy_loc = lp_sh.
y() - lp.y();
264 float dphi_glob = gp_sh.
phi() - gp.phi();
265 float deta_glob = gp_sh.
eta() - gp.eta();
270 float timeOfFlight_sh =
hits->tof();
273 float centralTOF(centralGP.mag() / 29.98);
274 float timeOfFlight_sh_corr = timeOfFlight_sh - centralTOF;
291 toBeCounted2 =
false;
295 toBeCounted1 =
false;
302 if ((
abs(particleType) == 11 ||
abs(particleType) == 22 ||
abs(particleType) == 2112) && isPrompt == 0)
304 if ((
abs(particleType) == 11) && isPrompt == 0)
306 if ((
abs(particleType) == 22 ||
abs(particleType) == 2112) && isPrompt == 0)
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
MonitorElement * BookHistZR(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
T getParameter(std::string const &) const
MonitorElement * me0_strip_dg_num_eta[2][6]
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * me0_strip_dg_den_eta_tot
MonitorElement * me0_strip_exp_bkgElePos_rad
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< std::string > regionLabel
Geom::Phi< T > phi() const
MonitorElement * me0_strip_dg_num_eta_tot
MonitorElement * me0_strip_dg_x_local_tot
const Plane & surface() const
The nominal surface of the GeomDet.
MonitorElement * me0_strip_dg_dphi_global_Muon[2][6]
MonitorElement * me0_strip_dg_y_local_tot
MonitorElement * BookHistXY(DQMStore::IBooker &, const char *name, const char *label, unsigned int region_num, unsigned int layer_num=99)
MonitorElement * num_evts
void setCurrentFolder(std::string const &fullpath)
MonitorElement * me0_strip_dg_zr_tot_Muon[2]
MonitorElement * me0_strip_dg_dtime_tot_Muon
MonitorElement * me0_strip_dg_xy[2][6]
MonitorElement * book1D(Args &&...args)
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]
MonitorElement * me0_strip_dg_bkgNeutral_rad
MonitorElement * me0_strip_exp_bkgNeutral_rad
MonitorElement * me0_strip_dg_dx_local_tot_Muon
MonitorElement * book2D(Args &&...args)
edm::EDGetToken InputTagToken_Digi
std::vector< DigiType >::const_iterator const_iterator
const GeomDet * idToDet(DetId) const override
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
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]