13 #include "CLHEP/Units/GlobalSystemOfUnits.h"
24 int nstrips,
float stripOffset,
float stripPhiPitch,
25 float whereStripsMeet,
float extentOfStripPlane,
float yCentreOfStripPlane,
26 const CSCWireGroupPackage& wg,
float wireAngleInDegrees,
double yOfFirstWire,
float hThickness )
28 theWireTopology( 0 ), theStripTopology( 0 ),
29 hBottomEdge( bounds.widthAtHalfLength() - bounds.
width()/2. ),
30 hTopEdge( bounds.
width()/2. ), apothem( bounds.length()/2. ),
31 myName(
"CSCLayerGeometry" ), chamberType( iChamberType ) {
33 LogTrace(
"CSCLayerGeometry|CSC") <<
myName <<
": being constructed, this=" <<
this;
36 bool gangedME1A = ( iChamberType == 1 && geom->
gangedStrips() );
40 extentOfStripPlane, whereStripsMeet, stripOffset, yCentreOfStripPlane );
44 delete aStripTopology;
52 float wangler = wireAngleInDegrees*degree;
53 float wireCos =
cos(wangler);
54 float wireSin =
sin(wangler);
57 float wireOffset = -y2 + wireSpacing/2.;
58 yOfFirstWire = wireOffset/wireCos;
62 LogTrace(
"CSCLayerGeometry|CSC") <<
myName <<
": constructed: "<< *
this;
67 0.5 * melg.thickness() ),
68 theWireTopology(0), theStripTopology(0),
69 hBottomEdge(melg.hBottomEdge), hTopEdge(melg.hTopEdge),
70 apothem(melg.apothem), chamberType(melg.chamberType)
80 if ( &melg !=
this ) {
102 LogTrace(
"CSCLayerGeometry|CSC") <<
myName <<
": being destroyed, this=" <<
this <<
127 float xi = ( ms * xs +
yOfWire(wire) ) / ( ms - mw );
128 float yi = ms * (xi - xs );
192 (sw1.
y()-sw2.
y())*(sw1.
y()-sw2.
y()) );
194 return std::pair<LocalPoint,float>( midpt,
length );
222 float c1 = p1.second;
224 float c2 = p2.second;
225 float x = (c2-
c1)/(m1-m2);
226 float y = (m1*c2-m2*
c1)/(m1-m2);
239 float sinAngdif =
sin(strangle-wangle);
240 float sinAngdif2 = sinAngdif * sinAngdif;
242 float du = sigmaStrip/
sin(strangle);
243 float dv = sigmaWire;
251 float wsins = dv *
sin(strangle);
252 float wcoss = dv *
cos(strangle);
253 float ssinw = du *
sin(wangle);
254 float scosw = du *
cos(wangle);
256 float dx2 = (scosw*scosw + wcoss*wcoss)/sinAngdif2;
257 float dy2 = (ssinw*ssinw + wsins*wsins)/sinAngdif2;
258 float dxy = (scosw*ssinw + wcoss*wsins)/sinAngdif2;
268 if ( (lp.
y() > ylims.first) && (lp.
y() < ylims.second) ) {
289 float deltaX = scale*
sqrt(le.
xx());
290 float deltaY = scale*
sqrt(le.
yy());
306 stream <<
"LayerGeometry " << std::endl
307 <<
"------------- " << std::endl
311 <<
"wireAngle (rad) " << lg.
wireAngle() << std::endl
315 <<
"wirePitch " << lg.
wirePitch() << std::endl
316 <<
"stripPitch " << lg.
stripPitch() << std::endl
322 <<
"hTopEdge " << lg.
hTopEdge << std::endl
323 <<
"apothem " << lg.
apothem << std::endl
324 <<
"length (should be 2xapothem) " << lg.
length() << std::endl
325 <<
"thickness " << lg.
thickness() << std::endl;
LocalPoint stripWireGroupIntersection(int strip, int wireGroup) const
std::pair< LocalPoint, float > possibleRecHitPosition(float s, int w1, int w2) const
std::pair< float, float > equationOfWire(float wire) const
common ppss p3p6s2 common epss epspn46 common const1 w2
float lengthOfWireGroup(int wireGroup) const
Sin< T >::type sin(const T &t)
int numberOfStrips() const
CSCStripTopology * theStripTopology
std::pair< float, float > yLimitsOfStripPlane() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
int numberOfWireGroups() const
CSCLayerGeometry(const CSCGeometry *geom, int iChamberType, const TrapezoidalPlaneBounds &bounds, int nstrips, float stripOffset, float stripPhiPitch, float whereStripsMeet, float extentOfStripPlane, float yCentreOfStripPlane, const CSCWireGroupPackage &wg, float wireAngleInDegrees, double yOfFirstWire, float hThickness)
float yOfWireGroup(int wireGroup, float x=0.) const
LocalError localError(int strip, float sigmaStrip, float sigmaWire) const
LocalPoint intersectionOfTwoLines(std::pair< float, float > p1, std::pair< float, float > p2) const
float xOfStrip(int strip, float y=0.) const
bool insideYOfWirePlane(float y) const
virtual float thickness() const
LocalPoint intersectionOfStripAndWire(float s, int w) const
virtual CSCStripTopology * clone() const =0
bool realWireGeometry() const
float yOfWire(float wire, float x=0.) const
float middleWireOfGroup(int wireGroup) const
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
int numberOfWires() const
virtual ~CSCLayerGeometry()
CSCWireTopology * theWireTopology
std::vector< float > wireValues(float wire) const
bool gangedStrips() const
LocalPoint localCenterOfWireGroup(int wireGroup) const
std::pair< float, float > equationOfStrip(float strip) const
LocalPoint stripWireIntersection(int strip, float wire) const
float restrictToYOfWirePlane(float y) const
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const
CSCLayerGeometry & operator=(const CSCLayerGeometry &)
virtual float length() const
float stripAngle(float strip) const
float stripAngle(int strip) const
void setTopology(CSCStripTopology *topology)
virtual float strip(const LocalPoint &) const