CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Friends
CSCLayerGeometry Class Reference

#include <CSCLayerGeometry.h>

Inheritance diagram for CSCLayerGeometry:
TrapezoidalPlaneBounds Bounds

Public Member Functions

int channel (int strip) const
 
virtual Boundsclone () 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)
 
 CSCLayerGeometry (const CSCLayerGeometry &)
 
bool inside (const Local3DPoint &, const LocalError &, float scale=1.f) const
 
bool inside (const Local3DPoint &) const
 Determine if the point is inside the bounds. More...
 
bool inside (const Local2DPoint &) const
 
LocalPoint intersectionOfStripAndWire (float s, int w) const
 
LocalPoint intersectionOfTwoLines (std::pair< float, float > p1, std::pair< float, float > p2) const
 
float lengthOfWireGroup (int wireGroup) const
 
LocalPoint localCenterOfWireGroup (int wireGroup) const
 
LocalError localError (int strip, float sigmaStrip, float sigmaWire) const
 
float middleWireOfGroup (int wireGroup) const
 
int nearestStrip (const LocalPoint &lp) const
 
int nearestWire (const LocalPoint &lp) const
 
int numberOfStrips () const
 
int numberOfWireGroups () const
 
int numberOfWires () const
 
int numberOfWiresPerGroup (int wireGroup) const
 
CSCLayerGeometryoperator= (const CSCLayerGeometry &)
 
std::pair< LocalPoint, float > possibleRecHitPosition (float s, int w1, int w2) const
 
void setTopology (CSCStripTopology *topology)
 
int stagger () const
 
float strip (const LocalPoint &lp) const
 
float stripAngle (int strip) const
 
float stripOffset (void) const
 
float stripPhiPitch () const
 
float stripPitch () const
 
float stripPitch (const LocalPoint &lp) const
 
LocalPoint stripWireGroupIntersection (int strip, int wireGroup) const
 
LocalPoint stripWireIntersection (int strip, float wire) const
 
const CSCStripTopologytopology () const
 
float wireAngle () const
 
int wireGroup (int wire) const
 
float wirePitch () const
 
const CSCWireTopologywireTopology () const
 
float xOfStrip (int strip, float y=0.) const
 
std::pair< float, float > yLimitsOfStripPlane () const
 
float yOfWire (float wire, float x=0.) const
 
float yOfWireGroup (int wireGroup, float x=0.) const
 
float yResolution (int wireGroup=1) const
 
virtual ~CSCLayerGeometry ()
 
- Public Member Functions inherited from TrapezoidalPlaneBounds
virtual bool inside (const Local2DPoint &p, const LocalError &err, float scale) const
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
virtual float length () const
 
virtual const std::array
< const float, 4 > 
parameters () const
 
virtual float thickness () const
 
 TrapezoidalPlaneBounds (float be, float te, float a, float t)
 
virtual float width () const
 
virtual float widthAtHalfLength () const
 
virtual int yAxisOrientation () const
 
- Public Member Functions inherited from Bounds
void computeSpan (Surface const &plane)
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
std::pair< float, float > const & phiSpan () const
 
std::pair< float, float > const & rSpan () const
 
std::pair< float, float > const & zSpan () const
 
virtual ~Bounds ()
 

Private Attributes

float apothem
 
int chamberType
 
float hBottomEdge
 
float hTopEdge
 
const std::string myName
 
CSCStripTopologytheStripTopology
 
CSCWireTopologytheWireTopology
 

Friends

std::ostream & operator<< (std::ostream &, const CSCLayerGeometry &)
 

Detailed Description

Encapsulates the geometrical details of a CSCLayer in a WireTopology for the wires and in a StripTopology for the strips. Note that it does not have the capability of calculating global values, so all values are in local coordinates.

Author
Tim Cox

Definition at line 25 of file CSCLayerGeometry.h.

Constructor & Destructor Documentation

CSCLayerGeometry::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 
)

Ctor from basic trapezoidal Chamber parameters.

