CMS 3D CMS Logo

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

StartingLayerFinder Class Reference

#include <StartingLayerFinder.h>

List of all members.

Public Member Functions

const std::vector
< ForwardDetLayer * > 
firstNegPixelFwdLayer () const
const BarrelDetLayerfirstPixelBarrelLayer () const
const std::vector
< ForwardDetLayer * > 
firstPosPixelFwdLayer () const
const Propagatorpropagator () const
 StartingLayerFinder (const Propagator *aPropagator, const MeasurementTracker *tracker)
std::vector< const DetLayer * > startingLayers (const TrajectorySeed &aSeed) const
std::vector< const DetLayer * > startingLayers (const FTS &aFts, float dr, float dz) const
 ~StartingLayerFinder ()

Private Types

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

Private Member Functions

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

Private Attributes

std::vector< ForwardDetLayer * > theFirstNegPixelFwdLayer
BarrelDetLayertheFirstPixelBarrelLayer
std::vector< ForwardDetLayer * > theFirstPosPixelFwdLayer
const MeasurementTrackertheMeasurementTracker
bool thePixelLayersValid
const PropagatorthePropagator

Detailed Description

Definition at line 29 of file StartingLayerFinder.h.


Member Typedef Documentation

Definition at line 33 of file StartingLayerFinder.h.

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

Definition at line 35 of file StartingLayerFinder.h.

Definition at line 34 of file StartingLayerFinder.h.


Constructor & Destructor Documentation

StartingLayerFinder::StartingLayerFinder ( const Propagator aPropagator,
const MeasurementTracker tracker 
) [inline]
StartingLayerFinder::~StartingLayerFinder ( ) [inline]

Definition at line 48 of file StartingLayerFinder.h.

{}

Member Function Documentation

void StartingLayerFinder::checkPixelLayers ( ) const [private]
const vector< ForwardDetLayer * > StartingLayerFinder::firstNegPixelFwdLayer ( ) const

Definition at line 149 of file StartingLayerFinder.cc.

const BarrelDetLayer * StartingLayerFinder::firstPixelBarrelLayer ( ) const

Definition at line 144 of file StartingLayerFinder.cc.

const vector< ForwardDetLayer * > StartingLayerFinder::firstPosPixelFwdLayer ( ) const

Definition at line 154 of file StartingLayerFinder.cc.

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

Definition at line 59 of file StartingLayerFinder.h.

References thePropagator.

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

Definition at line 77 of file StartingLayerFinder.h.

                                                                     {
    if ( a.first > b.second || b.first > a.second) return false;
    else return true;
  }
vector< const DetLayer * > StartingLayerFinder::startingLayers ( const TrajectorySeed aSeed) const

Definition at line 97 of file StartingLayerFinder.cc.

References GeomDetEnumerators::barrel, PTrajectoryStateOnDet::detId(), TrajectorySeed::direction(), GeomDetEnumerators::endcap, TrajectoryStateOnSurface::freeTrajectoryState(), TrackingRecHit::geographicalId(), DetLayer::location(), TrajectorySeed::nHits(), p1, p2, LargeD0_PixelPairStep_cff::propagator, TrajectorySeed::recHits(), TrajectorySeed::startingState(), GeomDet::surface(), and TrajectoryStateTransform::transientState().

                                                                     {



  float dr = 0., dz = 0.;


  if(propagator()->propagationDirection() != aSeed.direction())
    return vector<const DetLayer*>();

  if(aSeed.nHits() != 2) return vector<const DetLayer*>();
 

  TrackingRecHitCollection::const_iterator firstHit= aSeed.recHits().first;
  const TrackingRecHit* recHit1=&(*firstHit);
  const DetLayer* hit1Layer = theMeasurementTracker->geometricSearchTracker()->detLayer(recHit1->geographicalId());

  TrackingRecHitCollection::const_iterator secondHit= aSeed.recHits().second;
  const TrackingRecHit* recHit2=&(*secondHit);
  const DetLayer* hit2Layer = theMeasurementTracker->geometricSearchTracker()->detLayer(recHit2->geographicalId());

  
  GeomDetEnumerators::Location p1 =  hit1Layer->location();
  GeomDetEnumerators::Location p2 =  hit2Layer->location();

  if(p1 == GeomDetEnumerators::barrel && p2 == GeomDetEnumerators::barrel) {
    dr = 0.1; dz = 5.;
  } else if(p1 == GeomDetEnumerators::endcap && p2 == GeomDetEnumerators::endcap) {
    dr = 5.; dz = 0.1;
  } else {
    dr = 0.1; dz = 0.1;
  }


  
  const GeomDet* gdet = theMeasurementTracker->geomTracker()->idToDet( DetId( aSeed.startingState().detId()));
  
  TrajectoryStateTransform tsTransform;
  TrajectoryStateOnSurface tsos = tsTransform.transientState( aSeed.startingState(), &(gdet->surface()), 
                                                              thePropagator->magneticField());


  FreeTrajectoryState* fts=tsos.freeTrajectoryState();
  
  return startingLayers(*fts, dr, dz);
}
vector< const DetLayer * > StartingLayerFinder::startingLayers ( const FTS aFts,
float  dr,
float  dz 
) const

