CMS 3D CMS Logo

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

#include <MuRingForwardLayer.h>

Inheritance diagram for MuRingForwardLayer:
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
 
 MuRingForwardLayer (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
 
 ~MuRingForwardLayer () 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 (MuRingForwardDisk). Represents forward muon CSC/RPC stations.

Author
N. Amapane - INFN Torino

Definition at line 18 of file MuRingForwardLayer.h.

Constructor & Destructor Documentation

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

Constructor, takes ownership of pointers.

Definition at line 24 of file MuRingForwardLayer.cc.

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

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

Definition at line 71 of file MuRingForwardLayer.cc.

References mps_fire::i, theBinFinder, and theRings.

71  {
72  delete theBinFinder;
73  for (vector<const ForwardDetRing*>::iterator i = theRings.begin(); i < theRings.end(); i++) {
74  delete *i;
75  }
76 }
std::vector< const ForwardDetRing * > theRings
BaseBinFinder< double > * theBinFinder

Member Function Documentation

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

Definition at line 27 of file MuRingForwardLayer.h.

References compatibleDets(), components(), groupedCompatibleDets(), subDetector(), and theBasicComps.

Referenced by MuRingForwardLayer(), and MuRingForwardDoubleLayer::selfTest().

27 { return theBasicComps; }
std::vector< const GeomDet * > theBasicComps
vector< GeometricSearchDet::DetWithState > MuRingForwardLayer::compatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 78 of file MuRingForwardLayer.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 MuRingForwardDoubleLayer::groupedCompatibleDets().

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

Definition at line 187 of file MuRingForwardLayer.cc.

References theComponents.

Referenced by basicComponents().

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

Definition at line 177 of file MuRingForwardLayer.cc.

References gather_cfg::cout.

Referenced by basicComponents().

179  {
180  // FIXME should return only 1 group
181  cout << "dummy implementation of MuRingForwardLayer::groupedCompatibleDets()" << endl;
182  return vector<DetGroup>();
183 }
virtual const std::vector<const ForwardDetRing*>& MuRingForwardLayer::rings ( ) const
inlinevirtual

Return the vector of rings.

Definition at line 45 of file MuRingForwardLayer.h.

References theRings.

Referenced by MuRingForwardDoubleLayer::isCrack().

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

Definition at line 185 of file MuRingForwardLayer.cc.

References theBasicComps.

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

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

Member Data Documentation

bool MuRingForwardLayer::isOverlapping
private

Definition at line 52 of file MuRingForwardLayer.h.

Referenced by MuRingForwardLayer().

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

Definition at line 50 of file MuRingForwardLayer.h.

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

BaseBinFinder<double>* MuRingForwardLayer::theBinFinder
private

Definition at line 51 of file MuRingForwardLayer.h.

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

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

Definition at line 49 of file MuRingForwardLayer.h.

Referenced by components().

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