Parameters
geomThe pointer to the actual CSCGeometry we're building.
iChamberTypeThe index 1-9 for station/ring combination.
TrapezoidalPlaneBoundsdescribing geometry of face.
nstripsNo. of strips in cathode plane of a Layer.
stripOffsetAlternate strip planes are relatively shifted by +/-0.25 strip widths.
stripPhiPitchDelta-phi width of strips (they're fan-shaped) in radians
whereStripsMeetradial distance from projected intersection of strips to centre of strip plane
extentOfStripPlaneheight of strip plane (along its long symmetry axis)
yCentreOfStripPlanelocal y of symmetry centre of strip plane (before any offset rotation)
wgCSCWireGroupPackage encapsulating wire group info.
wireAngleInDegreesangle of wires w.r.t local x axis.
yOfFirstWirelocal y coordinate of first (lowest) wire in wire plane - nearest narrow edge.
hThicknesshalf-thickness of chamber layer in cm (i.e. half the gas gap).

Definition at line 22 of file CSCLayerGeometry.cc.

References apothem, funct::cos(), CSCGeometry::gangedStrips(), hBottomEdge, LogTrace, myName, CSCGeometry::realWireGeometry(), funct::sin(), theStripTopology, theWireTopology, and CSCWireGroupPackage::wireSpacing.

Referenced by clone().

27  : TrapezoidalPlaneBounds( bounds.widthAtHalfLength() - bounds.width()/2., bounds.width()/2., bounds.length()/2., hThickness ),
29  hBottomEdge( bounds.widthAtHalfLength() - bounds.width()/2. ),
30  hTopEdge( bounds.width()/2. ), apothem( bounds.length()/2. ),
31  myName( "CSCLayerGeometry" ), chamberType( iChamberType ) {
32 
33  LogTrace("CSCLayerGeometry|CSC") << myName <<": being constructed, this=" << this;
34 
35  // Ganged strips in ME1A?
36  bool gangedME1A = ( iChamberType == 1 && geom->gangedStrips() );
37 
38  CSCStripTopology* aStripTopology =
40  extentOfStripPlane, whereStripsMeet, stripOffset, yCentreOfStripPlane );
41 
42  if ( gangedME1A ) {
43  theStripTopology = new CSCGangedStripTopology( *aStripTopology, 16 );
44  delete aStripTopology;
45  }
46  else {
47  theStripTopology = aStripTopology;
48  }
49 
50  if ( ! geom->realWireGeometry() ) {
51  // Approximate ORCA_8_8_0 and earlier calculated geometry...
52  float wangler = wireAngleInDegrees*degree; // convert angle to radians
53  float wireCos = cos(wangler);
54  float wireSin = sin(wangler);
55  float y2 = apothem * wireCos + hBottomEdge * fabs(wireSin);
56  float wireSpacing = wg.wireSpacing/10.; // in cm
57  float wireOffset = -y2 + wireSpacing/2.;
58  yOfFirstWire = wireOffset/wireCos;
59  }
60 
61  theWireTopology = new CSCWireTopology( wg, yOfFirstWire, wireAngleInDegrees );
62  LogTrace("CSCLayerGeometry|CSC") << myName <<": constructed: "<< *this;
63 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
TrapezoidalPlaneBounds(float be, float te, float a, float t)
float stripOffset(void) const
CSCStripTopology * theStripTopology
bool realWireGeometry() const
Definition: CSCGeometry.h:124
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CSCWireTopology * theWireTopology
#define LogTrace(id)
const std::string myName
bool gangedStrips() const
Definition: CSCGeometry.h:110
virtual float widthAtHalfLength() const
float stripPhiPitch() const
virtual float length() const
virtual float width() const
CSCLayerGeometry::CSCLayerGeometry ( const CSCLayerGeometry melg)

Definition at line 65 of file CSCLayerGeometry.cc.

References CSCStripTopology::clone(), theStripTopology, and theWireTopology.

65  :
67  0.5 * melg.thickness() ),
71 {
72  // CSCStripTopology is abstract, so need clone()
74  // CSCWireTopology is concrete, so direct copy
76 }
TrapezoidalPlaneBounds(float be, float te, float a, float t)
CSCStripTopology * theStripTopology
virtual float thickness() const
virtual CSCStripTopology * clone() const =0
CSCWireTopology * theWireTopology
CSCLayerGeometry::~CSCLayerGeometry ( )
virtual

Definition at line 100 of file CSCLayerGeometry.cc.

References LogTrace, myName, theStripTopology, and theWireTopology.

101 {
102  LogTrace("CSCLayerGeometry|CSC") << myName << ": being destroyed, this=" << this <<
103  "\nDeleting theStripTopology=" << theStripTopology <<
104  " and theWireTopology=" << theWireTopology;
105  delete theStripTopology;
106  delete theWireTopology;
107 }
CSCStripTopology * theStripTopology
CSCWireTopology * theWireTopology
#define LogTrace(id)
const std::string myName

Member Function Documentation

int CSCLayerGeometry::channel ( int  strip) const
inline

Electronics channel corresponding to a given strip ...sometimes there will be more than one strip OR'ed into a channel

Definition at line 115 of file CSCLayerGeometry.h.

References OffsetRadialStripTopology::channel(), and theStripTopology.

Referenced by MuonTruth::analyze(), MuonTruth::associateCSCHitId(), MuonTruth::associateHitId(), and CSCStripElectronicsSim::readoutElement().

115  {
116  return theStripTopology->channel(strip);
117  }
CSCStripTopology * theStripTopology
float strip(const LocalPoint &lp) const
virtual int channel(int strip) const =0
virtual Bounds* CSCLayerGeometry::clone ( void  ) const
inlinevirtual

Utility method to handle proper copying of the class

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 306 of file CSCLayerGeometry.h.

References CSCLayerGeometry().

306  {
307  return new CSCLayerGeometry(*this);
308  }
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)
bool CSCLayerGeometry::inside ( const Local3DPoint lp,
const LocalError le,
float  scale = 1.f 
) const
virtual

Is a supplied LocalPoint inside the strip region?

This is a more reliable fiducial cut for CSCs than the 'Bounds' of the GeomDet(Unit) since those ranges are looser than the sensitive gas region. There are three versions, to parallel those of the TrapezoidalPlaneBounds which a naive user might otherwise employ.

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 283 of file CSCLayerGeometry.cc.

References mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by CSCWireHitSim::getIonizationClusters(), CSCMake2DRecHit::hitFromStripAndWire(), inside(), CSCMake2DRecHit::isHitInFiducial(), and MuonSimHitProducer::produce().

283  {
284  // Effectively consider that the LocalError components extend the area which is acceptable.
285  // Form a little box centered on the point, with x, y diameters defined by the errors
286  // and require that ALL four corners of the box fall outside the strip region for failure
287 
288  // Note that LocalError is 2-dim x,y and doesn't supply a z error
289  float deltaX = scale*sqrt(le.xx());
290  float deltaY = scale*sqrt(le.yy());
291 
292  LocalPoint lp1( lp.x()-deltaX, lp.y()-deltaY, lp.z() );
293  LocalPoint lp2( lp.x()-deltaX, lp.y()+deltaY, lp.z() );
294  LocalPoint lp3( lp.x()+deltaX, lp.y()+deltaY, lp.z() );
295  LocalPoint lp4( lp.x()+deltaX, lp.y()-deltaY, lp.z() );
296 
297  return ( inside(lp1) || inside(lp2) || inside(lp3) || inside(lp4) );
298 }
float xx() const
Definition: LocalError.h:24
T y() const
Definition: PV3DBase.h:63
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const
T x() const
Definition: PV3DBase.h:62
bool CSCLayerGeometry::inside ( const Local3DPoint ) const
virtual

Determine if the point is inside the bounds.

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 263 of file CSCLayerGeometry.cc.

References epsilon, numberOfStrips(), query::result, OffsetRadialStripTopology::strip(), theStripTopology, TrapezoidalPlaneBounds::thickness(), PV3DBase< T, PVType, FrameType >::y(), yLimitsOfStripPlane(), and PV3DBase< T, PVType, FrameType >::z().

263  {
264  bool result = false;
265  const float epsilon = 1.e-06;
266  if ( fabs( lp.z() ) < thickness()/2. ) { // thickness of TPB is that of gas layer
267  std::pair<float, float> ylims = yLimitsOfStripPlane();
268  if ( (lp.y() > ylims.first) && (lp.y() < ylims.second) ) {
269  // 'strip' returns float value between 0. and float(Nstrips) and value outside
270  // is set to 0. or float(Nstrips)... add a conservative precision of 'epsilon'
271  if ( ( theStripTopology->strip(lp) > epsilon ) &&
272  ( theStripTopology->strip(lp) < (numberOfStrips() - epsilon) ) ) result = true;
273  }
274  }
275  return result;
276 }
int numberOfStrips() const
CSCStripTopology * theStripTopology
std::pair< float, float > yLimitsOfStripPlane() const
virtual float thickness() const
tuple result
Definition: query.py:137
const double epsilon
virtual float strip(const LocalPoint &) const
bool CSCLayerGeometry::inside ( const Local2DPoint lp) const
virtual

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 278 of file CSCLayerGeometry.cc.

References inside(), PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

278  {
279  LocalPoint lp2( lp.x(), lp.y(), 0. );
280  return inside( lp2 );
281 }
T y() const
Definition: PV2DBase.h:46
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const
T x() const
Definition: PV2DBase.h:45
LocalPoint CSCLayerGeometry::intersectionOfStripAndWire ( float  s,
int  w 
) const

Return 2-dim point at which a strip and a wire intersects.

Input arguments: a (float) strip number, and an (int) wire.
Output: LocalPoint which is at their intersection, or at extreme y of wire plane, as appropriate. (If y is adjusted, x is also adjusted to keep it on same strip.)

Definition at line 197 of file CSCLayerGeometry.cc.

References CSCStripTopology::equationOfStrip(), CSCWireTopology::equationOfWire(), CSCWireTopology::insideYOfWirePlane(), intersectionOfTwoLines(), CSCWireTopology::restrictToYOfWirePlane(), OffsetRadialStripTopology::stripAngle(), funct::tan(), theStripTopology, theWireTopology, x, PV3DBase< T, PVType, FrameType >::x(), detailsBasic3DVector::y, and PV3DBase< T, PVType, FrameType >::y().

Referenced by possibleRecHitPosition().

197  {
198 
199  std::pair<float, float> pw = theWireTopology->equationOfWire( static_cast<float>(w) );
200  std::pair<float, float> ps = theStripTopology->equationOfStrip( s );
201  LocalPoint sw = intersectionOfTwoLines( ps, pw );
202 
203  // If point falls outside wire plane, at extremes in local y,
204  // replace its y by that of appropriate edge of wire plane
205  if ( !(theWireTopology->insideYOfWirePlane( sw.y() ) ) ) {
206  float y = theWireTopology->restrictToYOfWirePlane( sw.y() );
207  // and adjust x to match new y
208  float x = sw.x() + (y - sw.y())*tan(theStripTopology->stripAngle(s));
209  sw = LocalPoint(x, y);
210  }
211 
212  return sw;
213 }
std::pair< float, float > equationOfWire(float wire) const
T y() const
Definition: PV3DBase.h:63
CSCStripTopology * theStripTopology
LocalPoint intersectionOfTwoLines(std::pair< float, float > p1, std::pair< float, float > p2) const
bool insideYOfWirePlane(float y) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
CSCWireTopology * theWireTopology
std::pair< float, float > equationOfStrip(float strip) const
float restrictToYOfWirePlane(float y) const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
T w() const
Definition: DDAxes.h:10
float stripAngle(float strip) const
T x() const
Definition: PV3DBase.h:62
LocalPoint CSCLayerGeometry::intersectionOfTwoLines ( std::pair< float, float >  p1,
std::pair< float, float >  p2 
) const

