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 Member Functions | Private Attributes
MuRodBarrelLayer Class Reference

#include <MuRodBarrelLayer.h>

Inheritance diagram for MuRodBarrelLayer:
RodBarrelLayer BarrelDetLayer 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
 
 MuRodBarrelLayer (std::vector< const DetRod * > &rods)
 Constructor, takes ownership of pointers. More...
 
virtual const std::vector
< const DetRod * > & 
rods () const
 Return the vector of rods. More...
 
virtual SubDetector subDetector () const
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
virtual ~MuRodBarrelLayer ()
 
- Public Member Functions inherited from RodBarrelLayer
 RodBarrelLayer ()
 
virtual ~RodBarrelLayer ()
 
- Public Member Functions inherited from BarrelDetLayer
 BarrelDetLayer ()
 
virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const GCC11_FINAL
 
bool contains (const Local3DPoint &p) const
 
virtual Location location () const GCC11_FINAL
 DetLayer interface. More...
 
virtual const BoundCylinderspecificSurface () const GCC11_FINAL
 Extension of the interface. More...
 
virtual const BoundSurfacesurface () const GCC11_FINAL
 GeometricSearchDet interface. More...
 
virtual ~BarrelDetLayer ()
 
- 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 Member Functions

float xError (const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
 

Private Attributes

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

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 BarrelDetLayer
virtual BoundCylindercomputeSurface ()
 
virtual void initialize ()
 
void setSurface (BoundCylinder *cp)
 
- Protected Attributes inherited from GeometricSearchDet
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A cylinder composed of rods. Represents barrel muon DT/RPC stations.

Date:
2006/07/25 17:10:27
Revision:
1.8
Author
N. Amapane - INFN Torino

Definition at line 19 of file MuRodBarrelLayer.h.

Constructor & Destructor Documentation

MuRodBarrelLayer::MuRodBarrelLayer ( std::vector< const DetRod * > &  rods)

Constructor, takes ownership of pointers.

Definition at line 28 of file MuRodBarrelLayer.cc.

References basicComponents(), filterCSVwithJSON::copy, BarrelDetLayer::initialize(), isOverlapping, PhiBorderFinder::isPhiOverlapping(), PhiBorderFinder::isPhiPeriodic(), LogTrace, metname, precomputed_value_sort(), BarrelDetLayer::specificSurface(), AlCaHLTBitMon_QueryRunRegistry::string, theBasicComps, theBinFinder, theComponents, and theRods.

28  :
29  theRods(rods),
30  theBinFinder(0),
31  isOverlapping(false)
32 {
33  // Sort rods in phi
35 
36  theComponents.reserve(theRods.size());
37  std::copy(theRods.begin(),theRods.end(),back_inserter(theComponents));
38 
39  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRodBarrelLayer";
40 
41  // Cache chamber pointers (the basic components_)
42  for (vector<const DetRod*>::const_iterator it=rods.begin();
43  it!=rods.end(); it++) {
44  vector<const GeomDet*> tmp2 = (*it)->basicComponents();
45  theBasicComps.insert(theBasicComps.end(),tmp2.begin(),tmp2.end());
46  }
47 
48  // Initialize the binfinder
50  isOverlapping = bf.isPhiOverlapping();
51 
52  if ( bf.isPhiPeriodic() ) {
54  (theRods.front()->position().phi(),theRods.size());
55  } else {
57  }
58 
59  // Compute the layer's surface and bounds (from the components())
61 
62  LogTrace(metname) << "Constructing MuRodBarrelLayer: "
63  << basicComponents().size() << " Dets "
64  << theRods.size() << " Rods "
65  << " R: " << specificSurface().radius()
66  << " Per.: " << bf.isPhiPeriodic()
67  << " Overl.: " << isOverlapping;
68 }
virtual void initialize()
const std::string metname
std::vector< const GeomDet * > theBasicComps
BaseBinFinder< double > * theBinFinder
std::vector< const GeometricSearchDet * > theComponents
std::vector< const DetRod * > theRods
#define LogTrace(id)
void precomputed_value_sort(RandomAccessIterator begin, RandomAccessIterator end, const Extractor &extr)
virtual const std::vector< const GeomDet * > & basicComponents() const
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
virtual const std::vector< const DetRod * > & rods() const
Return the vector of rods.
MuRodBarrelLayer::~MuRodBarrelLayer ( )
virtual

Definition at line 71 of file MuRodBarrelLayer.cc.

References i, theBinFinder, and theRods.

71  {
72  delete theBinFinder;
73  for (vector <const DetRod*>::iterator i = theRods.begin();
74  i<theRods.end(); i++) {delete *i;}
75 }
int i
Definition: DBlmapReader.cc:9
BaseBinFinder< double > * theBinFinder
std::vector< const DetRod * > theRods

Member Function Documentation

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

Implements GeometricSearchDet.

Definition at line 29 of file MuRodBarrelLayer.h.

References theBasicComps.

Referenced by MuRodBarrelLayer().

29 {return theBasicComps;}
std::vector< const GeomDet * > theBasicComps
vector< GeometricSearchDet::DetWithState > MuRodBarrelLayer::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 79 of file MuRodBarrelLayer.cc.

References BaseBinFinder< T >::binIndex(), Surface::bounds(), BarrelDetLayer::compatible(), GeometricSearchDet::compatibleDets(), funct::false, TrajectoryStateOnSurface::globalPosition(), isOverlapping, TrajectoryStateOnSurface::localPosition(), LogTrace, metname, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), query::result, BarrelDetLayer::specificSurface(), AlCaHLTBitMon_QueryRunRegistry::string, DetRod::surface(), theBinFinder, theRods, Bounds::width(), PV3DBase< T, PVType, FrameType >::x(), and xError().

