23 PixelForwardLayer::PixelForwardLayer(vector<const PixelBlade*>& blades):
24 theComps(blades.
begin(),blades.
end())
26 for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
27 it!=theComps.end();it++){
28 theBasicComps.insert(theBasicComps.end(),
29 (**it).basicComponents().begin(),
30 (**it).basicComponents().end());
35 setSurface( computeSurface() );
38 theBinFinder = BinFinderType( theComps.front()->surface().position().phi(),
42 LogDebug(
"TkDetLayers") <<
"DEBUG INFO for PixelForwardLayer" <<
"\n"
43 <<
"PixelForwardLayer.surfcace.phi(): "
44 << this->surface().position().phi() <<
"\n"
45 <<
"PixelForwardLayer.surfcace.z(): "
46 << this->surface().position().z() <<
"\n"
47 <<
"PixelForwardLayer.surfcace.innerR(): "
48 << this->specificSurface().innerRadius() <<
"\n"
49 <<
"PixelForwardLayer.surfcace.outerR(): "
50 << this->specificSurface().outerRadius() ;
52 for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
53 it!=theComps.end(); it++){
54 LogDebug(
"TkDetLayers") <<
"blades phi,z,r: "
55 << (*it)->surface().position().phi() <<
" , "
56 << (*it)->surface().position().z() <<
" , "
57 << (*it)->surface().position().perp();
64 PixelForwardLayer::~PixelForwardLayer(){
65 vector<const GeometricSearchDet*>::const_iterator
i;
66 for (i=theComps.begin(); i!=theComps.end(); i++) {
75 std::vector<DetGroup> &
result)
const {
76 vector<DetGroup> closestResult;
77 SubTurbineCrossings crossings;
80 if (!crossings.isValid){
86 Adder::add( *theComps[theBinFinder.binIndex(crossings.closestIndex)],
87 tsos, prop, est, closestResult);
89 if(closestResult.empty()){
90 Adder::add( *theComps[theBinFinder.binIndex(crossings.nextIndex)],
100 vector<DetGroup> nextResult;
101 if (
Adder::add( *theComps[theBinFinder.binIndex(crossings.nextIndex)],
102 tsos, prop, est, nextResult)) {
104 int theHelicity = computeHelicity(theComps[theBinFinder.binIndex(crossings.closestIndex)],
105 theComps[theBinFinder.binIndex(crossings.nextIndex)] );
107 theHelicity, crossingSide);
110 result.swap(closestResult);
123 searchNeighbors( tsos, prop, est, crossings, window, result);
133 const SubTurbineCrossings& crossings,
135 vector<DetGroup>& result)
const
141 int negStart =
min( crossings.closestIndex, crossings.nextIndex) - 1;
142 int posStart =
max( crossings.closestIndex, crossings.nextIndex) + 1;
144 int quarter = theComps.size()/4;
146 for (
int idet=negStart; idet >= negStart - quarter+1; idet--) {
147 vector<DetGroup> tmp1;
151 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
152 int theHelicity = computeHelicity(theComps[theBinFinder.binIndex(idet)],
153 theComps[theBinFinder.binIndex(idet+1)] );
154 vector<DetGroup> tmp2; tmp2.swap(result);
155 vector<DetGroup> newResult;
156 Merger::orderAndMergeTwoLevels( std::move(tmp1), std::move(tmp2), newResult, theHelicity, crossingSide);
157 result.swap(newResult);
159 for (
int idet=posStart; idet < posStart + quarter-1; idet++) {
160 vector<DetGroup> tmp1;
164 if (!
Adder::add( *neighbor, tsos, prop, est, tmp1))
break;
165 int theHelicity = computeHelicity(theComps[theBinFinder.binIndex(idet-1)],
166 theComps[theBinFinder.binIndex(idet)] );
167 vector<DetGroup> tmp2; tmp2.swap(result);
168 vector<DetGroup> newResult;
169 Merger::orderAndMergeTwoLevels(std::move(tmp2), std::move(tmp1), newResult, theHelicity, crossingSide);
170 result.swap(newResult);
181 PixelForwardLayer::SubTurbineCrossings
191 HelixArbitraryPlaneCrossing turbineCrossing( startPos, startDir,
rho,
194 pair<bool,double> thePath = turbineCrossing.pathLength( specificSurface() );
196 if (!thePath.first) {
198 return SubTurbineCrossings();
203 int closestIndex = theBinFinder.binIndex(turbinePoint.phi());
205 const Plane& closestPlane( static_cast<const Plane&>(
206 theComps[closestIndex]->surface()));
209 HelixArbitraryPlaneCrossing2Order theBladeCrossing(turbinePoint, turbineDir,
rho);
211 pair<bool,double> theClosestBladePath = theBladeCrossing.pathLength( closestPlane );
212 LocalPoint closestPos = closestPlane.toLocal(
GlobalPoint(theBladeCrossing.position(theClosestBladePath.second)) );
214 float closestDist = closestPos.
x();
217 int nextIndex =
PhiLess()( closestPlane.position().phi(), turbinePoint.phi()) ?
218 closestIndex+1 : closestIndex-1;
220 const Plane& nextPlane( static_cast<const Plane&>(
221 theComps[ theBinFinder.binIndex(nextIndex)]->surface()));
223 pair<bool,double> theNextBladePath = theBladeCrossing.pathLength( nextPlane );
224 LocalPoint nextPos = nextPlane.toLocal(
GlobalPoint(theBladeCrossing.position(theNextBladePath.second)) );
226 float nextDist = nextPos.
x();
228 if (fabs(closestDist) < fabs(nextDist)) {
229 return SubTurbineCrossings( closestIndex, nextIndex, nextDist);
232 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
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop) const
const T & max(const T &a, const T &b)
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
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