Return the point of intersection of two straight lines (in 2-dim).

Input arguments are pair(m1,c1) and pair(m2,c2) where m=slope, c=intercept (y=mx+c).
BEWARE! Do not call with m1 = m2 ! No trapping !

Definition at line 215 of file CSCLayerGeometry.cc.

References alignmentValidation::c1, x, and detailsBasic3DVector::y.

Referenced by intersectionOfStripAndWire().

215  {
216 
217  // Calculate the point of intersection of two straight lines (in 2-dim)
218  // input arguments are pair(m1,c1) and pair(m2,c2) where m=slope, c=intercept (y=mx+c)
219  // BEWARE! Do not call with m1 = m2 ! No trapping !
220 
221  float m1 = p1.first;
222  float c1 = p1.second;
223  float m2 = p2.first;
224  float c2 = p2.second;
225  float x = (c2-c1)/(m1-m2);
226  float y = (m1*c2-m2*c1)/(m1-m2);
227  return LocalPoint( x, y );
228 }
double p2[4]
Definition: TauolaWrapper.h:90
double p1[4]
Definition: TauolaWrapper.h:89
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
Definition: DDAxes.h:10
float CSCLayerGeometry::lengthOfWireGroup ( int  wireGroup) const

Length of a wire group (center wire, across chamber face)

Definition at line 175 of file CSCLayerGeometry.cc.

References middleWireOfGroup(), theWireTopology, w(), and CSCWireTopology::wireValues().

175  {
176  // Return length of 'wire' in the middle of the wire group
177  float w = middleWireOfGroup( wireGroup );
178  std::vector<float> store = theWireTopology->wireValues( w );
179  return store[2];
180 }
int wireGroup(int wire) const
float middleWireOfGroup(int wireGroup) const
CSCWireTopology * theWireTopology
std::vector< float > wireValues(float wire) const
T w() const
LocalPoint CSCLayerGeometry::localCenterOfWireGroup ( int  wireGroup) const

Local coordinates of center of a wire group. Used to be centerOfWireGroup in ORCA but that version now returns GlobalPoint.

Definition at line 157 of file CSCLayerGeometry.cc.

References middleWireOfGroup(), theWireTopology, w(), wireAngle(), CSCWireTopology::wireValues(), detailsBasic3DVector::y, and yOfWireGroup().

Referenced by ValidateGeometry::validateCSCLayerGeometry().

157  {
158 
159  // It can use CSCWireTopology::yOfWireGroup for y,
160  // But x requires mixing with 'extent' of wire plane
161 
162  // If the wires are NOT tilted, default to simple calculation...
163  if ( fabs(wireAngle() ) < 1.E-6 ) {
164  float y = yOfWireGroup( wireGroup );
165  return LocalPoint( 0., y );
166  }
167  else {
168  // w is "wire" at the center of the wire group
169  float w = middleWireOfGroup( wireGroup );
170  std::vector<float> store = theWireTopology->wireValues( w );
171  return LocalPoint( store[0], store[1] );
172  }
173 }
float yOfWireGroup(int wireGroup, float x=0.) const
float wireAngle() const
int wireGroup(int wire) const
float middleWireOfGroup(int wireGroup) const
CSCWireTopology * theWireTopology
std::vector< float > wireValues(float wire) const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
T w() const
LocalError CSCLayerGeometry::localError ( int  strip,
float  sigmaStrip,
float  sigmaWire 
) const

Transform strip and wire errors to local x, y frame. Need to supply (central) strip of the hit. The sigma's are in distance units.

Definition at line 231 of file CSCLayerGeometry.cc.

References funct::cos(), funct::sin(), stripAngle(), and wireAngle().

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

