CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
MTDDetTray Class Reference

#include <MTDDetTray.h>

Inheritance diagram for MTDDetTray:
DetRodOneR DetRod GeometricSearchDet

Public Member Functions

std::pair< bool, TrajectoryStateOnSurfacecompatible (const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est) const override
 
std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
 
const std::vector< const GeometricSearchDet * > & components () const override
 Returns basic components, if any. More...
 
std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const override
 
 MTDDetTray (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on GeomDet*. More...
 
 MTDDetTray (const std::vector< const GeomDet * > &dets)
 Construct from a std::vector of GeomDet*. More...
 
 ~MTDDetTray () override
 Destructor. More...
 
- Public Member Functions inherited from DetRodOneR
const std::vector< const GeomDet * > & basicComponents () const override
 
 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...
 
 ~DetRodOneR () override
 
- Public Member Functions inherited from DetRod
virtual const PlanespecificSurface () const final
 Return the rod surface as a Plane. More...
 
const BoundSurfacesurface () const final
 The surface of the GeometricSearchDet. More...
 
 ~DetRod () override
 
- Public Member Functions inherited from GeometricSearchDet
virtual void compatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
 
 GeometricSearchDet (bool doHaveGroups)
 
virtual void groupedCompatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
 
bool hasGroups () const
 
virtual const Surface::PositionTypeposition () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Private Types

typedef GenericBinFinderInZ< float, GeomDetBinFinderType
 

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 *, TrajectoryStateOnSurfaceDetWithState
 
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 (Plane *plane)
 Set the rod's plane. More...
 
- Protected Attributes inherited from DetRodOneR
std::vector< const GeomDet * > theDets
 
- Protected Attributes inherited from GeometricSearchDet
bool haveGroups
 
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A tray of aligned equal-sized non-overlapping detectors. Designed for barrel timing layer.

Author
L. Gray - FNAL

Definition at line 17 of file MTDDetTray.h.

Member Typedef Documentation

Definition at line 51 of file MTDDetTray.h.

Constructor & Destructor Documentation

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

Construct from iterators on GeomDet*.

Definition at line 17 of file MTDDetTray.cc.

References init().

19  : DetRodOneR(first,last) {
20  init();
21 }
DetRodOneR(std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
Construct from iterators on GeomDet*.
Definition: DetRodOneR.cc:15
void init()
Definition: MTDDetTray.cc:29
MTDDetTray::MTDDetTray ( const std::vector< const GeomDet * > &  dets)

Construct from a std::vector of GeomDet*.

Definition at line 23 of file MTDDetTray.cc.

References init().

24  : DetRodOneR(vdets) {
25  init();
26 }
DetRodOneR(std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
Construct from iterators on GeomDet*.
Definition: DetRodOneR.cc:15
void init()
Definition: MTDDetTray.cc:29
MTDDetTray::~MTDDetTray ( )
override

Destructor.

Definition at line 34 of file MTDDetTray.cc.

34 {}

Member Function Documentation

pair< bool, TrajectoryStateOnSurface > MTDDetTray::compatible ( const TrajectoryStateOnSurface ts,
const Propagator ,
const MeasurementEstimator  
) const
overridevirtual

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 46 of file MTDDetTray.cc.

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

Referenced by compatibleDets().

47  {
48 
49  TrajectoryStateOnSurface ms = prop.propagate(ts,specificSurface());
50  if (ms.isValid()) return make_pair(est.estimate(ms, specificSurface()) != 0, ms);
51  else return make_pair(false, ms);
52 }
virtual const Plane & specificSurface() const final
Return the rod surface as a Plane.
Definition: DetRod.h:27
susybsm::MuonSegment ms
Definition: classes.h:31
vector< GeometricSearchDet::DetWithState > MTDDetTray::compatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
overridevirtual

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 56 of file MTDDetTray.cc.

References DetRodOneR::add(), DetRodOneR::basicComponents(), GenericBinFinderInZ< T, G >::binIndex(), compatible(), TrajectoryStateOnSurface::globalPosition(), LogTrace, particleFlowClusterHGC_cfi::maxDistance, MeasurementEstimator::maximalLocalDisplacement(), metname, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), mps_fire::result, AlCaHLTBitMon_QueryRunRegistry::string, DetRod::surface(), theBinFinder, toLocal(), PV2DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

58  {
59  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDDetTray";
60 
61  LogTrace(metname) << "MTDDetTray::compatibleDets, Surface at R,phi: "
62  << surface().position().perp() << ","
63  << surface().position().phi() << " DetRod pos.";
64  // FIXME << " TS at R,phi: " << startingState.position().perp() << ","
65  // << startingState.position().phi()
66 
67 
68  vector<DetWithState> result;
69 
70  // Propagate and check that the result is within bounds
71  pair<bool, TrajectoryStateOnSurface> compat =
72  compatible(startingState, prop, est);
73 
74  if (!compat.first) {
75  LogTrace(metname) << " MTDDetTray::compatibleDets: not compatible"
76  << " (should not have been selected!)";
77  return result;
78  }
79 
80  // Find the most probable destination component
81  TrajectoryStateOnSurface& tsos = compat.second;
82  GlobalPoint startPos = tsos.globalPosition();
83  int closest = theBinFinder.binIndex(startPos.z());
84  const vector<const GeomDet*> dets = basicComponents();
85  LogTrace(metname) << " MTDDetTray::compatibleDets, closest det: " << closest
86  << " pos: " << dets[closest]->surface().position()
87  << " impact " << startPos;
88 
89  // Add this detector, if it is compatible
90  // NOTE: add performs a null propagation
91  add(closest, result, tsos, prop, est);
92 
93 #ifdef EDM_ML_DEBUG
94  int nclosest = result.size(); int nnextdet=0; // just DEBUG counters
95 #endif
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 #ifdef EDM_ML_DEBUG
114  nnextdet++;
115 #endif
116  if ( !add(idet, result, tsos, prop, est)) break;
117  } else {
118  break;
119  }
120  }
121 
122  for (int idet=closest-1; idet >= 0; idet--) {
123  LocalPoint nextPos( dets[idet]->toLocal(startPos));
124  if (fabs(nextPos.y()) < detHalfLen + maxDistance.y()) {
125  LogTrace(metname) << " positiveZ: det:" << idet
126  << " pos " << nextPos.y()
127  << " maxDistance " << maxDistance.y();
128 #ifdef EDM_ML_DEBUG
129  nnextdet++;
130 #endif
131  if ( !add(idet, result, tsos, prop, est)) break;
132  } else {
133  break;
134  }
135  }
136  }
137 
138 #ifdef EDM_ML_DEBUG
139  LogTrace(metname) << " MTDDetTray::compatibleDets, size: " << result.size()
140  << " on closest: " << nclosest
141  << " # checked dets: " << nnextdet+1;
142 #endif
143  if (result.empty()) {
144  LogTrace(metname) << " ***Rod not compatible---should have been discarded before!!!";
145  }
146  return result;
147 }
T y() const
Definition: PV2DBase.h:46
T perp() const
Definition: PV3DBase.h:72
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
Definition: DetRod.h:21
const std::string metname
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
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
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est) const override
Definition: MTDDetTray.cc:46
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
T z() const
Definition: PV3DBase.h:64
int binIndex(T z) const override
returns an index in the valid range for the bin closest to Z
#define LogTrace(id)
const std::vector< const GeomDet * > & basicComponents() const override
Definition: DetRodOneR.h:28
BinFinderType theBinFinder
Definition: MTDDetTray.h:52
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
const PositionType & position() const
const vector< const GeometricSearchDet * > & MTDDetTray::components ( ) const
overridevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 37 of file MTDDetTray.cc.

