Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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