|
|
Go to the documentation of this file.
33 #include <type_traits>
58 void endJob()
override;
60 void validateGEMChamberGeometry();
61 void validateGEMEtaPartitionGeometry();
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",
"cmsRecoGeom-2021.root")),
105 outfileName_(iConfig.getUntrackedParameter<
string>(
"outfileName",
"validateGEMGeometry.root")),
106 tolerance_(iConfig.getUntrackedParameter<
int>(
"tolerance", 6)) {
115 LogVerbatim(
"GEMGeometry") <<
"Validating GEM chamber geometry";
122 LogVerbatim(
"GEMGeometry") <<
"Invalid GEM geometry";
135 LogVerbatim(
"GEMGeometry") <<
"Failed to get matrix of GEM chamber with detid: " << chId.
rawId();
143 LogVerbatim(
"GEMGeometry") <<
"Failed to get shape of GEM chamber with detid: " << chId.
rawId();
156 const int n_strips = it->nstrips();
157 const float n_pitch = it->pitch();
164 for (
int istrips = 1; istrips <= n_strips; istrips++) {
170 LogVerbatim(
"GEMGeometry") <<
"ATTENTION! nStrips == 0";
177 double local[3] = {0.0, 0.0, 0.0};
190 float shapeBottomWidth;
192 float shapeThickness;
195 shapeTopWidth = shape[2];
196 shapeBottomWidth = shape[1];
197 shapeLength = shape[4];
198 shapeThickness = shape[3];
199 }
else if (shape[0] == 2) {
200 shapeTopWidth = shape[1];
201 shapeBottomWidth = shape[1];
202 shapeLength = shape[2];
203 shapeThickness = shape[3];
205 LogVerbatim(
"GEMGeometry") <<
"Failed to get box or trapezoid from shape";
210 float topWidth, bottomWidth;
215 array<const float, 4>
const& ps = tpbs->parameters();
223 }
else if ((dynamic_cast<const RectangularPlaneBounds*>(bounds))) {
226 bottomWidth = topWidth;
229 LogVerbatim(
"GEMGeometry") <<
"Failed to get bounds";
233 topWidths_.push_back(fabs(shapeTopWidth - topWidth));
234 bottomWidths_.push_back(fabs(shapeBottomWidth - bottomWidth));
235 lengths_.push_back(fabs(shapeLength - length));
241 (
p1.z() -
p2.z()) * (
p1.z() -
p2.z()));
248 return (val1 - val2);
256 string gdn =
d +
": distance between points in global coordinates";
259 string twn =
d +
": absolute difference between top widths (along X)";
262 string bwn =
d +
": absolute difference between bottom widths (along X)";
265 string ln =
d +
": absolute difference between lengths (along Y)";
268 string tn =
d +
": absolute difference between thicknesses (along Z)";
277 string ns =
d +
": absolute difference between nStrips";
280 string pi =
d +
": absolute difference between Strips Pitch";
283 string pl =
d +
": absolute difference between Strips Length";
293 TH1D
hist(
name.c_str(),
name.c_str(), 100, *minE * (1 + 0.10), *
maxE * (1 + 0.10));
295 for (
auto const& it :
data)
298 hist.GetXaxis()->SetTitle(
"[cm]");
vector< float > globalDistances_
void compareTransform(const GlobalPoint &, const TGeoMatrix *)
void analyze(const edm::Event &, const edm::EventSetup &) override
virtual float width() const =0
void loadMap(const char *fileName)
GEMGeometryValidate(const ParameterSet &)
const float * getShapePars(unsigned int id) const
void validateGEMEtaPartitionGeometry()
void makeHistograms2(const char *)
Point3DBase< Scalar, LocalTag > LocalPoint
virtual float length() const =0
edm::ESHandle< GEMGeometry > gemGeometry_
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)
vector< float > bottomWidths_
const Bounds & bounds() const
void compareShape(const GeomDet *, const float *)
Global3DPoint GlobalPoint
float getDistance(const GlobalPoint &, const GlobalPoint &)
float getDiff(const float, const float)
virtual float thickness() const =0
virtual float stripLength() const =0
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
vector< float > thicknesses_
void makeHistograms(const char *)
enable_if<!numeric_limits< T >::is_integer, bool >::type almost_equal(T x, T y, int ulp)
~GEMGeometryValidate() override
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
void validateGEMChamberGeometry()
constexpr uint32_t rawId() const
get the raw id
Log< level::Info, true > LogVerbatim
vector< float > stripslen_
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
char data[epos_bytes_allocation]
Abs< T >::type abs(const T &t)
vector< float > topWidths_
void makeHistogram(const string &, vector< float > &)