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 ( const std::vector< const ForwardDetRing * > &  rings)

Constructor, takes ownership of pointers.

Definition at line 24 of file MTDRingForwardLayer.cc.

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

24  :
25  RingedForwardLayer(false),
26  theRings(rings),
27  theComponents(theRings.begin(),theRings.end()),
28  theBinFinder(nullptr),
29  isOverlapping(false)
30 {
31 
32  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDRingForwardLayer";
33 
34  // Initial values for R and Z bounds
35  float theRmin = rings.front()->basicComponents().front()->position().perp();
36  float theRmax = theRmin;
37  float theZmin = rings.front()->position().z();
38  float theZmax = theZmin;
39 
40  // Cache chamber pointers (the basic components_)
41  // and find extension in R and Z
42  for (vector<const ForwardDetRing*>::const_iterator it=rings.begin();
43  it!=rings.end(); it++) {
44  vector<const GeomDet*> tmp2 = (*it)->basicComponents();
45  theBasicComps.insert(theBasicComps.end(),tmp2.begin(),tmp2.end());
46 
47  theRmin = min( theRmin, (*it)->specificSurface().innerRadius());
48  theRmax = max( theRmax, (*it)->specificSurface().outerRadius());
49  float halfThick = (*it)->surface().bounds().thickness()/2.;
50  float zCenter = (*it)->surface().position().z();
51  theZmin = min( theZmin, zCenter-halfThick);
52  theZmax = max( theZmax, zCenter+halfThick);
53  }
54 
56  isOverlapping = bf.isROverlapping();
58 
59  // Build surface
60 
61  float zPos = (theZmax+theZmin)/2.;
62  PositionType pos(0.,0.,zPos);
64 
65  setSurface(new BoundDisk( pos, rot,
66  new SimpleDiskBounds( theRmin, theRmax,
67  theZmin-zPos, theZmax-zPos)));
68 
69 
70 
71  LogTrace(metname) << "Constructing MTDRingForwardLayer: "
72  << basicComponents().size() << " Dets "
73  << theRings.size() << " Rings "
74  << " Z: " << specificSurface().position().z()
75  << " R1: " << specificSurface().innerRadius()
76  << " R2: " << specificSurface().outerRadius()
77  << " Per.: " << bf.isRPeriodic()
78  << " Overl.: " << bf.isROverlapping();
79 }
TkRotation< Scalar > RotationType
Definition: Definitions.h:29
virtual const std::vector< const ForwardDetRing * > & rings() const
Return the vector of rings.
const std::vector< const GeomDet * > & basicComponents() const override
ForwardDetLayer RingedForwardLayer
const std::string metname
std::vector< const ForwardDetRing * > theRings
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:30
BaseBinFinder< double > * theBinFinder
T min(T a, T b)
Definition: MathUtil.h:58
#define LogTrace(id)
std::vector< const GeometricSearchDet * > theComponents
Disk BoundDisk
Definition: BoundDisk.h:62
std::vector< const GeomDet * > theBasicComps
MTDRingForwardLayer::~MTDRingForwardLayer ( )
override

Definition at line 82 of file MTDRingForwardLayer.cc.

References mps_fire::i, theBinFinder, and theRings.

82  {
83  delete theBinFinder;
84  for (vector <const ForwardDetRing*>::iterator i = theRings.begin();
85  i<theRings.end(); i++) {delete *i;}
86 }
std::vector< const ForwardDetRing * > theRings
BaseBinFinder< double > * theBinFinder

Member Function Documentation

const std::vector<const GeomDet*>& MTDRingForwardLayer::basicComponents ( ) const
inlineoverride
vector< GeometricSearchDet::DetWithState > MTDRingForwardLayer::compatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 90 of file MTDRingForwardLayer.cc.

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

Referenced by basicComponents(), and MTDRingForwardDoubleLayer::groupedCompatibleDets().

