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

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

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

Definition at line 27 of file MuRingForwardDoubleLayer.h.

27 {}

Member Function Documentation

const MuRingForwardLayer* MuRingForwardDoubleLayer::backLayer ( ) const
inline

Definition at line 66 of file MuRingForwardDoubleLayer.h.

References computeSurface(), selfTest(), and theBackLayer.

66 {return &theBackLayer;}
const std::vector<const GeomDet*>& MuRingForwardDoubleLayer::basicComponents ( ) const
inlineoverride

Definition at line 32 of file MuRingForwardDoubleLayer.h.

References theBasicComponents.

Referenced by MuRingForwardDoubleLayer().

32 {return theBasicComponents;}
std::vector< const GeomDet * > theBasicComponents
std::pair< bool, TrajectoryStateOnSurface > MuRingForwardDoubleLayer::compatible ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 88 of file MuRingForwardDoubleLayer.cc.

References boostedElectronIsolation_cff::deltaR, TrajectoryStateOnSurface::hasError(), SimpleDiskBounds::inside(), insideOut, isInsideOut(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localPosition(), LogTrace, metname, gsfElectronCkfTrackCandidateMaker_cff::nSigma, LocalTrajectoryError::positionError(), Propagator::propagate(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, funct::tan(), theBackLayer, theFrontLayer, PV3DBase< T, PVType, FrameType >::theta(), tmp, LocalError::xx(), and LocalError::yy().

Referenced by compatibleDets(), and components().

90 {
91  // mostly copied from ForwardDetLayer, except propagates to closest surface,
92  // not to center
93  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer";
94 
95  bool insideOut = isInsideOut(startingState);
96  const MuRingForwardLayer & closerLayer = (insideOut) ? theFrontLayer : theBackLayer;
97  LogTrace("Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer")
98  << "MuRingForwardDoubleLayer::compatible is assuming inside-out direction: "<< insideOut;
99 
100 
101  //std::pair<bool, TrajectoryStateOnSurface> result
102  // = closerLayer.compatible(startingState, prop, est);
103  //if(!result.first)
104  // {
105  // result = furtherLayer.compatible(startingState, prop, est);
106  //}
107 
108 
109  TrajectoryStateOnSurface myState = prop.propagate( startingState, closerLayer.specificSurface());
110  if ( !myState.isValid()) return make_pair( false, myState);
111 
112  // take into account the thickness of the layer
113  float deltaR = surface().bounds().thickness()/2. *
114  fabs( tan( myState.localDirection().theta()));
115 
116  // take into account the error on the predicted state
117  const float nSigma = 3.;
118  if (myState.hasError()) {
119  LocalError err = myState.localError().positionError();
120  // ignore correlation for the moment...
121  deltaR += nSigma * sqrt(err.xx() + err.yy());
122  }
123 
124  float zPos = (zmax()+zmin())/2.;
125  SimpleDiskBounds tmp( rmin()-deltaR, rmax()+deltaR,
126  zmin()-zPos, zmax()-zPos);
127 
128  return make_pair( tmp.inside(myState.localPosition()), myState);
129 }
float xx() const
Definition: LocalError.h:24
const std::string metname
LocalVector localDirection() const
LocalError positionError() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const LocalTrajectoryError & localError() const
#define LogTrace(id)
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:53
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool isInsideOut(const TrajectoryStateOnSurface &tsos) const
vector< GeometricSearchDet::DetWithState > MuRingForwardDoubleLayer::compatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 133 of file MuRingForwardDoubleLayer.cc.

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

Referenced by components().

135  {
136  vector<DetWithState> result;
137  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer";
138  pair<bool, TrajectoryStateOnSurface> compat =
139  compatible(startingState, prop, est);
140 
141  if (!compat.first) {
142 
143  LogTrace(metname) << " MuRingForwardDoubleLayer::compatibleDets: not compatible"
144  << " (should not have been selected!)";
145  return result;
146  }
147 
148 
149  TrajectoryStateOnSurface& tsos = compat.second;
150 
151  // standard implementation of compatibleDets() for class which have
152  // groupedCompatibleDets implemented.
153  // This code should be moved in a common place intead of being
154  // copied many times.
155  vector<DetGroup> vectorGroups = groupedCompatibleDets(tsos,prop,est);
156  for(vector<DetGroup>::const_iterator itDG=vectorGroups.begin();
157  itDG!=vectorGroups.end();itDG++){
158  for(vector<DetGroupElement>::const_iterator itDGE=itDG->begin();
159  itDGE!=itDG->end();itDGE++){
160  result.push_back(DetWithState(itDGE->det(),itDGE->trajectoryState()));
161  }
162  }
163  return result;
164 }
const std::string metname
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
#define LogTrace(id)
const std::vector<const GeometricSearchDet*>& MuRingForwardDoubleLayer::components ( ) const
inlineoverride

Definition at line 34 of file MuRingForwardDoubleLayer.h.

References compatible(), compatibleDets(), groupedCompatibleDets(), isInsideOut(), and theComponents.

34 {return theComponents;}
std::vector< const GeometricSearchDet * > theComponents
BoundDisk * MuRingForwardDoubleLayer::computeSurface ( )
overrideprotected

Definition at line 57 of file MuRingForwardDoubleLayer.cc.

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

Referenced by backLayer(), and MuRingForwardDoubleLayer().

58 {
59  const BoundDisk & frontDisk = theFrontLayer.specificSurface();
60  const BoundDisk & backDisk = theBackLayer.specificSurface();
61 
62  float rmin = min( frontDisk.innerRadius(), backDisk.innerRadius() );
63  float rmax = max( frontDisk.outerRadius(), backDisk.outerRadius() );
64  float zmin = frontDisk.position().z();
65  float halfThickness = frontDisk.bounds().thickness()/2.;
66  zmin = (zmin > 0) ? zmin-halfThickness : zmin+halfThickness;
67  float zmax = backDisk.position().z();
68  halfThickness = backDisk.bounds().thickness()/2.;
69  zmax = (zmax > 0) ? zmax+halfThickness : zmax-halfThickness;
70  float zPos = (zmax+zmin)/2.;
71  PositionType pos(0.,0.,zPos);
73 
74  return new BoundDisk( pos, rot,
75  new SimpleDiskBounds( rmin, rmax,
76  zmin-zPos, zmax-zPos));
77 }
TkRotation< Scalar > RotationType
Definition: Definitions.h:29
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:30
T min(T a, T b)
Definition: MathUtil.h:58
Disk BoundDisk
Definition: BoundDisk.h:62
const MuRingForwardLayer* MuRingForwardDoubleLayer::frontLayer ( ) const
inline

Definition at line 65 of file MuRingForwardDoubleLayer.h.

References theFrontLayer.

65 {return &theFrontLayer;}
vector< DetGroup > MuRingForwardDoubleLayer::groupedCompatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
override

Definition at line 168 of file MuRingForwardDoubleLayer.cc.

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

Referenced by compatibleDets(), and components().

170  {
171 
172  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer";
173  vector<GeometricSearchDet::DetWithState> detWithStates1, detWithStates2;
174 
175  LogTrace(metname) << "groupedCompatibleDets are currently given always in inside-out order";
176  // this should be fixed either in RecoMuon/MeasurementDet/MuonDetLayerMeasurements or
177  // RecoMuon/DetLayers/MuRingForwardDoubleLayer
178  // and removed the reverse operation in StandAloneMuonFilter::findBestMeasurements
179 
180  detWithStates1 = theFrontLayer.compatibleDets(startingState, prop, est);
181  detWithStates2 = theBackLayer.compatibleDets(startingState, prop, est);
182 
183  vector<DetGroup> result;
184  if(!detWithStates1.empty()) result.push_back( DetGroup(detWithStates1) );
185  if(!detWithStates2.empty()) result.push_back( DetGroup(detWithStates2) );
186  LogTrace(metname) << "DoubleLayer Compatible dets: " << result.size();
187  return result;
188 }
const std::string metname
std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
#define LogTrace(id)
bool MuRingForwardDoubleLayer::isCrack ( const GlobalPoint gp) const

Definition at line 191 of file MuRingForwardDoubleLayer.cc.

References LogTrace, metname, PV3DBase< T, PVType, FrameType >::perp(), alignCSCRings::r, mps_fire::result, MuRingForwardLayer::rings(), ForwardDetRing::specificSurface(), AlCaHLTBitMon_QueryRunRegistry::string, and theBackLayer.

Referenced by rings().

192 {
193  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardDoubleLayer";
194  // approximate
195  bool result = false;
196  double r = gp.perp();
197  const std::vector<const ForwardDetRing*>& backRings = theBackLayer.rings();
198  if(backRings.size() > 1)
199  {
200  const MuDetRing * innerRing = dynamic_cast<const MuDetRing *>(backRings[0]);
201  const MuDetRing * outerRing = dynamic_cast<const MuDetRing *>(backRings[1]);
202  assert(innerRing && outerRing);
203  float crackInner = innerRing->specificSurface().outerRadius();
204  float crackOuter = outerRing->specificSurface().innerRadius();
205  LogTrace(metname) << "In a crack:" << crackInner << " " << r << " " << crackOuter;
206  if(r > crackInner && r < crackOuter) return true;
207  }
208  // non-overlapping rings
209  //double phi = gp.phi().degrees();
210  return result;
211 }
T perp() const
Definition: PV3DBase.h:72
const std::string metname
virtual const std::vector< const ForwardDetRing * > & rings() const
Return the vector of rings.
#define LogTrace(id)
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
bool MuRingForwardDoubleLayer::isInsideOut ( const TrajectoryStateOnSurface tsos) const

Definition at line 80 of file MuRingForwardDoubleLayer.cc.

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

Referenced by compatible(), and components().

81 {
82  return tsos.globalPosition().basicVector().dot(tsos.globalMomentum().basicVector()) > 0;
83 }
GlobalPoint globalPosition() const
GlobalVector globalMomentum() const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
T dot(const Basic3DVector &rh) const
Scalar product, or "dot" product, with a vector of same type.
virtual const std::vector<const ForwardDetRing*>& MuRingForwardDoubleLayer::rings ( ) const
inlinevirtual

Return the vector of rings.

Definition at line 61 of file MuRingForwardDoubleLayer.h.

References runTauDisplay::gp, isCrack(), and theRings.

61 {return theRings;}
std::vector< const ForwardDetRing * > theRings
void MuRingForwardDoubleLayer::selfTest ( ) const

Definition at line 214 of file MuRingForwardDoubleLayer.cc.

References MuRingForwardLayer::basicComponents(), theBackLayer, and theFrontLayer.

Referenced by backLayer(), and MuRingForwardDoubleLayer().

215 {
216  const std::vector<const GeomDet*>& frontDets = theFrontLayer.basicComponents();
217  const std::vector<const GeomDet*>& backDets = theBackLayer.basicComponents();
218 
219  std::vector<const GeomDet*>::const_iterator frontItr = frontDets.begin(),
220  lastFront = frontDets.end(),
221  backItr = backDets.begin(),
222  lastBack = backDets.end();
223 
224  // test that each front z is less than each back z
225  for( ; frontItr != lastFront; ++frontItr)
226  {
227  float frontz = fabs( (**frontItr).surface().position().z() );
228  for( ; backItr != lastBack; ++backItr)
229  {
230  float backz = fabs( (**backItr).surface().position().z() );
231  assert(frontz < backz);
232  }
233  }
234 }
const std::vector< const GeomDet * > & basicComponents() const override
SubDetector MuRingForwardDoubleLayer::subDetector ( ) const
inlineoverride

Definition at line 55 of file MuRingForwardDoubleLayer.h.

References MuRingForwardLayer::subDetector(), and theBackLayer.

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

Member Data Documentation

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

Definition at line 76 of file MuRingForwardDoubleLayer.h.

Referenced by basicComponents(), and MuRingForwardDoubleLayer().

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

Definition at line 75 of file MuRingForwardDoubleLayer.h.

Referenced by components(), and MuRingForwardDoubleLayer().

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

Definition at line 74 of file MuRingForwardDoubleLayer.h.

Referenced by MuRingForwardDoubleLayer(), and rings().