CMS 3D CMS Logo

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

#include <MTDDetRing.h>

Inheritance diagram for MTDDetRing:
ForwardDetRingOneZ ForwardDetRing 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
 
 MTDDetRing (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on GeomDet*. More...
 
 MTDDetRing (const std::vector< const GeomDet * > &dets)
 Construct from a vector of GeomDet*. More...
 
 ~MTDDetRing () override
 
- Public Member Functions inherited from ForwardDetRingOneZ
const std::vector< const GeomDet * > & basicComponents () const override
 
 ForwardDetRingOneZ (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on Det*. More...
 
 ForwardDetRingOneZ (const std::vector< const GeomDet * > &dets)
 
 ~ForwardDetRingOneZ () override
 
- Public Member Functions inherited from ForwardDetRing
void compatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const override
 
const BoundDiskspecificSurface () const
 Return the ring surface as a BoundDisk. More...
 
const BoundSurfacesurface () const final
 The surface of the GeometricSearchDet. More...
 
 ~ForwardDetRing () override
 
- Public Member Functions inherited from GeometricSearchDet
 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 PeriodicBinFinderInPhi< float > BinFinderType
 

Private Member Functions

void init ()
 

Private Attributes

BinFinderType theBinFinder
 

Additional Inherited Members

- 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 ForwardDetRingOneZ
bool add (int idet, std::vector< DetWithState > &result, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est) const
 
- Protected Member Functions inherited from ForwardDetRing
void setDisk (BoundDisk *disk)
 Set the rod's disk. More...
 
- Protected Attributes inherited from GeometricSearchDet
bool haveGroups
 
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A ring of periodic, possibly overlapping vertical detectors. Designed for the endcap timing layer.

Author
L. Gray - FNAL

Definition at line 16 of file MTDDetRing.h.

Member Typedef Documentation

Definition at line 49 of file MTDDetRing.h.

Constructor & Destructor Documentation

MTDDetRing::MTDDetRing ( 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 MTDDetRing.cc.

References init().

18  :
20 {
21  init();
22 }
void init()
Definition: MTDDetRing.cc:32
ForwardDetRingOneZ(std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
Construct from iterators on Det*.
MTDDetRing::MTDDetRing ( const std::vector< const GeomDet * > &  dets)

Construct from a vector of GeomDet*.

Definition at line 25 of file MTDDetRing.cc.

References init().

25  :
26  ForwardDetRingOneZ(vdets)
27 {
28  init();
29 }
void init()
Definition: MTDDetRing.cc:32
ForwardDetRingOneZ(std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
Construct from iterators on Det*.
MTDDetRing::~MTDDetRing ( )
override

Definition at line 38 of file MTDDetRing.cc.

38 {}

Member Function Documentation

pair< bool, TrajectoryStateOnSurface > MTDDetRing::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 51 of file MTDDetRing.cc.

References MeasurementEstimator::estimate(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localPosition(), LogTrace, metname, AnalysisDataFormats_SUSYBSMObjects::ms, PV3DBase< T, PVType, FrameType >::perp(), Propagator::propagate(), ForwardDetRing::specificSurface(), AlCaHLTBitMon_QueryRunRegistry::string, and PV3DBase< T, PVType, FrameType >::z().

Referenced by compatibleDets().

52  {
53 
54  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDDetRing";
55  TrajectoryStateOnSurface ms = prop.propagate(ts,specificSurface());
56 
57  LogTrace(metname) << "MTDDetRing::compatible, Surface at Z: "
58  << specificSurface().position().z()
59  << " R1: " << specificSurface().innerRadius()
60  << " R2: " << specificSurface().outerRadius()
61  << " TS at Z,R: " << ts.globalPosition().z() << ","
62  << ts.globalPosition().perp();
63  if (ms.isValid()) {
64  LogTrace(metname) << " DEST at Z,R: " << ms.globalPosition().z() << ","
65  << ms.globalPosition().perp()
66  << " local Z: " << ms.localPosition().z() << endl;
67  }
68  else
69  LogTrace(metname) << " DEST: not valid" <<endl;
70 
71 
72  if (ms.isValid()) return make_pair(est.estimate(ms, specificSurface()) != 0, ms);
73  else return make_pair(false, ms);
74 }
T perp() const
Definition: PV3DBase.h:72
const std::string metname
GlobalPoint globalPosition() const
T z() const
Definition: PV3DBase.h:64
#define LogTrace(id)
susybsm::MuonSegment ms
Definition: classes.h:31
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
vector< GeometricSearchDet::DetWithState > MTDDetRing::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 78 of file MTDDetRing.cc.

References ForwardDetRingOneZ::add(), ForwardDetRingOneZ::basicComponents(), PeriodicBinFinderInPhi< T >::binIndex(), compatible(), TrajectoryStateOnSurface::globalPosition(), createfilelist::int, LogTrace, metname, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GeometricSearchDet::position(), GloballyPositioned< T >::position(), mps_fire::result, ForwardDetRing::specificSurface(), mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, ForwardDetRing::surface(), theBinFinder, and PV3DBase< T, PVType, FrameType >::z().

80  {
81 
82  const std::string metname = "MTD|RecoMTD|RecoMTDDetLayers|MTDDetRing";
83 
84  LogTrace(metname) << "MTDDetRing::compatibleDets, Surface at Z: "
85  << surface().position().z()
86  << " R1: " << specificSurface().innerRadius()
87  << " R2: " << specificSurface().outerRadius()
88  << " TS at Z,R: " << startingState.globalPosition().z() << ","
89  << startingState.globalPosition().perp() << " DetRing pos." << position();
90 
91  vector<DetWithState> result;
92 
93  // Propagate and check that the result is within bounds
94  pair<bool, TrajectoryStateOnSurface> compat =
95  compatible(startingState, prop, est);
96  if (!compat.first) {
97  LogTrace(metname) << " MTDDetRing::compatibleDets: not compatible"
98  << " (should not have been selected!)";
99  return result;
100  }
101 
102  // Find the most probable destination component
103  TrajectoryStateOnSurface& tsos = compat.second;
104  GlobalPoint startPos = tsos.globalPosition();
105  int closest = theBinFinder.binIndex(startPos.phi());
106  const vector<const GeomDet*> dets = basicComponents();
107  LogTrace(metname) << " MTDDetRing::compatibleDets, closest det: " << closest
108  << " Phi: " << dets[closest]->surface().position().phi()
109  << " impactPhi " << startPos.phi();
110 
111  // Add this detector, if it is compatible
112  // NOTE: add performs a null propagation
113  add(closest, result, tsos, prop, est);
114 
115 #ifdef EDM_ML_DEBUG
116  int nclosest = result.size(); int nnextdet=0; // MDEBUG counters
117 #endif
118 
119  // Try the neighbors on each side until no more compatible.
120  float dphi=0;
121  if (!result.empty()) { // If closest is not compatible the next cannot be either
122  float nSigmas = 3.;
123  if (result.back().second.hasError()) {
124  dphi = nSigmas*
125  atan(sqrt(result.back().second.localError().positionError().xx())/
126  result.back().second.globalPosition().perp());
127  }
128  } else {
129  LogTrace(metname) << " MTDDetRing::compatibleDets, closest not compatible!";
130  //FIXME: if closest is not compatible the next cannot be either
131  }
132 
133  for (int idet=closest+1; idet < closest+int(dets.size())/4+1; idet++){
134  // FIXME: should use dphi to decide if det must be queried.
135  // Right now query until not compatible.
136  int idetp = theBinFinder.binIndex(idet);
137  {
138  LogTrace(metname) << " next det:" << idetp
139  << " at Z: " << dets[idetp]->position().z()
140  << " phi: " << dets[idetp]->position().phi()
141  << " FTS phi " << startPos.phi()
142  << " max dphi " << dphi;
143 #ifdef EDM_ML_DEBUG
144  nnextdet++;
145 #endif
146  if ( !add(idetp, result, tsos, prop, est)) break;
147  }
148  }
149 
150  for (int idet=closest-1; idet > closest-int(dets.size())/4-1; idet--){
151  // FIXME: should use dphi to decide if det must be queried.
152  // Right now query until not compatible.
153  int idetp = theBinFinder.binIndex(idet);
154  {
155  LogTrace(metname) << " previous det:" << idetp << " " << idet << " " << closest-dets.size()/4-1
156  << " at Z: " << dets[idetp]->position().z()
157  << " phi: " << dets[idetp]->position().phi()
158  << " FTS phi " << startPos.phi()
159  << " max dphi" << dphi;
160 #ifdef EDM_ML_DEBUG
161  nnextdet++;
162 #endif
163  if ( !add(idetp, result, tsos, prop, est)) break;
164  }
165  }
166 
167 #ifdef EDM_ML_DEBUG
168  LogTrace(metname) << " MTDDetRing::compatibleDets, size: " << result.size()
169  << " on closest: " << nclosest << " # checked dets: " << nnextdet+1;
170 #endif
171 
172  if (result.empty()) {
173  LogTrace(metname) << " ***Ring not compatible,should have been discarded before!!!";
174  }
175 
176  return result;
177 }
BinFinderType theBinFinder
Definition: MTDDetRing.h:50
T perp() const
Definition: PV3DBase.h:72
const std::string metname
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
GlobalPoint globalPosition() const
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
#define LogTrace(id)
virtual const Surface::PositionType & position() const
Returns position of the surface.
const std::vector< const GeomDet * > & basicComponents() const override
bool add(int idet, std::vector< DetWithState > &result, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est) const
const PositionType & position() const
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est) const override
Definition: MTDDetRing.cc:51
const vector< const GeometricSearchDet * > & MTDDetRing::components ( ) const
overridevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 42 of file MTDDetRing.cc.

References mps_fire::result.

42  {
43  // FIXME dummy impl.
44  edm::LogError("MTDDetRing") << "temporary dummy implementation of MTDDetRing::components()!!" << endl;
45  static const vector<const GeometricSearchDet*> result;
46  return result;
47 }
vector< DetGroup > MTDDetRing::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 181 of file MTDDetRing.cc.

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

183  {
184  // FIXME should be implemented to allow returning overlapping chambers
185  // as separate groups!
186  cout << "dummy implementation of MTDDetRod::groupedCompatibleDets()" << endl;
187  vector<DetGroup> result;
188  return result;
189 }
void MTDDetRing::init ( void  )
private

Definition at line 32 of file MTDDetRing.cc.

References ForwardDetRingOneZ::basicComponents(), phi, GeometricSearchDet::position(), findQualityFiles::size, and theBinFinder.

Referenced by MTDDetRing().

33 {
35  basicComponents().size());
36 }
BinFinderType theBinFinder
Definition: MTDDetRing.h:50
size
Write out results.
virtual const Surface::PositionType & position() const
Returns position of the surface.
const std::vector< const GeomDet * > & basicComponents() const override
PeriodicBinFinderInPhi< float > BinFinderType
Definition: MTDDetRing.h:49

Member Data Documentation

BinFinderType MTDDetRing::theBinFinder
private

Definition at line 50 of file MTDDetRing.h.

Referenced by compatibleDets(), and init().