114 double d_residual_xmin =
Parameters.getParameter<
double>(
"xmin");
115 double d_residual_xmax =
Parameters.getParameter<
double>(
"xmax");
117 int32_t i_normres_Nbins = Parameters.
getParameter<int32_t>(
"Nbinx");
118 double d_normres_xmin = Parameters.getParameter<
double>(
"xmin");
119 double d_normres_xmax = Parameters.getParameter<
double>(
"xmax");
131 auto ModuleID =
id.rawId();
132 auto isPixel =
id.subdetId() == 1 ||
id.subdetId() == 2;
138 switch (
id.subdetId()) {
140 pixel_organizer.setModuleFolder(ibooker, ModuleID, 0);
143 pixel_organizer.setModuleFolder(ibooker, ModuleID, 0);
150 std::string hid = hidmanager.createHistoId(
"HitResidualsX",
"det", ModuleID);
151 std::string normhid = hidmanager.createHistoId(
"NormalizedHitResidualsX",
"det", ModuleID);
153 histos.x.base = ibooker.
book1D(hid, hid, i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
154 histos.x.base->setAxisTitle(
"(x_{pred} - x_{rec})' [cm]");
155 histos.x.normed = ibooker.
book1D(normhid, normhid, i_normres_Nbins, d_normres_xmin, d_normres_xmax);
156 histos.x.normed->setAxisTitle(
"(x_{pred} - x_{rec})'/#sigma");
159 std::string hid = hidmanager.createHistoId(
"HitResidualsY",
"det", ModuleID);
160 std::string normhid = hidmanager.createHistoId(
"NormalizedHitResidualsY",
"det", ModuleID);
162 histos.y.base = ibooker.
book1D(hid, hid, i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
163 histos.y.base->setAxisTitle(
"(y_{pred} - y_{rec})' [cm]");
164 histos.y.normed = ibooker.
book1D(normhid, normhid, i_normres_Nbins, d_normres_xmin, d_normres_xmax);
165 histos.y.normed->setAxisTitle(
"(y_{pred} - y_{rec})'/#sigma");
173 switch (
id.subdetId()) {
185 strip_organizer.
setLayerFolder(ModuleID, tTopo, subdetandlayer.second);
188 auto isBarrel = subdetandlayer.first.find(
"B") != std::string::npos;
190 auto xy = std::vector<std::pair<HistoPair &, const char *>>{std::make_pair(std::ref(
histos.x),
"X"),
191 std::make_pair(std::ref(
histos.y),
"Y")};
192 for (
auto &histopair :
xy) {
197 if (!
isPixel && histopair.second[0] ==
'Y')
201 Form(
"HitResiduals%s_%s%d",
203 isBarrel ?
"L" : (subdetandlayer.second > 0 ?
"Dp" :
"Dm"),
205 : (Form(
"HitResiduals_%s__%s__%d",
207 subdetandlayer.first.c_str(),
211 std::string histotitle = Form(
"HitResiduals %s on %s%s full %s %d",
213 subdetandlayer.first.c_str(),
214 isBarrel ?
"" : (subdetandlayer.second > 0 ?
"+" :
"-"),
218 std::string normhistoname = Form(
"Normalized%s", histoname.c_str());
219 std::string normhistotitle = Form(
"Normalized%s", histotitle.c_str());
224 histopair.first.base =
225 ibooker.
book1D(histoname.c_str(), histotitle.c_str(), i_residuals_Nbins, d_residual_xmin, d_residual_xmax);
226 histopair.first.base->
setAxisTitle(
"(x_{pred} - x_{rec})' [cm]");
228 histopair.first.normed = ibooker.
book1D(
229 normhistoname.c_str(), normhistotitle.c_str(), i_normres_Nbins, d_normres_xmin, d_normres_xmax);
230 histopair.first.normed->
setAxisTitle(
"(x_{pred} - x_{rec})'/#sigma");
T getParameter(std::string const &) const
bool isBarrel(GeomDetEnumerators::SubDetector m)
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
void setDetectorFolder(uint32_t rawdetid, const TrackerTopology *tTopo)
vector< ParameterSet > Parameters
void setCurrentFolder(std::string const &fullpath)
HistoSet m_ModuleResiduals
HistoSet m_SubdetLayerResiduals
MonitorElement * book1D(Args &&...args)
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
Abs< T >::type abs(const T &t)
bool isPixel(HitType hitType)
std::pair< std::string, int32_t > findSubdetAndLayer(uint32_t ModuleID, const TrackerTopology *tTopo)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const