CMS 3D CMS Logo

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

TIDRing Class Reference

#include <TIDRing.h>

Inheritance diagram for TIDRing:
GeometricSearchDetWithGroups GeometricSearchDet

List of all members.

Public Member Functions

virtual const std::vector
< const GeomDet * > & 
basicComponents () const
virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
virtual const std::vector
< const GeometricSearchDet * > & 
components () const
 Returns basic components, if any.
void groupedCompatibleDetsV (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
virtual const BoundDiskspecificSurface () const
virtual const BoundSurfacesurface () const
 The surface of the GeometricSearchDet.
 TIDRing (std::vector< const GeomDet * > &innerDets, std::vector< const GeomDet * > &outerDets)
 ~TIDRing ()

Private Types

typedef PeriodicBinFinderInPhi
< double > 
BinFinderType

Private Member Functions

bool addClosest (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const
SubLayerCrossings computeCrossings (const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const
void searchNeighbors (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const
const std::vector< const
GeomDet * > & 
subLayer (int ind) const

Private Attributes

BinFinderType theBackBinFinder
std::vector< const GeomDet * > theBackDets
ReferenceCountingPointer
< BoundDisk
theBackDisk
std::vector< const GeomDet * > theDets
ReferenceCountingPointer
< BoundDisk
theDisk
BinFinderType theFrontBinFinder
std::vector< const GeomDet * > theFrontDets
ReferenceCountingPointer
< BoundDisk
theFrontDisk

Detailed Description

A concrete implementation for TID rings

Definition at line 13 of file TIDRing.h.


Member Typedef Documentation

Definition at line 74 of file TIDRing.h.


Constructor & Destructor Documentation

TIDRing::TIDRing ( std::vector< const GeomDet * > &  innerDets,
std::vector< const GeomDet * > &  outerDets 
)

Definition at line 25 of file TIDRing.cc.

References LogDebug, theBackBinFinder, theBackDets, theBackDisk, theDets, theDisk, theFrontBinFinder, theFrontDets, and theFrontDisk.

                                                   :
  theFrontDets(innerDets.begin(),innerDets.end()), 
  theBackDets(outerDets.begin(),outerDets.end())
{
  theDets.assign(theFrontDets.begin(),theFrontDets.end());
  theDets.insert(theDets.end(),theBackDets.begin(),theBackDets.end());


  // the dets should be already phi-ordered. TO BE CHECKED
  //sort( theFrontDets.begin(), theFrontDets.end(), DetLessPhi() );
  //sort( theBackDets.begin(), theBackDets.end(), DetLessPhi() );

  theDisk = ForwardRingDiskBuilderFromDet()( theDets );

  theFrontDisk = ForwardRingDiskBuilderFromDet()( theFrontDets );
  theBackDisk  = ForwardRingDiskBuilderFromDet()( theBackDets );

  theFrontBinFinder = BinFinderType( theFrontDets.front()->surface().position().phi(),
                                     theFrontDets.size());
  theBackBinFinder  = BinFinderType( theBackDets.front()->surface().position().phi(),
                                     theBackDets.size());  


  
  LogDebug("TkDetLayers") << "DEBUG INFO for TIDRing" ;
  for(vector<const GeomDet*>::const_iterator it=theFrontDets.begin(); 
      it!=theFrontDets.end(); it++){
    LogDebug("TkDetLayers") << "frontDet phi,z,r: " 
                            << (*it)->surface().position().phi()  << " , "
                            << (*it)->surface().position().z()    << " , "
                            << (*it)->surface().position().perp() ;
  }

  for(vector<const GeomDet*>::const_iterator it=theBackDets.begin(); 
      it!=theBackDets.end(); it++){
    LogDebug("TkDetLayers") << "backDet phi,z,r: " 
                            << (*it)->surface().position().phi() << " , "
                            << (*it)->surface().position().z()   << " , "
                            << (*it)->surface().position().perp() ;
  }


}
TIDRing::~TIDRing ( )

Definition at line 70 of file TIDRing.cc.

                 {

} 

Member Function Documentation

bool TIDRing::addClosest ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubLayerCrossing crossing,
std::vector< DetGroup > &  result 
) const [private]

Referenced by groupedCompatibleDetsV().

virtual const std::vector<const GeomDet*>& TIDRing::basicComponents ( ) const [inline, virtual]

Implements GeometricSearchDet.

Definition at line 22 of file TIDRing.h.

References theDets.

{return theDets;}
pair< bool, TrajectoryStateOnSurface > TIDRing::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 82 of file TIDRing.cc.

                                                    {
  edm::LogError("TkDetLayers") << "temporary dummy implementation of TIDRing::compatible()!!" ;
  return pair<bool,TrajectoryStateOnSurface>();
}
const vector< const GeometricSearchDet * > & TIDRing::components ( ) const [virtual]

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 75 of file TIDRing.cc.

{
  throw DetLayerException("TIDRing doesn't have GeometricSearchDet components");
}
SubLayerCrossings TIDRing::computeCrossings ( const TrajectoryStateOnSurface tsos,
PropagationDirection  propDir 
) const [private]

Definition at line 120 of file TIDRing.cc.

References abs, PeriodicBinFinderInPhi< T >::binIndex(), Geom::deltaPhi(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), GloballyPositioned< T >::phi(), rho, surface(), theBackBinFinder, theBackDets, theBackDisk, theFrontBinFinder, theFrontDets, theFrontDisk, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

{
  double rho( startingState.transverseCurvature());
  
  HelixPlaneCrossing::PositionType startPos( startingState.globalPosition() );
  HelixPlaneCrossing::DirectionType startDir( startingState.globalMomentum() );
  HelixForwardPlaneCrossing crossing(startPos,startDir,rho,propDir);

  pair<bool,double> frontPath = crossing.pathLength( *theFrontDisk);
  if (!frontPath.first) return SubLayerCrossings();

  GlobalPoint gFrontPoint(crossing.position(frontPath.second));

  int frontIndex = theFrontBinFinder.binIndex(gFrontPoint.phi()); 
  SubLayerCrossing frontSLC( 0, frontIndex, gFrontPoint);



  pair<bool,double> backPath = crossing.pathLength( *theBackDisk);
  if (!backPath.first) return SubLayerCrossings();

  GlobalPoint gBackPoint( crossing.position(backPath.second));
  int backIndex = theBackBinFinder.binIndex(gBackPoint.phi());
  SubLayerCrossing backSLC( 1, backIndex, gBackPoint);

  
  // 0ss: frontDisk has index=0, backDisk has index=1
  float frontDist = std::abs(Geom::deltaPhi( double(gFrontPoint.barePhi()), 
                                             double(theFrontDets[frontIndex]->surface().phi())));
  float backDist = std::abs(Geom::deltaPhi( double(gBackPoint.barePhi()), 
                                            double(theBackDets[backIndex]->surface().phi())));


  if (frontDist < backDist) {
    return SubLayerCrossings( frontSLC, backSLC, 0);
  }
  else {
    return SubLayerCrossings( backSLC, frontSLC, 1);
  } 
}
void TIDRing::groupedCompatibleDetsV ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
) const [virtual]

Reimplemented from GeometricSearchDet.

Definition at line 91 of file TIDRing.cc.

References addClosest(), SubLayerCrossings::closest(), SubLayerCrossings::closestIndex(), computeCrossings(), tkDetUtil::computeWindowSize(), LayerCrossingSide::endcapSide(), SubLayerCrossings::isValid(), DetGroupMerger::orderAndMergeTwoLevels(), SubLayerCrossings::other(), Propagator::propagationDirection(), and searchNeighbors().

{
  SubLayerCrossings  crossings; 
  crossings = computeCrossings( tsos, prop.propagationDirection());
  if(! crossings.isValid()) return;

  std::vector<DetGroup> closestResult;
  addClosest( tsos, prop, est, crossings.closest(), closestResult); 
  if (closestResult.empty())     return;
  
  DetGroupElement closestGel( closestResult.front().front());  
  float phiWindow =  tkDetUtil::computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est); 
  searchNeighbors( tsos, prop, est, crossings.closest(), phiWindow,
                   closestResult, false); 

  vector<DetGroup> nextResult;
  searchNeighbors( tsos, prop, est, crossings.other(), phiWindow,
                   nextResult, true); 

  int crossingSide = LayerCrossingSide().endcapSide( closestGel.trajectoryState(), prop);
  DetGroupMerger::orderAndMergeTwoLevels( closestResult, nextResult, result,
                                          crossings.closestIndex(), crossingSide);
}
void TIDRing::searchNeighbors ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubLayerCrossing crossing,
float  window,
std::vector< DetGroup > &  result,
bool  checkClosest 
) const [private]

