110 double d_residual_xmin =
Parameters.getParameter<
double>(
"xmin");
111 double d_residual_xmax =
Parameters.getParameter<
double>(
"xmax");
113 int32_t i_normres_Nbins = Parameters.
getParameter<int32_t>(
"Nbinx");
114 double d_normres_xmin = Parameters.getParameter<
double>(
"xmin");
115 double d_normres_xmax = Parameters.getParameter<
double>(
"xmax");
129 auto ModuleID =
id.rawId();
130 auto isPixel =
id.subdetId() == 1 ||
id.subdetId() == 2;
135 switch (
id.subdetId()) {
136 case 1: pixel_organizer.setModuleFolder(ibooker, ModuleID, 0);
break;
137 case 2: pixel_organizer.setModuleFolder(ibooker, ModuleID, 0);
break;
142 std::string hid = hidmanager.createHistoId(
"HitResidualsX",
"det",ModuleID);
143 std::string normhid = hidmanager.createHistoId(
"NormalizedHitResidualsX",
"det",ModuleID);
145 histos.x.base = ibooker.
book1D(hid, hid, i_residuals_Nbins,d_residual_xmin,d_residual_xmax);
146 histos.x.base->setAxisTitle(
"(x_{pred} - x_{rec})' [cm]");
147 histos.x.normed = ibooker.
book1D(normhid, normhid, i_normres_Nbins,d_normres_xmin,d_normres_xmax);
148 histos.x.normed->setAxisTitle(
"(x_{pred} - x_{rec})'/#sigma");
150 std::string hid = hidmanager.createHistoId(
"HitResidualsY",
"det",ModuleID);
151 std::string normhid = hidmanager.createHistoId(
"NormalizedHitResidualsY",
"det",ModuleID);
153 histos.y.base = ibooker.
book1D(hid, hid, i_residuals_Nbins,d_residual_xmin,d_residual_xmax);
154 histos.y.base->setAxisTitle(
"(y_{pred} - y_{rec})' [cm]");
155 histos.y.normed = ibooker.
book1D(normhid, normhid, i_normres_Nbins,d_normres_xmin,d_normres_xmax);
156 histos.y.normed->setAxisTitle(
"(y_{pred} - y_{rec})'/#sigma");
164 switch (
id.subdetId()) {
170 default: strip_organizer.
setLayerFolder(ModuleID,tTopo,subdetandlayer.second);
173 auto isBarrel = subdetandlayer.first.find(
"B") != std::string::npos;
175 auto xy = std::vector<std::pair<HistoPair&, const char*> >
176 { std::make_pair(std::ref(
histos.x),
"X"),
177 std::make_pair(std::ref(
histos.y),
"Y") };
178 for (
auto& histopair :
xy) {
182 if (!
isPixel && histopair.second[0] ==
'Y')
continue;
185 Form(
"HitResiduals%s_%s%d",
187 isBarrel ?
"L" : (subdetandlayer.second > 0 ?
"Dp" :
"Dm"),
189 : (Form(
"HitResiduals_%s__%s__%d",
190 subdetandlayer.first.c_str(),
194 std::string histotitle = Form(
"HitResiduals %s on %s%s full %s %d",
196 subdetandlayer.first.c_str(),
197 isBarrel ?
"" : (subdetandlayer.second > 0 ?
"+" :
"-"),
202 std::string normhistoname = Form(
"Normalized%s", histoname.c_str());
203 std::string normhistotitle = Form(
"Normalized%s", histotitle.c_str());
207 histopair.first.base =
208 ibooker.
book1D(histoname.c_str(),histotitle.c_str(),
209 i_residuals_Nbins,d_residual_xmin,d_residual_xmax);
210 histopair.first.base->
setAxisTitle(
"(x_{pred} - x_{rec})' [cm]");
212 histopair.first.normed =
213 ibooker.
book1D(normhistoname.c_str(),normhistotitle.c_str(),
214 i_normres_Nbins,d_normres_xmin,d_normres_xmax);
215 histopair.first.normed->
setAxisTitle(
"(x_{pred} - x_{rec})'/#sigma");
T getParameter(std::string const &) const
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