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 ForwardDetLayer DetLayer GeometricSearchDet

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
 Returns basic components, if any. More...
 
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual bool hasGroups () 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
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
virtual ~MuRingForwardLayer ()
 
- Public Member Functions inherited from RingedForwardLayer
 RingedForwardLayer ()
 
virtual ~RingedForwardLayer ()
 
- Public Member Functions inherited from ForwardDetLayer
virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
 
bool contains (const Local3DPoint &p) const
 
 ForwardDetLayer ()
 
virtual Location location () const GCC11_FINAL
 Which part of the detector (barrel, endcap) More...
 
virtual const BoundDiskspecificSurface () const GCC11_FINAL
 
virtual const BoundSurfacesurface () const GCC11_FINAL
 The surface of the GeometricSearchDet. More...
 
virtual ~ForwardDetLayer ()
 
- Public Member Functions inherited from DetLayer
template<typename... Args>
std::vector< const DetLayer * > compatibleLayers (Args &&...args) const
 Returns all layers compatible. More...
 
 DetLayer (bool ibar)
 
bool isBarrel () const
 
bool isForward () const
 
NavigableLayernavigableLayer () const
 Return the NavigableLayer associated with this DetLayer. More...
 
template<typename... Args>
std::vector< const DetLayer * > nextLayers (Args &&...args) const
 
int seqNum () const
 
void setNavigableLayer (NavigableLayer *nlp)
 Set the NavigableLayer associated with this DetLayer. More...
 
void setSeqNum (int sq)
 
virtual ~DetLayer ()
 
- Public Member Functions inherited from GeometricSearchDet
virtual void compatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
 
 GeometricSearchDet ()
 
virtual void groupedCompatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
 
virtual const
Surface::PositionType
position () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from DetLayer
typedef
GeomDetEnumerators::Location 
Location
 
typedef
GeomDetEnumerators::SubDetector 
SubDetector
 
- Public Types inherited from GeometricSearchDet
typedef std::pair< const
GeomDet
*, TrajectoryStateOnSurface
DetWithState
 
typedef BoundSurface::PositionType PositionType
 
typedef BoundSurface::RotationType RotationType
 
typedef TrajectoryStateOnSurface TrajectoryState
 
- Protected Member Functions inherited from ForwardDetLayer
virtual BoundDiskcomputeSurface ()
 
virtual void initialize ()
 
float rmax () const
 
float rmin () const
 
void setSurface (BoundDisk *cp)
 
float zmax () const
 
float zmin () const
 
- Protected Attributes inherited from GeometricSearchDet
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

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

Date:
2007/06/14 17:22:41
Revision:
1.9
Author
N. Amapane - INFN Torino

Definition at line 20 of file MuRingForwardLayer.h.

Constructor & Destructor Documentation

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

Constructor, takes ownership of pointers.

Definition at line 26 of file MuRingForwardLayer.cc.

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

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

Definition at line 83 of file MuRingForwardLayer.cc.

References i, theBinFinder, and theRings.

83  {
84  delete theBinFinder;
85  for (vector <const ForwardDetRing*>::iterator i = theRings.begin();
86  i<theRings.end(); i++) {delete *i;}
87 }
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

Implements GeometricSearchDet.

Definition at line 32 of file MuRingForwardLayer.h.

References theBasicComps.

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

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

Returns all Dets compatible with a trajectory state according to the estimator est. The startingState should be propagated to the surface of each compatible Det using the Propagator passed as an argument. The default implementation should be overridden in dets with specific surface types to avoid propagation to a generic Surface

Reimplemented from GeometricSearchDet.

Definition at line 91 of file MuRingForwardLayer.cc.

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

Referenced by MuRingForwardDoubleLayer::groupedCompatibleDets().

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

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 228 of file MuRingForwardLayer.cc.

References theComponents.

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

Similar to compatibleDets(), but the compatible Dets are grouped in one or more groups. Dets are put in the same group if they are mutually exclusive for track crossing, i.e. a reconstructible track cannot cross more than one Det from a group. Pathological tracks (spirals etc.) can of course violate this rule.
The DetGroups are sorted in the sequence of crossing by a track. In order to define the direction of crossing the Propagator used in this method should have a defined direction() : either "alongMomentum" or "oppositeToMomentum" but not "anyDirection".
The three signatures of this method differ by the input trajectory state arguments: the starting state can be a TrajectoryStateOnSurface or a FreeTrajectoryState, and the state on this CompositeDet may be already known or not. The last two arguments are as for the method compatibleDets().
First signature: The first argument is a TrajectoryStateOnSurface, usually not on the surface of this CompositeDet.

Reimplemented from GeometricSearchDet.

Definition at line 208 of file MuRingForwardLayer.cc.

References gather_cfg::cout.

210  {
211  // FIXME should return only 1 group
212  cout << "dummy implementation of MuRingForwardLayer::groupedCompatibleDets()" << endl;
213  return vector<DetGroup>();
214 }
tuple cout
Definition: gather_cfg.py:121
bool MuRingForwardLayer::hasGroups ( ) const
virtual

Implements GeometricSearchDet.

Definition at line 217 of file MuRingForwardLayer.cc.

217  {
218  // FIXME : depending on isOverlapping?
219  return false;
220 }
virtual const std::vector<const ForwardDetRing*>& MuRingForwardLayer::rings ( ) const
inlinevirtual

Return the vector of rings.

Definition at line 57 of file MuRingForwardLayer.h.

References theRings.

Referenced by MuRingForwardDoubleLayer::isCrack().

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

The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)

Implements DetLayer.

Definition at line 223 of file MuRingForwardLayer.cc.

References theBasicComps.

Referenced by MuRingForwardDoubleLayer::subDetector().

223  {
224  return theBasicComps.front()->subDetector();
225 }
std::vector< const GeomDet * > theBasicComps

Member Data Documentation

bool MuRingForwardLayer::isOverlapping
private

Definition at line 65 of file MuRingForwardLayer.h.

Referenced by MuRingForwardLayer().

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

Definition at line 63 of file MuRingForwardLayer.h.

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

BaseBinFinder<double>* MuRingForwardLayer::theBinFinder
private

Definition at line 64 of file MuRingForwardLayer.h.

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

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

Definition at line 62 of file MuRingForwardLayer.h.

Referenced by components().

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