CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
MuRingForwardLayer Class Reference

#include <MuRingForwardLayer.h>

Inheritance diagram for MuRingForwardLayer:
RingedForwardLayer

Public Member Functions

virtual const std::vector
< const GeomDet * > & 
basicComponents () const
 
virtual std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual const std::vector
< const GeometricSearchDet * > & 
components () const
 
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
 MuRingForwardLayer (const std::vector< const ForwardDetRing * > &rings)
 Constructor, takes ownership of pointers. More...
 
virtual const std::vector
< const ForwardDetRing * > & 
rings () const
 Return the vector of rings. More...
 
virtual SubDetector subDetector () const
 
virtual ~MuRingForwardLayer ()
 

Private Attributes

bool isOverlapping
 
std::vector< const GeomDet * > theBasicComps
 
BaseBinFinder< double > * theBinFinder
 
std::vector< const
GeometricSearchDet * > 
theComponents
 
std::vector< const
ForwardDetRing * > 
theRings
 

Detailed Description

A plane composed of disks (MuRingForwardDisk). Represents forward muon CSC/RPC stations.

Author
N. Amapane - INFN Torino

Definition at line 18 of file MuRingForwardLayer.h.

Constructor & Destructor Documentation

MuRingForwardLayer::MuRingForwardLayer ( const std::vector< const ForwardDetRing * > &  rings)

Constructor, takes ownership of pointers.

Definition at line 24 of file MuRingForwardLayer.cc.

References basicComponents(), isOverlapping, RBorderFinder::isROverlapping(), RBorderFinder::isRPeriodic(), LogTrace, max(), metname, bookConverter::min, makeMuonMisalignmentScenario::rot, AlCaHLTBitMon_QueryRunRegistry::string, theBasicComps, theBinFinder, theRings, and zPos.

24  :
25  RingedForwardLayer(false),
26  theRings(rings),
27  theComponents(theRings.begin(),theRings.end()),
28  theBinFinder(0),
29  isOverlapping(false)
30 {
31 
32  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardLayer";
33 
34  // Initial values for R and Z bounds
35  float theRmin = rings.front()->basicComponents().front()->position().perp();
36  float theRmax = theRmin;
37  float theZmin = rings.front()->position().z();
38  float theZmax = theZmin;
39 
40  // Cache chamber pointers (the basic components_)
41  // and find extension in R and Z
42  for (vector<const ForwardDetRing*>::const_iterator it=rings.begin();
43  it!=rings.end(); it++) {
44  vector<const GeomDet*> tmp2 = (*it)->basicComponents();
45  theBasicComps.insert(theBasicComps.end(),tmp2.begin(),tmp2.end());
46 
47  theRmin = min( theRmin, (*it)->specificSurface().innerRadius());
48  theRmax = max( theRmax, (*it)->specificSurface().outerRadius());
49  float halfThick = (*it)->surface().bounds().thickness()/2.;
50  float zCenter = (*it)->surface().position().z();
51  theZmin = min( theZmin, zCenter-halfThick);
52  theZmax = max( theZmax, zCenter+halfThick);
53  }
54 
56  isOverlapping = bf.isROverlapping();
58 
59  // Build surface
60 
61  float zPos = (theZmax+theZmin)/2.;
62  PositionType pos(0.,0.,zPos);
64 
65  setSurface(new BoundDisk( pos, rot,
66  new SimpleDiskBounds( theRmin, theRmax,
67  theZmin-zPos, theZmax-zPos)));
68 
69 
70 
71  LogTrace(metname) << "Constructing MuRingForwardLayer: "
72  << basicComponents().size() << " Dets "
73  << theRings.size() << " Rings "
74  << " Z: " << specificSurface().position().z()
75  << " R1: " << specificSurface().innerRadius()
76  << " R2: " << specificSurface().outerRadius()
77  << " Per.: " << bf.isRPeriodic()
78  << " Overl.: " << bf.isROverlapping();
79 }
TkRotation< Scalar > RotationType
Definition: Definitions.h:29
ForwardDetLayer RingedForwardLayer
const std::string metname
double zPos
std::vector< const ForwardDetRing * > theRings
Point3DBase< Scalar, GlobalTag > PositionType
Definition: Definitions.h:30
virtual const std::vector< const ForwardDetRing * > & rings() const
Return the vector of rings.
const T & max(const T &a, const T &b)
#define LogTrace(id)
std::vector< const GeometricSearchDet * > theComponents
virtual const std::vector< const GeomDet * > & basicComponents() const
BaseBinFinder< double > * theBinFinder
Disk BoundDisk
Definition: BoundDisk.h:62
std::vector< const GeomDet * > theBasicComps
MuRingForwardLayer::~MuRingForwardLayer ( )
virtual

