Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:07

0001 #include "Geometry/TrackerGeometryBuilder/interface/StripTopologyBuilder.h"
0002 #include "Geometry/CommonTopologies/interface/RectangularStripTopology.h"
0003 #include "Geometry/CommonTopologies/interface/TkRadialStripTopology.h"
0004 #include "DataFormats/GeometrySurface/interface/Bounds.h"
0005 #include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h"
0006 
0007 StripTopologyBuilder::StripTopologyBuilder(void) : theAPVNumb(0.0) {}
0008 
0009 StripTopology* StripTopologyBuilder::build(const Bounds* bs, double apvnumb, const std::string& part) {
0010   theAPVNumb = apvnumb;
0011 
0012   StripTopology* result = nullptr;
0013   if (part == "barrel") {
0014     result = constructBarrel(bs->length(), bs->width());
0015   } else {
0016     const TrapezoidalPlaneBounds* topo = dynamic_cast<const TrapezoidalPlaneBounds*>(bs);
0017     if (topo) {
0018       int yAx = topo->yAxisOrientation();
0019       result = constructForward(bs->length(), bs->width(), bs->widthAtHalfLength(), yAx);
0020     }
0021   }
0022   return result;
0023 }
0024 
0025 StripTopology* StripTopologyBuilder::constructBarrel(float length, float width) {
0026   int nstrip = int(128 * theAPVNumb);
0027   float pitch = width / nstrip;
0028 
0029   return new RectangularStripTopology(nstrip, pitch, length);
0030 }
0031 
0032 StripTopology* StripTopologyBuilder::constructForward(float length, float width, float widthAtHalf, int yAxOr) {
0033   int nstrip = int(128 * theAPVNumb);
0034   float rCross = widthAtHalf * length / (2 * (width - widthAtHalf));
0035   float aw = atan2(widthAtHalf / 2., static_cast<double>(rCross)) / (nstrip / 2);
0036   return new TkRadialStripTopology(nstrip, aw, length, rCross, yAxOr);
0037 }