#include <RecoTracker/TkNavigation/interface/StartingLayerFinder.h>
Definition at line 29 of file StartingLayerFinder.h.
typedef FreeTrajectoryState StartingLayerFinder::FTS [private] |
Definition at line 33 of file StartingLayerFinder.h.
typedef std::pair<float, float> StartingLayerFinder::Range [private] |
Definition at line 35 of file StartingLayerFinder.h.
typedef TrajectoryStateOnSurface StartingLayerFinder::TSOS [private] |
Definition at line 34 of file StartingLayerFinder.h.
StartingLayerFinder::StartingLayerFinder | ( | const Propagator * | aPropagator, | |
const MeasurementTracker * | tracker | |||
) | [inline] |
Definition at line 39 of file StartingLayerFinder.h.
00039 : 00040 00041 thePropagator(aPropagator), 00042 theMeasurementTracker(tracker), 00043 thePixelLayersValid(false), 00044 theFirstPixelBarrelLayer(0), 00045 theFirstNegPixelFwdLayer(0), 00046 theFirstPosPixelFwdLayer(0) { }
StartingLayerFinder::~StartingLayerFinder | ( | ) | [inline] |
void StartingLayerFinder::checkPixelLayers | ( | ) | const [private] |
Definition at line 159 of file StartingLayerFinder.cc.
References MeasurementTracker::geometricSearchTracker(), GeometricSearchTracker::negPixelForwardLayers(), GeometricSearchTracker::pixelBarrelLayers(), GeometricSearchTracker::posPixelForwardLayers(), theFirstNegPixelFwdLayer, theFirstPixelBarrelLayer, theFirstPosPixelFwdLayer, theMeasurementTracker, and thePixelLayersValid.
Referenced by firstNegPixelFwdLayer(), firstPixelBarrelLayer(), and firstPosPixelFwdLayer().
00159 { 00160 00161 00162 if(!thePixelLayersValid) { 00163 00164 const GeometricSearchTracker* theGeometricSearchTracker=theMeasurementTracker->geometricSearchTracker(); 00165 00166 00167 theFirstPixelBarrelLayer = theGeometricSearchTracker->pixelBarrelLayers().front(); 00168 theFirstNegPixelFwdLayer = theGeometricSearchTracker->negPixelForwardLayers(); 00169 theFirstPosPixelFwdLayer = theGeometricSearchTracker->posPixelForwardLayers(); 00170 thePixelLayersValid = true; 00171 00172 00173 00174 } 00175 00176 00177 }
const vector< ForwardDetLayer * > StartingLayerFinder::firstNegPixelFwdLayer | ( | ) | const |
Definition at line 149 of file StartingLayerFinder.cc.
References checkPixelLayers(), and theFirstNegPixelFwdLayer.
00149 { 00150 checkPixelLayers(); 00151 return theFirstNegPixelFwdLayer; 00152 }
const BarrelDetLayer * StartingLayerFinder::firstPixelBarrelLayer | ( | ) | const |
Definition at line 144 of file StartingLayerFinder.cc.
References checkPixelLayers(), and theFirstPixelBarrelLayer.
Referenced by startingLayers().
00144 { 00145 checkPixelLayers(); 00146 return theFirstPixelBarrelLayer; 00147 }
const vector< ForwardDetLayer * > StartingLayerFinder::firstPosPixelFwdLayer | ( | ) | const |
Definition at line 154 of file StartingLayerFinder.cc.
References checkPixelLayers(), and theFirstPosPixelFwdLayer.
Referenced by startingLayers().
00154 { 00155 checkPixelLayers(); 00156 return theFirstPosPixelFwdLayer; 00157 }
const Propagator* StartingLayerFinder::propagator | ( | void | ) | const [inline] |
Definition at line 59 of file StartingLayerFinder.h.
References thePropagator.
Referenced by startingLayers().
00059 {return thePropagator;}
bool StartingLayerFinder::rangesIntersect | ( | const Range & | a, | |
const Range & | b | |||
) | const [inline, private] |
Definition at line 77 of file StartingLayerFinder.h.
Referenced by startingLayers().
00077 { 00078 if ( a.first > b.second || b.first > a.second) return false; 00079 else return true; 00080 }
vector< const DetLayer * > StartingLayerFinder::startingLayers | ( | const TrajectorySeed & | aSeed | ) | const |
Definition at line 97 of file StartingLayerFinder.cc.
References GeomDetEnumerators::barrel, PTrajectoryStateOnDet::detId(), GeometricSearchTracker::detLayer(), TrajectorySeed::direction(), GeomDetEnumerators::endcap, TrajectoryStateOnSurface::freeTrajectoryState(), TrackingRecHit::geographicalId(), MeasurementTracker::geometricSearchTracker(), MeasurementTracker::geomTracker(), TrackingGeometry::idToDet(), DetLayer::location(), Propagator::magneticField(), TrajectorySeed::nHits(), p1, p2, propagator(), TrajectorySeed::recHits(), startingLayers(), TrajectorySeed::startingState(), GeomDet::surface(), theMeasurementTracker, thePropagator, and TrajectoryStateTransform::transientState().
00097 { 00098 00099 00100 00101 float dr = 0., dz = 0.; 00102 00103 00104 if(propagator()->propagationDirection() != aSeed.direction()) 00105 return vector<const DetLayer*>(); 00106 00107 if(aSeed.nHits() != 2) return vector<const DetLayer*>(); 00108 00109 00110 TrackingRecHitCollection::const_iterator firstHit= aSeed.recHits().first; 00111 const TrackingRecHit* recHit1=&(*firstHit); 00112 const DetLayer* hit1Layer = theMeasurementTracker->geometricSearchTracker()->detLayer(recHit1->geographicalId()); 00113 00114 TrackingRecHitCollection::const_iterator secondHit= aSeed.recHits().second; 00115 const TrackingRecHit* recHit2=&(*secondHit); 00116 const DetLayer* hit2Layer = theMeasurementTracker->geometricSearchTracker()->detLayer(recHit2->geographicalId()); 00117 00118 00119 GeomDetEnumerators::Location p1 = hit1Layer->location(); 00120 GeomDetEnumerators::Location p2 = hit2Layer->location(); 00121 00122 if(p1 == GeomDetEnumerators::barrel && p2 == GeomDetEnumerators::barrel) { 00123 dr = 0.1; dz = 5.; 00124 } else if(p1 == GeomDetEnumerators::endcap && p2 == GeomDetEnumerators::endcap) { 00125 dr = 5.; dz = 0.1; 00126 } else { 00127 dr = 0.1; dz = 0.1; 00128 } 00129 00130 00131 00132 const GeomDet* gdet = theMeasurementTracker->geomTracker()->idToDet( DetId( aSeed.startingState().detId())); 00133 00134 TrajectoryStateTransform tsTransform; 00135 TrajectoryStateOnSurface tsos = tsTransform.transientState( aSeed.startingState(), &(gdet->surface()), 00136 thePropagator->magneticField()); 00137 00138 00139 FreeTrajectoryState* fts=tsos.freeTrajectoryState(); 00140 00141 return startingLayers(*fts, dr, dz); 00142 }
vector< const DetLayer * > StartingLayerFinder::startingLayers | ( | const FTS & | aFts, | |
float | dr, | |||
float | dz | |||
) | const |
Definition at line 20 of file StartingLayerFinder.cc.
References firstPixelBarrelLayer(), firstPosPixelFwdLayer(), FreeTrajectoryState::parameters(), Propagator::propagate(), propagator(), rangesIntersect(), and z.
Referenced by LayerCollector::allLayers(), and startingLayers().
00020 { 00021 00022 00023 00024 00025 vector<const DetLayer*> mylayers; 00026 mylayers.reserve(3); 00027 00028 FTS fastFts(aFts.parameters()); 00029 00030 00031 //barrel pixel 00032 TSOS pTsos = 00033 propagator()->propagate(fastFts, firstPixelBarrelLayer()->surface()); 00034 00035 if(pTsos.isValid()) { 00036 00037 Range barrZRange(firstPixelBarrelLayer()->position().z() - 00038 0.5*(firstPixelBarrelLayer()->surface().bounds().length()), 00039 firstPixelBarrelLayer()->position().z() + 00040 0.5*(firstPixelBarrelLayer()->surface().bounds().length())); 00041 Range trajZRange(pTsos.globalPosition().z() - dz, 00042 pTsos.globalPosition().z() + dz); 00043 00044 if(rangesIntersect(trajZRange, barrZRange)) { 00045 mylayers.push_back(firstPixelBarrelLayer()); 00046 00047 } 00048 } 00049 00050 00051 //negative fwd pixel 00052 00053 const vector<ForwardDetLayer*> nfwd = firstPosPixelFwdLayer(); 00054 for(vector<ForwardDetLayer*>::const_iterator infwd = nfwd.begin(); 00055 infwd != nfwd.end(); infwd++) { 00056 pTsos = propagator()->propagate(fastFts, (*infwd)->surface()); 00057 if(pTsos.isValid()) { 00058 Range nfwdRRange((*infwd)->specificSurface().innerRadius(), 00059 (*infwd)->specificSurface().outerRadius()); 00060 Range trajRRange(pTsos.globalPosition().perp() - dr, 00061 pTsos.globalPosition().perp() + dr); 00062 if(rangesIntersect(trajRRange, nfwdRRange)) { 00063 mylayers.push_back(*infwd); 00064 00065 } 00066 } 00067 } 00068 00069 //positive fwd pixel 00070 const vector<ForwardDetLayer*> pfwd = firstPosPixelFwdLayer(); 00071 for(vector<ForwardDetLayer*>::const_iterator ipfwd = pfwd.begin(); 00072 ipfwd != pfwd.end(); ipfwd++) { 00073 pTsos = propagator()->propagate(fastFts, (*ipfwd)->surface()); 00074 if(pTsos.isValid()) { 00075 Range pfwdRRange((*ipfwd)->specificSurface().innerRadius(), 00076 (*ipfwd)->specificSurface().outerRadius()); 00077 Range trajRRange(pTsos.globalPosition().perp() - dr, 00078 pTsos.globalPosition().perp() + dr); 00079 if(rangesIntersect(trajRRange, pfwdRRange)) { 00080 mylayers.push_back(*ipfwd); 00081 00082 } 00083 } 00084 } 00085 00086 00087 00088 return mylayers; 00089 00090 00091 00092 00093 00094 }
std::vector<ForwardDetLayer*> StartingLayerFinder::theFirstNegPixelFwdLayer [mutable, private] |
Definition at line 69 of file StartingLayerFinder.h.
Referenced by checkPixelLayers(), and firstNegPixelFwdLayer().
BarrelDetLayer* StartingLayerFinder::theFirstPixelBarrelLayer [mutable, private] |
Definition at line 68 of file StartingLayerFinder.h.
Referenced by checkPixelLayers(), and firstPixelBarrelLayer().
std::vector<ForwardDetLayer*> StartingLayerFinder::theFirstPosPixelFwdLayer [mutable, private] |
Definition at line 70 of file StartingLayerFinder.h.
Referenced by checkPixelLayers(), and firstPosPixelFwdLayer().
const MeasurementTracker* StartingLayerFinder::theMeasurementTracker [private] |
Definition at line 66 of file StartingLayerFinder.h.
Referenced by checkPixelLayers(), and startingLayers().
bool StartingLayerFinder::thePixelLayersValid [mutable, private] |
const Propagator* StartingLayerFinder::thePropagator [private] |
Definition at line 65 of file StartingLayerFinder.h.
Referenced by propagator(), and startingLayers().