CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

MuDetRing Class Reference

#include <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
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.
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
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

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.

{}

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

Referenced by compatibleDets().

                                                             {
  
  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuDetRing";
  TrajectoryStateOnSurface ms = prop.propagate(ts,specificSurface());
  
  LogTrace(metname) << "MuDetRing::compatible, Surface at Z: " 
                    << specificSurface().position().z()
                    << " R1: " << specificSurface().innerRadius()
                    << " R2: " << specificSurface().outerRadius()
                    << " TS   at Z,R: " << ts.globalPosition().z() << ","
                    << ts.globalPosition().perp();
  if (ms.isValid()) {
    LogTrace(metname) << " DEST at Z,R: " << ms.globalPosition().z() << ","
                      << ms.globalPosition().perp()
                      << " local Z: "   << ms.localPosition().z()  << endl;
  }
  else
    LogTrace(metname) << " DEST: not valid" <<endl;
  
  
  if (ms.isValid()) return make_pair(est.estimate(ms, specificSurface()) != 0, ms);
  else return make_pair(false, ms);
}
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(), BoundDisk::innerRadius(), LogTrace, metname, BoundDisk::outerRadius(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GeometricSearchDet::position(), GloballyPositioned< T >::position(), query::result, ForwardDetRing::specificSurface(), mathSSE::sqrt(), ForwardDetRing::surface(), theBinFinder, and PV3DBase< T, PVType, FrameType >::z().

                                                                  {

  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuDetRing";

  LogTrace(metname) << "MuDetRing::compatibleDets, Surface at Z: " 
                    << surface().position().z()
                    << " R1: " << specificSurface().innerRadius()
                    << " R2: " << specificSurface().outerRadius()
                    << " TS at Z,R: " << startingState.globalPosition().z() << ","
                    << startingState.globalPosition().perp() << "     DetRing pos." << position();

  vector<DetWithState> result;

  // Propagate and check that the result is within bounds
  pair<bool, TrajectoryStateOnSurface> compat =
    compatible(startingState, prop, est);
  if (!compat.first) {
    LogTrace(metname) << "    MuDetRing::compatibleDets: not compatible"
                      << "    (should not have been selected!)";
    return result;
  }
  
  // Find the most probable destination component
  TrajectoryStateOnSurface& tsos = compat.second;
  GlobalPoint startPos = tsos.globalPosition();  
  int closest = theBinFinder.binIndex(startPos.phi());
  const vector<const GeomDet*> dets = basicComponents();
  LogTrace(metname) << "     MuDetRing::compatibleDets, closest det: " << closest 
                    << " Phi: " << dets[closest]->surface().position().phi()
                    << " impactPhi " << startPos.phi();

  // Add this detector, if it is compatible
  // NOTE: add performs a null propagation
  add(closest, result, tsos, prop, est);

  int nclosest = result.size(); int nnextdet=0; // MDEBUG counters

  // Try the neighbors on each side until no more compatible.
  float dphi=0;
  if (!result.empty()) { // If closest is not compatible the next cannot be either
    float nSigmas = 3.;
    if (result.back().second.hasError()) {
      dphi = nSigmas*      
        atan(sqrt(result.back().second.localError().positionError().xx())/
             result.back().second.globalPosition().perp());
    }  
  } else {
    LogTrace(metname) << "     MuDetRing::compatibleDets, closest not compatible!";
    //FIXME:  if closest is not compatible the next cannot be either
  }
  
  for (int idet=closest+1; idet < closest+int(dets.size())/4+1; idet++){
    // FIXME: should use dphi to decide if det must be queried.
    // Right now query until not compatible.
    int idetp = theBinFinder.binIndex(idet);
    {
      LogTrace(metname) << "     next det:" << idetp
                        << " at Z: " << dets[idetp]->position().z()
                        << " phi: " << dets[idetp]->position().phi()
                        << " FTS phi " << startPos.phi()
                        << " max dphi " << dphi;
      nnextdet++;      
      if ( !add(idetp, result, tsos, prop, est)) break;
    }
  }
  
  for (int idet=closest-1; idet > closest-int(dets.size())/4-1; idet--){
    // FIXME: should use dphi to decide if det must be queried.
    // Right now query until not compatible.
    int idetp = theBinFinder.binIndex(idet);
    {
      LogTrace(metname) << "     previous det:" << idetp << " " << idet << " " << closest-dets.size()/4-1
                        << " at Z: " << dets[idetp]->position().z()
                        << " phi: " << dets[idetp]->position().phi()
                        << " FTS phi " << startPos.phi()
                        << " max dphi" << dphi;
      nnextdet++;
      if ( !add(idetp, result, tsos, prop, est)) break;
    }
  }
  
  LogTrace(metname) << "     MuDetRing::compatibleDets, size: " << result.size()
                    << " on closest: " << nclosest << " # checked dets: " << nnextdet+1;

  if (result.size()==0) {
    LogTrace(metname) << "   ***Ring not compatible,should have been discarded before!!!";
  }
  
  return result;
}
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.

                            {
  // FIXME dummy impl.
  cout << "temporary dummy implementation of MuDetRing::components()!!" << endl;
  static vector<const GeometricSearchDet*> result;
  return result;
}
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.

                                                                         {
  // FIXME should be implemented to allow returning  overlapping chambers
  // as separate groups!
  cout << "dummy implementation of MuDetRod::groupedCompatibleDets()" << endl;
  vector<DetGroup> result;
  return result;
}
virtual bool MuDetRing::hasGroups ( ) const [inline, virtual]

Implements GeometricSearchDet.

Definition at line 51 of file MuDetRing.h.

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

Member Data Documentation

Definition at line 55 of file MuDetRing.h.

Referenced by compatibleDets(), and init().