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

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

Referenced by clone().

30  : TrapezoidalPlaneBounds( bounds.widthAtHalfLength() - bounds.width()/2., bounds.width()/2., bounds.length()/2., hThickness ),
31  theWireTopology( nullptr ), theStripTopology( nullptr ),
32  hBottomEdge( bounds.widthAtHalfLength() - bounds.width()/2. ),
33  hTopEdge( bounds.width()/2. ), apothem( bounds.length()/2. ),
34  myName( "CSCLayerGeometry" ), chamberType( iChamberType ) {
35 
36  LogTrace("CSCLayerGeometry|CSC") << myName <<": being constructed, this=" << this;
37 
38  // Ganged strips in ME1A?
39  bool gangedME1A = ( iChamberType == 1 && geom->gangedStrips() );
40 
41  CSCStripTopology* aStripTopology =
43  extentOfStripPlane, whereStripsMeet, stripOffset, yCentreOfStripPlane );
44 
45  if ( gangedME1A ) {
46  theStripTopology = new CSCGangedStripTopology( *aStripTopology, 16 );
47  delete aStripTopology;
48  }
49  else {
50  theStripTopology = aStripTopology;
51  }
52 
53  if ( ! geom->realWireGeometry() ) {
54  // Approximate ORCA_8_8_0 and earlier calculated geometry...
55  float wangler = convertDegToRad( wireAngleInDegrees );
56  float wireCos = cos(wangler);
57  float wireSin = sin(wangler);
58  float y2 = apothem * wireCos + hBottomEdge * fabs(wireSin);
59  float wireSpacing = convertMmToCm( wg.wireSpacing );
60  float wireOffset = -y2 + wireSpacing/2.;
61  yOfFirstWire = wireOffset/wireCos;
62  }
63 
64  theWireTopology = new CSCWireTopology( wg, yOfFirstWire, wireAngleInDegrees );
65  LogTrace("CSCLayerGeometry|CSC") << myName <<": constructed: "<< *this;
66 }
float width() const override
float length() const override
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
float widthAtHalfLength() const override
bool realWireGeometry() const
Definition: CSCGeometry.h:127
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
CSCWireTopology * theWireTopology
constexpr long double convertDegToRad(NumType degrees)
Definition: GeantUnits.h:104
#define LogTrace(id)
const std::string myName
bool gangedStrips() const
Definition: CSCGeometry.h:113
float stripPhiPitch() const
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:110
CSCLayerGeometry::CSCLayerGeometry ( const CSCLayerGeometry melg)

Definition at line 68 of file CSCLayerGeometry.cc.

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

68  :
70  0.5 * melg.thickness() ),
71  theWireTopology(nullptr), theStripTopology(nullptr),
74 {
75  // CSCStripTopology is abstract, so need clone()
77  // CSCWireTopology is concrete, so direct copy
79 }
TrapezoidalPlaneBounds(float be, float te, float a, float t)
CSCStripTopology * theStripTopology
virtual CSCStripTopology * clone() const =0
float thickness() const override
CSCWireTopology * theWireTopology
CSCLayerGeometry::~CSCLayerGeometry ( )
override

Definition at line 103 of file CSCLayerGeometry.cc.

References LogTrace, myName, theStripTopology, and theWireTopology.

104 {
105  LogTrace("CSCLayerGeometry|CSC") << myName << ": being destroyed, this=" << this <<
106  "\nDeleting theStripTopology=" << theStripTopology <<
107  " and theWireTopology=" << theWireTopology;
108  delete theStripTopology;
109  delete theWireTopology;
110 }
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(), CSCHitAssociator::associateCSCHitId(), CSCHitAssociator::associateHitId(), and CSCStripElectronicsSim::readoutElement().

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

Utility method to handle proper copying of the class

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 306 of file CSCLayerGeometry.h.

References CSCLayerGeometry(), and operator<<.

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
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 286 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(), MuonSimHitProducer::produce(), and yLimitsOfStripPlane().

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

Determine if the point is inside the bounds.

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 266 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().

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

