CMS 3D CMS Logo

MuDetRing Class Reference

A ring of periodic, possibly overlapping vertical detectors. More...

#include <RecoMuon/DetLayers/interface/MuDetRing.h>

Inheritance diagram for MuDetRing:

ForwardDetRingOneZ ForwardDetRing GeometricSearchDet

List of all members.

Public Member Functions

virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est) const
 tests the geometrical compatibility of the Det with the predicted state.
virtual std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 Returns all Dets compatible with a trajectory state according to the estimator est.
virtual const std::vector
< const GeometricSearchDet * > & 
components () const
 Returns basic components, if any.
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 Similar to compatibleDets(), but the compatible Dets are grouped in one or more groups.
virtual bool hasGroups () const
 MuDetRing (const std::vector< const GeomDet * > &dets)
 Construct from a vector of GeomDet*.
 MuDetRing (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on GeomDet*.
virtual ~MuDetRing ()

Private Types

typedef PeriodicBinFinderInPhi
< float > 
BinFinderType

Private Member Functions

void init ()

Private Attributes

BinFinderType theBinFinder


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

typedef PeriodicBinFinderInPhi<float> MuDetRing::BinFinderType [private]

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*.

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

Construct from a vector of GeomDet*.

MuDetRing::~MuDetRing (  )  [virtual]

Definition at line 40 of file MuDetRing.cc.

00040 {}


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 lat::endl(), MeasurementEstimator::estimate(), TrajectoryStateOnSurface::globalPosition(), BoundDisk::innerRadius(), TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localPosition(), LogTrace, BoundDisk::outerRadius(), PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::position(), Propagator::propagate(), ForwardDetRing::specificSurface(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by compatibleDets().

00054                                                              {
00055   
00056   const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuDetRing";
00057   TrajectoryStateOnSurface ms = prop.propagate(ts,specificSurface());
00058   
00059   LogTrace(metname) << "MuDetRing::compatible, Surface at Z: " 
00060                     << specificSurface().position().z()
00061                     << " R1: " << specificSurface().innerRadius()
00062                     << " R2: " << specificSurface().outerRadius()
00063                     << " TS   at Z,R: " << ts.globalPosition().z() << ","
00064                     << ts.globalPosition().perp();
00065   if (ms.isValid()) {
00066     LogTrace(metname) << " DEST at Z,R: " << ms.globalPosition().z() << ","
00067                       << ms.globalPosition().perp()
00068                       << " local Z: "   << ms.localPosition().z()  << endl;
00069   }
00070   else
00071     LogTrace(metname) << " DEST: not valid" <<endl;
00072   
00073   
00074   if (ms.isValid()) return make_pair(est.estimate(ms, specificSurface()) != 0, ms);
00075   else return make_pair(false, ms);
00076 }

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::basicComponents(), PeriodicBinFinderInPhi< T >::binIndex(), compatible(), TrajectoryStateOnSurface::globalPosition(), BoundDisk::innerRadius(), int, LogTrace, BoundDisk::outerRadius(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GeometricSearchDet::position(), GloballyPositioned< T >::position(), HLT_VtxMuL3::result, ForwardDetRing::specificSurface(), funct::sqrt(), ForwardDetRing::surface(), theBinFinder, and PV3DBase< T, PVType, FrameType >::z().

00082                                                                   {
00083 
00084   const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuDetRing";
00085 
00086   LogTrace(metname) << "MuDetRing::compatibleDets, Surface at Z: " 
00087                     << surface().position().z()
00088                     << " R1: " << specificSurface().innerRadius()
00089                     << " R2: " << specificSurface().outerRadius()
00090                     << " TS at Z,R: " << startingState.globalPosition().z() << ","
00091                     << startingState.globalPosition().perp() << "     DetRing pos." << position();
00092 
00093   vector<DetWithState> result;
00094 
00095   // Propagate and check that the result is within bounds
00096   pair<bool, TrajectoryStateOnSurface> compat =
00097     compatible(startingState, prop, est);
00098   if (!compat.first) {
00099     LogTrace(metname) << "    MuDetRing::compatibleDets: not compatible"
00100                       << "    (should not have been selected!)";
00101     return result;
00102   }
00103   
00104   // Find the most probable destination component
00105   TrajectoryStateOnSurface& tsos = compat.second;
00106   GlobalPoint startPos = tsos.globalPosition();  
00107   int closest = theBinFinder.binIndex(startPos.phi());
00108   const vector<const GeomDet*> dets = basicComponents();
00109   LogTrace(metname) << "     MuDetRing::compatibleDets, closest det: " << closest 
00110                     << " Phi: " << dets[closest]->surface().position().phi()
00111                     << " impactPhi " << startPos.phi();
00112 
00113   // Add this detector, if it is compatible
00114   // NOTE: add performs a null propagation
00115   add(closest, result, tsos, prop, est);
00116 
00117   int nclosest = result.size(); int nnextdet=0; // MDEBUG counters
00118 
00119   // Try the neighbors on each side until no more compatible.
00120   float dphi=0;
00121   if (!result.empty()) { // If closest is not compatible the next cannot be either
00122     float nSigmas = 3.;
00123     if (result.back().second.hasError()) {
00124       dphi = nSigmas*      
00125         atan(sqrt(result.back().second.localError().positionError().xx())/
00126              result.back().second.globalPosition().perp());
00127     }  
00128   } else {
00129     LogTrace(metname) << "     MuDetRing::compatibleDets, closest not compatible!";
00130     //FIXME:  if closest is not compatible the next cannot be either
00131   }
00132   
00133   for (int idet=closest+1; idet < closest+int(dets.size())/4+1; idet++){
00134     // FIXME: should use dphi to decide if det must be queried.
00135     // Right now query until not compatible.
00136     int idetp = theBinFinder.binIndex(idet);
00137     {
00138       LogTrace(metname) << "     next det:" << idetp
00139                         << " at Z: " << dets[idetp]->position().z()
00140                         << " phi: " << dets[idetp]->position().phi()
00141                         << " FTS phi " << startPos.phi()
00142                         << " max dphi " << dphi;
00143       nnextdet++;      
00144       if ( !add(idetp, result, tsos, prop, est)) break;
00145     }
00146   }
00147   
00148   for (int idet=closest-1; idet > closest-int(dets.size())/4-1; idet--){
00149     // FIXME: should use dphi to decide if det must be queried.
00150     // Right now query until not compatible.
00151     int idetp = theBinFinder.binIndex(idet);
00152     {
00153       LogTrace(metname) << "     previous det:" << idetp << " " << idet << " " << closest-dets.size()/4-1
00154                         << " at Z: " << dets[idetp]->position().z()
00155                         << " phi: " << dets[idetp]->position().phi()
00156                         << " FTS phi " << startPos.phi()
00157                         << " max dphi" << dphi;
00158       nnextdet++;
00159       if ( !add(idetp, result, tsos, prop, est)) break;
00160     }
00161   }
00162   
00163   LogTrace(metname) << "     MuDetRing::compatibleDets, size: " << result.size()
00164                     << " on closest: " << nclosest << " # checked dets: " << nnextdet+1;
00165 
00166   if (result.size()==0) {
00167     LogTrace(metname) << "   ***Ring not compatible,should have been discarded before!!!";
00168   }
00169   
00170   return result;
00171 }

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 GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and HLT_VtxMuL3::result.

00044                             {
00045   // FIXME dummy impl.
00046   cout << "temporary dummy implementation of MuDetRing::components()!!" << endl;
00047   static vector<const GeometricSearchDet*> result;
00048   return result;
00049 }

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 GenMuonPlsPt100GeV_cfg::cout, lat::endl(), and HLT_VtxMuL3::result.

00177                                                                          {
00178   // FIXME should be implemented to allow returning  overlapping chambers
00179   // as separate groups!
00180   cout << "dummy implementation of MuDetRod::groupedCompatibleDets()" << endl;
00181   vector<DetGroup> result;
00182   return result;
00183 }

virtual bool MuDetRing::hasGroups (  )  const [inline, virtual]

Implements GeometricSearchDet.

Definition at line 51 of file MuDetRing.h.

00051 {return false;}

void MuDetRing::init ( void   )  [private]

Definition at line 34 of file MuDetRing.cc.

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

00035 {
00036   theBinFinder = BinFinderType(basicComponents().front()->position().phi(),
00037                                basicComponents().size());  
00038 }


Member Data Documentation

BinFinderType MuDetRing::theBinFinder [private]

Definition at line 55 of file MuDetRing.h.

Referenced by compatibleDets(), and init().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:25 2009 for CMSSW by  doxygen 1.5.4