33 #include <type_traits>
57 void endJob()
override;
59 void validateRPCChamberGeometry();
60 void validateRPCStripsGeometry();
62 void compareTransform(
const GlobalPoint&,
const TGeoMatrix*);
63 void compareShape(
const GeomDet*,
const float*);
66 float getDiff(
const float,
const float);
69 void makeHistograms2(
const char*);
70 void makeHistogram(
const string&, vector<float>&);
73 globalDistances_.clear();
75 bottomWidths_.clear();
104 : tokRPC_{esConsumes<RPCGeometry, MuonGeometryRecord>(
edm::ESInputTag{})},
105 infileName_(iConfig.getUntrackedParameter<
string>(
"infileName",
"cmsGeom10.root")),
106 outfileName_(iConfig.getUntrackedParameter<
string>(
"outfileName",
"validateRPCGeometry.root")),
107 tolerance_(iConfig.getUntrackedParameter<
int>(
"tolerance", 6)) {
108 fwGeometry_.loadMap(infileName_.c_str());
109 outFile_ =
new TFile(outfileName_.c_str(),
"RECREATE");
114 LogVerbatim(
"RPCGeometry") <<
"Validating RPC chamber geometry";
129 LogVerbatim(
"RPCGeometry") <<
"Failed to get matrix of RPC chamber with detid: " << chId.
rawId();
137 LogVerbatim(
"RPCGeometry") <<
"Failed to get shape of RPC chamber with detid: " << chId.
rawId();
150 const int n_strips = it->nstrips();
151 const float n_pitch = it->pitch();
157 for (
int istrips = 1; istrips <= n_strips; istrips++) {
163 LogVerbatim(
"RPCGeometry") <<
"ATTENTION! nStrips == 0";
170 double local[3] = {0.0, 0.0, 0.0};
183 float shapeBottomWidth;
185 float shapeThickness;
188 shapeTopWidth = shape[2];
189 shapeBottomWidth = shape[1];
190 shapeLength = shape[4];
191 shapeThickness = shape[3];
192 }
else if (shape[0] == 2) {
193 shapeTopWidth = shape[1];
194 shapeBottomWidth = shape[1];
195 shapeLength = shape[2];
196 shapeThickness = shape[3];
198 LogVerbatim(
"RPCGeometry") <<
"Failed to get box or trapezoid from shape";
203 float topWidth, bottomWidth;
208 array<const float, 4>
const& ps = tpbs->parameters();
216 }
else if ((dynamic_cast<const RectangularPlaneBounds*>(bounds))) {
219 bottomWidth = topWidth;
222 LogVerbatim(
"RPCGeometry") <<
"Failed to get bounds";
226 topWidths_.push_back(fabs(shapeTopWidth - topWidth));
227 bottomWidths_.push_back(fabs(shapeBottomWidth - bottomWidth));
228 lengths_.push_back(fabs(shapeLength - length));
234 (
p1.z() -
p2.z()) * (
p1.z() -
p2.z()));
241 return (val1 - val2);
249 string gdn =
d +
": distance between points in global coordinates";
252 string twn =
d +
": absolute difference between top widths (along X)";
255 string bwn =
d +
": absolute difference between bottom widths (along X)";
258 string ln =
d +
": absolute difference between lengths (along Y)";
261 string tn =
d +
": absolute difference between thicknesses (along Z)";
270 string ns =
d +
": absolute difference between nStrips";
273 string pi =
d +
": absolute difference between Strips Pitch";
276 string pl =
d +
": absolute difference between Strips Length";
286 TH1D
hist(
name.c_str(),
name.c_str(), 100, *minE * (1 + 0.10), *
maxE * (1 + 0.10));
288 for (
auto const& it :
data)
291 hist.GetXaxis()->SetTitle(
"[cm]");