Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:08:10

0001 #include "Geometry/GEMGeometry/interface/ME0EtaPartition.h"
0002 #include "Geometry/GEMGeometry/interface/ME0EtaPartitionSpecs.h"
0003 #include "Geometry/CommonTopologies/interface/TrapezoidalStripTopology.h"
0004 
0005 ME0EtaPartition::ME0EtaPartition(ME0DetId id, const BoundPlane::BoundPlanePointer& bp, ME0EtaPartitionSpecs* rrs)
0006     : GeomDet(bp), id_(id), specs_(rrs) {
0007   setDetId(id);
0008 }
0009 
0010 ME0EtaPartition::~ME0EtaPartition() {
0011   delete specs_;  //Assume the roll owns it specs (specs are not shared)
0012 }
0013 
0014 const Topology& ME0EtaPartition::topology() const { return specs_->topology(); }
0015 
0016 const StripTopology& ME0EtaPartition::specificTopology() const { return specs_->specificTopology(); }
0017 
0018 const Topology& ME0EtaPartition::padTopology() const { return specs_->padTopology(); }
0019 
0020 const StripTopology& ME0EtaPartition::specificPadTopology() const { return specs_->specificPadTopology(); }
0021 
0022 const GeomDetType& ME0EtaPartition::type() const { return (*specs_); }
0023 
0024 int ME0EtaPartition::nstrips() const { return this->specificTopology().nstrips(); }
0025 
0026 LocalPoint ME0EtaPartition::centreOfStrip(int strip) const {
0027   float s = static_cast<float>(strip) - 0.5;
0028   return this->specificTopology().localPosition(s);
0029 }
0030 
0031 LocalPoint ME0EtaPartition::centreOfStrip(float strip) const { return this->specificTopology().localPosition(strip); }
0032 
0033 LocalError ME0EtaPartition::localError(float strip, float cluster_size) const {
0034   return this->specificTopology().localError(strip, cluster_size * cluster_size / sqrt(12.));
0035 }
0036 
0037 float ME0EtaPartition::strip(const LocalPoint& lp) const { return this->specificTopology().strip(lp); }
0038 
0039 float ME0EtaPartition::localPitch(const LocalPoint& lp) const { return this->specificTopology().localPitch(lp); }
0040 
0041 float ME0EtaPartition::pitch() const { return this->specificTopology().pitch(); }
0042 
0043 int ME0EtaPartition::npads() const { return specificPadTopology().nstrips(); }
0044 
0045 LocalPoint ME0EtaPartition::centreOfPad(int pad) const {
0046   float p = static_cast<float>(pad) - 0.5;
0047   return specificPadTopology().localPosition(p);
0048 }
0049 
0050 LocalPoint ME0EtaPartition::centreOfPad(float pad) const { return specificPadTopology().localPosition(pad); }
0051 
0052 float ME0EtaPartition::pad(const LocalPoint& lp) const { return specificPadTopology().strip(lp); }
0053 
0054 float ME0EtaPartition::localPadPitch(const LocalPoint& lp) const { return specificPadTopology().localPitch(lp); }
0055 
0056 float ME0EtaPartition::padPitch() const { return specificPadTopology().pitch(); }
0057 
0058 float ME0EtaPartition::padOfStrip(int strip) const {
0059   LocalPoint c_o_s = centreOfStrip(strip);
0060   return pad(c_o_s);
0061 }
0062 
0063 int ME0EtaPartition::firstStripInPad(int pad) const {
0064   float p = static_cast<float>(pad) - 0.9999;
0065   LocalPoint lp = specificPadTopology().localPosition(p);
0066   return static_cast<int>(strip(lp)) + 1;
0067 }
0068 
0069 int ME0EtaPartition::lastStripInPad(int pad) const {
0070   float p = static_cast<float>(pad) - 0.0001;
0071   LocalPoint lp = specificPadTopology().localPosition(p);
0072   return static_cast<int>(strip(lp)) + 1;
0073 }