Referenced by groupedCompatibleDetsV().

virtual const BoundDisk& TIDRing::specificSurface ( ) const [inline, virtual]

Definition at line 37 of file TIDRing.h.

References theDisk.

{return *theDisk;}
const std::vector<const GeomDet*>& TIDRing::subLayer ( int  ind) const [inline, private]

Definition at line 60 of file TIDRing.h.

References theBackDets, and theFrontDets.

                                                            {
    return (ind==0 ? theFrontDets : theBackDets);
  }
virtual const BoundSurface& TIDRing::surface ( ) const [inline, virtual]

The surface of the GeometricSearchDet.

Implements GeometricSearchDet.

Definition at line 20 of file TIDRing.h.

References theDisk.

Referenced by computeCrossings().

{return *theDisk;}

Member Data Documentation

Definition at line 77 of file TIDRing.h.

Referenced by computeCrossings(), and TIDRing().

std::vector<const GeomDet*> TIDRing::theBackDets [private]

Definition at line 68 of file TIDRing.h.

Referenced by computeCrossings(), subLayer(), and TIDRing().

Definition at line 72 of file TIDRing.h.

Referenced by computeCrossings(), and TIDRing().

std::vector<const GeomDet*> TIDRing::theDets [private]

Definition at line 66 of file TIDRing.h.

Referenced by basicComponents(), and TIDRing().

Definition at line 70 of file TIDRing.h.

Referenced by specificSurface(), surface(), and TIDRing().

Definition at line 76 of file TIDRing.h.

Referenced by computeCrossings(), and TIDRing().

std::vector<const GeomDet*> TIDRing::theFrontDets [private]

Definition at line 67 of file TIDRing.h.

Referenced by computeCrossings(), subLayer(), and TIDRing().

Definition at line 71 of file TIDRing.h.

Referenced by computeCrossings(), and TIDRing().