231  {
232  // Input sigmas are expected to be in _distance units_
233  // - uncertainty in strip measurement (typically from Gatti fit, value is in local x units)
234  // - uncertainty in wire measurement (along direction perpendicular to wires)
235 
236  float wangle = this->wireAngle();
237  float strangle = this->stripAngle( strip );
238 
239  float sinAngdif = sin(strangle-wangle);
240  float sinAngdif2 = sinAngdif * sinAngdif;
241 
242  float du = sigmaStrip/sin(strangle); // sigmaStrip is just x-component of strip error
243  float dv = sigmaWire;
244 
245  // The notation is
246  // wsins = wire resol * sin(strip angle)
247  // wcoss = wire resol * cos(strip angle)
248  // ssinw = strip resol * sin(wire angle)
249  // scosw = strip resol * cos(wire angle)
250 
251  float wsins = dv * sin(strangle);
252  float wcoss = dv * cos(strangle);
253  float ssinw = du * sin(wangle);
254  float scosw = du * cos(wangle);
255 
256  float dx2 = (scosw*scosw + wcoss*wcoss)/sinAngdif2;
257  float dy2 = (ssinw*ssinw + wsins*wsins)/sinAngdif2;
258  float dxy = (scosw*ssinw + wcoss*wsins)/sinAngdif2;
259 
260  return LocalError(dx2, dxy, dy2);
261 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float wireAngle() const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float strip(const LocalPoint &lp) const
float stripAngle(int strip) const
float CSCLayerGeometry::middleWireOfGroup ( int  wireGroup) const
inline

Middle of wire-group. This is the central wire no. for a group with an odd no. of wires. This is a pseudo-wire no. for a group with an even no. of wires. Accordingly, it is non-integer.

Definition at line 201 of file CSCLayerGeometry.h.

References CSCWireTopology::middleWireOfGroup(), and theWireTopology.

Referenced by CSCMake2DRecHit::hitFromStripAndWire(), lengthOfWireGroup(), localCenterOfWireGroup(), and stripWireGroupIntersection().

201  {
int wireGroup(int wire) const
CSCWireTopology * theWireTopology
float middleWireOfGroup(int wireGroup) const
int CSCLayerGeometry::nearestStrip ( const LocalPoint lp) const
inline

Strip nearest a given local point

Definition at line 94 of file CSCLayerGeometry.h.

References CSCRadialStripTopology::nearestStrip(), and theStripTopology.

Referenced by MuonCSCChamberResidual::addResidual(), CSCPairResidualsConstraint::calculatePhi(), CSCEfficiency::recHitSegment_Efficiencies(), and CSCStripHitSim::simulate().

94  {
95  return theStripTopology->nearestStrip(lp);
96  }
CSCStripTopology * theStripTopology
virtual int nearestStrip(const LocalPoint &) const
int CSCLayerGeometry::nearestWire ( const LocalPoint lp) const
inline

Wire nearest a given local point

Definition at line 101 of file CSCLayerGeometry.h.

References CSCWireTopology::nearestWire(), and theWireTopology.

Referenced by CSCWireHitSim::simulate().

101  {
102  return theWireTopology->nearestWire( lp ); }
int nearestWire(const LocalPoint &lp) const
CSCWireTopology * theWireTopology
int CSCLayerGeometry::numberOfStrips ( ) const
inline
int CSCLayerGeometry::numberOfWireGroups ( ) const
inline
int CSCLayerGeometry::numberOfWires ( ) const
inline

How many wires in layer

Definition at line 66 of file CSCLayerGeometry.h.

References CSCWireTopology::numberOfWires(), and theWireTopology.

Referenced by operator<<().

66  {
67  return theWireTopology->numberOfWires(); }
int numberOfWires() const
CSCWireTopology * theWireTopology
int CSCLayerGeometry::numberOfWiresPerGroup ( int  wireGroup) const
inline

How many wires in a wiregroup

Definition at line 78 of file CSCLayerGeometry.h.

References CSCWireTopology::numberOfWiresPerGroup(), and theWireTopology.

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

78  {
int numberOfWiresPerGroup(int wireGroup) const
int wireGroup(int wire) const
CSCWireTopology * theWireTopology
CSCLayerGeometry & CSCLayerGeometry::operator= ( const CSCLayerGeometry melg)

Definition at line 78 of file CSCLayerGeometry.cc.

References apothem, CSCStripTopology::clone(), hBottomEdge, hTopEdge, theStripTopology, and theWireTopology.

79 {
80  if ( &melg != this ) {
81  delete theStripTopology;
82  if ( melg.theStripTopology )
84  else
86 
87  delete theWireTopology;
88  if ( melg.theWireTopology )
90  else
92 
93  hBottomEdge = melg.hBottomEdge;
94  hTopEdge = melg.hTopEdge;
95  apothem = melg.apothem;
96  }
97  return *this;
98 }
CSCStripTopology * theStripTopology
virtual CSCStripTopology * clone() const =0
CSCWireTopology * theWireTopology
std::pair< LocalPoint, float > CSCLayerGeometry::possibleRecHitPosition ( float  s,
int  w1,
int  w2 
) const

Return estimate of the 2-dim point of intersection of a strip and a cluster of wires.

Input arguments: a (float) strip number, and the wires which delimit a cluster of wires. The wires are expected to be real wire numbers, and not wire-group numbers.

Returned: pair, with members:
first: LocalPoint which is midway along "the" strip between the wire limits,
or the chamber edges, as appropriate. <bf> second: length of the strip between the wires (or edges as appropriate).

Definition at line 182 of file CSCLayerGeometry.cc.

References intersectionOfStripAndWire(), TrapezoidalPlaneBounds::length(), mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

182  {
183 
186 
187  // Average the two points
188  LocalPoint midpt( (sw1.x()+sw2.x())/2., (sw1.y()+sw2.y())/2 );
189 
190  // Length of strip crossing this group of wires
191  float length = sqrt( (sw1.x()-sw2.x())*(sw1.x()-sw2.x()) +
192  (sw1.y()-sw2.y())*(sw1.y()-sw2.y()) );
193 
194  return std::pair<LocalPoint,float>( midpt, length );
195 }
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
T y() const
Definition: PV3DBase.h:63
LocalPoint intersectionOfStripAndWire(float s, int w) const
T sqrt(T t)
Definition: SSEVec.h:48
virtual float length() const
T x() const
Definition: PV3DBase.h:62
void CSCLayerGeometry::setTopology ( CSCStripTopology topology)

This class takes ownership of the pointer, and will destroy it

Definition at line 300 of file CSCLayerGeometry.cc.

References theStripTopology.

300  {
301  delete theStripTopology;
302  theStripTopology = newTopology;
303 }
CSCStripTopology * theStripTopology
int CSCLayerGeometry::stagger ( ) const
inline

Return +1 or -1 for a stripOffset of +0.25 or -0.25 respectively. Requested by trigger people.

Definition at line 129 of file CSCLayerGeometry.h.

References stripOffset().

Referenced by CSCCathodeLCTProcessor::run().

129 { return static_cast<int>( 4.1*stripOffset() ); }
float stripOffset(void) const
float CSCLayerGeometry::strip ( const LocalPoint lp) const
inline

Strip in which a given LocalPoint lies. This is a float which represents the fractional strip position within the detector.
Returns zero if the LocalPoint falls at the extreme low edge of the detector or BELOW, and float(nstrips) if it falls at the extreme high edge or ABOVE.

Definition at line 193 of file CSCLayerGeometry.h.

References OffsetRadialStripTopology::strip(), and theStripTopology.

Referenced by CSCRecHit2DValidation::plotResolution().

193 { return theStripTopology->strip(lp); }
CSCStripTopology * theStripTopology
virtual float strip(const LocalPoint &) const
float CSCLayerGeometry::stripAngle ( int  strip) const

The angle (in radians) of a strip wrt local x-axis.

Definition at line 140 of file CSCLayerGeometry.cc.

References M_PI_2, OffsetRadialStripTopology::stripAngle(), and theStripTopology.

Referenced by MuonCSCChamberResidual::addResidual(), CSCPairResidualsConstraint::calculatePhi(), CSCMake2DRecHit::hitFromStripAndWire(), localError(), CSCEfficiency::recHitSegment_Efficiencies(), CSCStripHitSim::simulate(), and stripWireIntersection().

141 {
142  // Cleverly subtly change meaning of stripAngle once more.
143  // In TrapezoidalStripTopology it is angle measured
144  // counter-clockwise from y axis.
145  // In APTST and RST it is angle measured
146  // clockwise from y axis.
147  // Output of this function is measured counter-clockwise
148  // from x-axis, so it is a conventional 2-dim azimuthal angle
149  // in the (x,y) local coordinates
150 
151  // We want angle at centre of strip (strip N covers
152  // *float* range N-1 to N-epsilon)
153 
154  return M_PI_2 - theStripTopology->stripAngle(strip-0.5);
155 }
#define M_PI_2
CSCStripTopology * theStripTopology
float strip(const LocalPoint &lp) const
float stripAngle(float strip) const
float CSCLayerGeometry::stripOffset ( void  ) const
inline

Offset of strips from symmetrical distribution about local y axis as a fraction of a strip (0 default, but usually +0.25 or -0.25)

Definition at line 123 of file CSCLayerGeometry.h.

References OffsetRadialStripTopology::stripOffset(), and theStripTopology.

Referenced by stagger().

123 {return theStripTopology->stripOffset();}
CSCStripTopology * theStripTopology
virtual float stripOffset(void) const
float CSCLayerGeometry::stripPhiPitch ( ) const
inline

The phi width of the strips (radians)

Definition at line 165 of file CSCLayerGeometry.h.

References CSCRadialStripTopology::phiPitch(), and theStripTopology.

165  {
166  return theStripTopology->phiPitch(); }
CSCStripTopology * theStripTopology
virtual float phiPitch(void) const
float CSCLayerGeometry::stripPitch ( ) const
inline

The width of the strips (in middle)

Definition at line 171 of file CSCLayerGeometry.h.

Referenced by CSCMake2DRecHit::hitFromStripAndWire(), operator<<(), and CSCStripHitSim::simulate().

171  {
172  // return theStripTopology->pitch(); }
173  return stripPitch( LocalPoint(0.,0.) ); }
float stripPitch() const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
float CSCLayerGeometry::stripPitch ( const LocalPoint lp) const
inline

The width of the strip at a given local point

Definition at line 178 of file CSCLayerGeometry.h.

References CSCRadialStripTopology::localPitch(), and theStripTopology.

178  {
179  return theStripTopology->localPitch(lp); }
virtual float localPitch(const LocalPoint &) const
CSCStripTopology * theStripTopology
LocalPoint CSCLayerGeometry::stripWireGroupIntersection ( int  strip,
int  wireGroup 
) const

Local point at which strip and centre of wire group intersect

Definition at line 133 of file CSCLayerGeometry.cc.

References middleWireOfGroup(), and stripWireIntersection().

Referenced by CSCSectorReceiverLUT::getGlobalEtaValue().

134 {
135  // middleWire is only an actual wire for a group with an odd no. of wires
136  float middleWire = middleWireOfGroup( wireGroup );
137  return stripWireIntersection(strip, middleWire);
138 }
int wireGroup(int wire) const
float middleWireOfGroup(int wireGroup) const
float strip(const LocalPoint &lp) const
LocalPoint stripWireIntersection(int strip, float wire) const
LocalPoint CSCLayerGeometry::stripWireIntersection ( int  strip,
float  wire 
) const

Local point at which strip and wire intersect

Definition at line 111 of file CSCLayerGeometry.cc.

References stripAngle(), funct::tan(), wireAngle(), xOfStrip(), and yOfWire().

Referenced by CSCMake2DRecHit::hitFromStripAndWire(), and stripWireGroupIntersection().

112 {
113  // This allows _float_ wire no. so that we can calculate the
114  // intersection of a strip with the mid point of a wire group
115  // containing an even no. of wires (which is not an actual wire),
116  // as well as for a group containing an odd no. of wires.
117 
118  // Equation of wire and strip as straight lines in local xy
119  // y = mx + c where m = tan(angle w.r.t. x axis)
120  // At the intersection x = -(cs-cw)/(ms-mw)
121  // At y=0, 0 = ms * xOfStrip(strip) + cs => cs = -ms*xOfStrip
122  // At x=0, yOfWire(wire) = 0 + cw => cw = yOfWire
123 
124  float ms = tan( stripAngle(strip) );
125  float mw = tan( wireAngle() );
126  float xs = xOfStrip(strip);
127  float xi = ( ms * xs + yOfWire(wire) ) / ( ms - mw );
128  float yi = ms * (xi - xs );
129 
130  return LocalPoint(xi, yi);
131 }
float wireAngle() const
float xOfStrip(int strip, float y=0.) const
float yOfWire(float wire, float x=0.) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
float strip(const LocalPoint &lp) const
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
float stripAngle(int strip) const
const CSCStripTopology* CSCLayerGeometry::topology ( ) const
inline

'The' Topology (i.e. Strip Topology) owned by this MELG

Definition at line 287 of file CSCLayerGeometry.h.

References theStripTopology.

Referenced by FWRecoGeometryESProducer::addCSCGeometry(), CSCLayer::topology(), CSCChamberSpecs::topology(), and ValidateGeometry::validateCSCLayerGeometry().

287  {
288  return theStripTopology;
289  }
CSCStripTopology * theStripTopology
float CSCLayerGeometry::wireAngle ( ) const
inline

The angle (in radians) of (any) wire wrt local x-axis.

Definition at line 139 of file CSCLayerGeometry.h.

References theWireTopology, and CSCWireTopology::wireAngle().

Referenced by CSCDriftSim::getWireHit(), localCenterOfWireGroup(), localError(), operator<<(), CSCStripHitSim::simulate(), and stripWireIntersection().

139  {
140  return theWireTopology->wireAngle(); }
float wireAngle() const
CSCWireTopology * theWireTopology
int CSCLayerGeometry::wireGroup ( int  wire) const
inline

Wire group containing a given wire

Definition at line 107 of file CSCLayerGeometry.h.

References theWireTopology, and CSCWireTopology::wireGroup().

Referenced by CSCWireElectronicsSim::readoutElement(), and yResolution().

107  {
108  return theWireTopology->wireGroup( wire );
109  }
CSCWireTopology * theWireTopology
int wireGroup(int wire) const
float CSCLayerGeometry::wirePitch ( ) const
inline

The distance (in cm) between anode wires

Definition at line 145 of file CSCLayerGeometry.h.

References theWireTopology, and CSCWireTopology::wirePitch().

Referenced by operator<<(), and CSCChamberSpecs::wireSpacing().

145  {
146  return theWireTopology->wirePitch(); }
float wirePitch() const
CSCWireTopology * theWireTopology
const CSCWireTopology* CSCLayerGeometry::wireTopology ( ) const
inline

The Wire Topology owned by this MELG

Definition at line 299 of file CSCLayerGeometry.h.

References theWireTopology.

Referenced by FWRecoGeometryESProducer::addCSCGeometry(), TrackDetectorAssociator::getTAMuonChamberMatches(), and ValidateGeometry::validateCSCLayerGeometry().

299  {
300  return theWireTopology;
301  }
CSCWireTopology * theWireTopology
float CSCLayerGeometry::xOfStrip ( int  strip,
float  y = 0. 
) const
inline

The local x-position of the center of the strip.

Definition at line 184 of file CSCLayerGeometry.h.

References theStripTopology, CSCRadialStripTopology::xOfStrip(), and detailsBasic3DVector::y.

Referenced by CSCLayer::centerOfStrip(), CSCStripDigiValidation::plotResolution(), CSCStripHitSim::simulate(), stripWireIntersection(), and ValidateGeometry::validateCSCLayerGeometry().

184  {
185  return theStripTopology->xOfStrip(strip, y); }
CSCStripTopology * theStripTopology
float xOfStrip(int strip, float y) const
float strip(const LocalPoint &lp) const
std::pair<float, float> CSCLayerGeometry::yLimitsOfStripPlane ( ) const
inline

Local y limits of the strip plane

Definition at line 231 of file CSCLayerGeometry.h.

References theStripTopology, and CSCStripTopology::yLimitsOfStripPlane().

Referenced by inside().

231  {
233  }
CSCStripTopology * theStripTopology
std::pair< float, float > yLimitsOfStripPlane() const
float CSCLayerGeometry::yOfWire ( float  wire,
float  x = 0. 
) const
inline

Local y of a given wire 'number' (float) at given x

Definition at line 207 of file CSCLayerGeometry.h.

References theWireTopology, x, and CSCWireTopology::yOfWire().

Referenced by CSCDriftSim::getWireHit(), CSCMake2DRecHit::hitFromStripAndWire(), CSCStripHitSim::simulate(), and stripWireIntersection().

207  {
208  return theWireTopology->yOfWire( wire, x ); }
CSCWireTopology * theWireTopology
float yOfWire(float wire, float x=0.) const
Definition: DDAxes.h:10
float CSCLayerGeometry::yOfWireGroup ( int  wireGroup,
float  x = 0. 
) const
inline

Local y of a given wire group at given x

Definition at line 213 of file CSCLayerGeometry.h.

References theWireTopology, x, and CSCWireTopology::yOfWireGroup().

Referenced by CSCEfficiency::fillWG_info(), localCenterOfWireGroup(), and CSCWireDigiValidation::plotResolution().

213  {
214  return theWireTopology->yOfWireGroup( wireGroup, x ); }
float yOfWireGroup(int wireGroup, float x=0.) const
int wireGroup(int wire) const
CSCWireTopology * theWireTopology
Definition: DDAxes.h:10
float CSCLayerGeometry::yResolution ( int  wireGroup = 1) const
inline

The measurement resolution from wire groups (in cm.) This approximates the measurement resolution in the local y direction but may be too small by a factor of up to 1.26 due to stripAngle contributions which are neglected here. The last wiregroup may have more wires than others. The other wiregroups, including the first, are the same. One day the wiregroups will be matched to the hardware by using the DDD.

Definition at line 159 of file CSCLayerGeometry.h.

References theWireTopology, wireGroup(), and CSCWireTopology::yResolution().

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

159  {
int wireGroup(int wire) const
CSCWireTopology * theWireTopology
float yResolution(int wireGroup=1) const

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const CSCLayerGeometry lg 
)
friend

Output operator for members of class.

Definition at line 305 of file CSCLayerGeometry.cc.

305  {
306  stream << "LayerGeometry " << std::endl
307  << "------------- " << std::endl
308  << "numberOfStrips " << lg.numberOfStrips() << std::endl
309  << "numberOfWires " << lg.numberOfWires() << std::endl
310  << "numberOfWireGroups " << lg.numberOfWireGroups() << std::endl
311  << "wireAngle (rad) " << lg.wireAngle() << std::endl
312  // << "wireAngle (deg) " << lg.theWireAngle << std::endl
313  // << "sin(wireAngle) " << lg.theWireSin << std::endl
314  // << "cos(wireAngle) " << lg.theWireCos << std::endl
315  << "wirePitch " << lg.wirePitch() << std::endl
316  << "stripPitch " << lg.stripPitch() << std::endl
317  // << "numberOfWiresPerGroup " << lg.theNumberOfWiresPerGroup << std::endl
318  // << "numberOfWiresInLastGroup " << lg.theNumberOfWiresInLastGroup << std::endl
319  // << "wireOffset " << lg.theWireOffset << std::endl
320  // << "whereStripsMeet " << lg.whereStripsMeet << std::endl;
321  << "hBottomEdge " << lg.hBottomEdge << 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;
326  return stream;
327 }
int numberOfStrips() const
float stripPitch() const
int numberOfWireGroups() const
float wireAngle() const
virtual float thickness() const
int numberOfWires() const
float wirePitch() const
virtual float length() const

Member Data Documentation

float CSCLayerGeometry::apothem
private

Definition at line 334 of file CSCLayerGeometry.h.

Referenced by CSCLayerGeometry(), operator<<(), and operator=().

int CSCLayerGeometry::chamberType
private

Definition at line 337 of file CSCLayerGeometry.h.

float CSCLayerGeometry::hBottomEdge
private

Definition at line 332 of file CSCLayerGeometry.h.

Referenced by CSCLayerGeometry(), operator<<(), and operator=().

float CSCLayerGeometry::hTopEdge
private

Definition at line 333 of file CSCLayerGeometry.h.

Referenced by operator<<(), and operator=().

const std::string CSCLayerGeometry::myName
private

Definition at line 336 of file CSCLayerGeometry.h.

Referenced by CSCLayerGeometry(), and ~CSCLayerGeometry().

CSCStripTopology* CSCLayerGeometry::theStripTopology
private
CSCWireTopology* CSCLayerGeometry::theWireTopology
private