CMS 3D CMS Logo

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
 
Boundsclone () const override
 
 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 Local2DPoint &) const override
 
bool inside (const Local3DPoint &) const override
 Determine if the point is inside the bounds. More...
 
bool inside (const Local3DPoint &, const LocalError &, float scale=1.f) const override
 
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
 
 ~CSCLayerGeometry () override
 
- Public Member Functions inherited from TrapezoidalPlaneBounds
virtual bool inside (const Local2DPoint &p) const
 
bool inside (const Local2DPoint &p, const LocalError &err, float scale) const override
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
virtual bool inside (const Local2DPoint &p, const LocalError &err, float scale=1.f) const
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
virtual bool inside (const Local3DPoint &) const=0
 Determine if the point is inside the bounds. More...
 
virtual bool inside (const Local3DPoint &, const LocalError &, float scale=1.f) const=0
 Determine if a point is inside the bounds, taking error into account. More...
 
float length () const override
 
virtual const std::array< const float, 4 > parameters () const
 
float significanceInside (const Local3DPoint &, const LocalError &) const override
 
float thickness () const override
 
 TrapezoidalPlaneBounds (float be, float te, float a, float t)
 
float width () const override
 
float widthAtHalfLength () const override
 
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() [1/2]

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 23 of file CSCLayerGeometry.cc.

37  bounds.widthAtHalfLength() - bounds.width() / 2., bounds.width() / 2., bounds.length() / 2., hThickness),
38  theWireTopology(nullptr),
39  theStripTopology(nullptr),
40  hBottomEdge(bounds.widthAtHalfLength() - bounds.width() / 2.),
41  hTopEdge(bounds.width() / 2.),
42  apothem(bounds.length() / 2.),
43  myName("CSCLayerGeometry"),
44  chamberType(iChamberType) {
45  LogTrace("CSCLayerGeometry|CSC") << myName << ": being constructed, this=" << this;
46 
47  // Ganged strips in ME1A?
48  bool gangedME1A = (iChamberType == 1 && geom->gangedStrips());
49 
50  CSCStripTopology* aStripTopology = new CSCUngangedStripTopology(
51  nstrips, stripPhiPitch, extentOfStripPlane, whereStripsMeet, stripOffset, yCentreOfStripPlane);
52 
53  if (gangedME1A) {
54  theStripTopology = new CSCGangedStripTopology(*aStripTopology, 16);
55  delete aStripTopology;
56  } else {
57  theStripTopology = aStripTopology;
58  }
59 
60  if (!geom->realWireGeometry()) {
61  // Approximate ORCA_8_8_0 and earlier calculated geometry...
62  float wangler = convertDegToRad(wireAngleInDegrees);
63  float wireCos = cos(wangler);
64  float wireSin = sin(wangler);
65  float y2 = apothem * wireCos + hBottomEdge * fabs(wireSin);
66  float wireSpacing = convertMmToCm(wg.wireSpacing);
67  float wireOffset = -y2 + wireSpacing / 2.;
68  yOfFirstWire = wireOffset / wireCos;
69  }
70 
71  theWireTopology = new CSCWireTopology(wg, yOfFirstWire, wireAngleInDegrees);
72  LogTrace("CSCLayerGeometry|CSC") << myName << ": constructed: " << *this;
73 }

References apothem, angle_units::operators::convertDegToRad(), geant_units::operators::convertMmToCm(), funct::cos(), relativeConstraints::geom, hBottomEdge, LogTrace, myName, funct::sin(), stripOffset(), stripPhiPitch(), theStripTopology, theWireTopology, CSCWireGroupPackage::wireSpacing, and testProducerWithPsetDescEmpty_cfi::y2.

Referenced by clone().

◆ CSCLayerGeometry() [2/2]

CSCLayerGeometry::CSCLayerGeometry ( const CSCLayerGeometry melg)

Definition at line 75 of file CSCLayerGeometry.cc.

