CMS 3D CMS Logo

CompositeTECPetal Class Reference

A concrete implementation for TEC petals. More...

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

Inheritance diagram for CompositeTECPetal:

TECPetal 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.
 CompositeTECPetal (std::vector< const TECWedge * > &innerWedges, std::vector< const TECWedge * > &outerWedges)
virtual void groupedCompatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const
 ~CompositeTECPetal ()

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 findBin (float R, int layer) const
GlobalPoint findPosition (int index, int diskSectorIndex) 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

Static Private Member Functions

static float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
static bool overlap (const GlobalPoint &gpos, const GeometricSearchDet &rod, float window)

Private Attributes

std::vector< float > theBackBoundaries
std::vector< const
GeometricSearchDet * > 
theBackComps
ReferenceCountingPointer
< BoundDiskSector
theBackSector
std::vector< const GeomDet * > theBasicComps
std::vector< const
GeometricSearchDet * > 
theComps
std::vector< float > theFrontBoundaries
std::vector< const
GeometricSearchDet * > 
theFrontComps
ReferenceCountingPointer
< BoundDiskSector
theFrontSector


Detailed Description

A concrete implementation for TEC petals.

Definition at line 14 of file CompositeTECPetal.h.


Constructor & Destructor Documentation

CompositeTECPetal::CompositeTECPetal ( std::vector< const TECWedge * > &  innerWedges,
std::vector< const TECWedge * > &  outerWedges 
)

CompositeTECPetal::~CompositeTECPetal (  ) 

Definition at line 113 of file CompositeTECPetal.cc.

References i, and theComps.

00113                                      {
00114   vector<const GeometricSearchDet*>::const_iterator i;
00115   for (i=theComps.begin(); i!=theComps.end(); i++) {
00116     delete *i;
00117   }
00118 } 


Member Function Documentation

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

Implements GeometricSearchDet.

Definition at line 22 of file CompositeTECPetal.h.

References theBasicComps.

00022 {return theBasicComps;}

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

00123                                                     {
00124   edm::LogError("TkDetLayers") << "temporary dummy implementation of CompositeTECPetal::compatible()!!" ;
00125   return pair<bool,TrajectoryStateOnSurface>();
00126 }

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

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 24 of file CompositeTECPetal.h.

References theComps.

00024 {return theComps;}

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

Definition at line 172 of file CompositeTECPetal.cc.

References findBin(), findPosition(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), LogDebug, muonGeometry::perp(), rho, theBackSector, theFrontSector, and TrajectoryStateOnSurface::transverseCurvature().

Referenced by groupedCompatibleDetsV().

00174 {
00175   double rho( startingState.transverseCurvature());
00176   
00177   HelixPlaneCrossing::PositionType startPos( startingState.globalPosition() );
00178   HelixPlaneCrossing::DirectionType startDir( startingState.globalMomentum() );
00179   HelixForwardPlaneCrossing crossing(startPos,startDir,rho,propDir);
00180   pair<bool,double> frontPath = crossing.pathLength( *theFrontSector);
00181 
00182   if (!frontPath.first) return SubLayerCrossings();
00183 
00184   GlobalPoint gFrontPoint(crossing.position(frontPath.second));
00185   LogDebug("TkDetLayers") 
00186     << "in TECPetal,front crossing : r,z,phi: (" 
00187     << gFrontPoint.perp() << ","
00188     << gFrontPoint.z() << "," 
00189     << gFrontPoint.phi() << ")";
00190   
00191 
00192   int frontIndex = findBin(gFrontPoint.perp(),0);
00193   float frontDist = fabs( findPosition(frontIndex,0).perp() - gFrontPoint.perp());
00194   SubLayerCrossing frontSLC( 0, frontIndex, gFrontPoint);
00195 
00196 
00197 
00198   pair<bool,double> backPath = crossing.pathLength( *theBackSector);
00199 
00200   if (!backPath.first) return SubLayerCrossings();
00201   
00202 
00203   GlobalPoint gBackPoint( crossing.position(backPath.second));
00204   LogDebug("TkDetLayers") 
00205     << "in TECPetal,back crossing r,z,phi: (" 
00206     << gBackPoint.perp() << ","
00207     << gBackPoint.z() << "," 
00208     << gBackPoint.phi() << ")" ;
00209 
00210   int backIndex = findBin(gBackPoint.perp(),1);
00211   float backDist = fabs( findPosition(backIndex,1).perp() - gBackPoint.perp());
00212   
00213   SubLayerCrossing backSLC( 1, backIndex, gBackPoint);
00214   
00215   
00216   // 0ss: frontDisk has index=0, backDisk has index=1
00217   if (frontDist < backDist) {
00218     return SubLayerCrossings( frontSLC, backSLC, 0);
00219   }
00220   else {
00221     return SubLayerCrossings( backSLC, frontSLC, 1);
00222   } 
00223 }

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

Definition at line 322 of file CompositeTECPetal.cc.

References MeasurementEstimator::maximalLocalDisplacement(), GeomDet::surface(), and y.

Referenced by groupedCompatibleDetsV().

00325 {
00326   return est.maximalLocalDisplacement(tsos, det->surface()).y();
00327 }

int CompositeTECPetal::findBin ( float  R,
int  layer 
) const [private]

Definition at line 330 of file CompositeTECPetal.cc.

References details::findBin(), theBackBoundaries, and theFrontBoundaries.

Referenced by computeCrossings().

00331 {
00332   return details::findBin(diskSectorType==0 ? theFrontBoundaries : theBackBoundaries,R);
00333 }

GlobalPoint CompositeTECPetal::findPosition ( int  index,
int  diskSectorIndex 
) const [private]

