CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/Geometry/GEMGeometry/src/GEMEtaPartition.cc

Go to the documentation of this file.
00001 #include "Geometry/GEMGeometry/interface/GEMEtaPartition.h"
00002 #include "Geometry/GEMGeometry/interface/GEMEtaPartitionSpecs.h"
00003 #include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h"
00004 
00005 
00006 GEMEtaPartition::GEMEtaPartition(GEMDetId id, BoundPlane::BoundPlanePointer bp, GEMEtaPartitionSpecs* rrs) :
00007   GeomDetUnit(bp), id_(id),specs_(rrs)
00008 {
00009   setDetId(id);
00010 }
00011 
00012 GEMEtaPartition::~GEMEtaPartition()
00013 {
00014   delete specs_; //Assume the roll owns it specs (specs are not shared)
00015 }
00016 
00017 const Topology&
00018 GEMEtaPartition::topology() const
00019 {
00020   return specs_->topology();
00021 }
00022 
00023 const StripTopology&
00024 GEMEtaPartition::specificTopology() const
00025 {
00026   return specs_->specificTopology();
00027 }
00028 
00029 const Topology&
00030 GEMEtaPartition::padTopology() const
00031 {
00032   return specs_->padTopology();
00033 }
00034 
00035 const StripTopology&
00036 GEMEtaPartition::specificPadTopology() const
00037 {
00038   return specs_->specificPadTopology();
00039 }
00040 
00041 const GeomDetType& 
00042 GEMEtaPartition::type() const
00043 {
00044   return (*specs_);
00045 }
00046 
00047 int 
00048 GEMEtaPartition::nstrips() const
00049 {
00050   return this->specificTopology().nstrips();
00051 }
00052 
00053 LocalPoint
00054 GEMEtaPartition::centreOfStrip(int strip) const
00055 {
00056   float s = static_cast<float>(strip) - 0.5;
00057   return this->specificTopology().localPosition(s);
00058 }
00059 
00060 LocalPoint
00061 GEMEtaPartition::centreOfStrip(float strip) const
00062 {
00063   return this->specificTopology().localPosition(strip);
00064 }
00065 
00066 LocalError
00067 GEMEtaPartition::localError(float strip) const
00068 {
00069   return this->specificTopology().localError(strip, 1./sqrt(12.));
00070 }
00071 
00072 float
00073 GEMEtaPartition::strip(const LocalPoint& lp) const
00074 { 
00075   return this->specificTopology().strip(lp);
00076 }
00077 
00078 float
00079 GEMEtaPartition::localPitch(const LocalPoint& lp) const
00080 { 
00081   return this->specificTopology().localPitch(lp);
00082 }
00083 
00084 float
00085 GEMEtaPartition::pitch() const
00086 { 
00087   return this->specificTopology().pitch();
00088 }
00089 
00090 
00091 int 
00092 GEMEtaPartition::npads() const
00093 {
00094   return specificPadTopology().nstrips();
00095 }
00096 
00097 LocalPoint
00098 GEMEtaPartition::centreOfPad(int pad) const
00099 {
00100   float p = static_cast<float>(pad) - 0.5;
00101   return specificPadTopology().localPosition(p);
00102 }
00103 
00104 LocalPoint
00105 GEMEtaPartition::centreOfPad(float pad) const
00106 {
00107   return specificPadTopology().localPosition(pad);
00108 }
00109 
00110 float
00111 GEMEtaPartition::pad(const LocalPoint& lp) const
00112 { 
00113   return specificPadTopology().strip(lp);
00114 }
00115 
00116 float
00117 GEMEtaPartition::localPadPitch(const LocalPoint& lp) const
00118 { 
00119   return specificPadTopology().localPitch(lp);
00120 }
00121 
00122 float
00123 GEMEtaPartition::padPitch() const
00124 { 
00125   return specificPadTopology().pitch();
00126 }
00127 
00128 
00129 float
00130 GEMEtaPartition::padOfStrip(int strip) const
00131 {
00132   LocalPoint c_o_s = centreOfStrip(strip);
00133   return pad(c_o_s);
00134 }
00135 
00136 int
00137 GEMEtaPartition::firstStripInPad(int pad) const
00138 {
00139   float p = static_cast<float>(pad) - 0.9999;
00140   LocalPoint lp = specificPadTopology().localPosition(p);
00141   return static_cast<int>(strip(lp)) + 1;
00142 }
00143 
00144 int
00145 GEMEtaPartition::lastStripInPad(int pad) const
00146 {
00147   float p = static_cast<float>(pad) - 0.0001;
00148   LocalPoint lp = specificPadTopology().localPosition(p);
00149   return static_cast<int>(strip(lp)) + 1;
00150 }
00151