Reimplemented from TrapezoidalPlaneBounds.

Definition at line 281 of file CSCLayerGeometry.cc.

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

281  {
282  LocalPoint lp2( lp.x(), lp.y(), 0. );
283  return inside( lp2 );
284 }
T y() const
Definition: PV2DBase.h:46
bool inside(const Local3DPoint &, const LocalError &, float scale=1.f) const override
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 200 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(), y, and PV3DBase< T, PVType, FrameType >::y().

Referenced by possibleRecHitPosition(), and yLimitsOfStripPlane().

200  {
201 
202  std::pair<float, float> pw = theWireTopology->equationOfWire( static_cast<float>(w) );
203  std::pair<float, float> ps = theStripTopology->equationOfStrip( s );
204  LocalPoint sw = intersectionOfTwoLines( ps, pw );
205 
206  // If point falls outside wire plane, at extremes in local y,
207  // replace its y by that of appropriate edge of wire plane
208  if ( !(theWireTopology->insideYOfWirePlane( sw.y() ) ) ) {
209  float y = theWireTopology->restrictToYOfWirePlane( sw.y() );
210  // and adjust x to match new y
211  float x = sw.x() + (y - sw.y())*tan(theStripTopology->stripAngle(s));
212  sw = LocalPoint(x, y);
213  }
214 
215  return sw;
216 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
std::pair< float, float > equationOfWire(float wire) const
const double w
Definition: UKUtility.cc:23
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 stripAngle(float strip) const override
float restrictToYOfWirePlane(float y) 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 218 of file CSCLayerGeometry.cc.

References alignmentValidation::c1, x, and y.

Referenced by intersectionOfStripAndWire(), and yLimitsOfStripPlane().

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

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

Definition at line 178 of file CSCLayerGeometry.cc.

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

Referenced by yOfWireGroup().

178  {
179  // Return length of 'wire' in the middle of the wire group
180  float w = middleWireOfGroup( wireGroup );
181  std::vector<float> store = theWireTopology->wireValues( w );
182  return store[2];
183 }
const double w
Definition: UKUtility.cc:23
int wireGroup(int wire) const
float middleWireOfGroup(int wireGroup) const
CSCWireTopology * theWireTopology
std::vector< float > wireValues(float wire) 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 160 of file CSCLayerGeometry.cc.

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

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

160  {
161 
162  // It can use CSCWireTopology::yOfWireGroup for y,
163  // But x requires mixing with 'extent' of wire plane
164 
165  // If the wires are NOT tilted, default to simple calculation...
166  if ( fabs(wireAngle() ) < 1.E-6 ) {
167  float y = yOfWireGroup( wireGroup );
168  return LocalPoint( 0., y );
169  }
170  else {
171  // w is "wire" at the center of the wire group
172  float w = middleWireOfGroup( wireGroup );
173  std::vector<float> store = theWireTopology->wireValues( w );
174  return LocalPoint( store[0], store[1] );
175  }
176 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
const double w
Definition: UKUtility.cc:23
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
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 234 of file CSCLayerGeometry.cc.

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

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

234  {
235  // Input sigmas are expected to be in _distance units_
236  // - uncertainty in strip measurement (typically from Gatti fit, value is in local x units)
237  // - uncertainty in wire measurement (along direction perpendicular to wires)
238 
239  float wangle = this->wireAngle();
240  float strangle = this->stripAngle( strip );
241 
242  float sinAngdif = sin(strangle-wangle);
243  float sinAngdif2 = sinAngdif * sinAngdif;
244 
245  float du = sigmaStrip/sin(strangle); // sigmaStrip is just x-component of strip error
246  float dv = sigmaWire;
247 
248  // The notation is
249  // wsins = wire resol * sin(strip angle)
250  // wcoss = wire resol * cos(strip angle)
251  // ssinw = strip resol * sin(wire angle)
252  // scosw = strip resol * cos(wire angle)
253 
254  float wsins = dv * sin(strangle);
255  float wcoss = dv * cos(strangle);
256  float ssinw = du * sin(wangle);
257  float scosw = du * cos(wangle);
258 
259  float dx2 = (scosw*scosw + wcoss*wcoss)/sinAngdif2;
260  float dy2 = (ssinw*ssinw + wsins*wsins)/sinAngdif2;
261  float dxy = (scosw*ssinw + wcoss*wsins)/sinAngdif2;
262 
263  return LocalError(dx2, dxy, dy2);
264 }
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 CSCComparatorDigiFitter::fit(), CSCTriggerPrimitivesReader::getGlobalPosition(), 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
int nearestStrip(const LocalPoint &) const override
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 CSCAnodeLCTAnalyzer::nearestWG(), and CSCWireHitSim::simulate().

101  {
102  return theWireTopology->nearestWire( lp ); }
int nearestWire(const LocalPoint &lp) const override
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(); }
CSCWireTopology * theWireTopology
int numberOfWires() const override
int CSCLayerGeometry::numberOfWiresPerGroup ( int  wireGroup) const
inline

How many wires in a wiregroup

Definition at line 78 of file CSCLayerGeometry.h.

References CSCWireTopology::numberOfWiresPerGroup(), strip(), stripWireGroupIntersection(), stripWireIntersection(), theWireTopology, and wireGroup().

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

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

82 {
83  if ( &melg != this ) {
84  delete theStripTopology;
85  if ( melg.theStripTopology )
87  else
88  theStripTopology=nullptr;
89 
90  delete theWireTopology;
91  if ( melg.theWireTopology )
93  else
94  theWireTopology=nullptr;
95 
96  hBottomEdge = melg.hBottomEdge;
97  hTopEdge = melg.hTopEdge;
98  apothem = melg.apothem;
99  }
100  return *this;
101 }
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 185 of file CSCLayerGeometry.cc.

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

Referenced by yLimitsOfStripPlane().

185  {
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()) +
195  (sw1.y()-sw2.y())*(sw1.y()-sw2.y()) );
196 
197  return std::pair<LocalPoint,float>( midpt, length );
198 }
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
float length() const override
T y() const
Definition: PV3DBase.h:63
LocalPoint intersectionOfStripAndWire(float s, int w) const
T sqrt(T t)
Definition: SSEVec.h:18
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 303 of file CSCLayerGeometry.cc.

