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 );
221 float c1 = p1.second;
223 float c2 = p2.second;
224 float x = (c2-
c1)/(m1-m2);
225 float y = (m1*c2-m2*
c1)/(m1-m2);
238 float sinAngdif =
sin(strangle-wangle);
239 float sinAngdif2 = sinAngdif * sinAngdif;
241 float du = sigmaStrip/
sin(strangle);
242 float dv = sigmaWire;
250 float wsins = dv *
sin(strangle);
251 float wcoss = dv *
cos(strangle);
252 float ssinw = du *
sin(wangle);
253 float scosw = du *
cos(wangle);
255 float dx2 = (scosw*scosw + wcoss*wcoss)/sinAngdif2;
256 float dy2 = (ssinw*ssinw + wsins*wsins)/sinAngdif2;
257 float dxy = (scosw*ssinw + wcoss*wsins)/sinAngdif2;
267 if ( (lp.
y() > ylims.first) && (lp.
y() < ylims.second) ) {
288 float deltaX = scale*
sqrt(le.
xx());
289 float deltaY = scale*
sqrt(le.
yy());
305 stream <<
"LayerGeometry " << std::endl
306 <<
"------------- " << std::endl
310 <<
"wireAngle (rad) " << lg.
wireAngle() << std::endl
314 <<
"wirePitch " << lg.
wirePitch() << std::endl
315 <<
"stripPitch " << lg.
stripPitch() << std::endl
321 <<
"hTopEdge " << lg.
hTopEdge << std::endl
322 <<
"apothem " << lg.
apothem << std::endl
323 <<
"length (should be 2xapothem) " << lg.
length() << std::endl
324 <<
"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