Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:53

0001 #ifndef CSC_NONSLANTED_WIRE_GEOMETRY_H
0002 #define CSC_NONSLANTED_WIRE_GEOMETRY_H
0003 
0004 /** \class CSCNonslantedWireGeometry
0005  * A concrete CSCWireGeometry in which the wires are not slanted,
0006  * i.e. they are all parallel to the local x axis.
0007  *
0008  * \author Tim Cox
0009  *
0010  */
0011 
0012 #include "Geometry/CSCGeometry/interface/CSCWireGeometry.h"
0013 #include "Geometry/CSCGeometry/interface/nint.h"
0014 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0015 
0016 class CSCNonslantedWireGeometry : public CSCWireGeometry {
0017 public:
0018   ~CSCNonslantedWireGeometry() override {}
0019 
0020   /**
0021    * Constructor from wire spacing
0022    */
0023   CSCNonslantedWireGeometry(double wireSpacing, double yOfFirstWire, double narrow, double wide, double length)
0024       : CSCWireGeometry(wireSpacing, yOfFirstWire, narrow, wide, length) {}
0025 
0026   /**
0027    * The angle of the wires w.r.t local x axis (in radians)
0028    */
0029   float wireAngle() const override { return 0.; }
0030 
0031   /**
0032    * The nearest (virtual) wire to a given LocalPoint.
0033    * Beware that this wire might not exist or be read out!
0034    */
0035   int nearestWire(const LocalPoint& lp) const override { return 1 + nint((lp.y() - yOfFirstWire()) / wireSpacing()); }
0036 
0037   /**
0038    * Local y of a given wire 'number' (float) at given x
0039    * For nonslanted wires this y is independent of x.
0040    */
0041   float yOfWire(float wire, float x = 0.) const override { return yOfFirstWire() + (wire - 1.) * wireSpacing(); }
0042 
0043   /**
0044    * Clone to handle correct copy of component objects referenced
0045    * by base class pointer.
0046    */
0047   CSCWireGeometry* clone() const override { return new CSCNonslantedWireGeometry(*this); }
0048 };
0049 
0050 #endif