Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:19

0001 #include "Geometry/RPCGeometry/interface/RPCRoll.h"
0002 #include "Geometry/RPCGeometry/interface/RPCRollSpecs.h"
0003 #include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h"
0004 
0005 RPCRoll::RPCRoll(RPCDetId id, const BoundPlane::BoundPlanePointer& bp, RPCRollSpecs* rrs)
0006     : GeomDetUnit(bp), _id(id), _rrs(rrs) {
0007   setDetId(id);
0008 }
0009 
0010 RPCRoll::~RPCRoll() {
0011   delete _rrs;  //Assume the roll owns it specs (specs are not shared)
0012 }
0013 
0014 const RPCRollSpecs* RPCRoll::specs() const { return _rrs; }
0015 
0016 RPCDetId RPCRoll::id() const { return _id; }
0017 
0018 const Topology& RPCRoll::topology() const { return _rrs->topology(); }
0019 
0020 const GeomDetType& RPCRoll::type() const { return (*_rrs); }
0021 
0022 const RPCChamber* RPCRoll::chamber() const { return theCh; }
0023 
0024 int RPCRoll::nstrips() const { return this->specificTopology().nstrips(); }
0025 
0026 LocalPoint RPCRoll::centreOfStrip(int strip) const {
0027   float s = static_cast<float>(strip) - 0.5;
0028   return this->specificTopology().localPosition(s);
0029 }
0030 
0031 LocalPoint RPCRoll::centreOfStrip(float strip) const { return this->specificTopology().localPosition(strip); }
0032 
0033 LocalError RPCRoll::localError(float strip) const { return this->specificTopology().localError(strip, 1. / sqrt(12.)); }
0034 
0035 float RPCRoll::strip(const LocalPoint& lp) const { return this->specificTopology().strip(lp); }
0036 
0037 float RPCRoll::localPitch(const LocalPoint& lp) const { return this->specificTopology().localPitch(lp); }
0038 
0039 float RPCRoll::pitch() const { return this->specificTopology().pitch(); }
0040 
0041 bool RPCRoll::isBarrel() const { return ((this->id()).region() == 0); }
0042 
0043 bool RPCRoll::isForward() const
0044 
0045 {
0046   return (!this->isBarrel());
0047 }
0048 
0049 const StripTopology& RPCRoll::specificTopology() const { return _rrs->specificTopology(); }
0050 
0051 void RPCRoll::setChamber(const RPCChamber* ch) { theCh = ch; }