CMS 3D CMS Logo

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

#include <MTDSectorForwardLayer.h>

Inheritance diagram for MTDSectorForwardLayer:
ForwardDetLayer DetLayer GeometricSearchDet

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
 Returns basic components, if any. More...
 
std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
 
 MTDSectorForwardLayer (const std::vector< const MTDDetSector *> &sectors)
 Constructor, takes ownership of pointers. More...
 
virtual const std::vector< const MTDDetSector * > & sectors () const
 Return the vector of sectors. More...
 
SubDetector subDetector () const override
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
 ~MTDSectorForwardLayer () override
 
- Public Member Functions inherited from ForwardDetLayer
std::pair< bool, TrajectoryStateOnSurfacecompatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
 
bool contains (const Local3DPoint &p) const
 
 ForwardDetLayer (bool doHaveGroups)
 
Location location () const final
 Which part of the detector (barrel, endcap) More...
 
virtual const BoundDiskspecificSurface () const final
 
const BoundSurfacesurface () const final
 The surface of the GeometricSearchDet. More...
 
 ~ForwardDetLayer () override
 
- Public Member Functions inherited from DetLayer
 DetLayer (bool doHaveGroup, bool ibar)
 
bool isBarrel () const
 
bool isForward () const
 
int seqNum () const
 
void setSeqNum (int sq)
 
 ~DetLayer () override
 
- Public Member Functions inherited from GeometricSearchDet
virtual void compatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
 
 GeometricSearchDet (bool doHaveGroups)
 
virtual void groupedCompatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
 
bool hasGroups () const
 
virtual const Surface::PositionTypeposition () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Private Attributes

std::vector< const GeomDet * > theBasicComps
 
std::vector< const GeometricSearchDet * > theComponents
 
std::vector< const MTDDetSector * > theSectors
 

Additional Inherited Members

- Public Types inherited from DetLayer
typedef GeomDetEnumerators::Location Location
 
typedef GeomDetEnumerators::SubDetector SubDetector
 
- Public Types inherited from GeometricSearchDet
typedef std::pair< const GeomDet *, TrajectoryStateOnSurfaceDetWithState
 
typedef BoundSurface::PositionType PositionType
 
typedef BoundSurface::RotationType RotationType
 
typedef TrajectoryStateOnSurface TrajectoryState
 
- Protected Member Functions inherited from ForwardDetLayer
SimpleDiskBounds const & bounds () const
 
virtual BoundDiskcomputeSurface ()
 
virtual void initialize ()
 
float rmax () const
 
float rmin () const
 
void setSurface (BoundDisk *cp)
 
float zmax () const
 
float zmin () const
 
- Protected Attributes inherited from GeometricSearchDet
bool haveGroups
 
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

Definition at line 9 of file MTDSectorForwardLayer.h.

Constructor & Destructor Documentation

◆ MTDSectorForwardLayer()

MTDSectorForwardLayer::MTDSectorForwardLayer ( const std::vector< const MTDDetSector *> &  sectors)

Constructor, takes ownership of pointers.

Definition at line 18 of file MTDSectorForwardLayer.cc.

References basicComponents(), alignBH_cfg::fixed, LogTrace, WZElectronSkims53X_cff::max, SiStripPI::min, makeMuonMisalignmentScenario::rot, sectors(), ForwardDetLayer::setSurface(), ForwardDetLayer::specificSurface(), theBasicComps, and theSectors.

