CMS 3D CMS Logo

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

#include <MTDSectorForwardDoubleLayer.h>

Inheritance diagram for MTDSectorForwardDoubleLayer:
ForwardDetLayer DetLayer GeometricSearchDet

Public Member Functions

const MTDSectorForwardLayerbackLayer () const
 
const std::vector< const GeomDet * > & basicComponents () const override
 
std::pair< bool, TrajectoryStateOnSurfacecompatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) 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...
 
const MTDSectorForwardLayerfrontLayer () const
 
std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
 
bool isCrack (const GlobalPoint &gp) const
 
bool isInsideOut (const TrajectoryStateOnSurface &tsos) const
 
 MTDSectorForwardDoubleLayer (const std::vector< const MTDDetSector *> &frontSectors, const std::vector< const MTDDetSector *> &backSectors)
 Constructor, takes ownership of pointers. More...
 
virtual const std::vector< const MTDDetSector * > & sectors () const
 Return the vector of sectors. More...
 
void selfTest () const
 
SubDetector subDetector () const override
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
 ~MTDSectorForwardDoubleLayer () 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 ()
 

Protected Member Functions

BoundDiskcomputeSurface () override
 
- Protected Member Functions inherited from ForwardDetLayer
SimpleDiskBounds const & bounds () const
 
virtual void initialize ()
 
float rmax () const
 
float rmin () const
 
void setSurface (BoundDisk *cp)
 
float zmax () const
 
float zmin () const
 

Private Attributes

MTDSectorForwardLayer theBackLayer
 
std::vector< const GeomDet * > theBasicComponents
 
std::vector< const GeometricSearchDet * > theComponents
 
MTDSectorForwardLayer theFrontLayer
 
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 Attributes inherited from GeometricSearchDet
bool haveGroups
 
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

Definition at line 11 of file MTDSectorForwardDoubleLayer.h.

Constructor & Destructor Documentation

◆ MTDSectorForwardDoubleLayer()

MTDSectorForwardDoubleLayer::MTDSectorForwardDoubleLayer ( const std::vector< const MTDDetSector *> &  frontSectors,
const std::vector< const MTDDetSector *> &  backSectors 
)

Constructor, takes ownership of pointers.

Definition at line 17 of file MTDSectorForwardDoubleLayer.cc.

References basicComponents(), computeSurface(), alignBH_cfg::fixed, LogTrace, selfTest(), ForwardDetLayer::setSurface(), ForwardDetLayer::specificSurface(), theBasicComponents, theComponents, and theSectors.

19  : ForwardDetLayer(true),
20  theFrontLayer(frontSectors),
21  theBackLayer(backSectors),
22  theSectors(frontSectors), // add back later
23  theComponents(),
25  theSectors.insert(theSectors.end(), backSectors.begin(), backSectors.end());
26  theComponents = std::vector<const GeometricSearchDet*>(theSectors.begin(), theSectors.end());
27 
28  // Cache chamber pointers (the basic components_)
29  // and find extension in R and Z
30  for (const auto& isect : theSectors) {
31  vector<const GeomDet*> tmp2 = isect->basicComponents();
32  theBasicComponents.insert(theBasicComponents.end(), tmp2.begin(), tmp2.end());
33  }
34 
36 
37  LogTrace("MTDDetLayers") << "Constructing MTDSectorForwardDoubleLayer: " << std::fixed << std::setw(14)
38  << basicComponents().size() << " Dets " << std::setw(14) << theSectors.size() << " Sectors "
39  << " Z: " << std::setw(14) << specificSurface().position().z() << " R1: " << std::setw(14)
40  << specificSurface().innerRadius() << " R2: " << std::setw(14)
41  << specificSurface().outerRadius();
42 
43  selfTest();
44 }
void setSurface(BoundDisk *cp)
ForwardDetLayer(bool doHaveGroups)
#define LogTrace(id)
std::vector< const GeomDet * > theBasicComponents
std::vector< const MTDDetSector * > theSectors
virtual const BoundDisk & specificSurface() const final
std::vector< const GeometricSearchDet * > theComponents
const std::vector< const GeomDet * > & basicComponents() const override

◆ ~MTDSectorForwardDoubleLayer()

MTDSectorForwardDoubleLayer::~MTDSectorForwardDoubleLayer ( )
inlineoverride