References mps_fire::result.

37  {
38 
39  // FIXME dummy impl.
40  edm::LogError("MTDDetTray") << "temporary dummy implementation of MTDDetTray::components()!!" << endl;
41  static const vector<const GeometricSearchDet*> result;
42  return result;
43 }
vector< DetGroup > MTDDetTray::groupedCompatibleDets ( const TrajectoryStateOnSurface startingState,
const Propagator prop,
const MeasurementEstimator est 
) const
overridevirtual

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 151 of file MTDDetTray.cc.

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

153  {
154  // FIXME should return only 1 group
155  cout << "dummy implementation of MTDDetTray::groupedCompatibleDets()" << endl;
156  vector<DetGroup> result;
157  return result;
158 }
void MTDDetTray::init ( void  )
private

Definition at line 29 of file MTDDetTray.cc.

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

Referenced by MTDDetTray().

29  {
31 }
GenericBinFinderInZ< float, GeomDet > BinFinderType
Definition: MTDDetTray.h:51
#define end
Definition: vmac.h:39
const std::vector< const GeomDet * > & basicComponents() const override
Definition: DetRodOneR.h:28
#define begin
Definition: vmac.h:32
BinFinderType theBinFinder
Definition: MTDDetTray.h:52

Member Data Documentation

BinFinderType MTDDetTray::theBinFinder
private

Definition at line 52 of file MTDDetTray.h.

Referenced by compatibleDets(), and init().