Definition at line 82 of file MuRingForwardLayer.cc.

References i, theBinFinder, and theRings.

82  {
83  delete theBinFinder;
84  for (vector <const ForwardDetRing*>::iterator i = theRings.begin();
85  i<theRings.end(); i++) {delete *i;}
86 }
int i
Definition: DBlmapReader.cc:9
std::vector< const ForwardDetRing * > theRings
BaseBinFinder< double > * theBinFinder

Member Function Documentation

virtual const std::vector<const GeomDet*>& MuRingForwardLayer::basicComponents ( ) const
inlinevirtual

Definition at line 30 of file MuRingForwardLayer.h.

References theBasicComps.

Referenced by MuRingForwardLayer(), and MuRingForwardDoubleLayer::selfTest().

30 {return theBasicComps;}
std::vector< const GeomDet * > theBasicComps
vector< GeometricSearchDet::DetWithState > MuRingForwardLayer::compatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
virtual

Definition at line 90 of file MuRingForwardLayer.cc.

References BaseBinFinder< T >::binIndex(), GeometricSearchDet::compatibleDets(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::localError(), LogTrace, metname, PV3DBase< T, PVType, FrameType >::perp(), LocalTrajectoryError::positionError(), query::result, ForwardDetRing::specificSurface(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, theBinFinder, theRings, toLocal(), LocalError::xx(), and LocalError::yy().

Referenced by MuRingForwardDoubleLayer::groupedCompatibleDets().

92  {
93 
94  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRingForwardLayer";
95  vector<DetWithState> result;
96 
97 
98  LogTrace(metname) << "MuRingForwardLayer::compatibleDets,"
99  << " R1 " << specificSurface().innerRadius()
100  << " R2: " << specificSurface().outerRadius()
101  << " FTS at R: " << startingState.globalPosition().perp();
102 
103  pair<bool, TrajectoryStateOnSurface> compat =
104  compatible(startingState, prop, est);
105 
106  if (!compat.first) {
107 
108  LogTrace(metname) << " MuRingForwardLayer::compatibleDets: not compatible"
109  << " (should not have been selected!)";
110  return result;
111  }
112 
113 
114  TrajectoryStateOnSurface& tsos = compat.second;
115 
116  int closest = theBinFinder->binIndex(tsos.globalPosition().perp());
117  const ForwardDetRing* closestRing = theRings[closest];
118 
119  // Check the closest ring
120 
121  LogTrace(metname) << " MuRingForwardLayer::fastCompatibleDets, closestRing: "
122  << closest
123  << " R1 " << closestRing->specificSurface().innerRadius()
124  << " R2: " << closestRing->specificSurface().outerRadius()
125  << " FTS R: " << tsos.globalPosition().perp();
126  if (tsos.hasError()) {
127  LogTrace(metname) << " sR: " << sqrt(tsos.localError().positionError().yy())
128  << " sX: " << sqrt(tsos.localError().positionError().xx());
129  }
130  LogTrace(metname) << endl;
131 
132 
133  result = closestRing->compatibleDets(tsos, prop, est);
134 
135  int nclosest = result.size(); int nnextdet=0; // MDEBUG counters
136 
137  //FIXME: if closest is not compatible next cannot be either?
138 
139  // Use state on layer surface. Note that local coordinates and errors
140  // are the same on the layer and on all rings surfaces, since
141  // all BoundDisks are centered in 0,0 and have the same rotation.
142  // CAVEAT: if the rings are not at the same Z, the local position and error
143  // will be "Z-projected" to the rings. This is a fairly good approximation.
144  // However in this case additional propagation will be done when calling
145  // compatibleDets.
146  GlobalPoint startPos = tsos.globalPosition();
147  LocalPoint nextPos(surface().toLocal(startPos));
148 
149  for (unsigned int idet=closest+1; idet < theRings.size(); idet++) {
150  bool inside = false;
151  if (tsos.hasError()) {
152  inside=theRings[idet]->specificSurface().bounds().inside(nextPos,tsos.localError().positionError());
153  } else {
154  inside=theRings[idet]->specificSurface().bounds().inside(nextPos);
155  }
156  if (inside){
157  LogTrace(metname) << " MuRingForwardLayer::fastCompatibleDets:NextRing" << idet
158  << " R1 " << theRings[idet]->specificSurface().innerRadius()
159  << " R2: " << theRings[idet]->specificSurface().outerRadius()
160  << " FTS R " << nextPos.perp();
161  nnextdet++;
162  vector<DetWithState> nextRodDets =
163  theRings[idet]->compatibleDets(tsos, prop, est);
164  if (nextRodDets.size()!=0) {
165  result.insert( result.end(),
166  nextRodDets.begin(), nextRodDets.end());
167  } else {
168  break;
169  }
170  }
171  }
172 
173  for (int idet=closest-1; idet >= 0; idet--) {
174  bool inside = false;
175  if (tsos.hasError()) {
176  inside=theRings[idet]->specificSurface().bounds().inside(nextPos,tsos.localError().positionError());
177  } else {
178  inside=theRings[idet]->specificSurface().bounds().inside(nextPos);
179  }
180  if (inside){
181  LogTrace(metname) << " MuRingForwardLayer::fastCompatibleDets:PreviousRing:" << idet
182  << " R1 " << theRings[idet]->specificSurface().innerRadius()
183  << " R2: " << theRings[idet]->specificSurface().outerRadius()
184  << " FTS R " << nextPos.perp();
185  nnextdet++;
186  vector<DetWithState> nextRodDets =
187  theRings[idet]->compatibleDets(tsos, prop, est);
188  if (nextRodDets.size()!=0) {
189  result.insert( result.end(),
190  nextRodDets.begin(), nextRodDets.end());
191  } else {
192  break;
193  }
194  }
195  }
196 
197  LogTrace(metname) << " MuRingForwardLayer::fastCompatibleDets: found: "
198  << result.size()
199  << " on closest: " << nclosest
200  << " # checked rings: " << 1 + nnextdet;
201 
202  return result;
203 }
float xx() const
Definition: LocalError.h:24
T perp() const
Definition: PV3DBase.h:72
const std::string metname
virtual int binIndex(T pos) const =0
Return the index of bin at given position.
GlobalPoint globalPosition() const
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
std::vector< const ForwardDetRing * > theRings
LocalError positionError() const
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:48
tuple result
Definition: query.py:137
const LocalTrajectoryError & localError() const
#define LogTrace(id)
BaseBinFinder< double > * theBinFinder
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
const vector< const GeometricSearchDet * > & MuRingForwardLayer::components ( ) const
virtual

Definition at line 222 of file MuRingForwardLayer.cc.

References theComponents.

222  {
223  return theComponents;
224 }
std::vector< const GeometricSearchDet * > theComponents
vector< DetGroup > MuRingForwardLayer::groupedCompatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
virtual

Definition at line 207 of file MuRingForwardLayer.cc.

References gather_cfg::cout.

209  {
210  // FIXME should return only 1 group
211  cout << "dummy implementation of MuRingForwardLayer::groupedCompatibleDets()" << endl;
212  return vector<DetGroup>();
213 }
tuple cout
Definition: gather_cfg.py:121
virtual const std::vector<const ForwardDetRing*>& MuRingForwardLayer::rings ( ) const
inlinevirtual

Return the vector of rings.

Definition at line 53 of file MuRingForwardLayer.h.

References theRings.

Referenced by MuRingForwardDoubleLayer::isCrack().

53 {return theRings;}
std::vector< const ForwardDetRing * > theRings
GeomDetEnumerators::SubDetector MuRingForwardLayer::subDetector ( ) const
virtual

Definition at line 217 of file MuRingForwardLayer.cc.

References theBasicComps.

Referenced by MuRingForwardDoubleLayer::subDetector().

217  {
218  return theBasicComps.front()->subDetector();
219 }
std::vector< const GeomDet * > theBasicComps

Member Data Documentation

bool MuRingForwardLayer::isOverlapping
private

Definition at line 61 of file MuRingForwardLayer.h.

Referenced by MuRingForwardLayer().

std::vector<const GeomDet*> MuRingForwardLayer::theBasicComps
private

Definition at line 59 of file MuRingForwardLayer.h.

Referenced by basicComponents(), MuRingForwardLayer(), and subDetector().

BaseBinFinder<double>* MuRingForwardLayer::theBinFinder
private

Definition at line 60 of file MuRingForwardLayer.h.

Referenced by compatibleDets(), MuRingForwardLayer(), and ~MuRingForwardLayer().

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

Definition at line 58 of file MuRingForwardLayer.h.

Referenced by components().

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