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 (const std::vector< const GeomDet * > &dets)
 Construct from a std::vector of GeomDet*. More...
 
 MTDDetTray (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on GeomDet*. More...
 
 ~MTDDetTray () override
 Destructor. More...
 
- Public Member Functions inherited from DetRodOneR
const std::vector< const GeomDet * > & basicComponents () const override
 
 DetRodOneR (const std::vector< const GeomDet * > &dets)
 Construct from a std::vector of GeomDet*. More...
 
 DetRodOneR (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on GeomDet*. More...
 
 ~DetRodOneR () override
 
- Public Member Functions inherited from DetRod
 GeometricSearchDet (bool doHaveGroups)
 
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

◆ BinFinderType

Definition at line 45 of file MTDDetTray.h.

Constructor & Destructor Documentation

◆ MTDDetTray() [1/2]

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

Construct from iterators on GeomDet*.

Definition at line 16 of file MTDDetTray.cc.

17  : DetRodOneR(first, last) {
18  init();
19 }

References init().

◆ MTDDetTray() [2/2]

MTDDetTray::MTDDetTray ( const std::vector< const GeomDet * > &  dets)

Construct from a std::vector of GeomDet*.

Definition at line 21 of file MTDDetTray.cc.

21 : DetRodOneR(vdets) { init(); }

References init().

◆ ~MTDDetTray()

MTDDetTray::~MTDDetTray ( )
override

Destructor.

Definition at line 25 of file MTDDetTray.cc.

25 {}

Member Function Documentation

◆ compatible()

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

36  {
37  TrajectoryStateOnSurface ms = prop.propagate(ts, specificSurface());
38  if (ms.isValid())
39  return make_pair(est.estimate(ms, specificSurface()) != 0, ms);
40  else
41  return make_pair(false, ms);
42 }

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

Referenced by compatibleDets().

◆ compatibleDets()

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

46  {
47  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDDetTray";
48 
49  LogTrace(metname) << "MTDDetTray::compatibleDets, Surface at R,phi: " << surface().position().perp() << ","
50  << surface().position().phi() << " DetRod pos.";
51  // FIXME << " TS at R,phi: " << startingState.position().perp() << ","
52  // << startingState.position().phi()
53 
54  vector<DetWithState> result;
55 
56  // Propagate and check that the result is within bounds
57  pair<bool, TrajectoryStateOnSurface> compat = compatible(startingState, prop, est);
58 
59  if (!compat.first) {
60  LogTrace(metname) << " MTDDetTray::compatibleDets: not compatible"
61  << " (should not have been selected!)";
62  return result;
63  }
64 
65  // Find the most probable destination component
66  TrajectoryStateOnSurface& tsos = compat.second;
67  GlobalPoint startPos = tsos.globalPosition();
68  int closest = theBinFinder.binIndex(startPos.z());
69  const vector<const GeomDet*> dets = basicComponents();
70  LogTrace(metname) << " MTDDetTray::compatibleDets, closest det: " << closest
71  << " pos: " << dets[closest]->surface().position() << " impact " << startPos;
72 
73  // Add this detector, if it is compatible
74  // NOTE: add performs a null propagation
75  add(closest, result, tsos, prop, est);
76 
77 #ifdef EDM_ML_DEBUG
78  int nclosest = result.size();
79  int nnextdet = 0; // just DEBUG counters
80 #endif
81 
82  // Try the neighbors on each side until no more compatible.
83  // If closest is not compatible the next cannot be either
84  if (!result.empty()) {
85  const BoundPlane& closestPlane(dets[closest]->surface());
87 
88  // detHalfLen is assumed to be the same for all detectors.
89  float detHalfLen = closestPlane.bounds().length() / 2.;
90 
91  for (unsigned int idet = closest + 1; idet < dets.size(); idet++) {
92  LocalPoint nextPos(dets[idet]->toLocal(startPos));
93  if (fabs(nextPos.y()) < detHalfLen + maxDistance.y()) {
94  LogTrace(metname) << " negativeZ: det:" << idet << " pos " << nextPos.y() << " maxDistance "
95  << maxDistance.y();
96 #ifdef EDM_ML_DEBUG
97  nnextdet++;
98 #endif
99  if (!add(idet, result, tsos, prop, est))
100  break;
101  } else {
102  break;
103  }
104  }
105 
106  for (int idet = closest - 1; idet >= 0; idet--) {
107  LocalPoint nextPos(dets[idet]->toLocal(startPos));
108  if (fabs(nextPos.y()) < detHalfLen + maxDistance.y()) {
109  LogTrace(metname) << " positiveZ: det:" << idet << " pos " << nextPos.y() << " maxDistance "
110  << maxDistance.y();
111 #ifdef EDM_ML_DEBUG
112  nnextdet++;
113 #endif
114  if (!add(idet, result, tsos, prop, est))
115  break;
116  } else {
117  break;
118  }
119  }
120  }
121 
122 #ifdef EDM_ML_DEBUG
123  LogTrace(metname) << " MTDDetTray::compatibleDets, size: " << result.size() << " on closest: " << nclosest
124  << " # checked dets: " << nnextdet + 1;
125 #endif
126  if (result.empty()) {
127  LogTrace(metname) << " ***Rod not compatible---should have been discarded before!!!";
128  }
129  return result;
130 }

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(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

◆ components()

const vector< const GeometricSearchDet * > & MTDDetTray::components ( ) const
overridevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 27 of file MTDDetTray.cc.

27  {
28  // FIXME dummy impl.
29  edm::LogError("MTDDetTray") << "temporary dummy implementation of MTDDetTray::components()!!" << endl;
30  static const vector<const GeometricSearchDet*> result;
31  return result;
32 }

References mps_fire::result.

◆ groupedCompatibleDets()

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

134  {
135  // FIXME should return only 1 group
136  cout << "dummy implementation of MTDDetTray::groupedCompatibleDets()" << endl;
137  vector<DetGroup> result;
138  return result;
139 }

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

◆ init()

void MTDDetTray::init ( void  )
private

Definition at line 23 of file MTDDetTray.cc.

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

Referenced by MTDDetTray().

Member Data Documentation

◆ theBinFinder

BinFinderType MTDDetTray::theBinFinder
private

Definition at line 46 of file MTDDetTray.h.

Referenced by compatibleDets(), and init().

TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
gather_cfg.cout
cout
Definition: gather_cfg.py:144
MTDDetTray::theBinFinder
BinFinderType theBinFinder
Definition: MTDDetTray.h:46
particleFlowClusterHGC_cfi.maxDistance
maxDistance
Definition: particleFlowClusterHGC_cfi.py:23
dqmdumpme.first
first
Definition: dqmdumpme.py:55
MTDDetTray::compatible
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est) const override
Definition: MTDDetTray.cc:34
end
#define end
Definition: vmac.h:39
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
dqmdumpme.last
last
Definition: dqmdumpme.py:56
Vector2DBase
Definition: Vector2DBase.h:8
Point3DBase< float, GlobalTag >
GenericBinFinderInZ::binIndex
int binIndex(T z) const override
returns an index in the valid range for the bin closest to Z
Definition: GenericBinFinderInZ.h:35
MTDDetTray::BinFinderType
GenericBinFinderInZ< float, GeomDet > BinFinderType
Definition: MTDDetTray.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DetRod::specificSurface
virtual const Plane & specificSurface() const final
Return the rod surface as a Plane.
Definition: DetRod.h:24
edm::LogError
Definition: MessageLogger.h:183
DetRod::surface
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
Definition: DetRod.h:19
DetRodOneR::add
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:32
DetRodOneR::DetRodOneR
DetRodOneR(std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
Construct from iterators on GeomDet*.
Definition: DetRodOneR.cc:15
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
MTDDetTray::init
void init()
Definition: MTDDetTray.cc:23
DetRodOneR::basicComponents
const std::vector< const GeomDet * > & basicComponents() const override
Definition: DetRodOneR.h:26
BoundPlane
toLocal
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
Definition: ConversionProducer.h:192
mps_fire.result
result
Definition: mps_fire.py:303
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
begin
#define begin
Definition: vmac.h:32
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
MeasurementEstimator::maximalLocalDisplacement
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:43