CMS 3D CMS Logo

CompositeTECWedge Class Reference

A concrete implementation for TEC layer built out of TECPetals. More...

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

Inheritance diagram for CompositeTECWedge:

TECWedge 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 &ts, const Propagator &, const MeasurementEstimator &) const
 tests the geometrical compatibility of the Det with the predicted state.
virtual const std::vector
< const GeometricSearchDet * > & 
components () const
 Returns basic components, if any.
 CompositeTECWedge (std::vector< const GeomDet * > &innerDets, std::vector< const GeomDet * > &outerDets)
virtual void groupedCompatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
 ~CompositeTECWedge ()

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
int findClosestDet (const GlobalPoint &startPos, int sectorId) 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 * > & 
subWedge (int ind) const

Private Attributes

std::vector< const GeomDet * > theBackDets
ReferenceCountingPointer
< BoundDiskSector
theBackSector
std::vector< const GeomDet * > theDets
std::vector< const GeomDet * > theFrontDets
ReferenceCountingPointer
< BoundDiskSector
theFrontSector


Detailed Description

A concrete implementation for TEC layer built out of TECPetals.

Definition at line 13 of file CompositeTECWedge.h.


Constructor & Destructor Documentation

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

CompositeTECWedge::~CompositeTECWedge (  ) 

Definition at line 79 of file CompositeTECWedge.cc.

00079                                      {
00080 
00081 } 


Member Function Documentation

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

Implements GeometricSearchDet.

Definition at line 21 of file CompositeTECWedge.h.

References theDets.

00021 {return theDets;}

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

00092                                                                  {
00093   edm::LogError("TkDetLayers") << "temporary dummy implementation of CompositeTECWedge::compatible()!!" ;
00094   return pair<bool,TrajectoryStateOnSurface>();
00095 }

const vector< const GeometricSearchDet * > & CompositeTECWedge::components (  )  const [virtual]

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 85 of file CompositeTECWedge.cc.

00085                                    {
00086   throw DetLayerException("CompositeTECWedge doesn't have GeometricSearchDet components");
00087 }

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

Definition at line 137 of file CompositeTECWedge.cc.

References funct::abs(), Geom::deltaPhi(), lat::endl(), findClosestDet(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), LogDebug, GloballyPositioned< T >::phi(), rho, TECWedge::surface(), theBackDets, theBackSector, theFrontDets, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

00139 {
00140   HelixPlaneCrossing::PositionType startPos( startingState.globalPosition() );
00141   HelixPlaneCrossing::DirectionType startDir( startingState.globalMomentum() );
00142   float rho( startingState.transverseCurvature());
00143 
00144   HelixForwardPlaneCrossing crossing( startPos, startDir, rho, propDir);
00145 
00146   pair<bool,double> frontPath = crossing.pathLength( *theFrontSector);
00147   if (!frontPath.first) return SubLayerCrossings();
00148 
00149   GlobalPoint gFrontPoint( crossing.position(frontPath.second));
00150   LogDebug("TkDetLayers") << "in TECWedge,front crossing r,z,phi: (" 
00151        << gFrontPoint.perp() << ","
00152        << gFrontPoint.z() << "," 
00153        << gFrontPoint.phi() << ")" ;
00154 
00155 
00156   int frontIndex = findClosestDet(gFrontPoint,0); 
00157   SubLayerCrossing frontSLC( 0, frontIndex, gFrontPoint);
00158 
00159   pair<bool,double> backPath = crossing.pathLength( *theBackSector);
00160   if (!backPath.first) return SubLayerCrossings();
00161 
00162   GlobalPoint gBackPoint( crossing.position(backPath.second));
00163   LogDebug("TkDetLayers") 
00164     << "in TECWedge,back crossing r,z,phi: (" 
00165     << gBackPoint.perp() << ","
00166     << gBackPoint.z() << "," 
00167     << gBackPoint.phi() << ")" << endl;
00168   
00169   int backIndex = findClosestDet(gBackPoint,1);
00170   SubLayerCrossing backSLC( 1, backIndex, gBackPoint);
00171 
00172   float frontDist = std::abs(Geom::deltaPhi( double(gFrontPoint.barePhi()), 
00173                                              double(theFrontDets[frontIndex]->surface().phi())));
00174   /*
00175   float frontDist = theFrontDets[frontIndex]->surface().phi()  - gFrontPoint.phi(); 
00176   frontDist *= Geom::phiLess( theFrontDets[frontIndex]->surface().phi(),gFrontPoint.barePhi()) ? -1. : 1.; 
00177   if (frontDist < 0.) { frontDist += 2.*Geom::pi();}
00178   */
00179   float backDist = std::abs(Geom::deltaPhi( double(gBackPoint.barePhi()), 
00180                                             double(theBackDets[backIndex]->surface().phi())));
00181   /*
00182   float backDist = theBackDets[backIndex]->surface().phi()  - gBackPoint.phi(); 
00183   backDist  *= Geom::phiLess( theBackDets[backIndex]->surface().phi(),gBackPoint.barePhi()) ? -1. : 1.;
00184   if ( backDist < 0.) { backDist  += 2.*Geom::pi();}
00185   */
00186   
00187   if (frontDist < backDist) {
00188     return SubLayerCrossings( frontSLC, backSLC, 0);
00189   }
00190   else {
00191     return SubLayerCrossings( backSLC, frontSLC, 1);
00192   } 
00193 }

int CompositeTECWedge::findClosestDet ( const GlobalPoint startPos,
int  sectorId 
) const [private]

Definition at line 256 of file CompositeTECWedge.cc.

References dist(), i, theBackDets, theFrontDets, and x.

Referenced by computeCrossings().

00257 {
00258   vector<const GeomDet*> myDets = sectorId==0 ? theFrontDets : theBackDets;
00259 
00260   int close = 0;
00261   float closeDist = fabs( (myDets.front()->toLocal(startPos)).x());
00262   for (unsigned int i = 0; i < myDets.size(); i++ ) {
00263     float dist = (myDets[i]->surface().toLocal(startPos)).x();
00264     if ( fabs(dist) < fabs(closeDist) ) {
00265       close = i;
00266       closeDist = dist;
00267     }
00268   }
00269   return close;
00270 }

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

Reimplemented from GeometricSearchDet.

Definition at line 99 of file CompositeTECWedge.cc.

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

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

void CompositeTECWedge::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().

const std::vector<const GeomDet*>& CompositeTECWedge::subWedge ( int  ind  )  const [inline, private]

Definition at line 56 of file CompositeTECWedge.h.

References theBackDets, and theFrontDets.

00056                                                             {
00057     return (ind==0 ? theFrontDets : theBackDets);
00058   }


Member Data Documentation

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

Definition at line 63 of file CompositeTECWedge.h.

Referenced by computeCrossings(), findClosestDet(), and subWedge().

ReferenceCountingPointer<BoundDiskSector> CompositeTECWedge::theBackSector [private]

Definition at line 67 of file CompositeTECWedge.h.

Referenced by computeCrossings().

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

Definition at line 64 of file CompositeTECWedge.h.

Referenced by basicComponents().

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

Definition at line 62 of file CompositeTECWedge.h.

Referenced by computeCrossings(), findClosestDet(), and subWedge().

ReferenceCountingPointer<BoundDiskSector> CompositeTECWedge::theFrontSector [private]

Definition at line 66 of file CompositeTECWedge.h.


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