CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/Geometry/GEMGeometry/src/GEMEtaPartitionSpecs.cc

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