76  : TrapezoidalPlaneBounds(melg.hBottomEdge, melg.hTopEdge, melg.apothem, 0.5 * melg.thickness()),
77  theWireTopology(nullptr),
78  theStripTopology(nullptr),
80  hTopEdge(melg.hTopEdge),
81  apothem(melg.apothem),
82  chamberType(melg.chamberType) {
83  // CSCStripTopology is abstract, so need clone()
84  if (melg.theStripTopology)
86  // CSCWireTopology is concrete, so direct copy
87  if (melg.theWireTopology)
89 }

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

◆ ~CSCLayerGeometry()

CSCLayerGeometry::~CSCLayerGeometry ( )
override

Definition at line 112 of file CSCLayerGeometry.cc.

112  {
113  LogTrace("CSCLayerGeometry|CSC") << myName << ": being destroyed, this=" << this
114  << "\nDeleting theStripTopology=" << theStripTopology
115  << " and theWireTopology=" << theWireTopology;
116  delete theStripTopology;
117  delete theWireTopology;
118 }

References LogTrace, myName, theStripTopology, and theWireTopology.

Member Function Documentation

◆ channel()

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 112 of file CSCLayerGeometry.h.

112 { return theStripTopology->channel(strip); }

References OffsetRadialStripTopology::channel(), strip(), and theStripTopology.

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

◆ clone()

Bounds* CSCLayerGeometry::clone ( void  ) const
inlineoverridevirtual

Utility method to handle proper copying of the class

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 287 of file CSCLayerGeometry.h.

287 { return new CSCLayerGeometry(*this); }

References CSCLayerGeometry().

◆ inside() [1/3]

bool CSCLayerGeometry::inside ( const Local2DPoint lp) const
overridevirtual

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 277 of file CSCLayerGeometry.cc.

277  {
278  LocalPoint lp2(lp.x(), lp.y(), 0.);
279  return inside(lp2);
280 }

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

◆ inside() [2/3]

bool CSCLayerGeometry::inside ( const Local3DPoint ) const
overridevirtual

Determine if the point is inside the bounds.

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 262 of file CSCLayerGeometry.cc.

262  {
263  bool result = false;
264  const float epsilon = 1.e-06;
265  if (fabs(lp.z()) < thickness() / 2.) { // thickness of TPB is that of gas layer
266  std::pair<float, float> ylims = yLimitsOfStripPlane();
267  if ((lp.y() > ylims.first) && (lp.y() < ylims.second)) {
268  // 'strip' returns float value between 0. and float(Nstrips) and value outside
269  // is set to 0. or float(Nstrips)... add a conservative precision of 'epsilon'
271  result = true;
272  }
273  }
274  return result;
275 }

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

◆ inside() [3/3]

bool CSCLayerGeometry::inside ( const Local3DPoint lp,
const LocalError le,
float  scale = 1.f 
) const
overridevirtual

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 282 of file CSCLayerGeometry.cc.

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

References HLT_FULL_cff::scale, 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().

◆ intersectionOfStripAndWire()

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 199 of file CSCLayerGeometry.cc.

199  {
200  std::pair<float, float> pw = theWireTopology->equationOfWire(static_cast<float>(w));
201  std::pair<float, float> ps = theStripTopology->equationOfStrip(s);
202  LocalPoint sw = intersectionOfTwoLines(ps, pw);
203 
204  // If point falls outside wire plane, at extremes in local y,
205  // replace its y by that of appropriate edge of wire plane
206  if (!(theWireTopology->insideYOfWirePlane(sw.y()))) {
207  float y = theWireTopology->restrictToYOfWirePlane(sw.y());
208  // and adjust x to match new y
209  float x = sw.x() + (y - sw.y()) * tan(theStripTopology->stripAngle(s));
210  sw = LocalPoint(x, y);
211  }
212 
213  return sw;
214 }

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

