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 Local3DPoint &, const LocalError &, float scale=1.f) const override
 
bool inside (const Local3DPoint &) const override
 Determine if the point is inside the bounds. More...
 
bool inside (const Local2DPoint &) 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, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance into account. 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...
 
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 Local3DPoint &) const=0
 Determine if the point is inside the bounds. More...
 
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...
 
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.

References apothem, angle_units::operators::convertDegToRad(), angle_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().

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 }
constexpr double convertDegToRad(NumType degrees)
Definition: angle_units.h:27
float stripOffset(void) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
TrapezoidalPlaneBounds(float be, float te, float a, float t)
CSCStripTopology * theStripTopology
#define LogTrace(id)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CSCWireTopology * theWireTopology
const std::string myName
float stripPhiPitch() const
constexpr NumType convertMmToCm(NumType millimeters)
Definition: angle_units.h:44

◆ CSCLayerGeometry() [2/2]

CSCLayerGeometry::CSCLayerGeometry ( const CSCLayerGeometry melg)

Definition at line 75 of file CSCLayerGeometry.cc.

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

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 }
TrapezoidalPlaneBounds(float be, float te, float a, float t)
CSCStripTopology * theStripTopology
virtual CSCStripTopology * clone() const =0
CSCWireTopology * theWireTopology
float thickness() const override

◆ ~CSCLayerGeometry()

CSCLayerGeometry::~CSCLayerGeometry ( )
override

Definition at line 112 of file CSCLayerGeometry.cc.

References LogTrace, myName, theStripTopology, and theWireTopology.

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 }
CSCStripTopology * theStripTopology
#define LogTrace(id)
CSCWireTopology * theWireTopology
const std::string myName

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.

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

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

112 { return theStripTopology->channel(strip); }
CSCStripTopology * theStripTopology
float strip(const LocalPoint &lp) const
virtual int channel(int strip) const =0

◆ 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.

References CSCLayerGeometry().

287 { return new CSCLayerGeometry(*this); }
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)

◆ inside() [1/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.

References pfClustersFromCombinedCaloHF_cfi::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 CSCMake2DRecHit::hitFromStripAndWire(), inside(), CSCMake2DRecHit::isHitInFiducial(), and MuonSimHitProducer::produce().

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 }
T z() const
Definition: PV3DBase.h:61
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:19
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const override
float xx() const
Definition: LocalError.h:22

◆ 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.

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

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 }
CSCStripTopology * theStripTopology
float strip(const LocalPoint &) const override
int numberOfStrips() const
std::pair< float, float > yLimitsOfStripPlane() const
float thickness() const override

◆ inside() [3/3]

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

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 277 of file CSCLayerGeometry.cc.

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

277  {
278  LocalPoint lp2(lp.x(), lp.y(), 0.);
279  return inside(lp2);
280 }
T x() const
Definition: PV2DBase.h:43
T y() const
Definition: PV2DBase.h:44
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const override

◆ 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.

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().

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 }
std::pair< float, float > equationOfWire(float wire) const
LocalPoint intersectionOfTwoLines(std::pair< float, float > p1, std::pair< float, float > p2) const
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
std::pair< float, float > equationOfStrip(float strip) const
float restrictToYOfWirePlane(float y) const
T w() const
CSCStripTopology * theStripTopology
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
CSCWireTopology * theWireTopology
bool insideYOfWirePlane(float y) const
float stripAngle(float strip) const override

◆ 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.

References alignmentValidation::c1, callgraph::m2, LaserDQM_cfg::p1, SiStripOfflineCRack_cfg::p2, x, and y.

Referenced by intersectionOfStripAndWire().

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 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30

◆ 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.

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

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 }
std::vector< float > wireValues(float wire) const
float middleWireOfGroup(int wireGroup) const
T w() const
CSCWireTopology * theWireTopology
int wireGroup(int wire) const

◆ localCenterOfWireGroup()

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

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

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 }
std::vector< float > wireValues(float wire) const
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
float middleWireOfGroup(int wireGroup) const
T w() const
float yOfWireGroup(int wireGroup, float x=0.) const
CSCWireTopology * theWireTopology
int wireGroup(int wire) const
float wireAngle() const

◆ 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.

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

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

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 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
float stripAngle(int strip) const
float strip(const LocalPoint &lp) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
float wireAngle() const

◆ 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 CSCMake2DRecHit::hitFromStripAndWire(), lengthOfWireGroup(), localCenterOfWireGroup(), and stripWireGroupIntersection().

float middleWireOfGroup(int wireGroup) const
CSCWireTopology * theWireTopology
int wireGroup(int wire) const

◆ nearestStrip()

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

Strip nearest a given local point

Definition at line 96 of file CSCLayerGeometry.h.

References CSCRadialStripTopology::nearestStrip(), and theStripTopology.

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

96 { return theStripTopology->nearestStrip(lp); }
int nearestStrip(const LocalPoint &) const override
CSCStripTopology * theStripTopology

◆ nearestWire()

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.

101 { return theWireTopology->nearestWire(lp); }
CSCWireTopology * theWireTopology
int nearestWire(const LocalPoint &lp) const override

◆ 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.

References CSCWireTopology::numberOfWires(), and theWireTopology.

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

71 { return theWireTopology->numberOfWires(); }
CSCWireTopology * theWireTopology
int numberOfWires() const override

◆ 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().

