CMS 3D CMS Logo

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

MuDetRod Class Reference

#include <MuDetRod.h>

Inheritance diagram for MuDetRod:
DetRodOneR DetRod 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
 MuDetRod (const std::vector< const GeomDet * > &dets)
 Construct from a std::vector of GeomDet*.
 MuDetRod (std::vector< const GeomDet * >::const_iterator first, std::vector< const GeomDet * >::const_iterator last)
 Construct from iterators on GeomDet*.
virtual ~MuDetRod ()
 Destructor.

Private Types

typedef GenericBinFinderInZ
< float, GeomDet
BinFinderType

Private Member Functions

void init ()

Private Attributes

BinFinderType theBinFinder

Detailed Description

A rod of aligned equal-sized non-overlapping detectors. Designed for barrel muon DT/RPC chambers.

Date:
2007/07/08 04:19:44
Revision:
1.5
Author:
N. Amapane - INFN Torino

Definition at line 19 of file MuDetRod.h.


Member Typedef Documentation

Definition at line 56 of file MuDetRod.h.


Constructor & Destructor Documentation

MuDetRod::MuDetRod ( std::vector< const GeomDet * >::const_iterator  first,
std::vector< const GeomDet * >::const_iterator  last 
)

Construct from iterators on GeomDet*.

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

Construct from a std::vector of GeomDet*.

MuDetRod::~MuDetRod ( ) [virtual]

Destructor.

Definition at line 36 of file MuDetRod.cc.

{}

Member Function Documentation

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

References MeasurementEstimator::estimate(), TrajectoryStateOnSurface::isValid(), Propagator::propagate(), and DetRod::specificSurface().

Referenced by compatibleDets().

                                                            {
  
  TrajectoryStateOnSurface ms = prop.propagate(ts,specificSurface());
  if (ms.isValid()) return make_pair(est.estimate(ms, specificSurface()) != 0, ms);
  else return make_pair(false, ms);
}
vector< GeometricSearchDet::DetWithState > MuDetRod::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 58 of file MuDetRod.cc.

References DetRodOneR::add(), DetRodOneR::basicComponents(), GenericBinFinderInZ< T, G >::binIndex(), BoundSurface::bounds(), compatible(), TrajectoryStateOnSurface::globalPosition(), Bounds::length(), LogTrace, MeasurementEstimator::maximalLocalDisplacement(), metname, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), query::result, AlCaHLTBitMon_QueryRunRegistry::string, DetRod::surface(), theBinFinder, toLocal(), PV3DBase< T, PVType, FrameType >::y(), PV2DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

                                                                 {
  const std::string metname = "Muon|RecoMuon|RecoMuonDetLayers|MuDetRod";
  
  LogTrace(metname) << "MuDetRod::compatibleDets, Surface at R,phi: " 
                    << surface().position().perp()  << ","
                    << surface().position().phi() << "     DetRod pos.";
    // FIXME        << " TS at R,phi: " << startingState.position().perp() << ","
    //              << startingState.position().phi()

    
  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) << "    MuDetRod::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.z());
  const vector<const GeomDet*> dets = basicComponents();
  LogTrace(metname) << "     MuDetRod::compatibleDets, closest det: " << closest 
                    << " pos: " << dets[closest]->surface().position()
                    << " impact " << startPos;
  
  // 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; // just DEBUG counters
  
  // Try the neighbors on each side until no more compatible.
  // If closest is not compatible the next cannot be either
  if (!result.empty()) {
    const BoundPlane& closestPlane(dets[closest]->surface());
    MeasurementEstimator::Local2DVector maxDistance = 
      est.maximalLocalDisplacement( result.front().second, closestPlane);
    
    // detHalfLen is assumed to be the same for all detectors.
    float detHalfLen = closestPlane.bounds().length()/2.;
    
    for (unsigned int idet=closest+1; idet < dets.size(); idet++) {
      LocalPoint nextPos(dets[idet]->toLocal(startPos));
      if (fabs(nextPos.y()) < detHalfLen + maxDistance.y()) { 
        LogTrace(metname) << "     negativeZ: det:" << idet
                          << " pos " << nextPos.y()
                          << " maxDistance " << maxDistance.y();
        nnextdet++;
        if ( !add(idet, result, tsos, prop, est)) break;
      } else {
        break;
      }
    }
    
    for (int idet=closest-1; idet >= 0; idet--) {
      LocalPoint nextPos( dets[idet]->toLocal(startPos));
      if (fabs(nextPos.y()) < detHalfLen + maxDistance.y()) {
        LogTrace(metname) << "     positiveZ: det:" << idet
                          << " pos " << nextPos.y()
                          << " maxDistance " << maxDistance.y();
        nnextdet++;
        if ( !add(idet, result, tsos, prop, est)) break;
      } else {
        break;
      }
    }
  }
  
  LogTrace(metname) << "     MuDetRod::compatibleDets, size: " << result.size()
                    << " on closest: " << nclosest
                    << " # checked dets: " << nnextdet+1;
  if (result.size()==0) {
    LogTrace(metname) << "   ***Rod not compatible---should have been discarded before!!!";
  }
  return result;
}
const vector< const GeometricSearchDet * > & MuDetRod::components ( ) const [virtual]

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 39 of file MuDetRod.cc.

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

                           {

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

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

                                                                        {
  // FIXME should return only 1 group 
  cout << "dummy implementation of MuDetRod::groupedCompatibleDets()" << endl;
  vector<DetGroup> result;
  return result;
}
virtual bool MuDetRod::hasGroups ( ) const [inline, virtual]

Implements GeometricSearchDet.

Definition at line 52 of file MuDetRod.h.

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

Member Data Documentation

Definition at line 57 of file MuDetRod.h.

Referenced by compatibleDets(), and init().