|
|
Go to the documentation of this file.
37 #include <type_traits>
61 void endJob()
override;
63 void validateCSCChamberGeometry();
64 void validateCSCLayerGeometry();
66 void compareTransform(
const GlobalPoint&,
const TGeoMatrix*);
67 void compareShape(
const GeomDet*,
const float*);
70 float getDiff(
const float,
const float);
73 void makeHistograms2(
const char*);
74 void makeHistogram(
const string&, vector<float>&);
77 globalDistances_.clear();
79 bottomWidths_.clear();
85 yAxisOrientation_.clear();
87 yCentreOfStripPlane_.clear();
88 angularWidth_.clear();
89 centreToIntersection_.clear();
90 phiOfOneEdge_.clear();
121 : infileName_(iConfig.getUntrackedParameter<
string>(
"infileName",
"cmsGeom10.root")),
122 outfileName_(iConfig.getUntrackedParameter<
string>(
"outfileName",
"validateCSCGeometry.root")),
123 tolerance_(iConfig.getUntrackedParameter<
int>(
"tolerance", 6)) {
131 LogVerbatim(
"CSCGeometry") <<
"Validating CSC chamber geometry";
135 LogVerbatim(
"CSCGeometry") <<
"Invalid CSC geometry";
148 LogVerbatim(
"CSCGeometry") <<
"Failed to get matrix of CSC chamber with detid: " << chId.
rawId();
156 LogVerbatim(
"CSCGeometry") <<
"Failed to get shape of CSC chamber with detid: " << chId.
rawId();
181 const double wire_spacing = wiretopo->
wireSpacing();
182 const float wire_angle = wiretopo->
wireAngle();
185 for (
int istrips = 1; istrips <= n_strips; istrips++) {
194 LogVerbatim(
"CSCGeometry") <<
"ATTENTION! nStrips == 0";
198 for (
int iwires = 1; iwires <= n_wire; iwires++) {
203 LogVerbatim(
"CSCGeometry") <<
"ATTENTION! nWires == 0";
210 double local[3] = {0.0, 0.0, 0.0};
223 float shapeBottomWidth;
225 float shapeThickness;
228 shapeTopWidth = shape[2];
229 shapeBottomWidth = shape[1];
230 shapeLength = shape[4];
231 shapeThickness = shape[3];
232 }
else if (shape[0] == 2) {
233 shapeTopWidth = shape[1];
234 shapeBottomWidth = shape[1];
235 shapeLength = shape[2];
236 shapeThickness = shape[3];
238 LogVerbatim(
"CSCGeometry") <<
"Failed to get box or trapezoid from shape";
243 float topWidth, bottomWidth;
248 array<const float, 4>
const& ps = tpbs->parameters();
256 }
else if ((dynamic_cast<const RectangularPlaneBounds*>(bounds))) {
259 bottomWidth = topWidth;
262 LogVerbatim(
"CSCGeometry") <<
"Failed to get bounds";
266 topWidths_.push_back(fabs(shapeTopWidth - topWidth));
267 bottomWidths_.push_back(fabs(shapeBottomWidth - bottomWidth));
268 lengths_.push_back(fabs(shapeLength - length));
274 (
p1.z() -
p2.z()) * (
p1.z() -
p2.z()));
281 return (val1 - val2);
289 string gdn =
d +
": distance between points in global coordinates";
292 string twn =
d +
": absolute difference between top widths (along X)";
295 string bwn =
d +
": absolute difference between bottom widths (along X)";
298 string ln =
d +
": absolute difference between lengths (along Y)";
301 string tn =
d +
": absolute difference between thicknesses (along Z)";
310 string ns =
d +
": absolute difference between Y Axis Orientation of the Strips";
313 string pi =
d +
": absolute difference between Strips Offset";
316 string pl =
d +
": absolute difference between 'Y centre' of the Strips Planes";
319 string aw =
d +
": absolute difference between 'angular width' of the Strips ";
322 string ci =
d +
": absolute difference between 'centre to intersection' of the Strips ";
325 string po =
d +
": absolute difference between 'phi of one edge' of the Strips ";
328 string ws =
d +
": absolute difference between 'wire spacing' of the Wires ";
331 string wa =
d +
": absolute difference between 'wire angle' of the Wires ";
341 TH1D
hist(
name.c_str(),
name.c_str(), 100, *minE * (1 + 0.10), *
maxE * (1 + 0.10));
343 for (
auto const& it :
data)
346 hist.GetXaxis()->SetTitle(
"[cm]");
vector< float > yAxisOrientation_
vector< float > wireSpacing_
vector< float > phiOfOneEdge_
vector< float > globalDistances_
virtual float width() const =0
float wireAngle() const override
void loadMap(const char *fileName)
int numberOfWires() const
float angularWidth() const override
const float * getShapePars(unsigned int id) const
void validateCSCLayerGeometry()
void makeHistograms2(const char *)
void compareTransform(const GlobalPoint &, const TGeoMatrix *)
vector< float > bottomWidths_
Point3DBase< Scalar, LocalTag > LocalPoint
~CSCGeometryValidate() override
vector< float > thicknesses_
float centreToIntersection() const override
virtual float length() const =0
float yCentreOfStripPlane() const override
void compareShape(const GeomDet *, const float *)
const Plane & surface() const
The nominal surface of the GeomDet.
const float * getParameters(unsigned int id) const
vector< float > centreToIntersection_
const TGeoMatrix * getMatrix(unsigned int id) const
#define DEFINE_FWK_MODULE(type)
vector< float > topWidths_
const Bounds & bounds() const
const CSCStripTopology * topology() const
vector< float > yCentreOfStripPlane_
Global3DPoint GlobalPoint
virtual float thickness() const =0
enable_if<!numeric_limits< T >::is_integer, bool >::type almost_equal(T x, T y, int ulp)
vector< float > angularWidth_
float yAxisOrientation() const override
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void makeHistograms(const char *)
float getDistance(const GlobalPoint &, const GlobalPoint &)
void validateCSCChamberGeometry()
void makeHistogram(const string &, vector< float > &)
float getDiff(const float, const float)
constexpr uint32_t rawId() const
get the raw id
const CSCWireTopology * wireTopology() const
Log< level::Info, true > LogVerbatim
CSCGeometryValidate(const ParameterSet &)
float stripOffset(void) const
const LayerContainer & layers() const
Return a vector of all layers.
float phiOfOneEdge() const override
const ChamberContainer & chambers() const
Return a vector of all chambers.
char data[epos_bytes_allocation]
vector< float > wireAngle_
Abs< T >::type abs(const T &t)
edm::ESHandle< CSCGeometry > cscGeometry_
int numberOfStrips() const
double wireSpacing() const
void analyze(const edm::Event &, const edm::EventSetup &) override