CMS 3D CMS Logo

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

#include <MTDRingForwardDoubleLayer.h>

Inheritance diagram for MTDRingForwardDoubleLayer:
RingedForwardLayer

Public Member Functions

const MTDRingForwardLayerbackLayer () 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
 
const MTDRingForwardLayerfrontLayer () 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
 
 MTDRingForwardDoubleLayer (const std::vector< const ForwardDetRing *> &frontRings, const std::vector< const ForwardDetRing *> &backRings)
 Constructor, takes ownership of pointers. More...
 
virtual const std::vector< const ForwardDetRing * > & rings () const
 Return the vector of rings. More...
 
void selfTest () const
 
SubDetector subDetector () const override
 
 ~MTDRingForwardDoubleLayer () override
 

Protected Member Functions

BoundDiskcomputeSurface () override
 

Private Attributes

MTDRingForwardLayer theBackLayer
 
std::vector< const GeomDet * > theBasicComponents
 
std::vector< const GeometricSearchDet * > theComponents
 
MTDRingForwardLayer theFrontLayer
 
std::vector< const ForwardDetRing * > theRings
 

Detailed Description

A plane composed two layers of disks. The Endcap Timing Layer.

Author
L. Gray

Definition at line 19 of file MTDRingForwardDoubleLayer.h.

Constructor & Destructor Documentation

◆ MTDRingForwardDoubleLayer()

MTDRingForwardDoubleLayer::MTDRingForwardDoubleLayer ( const std::vector< const ForwardDetRing *> &  frontRings,
const std::vector< const ForwardDetRing *> &  backRings 
)

Constructor, takes ownership of pointers.

Definition at line 24 of file MTDRingForwardDoubleLayer.cc.

References basicComponents(), computeSurface(), LogTrace, selfTest(), theBasicComponents, theComponents, and theRings.

26  : RingedForwardLayer(true),
27  theFrontLayer(frontRings),
28  theBackLayer(backRings),
29  theRings(frontRings), // add back later
30  theComponents(),
32  theRings.insert(theRings.end(), backRings.begin(), backRings.end());
33  theComponents = std::vector<const GeometricSearchDet*>(theRings.begin(), theRings.end());
34 
35  // Cache chamber pointers (the basic components_)
36  // and find extension in R and Z
37  for (vector<const ForwardDetRing*>::const_iterator it = theRings.begin(); it != theRings.end(); it++) {
38  vector<const GeomDet*> tmp2 = (*it)->basicComponents();
39  theBasicComponents.insert(theBasicComponents.end(), tmp2.begin(), tmp2.end());
40  }
41 
42  setSurface(computeSurface());
43 
44  LogTrace("MTDDetLayers") << "Constructing MTDRingForwardDoubleLayer: " << basicComponents().size() << " Dets "
45  << theRings.size() << " Rings "
46  << " Z: " << specificSurface().position().z() << " R1: " << specificSurface().innerRadius()
47  << " R2: " << specificSurface().outerRadius();
48 
49  selfTest();
50 }
ForwardDetLayer RingedForwardLayer
const std::vector< const GeomDet * > & basicComponents() const override
BoundDisk * computeSurface() override
std::vector< const ForwardDetRing * > theRings
#define LogTrace(id)
std::vector< const GeomDet * > theBasicComponents
std::vector< const GeometricSearchDet * > theComponents

◆ ~MTDRingForwardDoubleLayer()

MTDRingForwardDoubleLayer::~MTDRingForwardDoubleLayer ( )
inlineoverride

Definition at line 25 of file MTDRingForwardDoubleLayer.h.

25 {}

Member Function Documentation

◆ backLayer()

const MTDRingForwardLayer* MTDRingForwardDoubleLayer::backLayer ( ) const
inline

Definition at line 59 of file MTDRingForwardDoubleLayer.h.

References theBackLayer.

59 { return &theBackLayer; }

◆ basicComponents()

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

Definition at line 29 of file MTDRingForwardDoubleLayer.h.

References theBasicComponents.

Referenced by MTDRingForwardDoubleLayer().

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

◆ compatible()

std::pair< bool, TrajectoryStateOnSurface > MTDRingForwardDoubleLayer::compatible ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 75 of file MTDRingForwardDoubleLayer.cc.

References 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(), mathSSE::sqrt(), funct::tan(), theBackLayer, theFrontLayer, PV3DBase< T, PVType, FrameType >::theta(), createJobs::tmp, SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

Referenced by compatibleDets().

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

◆ compatibleDets()

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

Definition at line 105 of file MTDRingForwardDoubleLayer.cc.

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

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

Definition at line 31 of file MTDRingForwardDoubleLayer.h.

References theComponents.

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

◆ computeSurface()

BoundDisk * MTDRingForwardDoubleLayer::computeSurface ( )
overrideprotected

Definition at line 52 of file MTDRingForwardDoubleLayer.cc.

References SiStripPI::max, SiStripPI::min, makeMuonMisalignmentScenario::rot, theBackLayer, theFrontLayer, SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

Referenced by MTDRingForwardDoubleLayer().

52  {
53  const BoundDisk& frontDisk = theFrontLayer.specificSurface();
54  const BoundDisk& backDisk = theBackLayer.specificSurface();
55 
56  float rmin = min(frontDisk.innerRadius(), backDisk.innerRadius());
57  float rmax = max(frontDisk.outerRadius(), backDisk.outerRadius());
58  float zmin = frontDisk.position().z();
59  float halfThickness = frontDisk.bounds().thickness() / 2.;
60  zmin = (zmin > 0) ? zmin - halfThickness : zmin + halfThickness;
61  float zmax = backDisk.position().z();
62  halfThickness = backDisk.bounds().thickness() / 2.;
63  zmax = (zmax > 0) ? zmax + halfThickness : zmax - halfThickness;
64  float zPos = (zmax + zmin) / 2.;
65  PositionType pos(0., 0., zPos);
67 
68  return new BoundDisk(pos, rot, new SimpleDiskBounds(rmin, rmax, zmin - zPos, zmax - zPos));
69 }
TkRotation< Scalar > RotationType
Definition: Definitions.h:27
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:28
Disk BoundDisk
Definition: BoundDisk.h:54