81  {
82 
83  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuRodBarrelLayer";
84  vector<DetWithState> result;
85 
86 
87  LogTrace(metname) << "MuRodBarrelLayer::compatibleDets, Cyl R: "
88  << specificSurface().radius()
89  << " TSOS at R= " << startingState.globalPosition().perp()
90  << " phi= " << startingState.globalPosition().phi();
91 
92  pair<bool, TrajectoryStateOnSurface> compat =
93  compatible(startingState, prop, est);
94  if (!compat.first) {
95  LogTrace(metname) << " MuRodBarrelLayer::compatibleDets: not compatible"
96  << " (should not have been selected!)";
97  return vector<DetWithState>();
98  }
99 
100  TrajectoryStateOnSurface& tsos = compat.second;
101 
102  LogTrace(metname) << " MuRodBarrelLayer::compatibleDets, reached layer at: "
103  << tsos.globalPosition()
104  << " R = " << tsos.globalPosition().perp()
105  << " phi = " << tsos.globalPosition().phi();
106 
107  int closest = theBinFinder->binIndex(tsos.globalPosition().phi());
108  const DetRod* closestRod = theRods[closest];
109 
110  // Check the closest rod
111  LogTrace(metname) << " MuRodBarrelLayer::compatibleDets, closestRod: " << closest
112  << " phi : " << closestRod->surface().position().phi()
113  << " FTS phi: " << tsos.globalPosition().phi();
114 
115  result = closestRod->compatibleDets(tsos, prop, est);
116 
117  int nclosest = result.size(); // Debug counter
118 
119  bool checknext = false ;
120  double dist;
121 
122  if (!result.empty()) {
123  // Check if the track go outside closest rod, then look for closest.
124  TrajectoryStateOnSurface& predictedState = result.front().second;
125  float xErr = xError(predictedState, est);
126  float halfWid = closestRod->surface().bounds().width()/2.;
127  dist = predictedState.localPosition().x();
128 
129  // If the layer is overlapping, additionally reduce halfWid by 10%
130  // to account for overlap.
131  // FIXME: should we account for the real amount of overlap?
132  if (isOverlapping) halfWid *= 0.9;
133 
134  if (fabs(dist) + xErr > halfWid) {
135  checknext = true;
136  }
137  } else { // Rod is not compatible
138  //FIXME: Usually next cannot be either. Implement proper logic.
139  // (in general at least one rod should be when this method is called by
140  // compatibleDets() which calls compatible())
141  checknext = true;
142 
143  // Look for the next-to closest in phi.
144  // Note Geom::Phi, subtraction is pi-border-safe
145  if ( tsos.globalPosition().phi()-closestRod->surface().position().phi()>0.)
146  {
147  dist = -1.;
148  } else {
149  dist = +1.;
150  }
151 
152 
153  LogTrace(metname) << " MuRodBarrelLayer::fastCompatibleDets, none on closest rod!";
154  }
155 
156  if (checknext) {
157  int next;
158  if (dist<0.) next = closest+1;
159  else next = closest-1;
160 
161  next = theBinFinder->binIndex(next); // Bin Periodicity
162  const DetRod* nextRod = theRods[next];
163 
164 
165  LogTrace(metname) << " MuRodBarrelLayer::fastCompatibleDets, next-to closest"
166  << " rod: " << next << " dist " << dist
167  << " phi : " << nextRod->surface().position().phi()
168  << " FTS phi: " << tsos.globalPosition().phi();
169 
170  vector<DetWithState> nextRodDets =
171  nextRod->compatibleDets(tsos, prop, est);
172  result.insert(result.end(),
173  nextRodDets.begin(), nextRodDets.end());
174  }
175 
176 
177  LogTrace(metname) << " MuRodBarrelLayer::fastCompatibleDets: found: "
178  << result.size()
179  << " on closest: " << nclosest
180  << " # checked rods: " << 1 + int(checknext);
181 
182  return result;
183 }
T perp() const
Definition: PV3DBase.h:72
const std::string metname
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
virtual int binIndex(T pos) const =0
Return the index of bin at given position.
GlobalPoint globalPosition() const
const Bounds & bounds() const
Definition: Surface.h:128
virtual std::vector< DetWithState > compatibleDets(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
BaseBinFinder< double > * theBinFinder
tuple result
Definition: query.py:137
std::vector< const DetRod * > theRods
virtual const BoundSurface & surface() const GCC11_FINAL
The surface of the GeometricSearchDet.
Definition: DetRod.h:19
#define LogTrace(id)
float xError(const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
Definition: DetRod.h:13
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const GCC11_FINAL
T x() const
Definition: PV3DBase.h:62
virtual float width() const =0
const PositionType & position() const
virtual const BoundCylinder & specificSurface() const GCC11_FINAL
Extension of the interface.
const vector< const GeometricSearchDet * > & MuRodBarrelLayer::components ( ) const
virtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 207 of file MuRodBarrelLayer.cc.

References theComponents.

207  {
208  return theComponents;
209 }
std::vector< const GeometricSearchDet * > theComponents
vector< DetGroup > MuRodBarrelLayer::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 187 of file MuRodBarrelLayer.cc.

References gather_cfg::cout.

189  {
190  // FIXME should return only 1 group
191  cout << "dummy implementation of MuRodBarrelLayer::groupedCompatibleDets()" << endl;
192  return vector<DetGroup>();
193 }
tuple cout
Definition: gather_cfg.py:121
bool MuRodBarrelLayer::hasGroups ( ) const
virtual

Implements GeometricSearchDet.

Definition at line 196 of file MuRodBarrelLayer.cc.

196  {
197  // FIXME : depending on isOverlapping?
198  return false;
199 }
virtual const std::vector<const DetRod*>& MuRodBarrelLayer::rods ( ) const
inlinevirtual

Return the vector of rods.

Definition at line 53 of file MuRodBarrelLayer.h.

References theRods.

53 {return theRods;}
std::vector< const DetRod * > theRods
GeomDetEnumerators::SubDetector MuRodBarrelLayer::subDetector ( ) const
virtual

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

Implements DetLayer.

Definition at line 202 of file MuRodBarrelLayer.cc.

References theBasicComps.

202  {
203  return theBasicComps.front()->subDetector();
204 }
std::vector< const GeomDet * > theBasicComps
float MuRodBarrelLayer::xError ( const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
private

Definition at line 211 of file MuRodBarrelLayer.cc.

References TrajectoryStateOnSurface::hasError(), TrajectoryStateOnSurface::localError(), LocalTrajectoryError::positionError(), mathSSE::sqrt(), and LocalError::xx().

Referenced by compatibleDets().

212  {
213  const float nSigmas = 3.f;
214  if (tsos.hasError()) {
215  return nSigmas * sqrt(tsos.localError().positionError().xx());
216  }
217  else return nSigmas * 0.5;
218 }
float xx() const
Definition: LocalError.h:24
LocalError positionError() const
T sqrt(T t)
Definition: SSEVec.h:48
const LocalTrajectoryError & localError() const

Member Data Documentation

bool MuRodBarrelLayer::isOverlapping
private

Definition at line 65 of file MuRodBarrelLayer.h.

Referenced by compatibleDets(), and MuRodBarrelLayer().

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

Definition at line 63 of file MuRodBarrelLayer.h.

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

BaseBinFinder<double>* MuRodBarrelLayer::theBinFinder
private

Definition at line 64 of file MuRodBarrelLayer.h.

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

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

Definition at line 62 of file MuRodBarrelLayer.h.

Referenced by components(), and MuRodBarrelLayer().

std::vector<const DetRod*> MuRodBarrelLayer::theRods
private

Definition at line 61 of file MuRodBarrelLayer.h.

Referenced by compatibleDets(), MuRodBarrelLayer(), rods(), and ~MuRodBarrelLayer().