References theStripTopology.

Referenced by topology().

303  {
304  delete theStripTopology;
305  theStripTopology = newTopology;
306 }
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 stripAngle(), and stripOffset().

Referenced by CSCCathodeLCTAnalyzer::preselectDigis(), and 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 numberOfWiresPerGroup(), and CSCRecHit2DValidation::plotResolution().

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

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

Definition at line 143 of file CSCLayerGeometry.cc.

References OffsetRadialStripTopology::stripAngle(), and theStripTopology.

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

144 {
145  // Cleverly subtly change meaning of stripAngle once more.
146  // In TrapezoidalStripTopology it is angle measured
147  // counter-clockwise from y axis.
148  // In APTST and RST it is angle measured
149  // clockwise from y axis.
150  // Output of this function is measured counter-clockwise
151  // from x-axis, so it is a conventional 2-dim azimuthal angle
152  // in the (x,y) local coordinates
153 
154  // We want angle at centre of strip (strip N covers
155  // *float* range N-1 to N-epsilon)
156 
157  return 0.5_pi - theStripTopology->stripAngle(strip - 0.5);
158 }
CSCStripTopology * theStripTopology
float strip(const LocalPoint &lp) const
float stripAngle(float strip) const override
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
float phiPitch(void) const override
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.) ); }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
float stripPitch() const
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); }
CSCStripTopology * theStripTopology
float localPitch(const LocalPoint &) const override
LocalPoint CSCLayerGeometry::stripWireGroupIntersection ( int  strip,
int  wireGroup 
) const

Local point at which strip and centre of wire group intersect

Definition at line 136 of file CSCLayerGeometry.cc.

References middleWireOfGroup(), and stripWireIntersection().