◆ frontLayer()

const MTDRingForwardLayer* MTDRingForwardDoubleLayer::frontLayer ( ) const
inline

Definition at line 58 of file MTDRingForwardDoubleLayer.h.

References theFrontLayer.

58 { return &theFrontLayer; }

◆ groupedCompatibleDets()

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

Definition at line 131 of file MTDRingForwardDoubleLayer.cc.

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

Referenced by compatibleDets().

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

◆ isCrack()

bool MTDRingForwardDoubleLayer::isCrack ( const GlobalPoint gp) const

Definition at line 152 of file MTDRingForwardDoubleLayer.cc.

References cms::cuda::assert(), runTauDisplay::gp, LogTrace, alignCSCRings::r, mps_fire::result, MTDRingForwardLayer::rings(), ForwardDetRing::specificSurface(), and theBackLayer.

152  {
153  // approximate
154  bool result = false;
155  double r = gp.perp();
156  const std::vector<const ForwardDetRing*>& backRings = theBackLayer.rings();
157  if (backRings.size() > 1) {
158  const MTDDetRing* innerRing = dynamic_cast<const MTDDetRing*>(backRings[0]);
159  const MTDDetRing* outerRing = dynamic_cast<const MTDDetRing*>(backRings[1]);
160  assert(innerRing && outerRing);
161  float crackInner = innerRing->specificSurface().outerRadius();
162  float crackOuter = outerRing->specificSurface().innerRadius();
163  LogTrace("MTDDetLayers") << "In a crack:" << crackInner << " " << r << " " << crackOuter;
164  if (r > crackInner && r < crackOuter)
165  return true;
166  }
167  // non-overlapping rings
168  return result;
169 }
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
assert(be >=bs)
virtual const std::vector< const ForwardDetRing * > & rings() const
Return the vector of rings.
#define LogTrace(id)

◆ isInsideOut()

bool MTDRingForwardDoubleLayer::isInsideOut ( const TrajectoryStateOnSurface tsos) const

Definition at line 71 of file MTDRingForwardDoubleLayer.cc.

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

Referenced by compatible().

71  {
72  return tsos.globalPosition().basicVector().dot(tsos.globalMomentum().basicVector()) > 0;
73 }
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.

◆ rings()

virtual const std::vector<const ForwardDetRing*>& MTDRingForwardDoubleLayer::rings ( ) const
inlinevirtual

Return the vector of rings.

Definition at line 54 of file MTDRingForwardDoubleLayer.h.

References theRings.

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

◆ selfTest()

void MTDRingForwardDoubleLayer::selfTest ( ) const

Definition at line 171 of file MTDRingForwardDoubleLayer.cc.

References funct::abs(), cms::cuda::assert(), MTDRingForwardLayer::basicComponents(), ETLDetId::kETLv1maxRing, theBackLayer, and theFrontLayer.

Referenced by MTDRingForwardDoubleLayer().

171  {
172  const std::vector<const GeomDet*>& frontDets = theFrontLayer.basicComponents();
173  const std::vector<const GeomDet*>& backDets = theBackLayer.basicComponents();
174 
175  for (int iring = 0; iring <= ETLDetId::kETLv1maxRing; iring++) {
176  float frontz(0.);
177  float backz(1e3f);
178  for (const auto& thisFront : frontDets) {
179  if (static_cast<ETLDetId>(thisFront->geographicalId().rawId()).mtdRR() == iring) {
180  float tmpz(std::abs(thisFront->surface().position().z()));
181  if (tmpz > frontz) {
182  frontz = tmpz;
183  }
184  }
185  }
186  for (const auto& thisBack : backDets) {
187  if (static_cast<ETLDetId>(thisBack->geographicalId().rawId()).mtdRR() == iring) {
188  float tmpz(std::abs(thisBack->surface().position().z()));
189  if (tmpz < backz) {
190  backz = tmpz;
191  }
192  }
193  }
194  assert(frontz < backz);
195  }
196 }
const std::vector< const GeomDet * > & basicComponents() const override
assert(be >=bs)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static constexpr int kETLv1maxRing
Definition: ETLDetId.h:28

◆ subDetector()

SubDetector MTDRingForwardDoubleLayer::subDetector ( ) const
inlineoverride

Definition at line 49 of file MTDRingForwardDoubleLayer.h.

References MTDRingForwardLayer::subDetector(), and theBackLayer.

49 { return theBackLayer.subDetector(); }
SubDetector subDetector() const override

Member Data Documentation

◆ theBackLayer

MTDRingForwardLayer MTDRingForwardDoubleLayer::theBackLayer
private

◆ theBasicComponents

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

Definition at line 71 of file MTDRingForwardDoubleLayer.h.

Referenced by basicComponents(), and MTDRingForwardDoubleLayer().

◆ theComponents

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

Definition at line 70 of file MTDRingForwardDoubleLayer.h.

Referenced by components(), and MTDRingForwardDoubleLayer().

◆ theFrontLayer

MTDRingForwardLayer MTDRingForwardDoubleLayer::theFrontLayer
private

◆ theRings

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

Definition at line 69 of file MTDRingForwardDoubleLayer.h.

Referenced by MTDRingForwardDoubleLayer(), and rings().