CMS 3D CMS Logo

TOBLayer Class Reference

A concrete implementation for TOB layer built out of TOBRods. More...

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

Inheritance diagram for TOBLayer:

RodBarrelLayer GeometricSearchDetWithGroups BarrelDetLayer GeometricSearchDet DetLayer GeometricSearchDet

List of all members.

Public Types

typedef PeriodicBinFinderInPhi
< double > 
BinFinderType

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).
 TOBLayer (std::vector< const TOBRod * > &innerRods, std::vector< const TOBRod * > &outerRods)
 ~TOBLayer ()

Private Member Functions

bool addClosest (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const
double calculatePhiWindow (double Xmax, const GeomDet &det, const TrajectoryStateOnSurface &state) const
SubLayerCrossings computeCrossings (const TrajectoryStateOnSurface &tsos, PropagationDirection propDir) const
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
BoundCylindercylinder (const std::vector< const GeometricSearchDet * > &rods) const
bool overlap (const GlobalPoint &gpos, const GeometricSearchDet &rod, float phiWin) 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
BinFinderType theInnerBinFinder
std::vector< const
GeometricSearchDet * > 
theInnerComps
ReferenceCountingPointer
< BoundCylinder
theInnerCylinder
BinFinderType theOuterBinFinder
std::vector< const
GeometricSearchDet * > 
theOuterComps
ReferenceCountingPointer
< BoundCylinder
theOuterCylinder


Detailed Description

A concrete implementation for TOB layer built out of TOBRods.

Definition at line 14 of file TOBLayer.h.


Member Typedef Documentation

typedef PeriodicBinFinderInPhi<double> TOBLayer::BinFinderType

Definition at line 16 of file TOBLayer.h.


Constructor & Destructor Documentation

TOBLayer::TOBLayer ( std::vector< const TOBRod * > &  innerRods,
std::vector< const TOBRod * > &  outerRods 
)

TOBLayer::~TOBLayer (  ) 

Definition at line 86 of file TOBLayer.cc.

References i, and theComps.

00086                    {
00087   vector<const GeometricSearchDet*>::const_iterator i;
00088   for (i=theComps.begin(); i!=theComps.end(); i++) {
00089     delete *i;
00090   }
00091 } 


Member Function Documentation

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

Implements GeometricSearchDet.

Definition at line 25 of file TOBLayer.h.

References theBasicComps.

00025 {return theBasicComps;}

double TOBLayer::calculatePhiWindow ( double  Xmax,
const GeomDet det,
const TrajectoryStateOnSurface state 
) const [private]

Definition at line 191 of file TOBLayer.cc.

References PV3DBase< T, PVType, FrameType >::barePhi(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::localPosition(), min, GeomDet::surface(), and Surface::toGlobal().

Referenced by computeWindowSize().

00193 {
00194 
00195   LocalPoint startPoint = state.localPosition();
00196   LocalVector shift( Xmax , 0. , 0.);
00197   LocalPoint shift1 = startPoint + shift;
00198   LocalPoint shift2 = startPoint + (-shift); 
00199   //LocalPoint shift2( startPoint); //original code;
00200   //shift2 -= shift;
00201 
00202   double phi1 = det.surface().toGlobal(shift1).barePhi();
00203   double phi2 = det.surface().toGlobal(shift2).barePhi();
00204   double phiStart = state.globalPosition().barePhi();
00205   double phiWin = min(fabs(phiStart-phi1),fabs(phiStart-phi2));
00206 
00207   return phiWin;
00208 }

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

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 27 of file TOBLayer.h.

References theComps.

00027 {return theComps;}

SubLayerCrossings TOBLayer::computeCrossings ( const TrajectoryStateOnSurface tsos,
PropagationDirection  propDir 
) const [private]

Definition at line 131 of file TOBLayer.cc.

References PeriodicBinFinderInPhi< T >::binIndex(), PeriodicBinFinderInPhi< T >::binPosition(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), HelixBarrelCylinderCrossing::hasSolution(), Geom::pi(), HelixBarrelCylinderCrossing::position(), rho, theInnerBinFinder, theInnerCylinder, theOuterBinFinder, theOuterCylinder, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

00133 {
00134   GlobalPoint startPos( startingState.globalPosition());
00135   GlobalVector startDir( startingState.globalMomentum());
00136   double rho( startingState.transverseCurvature());
00137 
00138   HelixBarrelCylinderCrossing innerCrossing( startPos, startDir, rho,
00139                                              propDir,*theInnerCylinder);
00140   if (!innerCrossing.hasSolution()) return SubLayerCrossings();
00141 
00142   GlobalPoint gInnerPoint( innerCrossing.position());
00143   int innerIndex = theInnerBinFinder.binIndex(gInnerPoint.phi());
00144   float innerDist = theInnerBinFinder.binPosition(innerIndex) - gInnerPoint.phi();
00145   SubLayerCrossing innerSLC( 0, innerIndex, gInnerPoint);
00146 
00147   HelixBarrelCylinderCrossing outerCrossing( startPos, startDir, rho,
00148                                              propDir,*theOuterCylinder);
00149   if (!outerCrossing.hasSolution()) return SubLayerCrossings();
00150 
00151   GlobalPoint gOuterPoint( outerCrossing.position());
00152   int outerIndex = theOuterBinFinder.binIndex(gOuterPoint.phi());
00153   float outerDist = theOuterBinFinder.binPosition(outerIndex) - gOuterPoint.phi() ;
00154   SubLayerCrossing outerSLC( 1, outerIndex, gOuterPoint);
00155   
00156   innerDist *= PhiLess()( theInnerBinFinder.binPosition(innerIndex),gInnerPoint.phi()) ? -1. : 1.; 
00157   outerDist *= PhiLess()( theOuterBinFinder.binPosition(outerIndex),gOuterPoint.phi()) ? -1. : 1.; 
00158   if (innerDist < 0.) { innerDist += 2.*Geom::pi();}
00159   if (outerDist < 0.) { outerDist += 2.*Geom::pi();}
00160   
00161 
00162   if (innerDist < outerDist) {
00163     return SubLayerCrossings( innerSLC, outerSLC, 0);
00164   }
00165   else {
00166     return SubLayerCrossings( outerSLC, innerSLC, 1);
00167   } 
00168 }

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

Definition at line 181 of file TOBLayer.cc.

References calculatePhiWindow(), MeasurementEstimator::maximalLocalDisplacement(), GeomDet::surface(), and x.

Referenced by groupedCompatibleDetsV().

00184 {
00185   double xmax = 
00186     est.maximalLocalDisplacement(tsos, det->surface()).x();
00187   return calculatePhiWindow( xmax, *det, tsos);
00188 }

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

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

Reimplemented from GeometricSearchDet.

Definition at line 96 of file TOBLayer.cc.

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

00100 {
00101   SubLayerCrossings crossings;
00102   crossings = computeCrossings( tsos, prop.propagationDirection());
00103   if(! crossings.isValid()) return;
00104 
00105   vector<DetGroup> closestResult;
00106   addClosest( tsos, prop, est, crossings.closest(), closestResult);
00107   if (closestResult.empty()){
00108     addClosest( tsos, prop, est, crossings.other(), result);
00109     return;
00110   }
00111   
00112   DetGroupElement closestGel( closestResult.front().front());
00113   float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
00114 
00115   searchNeighbors( tsos, prop, est, crossings.closest(), window,
00116                    closestResult, false);
00117   
00118   vector<DetGroup> nextResult;
00119   searchNeighbors( tsos, prop, est, crossings.other(), window,
00120                    nextResult, true);
00121   
00122   int crossingSide = LayerCrossingSide().barrelSide( closestGel.trajectoryState(), prop);
00123   DetGroupMerger::orderAndMergeTwoLevels( closestResult, nextResult, result,
00124                                           crossings.closestIndex(), crossingSide);
00125 }

bool TOBLayer::overlap ( const GlobalPoint gpos,
const GeometricSearchDet rod,
float  phiWin 
) const [private]

Definition at line 254 of file TOBLayer.cc.

References PV3DBase< T, PVType, FrameType >::phi(), BoundSurface::phiSpan(), rangesIntersect(), and GeometricSearchDet::surface().

00255 {
00256   GlobalPoint crossPoint(gpos);
00257 
00258   // introduce offset (extrapolated point and true propagated point differ by 0.0003 - 0.00033, 
00259   // due to thickness of Rod of 1 cm) 
00260   const float phiOffset = 0.00034;  //...TOBE CHECKED LATER...
00261   phiWin += phiOffset;
00262 
00263   // detector phi range
00264   std::pair<float,float> phiRange(crossPoint.phi()-phiWin, crossPoint.phi()+phiWin);
00265 
00266   //   // debug
00267   //   edm::LogInfo(TkDetLayers) ;
00268   //   edm::LogInfo(TkDetLayers) << " overlapInPhi: position, det phi range " 
00269   //        << "("<< rod.position().perp() << ", " << rod.position().phi() << ")  "
00270   //        << rodRange.phiRange().first << " " << rodRange.phiRange().second ;
00271   //   edm::LogInfo(TkDetLayers) << " overlapInPhi: cross point phi, window " << crossPoint.phi() << " " << phiWin ;
00272   //   edm::LogInfo(TkDetLayers) << " overlapInPhi: search window: " << crossPoint.phi()-phiWin << "  " << crossPoint.phi()+phiWin ;
00273 
00274   return rangesIntersect(phiRange, gsdet.surface().phiSpan(), PhiLess());
00275 } 

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

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

Implements DetLayer.

Definition at line 36 of file TOBLayer.h.

References GeomDetEnumerators::TOB.

00036 {return GeomDetEnumerators::TOB;}

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

Definition at line 69 of file TOBLayer.h.

References theInnerComps, and theOuterComps.

00069                                                                        {
00070     return (ind==0 ? theInnerComps : theOuterComps);}


Member Data Documentation

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

Definition at line 79 of file TOBLayer.h.

Referenced by basicComponents().

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

Definition at line 76 of file TOBLayer.h.

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

BinFinderType TOBLayer::theInnerBinFinder [private]

Definition at line 81 of file TOBLayer.h.

Referenced by computeCrossings().

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

Definition at line 77 of file TOBLayer.h.

Referenced by subLayer().

ReferenceCountingPointer<BoundCylinder> TOBLayer::theInnerCylinder [private]

Definition at line 84 of file TOBLayer.h.

Referenced by computeCrossings().

BinFinderType TOBLayer::theOuterBinFinder [private]

Definition at line 82 of file TOBLayer.h.

Referenced by computeCrossings().

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

Definition at line 78 of file TOBLayer.h.

Referenced by subLayer().

ReferenceCountingPointer<BoundCylinder> TOBLayer::theOuterCylinder [private]

Definition at line 85 of file TOBLayer.h.

Referenced by computeCrossings().


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