CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

LayerCollector Class Reference

#include <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

Definition at line 26 of file LayerCollector.h.

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

Definition at line 28 of file LayerCollector.h.

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.

                           : 
    thePropagator(aPropagator),
    theStartingLayerFinder(aFinder),
    theDeltaR(dr),
    theDeltaZ(dz) { }
LayerCollector::~LayerCollector ( ) [inline]

Definition at line 41 of file LayerCollector.h.

{}

Member Function Documentation

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

Definition at line 6 of file LayerCollector.cc.

References Reference_intrackfit_cff::barrel, deltaR(), Reference_intrackfit_cff::endcap, TrajectoryStateOnSurface::freeState(), TrajectoryStateOnSurface::globalParameters(), TrajectoryStateOnSurface::globalPosition(), TrajectoryStateOnSurface::isValid(), FreeTrajectoryState::parameters(), PV3DBase< T, PVType, FrameType >::perp(), LargeD0_PixelPairStep_cff::propagator, rangesIntersect(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by ConversionSeedFinder::findLayers().

                                                                       {


  vector<const DetLayer*> myLayers;



  FTS myFts(aFts.parameters());

  vector<const DetLayer*> nextLayers = finder()->startingLayers(myFts, deltaR(), deltaZ());

  vector<const DetLayer*> dummy;




  bool inside = true;
  while(inside) {

    inside = false;
    for(vector<const DetLayer*>::iterator ilay = nextLayers.begin(); ilay != nextLayers.end(); ilay++) {

      
      TSOS pTsos = propagator()->propagate(myFts, (**ilay).surface());


      if(pTsos.isValid()) {

        inside = true;

     

        if((**ilay).location() == GeomDetEnumerators::barrel) {

          Range barrZRange((**ilay).position().z() - 
                           0.5*((**ilay).surface().bounds().length()),
                           (**ilay).position().z() + 
                           0.5*((**ilay).surface().bounds().length()));
          Range trajZRange(pTsos.globalPosition().z() - deltaZ(),
                           pTsos.globalPosition().z() + deltaZ());
          
          if(rangesIntersect(trajZRange, barrZRange)) 
            myLayers.push_back(*ilay);

        } else if((**ilay).location() == GeomDetEnumerators::endcap) {

          const ForwardDetLayer* fwd = 
            dynamic_cast<const ForwardDetLayer*>(*ilay);
          Range fwdRRange((*fwd).specificSurface().innerRadius(),
                          (*fwd).specificSurface().outerRadius());
          Range trajRRange(pTsos.globalPosition().perp() - deltaR(),
                           pTsos.globalPosition().perp() + deltaR());

          if(rangesIntersect(trajRRange, fwdRRange)) 
            myLayers.push_back(*ilay);
         
        }

        myFts = FTS(pTsos.globalParameters());
 
        
        nextLayers = (**ilay).nextLayers(*pTsos.freeState(), 
                                         propagator()->propagationDirection());


        break;


      }     



    }
  }



  
  return myLayers;
}
vector< const BarrelDetLayer * > LayerCollector::barrelLayers ( const FTS aFts) const

Definition at line 87 of file LayerCollector.cc.

References cond::ecalcond::all.

                                                                                {

  vector<const DetLayer*> all = allLayers(aFts);
  vector<const BarrelDetLayer*> barrelLayers;


  for(vector<const DetLayer*>::iterator ilay = all.begin();
      ilay != all.end(); ilay++) {

    if(const BarrelDetLayer* myBarrel = 
       dynamic_cast<const BarrelDetLayer*>(*ilay))
      barrelLayers.push_back(myBarrel);
  }


  return barrelLayers;
}
float LayerCollector::deltaR ( ) const [inline]

Definition at line 49 of file LayerCollector.h.

References theDeltaR.

{return theDeltaR;}
float LayerCollector::deltaZ ( ) const [inline]

Definition at line 50 of file LayerCollector.h.

References theDeltaZ.

{return theDeltaZ;}
const StartingLayerFinder* LayerCollector::finder ( ) const [inline]

Definition at line 48 of file LayerCollector.h.

References theStartingLayerFinder.

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

Definition at line 105 of file LayerCollector.cc.

References cond::ecalcond::all.

                                                                                  {
  
  vector<const DetLayer*> all = allLayers(aFts);
  vector<const ForwardDetLayer*> fwdLayers;


  for(vector<const DetLayer*>::iterator ilay = all.begin();
      ilay != all.end(); ilay++) {
    
    if(const ForwardDetLayer* myFwd = 
       dynamic_cast<const ForwardDetLayer*>(*ilay))
      fwdLayers.push_back(myFwd);
  }

  
  return fwdLayers;
}
const Propagator* LayerCollector::propagator ( void  ) const [inline]

Definition at line 47 of file LayerCollector.h.

References thePropagator.

{return thePropagator;}
bool LayerCollector::rangesIntersect ( const Range a,
const Range b 
) const [inline, private]

Definition at line 61 of file LayerCollector.h.

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

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().

Definition at line 54 of file LayerCollector.h.

Referenced by propagator().

Definition at line 55 of file LayerCollector.h.

Referenced by finder().