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

#include <MuDetRod.h>

Inheritance diagram for MuDetRod:
DetRodOneR DetRod GeometricSearchDet

Public Member Functions

virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est) 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
 
 MuDetRod (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on GeomDet*. More...
 
 MuDetRod (const std::vector< const GeomDet * > &dets)
 Construct from a std::vector of GeomDet*. More...
 
virtual ~MuDetRod ()
 Destructor. More...
 
- Public Member Functions inherited from DetRodOneR
virtual const std::vector
< const GeomDet * > & 
basicComponents () const
 
 DetRodOneR ()
 Dummy constructor. More...
 
 DetRodOneR (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on GeomDet*. More...
 
 DetRodOneR (const std::vector< const GeomDet * > &dets)
 Construct from a std::vector of GeomDet*. More...
 
virtual ~DetRodOneR ()
 
- Public Member Functions inherited from DetRod
virtual const BoundPlanespecificSurface () const
 Return the rod surface as a BoundPlane. More...
 
virtual const BoundSurfacesurface () const
 The surface of the GeometricSearchDet. More...
 
virtual ~DetRod ()
 
- 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 Types

typedef GenericBinFinderInZ
< float, GeomDet
BinFinderType
 

Private Member Functions

void init ()
 

Private Attributes

BinFinderType theBinFinder
 

Additional Inherited Members

- Public Types inherited from DetRodOneR
typedef std::vector
< GeometricSearchDet * > 
DetContainer
 
- 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 DetRodOneR
bool add (int idet, std::vector< DetWithState > &result, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 Query detector idet for compatible and add the output to result. More...
 
void initialize ()
 
- Protected Member Functions inherited from DetRod
void setPlane (BoundPlane *plane)
 Set the rod's plane. More...
 
- Protected Attributes inherited from DetRodOneR
std::vector< const GeomDet * > theDets
 
- Protected Attributes inherited from GeometricSearchDet
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A rod of aligned equal-sized non-overlapping detectors. Designed for barrel muon DT/RPC chambers.

Date:
2007/07/08 04:19:44
Revision:
1.5
Author
N. Amapane - INFN Torino

Definition at line 19 of file MuDetRod.h.

Member Typedef Documentation

Definition at line 56 of file MuDetRod.h.

Constructor & Destructor Documentation

MuDetRod::MuDetRod ( std::vector< const GeomDet * >::const_iterator  first,
std::vector< const GeomDet * >::const_iterator  last 
)

Construct from iterators on GeomDet*.

Definition at line 19 of file MuDetRod.cc.

References init().

21  : DetRodOneR(first,last) {
22  init();
23 }
DetRodOneR()
Dummy constructor.
Definition: DetRodOneR.h:19
bool first
Definition: L1TdeRCT.cc:94
void init()
Definition: MuDetRod.cc:31
MuDetRod::MuDetRod ( const std::vector< const GeomDet * > &  dets)

Construct from a std::vector of GeomDet*.

Definition at line 25 of file MuDetRod.cc.

References init().

26  : DetRodOneR(vdets) {
27  init();
28 }
DetRodOneR()
Dummy constructor.
Definition: DetRodOneR.h:19
void init()
Definition: MuDetRod.cc:31
MuDetRod::~MuDetRod ( )
virtual

Destructor.

Definition at line 36 of file MuDetRod.cc.

36 {}

Member Function Documentation

pair< bool, TrajectoryStateOnSurface > MuDetRod::compatible ( const TrajectoryStateOnSurface ts,
const Propagator ,
const MeasurementEstimator  
) const
virtual

tests the geometrical compatibility of the Det with the predicted state. The FreeTrajectoryState argument is propagated to the Det surface using the Propagator argument. The resulting TrajectoryStateOnSurface is tested for compatibility with the surface bounds. If compatible, a std::pair< true, propagatedState> is returned. If the propagation fails, or if the state is not compatible, a std::pair< false, propagatedState> is returned.

Implements GeometricSearchDet.

Definition at line 48 of file MuDetRod.cc.

References MeasurementEstimator::estimate(), TrajectoryStateOnSurface::isValid(), Propagator::propagate(), and DetRod::specificSurface().

Referenced by compatibleDets().

49  {
50 
51  TrajectoryStateOnSurface ms = prop.propagate(ts,specificSurface());
52  if (ms.isValid()) return make_pair(est.estimate(ms, specificSurface()) != 0, ms);
53  else return make_pair(false, ms);
54 }
virtual const BoundPlane & specificSurface() const
Return the rod surface as a BoundPlane.
Definition: DetRod.h:25
vector< GeometricSearchDet::DetWithState > MuDetRod::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 58 of file MuDetRod.cc.

References DetRodOneR::add(), DetRodOneR::basicComponents(), GenericBinFinderInZ< T, G >::binIndex(), BoundSurface::bounds(), compatible(), TrajectoryStateOnSurface::globalPosition(), Bounds::length(), LogTrace, MeasurementEstimator::maximalLocalDisplacement(), metname, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), query::result, DetRod::surface(), theBinFinder, toLocal(), PV2DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

60  {
61  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuDetRod";
62 
63  LogTrace(metname) << "MuDetRod::compatibleDets, Surface at R,phi: "
64  << surface().position().perp() << ","
65  << surface().position().phi() << " DetRod pos.";
66  // FIXME << " TS at R,phi: " << startingState.position().perp() << ","
67  // << startingState.position().phi()
68 
69 
70  vector<DetWithState> result;
71 
72  // Propagate and check that the result is within bounds
73  pair<bool, TrajectoryStateOnSurface> compat =
74  compatible(startingState, prop, est);
75 
76  if (!compat.first) {
77  LogTrace(metname) << " MuDetRod::compatibleDets: not compatible"
78  << " (should not have been selected!)";
79  return result;
80  }
81 
82  // Find the most probable destination component
83  TrajectoryStateOnSurface& tsos = compat.second;
84  GlobalPoint startPos = tsos.globalPosition();
85  int closest = theBinFinder.binIndex(startPos.z());
86  const vector<const GeomDet*> dets = basicComponents();
87  LogTrace(metname) << " MuDetRod::compatibleDets, closest det: " << closest
88  << " pos: " << dets[closest]->surface().position()
89  << " impact " << startPos;
90 
91  // Add this detector, if it is compatible
92  // NOTE: add performs a null propagation
93  add(closest, result, tsos, prop, est);
94 
95  int nclosest = result.size(); int nnextdet=0; // just DEBUG counters
96 
97  // Try the neighbors on each side until no more compatible.
98  // If closest is not compatible the next cannot be either
99  if (!result.empty()) {
100  const BoundPlane& closestPlane(dets[closest]->surface());
102  est.maximalLocalDisplacement( result.front().second, closestPlane);
103 
104  // detHalfLen is assumed to be the same for all detectors.
105  float detHalfLen = closestPlane.bounds().length()/2.;
106 
107  for (unsigned int idet=closest+1; idet < dets.size(); idet++) {
108  LocalPoint nextPos(dets[idet]->toLocal(startPos));
109  if (fabs(nextPos.y()) < detHalfLen + maxDistance.y()) {
110  LogTrace(metname) << " negativeZ: det:" << idet
111  << " pos " << nextPos.y()
112  << " maxDistance " << maxDistance.y();
113  nnextdet++;
114  if ( !add(idet, result, tsos, prop, est)) break;
115  } else {
116  break;
117  }
118  }
119 
120  for (int idet=closest-1; idet >= 0; idet--) {
121  LocalPoint nextPos( dets[idet]->toLocal(startPos));
122  if (fabs(nextPos.y()) < detHalfLen + maxDistance.y()) {
123  LogTrace(metname) << " positiveZ: det:" << idet
124  << " pos " << nextPos.y()
125  << " maxDistance " << maxDistance.y();
126  nnextdet++;
127  if ( !add(idet, result, tsos, prop, est)) break;
128  } else {
129  break;
130  }
131  }
132  }
133 
134  LogTrace(metname) << " MuDetRod::compatibleDets, size: " << result.size()
135  << " on closest: " << nclosest
136  << " # checked dets: " << nnextdet+1;
137  if (result.size()==0) {
138  LogTrace(metname) << " ***Rod not compatible---should have been discarded before!!!";
139  }
140  return result;
141 }
T y() const
Definition: PV2DBase.h:45
T perp() const
Definition: PV3DBase.h:71
const std::string metname
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
GlobalPoint globalPosition() const
bool add(int idet, std::vector< DetWithState > &result, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Query detector idet for compatible and add the output to result.
Definition: DetRodOneR.cc:42
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const BoundPlane &plane) const
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est) const
Definition: MuDetRod.cc:48
T z() const
Definition: PV3DBase.h:63
tuple result
Definition: query.py:137
#define LogTrace(id)
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
Definition: DetRod.h:19
BinFinderType theBinFinder
Definition: MuDetRod.h:57
virtual int binIndex(T z) const
returns an index in the valid range for the bin closest to Z
virtual const std::vector< const GeomDet * > & basicComponents() const
Definition: DetRodOneR.h:30
const PositionType & position() const
const vector< const GeometricSearchDet * > & MuDetRod::components ( ) const
virtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 39 of file MuDetRod.cc.

References gather_cfg::cout, and query::result.

39  {
40 
41  // FIXME dummy impl.
42  cout << "temporary dummy implementation of MuDetRod::components()!!" << endl;
43  static vector<const GeometricSearchDet*> result;
44  return result;
45 }
tuple result
Definition: query.py:137
tuple cout
Definition: gather_cfg.py:121
vector< DetGroup > MuDetRod::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 145 of file MuDetRod.cc.

References gather_cfg::cout, and query::result.

147  {
148  // FIXME should return only 1 group
149  cout << "dummy implementation of MuDetRod::groupedCompatibleDets()" << endl;
150  vector<DetGroup> result;
151  return result;
152 }
tuple result
Definition: query.py:137
tuple cout
Definition: gather_cfg.py:121
virtual bool MuDetRod::hasGroups ( ) const
inlinevirtual

Implements GeometricSearchDet.

Definition at line 52 of file MuDetRod.h.

52 {return false;}
void MuDetRod::init ( void  )
private

Definition at line 31 of file MuDetRod.cc.

References DetRodOneR::basicComponents(), begin, end, and theBinFinder.

Referenced by MuDetRod().

31  {
33 }
#define end
Definition: vmac.h:38
GenericBinFinderInZ< float, GeomDet > BinFinderType
Definition: MuDetRod.h:56
BinFinderType theBinFinder
Definition: MuDetRod.h:57
#define begin
Definition: vmac.h:31
virtual const std::vector< const GeomDet * > & basicComponents() const
Definition: DetRodOneR.h:30

Member Data Documentation

BinFinderType MuDetRod::theBinFinder
private

Definition at line 57 of file MuDetRod.h.

Referenced by compatibleDets(), and init().