CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
virtual const std::vector
< const GeomDet * > & 
basicComponents () const
 
virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
 
virtual std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual const std::vector
< const GeometricSearchDet * > & 
components () const
 
const MuRingForwardLayerfrontLayer () const
 
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
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
 
virtual SubDetector subDetector () const
 
virtual ~MuRingForwardDoubleLayer ()
 

Protected Member Functions

virtual BoundDiskcomputeSurface ()
 

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
virtual const std::vector< const GeomDet * > & basicComponents() const
std::vector< const GeomDet * > theBasicComponents
std::vector< const ForwardDetRing * > theRings
#define LogTrace(id)
virtual BoundDisk * computeSurface()
std::vector< const GeometricSearchDet * > theComponents
virtual MuRingForwardDoubleLayer::~MuRingForwardDoubleLayer ( )
inlinevirtual

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

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

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
virtual

Definition at line 88 of file MuRingForwardDoubleLayer.cc.

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

Referenced by compatibleDets().

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
double zPos
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:48
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const LocalTrajectoryError & localError() const
#define LogTrace(id)
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:56
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
virtual

Definition at line 133 of file MuRingForwardDoubleLayer.cc.

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

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 }
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
const std::string metname
virtual std::vector< DetGroup > groupedCompatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
tuple result
Definition: query.py:137
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
#define LogTrace(id)
virtual const std::vector<const GeometricSearchDet*>& MuRingForwardDoubleLayer::components ( ) const
inlinevirtual

Definition at line 34 of file MuRingForwardDoubleLayer.h.

References theComponents.

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

Definition at line 57 of file MuRingForwardDoubleLayer.cc.

References max(), bookConverter::min, makeMuonMisalignmentScenario::rot, theBackLayer, theFrontLayer, SiStripMonitorClusterAlca_cfi::zmax, SiStripMonitorClusterAlca_cfi::zmin, and zPos.

Referenced by 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
double zPos
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:30
const T & max(const T &a, const T &b)
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
virtual

Definition at line 168 of file MuRingForwardDoubleLayer.cc.

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

Referenced by compatibleDets().

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
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
tuple result
Definition: query.py:137
#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, query::result, MuRingForwardLayer::rings(), ForwardDetRing::specificSurface(), AlCaHLTBitMon_QueryRunRegistry::string, and theBackLayer.

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.
tuple result
Definition: query.py:137
#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().

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 &quot;dot&quot; 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 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 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 }
virtual const std::vector< const GeomDet * > & basicComponents() const
virtual SubDetector MuRingForwardDoubleLayer::subDetector ( ) const
inlinevirtual

Definition at line 55 of file MuRingForwardDoubleLayer.h.

References MuRingForwardLayer::subDetector(), and theBackLayer.

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

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