20  // Initial values for R, Z and Phi bounds
21  float theRmin = sectors.front()->basicComponents().front()->position().perp();
22  float theRmax = theRmin;
23  float theZmin = sectors.front()->position().z();
24  float theZmax = theZmin;
25 
26  // Cache chamber pointers (the basic components_)
27  // and find extension in R and Z
28  for (const auto& isect : sectors) {
29  vector<const GeomDet*> tmp2 = isect->basicComponents();
30  theBasicComps.insert(theBasicComps.end(), tmp2.begin(), tmp2.end());
31 
32  theRmin = min(theRmin, isect->specificSurface().innerRadius());
33  theRmax = max(theRmax, isect->specificSurface().outerRadius());
34  float halfThick = isect->surface().bounds().thickness() / 2.;
35  float zCenter = isect->surface().position().z();
36  theZmin = min(theZmin, zCenter - halfThick);
37  theZmax = max(theZmax, zCenter + halfThick);
38  }
39 
40  // Build surface
41 
42  float zPos = (theZmax + theZmin) / 2.;
43  PositionType pos(0., 0., zPos);
45 
46  setSurface(new BoundDisk(pos, rot, new SimpleDiskBounds(theRmin, theRmax, theZmin - zPos, theZmax - zPos)));
47 
48  LogTrace("MTDDetLayers") << "Constructing MTDSectorForwardLayer: " << std::fixed << std::setw(14)
49  << basicComponents().size() << " Dets, " << std::setw(14) << theSectors.size()
50  << " Sectors, "
51  << " Z: " << std::setw(14) << specificSurface().position().z() << " R1: " << std::setw(14)
52  << specificSurface().innerRadius() << " R2: " << std::setw(14)
53  << specificSurface().outerRadius();
54 }
BoundSurface::RotationType RotationType
BoundSurface::PositionType PositionType
const std::vector< const GeomDet * > & basicComponents() const override
void setSurface(BoundDisk *cp)
ForwardDetLayer(bool doHaveGroups)
virtual const std::vector< const MTDDetSector * > & sectors() const
Return the vector of sectors.
#define LogTrace(id)
std::vector< const MTDDetSector * > theSectors
std::vector< const GeomDet * > theBasicComps
Disk BoundDisk
Definition: BoundDisk.h:54
std::vector< const GeometricSearchDet * > theComponents
virtual const BoundDisk & specificSurface() const final

◆ ~MTDSectorForwardLayer()

MTDSectorForwardLayer::~MTDSectorForwardLayer ( )
override

Definition at line 56 of file MTDSectorForwardLayer.cc.

References mps_fire::i, and theSectors.

56  {
57  for (auto& i : theSectors) {
58  delete i;
59  }
60 }
std::vector< const MTDDetSector * > theSectors

Member Function Documentation

◆ basicComponents()

const std::vector<const GeomDet*>& MTDSectorForwardLayer::basicComponents ( ) const
inlineoverridevirtual

Implements GeometricSearchDet.

Definition at line 18 of file MTDSectorForwardLayer.h.

References theBasicComps.

Referenced by MTDSectorForwardLayer(), and MTDSectorForwardDoubleLayer::selfTest().

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

◆ compatibleDets()

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

Returns all Dets compatible with a trajectory state according to the estimator est. The startingState should be propagated to the surface of each compatible Det using the Propagator passed as an argument. The default implementation should be overridden in dets with specific surface types to avoid propagation to a generic Surface

Reimplemented from GeometricSearchDet.

Definition at line 62 of file MTDSectorForwardLayer.cc.

References ForwardDetLayer::compatible(), alignBH_cfg::fixed, TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::localError(), LogDebug, LogTrace, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), LocalTrajectoryError::positionError(), mps_fire::result, ForwardDetLayer::specificSurface(), mathSSE::sqrt(), theSectors, toLocal(), LocalError::xx(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by MTDSectorForwardDoubleLayer::groupedCompatibleDets().

63  {
64  vector<DetWithState> result;
65 
66  LogTrace("MTDDetLayers") << "MTDSectorForwardLayer::compatibleDets,"
67  << " R1 " << std::fixed << std::setw(14) << specificSurface().innerRadius()
68  << " R2: " << std::setw(14) << specificSurface().outerRadius()
69  << " FTS at R: " << std::setw(14) << startingState.globalPosition().perp();
70 
71  pair<bool, TrajectoryStateOnSurface> compat = compatible(startingState, prop, est);
72 
73  if (!compat.first) {
74  LogTrace("MTDDetLayers") << " MTDSectorForwardLayer::compatibleDets: not compatible"
75  << " (should not have been selected!)";
76  return result;
77  }
78 
79  TrajectoryStateOnSurface& tsos = compat.second;
80 
81  // as there are either two or four sectors only, avoid complex logic and just loop on all of them
82 
83  // Use state on layer surface. Note that local coordinates and errors
84  // are the same on the layer and on all sectors surfaces, since
85  // all BoundDisks are centered in 0,0 and have the same rotation.
86  // CAVEAT: if the sectors are not at the same Z, the local position and error
87  // will be "Z-projected" to the sectors. This is a fairly good approximation.
88  // However in this case additional propagation will be done when calling
89  // compatibleDets.
90  GlobalPoint startPos = tsos.globalPosition();
91 
92  for (unsigned int isect = 0; isect < theSectors.size(); isect++) {
93  LocalPoint nextPos(theSectors[isect]->specificSurface().toLocal(startPos));
94  LogDebug("MTDDetLayers") << "Global point = " << std::fixed << startPos << " local point = " << nextPos
95  << " global sector ref pos = " << theSectors[isect]->specificSurface().position();
96  bool inside = false;
97  if (tsos.hasError()) {
98  inside = theSectors[isect]->specificSurface().bounds().inside(nextPos, tsos.localError().positionError(), 1.);
99  } else {
100  inside = theSectors[isect]->specificSurface().bounds().inside(nextPos);
101  }
102  if (inside) {
103 #ifdef EDM_ML_DEBUG
104  LogTrace("MTDDetLayers") << " MTDSectorForwardLayer::fastCompatibleDets:NextSector " << std::fixed
105  << std::setw(14) << isect << "\n"
106  << (*theSectors[isect]) << "\n FTS at Z,R,phi: " << std::setw(14)
107  << tsos.globalPosition().z() << " , " << std::setw(14) << tsos.globalPosition().perp()
108  << "," << std::setw(14) << tsos.globalPosition().phi();
109  if (tsos.hasError()) {
110  LogTrace("MTDDetLayers") << " sR: " << sqrt(tsos.localError().positionError().yy())
111  << " sX: " << sqrt(tsos.localError().positionError().xx());
112  }
113 #endif
114  vector<DetWithState> nextRodDets(theSectors[isect]->compatibleDets(tsos, prop, est));
115  if (!nextRodDets.empty()) {
116  result.insert(result.end(), nextRodDets.begin(), nextRodDets.end());
117  } else {
118  break;
119  }
120  }
121  }
122 
123  LogTrace("MTDDetLayers") << " MTDSectorForwardLayer::fastCompatibleDets: found: " << result.size();
124 
125  return result;
126 }
T perp() const
Definition: PV3DBase.h:69
const LocalTrajectoryError & localError() const
T z() const
Definition: PV3DBase.h:61
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
LocalError positionError() const
#define LogTrace(id)
std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
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)
std::vector< const MTDDetSector * > theSectors
virtual const BoundDisk & specificSurface() const final
float xx() const
Definition: LocalError.h:22
#define LogDebug(id)

