23 PixelForwardLayer::PixelForwardLayer(vector<const PixelBlade*>& blades):
25 theComps(blades.
begin(),blades.
end())
27 for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
28 it!=theComps.end();it++){
29 theBasicComps.insert(theBasicComps.end(),
30 (**it).basicComponents().begin(),
31 (**it).basicComponents().end());
36 setSurface( computeSurface() );
39 theBinFinder = BinFinderType( theComps.front()->surface().position().phi(),
43 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for PixelForwardLayer" <<
"\n"
44 <<
"PixelForwardLayer.surfcace.phi(): "
45 << this->surface().position().phi() <<
"\n"
46 <<
"PixelForwardLayer.surfcace.z(): "
47 << this->surface().position().z() <<
"\n"
48 <<
"PixelForwardLayer.surfcace.innerR(): "
49 << this->specificSurface().innerRadius() <<
"\n"
50 <<
"PixelForwardLayer.surfcace.outerR(): "
51 << this->specificSurface().outerRadius() ;
53 for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
54 it!=theComps.end(); it++){
55 LogDebug(
"TkDetLayers") <<
"blades phi,z,r: "
56 << (*it)->surface().position().phi() <<
" , "
57 << (*it)->surface().position().z() <<
" , "
58 << (*it)->surface().position().perp();
65 PixelForwardLayer::~PixelForwardLayer(){
66 vector<const GeometricSearchDet*>::const_iterator
i;
67 for (i=theComps.begin(); i!=theComps.end(); i++) {
76 std::vector<DetGroup> &
result)
const {
77 std::vector<DetGroup> closestResult;
78 SubTurbineCrossings crossings;
81 if (!crossings.isValid){
87 Adder::add( *theComps[theBinFinder.binIndex(crossings.closestIndex)],
88 tsos, prop, est, closestResult);
90 if(closestResult.empty()){
91 Adder::add( *theComps[theBinFinder.binIndex(crossings.nextIndex)],
101 vector<DetGroup> nextResult;
102 if (
Adder::add( *theComps[theBinFinder.binIndex(crossings.nextIndex)],
103 tsos, prop, est, nextResult)) {
105 int theHelicity = computeHelicity(theComps[theBinFinder.binIndex(crossings.closestIndex)],
106 theComps[theBinFinder.binIndex(crossings.nextIndex)] );
108 theHelicity, crossingSide);
111 result.swap(closestResult);
124 searchNeighbors( tsos, prop, est, crossings, window, result);
134 const SubTurbineCrossings& crossings,
136 vector<DetGroup>& result)
const
142 int negStart =
min( crossings.closestIndex, crossings.nextIndex) - 1;
143 int posStart =
max( crossings.closestIndex, crossings.nextIndex) + 1;
145 int quarter = theComps.size()/4;
147 for (
int idet=negStart; idet >= negStart - quarter+1; idet--) {
148 std::vector<DetGroup> tmp1;
152 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
153 int theHelicity = computeHelicity(theComps[theBinFinder.binIndex(idet)],
154 theComps[theBinFinder.binIndex(idet+1)] );
155 std::vector<DetGroup> tmp2; tmp2.swap(result);
156 std::vector<DetGroup> newResult;
157 Merger::orderAndMergeTwoLevels( std::move(tmp1), std::move(tmp2), newResult, theHelicity, crossingSide);
158 result.swap(newResult);
160 for (
int idet=posStart; idet < posStart + quarter-1; idet++) {
161 vector<DetGroup> tmp1;
165 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
166 int theHelicity = computeHelicity(theComps[theBinFinder.binIndex(idet-1)],
167 theComps[theBinFinder.binIndex(idet)] );
168 std::vector<DetGroup> tmp2; tmp2.swap(result);
169 std::vector<DetGroup> newResult;
170 Merger::orderAndMergeTwoLevels(std::move(tmp2), std::move(tmp1), newResult, theHelicity, crossingSide);
171 result.swap(newResult);
181 PixelForwardLayer::SubTurbineCrossings
192 HelixArbitraryPlaneCrossing turbineCrossing( startPos, startDir, rho,
195 pair<bool,double> thePath = turbineCrossing.pathLength( specificSurface() );
197 if (!thePath.first) {
199 return SubTurbineCrossings();
205 int closestIndex = theBinFinder.binIndex(turbinePoint.barePhi());
207 const Plane& closestPlane( static_cast<const Plane&>(theComps[closestIndex]->surface()));
210 HelixArbitraryPlaneCrossing2Order theBladeCrossing(turbinePoint, turbineDir, rho);
212 pair<bool,double> theClosestBladePath = theBladeCrossing.pathLength( closestPlane );
213 LocalPoint closestPos = closestPlane.toLocal(
GlobalPoint(theBladeCrossing.position(theClosestBladePath.second)) );
215 auto closestDist = closestPos.
x();
219 int nextIndex =
PhiLess()( closestPlane.phi(), turbinePoint.barePhi()) ?
220 closestIndex+1 : closestIndex-1;
222 const Plane& nextPlane( static_cast<const Plane&>(
223 theComps[ theBinFinder.binIndex(nextIndex)]->surface()));
225 pair<bool,double> theNextBladePath = theBladeCrossing.pathLength( nextPlane );
226 LocalPoint nextPos = nextPlane.toLocal(
GlobalPoint(theBladeCrossing.position(theNextBladePath.second)) );
228 auto nextDist = nextPos.
x();
231 return SubTurbineCrossings( closestIndex, nextIndex, nextDist);
234 return SubTurbineCrossings( nextIndex, closestIndex, closestDist);
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
Vector2DBase< float, LocalTag > Local2DVector
const Plane & surface() const
The nominal surface of the GeomDet.
virtual PropagationDirection propagationDirection() const GCC11_FINAL
const T & max(const T &a, const T &b)
Abs< T >::type abs(const T &t)
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
virtual const Surface::PositionType & position() const
Returns position of the surface.
GlobalVector globalMomentum() const
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
double transverseCurvature() const