Referenced by possibleRecHitPosition().

◆ intersectionOfTwoLines()

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 216 of file CSCLayerGeometry.cc.

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 }

References alignmentValidation::c1, p1, p2, x, and y.

Referenced by intersectionOfStripAndWire().

◆ lengthOfWireGroup()

float CSCLayerGeometry::lengthOfWireGroup ( int  wireGroup) const

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

Definition at line 179 of file CSCLayerGeometry.cc.

179  {
180  // Return length of 'wire' in the middle of the wire group
181  float w = middleWireOfGroup(wireGroup);
182  std::vector<float> store = theWireTopology->wireValues(w);
183  return store[2];
184 }

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

◆ localCenterOfWireGroup()

LocalPoint CSCLayerGeometry::localCenterOfWireGroup ( int  wireGroup) const

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

Definition at line 163 of file CSCLayerGeometry.cc.

163  {
164  // It can use CSCWireTopology::yOfWireGroup for y,
165  // But x requires mixing with 'extent' of wire plane
166 
167  // If the wires are NOT tilted, default to simple calculation...
168  if (fabs(wireAngle()) < 1.E-6) {
169  float y = yOfWireGroup(wireGroup);
170  return LocalPoint(0., y);
171  } else {
172  // w is "wire" at the center of the wire group
173  float w = middleWireOfGroup(wireGroup);
174  std::vector<float> store = theWireTopology->wireValues(w);
175  return LocalPoint(store[0], store[1]);
176  }
177 }

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

Referenced by CSCAnodeLCTAnalyzer::getWGEta(), and ValidateGeometry::validateCSCLayerGeometry().

◆ localError()

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 230 of file CSCLayerGeometry.cc.

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

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

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

◆ middleWireOfGroup()

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 191 of file CSCLayerGeometry.h.

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

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

◆ nearestStrip()

int CSCLayerGeometry::nearestStrip ( const LocalPoint lp) const
inline

◆ nearestWire()

int CSCLayerGeometry::nearestWire ( const LocalPoint lp) const
inline

Wire nearest a given local point

Definition at line 101 of file CSCLayerGeometry.h.

101 { return theWireTopology->nearestWire(lp); }

References CSCWireTopology::nearestWire(), and theWireTopology.

Referenced by CSCAnodeLCTAnalyzer::nearestWG().

◆ numberOfStrips()

int CSCLayerGeometry::numberOfStrips ( ) const
inline

◆ numberOfWireGroups()

int CSCLayerGeometry::numberOfWireGroups ( ) const
inline

◆ numberOfWires()

int CSCLayerGeometry::numberOfWires ( ) const
inline

How many wires in layer

Definition at line 71 of file CSCLayerGeometry.h.

71 { return theWireTopology->numberOfWires(); }

References CSCWireTopology::numberOfWires(), and theWireTopology.

Referenced by operator<<(), and CSCGeometryValidate::validateCSCLayerGeometry().

◆ numberOfWiresPerGroup()

int CSCLayerGeometry::numberOfWiresPerGroup ( int  wireGroup) const
inline

How many wires in a wiregroup

Definition at line 81 of file CSCLayerGeometry.h.

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

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

◆ operator=()

CSCLayerGeometry & CSCLayerGeometry::operator= ( const CSCLayerGeometry melg)

Definition at line 91 of file CSCLayerGeometry.cc.

91  {
92  if (&melg != this) {
93  delete theStripTopology;
94  if (melg.theStripTopology)
96  else
97  theStripTopology = nullptr;
98 
99  delete theWireTopology;
100  if (melg.theWireTopology)
102  else
103  theWireTopology = nullptr;
104 
105  hBottomEdge = melg.hBottomEdge;
106  hTopEdge = melg.hTopEdge;
107  apothem = melg.apothem;
108  }
109  return *this;
110 }

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

◆ possibleRecHitPosition()

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 186 of file CSCLayerGeometry.cc.