◆ components()

const vector< const GeometricSearchDet * > & MTDSectorForwardLayer::components ( ) const
overridevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 140 of file MTDSectorForwardLayer.cc.

References theComponents.

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

◆ groupedCompatibleDets()

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

Similar to compatibleDets(), but the compatible Dets are grouped in one or more groups. Dets are put in the same group if they are mutually exclusive for track crossing, i.e. a reconstructible track cannot cross more than one Det from a group. Pathological tracks (spirals etc.) can of course violate this rule.
The DetGroups are sorted in the sequence of crossing by a track. In order to define the direction of crossing the Propagator used in this method should have a defined direction() : either "alongMomentum" or "oppositeToMomentum" but not "anyDirection".
The three signatures of this method differ by the input trajectory state arguments: the starting state can be a TrajectoryStateOnSurface or a FreeTrajectoryState, and the state on this CompositeDet may be already known or not. The last two arguments are as for the method compatibleDets().
First signature: The first argument is a TrajectoryStateOnSurface, usually not on the surface of this CompositeDet.

Reimplemented from GeometricSearchDet.

Definition at line 128 of file MTDSectorForwardLayer.cc.

130  {
131  // FIXME should return only 1 group
132  edm::LogInfo("MTDDetLayers") << "dummy implementation of MTDSectorForwardLayer::groupedCompatibleDets()";
133  return vector<DetGroup>();
134 }
Log< level::Info, false > LogInfo

◆ sectors()

virtual const std::vector<const MTDDetSector*>& MTDSectorForwardLayer::sectors ( ) const
inlinevirtual

Return the vector of sectors.

Definition at line 36 of file MTDSectorForwardLayer.h.

References theSectors.

Referenced by MTDSectorForwardLayer().

36 { return theSectors; }
std::vector< const MTDDetSector * > theSectors

◆ subDetector()

GeomDetEnumerators::SubDetector MTDSectorForwardLayer::subDetector ( ) const
overridevirtual

The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)

Implements DetLayer.

Definition at line 136 of file MTDSectorForwardLayer.cc.

References theBasicComps.

Referenced by MTDSectorForwardDoubleLayer::subDetector().

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

Member Data Documentation

◆ theBasicComps

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

Definition at line 41 of file MTDSectorForwardLayer.h.

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

◆ theComponents

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

Definition at line 40 of file MTDSectorForwardLayer.h.

Referenced by components().

◆ theSectors

std::vector<const MTDDetSector*> MTDSectorForwardLayer::theSectors
private