CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
MTDRingForwardLayer Class Reference

#include <MTDRingForwardLayer.h>

Inheritance diagram for MTDRingForwardLayer:
RingedForwardLayer

Public Member Functions

const std::vector< const GeomDet * > & basicComponents () const override
 
std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
 
const std::vector< const GeometricSearchDet * > & components () const override
 
std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
 
 MTDRingForwardLayer (const std::vector< const ForwardDetRing * > &rings)
 Constructor, takes ownership of pointers. More...
 
virtual const std::vector< const ForwardDetRing * > & rings () const
 Return the vector of rings. More...
 
SubDetector subDetector () const override
 
 ~MTDRingForwardLayer () override
 

Private Attributes

bool isOverlapping
 
std::vector< const GeomDet * > theBasicComps
 
BaseBinFinder< double > * theBinFinder
 
std::vector< const GeometricSearchDet * > theComponents
 
std::vector< const ForwardDetRing * > theRings
 

Detailed Description

A plane composed of disks (MTDRingForwardDisk). Represents ETL.

Author
L. Gray - FNAL

Definition at line 18 of file MTDRingForwardLayer.h.

Constructor & Destructor Documentation

◆ MTDRingForwardLayer()

MTDRingForwardLayer::MTDRingForwardLayer ( const std::vector< const ForwardDetRing * > &  rings)

Constructor, takes ownership of pointers.

Definition at line 25 of file MTDRingForwardLayer.cc.

26  : RingedForwardLayer(false),
27  theRings(rings),
28  theComponents(theRings.begin(), theRings.end()),
29  theBinFinder(nullptr),
30  isOverlapping(false) {
31  // Initial values for R and Z bounds
32  float theRmin = rings.front()->basicComponents().front()->position().perp();
33  float theRmax = theRmin;
34  float theZmin = rings.front()->position().z();
35  float theZmax = theZmin;
36 
37  // Cache chamber pointers (the basic components_)
38  // and find extension in R and Z
39  for (const auto& it : rings) {
40  vector<const GeomDet*> tmp2 = it->basicComponents();
41  theBasicComps.insert(theBasicComps.end(), tmp2.begin(), tmp2.end());
42 
43  theRmin = min(theRmin, it->specificSurface().innerRadius());
44  theRmax = max(theRmax, it->specificSurface().outerRadius());
45  float halfThick = it->surface().bounds().thickness() / 2.;
46  float zCenter = it->surface().position().z();
47  theZmin = min(theZmin, zCenter - halfThick);
48  theZmax = max(theZmax, zCenter + halfThick);
49  }
50 
52  isOverlapping = bf.isROverlapping();
54 
55  // Build surface
56 
57  float zPos = (theZmax + theZmin) / 2.;
58  PositionType pos(0., 0., zPos);
60 
61  setSurface(new BoundDisk(pos, rot, new SimpleDiskBounds(theRmin, theRmax, theZmin - zPos, theZmax - zPos)));
62 
63  LogTrace("MTDDetLayers") << "Constructing MTDRingForwardLayer: " << basicComponents().size() << " Dets "
64  << theRings.size() << " Rings "
65  << " Z: " << specificSurface().position().z() << " R1: " << specificSurface().innerRadius()
66  << " R2: " << specificSurface().outerRadius() << " Per.: " << bf.isRPeriodic()
67  << " Overl.: " << bf.isROverlapping();
68 }

References basicComponents(), isOverlapping, RBorderFinder::isROverlapping(), RBorderFinder::isRPeriodic(), LogTrace, SiStripPI::max, min(), rings(), makeMuonMisalignmentScenario::rot, theBasicComps, theBinFinder, and theRings.

◆ ~MTDRingForwardLayer()

MTDRingForwardLayer::~MTDRingForwardLayer ( )
override

Definition at line 70 of file MTDRingForwardLayer.cc.

70  {
71  delete theBinFinder;
72  for (auto& i : theRings) {
73  delete i;
74  }
75 }

References mps_fire::i, theBinFinder, and theRings.

Member Function Documentation

◆ basicComponents()

const std::vector<const GeomDet*>& MTDRingForwardLayer::basicComponents ( ) const
inlineoverride

Definition at line 27 of file MTDRingForwardLayer.h.

27 { return theBasicComps; }

References theBasicComps.

Referenced by MTDRingForwardLayer(), and MTDRingForwardDoubleLayer::selfTest().

◆ compatibleDets()

vector< GeometricSearchDet::DetWithState > MTDRingForwardLayer::compatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 77 of file MTDRingForwardLayer.cc.