186  {
189 
190  // Average the two points
191  LocalPoint midpt((sw1.x() + sw2.x()) / 2., (sw1.y() + sw2.y()) / 2);
192 
193  // Length of strip crossing this group of wires
194  float length = sqrt((sw1.x() - sw2.x()) * (sw1.x() - sw2.x()) + (sw1.y() - sw2.y()) * (sw1.y() - sw2.y()));
195 
196  return std::pair<LocalPoint, float>(midpt, length);
197 }

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

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

◆ setTopology()

void CSCLayerGeometry::setTopology ( CSCStripTopology topology)

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

Definition at line 299 of file CSCLayerGeometry.cc.

299  {
300  delete theStripTopology;
301  theStripTopology = newTopology;
302 }

References theStripTopology.

◆ stagger()

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 124 of file CSCLayerGeometry.h.

124 { return static_cast<int>(4.1 * stripOffset()); }

References stripOffset().

Referenced by CSCCathodeLCTAnalyzer::preselectDigis(), and CSCCathodeLCTProcessor::run().

◆ strip()

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 183 of file CSCLayerGeometry.h.

183 { return theStripTopology->strip(lp); }

References OffsetRadialStripTopology::strip(), and theStripTopology.

Referenced by channel(), CSCRecHit2DValidation::plotResolution(), stripAngle(), stripWireGroupIntersection(), stripWireIntersection(), and xOfStrip().

◆ stripAngle()

float CSCLayerGeometry::stripAngle ( int  strip) const

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

Definition at line 147 of file CSCLayerGeometry.cc.

147  {
148  // Cleverly subtly change meaning of stripAngle once more.
149  // In TrapezoidalStripTopology it is angle measured
150  // counter-clockwise from y axis.
151  // In APTST and RST it is angle measured
152  // clockwise from y axis.
153  // Output of this function is measured counter-clockwise
154  // from x-axis, so it is a conventional 2-dim azimuthal angle
155  // in the (x,y) local coordinates
156 
157  // We want angle at centre of strip (strip N covers
158  // *float* range N-1 to N-epsilon)
159 
160  return 0.5_pi - theStripTopology->stripAngle(strip - 0.5);
161 }

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

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

◆ stripOffset()

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 118 of file CSCLayerGeometry.h.

118 { return theStripTopology->stripOffset(); }

References OffsetRadialStripTopology::stripOffset(), and theStripTopology.

Referenced by CSCLayerGeometry(), stagger(), and CSCGeometryValidate::validateCSCLayerGeometry().

◆ stripPhiPitch()

float CSCLayerGeometry::stripPhiPitch ( ) const
inline

The phi width of the strips (radians)

Definition at line 157 of file CSCLayerGeometry.h.

157 { return theStripTopology->phiPitch(); }

References CSCRadialStripTopology::phiPitch(), and theStripTopology.

Referenced by CSCLayerGeometry().

◆ stripPitch() [1/2]

float CSCLayerGeometry::stripPitch ( ) const
inline

The width of the strips (in middle)

Definition at line 162 of file CSCLayerGeometry.h.

162  {
163  // return theStripTopology->pitch(); }
164  return stripPitch(LocalPoint(0., 0.));
165  }

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

◆ stripPitch() [2/2]

float CSCLayerGeometry::stripPitch ( const LocalPoint lp) const
inline

The width of the strip at a given local point

Definition at line 170 of file CSCLayerGeometry.h.

170 { return theStripTopology->localPitch(lp); }

References CSCRadialStripTopology::localPitch(), and theStripTopology.

◆ stripWireGroupIntersection()

LocalPoint CSCLayerGeometry::stripWireGroupIntersection ( int  strip,
int  wireGroup 
) const

Local point at which strip and centre of wire group intersect

Definition at line 141 of file CSCLayerGeometry.cc.