Definition at line 338 of file CompositeTECPetal.cc.

References theBackComps, and theFrontComps.

Referenced by computeCrossings().

00339 {
00340   vector<const GeometricSearchDet*> const & diskSector = diskSectorType == 0 ? theFrontComps : theBackComps; 
00341   return (diskSector[index])->position();
00342 }

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

Reimplemented from GeometricSearchDet.

Definition at line 130 of file CompositeTECPetal.cc.

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

00133                                                              {
00134 
00135   vector<DetGroup> closestResult;
00136   SubLayerCrossings  crossings; 
00137   crossings = computeCrossings( tsos, prop.propagationDirection());
00138   if(! crossings.isValid()) return;
00139 
00140   addClosest( tsos, prop, est, crossings.closest(), closestResult); 
00141   LogDebug("TkDetLayers") << "in TECPetal, closestResult.size(): "<< closestResult.size();
00142 
00143   if (closestResult.empty()){
00144     vector<DetGroup> nextResult;
00145     addClosest( tsos, prop, est, crossings.other(), nextResult); 
00146     LogDebug("TkDetLayers") << "in TECPetal, nextResult.size(): "<< nextResult.size() ;
00147     if(nextResult.empty())    return;
00148     
00149     DetGroupElement nextGel( nextResult.front().front());  
00150     int crossingSide = LayerCrossingSide().endcapSide( nextGel.trajectoryState(), prop);
00151     DetGroupMerger::orderAndMergeTwoLevels( closestResult, nextResult, result, 
00152                                             crossings.closestIndex(), crossingSide);
00153   } else {
00154     
00155   DetGroupElement closestGel( closestResult.front().front());  
00156   float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est); 
00157 
00158   searchNeighbors( tsos, prop, est, crossings.closest(), window,
00159                    closestResult, false); 
00160 
00161   vector<DetGroup> nextResult;
00162   searchNeighbors( tsos, prop, est, crossings.other(), window,
00163                    nextResult, true); 
00164 
00165   int crossingSide = LayerCrossingSide().endcapSide( closestGel.trajectoryState(), prop);
00166   DetGroupMerger::orderAndMergeTwoLevels( closestResult, nextResult, result, 
00167                                           crossings.closestIndex(), crossingSide);
00168   }
00169 }

bool CompositeTECPetal::overlap ( const GlobalPoint gpos,
const GeometricSearchDet rod,
float  window 
) [static, private]

Definition at line 296 of file CompositeTECPetal.cc.

References BoundDiskSector::bounds(), BoundDiskSector::innerRadius(), max, BoundDiskSector::outerRadius(), PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::position(), GeometricSearchDet::surface(), DiskSectorBounds::thickness(), and PV3DBase< T, PVType, FrameType >::z().

00297 {
00298   // this method is just a duplication of overlapInR 
00299   // adapeted for groupedCompatibleDets() needs
00300 
00301   // assume "fixed theta window", i.e. margin in local y = r is changing linearly with z
00302   float tsRadius = gpos.perp();
00303   float thetamin = ( max((float)0.,tsRadius-ymax))/(fabs(gpos.z())+10.); // add 10 cm contingency 
00304   float thetamax = ( tsRadius + ymax)/(fabs(gpos.z())-10.);
00305 
00306   const BoundDiskSector& wedgeSector = static_cast<const BoundDiskSector&>( gsdet.surface());                   
00307   float wedgeMinZ = fabs( wedgeSector.position().z()) - 0.5*wedgeSector.bounds().thickness();
00308   float wedgeMaxZ = fabs( wedgeSector.position().z()) + 0.5*wedgeSector.bounds().thickness(); 
00309   float thetaWedgeMin =  wedgeSector.innerRadius()/ wedgeMaxZ;
00310   float thetaWedgeMax =  wedgeSector.outerRadius()/ wedgeMinZ;
00311   
00312   // do the theta regions overlap ?
00313 
00314   return  !( thetamin > thetaWedgeMax || thetaWedgeMin > thetamax);
00315   
00316 } 

void CompositeTECPetal::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 GeometricSearchDet*>& CompositeTECPetal::subLayer ( int  ind  )  const [inline, private]

Definition at line 70 of file CompositeTECPetal.h.

References theBackComps, and theFrontComps.

00070                                                                        {
00071     return (ind==0 ? theFrontComps : theBackComps);
00072   }


Member Data Documentation

std::vector<float> CompositeTECPetal::theBackBoundaries [private]

Definition at line 82 of file CompositeTECPetal.h.

Referenced by findBin().

std::vector<const GeometricSearchDet*> CompositeTECPetal::theBackComps [private]

Definition at line 78 of file CompositeTECPetal.h.

Referenced by findPosition(), and subLayer().

ReferenceCountingPointer<BoundDiskSector> CompositeTECPetal::theBackSector [private]

Definition at line 85 of file CompositeTECPetal.h.

Referenced by computeCrossings().

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

Definition at line 79 of file CompositeTECPetal.h.

Referenced by basicComponents().

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

Definition at line 76 of file CompositeTECPetal.h.

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

std::vector<float> CompositeTECPetal::theFrontBoundaries [private]

Definition at line 81 of file CompositeTECPetal.h.

Referenced by findBin().

std::vector<const GeometricSearchDet*> CompositeTECPetal::theFrontComps [private]

Definition at line 77 of file CompositeTECPetal.h.

Referenced by findPosition(), and subLayer().

ReferenceCountingPointer<BoundDiskSector> CompositeTECPetal::theFrontSector [private]

Definition at line 84 of file CompositeTECPetal.h.

Referenced by computeCrossings().


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