92  {
93 
94  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDRingForwardLayer";
95  vector<DetWithState> result;
96 
97 
98  LogTrace(metname) << "MTDRingForwardLayer::compatibleDets,"
99  << " R1 " << specificSurface().innerRadius()
100  << " R2: " << specificSurface().outerRadius()
101  << " FTS at R: " << startingState.globalPosition().perp();
102 
103  pair<bool, TrajectoryStateOnSurface> compat =
104  compatible(startingState, prop, est);
105 
106  if (!compat.first) {
107 
108  LogTrace(metname) << " MTDRingForwardLayer::compatibleDets: not compatible"
109  << " (should not have been selected!)";
110  return result;
111  }
112 
113 
114  TrajectoryStateOnSurface& tsos = compat.second;
115 
116  int closest = theBinFinder->binIndex(tsos.globalPosition().perp());
117  const ForwardDetRing* closestRing = theRings[closest];
118 
119  // Check the closest ring
120 
121  LogTrace(metname) << " MTDRingForwardLayer::fastCompatibleDets, closestRing: "
122  << closest
123  << " R1 " << closestRing->specificSurface().innerRadius()
124  << " R2: " << closestRing->specificSurface().outerRadius()
125  << " FTS R: " << tsos.globalPosition().perp();
126  if (tsos.hasError()) {
127  LogTrace(metname) << " sR: " << sqrt(tsos.localError().positionError().yy())
128  << " sX: " << sqrt(tsos.localError().positionError().xx());
129  }
130  LogTrace(metname) << endl;
131 
132 
133  result = closestRing->compatibleDets(tsos, prop, est);
134 
135 #ifdef EDM_ML_DEBUG
136  int nclosest = result.size(); int nnextdet=0; // MDEBUG counters
137 #endif
138 
139  //FIXME: if closest is not compatible next cannot be either?
140 
141  // Use state on layer surface. Note that local coordinates and errors
142  // are the same on the layer and on all rings surfaces, since
143  // all BoundDisks are centered in 0,0 and have the same rotation.
144  // CAVEAT: if the rings are not at the same Z, the local position and error
145  // will be "Z-projected" to the rings. This is a fairly good approximation.
146  // However in this case additional propagation will be done when calling
147  // compatibleDets.
148  GlobalPoint startPos = tsos.globalPosition();
149  LocalPoint nextPos(surface().toLocal(startPos));
150 
151  for (unsigned int idet=closest+1; idet < theRings.size(); idet++) {
152  bool inside = false;
153  if (tsos.hasError()) {
154  inside=theRings[idet]->specificSurface().bounds().inside(nextPos,tsos.localError().positionError());
155  } else {
156  inside=theRings[idet]->specificSurface().bounds().inside(nextPos);
157  }
158  if (inside){
159  LogTrace(metname) << " MTDRingForwardLayer::fastCompatibleDets:NextRing" << idet
160  << " R1 " << theRings[idet]->specificSurface().innerRadius()
161  << " R2: " << theRings[idet]->specificSurface().outerRadius()
162  << " FTS R " << nextPos.perp();
163 #ifdef EDM_ML_DEBUG
164  nnextdet++;
165 #endif
166  vector<DetWithState> nextRodDets =
167  theRings[idet]->compatibleDets(tsos, prop, est);
168  if (!nextRodDets.empty()) {
169  result.insert( result.end(),
170  nextRodDets.begin(), nextRodDets.end());
171  } else {
172  break;
173  }
174  }
175  }
176 
177  for (int idet=closest-1; idet >= 0; idet--) {
178  bool inside = false;
179  if (tsos.hasError()) {
180  inside=theRings[idet]->specificSurface().bounds().inside(nextPos,tsos.localError().positionError());
181  } else {
182  inside=theRings[idet]->specificSurface().bounds().inside(nextPos);
183  }
184  if (inside){
185  LogTrace(metname) << " MTDRingForwardLayer::fastCompatibleDets:PreviousRing:" << idet
186  << " R1 " << theRings[idet]->specificSurface().innerRadius()
187  << " R2: " << theRings[idet]->specificSurface().outerRadius()
188  << " FTS R " << nextPos.perp();
189 #ifdef EDM_ML_DEBUG
190  nnextdet++;
191 #endif
192  vector<DetWithState> nextRodDets =
193  theRings[idet]->compatibleDets(tsos, prop, est);
194  if (!nextRodDets.empty()) {
195  result.insert( result.end(),
196  nextRodDets.begin(), nextRodDets.end());
197  } else {
198  break;
199  }
200  }
201  }
202 
203 #ifdef EDM_ML_DEBUG
204  LogTrace(metname) << " MTDRingForwardLayer::fastCompatibleDets: found: "
205  << result.size()
206  << " on closest: " << nclosest
207  << " # checked rings: " << 1 + nnextdet;
208 #endif
209 
210  return result;
211 }
float xx() const
Definition: LocalError.h:24
T perp() const
Definition: PV3DBase.h:72
virtual int binIndex(T pos) const =0
Return the index of bin at given position.
const std::string metname
std::vector< const ForwardDetRing * > theRings
GlobalPoint globalPosition() const
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
LocalError positionError() const
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
BaseBinFinder< double > * theBinFinder
const LocalTrajectoryError & localError() const
#define LogTrace(id)
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
const vector< const GeometricSearchDet * > & MTDRingForwardLayer::components ( ) const
override

Definition at line 230 of file MTDRingForwardLayer.cc.

References theComponents.

Referenced by basicComponents().

230  {
231  return theComponents;
232 }
std::vector< const GeometricSearchDet * > theComponents
vector< DetGroup > MTDRingForwardLayer::groupedCompatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 215 of file MTDRingForwardLayer.cc.

References gather_cfg::cout.

Referenced by basicComponents().

217  {
218  // FIXME should return only 1 group
219  cout << "dummy implementation of MTDRingForwardLayer::groupedCompatibleDets()" << endl;
220  return vector<DetGroup>();
221 }
virtual const std::vector<const ForwardDetRing*>& MTDRingForwardLayer::rings ( ) const
inlinevirtual

Return the vector of rings.

Definition at line 53 of file MTDRingForwardLayer.h.

References theRings.

Referenced by MTDRingForwardDoubleLayer::isCrack().

53 {return theRings;}
std::vector< const ForwardDetRing * > theRings
GeomDetEnumerators::SubDetector MTDRingForwardLayer::subDetector ( ) const
override

Definition at line 225 of file MTDRingForwardLayer.cc.

References theBasicComps.

Referenced by basicComponents(), and MTDRingForwardDoubleLayer::subDetector().

225  {
226  return theBasicComps.front()->subDetector();
227 }
std::vector< const GeomDet * > theBasicComps

Member Data Documentation

bool MTDRingForwardLayer::isOverlapping
private

Definition at line 61 of file MTDRingForwardLayer.h.

Referenced by MTDRingForwardLayer().

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

Definition at line 59 of file MTDRingForwardLayer.h.

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

BaseBinFinder<double>* MTDRingForwardLayer::theBinFinder
private

Definition at line 60 of file MTDRingForwardLayer.h.

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

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

Definition at line 58 of file MTDRingForwardLayer.h.

Referenced by components().

std::vector<const ForwardDetRing*> MTDRingForwardLayer::theRings
private