|
|
Go to the documentation of this file.
34 #include <type_traits>
58 void endJob()
override;
60 void validateRPCChamberGeometry();
61 void validateRPCStripsGeometry();
63 void compareTransform(
const GlobalPoint&,
const TGeoMatrix*);
64 void compareShape(
const GeomDet*,
const float*);
67 float getDiff(
const float,
const float);
70 void makeHistograms2(
const char*);
71 void makeHistogram(
const string&, vector<float>&);
74 globalDistances_.clear();
76 bottomWidths_.clear();
104 : infileName_(iConfig.getUntrackedParameter<
string>(
"infileName",
"cmsGeom10.root")),
105 outfileName_(iConfig.getUntrackedParameter<
string>(
"outfileName",
"validateRPCGeometry.root")),
106 tolerance_(iConfig.getUntrackedParameter<
int>(
"tolerance", 6)) {
114 LogVerbatim(
"RPCGeometry") <<
"Validating RPC chamber geometry";
118 LogVerbatim(
"RPCGeometry") <<
"Invalid RPC geometry";
131 LogVerbatim(
"RPCGeometry") <<
"Failed to get matrix of RPC chamber with detid: " << chId.
rawId();
139 LogVerbatim(
"RPCGeometry") <<
"Failed to get shape of RPC chamber with detid: " << chId.
rawId();
152 const int n_strips = it->nstrips();
153 const float n_pitch = it->pitch();
159 for (
int istrips = 1; istrips <= n_strips; istrips++) {
165 LogVerbatim(
"RPCGeometry") <<
"ATTENTION! nStrips == 0";
172 double local[3] = {0.0, 0.0, 0.0};
185 float shapeBottomWidth;
187 float shapeThickness;
190 shapeTopWidth = shape[2];
191 shapeBottomWidth = shape[1];
192 shapeLength = shape[4];
193 shapeThickness = shape[3];
194 }
else if (shape[0] == 2) {
195 shapeTopWidth = shape[1];
196 shapeBottomWidth = shape[1];
197 shapeLength = shape[2];
198 shapeThickness = shape[3];
200 LogVerbatim(
"RPCGeometry") <<
"Failed to get box or trapezoid from shape";
205 float topWidth, bottomWidth;
210 array<const float, 4>
const& ps = tpbs->parameters();
218 }
else if ((dynamic_cast<const RectangularPlaneBounds*>(bounds))) {
221 bottomWidth = topWidth;
224 LogVerbatim(
"RPCGeometry") <<
"Failed to get bounds";
228 topWidths_.push_back(fabs(shapeTopWidth - topWidth));
229 bottomWidths_.push_back(fabs(shapeBottomWidth - bottomWidth));
230 lengths_.push_back(fabs(shapeLength - length));
236 (
p1.z() -
p2.z()) * (
p1.z() -
p2.z()));
243 return (val1 - val2);
251 string gdn =
d +
": distance between points in global coordinates";
254 string twn =
d +
": absolute difference between top widths (along X)";
257 string bwn =
d +
": absolute difference between bottom widths (along X)";
260 string ln =
d +
": absolute difference between lengths (along Y)";
263 string tn =
d +
": absolute difference between thicknesses (along Z)";
272 string ns =
d +
": absolute difference between nStrips";
275 string pi =
d +
": absolute difference between Strips Pitch";
278 string pl =
d +
": absolute difference between Strips Length";
288 TH1D
hist(
name.c_str(),
name.c_str(), 100, *minE * (1 + 0.10), *
maxE * (1 + 0.10));
290 for (
auto const& it :
data)
293 hist.GetXaxis()->SetTitle(
"[cm]");
virtual float width() const =0
void loadMap(const char *fileName)
void compareTransform(const GlobalPoint &, const TGeoMatrix *)
const float * getShapePars(unsigned int id) const
Point3DBase< Scalar, LocalTag > LocalPoint
virtual float length() const =0
const Plane & surface() const
The nominal surface of the GeomDet.
const float * getParameters(unsigned int id) const
const TGeoMatrix * getMatrix(unsigned int id) const
#define DEFINE_FWK_MODULE(type)
const Bounds & bounds() const
vector< float > topWidths_
Global3DPoint GlobalPoint
void compareShape(const GeomDet *, const float *)
~RPCGeometryValidate() override
virtual float thickness() const =0
virtual float stripLength() const =0
void makeHistogram(const string &, vector< float > &)
edm::ESHandle< RPCGeometry > rpcGeometry_
void validateRPCStripsGeometry()
vector< float > globalDistances_
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
vector< float > stripslen_
vector< float > bottomWidths_
float getDistance(const GlobalPoint &, const GlobalPoint &)
constexpr uint32_t rawId() const
get the raw id
void validateRPCChamberGeometry()
RPCGeometryValidate(const ParameterSet &)
void makeHistograms2(const char *)
Log< level::Info, true > LogVerbatim
void analyze(const edm::Event &, const edm::EventSetup &) override
char data[epos_bytes_allocation]
Abs< T >::type abs(const T &t)
float getDiff(const float, const float)
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
void makeHistograms(const char *)
enable_if<!numeric_limits< T >::is_integer, bool >::type almost_equal(T x, T y, int ulp)
vector< float > thicknesses_