00001 #include "Geometry/RPCGeometry/interface/RPCRoll.h" 00002 #include "Geometry/RPCGeometry/interface/RPCRollSpecs.h" 00003 #include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h" 00004 00005 00006 RPCRoll::RPCRoll(RPCDetId id, BoundPlane::BoundPlanePointer bp, RPCRollSpecs* rrs) : 00007 GeomDetUnit(bp), _id(id),_rrs(rrs) 00008 {} 00009 00010 RPCRoll::~RPCRoll() 00011 { 00012 delete _rrs; //Assume the roll owns it specs (specs are not shared) 00013 } 00014 00015 const RPCRollSpecs* 00016 RPCRoll::specs() const 00017 { 00018 return _rrs; 00019 } 00020 00021 DetId 00022 RPCRoll::geographicalId() const 00023 { 00024 return _id; 00025 } 00026 00027 RPCDetId 00028 RPCRoll::id() const 00029 { 00030 return _id; 00031 } 00032 00033 const Topology& 00034 RPCRoll::topology() const 00035 { 00036 return _rrs->topology(); 00037 } 00038 00039 const GeomDetType& 00040 RPCRoll::type() const 00041 { 00042 return (*_rrs); 00043 } 00044 00045 const RPCChamber* RPCRoll::chamber() const { 00046 return theCh; 00047 } 00048 00049 int 00050 RPCRoll::nstrips() const 00051 { 00052 return this->specificTopology().nstrips(); 00053 } 00054 00055 LocalPoint 00056 RPCRoll::centreOfStrip(int strip) const 00057 { 00058 float s = static_cast<float>(strip)-0.5; 00059 return this->specificTopology().localPosition(s); 00060 } 00061 00062 LocalPoint 00063 RPCRoll::centreOfStrip(float strip) const 00064 { 00065 return this->specificTopology().localPosition(strip); 00066 } 00067 00068 LocalError 00069 RPCRoll::localError(float strip) const 00070 { 00071 return this->specificTopology().localError(strip,1./sqrt(12.)); 00072 } 00073 00074 float 00075 RPCRoll::strip(const LocalPoint& lp) const 00076 { 00077 return this->specificTopology().strip(lp); 00078 00079 } 00080 00081 float 00082 RPCRoll::localPitch(const LocalPoint& lp) const 00083 { 00084 return this->specificTopology().localPitch(lp); 00085 00086 } 00087 00088 float 00089 RPCRoll::pitch() const 00090 { 00091 return this->specificTopology().pitch(); 00092 00093 } 00094 00095 bool 00096 RPCRoll::isBarrel() const 00097 { 00098 return ((this->id()).region()==0); 00099 } 00100 00101 bool 00102 RPCRoll::isForward() const 00103 00104 { 00105 return (!this->isBarrel()); 00106 } 00107 00108 00109 00110 const StripTopology& 00111 RPCRoll::specificTopology() const 00112 { 00113 return _rrs->specificTopology(); 00114 } 00115 00116 00117 00118 00119 void 00120 RPCRoll::setChamber(const RPCChamber* ch) 00121 { 00122 theCh = ch; 00123 }