CMS 3D CMS Logo

LayerCollector Class Reference

Class collecting all layers of the tracker. More...

#include <RecoTracker/TkNavigation/interface/LayerCollector.h>

List of all members.

Public Member Functions

std::vector< const DetLayer * > allLayers (const FTS &aFts) const
std::vector< const
BarrelDetLayer * > 
barrelLayers (const FTS &aFts) const
float deltaR () const
float deltaZ () const
const StartingLayerFinderfinder () const
std::vector< const
ForwardDetLayer * > 
forwardLayers (const FTS &aFts) const
 LayerCollector (const Propagator *aPropagator, const StartingLayerFinder *aFinder, float dr, float dz)
const Propagatorpropagator () const
 ~LayerCollector ()

Private Types

typedef FreeTrajectoryState FTS
typedef std::pair< float, float > Range
typedef TrajectoryStateOnSurface TSOS

Private Member Functions

bool rangesIntersect (const Range &a, const Range &b) const

Private Attributes

float theDeltaR
float theDeltaZ
const PropagatorthePropagator
const StartingLayerFindertheStartingLayerFinder


Detailed Description

Class collecting all layers of the tracker.

Date
2006/06/01 15:04:40
Revision
1.3

Definition at line 22 of file LayerCollector.h.


Member Typedef Documentation

typedef FreeTrajectoryState LayerCollector::FTS [private]

Definition at line 26 of file LayerCollector.h.

typedef std::pair<float, float> LayerCollector::Range [private]

Definition at line 28 of file LayerCollector.h.

typedef TrajectoryStateOnSurface LayerCollector::TSOS [private]

Definition at line 27 of file LayerCollector.h.


Constructor & Destructor Documentation

LayerCollector::LayerCollector ( const Propagator aPropagator,
const StartingLayerFinder aFinder,
float  dr,
float  dz 
) [inline]

Definition at line 32 of file LayerCollector.h.

00035                            : 
00036     thePropagator(aPropagator),
00037     theStartingLayerFinder(aFinder),
00038     theDeltaR(dr),
00039     theDeltaZ(dz) { }

LayerCollector::~LayerCollector (  )  [inline]

Definition at line 41 of file LayerCollector.h.

00041 {}


Member Function Documentation

vector< const DetLayer * > LayerCollector::allLayers ( const FTS aFts  )  const

Definition at line 6 of file LayerCollector.cc.

