File indexing completed on 2024-04-06 12:14:39
0001 #include "Geometry/GEMGeometry/interface/GEMEtaPartitionSpecs.h"
0002 #include "Geometry/CommonTopologies/interface/GEMStripTopology.h"
0003
0004 using namespace GeomDetEnumerators;
0005 using namespace angle_units::operators;
0006
0007 GEMEtaPartitionSpecs::GEMEtaPartitionSpecs(SubDetector rss, const std::string& name, const GEMSpecs& pars)
0008 : GeomDetType(name, rss), _p(pars), _n(name) {
0009 if (rss == GEM) {
0010 float b = _p[0];
0011 float B = _p[1];
0012 float h = _p[2];
0013 float r0 = h * (B + b) / (B - b);
0014 float striplength = h * 2;
0015 float strips = _p[3];
0016 float dphi = _p[5];
0017 float phiPitch = dphi / strips;
0018
0019 int nstrip = static_cast<int>(strips);
0020 _top = new GEMStripTopology(nstrip, phiPitch, striplength, r0);
0021
0022 float pads = _p[4];
0023 float padPhiPitch = dphi / pads;
0024
0025 int npad = static_cast<int>(pads);
0026 _top_pad = new GEMStripTopology(npad, padPhiPitch, striplength, r0);
0027 } else {
0028 _top = nullptr;
0029 _top_pad = nullptr;
0030 }
0031 }
0032
0033 GEMEtaPartitionSpecs::~GEMEtaPartitionSpecs() {
0034 if (_top)
0035 delete _top;
0036 if (_top_pad)
0037 delete _top_pad;
0038 }
0039
0040 const Topology& GEMEtaPartitionSpecs::topology() const { return *_top; }
0041
0042 const StripTopology& GEMEtaPartitionSpecs::specificTopology() const { return *_top; }
0043
0044 const Topology& GEMEtaPartitionSpecs::padTopology() const { return *_top_pad; }
0045
0046 const StripTopology& GEMEtaPartitionSpecs::specificPadTopology() const { return *_top_pad; }
0047
0048 const std::string& GEMEtaPartitionSpecs::detName() const { return _n; }
0049
0050 const std::vector<float>& GEMEtaPartitionSpecs::parameters() const { return _p; }