CSCWireTopology * theWireTopology
int wireGroup(int wire) const
int numberOfWiresPerGroup(int wireGroup) const

◆ operator=()

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

Definition at line 91 of file CSCLayerGeometry.cc.

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

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 }
CSCStripTopology * theStripTopology
virtual CSCStripTopology * clone() const =0
CSCWireTopology * 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.

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

Referenced by CSCMake2DRecHit::hitFromStripAndWire().

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 }
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:19
float length() const override
weight_default_t w1[2000]
Definition: w1.h:9
LocalPoint intersectionOfStripAndWire(float s, int w) const

◆ 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.

References theStripTopology.

299  {
300  delete theStripTopology;
301  theStripTopology = newTopology;
302 }
CSCStripTopology * 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.

References stripOffset().

Referenced by CSCCathodeLCTProcessor::run().

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

◆ 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.

References OffsetRadialStripTopology::strip(), and theStripTopology.

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

183 { return theStripTopology->strip(lp); }
CSCStripTopology * theStripTopology
float strip(const LocalPoint &) const override

◆ 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.

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

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

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 }
CSCStripTopology * theStripTopology
float strip(const LocalPoint &lp) const
float stripAngle(float strip) const override

◆ 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.

References OffsetRadialStripTopology::stripOffset(), and theStripTopology.

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

118 { return theStripTopology->stripOffset(); }
CSCStripTopology * theStripTopology
virtual float stripOffset(void) const

◆ stripPhiPitch()

float CSCLayerGeometry::stripPhiPitch ( ) const
inline

The phi width of the strips (radians)

Definition at line 157 of file CSCLayerGeometry.h.

References CSCRadialStripTopology::phiPitch(), and theStripTopology.

Referenced by CSCLayerGeometry().

157 { return theStripTopology->phiPitch(); }
CSCStripTopology * theStripTopology
float phiPitch(void) const override

◆ stripPitch() [1/2]

float CSCLayerGeometry::stripPitch ( ) const
inline

The width of the strips (in middle)

Definition at line 162 of file CSCLayerGeometry.h.

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

162  {
163  // return theStripTopology->pitch(); }
164  return stripPitch(LocalPoint(0., 0.));
165  }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
float stripPitch() const

◆ 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.

References CSCRadialStripTopology::localPitch(), and theStripTopology.

170 { return theStripTopology->localPitch(lp); }
CSCStripTopology * theStripTopology
float localPitch(const LocalPoint &) const override

◆ 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.

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

Referenced by CSCSectorReceiverLUT::getGlobalEtaValue().

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 }
float middleWireOfGroup(int wireGroup) const
float strip(const LocalPoint &lp) const
int wireGroup(int wire) const
LocalPoint stripWireIntersection(int strip, float wire) const

◆ 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.

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

Referenced by stripWireGroupIntersection().

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 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
float stripAngle(int strip) const
float strip(const LocalPoint &lp) const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
float yOfWire(float wire, float x=0.) const
float xOfStrip(int strip, float y=0.) const
float wireAngle() const

◆ topology()

const CSCStripTopology* CSCLayerGeometry::topology ( ) const
inline

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

Definition at line 272 of file CSCLayerGeometry.h.

References theStripTopology.

Referenced by CSCLayer::topology(), CSCChamberSpecs::topology(), and CSCGeometryValidate::validateCSCLayerGeometry().

272 { return theStripTopology; }
CSCStripTopology * theStripTopology

◆ 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.

References theWireTopology, and CSCWireTopology::wireAngle().

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

134 { return theWireTopology->wireAngle(); }
float wireAngle() const override
CSCWireTopology * theWireTopology

◆ 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.

References theWireTopology, and CSCWireTopology::wirePitch().

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

139 { return theWireTopology->wirePitch(); }
CSCWireTopology * theWireTopology
float wirePitch() const override

◆ wireTopology()

const CSCWireTopology* CSCLayerGeometry::wireTopology ( ) const
inline

The Wire Topology owned by this MELG

Definition at line 282 of file CSCLayerGeometry.h.

References theWireTopology.

Referenced by TrackDetectorAssociator::getTAMuonChamberMatches(), and CSCGeometryValidate::validateCSCLayerGeometry().

282 { return theWireTopology; }
CSCWireTopology * theWireTopology

◆ xOfStrip()

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

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

Definition at line 175 of file CSCLayerGeometry.h.

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

Referenced by CSCLayer::centerOfStrip(), MuonShowerDigiFiller::fill(), and stripWireIntersection().

175 { return theStripTopology->xOfStrip(strip, y); }
CSCStripTopology * theStripTopology
float strip(const LocalPoint &lp) const
float xOfStrip(int strip, float y) const override

◆ 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().

std::pair< float, float > yLimitsOfStripPlane() const
CSCStripTopology * theStripTopology

◆ 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.

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

Referenced by stripWireIntersection().

196 { return theWireTopology->yOfWire(wire, x); }
CSCWireTopology * theWireTopology
float yOfWire(float wire, float x=0.) const

◆ 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(), and localCenterOfWireGroup().

CSCWireTopology * theWireTopology
int wireGroup(int wire) const
float yOfWireGroup(int wireGroup, float x=0.) const

◆ 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().

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

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 }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
float stripPitch() const
int numberOfStrips() const
int numberOfWireGroups() const
float length() const override
int numberOfWires() const
float wirePitch() const
float thickness() const override
float wireAngle() const

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