Referenced by CSCSectorReceiverLUT::getGlobalEtaValue(), and numberOfWiresPerGroup().

137 {
138  // middleWire is only an actual wire for a group with an odd no. of wires
139  float middleWire = middleWireOfGroup( wireGroup );
140  return stripWireIntersection(strip, middleWire);
141 }
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 114 of file CSCLayerGeometry.cc.

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

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

115 {
116  // This allows _float_ wire no. so that we can calculate the
117  // intersection of a strip with the mid point of a wire group
118  // containing an even no. of wires (which is not an actual wire),
119  // as well as for a group containing an odd no. of wires.
120 
121  // Equation of wire and strip as straight lines in local xy
122  // y = mx + c where m = tan(angle w.r.t. x axis)
123  // At the intersection x = -(cs-cw)/(ms-mw)
124  // At y=0, 0 = ms * xOfStrip(strip) + cs => cs = -ms*xOfStrip
125  // At x=0, yOfWire(wire) = 0 + cw => cw = yOfWire
126 
127  float ms = tan( stripAngle(strip) );
128  float mw = tan( wireAngle() );
129  float xs = xOfStrip(strip);
130  float xi = ( ms * xs + yOfWire(wire) ) / ( ms - mw );
131  float yi = ms * (xi - xs );
132 
133  return LocalPoint(xi, yi);
134 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
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
susybsm::MuonSegment ms
Definition: classes.h:31
float stripAngle(int strip) const
const CSCStripTopology* CSCLayerGeometry::topology ( ) const
inline
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(); }
CSCWireTopology * theWireTopology
float wireAngle() const override
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 CSCAnodeLCTAnalyzer::nearestWG(), numberOfWiresPerGroup(), and CSCWireElectronicsSim::readoutElement().

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(); }
CSCWireTopology * theWireTopology
float wirePitch() const override
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 y.

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

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

Local y limits of the strip plane

Definition at line 231 of file CSCLayerGeometry.h.

References f, inside(), intersectionOfStripAndWire(), intersectionOfTwoLines(), localError(), p1, p2, possibleRecHitPosition(), alignCSCRings::s, Scenarios_cff::scale, theStripTopology, w, w2, 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
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 lengthOfWireGroup(), localCenterOfWireGroup(), 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
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, 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 308 of file CSCLayerGeometry.cc.

Referenced by clone().

308  {
309  stream << "LayerGeometry " << std::endl
310  << "------------- " << std::endl
311  << "numberOfStrips " << lg.numberOfStrips() << std::endl
312  << "numberOfWires " << lg.numberOfWires() << std::endl
313  << "numberOfWireGroups " << lg.numberOfWireGroups() << std::endl
314  << "wireAngle (rad) " << lg.wireAngle() << std::endl
315  // << "wireAngle (deg) " << lg.theWireAngle << std::endl
316  // << "sin(wireAngle) " << lg.theWireSin << std::endl
317  // << "cos(wireAngle) " << lg.theWireCos << std::endl
318  << "wirePitch " << lg.wirePitch() << std::endl
319  << "stripPitch " << lg.stripPitch() << std::endl
320  // << "numberOfWiresPerGroup " << lg.theNumberOfWiresPerGroup << std::endl
321  // << "numberOfWiresInLastGroup " << lg.theNumberOfWiresInLastGroup << std::endl
322  // << "wireOffset " << lg.theWireOffset << std::endl
323  // << "whereStripsMeet " << lg.whereStripsMeet << std::endl;
324  << "hBottomEdge " << lg.hBottomEdge << std::endl
325  << "hTopEdge " << lg.hTopEdge << std::endl
326  << "apothem " << lg.apothem << std::endl
327  << "length (should be 2xapothem) " << lg.length() << std::endl
328  << "thickness " << lg.thickness() << std::endl;
329  return stream;
330 }
float length() const override
int numberOfStrips() const
float stripPitch() const
int numberOfWireGroups() const
float wireAngle() const
int numberOfWires() const
float thickness() const override
float wirePitch() 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