CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/Geometry/RPCGeometry/src/RPCRollSpecs.cc

Go to the documentation of this file.
00001 #include "Geometry/RPCGeometry/interface/RPCRollSpecs.h"
00002 #include "Geometry/CommonTopologies/interface/RectangularStripTopology.h"
00003 #include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h"
00004 
00005 
00006 using namespace GeomDetEnumerators;
00007 
00008 
00009 RPCRollSpecs::RPCRollSpecs( SubDetector rss, const std::string& name, const RPCSpecs& pars)
00010   :  GeomDetType(name,rss),_p(pars),_n(name)
00011 {
00012   if (rss == RPCBarrel ){
00013     int nstrip =static_cast<int>( _p[2]);
00014     float pitch = _p[0]*2/_p[2];
00015     float striplength = _p[1]*2;
00016     _top = new RectangularStripTopology(nstrip,pitch,striplength);
00017   }else if (rss == RPCEndcap ){
00018     float b = _p[0];
00019     float B = _p[1];
00020     float h = _p[2];
00021     float r0 = h*(B+b)/(B-b);
00022     float striplength = h*2;
00023     float strips = _p[3];
00024     float pitch = (b+B)/strips;
00025     int nstrip =static_cast<int>(strips);
00026   
00027     _top = new TrapezoidalStripTopology(nstrip,pitch,striplength,r0);
00028   } else {
00029     _top = 0;
00030   }
00031 }
00032 
00033 
00034 RPCRollSpecs::~RPCRollSpecs()
00035 {
00036   if (_top)
00037     delete _top;
00038   _top=0;
00039 }
00040 
00041 
00042 const Topology& 
00043 RPCRollSpecs::topology() const
00044 {
00045   return *(_top);
00046 }
00047 
00048 const StripTopology& 
00049 RPCRollSpecs::specificTopology() const
00050 {
00051   return *(_top);
00052 }
00053 
00054 
00055 const std::string&
00056 RPCRollSpecs::detName() const
00057 {
00058   return _n;
00059 }