141  {
142  // middleWire is only an actual wire for a group with an odd no. of wires
143  float middleWire = middleWireOfGroup(wireGroup);
144  return stripWireIntersection(strip, middleWire);
145 }

References middleWireOfGroup(), strip(), stripWireIntersection(), and wireGroup().

Referenced by CSCSectorReceiverLUT::getGlobalEtaValue().

◆ stripWireIntersection()

LocalPoint CSCLayerGeometry::stripWireIntersection ( int  strip,
float  wire 
) const

Local point at which strip and wire intersect

Definition at line 120 of file CSCLayerGeometry.cc.

120  {
121  // This allows _float_ wire no. so that we can calculate the
122  // intersection of a strip with the mid point of a wire group
123  // containing an even no. of wires (which is not an actual wire),
124  // as well as for a group containing an odd no. of wires.
125 
126  // Equation of wire and strip as straight lines in local xy
127  // y = mx + c where m = tan(angle w.r.t. x axis)
128  // At the intersection x = -(cs-cw)/(ms-mw)
129  // At y=0, 0 = ms * xOfStrip(strip) + cs => cs = -ms*xOfStrip
130  // At x=0, yOfWire(wire) = 0 + cw => cw = yOfWire
131 
132  float ms = tan(stripAngle(strip));
133  float mw = tan(wireAngle());
134  float xs = xOfStrip(strip);
135  float xi = (ms * xs + yOfWire(wire)) / (ms - mw);
136  float yi = ms * (xi - xs);
137 
138  return LocalPoint(xi, yi);
139 }

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

Referenced by stripWireGroupIntersection().

◆ topology()

const CSCStripTopology* CSCLayerGeometry::topology ( ) const
inline

◆ wireAngle()

float CSCLayerGeometry::wireAngle ( ) const
inline

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

Definition at line 134 of file CSCLayerGeometry.h.

134 { return theWireTopology->wireAngle(); }

References theWireTopology, and CSCWireTopology::wireAngle().

Referenced by localCenterOfWireGroup(), localError(), operator<<(), and stripWireIntersection().

◆ wireGroup()

int CSCLayerGeometry::wireGroup ( int  wire) const
inline

◆ wirePitch()

float CSCLayerGeometry::wirePitch ( ) const
inline

The distance (in cm) between anode wires

Definition at line 139 of file CSCLayerGeometry.h.

139 { return theWireTopology->wirePitch(); }

References theWireTopology, and CSCWireTopology::wirePitch().

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

◆ wireTopology()

const CSCWireTopology* CSCLayerGeometry::wireTopology ( ) const
inline

◆ xOfStrip()

float CSCLayerGeometry::xOfStrip ( int  strip,
float  y = 0. 
) const
inline

◆ yLimitsOfStripPlane()

std::pair<float, float> CSCLayerGeometry::yLimitsOfStripPlane ( ) const
inline

Local y limits of the strip plane

Definition at line 218 of file CSCLayerGeometry.h.

References theStripTopology, and CSCStripTopology::yLimitsOfStripPlane().

Referenced by inside().

◆ yOfWire()

float CSCLayerGeometry::yOfWire ( float  wire,
float  x = 0. 
) const
inline

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

Definition at line 196 of file CSCLayerGeometry.h.

196 { return theWireTopology->yOfWire(wire, x); }

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

Referenced by stripWireIntersection().

◆ yOfWireGroup()

float CSCLayerGeometry::yOfWireGroup ( int  wireGroup,
float  x = 0. 
) const
inline

Local y of a given wire group at given x

Definition at line 201 of file CSCLayerGeometry.h.

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

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

◆ yResolution()

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 152 of file CSCLayerGeometry.h.

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

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

Friends And Related Function Documentation

◆ operator<<

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

Output operator for members of class.

Definition at line 304 of file CSCLayerGeometry.cc.

