33 #include <type_traits> 57 void endJob()
override;
59 void validateME0ChamberGeometry();
60 void validateME0EtaPartitionGeometry();
61 void validateME0EtaPartitionGeometry2();
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();
105 : tokGeom_{esConsumes<ME0Geometry, MuonGeometryRecord>(
edm::ESInputTag{})},
106 infileName_(iConfig.getUntrackedParameter<
string>(
"infileName",
"cmsRecoGeom-2026.root")),
107 outfileName_(iConfig.getUntrackedParameter<
string>(
"outfileName",
"validateME0Geometry.root")),
108 tolerance_(iConfig.getUntrackedParameter<
int>(
"tolerance", 6)) {
109 fwGeometry_.loadMap(infileName_.c_str());
110 outFile_ = TFile::Open(outfileName_.c_str(),
"RECREATE");
115 LogTrace(
"ME0Geometry") <<
"Validating ME0 chamber geometry";
130 LogTrace(
"ME0Geometry") <<
"Failed to get matrix of ME0 chamber with detid: " << chId.
rawId();
138 LogTrace(
"ME0Geometry") <<
"Failed to get shape of ME0 chamber with detid: " << chId.
rawId();
155 LogTrace(
"ME0Geometry") <<
"Failed to get matrix of ME0 eta partition 2 with detid: " << chId.
rawId();
163 LogTrace(
"ME0Geometry") <<
"Failed to get shape of ME0 eta partition 2 with detid: " << chId.
rawId();
176 const int n_strips =
it->nstrips();
177 const float n_pitch =
it->pitch();
184 for (
int istrips = 1; istrips <= n_strips; istrips++) {
195 LogWarning(
"ME0Geometry") <<
"ATTENTION! nStrips == 0";
202 double local[3] = {0.0, 0.0, 0.0};
215 float shapeBottomWidth;
217 float shapeThickness;
220 shapeTopWidth =
shape[2];
221 shapeBottomWidth =
shape[1];
222 shapeLength =
shape[4];
223 shapeThickness =
shape[3];
224 }
else if (
shape[0] == 2) {
225 shapeTopWidth =
shape[1];
226 shapeBottomWidth =
shape[1];
227 shapeLength =
shape[2];
228 shapeThickness =
shape[3];
230 LogTrace(
"ME0Geometry") <<
"Failed to get box or trapezoid from shape";
235 float topWidth, bottomWidth;
240 array<const float, 4>
const& ps = tpbs->parameters();
249 }
else if ((dynamic_cast<const RectangularPlaneBounds*>(
bounds))) {
252 bottomWidth = topWidth;
256 LogTrace(
"ME0Geometry") <<
"Failed to get bounds";
268 (
p1.z() -
p2.z()) * (
p1.z() -
p2.z()));
275 return (val1 - val2);
283 string gdn =
d +
": distance between points in global coordinates";
286 string twn =
d +
": absolute difference between top widths (along X)";
289 string bwn =
d +
": absolute difference between bottom widths (along X)";
292 string ln =
d +
": absolute difference between lengths (along Y)";
295 string tn =
d +
": absolute difference between thicknesses (along Z)";
304 string ns =
d +
": absolute difference between nStrips";
307 string pi =
d +
": absolute difference between Strips Pitch";
310 string pl =
d +
": absolute difference between Strips Length";
320 TH1D
hist(
name.c_str(),
name.c_str(), 100, *minE * (1 + 0.10), *
maxE * (1 + 0.10));
322 for (
auto const&
it :
data)
325 hist.GetXaxis()->SetTitle(
"[cm]");
~ME0GeometryValidate() override
Point3DBase< Scalar, LocalTag > LocalPoint
virtual float length() const =0
float getDiff(const float, const float)
Global3DPoint GlobalPoint
enable_if<!numeric_limits< T >::is_integer, bool >::type almost_equal(T x, T y, int ulp)
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
vector< float > thicknesses_
void analyze(const edm::Event &, const edm::EventSetup &) override
virtual float thickness() const =0
virtual float stripLength() const =0
vector< float > globalDistances_
const std::vector< const ME0Chamber * > & chambers() const
Return a vector of all ME0 chambers.
const ME0Geometry * me0Geometry_
const edm::ESGetToken< ME0Geometry, MuonGeometryRecord > tokGeom_
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
float getDistance(const GlobalPoint &, const GlobalPoint &)
vector< float > topWidths_
void compareShape(const GeomDet *, const float *)
void compareTransform(const GlobalPoint &, const TGeoMatrix *)
const Plane & surface() const
The nominal surface of the GeomDet.
void makeHistograms2(const char *)
constexpr uint32_t rawId() const
get the raw id
const float * getShapePars(unsigned int id) const
char data[epos_bytes_allocation]
void validateME0EtaPartitionGeometry()
const float * getParameters(unsigned int id) const
const TGeoMatrix * getMatrix(unsigned int id) const
void makeHistograms(const char *)
vector< float > stripslen_
vector< float > bottomWidths_
void makeHistogram(const string &, vector< float > &)
Log< level::Warning, false > LogWarning
virtual float width() const =0
ME0GeometryValidate(const ParameterSet &)
void validateME0EtaPartitionGeometry2()
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
void validateME0ChamberGeometry()
const Bounds & bounds() const