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.

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 }

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

◆ ~MTDSectorForwardLayer()

MTDSectorForwardLayer::~MTDSectorForwardLayer ( )
override

Definition at line 56 of file MTDSectorForwardLayer.cc.

56  {
57  for (auto& i : theSectors) {
58  delete i;
59  }
60 }

References mps_fire::i, and theSectors.

Member Function Documentation

◆ basicComponents()

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

Implements GeometricSearchDet.

Definition at line 18 of file MTDSectorForwardLayer.h.

18 { return theBasicComps; }

References theBasicComps.

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

◆ 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.

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 }

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().

◆ 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.

140 { return theComponents; }

References 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 }

◆ sectors()

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

Return the vector of sectors.

Definition at line 36 of file MTDSectorForwardLayer.h.

36 { return theSectors; }

References theSectors.

Referenced by MTDSectorForwardLayer().

◆ 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.

136  {
137  return theBasicComps.front()->subDetector();
138 }

References theBasicComps.

Referenced by MTDSectorForwardDoubleLayer::subDetector().

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
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
mps_fire.i
i
Definition: mps_fire.py:428
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
ForwardDetLayer::setSurface
void setSurface(BoundDisk *cp)
Definition: ForwardDetLayer.cc:13
GeometricSearchDet::RotationType
BoundSurface::RotationType RotationType
Definition: GeometricSearchDet.h:21
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
SimpleDiskBounds
Definition: SimpleDiskBounds.h:11
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
MTDSectorForwardLayer::basicComponents
const std::vector< const GeomDet * > & basicComponents() const override
Definition: MTDSectorForwardLayer.h:18
LocalError::xx
float xx() const
Definition: LocalError.h:22
MTDSectorForwardLayer::sectors
virtual const std::vector< const MTDDetSector * > & sectors() const
Return the vector of sectors.
Definition: MTDSectorForwardLayer.h:36
TrajectoryStateOnSurface::hasError
bool hasError() const
Definition: TrajectoryStateOnSurface.h:56
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
MTDSectorForwardLayer::theBasicComps
std::vector< const GeomDet * > theBasicComps
Definition: MTDSectorForwardLayer.h:41
Point3DBase< float, GlobalTag >
MTDSectorForwardLayer::compatibleDets
std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
Definition: MTDSectorForwardLayer.cc:62
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
ForwardDetLayer::ForwardDetLayer
ForwardDetLayer(bool doHaveGroups)
Definition: ForwardDetLayer.h:24
MTDSectorForwardLayer::theSectors
std::vector< const MTDDetSector * > theSectors
Definition: MTDSectorForwardLayer.h:39
toLocal
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
Definition: ConversionProducer.h:199
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
MTDSectorForwardLayer::theComponents
std::vector< const GeometricSearchDet * > theComponents
Definition: MTDSectorForwardLayer.h:40
mps_fire.result
result
Definition: mps_fire.py:311
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
GeometricSearchDet::PositionType
BoundSurface::PositionType PositionType
Definition: GeometricSearchDet.h:20
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
ForwardDetLayer::compatible
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
Definition: ForwardDetLayer.cc:84
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
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
ForwardDetLayer::specificSurface
virtual const BoundDisk & specificSurface() const final
Definition: ForwardDetLayer.h:39