Definition at line 20 of file StartingLayerFinder.cc.

References FreeTrajectoryState::parameters(), position, LargeD0_PixelPairStep_cff::propagator, rangesIntersect(), and z.

                                                                             {



  
  vector<const DetLayer*> mylayers; 
  mylayers.reserve(3);

  FTS fastFts(aFts.parameters());
  

  //barrel pixel
  TSOS pTsos = 
    propagator()->propagate(fastFts, firstPixelBarrelLayer()->surface());
  
  if(pTsos.isValid()) {

    Range barrZRange(firstPixelBarrelLayer()->position().z() - 
                    0.5*(firstPixelBarrelLayer()->surface().bounds().length()),
                     firstPixelBarrelLayer()->position().z() + 
                   0.5*(firstPixelBarrelLayer()->surface().bounds().length()));
    Range trajZRange(pTsos.globalPosition().z() - dz,
                     pTsos.globalPosition().z() + dz);

    if(rangesIntersect(trajZRange, barrZRange)) {
      mylayers.push_back(firstPixelBarrelLayer());

    }
  }


  //negative fwd pixel

  const vector<ForwardDetLayer*> nfwd = firstPosPixelFwdLayer();
  for(vector<ForwardDetLayer*>::const_iterator infwd = nfwd.begin();
      infwd != nfwd.end(); infwd++) {
    pTsos = propagator()->propagate(fastFts, (*infwd)->surface());  
    if(pTsos.isValid()) {
      Range nfwdRRange((*infwd)->specificSurface().innerRadius(),
                       (*infwd)->specificSurface().outerRadius());
      Range trajRRange(pTsos.globalPosition().perp() - dr,
                       pTsos.globalPosition().perp() + dr);
      if(rangesIntersect(trajRRange, nfwdRRange)) {
        mylayers.push_back(*infwd);

      }
    }
  }

  //positive fwd pixel
  const vector<ForwardDetLayer*> pfwd = firstPosPixelFwdLayer();
  for(vector<ForwardDetLayer*>::const_iterator ipfwd = pfwd.begin();
      ipfwd != pfwd.end(); ipfwd++) {
    pTsos = propagator()->propagate(fastFts, (*ipfwd)->surface());
    if(pTsos.isValid()) {
      Range pfwdRRange((*ipfwd)->specificSurface().innerRadius(),
                       (*ipfwd)->specificSurface().outerRadius());
      Range trajRRange(pTsos.globalPosition().perp() - dr,
                       pTsos.globalPosition().perp() + dr);
      if(rangesIntersect(trajRRange, pfwdRRange)) {
        mylayers.push_back(*ipfwd);

      }
    }
  }



  return mylayers;





}

Member Data Documentation

Definition at line 69 of file StartingLayerFinder.h.

Definition at line 68 of file StartingLayerFinder.h.

Definition at line 70 of file StartingLayerFinder.h.

Definition at line 66 of file StartingLayerFinder.h.

Definition at line 67 of file StartingLayerFinder.h.

Definition at line 65 of file StartingLayerFinder.h.

Referenced by propagator().