CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/Geometry/RPCGeometry/src/RPCRoll.cc

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