File indexing completed on 2024-04-06 12:15:19
0001 #include "Geometry/RPCGeometry/interface/RPCRollSpecs.h"
0002 #include "Geometry/CommonTopologies/interface/RectangularStripTopology.h"
0003 #include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h"
0004
0005 using namespace GeomDetEnumerators;
0006
0007 RPCRollSpecs::RPCRollSpecs(SubDetector rss, const std::string& name, const RPCSpecs& pars)
0008 : GeomDetType(name, rss), _p(pars), _n(name) {
0009 if (rss == RPCBarrel) {
0010 int nstrip = static_cast<int>(_p[2]);
0011 float pitch = _p[0] * 2 / _p[2];
0012 float striplength = _p[1] * 2;
0013 _top = new RectangularStripTopology(nstrip, pitch, striplength);
0014 } else if (rss == RPCEndcap) {
0015 float b = _p[0];
0016 float B = _p[1];
0017 float h = _p[2];
0018 float r0 = h * (B + b) / (B - b);
0019 float striplength = h * 2;
0020 float strips = _p[3];
0021 float pitch = (b + B) / strips;
0022 int nstrip = static_cast<int>(strips);
0023
0024 _top = new TrapezoidalStripTopology(nstrip, pitch, striplength, r0);
0025 } else {
0026 _top = nullptr;
0027 }
0028 }
0029
0030 RPCRollSpecs::~RPCRollSpecs() {
0031 if (_top)
0032 delete _top;
0033 _top = nullptr;
0034 }
0035
0036 const Topology& RPCRollSpecs::topology() const { return *(_top); }
0037
0038 const StripTopology& RPCRollSpecs::specificTopology() const { return *(_top); }
0039
0040 const std::string& RPCRollSpecs::detName() const { return _n; }