|
|
Go to the documentation of this file.
36 #include <type_traits>
60 void endJob()
override;
62 void validateCSCChamberGeometry();
63 void validateCSCLayerGeometry();
65 void compareTransform(
const GlobalPoint&,
const TGeoMatrix*);
66 void compareShape(
const GeomDet*,
const float*);
69 float getDiff(
const float,
const float);
72 void makeHistograms2(
const char*);
73 void makeHistogram(
const string&, vector<float>&);
76 globalDistances_.clear();
78 bottomWidths_.clear();
84 yAxisOrientation_.clear();
86 yCentreOfStripPlane_.clear();
87 angularWidth_.clear();
88 centreToIntersection_.clear();
89 phiOfOneEdge_.clear();
121 : tokCSC_{esConsumes<CSCGeometry, MuonGeometryRecord>(
edm::ESInputTag{})},
122 infileName_(iConfig.getUntrackedParameter<
string>(
"infileName",
"cmsGeom10.root")),
123 outfileName_(iConfig.getUntrackedParameter<
string>(
"outfileName",
"validateCSCGeometry.root")),
124 tolerance_(iConfig.getUntrackedParameter<
int>(
"tolerance", 6)) {
125 fwGeometry_.loadMap(infileName_.c_str());
126 outFile_ = TFile::Open(outfileName_.c_str(),
"RECREATE");
131 LogVerbatim(
"CSCGeometry") <<
"Validating CSC chamber geometry";
146 LogVerbatim(
"CSCGeometry") <<
"Failed to get matrix of CSC chamber with detid: " << chId.
rawId();
154 LogVerbatim(
"CSCGeometry") <<
"Failed to get shape of CSC chamber with detid: " << chId.
rawId();
179 const double wire_spacing = wiretopo->
wireSpacing();
180 const float wire_angle = wiretopo->
wireAngle();
183 for (
int istrips = 1; istrips <= n_strips; istrips++) {
192 LogVerbatim(
"CSCGeometry") <<
"ATTENTION! nStrips == 0";
196 for (
int iwires = 1; iwires <= n_wire; iwires++) {
201 LogVerbatim(
"CSCGeometry") <<
"ATTENTION! nWires == 0";
208 double local[3] = {0.0, 0.0, 0.0};
221 float shapeBottomWidth;
223 float shapeThickness;
226 shapeTopWidth = shape[2];
227 shapeBottomWidth = shape[1];
228 shapeLength = shape[4];
229 shapeThickness = shape[3];
230 }
else if (shape[0] == 2) {
231 shapeTopWidth = shape[1];
232 shapeBottomWidth = shape[1];
233 shapeLength = shape[2];
234 shapeThickness = shape[3];
236 LogVerbatim(
"CSCGeometry") <<
"Failed to get box or trapezoid from shape";
241 float topWidth, bottomWidth;
246 array<const float, 4>
const& ps = tpbs->parameters();
254 }
else if ((dynamic_cast<const RectangularPlaneBounds*>(bounds))) {
257 bottomWidth = topWidth;
260 LogVerbatim(
"CSCGeometry") <<
"Failed to get bounds";
264 topWidths_.push_back(fabs(shapeTopWidth - topWidth));
265 bottomWidths_.push_back(fabs(shapeBottomWidth - bottomWidth));
266 lengths_.push_back(fabs(shapeLength - length));
272 (
p1.z() -
p2.z()) * (
p1.z() -
p2.z()));
279 return (val1 - val2);
287 string gdn =
d +
": distance between points in global coordinates";
290 string twn =
d +
": absolute difference between top widths (along X)";
293 string bwn =
d +
": absolute difference between bottom widths (along X)";
296 string ln =
d +
": absolute difference between lengths (along Y)";
299 string tn =
d +
": absolute difference between thicknesses (along Z)";
308 string ns =
d +
": absolute difference between Y Axis Orientation of the Strips";
311 string pi =
d +
": absolute difference between Strips Offset";
314 string pl =
d +
": absolute difference between 'Y centre' of the Strips Planes";
317 string aw =
d +
": absolute difference between 'angular width' of the Strips ";
320 string ci =
d +
": absolute difference between 'centre to intersection' of the Strips ";
323 string po =
d +
": absolute difference between 'phi of one edge' of the Strips ";
326 string ws =
d +
": absolute difference between 'wire spacing' of the Wires ";
329 string wa =
d +
": absolute difference between 'wire angle' of the Wires ";
339 TH1D
hist(
name.c_str(),
name.c_str(), 100, *minE * (1 + 0.10), *
maxE * (1 + 0.10));
341 for (
auto const& it :
data)
344 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
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
const CSCGeometry * cscGeometry_
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 &)
bool getData(T &iHolder) const
void validateCSCChamberGeometry()
void makeHistogram(const string &, vector< float > &)
float getDiff(const float, const float)
constexpr uint32_t rawId() const
get the raw id
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > tokCSC_
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)
int numberOfStrips() const
double wireSpacing() const
void analyze(const edm::Event &, const edm::EventSetup &) override