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.

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, ForwardDetLayer::setSurface(), ForwardDetLayer::specificSurface(), AlCaHLTBitMon_QueryRunRegistry::string, theBasicComps, theBinFinder, theRings, and zPos.

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

Definition at line 81 of file MuRingForwardLayer.cc.

References i, theBinFinder, and theRings.

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

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

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

References theComponents.

226  {
227  return theComponents;
228 }
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 206 of file MuRingForwardLayer.cc.

References gather_cfg::cout.

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

Implements GeometricSearchDet.

Definition at line 215 of file MuRingForwardLayer.cc.

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

Return the vector of rings.

Definition at line 55 of file MuRingForwardLayer.h.

References theRings.

Referenced by MuRingForwardDoubleLayer::isCrack().

55 {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 221 of file MuRingForwardLayer.cc.

References theBasicComps.

Referenced by MuRingForwardDoubleLayer::subDetector().

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

Member Data Documentation

bool MuRingForwardLayer::isOverlapping
private

Definition at line 63 of file MuRingForwardLayer.h.

Referenced by MuRingForwardLayer().

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

Definition at line 61 of file MuRingForwardLayer.h.

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

BaseBinFinder<double>* MuRingForwardLayer::theBinFinder
private

Definition at line 62 of file MuRingForwardLayer.h.

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

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

Definition at line 60 of file MuRingForwardLayer.h.

Referenced by components().

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