CMS 3D CMS Logo

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

#include <MuRingForwardDoubleLayer.h>

Inheritance diagram for MuRingForwardDoubleLayer:
RingedForwardLayer

Public Member Functions

const MuRingForwardLayerbackLayer () 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 MuRingForwardLayerfrontLayer () 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
 
 MuRingForwardDoubleLayer (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
 
 ~MuRingForwardDoubleLayer () override
 

Protected Member Functions

BoundDiskcomputeSurface () override
 

Private Attributes

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

Detailed Description

A plane composed two layers of disks. Represents forward muon CSC stations.

Author
R. Wilkinson

Definition at line 19 of file MuRingForwardDoubleLayer.h.

Constructor & Destructor Documentation

◆ MuRingForwardDoubleLayer()

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

Constructor, takes ownership of pointers.

Definition at line 21 of file MuRingForwardDoubleLayer.cc.

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

References basicComponents(), computeSurface(), LogTrace, metname, selfTest(), AlCaHLTBitMon_QueryRunRegistry::string, theBasicComponents, theComponents, and theRings.

◆ ~MuRingForwardDoubleLayer()

MuRingForwardDoubleLayer::~MuRingForwardDoubleLayer ( )
inlineoverride

Definition at line 25 of file MuRingForwardDoubleLayer.h.

25 {}

Member Function Documentation

◆ backLayer()

const MuRingForwardLayer* MuRingForwardDoubleLayer::backLayer ( ) const
inline

Definition at line 59 of file MuRingForwardDoubleLayer.h.

59 { return &theBackLayer; }

References theBackLayer.

◆ basicComponents()

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

Definition at line 29 of file MuRingForwardDoubleLayer.h.

29 { return theBasicComponents; }

References theBasicComponents.

Referenced by MuRingForwardDoubleLayer().

◆ compatible()

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

Definition at line 74 of file MuRingForwardDoubleLayer.cc.

75  {
76  // mostly copied from ForwardDetLayer, except propagates to closest surface,
77  // not to center
78  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer";
79 
80  bool insideOut = isInsideOut(startingState);
81  const MuRingForwardLayer& closerLayer = (insideOut) ? theFrontLayer : theBackLayer;
82  LogTrace("Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer")
83  << "MuRingForwardDoubleLayer::compatible is assuming inside-out direction: " << insideOut;
84 
85  //std::pair<bool, TrajectoryStateOnSurface> result
86  // = closerLayer.compatible(startingState, prop, est);
87  //if(!result.first)
88  // {
89  // result = furtherLayer.compatible(startingState, prop, est);
90  //}
91 
92  TrajectoryStateOnSurface myState = prop.propagate(startingState, closerLayer.specificSurface());
93  if (!myState.isValid())
94  return make_pair(false, myState);
95 
96  // take into account the thickness of the layer
97  float deltaR = surface().bounds().thickness() / 2. * fabs(tan(myState.localDirection().theta()));
98 
99  // take into account the error on the predicted state
100  const float nSigma = 3.;
101  if (myState.hasError()) {
102  LocalError err = myState.localError().positionError();
103  // ignore correlation for the moment...
104  deltaR += nSigma * sqrt(err.xx() + err.yy());
105  }
106 
107  float zPos = (zmax() + zmin()) / 2.;
108  SimpleDiskBounds tmp(rmin() - deltaR, rmax() + deltaR, zmin() - zPos, zmax() - zPos);
109 
110  return make_pair(tmp.inside(myState.localPosition()), myState);
111 }

References PbPb_ZMuSkimMuonDPG_cff::deltaR, submitPVResolutionJobs::err, TrajectoryStateOnSurface::hasError(), insideOut, isInsideOut(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LogTrace, metname, HLTSiStripMonitoring_cff::nSigma, LocalTrajectoryError::positionError(), Propagator::propagate(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), theBackLayer, theFrontLayer, PV3DBase< T, PVType, FrameType >::theta(), createJobs::tmp, SiStripMonitorCluster_cfi::zmax, and SiStripMonitorCluster_cfi::zmin.

Referenced by compatibleDets().

◆ compatibleDets()

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

Definition at line 113 of file MuRingForwardDoubleLayer.cc.

114  {
115  vector<DetWithState> result;
116  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer";
117  pair<bool, TrajectoryStateOnSurface> compat = compatible(startingState, prop, est);
118 
119  if (!compat.first) {
120  LogTrace(metname) << " MuRingForwardDoubleLayer::compatibleDets: not compatible"
121  << " (should not have been selected!)";
122  return result;
123  }
124 
125  TrajectoryStateOnSurface& tsos = compat.second;
126 
127  // standard implementation of compatibleDets() for class which have
128  // groupedCompatibleDets implemented.
129  // This code should be moved in a common place intead of being
130  // copied many times.
131  vector<DetGroup> vectorGroups = groupedCompatibleDets(tsos, prop, est);
132  for (vector<DetGroup>::const_iterator itDG = vectorGroups.begin(); itDG != vectorGroups.end(); itDG++) {
133  for (vector<DetGroupElement>::const_iterator itDGE = itDG->begin(); itDGE != itDG->end(); itDGE++) {
134  result.push_back(DetWithState(itDGE->det(), itDGE->trajectoryState()));
135  }
136  }
137  return result;
138 }

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

◆ components()

const std::vector<const GeometricSearchDet*>& MuRingForwardDoubleLayer::components ( ) const
inlineoverride

Definition at line 31 of file MuRingForwardDoubleLayer.h.

31 { return theComponents; }

References theComponents.

◆ computeSurface()

BoundDisk * MuRingForwardDoubleLayer::computeSurface ( )
overrideprotected

Definition at line 51 of file MuRingForwardDoubleLayer.cc.

51  {
52  const BoundDisk& frontDisk = theFrontLayer.specificSurface();
53  const BoundDisk& backDisk = theBackLayer.specificSurface();
54 
55  float rmin = min(frontDisk.innerRadius(), backDisk.innerRadius());
56  float rmax = max(frontDisk.outerRadius(), backDisk.outerRadius());
57  float zmin = frontDisk.position().z();
58  float halfThickness = frontDisk.bounds().thickness() / 2.;
59  zmin = (zmin > 0) ? zmin - halfThickness : zmin + halfThickness;
60  float zmax = backDisk.position().z();
61  halfThickness = backDisk.bounds().thickness() / 2.;
62  zmax = (zmax > 0) ? zmax + halfThickness : zmax - halfThickness;
63  float zPos = (zmax + zmin) / 2.;
64  PositionType pos(0., 0., zPos);
66 
67  return new BoundDisk(pos, rot, new SimpleDiskBounds(rmin, rmax, zmin - zPos, zmax - zPos));
68 }

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

Referenced by MuRingForwardDoubleLayer().

◆ frontLayer()

const MuRingForwardLayer* MuRingForwardDoubleLayer::frontLayer ( ) const
inline

Definition at line 58 of file MuRingForwardDoubleLayer.h.

58 { return &theFrontLayer; }

References theFrontLayer.

◆ groupedCompatibleDets()

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

Definition at line 140 of file MuRingForwardDoubleLayer.cc.

142  {
143  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer";
144  vector<GeometricSearchDet::DetWithState> detWithStates1, detWithStates2;
145 
146  LogTrace(metname) << "groupedCompatibleDets are currently given always in inside-out order";
147  // this should be fixed either in RecoMuon/MeasurementDet/MuonDetLayerMeasurements or
148  // RecoMuon/DetLayers/MuRingForwardDoubleLayer
149  // and removed the reverse operation in StandAloneMuonFilter::findBestMeasurements
150 
151  detWithStates1 = theFrontLayer.compatibleDets(startingState, prop, est);
152  detWithStates2 = theBackLayer.compatibleDets(startingState, prop, est);
153 
154  vector<DetGroup> result;
155  if (!detWithStates1.empty())
156  result.push_back(DetGroup(detWithStates1));
157  if (!detWithStates2.empty())
158  result.push_back(DetGroup(detWithStates2));
159  LogTrace(metname) << "DoubleLayer Compatible dets: " << result.size();
160  return result;
161 }

References MuRingForwardLayer::compatibleDets(), LogTrace, metname, mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, theBackLayer, and theFrontLayer.

Referenced by compatibleDets().

◆ isCrack()

bool MuRingForwardDoubleLayer::isCrack ( const GlobalPoint gp) const

Definition at line 163 of file MuRingForwardDoubleLayer.cc.

163  {
164  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer";
165  // approximate
166  bool result = false;
167  double r = gp.perp();
168  const std::vector<const ForwardDetRing*>& backRings = theBackLayer.rings();
169  if (backRings.size() > 1) {
170  const MuDetRing* innerRing = dynamic_cast<const MuDetRing*>(backRings[0]);
171  const MuDetRing* outerRing = dynamic_cast<const MuDetRing*>(backRings[1]);
172  assert(innerRing && outerRing);
173  float crackInner = innerRing->specificSurface().outerRadius();
174  float crackOuter = outerRing->specificSurface().innerRadius();
175  LogTrace(metname) << "In a crack:" << crackInner << " " << r << " " << crackOuter;
176  if (r > crackInner && r < crackOuter)
177  return true;
178  }
179  // non-overlapping rings
180  //double phi = gp.phi().degrees();
181  return result;
182 }

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

◆ isInsideOut()

bool MuRingForwardDoubleLayer::isInsideOut ( const TrajectoryStateOnSurface tsos) const

◆ rings()

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

Return the vector of rings.

Definition at line 54 of file MuRingForwardDoubleLayer.h.

54 { return theRings; }

References theRings.

◆ selfTest()

void MuRingForwardDoubleLayer::selfTest ( ) const

Definition at line 184 of file MuRingForwardDoubleLayer.cc.

184  {
185  const std::vector<const GeomDet*>& frontDets = theFrontLayer.basicComponents();
186  const std::vector<const GeomDet*>& backDets = theBackLayer.basicComponents();
187 
188  std::vector<const GeomDet*>::const_iterator frontItr = frontDets.begin(), lastFront = frontDets.end(),
189  backItr = backDets.begin(), lastBack = backDets.end();
190 
191  // test that each front z is less than each back z
192  for (; frontItr != lastFront; ++frontItr) {
193  float frontz = fabs((**frontItr).surface().position().z());
194  for (; backItr != lastBack; ++backItr) {
195  float backz = fabs((**backItr).surface().position().z());
196  assert(frontz < backz);
197  }
198  }
199 }

References cms::cuda::assert(), MuRingForwardLayer::basicComponents(), theBackLayer, and theFrontLayer.

Referenced by MuRingForwardDoubleLayer().

◆ subDetector()

SubDetector MuRingForwardDoubleLayer::subDetector ( ) const
inlineoverride

Definition at line 49 of file MuRingForwardDoubleLayer.h.

49 { return theBackLayer.subDetector(); }

References MuRingForwardLayer::subDetector(), and theBackLayer.

Member Data Documentation

◆ theBackLayer

MuRingForwardLayer MuRingForwardDoubleLayer::theBackLayer
private

◆ theBasicComponents

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

Definition at line 71 of file MuRingForwardDoubleLayer.h.

Referenced by basicComponents(), and MuRingForwardDoubleLayer().

◆ theComponents

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

Definition at line 70 of file MuRingForwardDoubleLayer.h.

Referenced by components(), and MuRingForwardDoubleLayer().

◆ theFrontLayer

MuRingForwardLayer MuRingForwardDoubleLayer::theFrontLayer
private

◆ theRings

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

Definition at line 69 of file MuRingForwardDoubleLayer.h.

Referenced by MuRingForwardDoubleLayer(), and rings().

MuRingForwardDoubleLayer::theComponents
std::vector< const GeometricSearchDet * > theComponents
Definition: MuRingForwardDoubleLayer.h:70
ForwardDetRing::specificSurface
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
Definition: ForwardDetRing.h:27
align::RotationType
TkRotation< Scalar > RotationType
Definition: Definitions.h:27
LocalTrajectoryError::positionError
LocalError positionError() const
Definition: LocalTrajectoryError.h:81
min
T min(T a, T b)
Definition: MathUtil.h:58
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
pos
Definition: PixelAliasList.h:18
align::PositionType
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:28
cms::cuda::assert
assert(be >=bs)
MuRingForwardLayer::compatibleDets
std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
Definition: MuRingForwardLayer.cc:77
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
MuDetRing
Definition: MuDetRing.h:16
SiStripMonitorCluster_cfi.zmin
zmin
Definition: SiStripMonitorCluster_cfi.py:200
MuRingForwardDoubleLayer::isInsideOut
bool isInsideOut(const TrajectoryStateOnSurface &tsos) const
Definition: MuRingForwardDoubleLayer.cc:70
BoundDisk
MuRingForwardDoubleLayer::computeSurface
BoundDisk * computeSurface() override
Definition: MuRingForwardDoubleLayer.cc:51
MuRingForwardLayer::rings
virtual const std::vector< const ForwardDetRing * > & rings() const
Return the vector of rings.
Definition: MuRingForwardLayer.h:45
SimpleDiskBounds
Definition: SimpleDiskBounds.h:11
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
MuRingForwardLayer
Definition: MuRingForwardLayer.h:18
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
TrajectoryStateOnSurface::localDirection
LocalVector localDirection() const
Definition: TrajectoryStateOnSurface.h:76
TrajectoryStateOnSurface::hasError
bool hasError() const
Definition: TrajectoryStateOnSurface.h:56
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Basic3DVector::dot
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
Definition: extBasic3DVector.h:189
MuRingForwardDoubleLayer::theBasicComponents
std::vector< const GeomDet * > theBasicComponents
Definition: MuRingForwardDoubleLayer.h:71
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
TrajectoryStateOnSurface::localPosition
LocalPoint localPosition() const
Definition: TrajectoryStateOnSurface.h:74
RingedForwardLayer
ForwardDetLayer RingedForwardLayer
Definition: RingedForwardLayer.h:13
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
MuRingForwardDoubleLayer::theRings
std::vector< const ForwardDetRing * > theRings
Definition: MuRingForwardDoubleLayer.h:69
LocalError
Definition: LocalError.h:12
MuRingForwardLayer::subDetector
SubDetector subDetector() const override
Definition: MuRingForwardLayer.cc:184
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
MuRingForwardLayer::basicComponents
const std::vector< const GeomDet * > & basicComponents() const override
Definition: MuRingForwardLayer.h:27
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
DetWithState
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
Definition: RPCRecHitFilter.h:58
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
alignCSCRings.r
r
Definition: alignCSCRings.py:93
MuRingForwardDoubleLayer::basicComponents
const std::vector< const GeomDet * > & basicComponents() const override
Definition: MuRingForwardDoubleLayer.h:29
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
MuRingForwardDoubleLayer::theBackLayer
MuRingForwardLayer theBackLayer
Definition: MuRingForwardDoubleLayer.h:68
MuRingForwardDoubleLayer::selfTest
void selfTest() const
Definition: MuRingForwardDoubleLayer.cc:184
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
insideOut
Definition: NavigationDirection.h:4
DetGroup
Definition: DetGroup.h:41
MuRingForwardDoubleLayer::groupedCompatibleDets
std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
Definition: MuRingForwardDoubleLayer.cc:140
mps_fire.result
result
Definition: mps_fire.py:311
MuRingForwardDoubleLayer::theFrontLayer
MuRingForwardLayer theFrontLayer
Definition: MuRingForwardDoubleLayer.h:67
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
TrajectoryStateOnSurface::localError
const LocalTrajectoryError & localError() const
Definition: TrajectoryStateOnSurface.h:77
BoundDisk
Disk BoundDisk
Definition: BoundDisk.h:54
HLTSiStripMonitoring_cff.nSigma
nSigma
Definition: HLTSiStripMonitoring_cff.py:151
MuRingForwardDoubleLayer::compatible
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
Definition: MuRingForwardDoubleLayer.cc:74
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40