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);
39 float bins[] = {62.3, 70.0, 77.7, 87.1, 96.4, 108.2, 119.9, 134.7, 149.5};
40 int binnum =
sizeof(
bins)/
sizeof(
float) - 1;
43 me0_strip_dg_bkgElePos_rad = ibooker.
book1D(
"me0_strip_dg_bkgElePos_radius",
"Neutron background: electrons+positrons; Radius [cm]; Entries", binnum, bins);
46 me0_strip_exp_bkg_rad_tot = ibooker.
book1D(
"me0_strip_exp_bkg_radius_tot",
"Total expected neutron background; Radius [cm]; Hit Rate [Hz/cm^{2}]", binnum, bins);
47 me0_strip_exp_bkgElePos_rad = ibooker.
book1D(
"me0_strip_exp_bkgElePos_radius",
"Expected neutron background: electrons+positrons; Radius [cm]; Hit Rate [Hz/cm^{2}]", binnum, bins);
48 me0_strip_exp_bkgNeutral_rad = ibooker.
book1D(
"me0_strip_exp_bkgNeutral_radius",
"Expected neutron background: gammas+neutrons; Radius [cm]; Hit Rate [Hz/cm^{2}]", binnum, bins);
50 std::vector<double> neuBkg, eleBkg;
51 neuBkg.push_back(899644.0); neuBkg.push_back(-30841.0); neuBkg.push_back(441.28);
52 neuBkg.push_back(-3.3405); neuBkg.push_back(0.0140588); neuBkg.push_back(-3.11473
e-05); neuBkg.push_back(2.83736
e-08);
53 eleBkg.push_back(4.68590
e+05); eleBkg.push_back(-1.63834
e+04); eleBkg.push_back(2.35700
e+02);
54 eleBkg.push_back(-1.77706
e+00); eleBkg.push_back(7.39960
e-03); eleBkg.push_back(-1.61448
e-05); eleBkg.push_back(1.44368
e-08);
62 double pos_helper = 1.0;
63 for(
int j = 0; j < 7; ++j) {
65 neutral += neuBkg[j]*pos_helper;
66 charged += eleBkg[j]*pos_helper;
77 for(
unsigned int region_num = 0 ; region_num < nregion ; region_num++ ) {
80 for(
unsigned int layer_num = 0 ; layer_num < 6 ; layer_num++) {
89 std::string hist_label_for_dx_local =
"Local DeltaX: region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" ; #Delta X_{local} [cm]; Entries";
90 std::string hist_label_for_dy_local =
"Local DeltaY: region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" ; #Delta Y_{local} [cm]; Entries";
91 std::string hist_label_for_dphi_global =
"Global DeltaPhi: region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" ; #Delta #phi_{global} [rad]; Entries";
93 std::string hist_label_for_den_eta =
"Denominator: region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" ; #eta; Entries";
94 std::string hist_label_for_num_eta =
"Numerator: region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" ; #eta; Entries";
128 edm::LogError(
"ME0DigisValidation") <<
"Cannot get ME0Hits/ME0Digis by Token simInputTagToken";
133 bool toBeCounted1 =
true;
139 if ( gdet ==
nullptr) {
140 edm::LogWarning(
"ME0DigisValidation")<<
"Getting DetId failed. Discard this gem strip hit. Maybe it comes from unmatched geometry.";
145 int region = (
int)
id.region();
146 int layer = (
int)
id.layer();
148 int roll = (
int)
id.roll();
151 for (digiItr = (*cItr ).second.first; digiItr != (*cItr ).second.second; ++digiItr)
158 float g_r = (
float) gp.perp();
159 float g_x = (
float) gp.x();
160 float g_y = (
float) gp.y();
161 float g_z = (
float) gp.z();
164 int isPrompt = digiItr->prompt();
174 if ( region == -1 ) region_num = 0 ;
175 else if ( region == 1) region_num = 1;
176 int layer_num = layer-1;
178 bool toBeCounted2 =
true;
180 if (isPrompt == 1 &&
abs(particleType) == 13) {
185 for (
auto hits=ME0Hits->begin();
hits!=ME0Hits->end();
hits++) {
187 int particleType_sh =
hits->particleType();
188 int evtId_sh =
hits->eventId().event();
189 int bx_sh =
hits->eventId().bunchCrossing();
190 int procType_sh =
hits->processType();
192 if(!(
abs(particleType_sh) == 13 && evtId_sh == 0 && bx_sh == 0 && procType_sh == 0))
continue;
195 int region_sh =
id.region();
196 int layer_sh =
id.layer();
197 int chamber_sh =
id.chamber();
198 int roll_sh =
id.roll();
200 int region_sh_num = 0 ;
201 if ( region_sh == -1 ) region_sh_num = 0 ;
202 else if ( region_sh == 1) region_sh_num = 1;
203 int layer_sh_num = layer_sh - 1;
214 if(!(region == region_sh && layer == layer_sh && chamber == chamber_sh && roll == roll_sh))
continue;
216 float dx_loc = lp_sh.
x()-lp.x();
217 float dy_loc = lp_sh.
y()-lp.y();
218 float dphi_glob = gp_sh.
phi()-gp.phi();
219 float deta_glob = gp_sh.
eta()-gp.eta();
221 if(!(fabs(dphi_glob) < 3*
sigma_x_ && fabs(deta_glob) < 3*
sigma_y_))
continue;
223 float timeOfFlight_sh =
hits->tof();
226 float centralTOF(centralGP.mag() / 29.98);
227 float timeOfFlight_sh_corr = timeOfFlight_sh - centralTOF;
246 toBeCounted2 =
false;
250 toBeCounted1 =
false;
258 if ((
abs(particleType) == 11 ||
abs(particleType) == 22 ||
abs(particleType) == 2112) && isPrompt == 0)
260 if ((
abs(particleType) == 11) && isPrompt == 0)
262 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
virtual const GeomDet * idToDet(DetId) const
Geom::Phi< T > phi() const
std::vector< std::string > layerLabel
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
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 &)
std::vector< std::string > regionLabel
MonitorElement * me0_strip_dg_dy_local_Muon[2][6]
MonitorElement * me0_strip_dg_bkgNeutral_rad
MonitorElement * me0_strip_exp_bkgNeutral_rad
void setCurrentFolder(const std::string &fullpath)
MonitorElement * me0_strip_dg_dx_local_tot_Muon
MonitorElement * book2D(Args &&...args)
edm::EDGetToken InputTagToken_Digi
TH1F * getTH1F(void) const
std::vector< ME0DigiPreReco >::const_iterator const_iterator
MonitorElement * me0_strip_dg_time_tot
edm::EDGetToken InputTagToken_
return(e1-e2)*(e1-e2)+dp *dp
MonitorElement * me0_strip_dg_bkg_rad_tot
MonitorElement * me0_strip_dg_den_eta[2][6]
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]