304  {
305  stream << "LayerGeometry " << std::endl
306  << "------------- " << std::endl
307  << "numberOfStrips " << lg.numberOfStrips() << std::endl
308  << "numberOfWires " << lg.numberOfWires() << std::endl
309  << "numberOfWireGroups " << lg.numberOfWireGroups() << std::endl
310  << "wireAngle (rad) " << lg.wireAngle()
311  << 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()
317  << std::endl
318  // << "numberOfWiresPerGroup " << lg.theNumberOfWiresPerGroup << std::endl
319  // << "numberOfWiresInLastGroup " << lg.theNumberOfWiresInLastGroup << std::endl
320  // << "wireOffset " << lg.theWireOffset << std::endl
321  // << "whereStripsMeet " << lg.whereStripsMeet << std::endl;
322  << "hBottomEdge " << lg.hBottomEdge << std::endl
323  << "hTopEdge " << lg.hTopEdge << std::endl
324  << "apothem " << lg.apothem << std::endl
325  << "length (should be 2xapothem) " << lg.length() << std::endl
326  << "thickness " << lg.thickness() << std::endl;
327  return stream;
328 }

Member Data Documentation

◆ apothem

float CSCLayerGeometry::apothem
private

Definition at line 312 of file CSCLayerGeometry.h.

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

◆ chamberType

int CSCLayerGeometry::chamberType
private

Definition at line 315 of file CSCLayerGeometry.h.

◆ hBottomEdge

float CSCLayerGeometry::hBottomEdge
private

Definition at line 310 of file CSCLayerGeometry.h.

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

◆ hTopEdge

float CSCLayerGeometry::hTopEdge
private

Definition at line 311 of file CSCLayerGeometry.h.

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

◆ myName

const std::string CSCLayerGeometry::myName
private

Definition at line 314 of file CSCLayerGeometry.h.

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

◆ theStripTopology

CSCStripTopology* CSCLayerGeometry::theStripTopology
private

◆ theWireTopology