78  {
79  vector<DetWithState> result;
80 
81  LogTrace("MTDDetLayers") << "MTDRingForwardLayer::compatibleDets,"
82  << " R1 " << specificSurface().innerRadius() << " R2: " << specificSurface().outerRadius()
83  << " FTS at R: " << startingState.globalPosition().perp();
84 
85  pair<bool, TrajectoryStateOnSurface> compat = compatible(startingState, prop, est);
86 
87  if (!compat.first) {
88  LogTrace("MTDDetLayers") << " MTDRingForwardLayer::compatibleDets: not compatible"
89  << " (should not have been selected!)";
90  return result;
91  }
92 
93  TrajectoryStateOnSurface& tsos = compat.second;
94 
95  int closest = theBinFinder->binIndex(tsos.globalPosition().perp());
96  const ForwardDetRing* closestRing = theRings[closest];
97 
98  // Check the closest ring
99 
100  LogTrace("MTDDetLayers") << " MTDRingForwardLayer::fastCompatibleDets, closestRing: " << closest << " R1 "
101  << closestRing->specificSurface().innerRadius()
102  << " R2: " << closestRing->specificSurface().outerRadius()
103  << " FTS R: " << tsos.globalPosition().perp();
104  if (tsos.hasError()) {
105  LogTrace("MTDDetLayers") << " sR: " << sqrt(tsos.localError().positionError().yy())
106  << " sX: " << sqrt(tsos.localError().positionError().xx());
107  }
108 
109  result = closestRing->compatibleDets(tsos, prop, est);
110 
111 #ifdef EDM_ML_DEBUG
112  int nclosest = result.size();
113  int nnextdet = 0; // MDEBUG counters
114 #endif
115 
116  //FIXME: if closest is not compatible next cannot be either?
117 
118  // Use state on layer surface. Note that local coordinates and errors
119  // are the same on the layer and on all rings surfaces, since
120  // all BoundDisks are centered in 0,0 and have the same rotation.
121  // CAVEAT: if the rings are not at the same Z, the local position and error
122  // will be "Z-projected" to the rings. This is a fairly good approximation.
123  // However in this case additional propagation will be done when calling
124  // compatibleDets.
125  GlobalPoint startPos = tsos.globalPosition();
126  LocalPoint nextPos(surface().toLocal(startPos));
127 
128  for (unsigned int idet = closest + 1; idet < theRings.size(); idet++) {
129  bool inside = false;
130  if (tsos.hasError()) {
131  inside = theRings[idet]->specificSurface().bounds().inside(nextPos, tsos.localError().positionError());
132  } else {
133  inside = theRings[idet]->specificSurface().bounds().inside(nextPos);
134  }
135  if (inside) {
136 #ifdef EDM_ML_DEBUG
137  LogTrace("MTDDetLayers") << " MTDRingForwardLayer::fastCompatibleDets:NextRing" << idet << " R1 "
138  << theRings[idet]->specificSurface().innerRadius()
139  << " R2: " << theRings[idet]->specificSurface().outerRadius() << " FTS R "
140  << nextPos.perp();
141  nnextdet++;
142 #endif
143  vector<DetWithState> nextRodDets = theRings[idet]->compatibleDets(tsos, prop, est);
144  if (!nextRodDets.empty()) {
145  result.insert(result.end(), nextRodDets.begin(), nextRodDets.end());
146  } else {
147  break;
148  }
149  }
150  }
151 
152  for (int idet = closest - 1; idet >= 0; idet--) {
153  bool inside = false;
154  if (tsos.hasError()) {
155  inside = theRings[idet]->specificSurface().bounds().inside(nextPos, tsos.localError().positionError());
156  } else {
157  inside = theRings[idet]->specificSurface().bounds().inside(nextPos);
158  }
159  if (inside) {
160 #ifdef EDM_ML_DEBUG
161  LogTrace("MTDDetLayers") << " MTDRingForwardLayer::fastCompatibleDets:PreviousRing:" << idet << " R1 "
162  << theRings[idet]->specificSurface().innerRadius()
163  << " R2: " << theRings[idet]->specificSurface().outerRadius() << " FTS R "
164  << nextPos.perp();
165  nnextdet++;
166 #endif
167  vector<DetWithState> nextRodDets = theRings[idet]->compatibleDets(tsos, prop, est);
168  if (!nextRodDets.empty()) {
169  result.insert(result.end(), nextRodDets.begin(), nextRodDets.end());
170  } else {
171  break;
172  }
173  }
174  }
175 
176 #ifdef EDM_ML_DEBUG
177  LogTrace("MTDDetLayers") << " MTDRingForwardLayer::fastCompatibleDets: found: " << result.size()
178  << " on closest: " << nclosest << " # checked rings: " << 1 + nnextdet;
179 #endif
180 
181  return result;
182 }

