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

Constructor, takes ownership of pointers.

Definition at line 23 of file MuRingForwardLayer.cc.

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

24  : RingedForwardLayer(false),
25  theRings(rings),
26  theComponents(theRings.begin(), theRings.end()),
27  theBinFinder(nullptr),
28  isOverlapping(false) {
29  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardLayer";
30 
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 (vector<const ForwardDetRing*>::const_iterator it = rings.begin(); it != rings.end(); it++) {
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(metname) << "Constructing MuRingForwardLayer: " << basicComponents().size() << " Dets " << theRings.size()
64  << " Rings "
65  << " Z: " << specificSurface().position().z() << " R1: " << specificSurface().innerRadius()
66  << " R2: " << specificSurface().outerRadius() << " Per.: " << bf.isRPeriodic()
67  << " Overl.: " << bf.isROverlapping();
68 }
TkRotation< Scalar > RotationType
Definition: Definitions.h:27
ForwardDetLayer RingedForwardLayer
const std::string metname
std::vector< const ForwardDetRing * > theRings
#define LogTrace(id)
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:28
std::vector< const GeometricSearchDet * > theComponents
const std::vector< const GeomDet * > & basicComponents() const override
BaseBinFinder< double > * theBinFinder
Disk BoundDisk
Definition: BoundDisk.h:54
virtual const std::vector< const ForwardDetRing * > & rings() const
Return the vector of rings.
std::vector< const GeomDet * > theBasicComps

◆ ~MuRingForwardLayer()

MuRingForwardLayer::~MuRingForwardLayer ( )
override

Definition at line 70 of file MuRingForwardLayer.cc.

References mps_fire::i, theBinFinder, and theRings.

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

Member Function Documentation

◆ basicComponents()

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

Definition at line 27 of file MuRingForwardLayer.h.

References theBasicComps.

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

27 { return theBasicComps; }
std::vector< const GeomDet * > theBasicComps

◆ compatibleDets()

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

Definition at line 77 of file MuRingForwardLayer.cc.

References BaseBinFinder< T >::binIndex(), pv::closest(), 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 MuRingForwardDoubleLayer::groupedCompatibleDets().

78  {
79  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardLayer";
80  vector<DetWithState> result;
81 
82  LogTrace(metname) << "MuRingForwardLayer::compatibleDets,"
83  << " R1 " << specificSurface().innerRadius() << " R2: " << specificSurface().outerRadius()
84  << " FTS at R: " << startingState.globalPosition().perp();
85 
86  pair<bool, TrajectoryStateOnSurface> compat = compatible(startingState, prop, est);
87 
88  if (!compat.first) {
89  LogTrace(metname) << " MuRingForwardLayer::compatibleDets: not compatible"
90  << " (should not have been selected!)";
91  return result;
92  }
93 
94  TrajectoryStateOnSurface& tsos = compat.second;
95 
97  const ForwardDetRing* closestRing = theRings[closest];
98 
99  // Check the closest ring
100 
101  LogTrace(metname) << " MuRingForwardLayer::fastCompatibleDets, closestRing: " << closest << " R1 "
102  << closestRing->specificSurface().innerRadius()
103  << " R2: " << closestRing->specificSurface().outerRadius()
104  << " FTS R: " << tsos.globalPosition().perp();
105  if (tsos.hasError()) {
106  LogTrace(metname) << " sR: " << sqrt(tsos.localError().positionError().yy())
107  << " sX: " << sqrt(tsos.localError().positionError().xx());
108  }
109  LogTrace(metname) << endl;
110 
111  result = closestRing->compatibleDets(tsos, prop, est);
112 
113  int nclosest = result.size();
114  int nnextdet = 0; // MDEBUG counters
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  LogTrace(metname) << " MuRingForwardLayer::fastCompatibleDets:NextRing" << idet << " R1 "
137  << theRings[idet]->specificSurface().innerRadius()
138  << " R2: " << theRings[idet]->specificSurface().outerRadius() << " FTS R " << nextPos.perp();
139  nnextdet++;
140  vector<DetWithState> nextRodDets = theRings[idet]->compatibleDets(tsos, prop, est);
141  if (!nextRodDets.empty()) {
142  result.insert(result.end(), nextRodDets.begin(), nextRodDets.end());
143  } else {
144  break;
145  }
146  }
147  }
148 
149  for (int idet = closest - 1; idet >= 0; idet--) {
150  bool inside = false;
151  if (tsos.hasError()) {
152  inside = theRings[idet]->specificSurface().bounds().inside(nextPos, tsos.localError().positionError());
153  } else {
154  inside = theRings[idet]->specificSurface().bounds().inside(nextPos);
155  }
156  if (inside) {
157  LogTrace(metname) << " MuRingForwardLayer::fastCompatibleDets:PreviousRing:" << idet << " R1 "
158  << theRings[idet]->specificSurface().innerRadius()
159  << " R2: " << theRings[idet]->specificSurface().outerRadius() << " FTS R " << nextPos.perp();
160  nnextdet++;
161  vector<DetWithState> nextRodDets = theRings[idet]->compatibleDets(tsos, prop, est);
162  if (!nextRodDets.empty()) {
163  result.insert(result.end(), nextRodDets.begin(), nextRodDets.end());
164  } else {
165  break;
166  }
167  }
168  }
169 
170  LogTrace(metname) << " MuRingForwardLayer::fastCompatibleDets: found: " << result.size()
171  << " on closest: " << nclosest << " # checked rings: " << 1 + nnextdet;
172 
173  return result;
174 }
T perp() const
Definition: PV3DBase.h:69
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
const LocalTrajectoryError & localError() const
const std::string metname
int closest(std::vector< int > const &vec, int value)
virtual int binIndex(T pos) const =0
Return the index of bin at given position.
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
LocalError positionError() const
std::vector< const ForwardDetRing * > theRings
#define LogTrace(id)
float yy() const
Definition: LocalError.h:24
GlobalPoint globalPosition() const
T sqrt(T t)
Definition: SSEVec.h:23
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
BaseBinFinder< double > * theBinFinder
float xx() const
Definition: LocalError.h:22

◆ components()

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

Definition at line 186 of file MuRingForwardLayer.cc.

References theComponents.

186 { return theComponents; }
std::vector< const GeometricSearchDet * > theComponents

◆ groupedCompatibleDets()

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

Definition at line 176 of file MuRingForwardLayer.cc.

References gather_cfg::cout.

178  {
179  // FIXME should return only 1 group
180  cout << "dummy implementation of MuRingForwardLayer::groupedCompatibleDets()" << endl;
181  return vector<DetGroup>();
182 }

◆ rings()

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

45 { return theRings; }
std::vector< const ForwardDetRing * > theRings

◆ subDetector()

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

Definition at line 184 of file MuRingForwardLayer.cc.

References theBasicComps.

Referenced by MuRingForwardDoubleLayer::subDetector().

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

Member Data Documentation

◆ isOverlapping

bool MuRingForwardLayer::isOverlapping
private

Definition at line 52 of file MuRingForwardLayer.h.

Referenced by MuRingForwardLayer().

◆ theBasicComps

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

Definition at line 50 of file MuRingForwardLayer.h.

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

◆ theBinFinder

BaseBinFinder<double>* MuRingForwardLayer::theBinFinder
private

Definition at line 51 of file MuRingForwardLayer.h.

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

◆ theComponents

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

Definition at line 49 of file MuRingForwardLayer.h.

Referenced by components().

◆ theRings

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