CMS 3D CMS Logo

TIBLayer Class Reference

A concrete implementation for TIB layer built out of TIBRings. More...

#include <RecoTracker/TkDetLayers/interface/TIBLayer.h>

Inheritance diagram for TIBLayer:

BarrelDetLayer GeometricSearchDetWithGroups DetLayer GeometricSearchDet GeometricSearchDet

List of all members.

Public Member Functions

virtual const std::vector
< const GeomDet * > & 
basicComponents () 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 SubDetector subDetector () const
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap).
 TIBLayer (std::vector< const TIBRing * > &innerRings, std::vector< const TIBRing * > &outerRings)
 ~TIBLayer ()

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 &startingState, PropagationDirection propDir) const
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
BoundCylindercylinder (const std::vector< const GeometricSearchDet * > &rings)
bool overlap (const GlobalPoint &gpos, const GeometricSearchDet &ring, float window) 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
GeometricSearchDet * > & 
subLayer (int ind) const

Private Attributes

std::vector< const GeomDet * > theBasicComps
std::vector< const
GeometricSearchDet * > 
theComps
GeneralBinFinderInZforGeometricSearchDet
< float > 
theInnerBinFinder
std::vector< const
GeometricSearchDet * > 
theInnerComps
ReferenceCountingPointer
< BoundCylinder
theInnerCylinder
GeneralBinFinderInZforGeometricSearchDet
< float > 
theOuterBinFinder
std::vector< const
GeometricSearchDet * > 
theOuterComps
ReferenceCountingPointer
< BoundCylinder
theOuterCylinder


Detailed Description

A concrete implementation for TIB layer built out of TIBRings.

Definition at line 14 of file TIBLayer.h.


Constructor & Destructor Documentation

TIBLayer::TIBLayer ( std::vector< const TIBRing * > &  innerRings,
std::vector< const TIBRing * > &  outerRings 
)

TIBLayer::~TIBLayer (  ) 

Definition at line 91 of file TIBLayer.cc.

References i, and theComps.

00091                    {
00092   vector<const GeometricSearchDet*>::const_iterator i;
00093   for (i=theComps.begin(); i!=theComps.end(); i++) {
00094     delete *i;
00095   }
00096 } 


Member Function Documentation

bool TIBLayer::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*>& TIBLayer::basicComponents (  )  const [inline, virtual]

Implements GeometricSearchDet.

Definition at line 24 of file TIBLayer.h.

References theBasicComps.

00024 {return theBasicComps;}

virtual const std::vector<const GeometricSearchDet*>& TIBLayer::components (  )  const [inline, virtual]

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 26 of file TIBLayer.h.

References theComps.

00026 {return theComps;}

SubLayerCrossings TIBLayer::computeCrossings ( const TrajectoryStateOnSurface startingState,
PropagationDirection  propDir 
) const [private]

Definition at line 162 of file TIBLayer.cc.

References GeneralBinFinderInZforGeometricSearchDet< T >::binIndex(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), HelixBarrelCylinderCrossing::hasSolution(), HelixBarrelCylinderCrossing::position(), GloballyPositioned< T >::position(), rho, GeometricSearchDet::surface(), theInnerBinFinder, theInnerComps, theInnerCylinder, theOuterBinFinder, theOuterComps, theOuterCylinder, TrajectoryStateOnSurface::transverseCurvature(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by groupedCompatibleDetsV().

00164 {
00165   GlobalPoint startPos( startingState.globalPosition());
00166   GlobalVector startDir( startingState.globalMomentum());
00167   double rho( startingState.transverseCurvature());
00168 
00169   HelixBarrelCylinderCrossing innerCrossing( startPos, startDir, rho,
00170                                              propDir,*theInnerCylinder);
00171   if (!innerCrossing.hasSolution()) return SubLayerCrossings(); 
00172 
00173   GlobalPoint gInnerPoint( innerCrossing.position());
00174   int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.z());
00175   const GeometricSearchDet* innerRing( theInnerComps[innerIndex]);
00176   float innerDist = fabs( innerRing->surface().position().z() - gInnerPoint.z());
00177   SubLayerCrossing innerSLC( 0, innerIndex, gInnerPoint);
00178 
00179   HelixBarrelCylinderCrossing outerCrossing( startPos, startDir, rho,
00180                                              propDir,*theOuterCylinder);
00181   if (!outerCrossing.hasSolution()) return SubLayerCrossings();
00182 
00183   GlobalPoint gOuterPoint( outerCrossing.position());
00184   int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.z());
00185   const GeometricSearchDet* outerRing( theOuterComps[outerIndex]);
00186   float outerDist = fabs( outerRing->surface().position().z() - gOuterPoint.z());
00187   SubLayerCrossing outerSLC( 1, outerIndex, gOuterPoint);
00188 
00189   if (innerDist < outerDist) {
00190     return SubLayerCrossings( innerSLC, outerSLC, 0);
00191   }
00192   else {
00193     return SubLayerCrossings( outerSLC, innerSLC, 1);
00194   } 
00195 }

float TIBLayer::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const [private]

Definition at line 265 of file TIBLayer.cc.

References BoundSurface::bounds(), TrajectoryStateOnSurface::globalMomentum(), MeasurementEstimator::maximalLocalDisplacement(), GeomDet::surface(), funct::tan(), PV3DBase< T, PVType, FrameType >::theta(), Bounds::thickness(), and PV2DBase< T, PVType, FrameType >::y().

