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, 68.2, 74.1, 81.1, 88.2, 96.6, 104.9, 115.1, 125.2, 137.3, 149.5};
40 int binnum =
sizeof(bins)/
sizeof(
float) - 1;
46 for(
unsigned int region_num = 0 ; region_num < nregion ; region_num++ ) {
49 for(
unsigned int layer_num = 0 ; layer_num < 6 ; layer_num++) {
58 std::string hist_label_for_dx_local =
"Local DeltaX: region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" ; #Delta X_{local} [cm]; Entries";
59 std::string hist_label_for_dy_local =
"Local DeltaY: region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" ; #Delta Y_{local} [cm]; Entries";
60 std::string hist_label_for_dphi_global =
"Global DeltaPhi: region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" ; #Delta #phi_{global} [rad]; Entries";
62 std::string hist_label_for_den_eta =
"Denominator: region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" ; #eta; Entries";
63 std::string hist_label_for_num_eta =
"Numerator: region"+
regionLabel[region_num]+
" layer "+layerLabel[layer_num]+
" ; #eta; Entries";
97 edm::LogError(
"ME0DigisValidation") <<
"Cannot get ME0Hits/ME0Digis by Token simInputTagToken";
102 bool toBeCounted1 =
true;
108 if ( gdet ==
nullptr) {
109 edm::LogWarning(
"ME0DigisValidation")<<
"Getting DetId failed. Discard this gem strip hit. Maybe it comes from unmatched geometry.";
115 int layer = (int)
id.layer();
116 int chamber = (int)
id.chamber();
120 for (digiItr = (*cItr ).second.first; digiItr != (*cItr ).second.second; ++digiItr)
127 float g_r = (float) gp.perp();
128 float g_x = (float) gp.x();
129 float g_y = (float) gp.y();
130 float g_z = (float) gp.z();
133 int isPrompt = digiItr->prompt();
143 if ( region == -1 ) region_num = 0 ;
144 else if ( region == 1) region_num = 1;
145 int layer_num = layer-1;
147 bool toBeCounted2 =
true;
149 if (isPrompt == 1 &&
abs(particleType) == 13) {
154 for (
auto hits=ME0Hits->begin(); hits!=ME0Hits->end(); hits++) {
156 int particleType_sh = hits->particleType();
157 int evtId_sh = hits->eventId().event();
158 int bx_sh = hits->eventId().bunchCrossing();
159 int procType_sh = hits->processType();
161 if(!(
abs(particleType_sh) == 13 && evtId_sh == 0 && bx_sh == 0 && procType_sh == 0))
continue;
163 const ME0DetId id(hits->detUnitId());
164 int region_sh =
id.
region();
165 int layer_sh =
id.layer();
166 int chamber_sh =
id.chamber();
169 int region_sh_num = 0 ;
170 if ( region_sh == -1 ) region_sh_num = 0 ;
171 else if ( region_sh == 1) region_sh_num = 1;
172 int layer_sh_num = layer_sh - 1;
183 if(!(region == region_sh && layer == layer_sh && chamber == chamber_sh ))
continue;
185 float dx_loc = lp_sh.
x()-lp.x();
186 float dy_loc = lp_sh.
y()-lp.y();
190 float timeOfFlight_sh = hits->tof();
193 float centralTOF(centralGP.mag() / 29.98);
194 float timeOfFlight_sh_corr = timeOfFlight_sh - centralTOF;
196 float dphi_glob = gp_sh.
phi()-gp.
phi();
215 toBeCounted2 =
false;
219 toBeCounted1 =
false;
227 if ((
abs(particleType) == 11 ||
abs(particleType) == 22 ||
abs(particleType) == 2112) && isPrompt == 0)
229 if ((
abs(particleType) == 11) && isPrompt == 0)
231 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]
MonitorElement * me0_strip_dg_den_eta_tot
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
void setCurrentFolder(const std::string &fullpath)
MonitorElement * me0_strip_dg_dx_local_tot_Muon
MonitorElement * book2D(Args &&...args)
edm::EDGetToken InputTagToken_Digi
int region() const
Region id: 0 for Barrel Not in use, +/-1 For +/- Endcap.
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_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]