CMS 3D CMS Logo

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

#include <MuDetRing.h>

Inheritance diagram for MuDetRing:
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
 
 MuDetRing (const std::vector< const GeomDet * > &dets)
 Construct from a vector of GeomDet*. More...
 
 MuDetRing (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on GeomDet*. More...
 
 ~MuDetRing () override
 
- Public Member Functions inherited from ForwardDetRingOneZ
const std::vector< const GeomDet * > & basicComponents () const override
 
 ForwardDetRingOneZ (const std::vector< const GeomDet * > &dets)
 
 ForwardDetRingOneZ (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on Det*. More...
 
 ~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
 
 GeometricSearchDet (bool doHaveGroups)
 
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 forward muon CSC/RPC chambers.

Author
N. Amapane - INFN Torino

Definition at line 16 of file MuDetRing.h.

Member Typedef Documentation

◆ BinFinderType

Definition at line 43 of file MuDetRing.h.

Constructor & Destructor Documentation

◆ MuDetRing() [1/2]

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

19  init();
20 }

References init().

◆ MuDetRing() [2/2]

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

Construct from a vector of GeomDet*.

Definition at line 22 of file MuDetRing.cc.

22 : ForwardDetRingOneZ(vdets) { init(); }

References init().

◆ ~MuDetRing()

MuDetRing::~MuDetRing ( )
override

Definition at line 28 of file MuDetRing.cc.

28 {}

Member Function Documentation

◆ compatible()

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

39  {
40  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuDetRing";
41  TrajectoryStateOnSurface ms = prop.propagate(ts, specificSurface());
42 
43  LogTrace(metname) << "MuDetRing::compatible, Surface at Z: " << specificSurface().position().z()
44  << " R1: " << specificSurface().innerRadius() << " R2: " << specificSurface().outerRadius()
45  << " TS at Z,R: " << ts.globalPosition().z() << "," << ts.globalPosition().perp();
46  if (ms.isValid()) {
47  LogTrace(metname) << " DEST at Z,R: " << ms.globalPosition().z() << "," << ms.globalPosition().perp()
48  << " local Z: " << ms.localPosition().z() << endl;
49  } else
50  LogTrace(metname) << " DEST: not valid" << endl;
51 
52  if (ms.isValid())
53  return make_pair(est.estimate(ms, specificSurface()) != 0, ms);
54  else
55  return make_pair(false, ms);
56 }

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

Referenced by compatibleDets().

◆ compatibleDets()

vector< GeometricSearchDet::DetWithState > MuDetRing::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 58 of file MuDetRing.cc.

60  {
61  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuDetRing";
62 
63  LogTrace(metname) << "MuDetRing::compatibleDets, Surface at Z: " << surface().position().z()
64  << " R1: " << specificSurface().innerRadius() << " R2: " << specificSurface().outerRadius()
65  << " TS at Z,R: " << startingState.globalPosition().z() << ","
66  << startingState.globalPosition().perp() << " DetRing pos." << position();
67 
68  vector<DetWithState> result;
69 
70  // Propagate and check that the result is within bounds
71  pair<bool, TrajectoryStateOnSurface> compat = compatible(startingState, prop, est);
72  if (!compat.first) {
73  LogTrace(metname) << " MuDetRing::compatibleDets: not compatible"
74  << " (should not have been selected!)";
75  return result;
76  }
77 
78  // Find the most probable destination component
79  TrajectoryStateOnSurface& tsos = compat.second;
80  GlobalPoint startPos = tsos.globalPosition();
81  int closest = theBinFinder.binIndex(startPos.phi());
82  const vector<const GeomDet*> dets = basicComponents();
83  LogTrace(metname) << " MuDetRing::compatibleDets, closest det: " << closest
84  << " Phi: " << dets[closest]->surface().position().phi() << " impactPhi " << startPos.phi();
85 
86  // Add this detector, if it is compatible
87  // NOTE: add performs a null propagation
88  add(closest, result, tsos, prop, est);
89 
90  int nclosest = result.size();
91  int nnextdet = 0; // MDEBUG counters
92 
93  // Try the neighbors on each side until no more compatible.
94  float dphi = 0;
95  if (!result.empty()) { // If closest is not compatible the next cannot be either
96  float nSigmas = 3.;
97  if (result.back().second.hasError()) {
98  dphi = nSigmas * atan(sqrt(result.back().second.localError().positionError().xx()) /
99  result.back().second.globalPosition().perp());
100  }
101  } else {
102  LogTrace(metname) << " MuDetRing::compatibleDets, closest not compatible!";
103  //FIXME: if closest is not compatible the next cannot be either
104  }
105 
106  for (int idet = closest + 1; idet < closest + int(dets.size()) / 4 + 1; idet++) {
107  // FIXME: should use dphi to decide if det must be queried.
108  // Right now query until not compatible.
109  int idetp = theBinFinder.binIndex(idet);
110  {
111  LogTrace(metname) << " next det:" << idetp << " at Z: " << dets[idetp]->position().z()
112  << " phi: " << dets[idetp]->position().phi() << " FTS phi " << startPos.phi() << " max dphi "
113  << dphi;
114  nnextdet++;
115  if (!add(idetp, result, tsos, prop, est))
116  break;
117  }
118  }
119 
120  for (int idet = closest - 1; idet > closest - int(dets.size()) / 4 - 1; idet--) {
121  // FIXME: should use dphi to decide if det must be queried.
122  // Right now query until not compatible.
123  int idetp = theBinFinder.binIndex(idet);
124  {
125  LogTrace(metname) << " previous det:" << idetp << " " << idet << " " << closest - dets.size() / 4 - 1
126  << " at Z: " << dets[idetp]->position().z() << " phi: " << dets[idetp]->position().phi()
127  << " FTS phi " << startPos.phi() << " max dphi" << dphi;
128  nnextdet++;
129  if (!add(idetp, result, tsos, prop, est))
130  break;
131  }
132  }
133 
134  LogTrace(metname) << " MuDetRing::compatibleDets, size: " << result.size() << " on closest: " << nclosest
135  << " # checked dets: " << nnextdet + 1;
136 
137  if (result.empty()) {
138  LogTrace(metname) << " ***Ring not compatible,should have been discarded before!!!";
139  }
140 
141  return result;
142 }

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().

◆ components()

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

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 30 of file MuDetRing.cc.

30  {
31  // FIXME dummy impl.
32  cout << "temporary dummy implementation of MuDetRing::components()!!" << endl;
33  static const vector<const GeometricSearchDet*> result;
34  return result;
35 }

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

◆ groupedCompatibleDets()

vector< DetGroup > MuDetRing::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 144 of file MuDetRing.cc.

146  {
147  // FIXME should be implemented to allow returning overlapping chambers
148  // as separate groups!
149  cout << "dummy implementation of MuDetRod::groupedCompatibleDets()" << endl;
150  vector<DetGroup> result;
151  return result;
152 }

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

◆ init()

void MuDetRing::init ( void  )
private

Member Data Documentation

◆ theBinFinder

BinFinderType MuDetRing::theBinFinder
private

Definition at line 44 of file MuDetRing.h.

Referenced by compatibleDets(), and init().

MuDetRing::init
void init()
Definition: MuDetRing.cc:24
ForwardDetRing::specificSurface
const BoundDisk & specificSurface() const
Return the ring surface as a BoundDisk.
Definition: ForwardDetRing.h:27
MuDetRing::BinFinderType
PeriodicBinFinderInPhi< float > BinFinderType
Definition: MuDetRing.h:43
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
gather_cfg.cout
cout
Definition: gather_cfg.py:144
GeometricSearchDet::position
virtual const Surface::PositionType & position() const
Returns position of the surface.
Definition: GeometricSearchDet.h:31
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
dqmdumpme.last
last
Definition: dqmdumpme.py:56
ForwardDetRingOneZ::basicComponents
const std::vector< const GeomDet * > & basicComponents() const override
Definition: ForwardDetRingOneZ.h:21
ForwardDetRingOneZ::add
bool add(int idet, std::vector< DetWithState > &result, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est) const
Definition: ForwardDetRingOneZ.cc:33
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Point3DBase< float, GlobalTag >
MuDetRing::theBinFinder
BinFinderType theBinFinder
Definition: MuDetRing.h:44
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ForwardDetRingOneZ::ForwardDetRingOneZ
ForwardDetRingOneZ(std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
Construct from iterators on Det*.
Definition: ForwardDetRingOneZ.cc:16
TrajectoryStateOnSurface::localPosition
LocalPoint localPosition() const
Definition: TrajectoryStateOnSurface.h:74
createfilelist.int
int
Definition: createfilelist.py:10
DDAxes::phi
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
MuDetRing::compatible
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est) const override
Definition: MuDetRing.cc:37
PeriodicBinFinderInPhi::binIndex
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
Definition: PeriodicBinFinderInPhi.h:25
mps_fire.result
result
Definition: mps_fire.py:311
ForwardDetRing::surface
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
Definition: ForwardDetRing.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40