References GeomDetEnumerators::barrel, deltaR(), deltaZ(), dummy, GeomDetEnumerators::endcap, finder(), TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalParameters(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), Propagator::propagate(), Propagator::propagationDirection(), propagator(), rangesIntersect(), StartingLayerFinder::startingLayers(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by barrelLayers(), and forwardLayers().

00006                                                                        {
00007 
00008 
00009   vector<const DetLayer*> myLayers;
00010 
00011 
00012 
00013   FTS myFts(aFts.parameters());
00014 
00015   vector<const DetLayer*> nextLayers = finder()->startingLayers(myFts, deltaR(), deltaZ());
00016 
00017   vector<const DetLayer*> dummy;
00018 
00019 
00020 
00021 
00022   bool inside = true;
00023   while(inside) {
00024 
00025     inside = false;
00026     for(vector<const DetLayer*>::iterator ilay = nextLayers.begin(); ilay != nextLayers.end(); ilay++) {
00027 
00028       
00029       TSOS pTsos = propagator()->propagate(myFts, (**ilay).surface());
00030 
00031 
00032       if(pTsos.isValid()) {
00033 
00034         inside = true;
00035 
00036      
00037 
00038         if((**ilay).location() == GeomDetEnumerators::barrel) {
00039 
00040           Range barrZRange((**ilay).position().z() - 
00041                            0.5*((**ilay).surface().bounds().length()),
00042                            (**ilay).position().z() + 
00043                            0.5*((**ilay).surface().bounds().length()));
00044           Range trajZRange(pTsos.globalPosition().z() - deltaZ(),
00045                            pTsos.globalPosition().z() + deltaZ());
00046           
00047           if(rangesIntersect(trajZRange, barrZRange)) 
00048             myLayers.push_back(*ilay);
00049 
00050         } else if((**ilay).location() == GeomDetEnumerators::endcap) {
00051 
00052           const ForwardDetLayer* fwd = 
00053             dynamic_cast<const ForwardDetLayer*>(*ilay);
00054           Range fwdRRange((*fwd).specificSurface().innerRadius(),
00055                           (*fwd).specificSurface().outerRadius());
00056           Range trajRRange(pTsos.globalPosition().perp() - deltaR(),
00057                            pTsos.globalPosition().perp() + deltaR());
00058 
00059           if(rangesIntersect(trajRRange, fwdRRange)) 
00060             myLayers.push_back(*ilay);
00061          
00062         }
00063 
00064         myFts = FTS(pTsos.globalParameters());
00065  
00066         
00067         nextLayers = (**ilay).nextLayers(*pTsos.freeState(), 
00068                                          propagator()->propagationDirection());
00069 
00070 
00071         break;
00072 
00073 
00074       }     
00075 
00076 
00077 
00078     }
00079   }
00080 
00081 
00082 
00083   
00084   return myLayers;
00085 }

vector< const BarrelDetLayer * > LayerCollector::barrelLayers ( const FTS aFts  )  const

Definition at line 87 of file LayerCollector.cc.

References python::cmstools::all(), and allLayers().

00087                                                                                 {
00088 
00089   vector<const DetLayer*> all = allLayers(aFts);
00090   vector<const BarrelDetLayer*> barrelLayers;
00091 
00092 
00093   for(vector<const DetLayer*>::iterator ilay = all.begin();
00094       ilay != all.end(); ilay++) {
00095 
00096     if(const BarrelDetLayer* myBarrel = 
00097        dynamic_cast<const BarrelDetLayer*>(*ilay))
00098       barrelLayers.push_back(myBarrel);
00099   }
00100 
00101 
00102   return barrelLayers;
00103 }

float LayerCollector::deltaR (  )  const [inline]

Definition at line 49 of file LayerCollector.h.

References theDeltaR.

Referenced by allLayers().

00049 {return theDeltaR;}

float LayerCollector::deltaZ (  )  const [inline]

Definition at line 50 of file LayerCollector.h.

References theDeltaZ.

Referenced by allLayers().

00050 {return theDeltaZ;}

const StartingLayerFinder* LayerCollector::finder (  )  const [inline]

Definition at line 48 of file LayerCollector.h.

References theStartingLayerFinder.

Referenced by allLayers().

00048 {return theStartingLayerFinder;}

vector< const ForwardDetLayer * > LayerCollector::forwardLayers ( const FTS aFts  )  const

Definition at line 105 of file LayerCollector.cc.

References python::cmstools::all(), and allLayers().

00105                                                                                   {
00106   
00107   vector<const DetLayer*> all = allLayers(aFts);
00108   vector<const ForwardDetLayer*> fwdLayers;
00109 
00110 
00111   for(vector<const DetLayer*>::iterator ilay = all.begin();
00112       ilay != all.end(); ilay++) {
00113     
00114     if(const ForwardDetLayer* myFwd = 
00115        dynamic_cast<const ForwardDetLayer*>(*ilay))
00116       fwdLayers.push_back(myFwd);
00117   }
00118 
00119   
00120   return fwdLayers;
00121 }

const Propagator* LayerCollector::propagator ( void   )  const [inline]

Definition at line 47 of file LayerCollector.h.

References thePropagator.

Referenced by allLayers().

00047 {return thePropagator;}

bool LayerCollector::rangesIntersect ( const Range a,
const Range b 
) const [inline, private]

Definition at line 61 of file LayerCollector.h.

Referenced by allLayers().

00061                                                                      {
00062     if ( a.first > b.second || b.first > a.second) return false;
00063     else return true;
00064   }


Member Data Documentation

float LayerCollector::theDeltaR [private]

Definition at line 56 of file LayerCollector.h.

Referenced by deltaR().

float LayerCollector::theDeltaZ [private]

Definition at line 57 of file LayerCollector.h.

Referenced by deltaZ().

const Propagator* LayerCollector::thePropagator [private]

Definition at line 54 of file LayerCollector.h.

Referenced by propagator().

const StartingLayerFinder* LayerCollector::theStartingLayerFinder [private]

Definition at line 55 of file LayerCollector.h.

Referenced by finder().


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