Definition at line 17 of file MTDSectorForwardDoubleLayer.h.

17 {}

Member Function Documentation

◆ backLayer()

const MTDSectorForwardLayer* MTDSectorForwardDoubleLayer::backLayer ( ) const
inline

Definition at line 51 of file MTDSectorForwardDoubleLayer.h.

References theBackLayer.

51 { return &theBackLayer; }

◆ basicComponents()

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

Implements GeometricSearchDet.

Definition at line 21 of file MTDSectorForwardDoubleLayer.h.

References theBasicComponents.

Referenced by MTDSectorForwardDoubleLayer().

21 { return theBasicComponents; }
std::vector< const GeomDet * > theBasicComponents

◆ compatible()

std::pair< bool, TrajectoryStateOnSurface > MTDSectorForwardDoubleLayer::compatible ( const TrajectoryStateOnSurface ts,
const Propagator ,
const MeasurementEstimator  
) const
overridevirtual

tests the geometrical compatibility of the Det with the predicted state. The FreeTrajectoryState argument is propagated to the Det surface using the Propagator argument. The resulting TrajectoryStateOnSurface is tested for compatibility with the surface bounds. If compatible, a std::pair< true, propagatedState> is returned. If the propagation fails, or if the state is not compatible, a std::pair< false, propagatedState> is returned.

Implements GeometricSearchDet.

Definition at line 69 of file MTDSectorForwardDoubleLayer.cc.