Referenced by groupedCompatibleDetsV().

00268 {
00269   // we assume the outer and inner rings have about same thickness...
00270 
00271 //   edm::LogInfo(TkDetLayers) << "TIBLayer::computeWindowSize: Y axis of tangent plane is"
00272 //        << plane.toGlobal( LocalVector(0,1,0)) ;
00273 
00274   MeasurementEstimator::Local2DVector localError( est.maximalLocalDisplacement(tsos, det->surface()));
00275   float yError = localError.y();
00276 
00277   float tanTheta = tan( tsos.globalMomentum().theta());
00278   float thickCorrection = det->surface().bounds().thickness() / (2.*fabs( tanTheta));
00279 
00280   // FIXME: correct this in case of wide phi window !  
00281 
00282   return yError + thickCorrection;
00283 }

BoundCylinder* TIBLayer::cylinder ( const std::vector< const GeometricSearchDet * > &  rings  )  [private]

void TIBLayer::groupedCompatibleDetsV ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
) const [virtual]

Reimplemented from GeometricSearchDet.

Definition at line 133 of file TIBLayer.cc.

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

00136                                                                       {
00137   SubLayerCrossings  crossings; 
00138   crossings = computeCrossings( tsos, prop.propagationDirection());
00139   if(! crossings.isValid()) return;
00140   
00141   vector<DetGroup> closestResult;
00142   addClosest( tsos, prop, est, crossings.closest(), closestResult);
00143   // this differs from compatibleDets logic, which checks next in such cases!!!
00144   if (closestResult.empty())    return;
00145   
00146   
00147   DetGroupElement closestGel( closestResult.front().front());
00148   float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
00149 
00150   searchNeighbors( tsos, prop, est, crossings.closest(), window,
00151                    closestResult, false);
00152 
00153   vector<DetGroup> nextResult;
00154   searchNeighbors( tsos, prop, est, crossings.other(), window,
00155                    nextResult, true);
00156 
00157   int crossingSide = LayerCrossingSide().barrelSide( closestGel.trajectoryState(), prop);
00158   DetGroupMerger::orderAndMergeTwoLevels( closestResult, nextResult, result, 
00159                                           crossings.closestIndex(), crossingSide);
00160 }

bool TIBLayer::overlap ( const GlobalPoint gpos,
const GeometricSearchDet ring,
float  window 
) const [private]

Definition at line 248 of file TIBLayer.cc.

References BoundSurface::bounds(), Bounds::length(), GeometricSearchDet::position(), GeometricSearchDet::surface(), and PV3DBase< T, PVType, FrameType >::z().

00251 {
00252   float halfLength = det.surface().bounds().length()/2.;
00253 
00254 //   edm::LogInfo(TkDetLayers) << " TIBLayer: checking ring with z " << det.position().z();
00255 
00256   if ( fabs( crossPoint.z()-det.position().z()) < (halfLength + window)) {
00257 //     edm::LogInfo(TkDetLayers) << "    PASSED" ;
00258     return true;
00259   } else {
00260 //     edm::LogInfo(TkDetLayers) << "    FAILED " ;
00261     return false;
00262   }
00263 }

void TIBLayer::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 SubDetector TIBLayer::subDetector (  )  const [inline, virtual]

The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap).

Implements DetLayer.

Definition at line 34 of file TIBLayer.h.

References GeomDetEnumerators::TIB.

00034 {return GeomDetEnumerators::TIB;}

const std::vector<const GeometricSearchDet*>& TIBLayer::subLayer ( int  ind  )  const [inline, private]

Definition at line 63 of file TIBLayer.h.

References theInnerComps, and theOuterComps.

00063                                                                        {
00064     return (ind==0 ? theInnerComps : theOuterComps);
00065   }


Member Data Documentation

std::vector<const GeomDet*> TIBLayer::theBasicComps [private]

Definition at line 72 of file TIBLayer.h.

Referenced by basicComponents().

std::vector<const GeometricSearchDet*> TIBLayer::theComps [private]

Definition at line 69 of file TIBLayer.h.

Referenced by components(), and ~TIBLayer().

GeneralBinFinderInZforGeometricSearchDet<float> TIBLayer::theInnerBinFinder [private]

Definition at line 77 of file TIBLayer.h.

Referenced by computeCrossings().

std::vector<const GeometricSearchDet*> TIBLayer::theInnerComps [private]

Definition at line 70 of file TIBLayer.h.

Referenced by computeCrossings(), and subLayer().

ReferenceCountingPointer<BoundCylinder> TIBLayer::theInnerCylinder [private]

Definition at line 74 of file TIBLayer.h.

Referenced by computeCrossings().

GeneralBinFinderInZforGeometricSearchDet<float> TIBLayer::theOuterBinFinder [private]

Definition at line 78 of file TIBLayer.h.

Referenced by computeCrossings().

std::vector<const GeometricSearchDet*> TIBLayer::theOuterComps [private]

Definition at line 71 of file TIBLayer.h.

Referenced by computeCrossings(), and subLayer().

ReferenceCountingPointer<BoundCylinder> TIBLayer::theOuterCylinder [private]

Definition at line 75 of file TIBLayer.h.

Referenced by computeCrossings().


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