CSCWireTopology* CSCLayerGeometry::theWireTopology
private
CSCWireTopology::insideYOfWirePlane
bool insideYOfWirePlane(float y) const
Definition: CSCWireTopology.cc:148
DDAxes::y
w2
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
CSCLayerGeometry::myName
const std::string myName
Definition: CSCLayerGeometry.h:314
CSCLayerGeometry::yLimitsOfStripPlane
std::pair< float, float > yLimitsOfStripPlane() const
Definition: CSCLayerGeometry.h:218
CSCLayerGeometry::stripPitch
float stripPitch() const
Definition: CSCLayerGeometry.h:162
CSCWireTopology::wireAngle
float wireAngle() const override
Definition: CSCWireTopology.h:70
CSCLayerGeometry::stripPhiPitch
float stripPhiPitch() const
Definition: CSCLayerGeometry.h:157
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
CSCLayerGeometry::numberOfWires
int numberOfWires() const
Definition: CSCLayerGeometry.h:71
TrapezoidalPlaneBounds::thickness
float thickness() const override
Definition: TrapezoidalPlaneBounds.h:33
HLT_FULL_cff.scale
scale
Definition: HLT_FULL_cff.py:6634
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
TrapezoidalPlaneBounds::TrapezoidalPlaneBounds
TrapezoidalPlaneBounds(float be, float te, float a, float t)
Definition: TrapezoidalPlaneBounds.cc:7
hybridSuperClusters_cfi.xi
xi
Definition: hybridSuperClusters_cfi.py:10
CSCWireTopology::yOfWireGroup
float yOfWireGroup(int wireGroup, float x=0.) const
Definition: CSCWireTopology.cc:114
CSCRadialStripTopology::phiPitch
float phiPitch(void) const override
Definition: CSCRadialStripTopology.h:164
angle_units::operators::convertDegToRad
constexpr long double convertDegToRad(NumType degrees)
Definition: angle_units.h:27
CSCLayerGeometry::theWireTopology
CSCWireTopology * theWireTopology
Definition: CSCLayerGeometry.h:299
CSCLayerGeometry::wireGroup
int wireGroup(int wire) const
Definition: CSCLayerGeometry.h:106
CSCWireTopology::nearestWire
int nearestWire(const LocalPoint &lp) const override
Definition: CSCWireTopology.h:76
DDAxes::x
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
CSCLayerGeometry::stripWireIntersection
LocalPoint stripWireIntersection(int strip, float wire) const
Definition: CSCLayerGeometry.cc:120
CSCLayerGeometry::hTopEdge
float hTopEdge
Definition: CSCLayerGeometry.h:311
CSCWireTopology::numberOfWires
int numberOfWires() const override
Definition: CSCWireTopology.h:108
CSCStripTopology::equationOfStrip
std::pair< float, float > equationOfStrip(float strip) const
Definition: CSCStripTopology.cc:9
CSCStripTopology::yLimitsOfStripPlane
std::pair< float, float > yLimitsOfStripPlane() const
Definition: CSCStripTopology.cc:27
CSCGangedStripTopology
Definition: CSCGangedStripTopology.h:13
geometryDiff.epsilon
int epsilon
Definition: geometryDiff.py:26
TrapezoidalPlaneBounds::widthAtHalfLength
float widthAtHalfLength() const override
Definition: TrapezoidalPlaneBounds.h:37
CSCLayerGeometry::wirePitch
float wirePitch() const
Definition: CSCLayerGeometry.h:139
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
OffsetRadialStripTopology::channel
virtual int channel(int strip) const =0
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
alignCSCRings.s
s
Definition: alignCSCRings.py:92
CSCLayerGeometry::intersectionOfStripAndWire
LocalPoint intersectionOfStripAndWire(float s, int w) const
Definition: CSCLayerGeometry.cc:199
CSCWireTopology::equationOfWire
std::pair< float, float > equationOfWire(float wire) const
Definition: CSCWireTopology.cc:131
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TrapezoidalPlaneBounds::width
float width() const override
Definition: TrapezoidalPlaneBounds.h:30
LocalError::xx
float xx() const
Definition: LocalError.h:22
CSCWireTopology::middleWireOfGroup
float middleWireOfGroup(int wireGroup) const
Definition: CSCWireTopology.h:131
CSCWireTopology::yResolution
float yResolution(int wireGroup=1) const
Definition: CSCWireTopology.cc:119
w
const double w
Definition: UKUtility.cc:23
CSCLayerGeometry::xOfStrip
float xOfStrip(int strip, float y=0.) const
Definition: CSCLayerGeometry.h:175
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CSCLayerGeometry::wireAngle
float wireAngle() const
Definition: CSCLayerGeometry.h:134
CSCLayerGeometry::chamberType
int chamberType
Definition: CSCLayerGeometry.h:315
p2
double p2[4]
Definition: TauolaWrapper.h:90
CSCLayerGeometry::middleWireOfGroup
float middleWireOfGroup(int wireGroup) const
Definition: CSCLayerGeometry.h:191
CSCLayerGeometry::yOfWire
float yOfWire(float wire, float x=0.) const
Definition: CSCLayerGeometry.h:196
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
CSCRadialStripTopology::xOfStrip
float xOfStrip(int strip, float y) const override
Definition: CSCRadialStripTopology.cc:45
CSCWireTopology::wireValues
std::vector< float > wireValues(float wire) const
Definition: CSCWireTopology.h:167
Point3DBase< float, LocalTag >
CSCWireTopology::restrictToYOfWirePlane
float restrictToYOfWirePlane(float y) const
Definition: CSCWireTopology.cc:135
testProducerWithPsetDescEmpty_cfi.y2
y2
Definition: testProducerWithPsetDescEmpty_cfi.py:30
CSCLayerGeometry::inside
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const override
Definition: CSCLayerGeometry.cc:282
CSCWireGroupPackage::wireSpacing
double wireSpacing
Definition: CSCWireGroupPackage.h:33
LocalError
Definition: LocalError.h:12
PV2DBase::y
T y() const
Definition: PV2DBase.h:44
PV2DBase::x
T x() const
Definition: PV2DBase.h:43
CSCWireTopology::wirePitch
float wirePitch() const override
Definition: CSCWireTopology.h:65
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
CSCLayerGeometry::intersectionOfTwoLines
LocalPoint intersectionOfTwoLines(std::pair< float, float > p1, std::pair< float, float > p2) const
Definition: CSCLayerGeometry.cc:216
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
CSCRadialStripTopology::localPitch
float localPitch(const LocalPoint &) const override
Definition: CSCRadialStripTopology.cc:118
p1
double p1[4]
Definition: TauolaWrapper.h:89
CSCLayerGeometry::hBottomEdge
float hBottomEdge
Definition: CSCLayerGeometry.h:310
CSCLayerGeometry::stripAngle
float stripAngle(int strip) const
Definition: CSCLayerGeometry.cc:147
CSCRadialStripTopology::nstrips
int nstrips() const override
Definition: CSCRadialStripTopology.h:122
OffsetRadialStripTopology::stripAngle
float stripAngle(float strip) const override
Definition: OffsetRadialStripTopology.cc:82
CSCStripTopology
Definition: CSCStripTopology.h:28
OffsetRadialStripTopology::stripOffset
virtual float stripOffset(void) const
Definition: OffsetRadialStripTopology.h:35
CSCWireTopology::wireGroup
int wireGroup(int wire) const
Definition: CSCWireTopology.h:123
TrapezoidalPlaneBounds::length
float length() const override
Definition: TrapezoidalPlaneBounds.h:27
PVValHelper::dxy
Definition: PVValidationHelpers.h:47
CSCLayerGeometry::strip
float strip(const LocalPoint &lp) const
Definition: CSCLayerGeometry.h:183
CSCWireTopology::yOfWire
float yOfWire(float wire, float x=0.) const
Definition: CSCWireTopology.h:81
CSCLayerGeometry::stripOffset
float stripOffset(void) const
Definition: CSCLayerGeometry.h:118
OffsetRadialStripTopology::strip
float strip(const LocalPoint &) const override
Definition: OffsetRadialStripTopology.cc:73
CSCRadialStripTopology::nearestStrip
int nearestStrip(const LocalPoint &) const override
Definition: CSCRadialStripTopology.cc:29
CSCWireTopology
Definition: CSCWireTopology.h:18
CSCLayerGeometry::apothem
float apothem
Definition: CSCLayerGeometry.h:312
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:62
CSCStripTopology::clone
virtual CSCStripTopology * clone() const =0
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
CSCLayerGeometry::yOfWireGroup
float yOfWireGroup(int wireGroup, float x=0.) const
Definition: CSCLayerGeometry.h:201
CSCLayerGeometry::theStripTopology
CSCStripTopology * theStripTopology
Definition: CSCLayerGeometry.h:305
CSCLayerGeometry::numberOfStrips
int numberOfStrips() const
Definition: CSCLayerGeometry.h:66
CSCWireTopology::numberOfWiresPerGroup
int numberOfWiresPerGroup(int wireGroup) const
Definition: CSCWireTopology.h:118
CSCLayerGeometry::numberOfWireGroups
int numberOfWireGroups() const
Definition: CSCLayerGeometry.h:76
CSCWireTopology::numberOfWireGroups
int numberOfWireGroups() const
Definition: CSCWireTopology.h:113
LocalError::yy
float yy() const
Definition: LocalError.h:24
CSCLayerGeometry::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)
Definition: CSCLayerGeometry.cc:23
CSCUngangedStripTopology
Definition: CSCUngangedStripTopology.h:13