References funct::abs(), Surface::bounds(), PbPb_ZMuSkimMuonDPG_cff::deltaR, submitPVResolutionJobs::err, TrajectoryStateOnSurface::hasError(), insideOut, isInsideOut(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LogTrace, HLTSiStripMonitoring_cff::nSigma, LocalTrajectoryError::positionError(), Propagator::propagate(), ForwardDetLayer::rmax(), ForwardDetLayer::rmin(), ForwardDetLayer::specificSurface(), mathSSE::sqrt(), ForwardDetLayer::surface(), funct::tan(), theBackLayer, theFrontLayer, PV3DBase< T, PVType, FrameType >::theta(), Bounds::thickness(), createJobs::tmp, ForwardDetLayer::zmax(), and ForwardDetLayer::zmin().

Referenced by compatibleDets().

70  {
71  // mostly copied from ForwardDetLayer, except propagates to closest surface,
72  // not to center
73 
74  bool insideOut = isInsideOut(startingState);
75  const MTDSectorForwardLayer& closerLayer = (insideOut) ? theFrontLayer : theBackLayer;
76  LogTrace("MTDDetLayers") << "MTDSectorForwardDoubleLayer::compatible is assuming inside-out direction: " << insideOut;
77 
78  TrajectoryStateOnSurface myState = prop.propagate(startingState, closerLayer.specificSurface());
79  if (!myState.isValid())
80  return make_pair(false, myState);
81 
82  // take into account the thickness of the layer
83  float deltaR = surface().bounds().thickness() / 2. * std::abs(tan(myState.localDirection().theta()));
84 
85  // take into account the error on the predicted state
86  constexpr float nSigma = 3.;
87  if (myState.hasError()) {
88  LocalError err = myState.localError().positionError();
89  // ignore correlation for the moment...
90  deltaR += nSigma * sqrt(err.xx() + err.yy());
91  }
92 
93  float zPos = (zmax() + zmin()) / 2.;
94  SimpleDiskBounds tmp(rmin() - deltaR, rmax() + deltaR, zmin() - zPos, zmax() - zPos);
95 
96  return make_pair(tmp.inside(myState.localPosition()), myState);
97 }
const LocalTrajectoryError & localError() const
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
LocalError positionError() const
float zmin() const
#define LogTrace(id)
bool isInsideOut(const TrajectoryStateOnSurface &tsos) const
virtual float thickness() const =0
T sqrt(T t)
Definition: SSEVec.h:19
LocalVector localDirection() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float zmax() const
float rmax() const
virtual const BoundDisk & specificSurface() const final
tmp
align.sh
Definition: createJobs.py:716
float rmin() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
const Bounds & bounds() const
Definition: Surface.h:87

◆ compatibleDets()

vector< GeometricSearchDet::DetWithState > MTDSectorForwardDoubleLayer::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 99 of file MTDSectorForwardDoubleLayer.cc.

References compatible(), groupedCompatibleDets(), LogTrace, and mps_fire::result.

100  {
101  vector<DetWithState> result;
102  pair<bool, TrajectoryStateOnSurface> compat = compatible(startingState, prop, est);
103 
104  if (!compat.first) {
105  LogTrace("MTDDetLayers") << " MTDSectorForwardDoubleLayer::compatibleDets: not compatible"
106  << " (should not have been selected!)";
107  return result;
108  }
109 
110  TrajectoryStateOnSurface& tsos = compat.second;
111 
112  // standard implementation of compatibleDets() for class which have
113  // groupedCompatibleDets implemented.
114  // This code should be moved in a common place intead of being
115  // copied many times.
116  vector<DetGroup> vectorGroups(groupedCompatibleDets(tsos, prop, est));
117  for (const auto& thisDG : vectorGroups) {
118  for (const auto& thisDGE : thisDG) {
119  result.emplace_back(DetWithState(thisDGE.det(), thisDGE.trajectoryState()));
120  }
121  }
122 
123  return result;
124 }
#define LogTrace(id)
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState

◆ components()

const std::vector<const GeometricSearchDet*>& MTDSectorForwardDoubleLayer::components ( ) const
inlineoverridevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 23 of file MTDSectorForwardDoubleLayer.h.

References theComponents.

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

◆ computeSurface()

BoundDisk * MTDSectorForwardDoubleLayer::computeSurface ( )
overrideprotectedvirtual

Reimplemented from ForwardDetLayer.

Definition at line 46 of file MTDSectorForwardDoubleLayer.cc.

References SiStripPI::max, SiStripPI::min, ForwardDetLayer::rmax(), ForwardDetLayer::rmin(), makeMuonMisalignmentScenario::rot, ForwardDetLayer::specificSurface(), theBackLayer, theFrontLayer, ForwardDetLayer::zmax(), and ForwardDetLayer::zmin().

Referenced by MTDSectorForwardDoubleLayer().

46  {
47  const BoundDisk& frontDisk = theFrontLayer.specificSurface();
48  const BoundDisk& backDisk = theBackLayer.specificSurface();
49 
50  float rmin = min(frontDisk.innerRadius(), backDisk.innerRadius());
51  float rmax = max(frontDisk.outerRadius(), backDisk.outerRadius());
52  float zmin = frontDisk.position().z();
53  float halfThickness = frontDisk.bounds().thickness() / 2.;
54  zmin = (zmin > 0) ? zmin - halfThickness : zmin + halfThickness;
55  float zmax = backDisk.position().z();
56  halfThickness = backDisk.bounds().thickness() / 2.;
57  zmax = (zmax > 0) ? zmax + halfThickness : zmax - halfThickness;
58  float zPos = (zmax + zmin) / 2.;
59  PositionType pos(0., 0., zPos);
61 
62  return new BoundDisk(pos, rot, new SimpleDiskBounds(rmin, rmax, zmin - zPos, zmax - zPos));
63 }
BoundSurface::RotationType RotationType
BoundSurface::PositionType PositionType
float zmin() const
float zmax() const
Disk BoundDisk
Definition: BoundDisk.h:54
float rmax() const
virtual const BoundDisk & specificSurface() const final
float rmin() const

◆ frontLayer()

const MTDSectorForwardLayer* MTDSectorForwardDoubleLayer::frontLayer ( ) const
inline

Definition at line 50 of file MTDSectorForwardDoubleLayer.h.

References theFrontLayer.

50 { return &theFrontLayer; }

◆ groupedCompatibleDets()

vector< DetGroup > MTDSectorForwardDoubleLayer::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 126 of file MTDSectorForwardDoubleLayer.cc.

References MTDSectorForwardLayer::compatibleDets(), LogTrace, mps_fire::result, theBackLayer, and theFrontLayer.

Referenced by compatibleDets().

128  {
129  vector<GeometricSearchDet::DetWithState> detWithStates1, detWithStates2;
130 
131  LogTrace("MTDDetLayers") << "groupedCompatibleDets are currently given always in inside-out order";
132  // this should be fixed either in RecoMTD/MeasurementDet/MTDDetLayerMeasurements or
133  // RecoMTD/DetLayers/MTDSectorForwardDoubleLayer
134 
135  detWithStates1 = theFrontLayer.compatibleDets(startingState, prop, est);
136  detWithStates2 = theBackLayer.compatibleDets(startingState, prop, est);
137 
138  vector<DetGroup> result;
139  if (!detWithStates1.empty())
140  result.push_back(DetGroup(detWithStates1));
141  if (!detWithStates2.empty())
142  result.push_back(DetGroup(detWithStates2));
143  LogTrace("MTDDetLayers") << "DoubleLayer Compatible dets: " << result.size();
144  return result;
145 }
#define LogTrace(id)
std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override

◆ isCrack()

bool MTDSectorForwardDoubleLayer::isCrack ( const GlobalPoint gp) const

Definition at line 147 of file MTDSectorForwardDoubleLayer.cc.

References LogTrace, and mps_fire::result.

147  {
148  bool result = false;
149  LogTrace("MTDDetLayers")
150  << "MTDSectorForwardDoubleLayer::isCrack kept only for backward compatibility, no real implementation";
151  return result;
152 }
#define LogTrace(id)

◆ isInsideOut()

bool MTDSectorForwardDoubleLayer::isInsideOut ( const TrajectoryStateOnSurface tsos) const

Definition at line 65 of file MTDSectorForwardDoubleLayer.cc.

References PV3DBase< T, PVType, FrameType >::basicVector(), Basic3DVector< T >::dot(), TrajectoryStateOnSurface::globalMomentum(), and TrajectoryStateOnSurface::globalPosition().

Referenced by compatible().

65  {
66  return tsos.globalPosition().basicVector().dot(tsos.globalMomentum().basicVector()) > 0;
67 }
GlobalPoint globalPosition() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
GlobalVector globalMomentum() const
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.

◆ sectors()

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

Return the vector of sectors.

Definition at line 46 of file MTDSectorForwardDoubleLayer.h.

References theSectors.

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

◆ selfTest()

void MTDSectorForwardDoubleLayer::selfTest ( ) const

Definition at line 154 of file MTDSectorForwardDoubleLayer.cc.

References funct::abs(), cms::cuda::assert(), MTDSectorForwardLayer::basicComponents(), theBackLayer, and theFrontLayer.

Referenced by MTDSectorForwardDoubleLayer().

154  {
155  const std::vector<const GeomDet*>& frontDets = theFrontLayer.basicComponents();
156  const std::vector<const GeomDet*>& backDets = theBackLayer.basicComponents();
157 
158  // test that each front z is less than each back z
159  float frontz(0.);
160  float backz(1e3f);
161  for (const auto& thisFront : frontDets) {
162  float tmpz(std::abs(thisFront->surface().position().z()));
163  if (tmpz > frontz) {
164  frontz = tmpz;
165  }
166  }
167  for (const auto& thisBack : backDets) {
168  float tmpz(std::abs(thisBack->surface().position().z()));
169  if (tmpz < backz) {
170  backz = tmpz;
171  }
172  }
173  assert(frontz < backz);
174 }
const std::vector< const GeomDet * > & basicComponents() const override
assert(be >=bs)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ subDetector()

SubDetector MTDSectorForwardDoubleLayer::subDetector ( ) const
inlineoverridevirtual

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

Implements DetLayer.

Definition at line 41 of file MTDSectorForwardDoubleLayer.h.

References MTDSectorForwardLayer::subDetector(), and theBackLayer.

41 { return theBackLayer.subDetector(); }
SubDetector subDetector() const override
The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)

Member Data Documentation

◆ theBackLayer

MTDSectorForwardLayer MTDSectorForwardDoubleLayer::theBackLayer
private

◆ theBasicComponents

std::vector<const GeomDet*> MTDSectorForwardDoubleLayer::theBasicComponents
private

Definition at line 63 of file MTDSectorForwardDoubleLayer.h.

Referenced by basicComponents(), and MTDSectorForwardDoubleLayer().

◆ theComponents

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

Definition at line 62 of file MTDSectorForwardDoubleLayer.h.

Referenced by components(), and MTDSectorForwardDoubleLayer().

◆ theFrontLayer

MTDSectorForwardLayer MTDSectorForwardDoubleLayer::theFrontLayer
private

◆ theSectors

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

Definition at line 61 of file MTDSectorForwardDoubleLayer.h.

Referenced by MTDSectorForwardDoubleLayer(), and sectors().