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
MuDetRing Class Reference

#include <MuDetRing.h>

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

Detailed Description

A ring of periodic, possibly overlapping vertical detectors. Designed for forward muon CSC/RPC chambers.

Date:
2006/06/02 15:19:39
Revision:
1.4
Author
N. Amapane - INFN Torino

Definition at line 18 of file MuDetRing.h.

Member Typedef Documentation

Definition at line 54 of file MuDetRing.h.

Constructor & Destructor Documentation

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

References init().

20  :
22 {
23  init();
24 }
ForwardDetRingOneZ()
Dummy constructor.
bool first
Definition: L1TdeRCT.cc:94
void init()
Definition: MuDetRing.cc:34
MuDetRing::MuDetRing ( const std::vector< const GeomDet * > &  dets)

Construct from a vector of GeomDet*.

Definition at line 27 of file MuDetRing.cc.

References init().

27  :
28  ForwardDetRingOneZ(vdets)
29 {
30  init();
31 }
ForwardDetRingOneZ()
Dummy constructor.
void init()
Definition: MuDetRing.cc:34
MuDetRing::~MuDetRing ( )
virtual

Definition at line 40 of file MuDetRing.cc.

40 {}

Member Function Documentation

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

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

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

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

82  {
83 
84  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuDetRing";
85 
86  LogTrace(metname) << "MuDetRing::compatibleDets, Surface at Z: "
87  << surface().position().z()
88  << " R1: " << specificSurface().innerRadius()
89  << " R2: " << specificSurface().outerRadius()
90  << " TS at Z,R: " << startingState.globalPosition().z() << ","
91  << startingState.globalPosition().perp() << " DetRing pos." << position();
92 
93  vector<DetWithState> result;
94 
95  // Propagate and check that the result is within bounds
96  pair<bool, TrajectoryStateOnSurface> compat =
97  compatible(startingState, prop, est);
98  if (!compat.first) {
99  LogTrace(metname) << " MuDetRing::compatibleDets: not compatible"
100  << " (should not have been selected!)";
101  return result;
102  }
103 
104  // Find the most probable destination component
105  TrajectoryStateOnSurface& tsos = compat.second;
106  GlobalPoint startPos = tsos.globalPosition();
107  int closest = theBinFinder.binIndex(startPos.phi());
108  const vector<const GeomDet*> dets = basicComponents();
109  LogTrace(metname) << " MuDetRing::compatibleDets, closest det: " << closest
110  << " Phi: " << dets[closest]->surface().position().phi()
111  << " impactPhi " << startPos.phi();
112 
113  // Add this detector, if it is compatible
114  // NOTE: add performs a null propagation
115  add(closest, result, tsos, prop, est);
116 
117  int nclosest = result.size(); int nnextdet=0; // MDEBUG counters
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) << " MuDetRing::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  nnextdet++;
144  if ( !add(idetp, result, tsos, prop, est)) break;
145  }
146  }
147 
148  for (int idet=closest-1; idet > closest-int(dets.size())/4-1; idet--){
149  // FIXME: should use dphi to decide if det must be queried.
150  // Right now query until not compatible.
151  int idetp = theBinFinder.binIndex(idet);
152  {
153  LogTrace(metname) << " previous det:" << idetp << " " << idet << " " << closest-dets.size()/4-1
154  << " at Z: " << dets[idetp]->position().z()
155  << " phi: " << dets[idetp]->position().phi()
156  << " FTS phi " << startPos.phi()
157  << " max dphi" << dphi;
158  nnextdet++;
159  if ( !add(idetp, result, tsos, prop, est)) break;
160  }
161  }
162 
163  LogTrace(metname) << " MuDetRing::compatibleDets, size: " << result.size()
164  << " on closest: " << nclosest << " # checked dets: " << nnextdet+1;
165 
166  if (result.size()==0) {
167  LogTrace(metname) << " ***Ring not compatible,should have been discarded before!!!";
168  }
169 
170  return result;
171 }
T perp() const
Definition: PV3DBase.h:72
const std::string metname
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
GlobalPoint globalPosition() const
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
virtual std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est) const
Definition: MuDetRing.cc:53
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
tuple result
Definition: query.py:137
#define LogTrace(id)
virtual const std::vector< const GeomDet * > & basicComponents() const
virtual const Surface::PositionType & position() const
Returns position of the surface.
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.
BinFinderType theBinFinder
Definition: MuDetRing.h:55
virtual const BoundSurface & surface() const GCC11_FINAL
The surface of the GeometricSearchDet.
const vector< const GeometricSearchDet * > & MuDetRing::components ( ) const
virtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 44 of file MuDetRing.cc.

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

44  {
45  // FIXME dummy impl.
46  cout << "temporary dummy implementation of MuDetRing::components()!!" << endl;
47  static vector<const GeometricSearchDet*> result;
48  return result;
49 }
tuple result
Definition: query.py:137
tuple cout
Definition: gather_cfg.py:121
vector< DetGroup > MuDetRing::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 175 of file MuDetRing.cc.

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

177  {
178  // FIXME should be implemented to allow returning overlapping chambers
179  // as separate groups!
180  cout << "dummy implementation of MuDetRod::groupedCompatibleDets()" << endl;
181  vector<DetGroup> result;
182  return result;
183 }
tuple result
Definition: query.py:137
tuple cout
Definition: gather_cfg.py:121
virtual bool MuDetRing::hasGroups ( ) const
inlinevirtual

Implements GeometricSearchDet.

Definition at line 51 of file MuDetRing.h.

51 {return false;}
void MuDetRing::init ( void  )
private

Definition at line 34 of file MuDetRing.cc.

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

Referenced by MuDetRing().

35 {
37  basicComponents().size());
38 }
PeriodicBinFinderInPhi< float > BinFinderType
Definition: MuDetRing.h:54
virtual const std::vector< const GeomDet * > & basicComponents() const
virtual const Surface::PositionType & position() const
Returns position of the surface.
tuple size
Write out results.
BinFinderType theBinFinder
Definition: MuDetRing.h:55
Definition: DDAxes.h:10

Member Data Documentation

BinFinderType MuDetRing::theBinFinder
private

Definition at line 55 of file MuDetRing.h.

Referenced by compatibleDets(), and init().