References BaseBinFinder< T >::binIndex(), GeometricSearchDet::compatibleDets(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::localError(), LogTrace, PV3DBase< T, PVType, FrameType >::perp(), LocalTrajectoryError::positionError(), mps_fire::result, ForwardDetRing::specificSurface(), mathSSE::sqrt(), theBinFinder, theRings, toLocal(), LocalError::xx(), and LocalError::yy().

Referenced by MTDRingForwardDoubleLayer::groupedCompatibleDets().

◆ components()

const vector< const GeometricSearchDet * > & MTDRingForwardLayer::components ( ) const
override

Definition at line 196 of file MTDRingForwardLayer.cc.

196 { return theComponents; }

References theComponents.

◆ groupedCompatibleDets()

vector< DetGroup > MTDRingForwardLayer::groupedCompatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 184 of file MTDRingForwardLayer.cc.

186  {
187  // FIXME should return only 1 group
188  edm::LogError("MTDDetLayers") << "dummy implementation of MTDRingForwardLayer::groupedCompatibleDets()";
189  return vector<DetGroup>();
190 }

◆ rings()

virtual const std::vector<const ForwardDetRing*>& MTDRingForwardLayer::rings ( ) const
inlinevirtual

Return the vector of rings.

Definition at line 45 of file MTDRingForwardLayer.h.

45 { return theRings; }

References theRings.

Referenced by MTDRingForwardDoubleLayer::isCrack(), and MTDRingForwardLayer().

◆ subDetector()

GeomDetEnumerators::SubDetector MTDRingForwardLayer::subDetector ( ) const
override

Definition at line 192 of file MTDRingForwardLayer.cc.

192  {
193  return theBasicComps.front()->subDetector();
194 }

References theBasicComps.

Referenced by MTDRingForwardDoubleLayer::subDetector().

Member Data Documentation

◆ isOverlapping

bool MTDRingForwardLayer::isOverlapping
private

Definition at line 52 of file MTDRingForwardLayer.h.

Referenced by MTDRingForwardLayer().

◆ theBasicComps

std::vector<const GeomDet*> MTDRingForwardLayer::theBasicComps
private

Definition at line 50 of file MTDRingForwardLayer.h.

Referenced by basicComponents(), MTDRingForwardLayer(), and subDetector().

◆ theBinFinder

BaseBinFinder<double>* MTDRingForwardLayer::theBinFinder
private

Definition at line 51 of file MTDRingForwardLayer.h.

Referenced by compatibleDets(), MTDRingForwardLayer(), and ~MTDRingForwardLayer().

◆ theComponents

std::vector<const GeometricSearchDet*> MTDRingForwardLayer::theComponents
private

Definition at line 49 of file MTDRingForwardLayer.h.

Referenced by components().

◆ theRings

std::vector<const ForwardDetRing*> MTDRingForwardLayer::theRings
private
GeneralBinFinderInR
Definition: GeneralBinFinderInR.h:17
mps_fire.i
i
Definition: mps_fire.py:428
ForwardDetRing::specificSurface
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
Definition: ForwardDetRing.h:27
align::RotationType
TkRotation< Scalar > RotationType
Definition: Definitions.h:27
LocalTrajectoryError::positionError
LocalError positionError() const
Definition: LocalTrajectoryError.h:81
min
T min(T a, T b)
Definition: MathUtil.h:58
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
pos
Definition: PixelAliasList.h:18
align::PositionType
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:28
GeometricSearchDet::compatibleDets
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Definition: GeometricSearchDet.cc:35
SimpleDiskBounds
Definition: SimpleDiskBounds.h:11
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
MTDRingForwardLayer::isOverlapping
bool isOverlapping
Definition: MTDRingForwardLayer.h:52
LocalError::xx
float xx() const
Definition: LocalError.h:22
TrajectoryStateOnSurface::hasError
bool hasError() const
Definition: TrajectoryStateOnSurface.h:56
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
MTDRingForwardLayer::theComponents
std::vector< const GeometricSearchDet * > theComponents
Definition: MTDRingForwardLayer.h:49
Point3DBase< float, GlobalTag >
MTDRingForwardLayer::theRings
std::vector< const ForwardDetRing * > theRings
Definition: MTDRingForwardLayer.h:48
RingedForwardLayer
ForwardDetLayer RingedForwardLayer
Definition: RingedForwardLayer.h:13
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
RBorderFinder
Definition: RBorderFinder.h:22
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
MTDRingForwardLayer::basicComponents
const std::vector< const GeomDet * > & basicComponents() const override
Definition: MTDRingForwardLayer.h:27
toLocal
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
Definition: ConversionProducer.h:199
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
MTDRingForwardLayer::rings
virtual const std::vector< const ForwardDetRing * > & rings() const
Return the vector of rings.
Definition: MTDRingForwardLayer.h:45
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
MTDRingForwardLayer::theBasicComps
std::vector< const GeomDet * > theBasicComps
Definition: MTDRingForwardLayer.h:50
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
BoundDisk
Disk BoundDisk
Definition: BoundDisk.h:54
LocalError::yy
float yy() const
Definition: LocalError.h:24
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
MTDRingForwardLayer::theBinFinder
BaseBinFinder< double > * theBinFinder
Definition: MTDRingForwardLayer.h:51
BaseBinFinder::binIndex
virtual int binIndex(T pos) const =0
Return the index of bin at given position.
ForwardDetRing
Definition: ForwardDetRing.h:11