CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
PixelForwardLayerPhase1 Class Reference

#include <PixelForwardLayerPhase1.h>

Inheritance diagram for PixelForwardLayerPhase1:
ForwardDetLayer DetLayer GeometricSearchDet

Classes

struct  SubTurbineCrossings
 

Public Member Functions

virtual const std::vector
< const GeomDet * > & 
basicComponents () const
 
virtual const std::vector
< const GeometricSearchDet * > & 
components () const __attribute__((cold))
 Returns basic components, if any. More...
 
void groupedCompatibleDetsV (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const __attribute__((hot))
 
 PixelForwardLayerPhase1 (std::vector< const PixelBlade * > &blades)
 
virtual SubDetector subDetector () const
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
 ~PixelForwardLayerPhase1 ()
 
- Public Member Functions inherited from ForwardDetLayer
virtual std::pair< bool,
TrajectoryStateOnSurface
compatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const
 
bool contains (const Local3DPoint &p) const
 
 ForwardDetLayer (bool doHaveGroups)
 
virtual Location location () const
 Which part of the detector (barrel, endcap) More...
 
virtual const BoundDiskspecificSurface () const
 
virtual const BoundSurfacesurface () const
 The surface of the GeometricSearchDet. More...
 
virtual ~ForwardDetLayer ()
 
- Public Member Functions inherited from DetLayer
 DetLayer (bool doHaveGroup, bool ibar)
 
bool isBarrel () const
 
bool isForward () const
 
int seqNum () const
 
void setSeqNum (int sq)
 
virtual ~DetLayer ()
 
- Public Member Functions inherited from GeometricSearchDet
virtual std::vector< DetWithStatecompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
virtual void compatibleDetsV (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const
 
 GeometricSearchDet (bool doHaveGroups)
 
virtual std::vector< DetGroupgroupedCompatibleDets (const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
 
bool hasGroups () const
 
virtual const
Surface::PositionType
position () const
 Returns position of the surface. More...
 
virtual ~GeometricSearchDet ()
 

Private Types

typedef PeriodicBinFinderInPhi
< double > 
BinFinderType
 

Private Member Functions

SubTurbineCrossings computeCrossings (const TrajectoryStateOnSurface &startingState, PropagationDirection propDir, bool innerDisk) const
 
int computeHelicity (const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade) const
 
float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
 
void searchNeighbors (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubTurbineCrossings &crossings, float window, std::vector< DetGroup > &result, bool innerDisk) const
 

Private Attributes

unsigned int _num_innerpanels
 
unsigned int _num_outerpanels
 
std::vector< const GeomDet * > theBasicComps
 
BinFinderType theBinFinder_inner
 
BinFinderType theBinFinder_outer
 
std::vector< const
GeometricSearchDet * > 
theComps
 

Additional Inherited Members

- Public Types inherited from DetLayer
typedef
GeomDetEnumerators::Location 
Location
 
typedef
GeomDetEnumerators::SubDetector 
SubDetector
 
- Public Types inherited from GeometricSearchDet
typedef std::pair< const
GeomDet
*, TrajectoryStateOnSurface
DetWithState
 
typedef BoundSurface::PositionType PositionType
 
typedef BoundSurface::RotationType RotationType
 
typedef TrajectoryStateOnSurface TrajectoryState
 
- Protected Member Functions inherited from ForwardDetLayer
SimpleDiskBounds const & bounds () const
 
virtual BoundDiskcomputeSurface ()
 
virtual void initialize ()
 
float rmax () const
 
float rmin () const
 
void setSurface (BoundDisk *cp)
 
float zmax () const
 
float zmin () const
 
- Protected Attributes inherited from GeometricSearchDet
bool haveGroups
 
GeomDetCompatibilityChecker theCompatibilityChecker
 

Detailed Description

A concrete implementation for PixelForward layer built out of ForwardPixelBlade

Definition at line 15 of file PixelForwardLayerPhase1.h.

Member Typedef Documentation

Definition at line 73 of file PixelForwardLayerPhase1.h.

Constructor & Destructor Documentation

PixelForwardLayerPhase1::PixelForwardLayerPhase1 ( std::vector< const PixelBlade * > &  blades)

Definition at line 25 of file PixelForwardLayerPhase1.cc.

References _num_innerpanels, _num_outerpanels, ForwardDetLayer::computeSurface(), bookConverter::max, min(), phi, GeometricSearchDet::position(), ForwardDetLayer::setSurface(), ForwardDetLayer::surface(), theBasicComps, theBinFinder_inner, theBinFinder_outer, and theComps.

25  :
26  ForwardDetLayer(true),
27  theComps(blades.begin(),blades.end())
28 {
29  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
30  it!=theComps.end();it++){
31  theBasicComps.insert(theBasicComps.end(),
32  (**it).basicComponents().begin(),
33  (**it).basicComponents().end());
34  }
35 
36  //They should be already phi-ordered. TO BE CHECKED!!
37  //sort( theBlades.begin(), theBlades.end(), PhiLess());
39 
40 
41  // Assumes blades are ordered inner first then outer; and within each by phi
42  // where we go 0 -> pi, and then -pi -> 0
43  // we also need the number of inner blades for the offset in theComps vector
44  //
45  // this->specificSurface() not yet available so need to calculate average R
46  // we need some way to flag if FPIX is made of an inner and outer disk
47  // or probably need to change the way this is done, e.g. a smarter binFinder
48  float theRmin = (*(theComps.begin()))->surface().position().perp();
49  float theRmax = theRmin;
50  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
51  it!=theComps.end(); it++){
52  theRmin = std::min( theRmin, (*it)->surface().position().perp());
53  theRmax = std::max( theRmax, (*it)->surface().position().perp());
54  }
55  float split_inner_outer_radius = 0.5 * (theRmin + theRmax);
56  _num_innerpanels = 0;
57  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
58  it!=theComps.end();it++){
59  if((**it).surface().position().perp() <= split_inner_outer_radius) ++_num_innerpanels;
60  }
62  //std::cout << " Rmin, Rmax, R_average = " << theRmin << ", " << theRmax << ", "
63  // << split_inner_outer_radius << std::endl;
64  //std::cout << " num inner, outer disks = " << _num_innerpanels << ", " << _num_outerpanels << std::endl;
65 
66  theBinFinder_inner = BinFinderType( theComps.front()->surface().position().phi(),
70 
71 }
virtual BoundDisk * computeSurface()
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
void setSurface(BoundDisk *cp)
ForwardDetLayer(bool doHaveGroups)
std::vector< const GeometricSearchDet * > theComps
std::vector< const GeomDet * > theBasicComps
T min(T a, T b)
Definition: MathUtil.h:58
virtual const Surface::PositionType & position() const
Returns position of the surface.
PeriodicBinFinderInPhi< double > BinFinderType
Definition: DDAxes.h:10
PixelForwardLayerPhase1::~PixelForwardLayerPhase1 ( )

Definition at line 73 of file PixelForwardLayerPhase1.cc.

References i, and theComps.

73  {
74  vector<const GeometricSearchDet*>::const_iterator i;
75  for (i=theComps.begin(); i!=theComps.end(); i++) {
76  delete *i;
77  }
78 }
int i
Definition: DBlmapReader.cc:9
std::vector< const GeometricSearchDet * > theComps

Member Function Documentation

virtual const std::vector<const GeomDet*>& PixelForwardLayerPhase1::basicComponents ( ) const
inlinevirtual

Implements GeometricSearchDet.

Definition at line 23 of file PixelForwardLayerPhase1.h.

References theBasicComps.

23 {return theBasicComps;}
std::vector< const GeomDet * > theBasicComps
virtual const std::vector<const GeometricSearchDet*>& PixelForwardLayerPhase1::components ( ) const
inlinevirtual

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 25 of file PixelForwardLayerPhase1.h.

References theComps.

25 {return theComps;}
std::vector< const GeometricSearchDet * > theComps
PixelForwardLayerPhase1::SubTurbineCrossings PixelForwardLayerPhase1::computeCrossings ( const TrajectoryStateOnSurface startingState,
PropagationDirection  propDir,
bool  innerDisk 
) const
private

Definition at line 259 of file PixelForwardLayerPhase1.cc.

References _num_innerpanels, PeriodicBinFinderInPhi< T >::binIndex(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), HelixArbitraryPlaneCrossing2Order::pathLength(), Geom::Phi< T >::phi(), PV3DBase< T, PVType, FrameType >::phi(), GloballyPositioned< T >::position(), HelixArbitraryPlaneCrossing2Order::position(), rho, ForwardDetLayer::specificSurface(), ForwardDetLayer::surface(), theBinFinder_inner, theBinFinder_outer, theComps, GloballyPositioned< T >::toLocal(), TrajectoryStateOnSurface::transverseCurvature(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by groupedCompatibleDetsV().

261 {
263 
264  HelixPlaneCrossing::PositionType startPos( startingState.globalPosition());
265  HelixPlaneCrossing::DirectionType startDir( startingState.globalMomentum());
266  float rho( startingState.transverseCurvature());
267 
268  HelixArbitraryPlaneCrossing turbineCrossing( startPos, startDir, rho,
269  propDir);
270 
271  pair<bool,double> thePath = turbineCrossing.pathLength( specificSurface() );
272 
273  if (!thePath.first) {
274  //edm::LogInfo("TkDetLayers") << "ERROR in PixelForwardLayerPhase1: disk not crossed by track" ;
275  return SubTurbineCrossings();
276  }
277 
278  HelixPlaneCrossing::PositionType turbinePoint( turbineCrossing.position(thePath.second));
279  HelixPlaneCrossing::DirectionType turbineDir( turbineCrossing.direction(thePath.second));
280  int closestIndex = 0;
281  if(innerDisk)
282  closestIndex = theBinFinder_inner.binIndex(turbinePoint.phi());
283  else
284  closestIndex = theBinFinder_outer.binIndex(turbinePoint.phi());
285 
286  HelixArbitraryPlaneCrossing2Order theBladeCrossing(turbinePoint, turbineDir, rho);
287 
288  float closestDist = 0;
289  int nextIndex = 0;
290  if(innerDisk) {
291  const Plane& closestPlane( static_cast<const Plane&>(
292  theComps[closestIndex]->surface()));
293 
294  pair<bool,double> theClosestBladePath = theBladeCrossing.pathLength( closestPlane );
295  LocalPoint closestPos = closestPlane.toLocal(GlobalPoint(theBladeCrossing.position(theClosestBladePath.second)) );
296 
297  closestDist = closestPos.x(); // use fact that local X perp to global Y
298 
299  nextIndex = PhiLess()( closestPlane.position().phi(), turbinePoint.phi()) ?
300  closestIndex+1 : closestIndex-1;
301  } else {
302  const Plane& closestPlane( static_cast<const Plane&>(
303  theComps[closestIndex + _num_innerpanels]->surface()));
304 
305  pair<bool,double> theClosestBladePath = theBladeCrossing.pathLength( closestPlane );
306  LocalPoint closestPos = closestPlane.toLocal(GlobalPoint(theBladeCrossing.position(theClosestBladePath.second)) );
307 
308  closestDist = closestPos.x(); // use fact that local X perp to global Y
309 
310  nextIndex = PhiLess()( closestPlane.position().phi(), turbinePoint.phi()) ?
311  closestIndex+1 : closestIndex-1;
312  }
313 
314  float nextDist = 0;
315  if(innerDisk) {
316  const Plane& nextPlane( static_cast<const Plane&>(
317  theComps[ theBinFinder_inner.binIndex(nextIndex)]->surface()));
318  pair<bool,double> theNextBladePath = theBladeCrossing.pathLength( nextPlane );
319  LocalPoint nextPos = nextPlane.toLocal(GlobalPoint(theBladeCrossing.position(theNextBladePath.second)) );
320  nextDist = nextPos.x();
321  } else {
322  const Plane& nextPlane( static_cast<const Plane&>(
323  theComps[ theBinFinder_outer.binIndex(nextIndex) + _num_innerpanels]->surface()));
324  pair<bool,double> theNextBladePath = theBladeCrossing.pathLength( nextPlane );
325  LocalPoint nextPos = nextPlane.toLocal(GlobalPoint(theBladeCrossing.position(theNextBladePath.second)) );
326  nextDist = nextPos.x();
327  }
328 
329  if (fabs(closestDist) < fabs(nextDist)) {
330  return SubTurbineCrossings( closestIndex, nextIndex, nextDist);
331  }
332  else {
333  return SubTurbineCrossings( nextIndex, closestIndex, closestDist);
334  }
335 }
virtual const BoundSurface & surface() const
The surface of the GeometricSearchDet.
Definition: DDAxes.h:10
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint globalPosition() const
Vector2DBase< float, LocalTag > Local2DVector
std::vector< const GeometricSearchDet * > theComps
Definition: Plane.h:17
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
virtual const BoundDisk & specificSurface() const
GlobalVector globalMomentum() const
T x() const
Definition: PV3DBase.h:62
int PixelForwardLayerPhase1::computeHelicity ( const GeometricSearchDet firstBlade,
const GeometricSearchDet secondBlade 
) const
private

Definition at line 252 of file PixelForwardLayerPhase1.cc.

References GeometricSearchDet::position(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by groupedCompatibleDetsV(), and searchNeighbors().

253 {
254  if( fabs(firstBlade->position().z()) < fabs(secondBlade->position().z()) ) return 0;
255  return 1;
256 }
T z() const
Definition: PV3DBase.h:64
virtual const Surface::PositionType & position() const
Returns position of the surface.
float PixelForwardLayerPhase1::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
) const
private

Definition at line 340 of file PixelForwardLayerPhase1.cc.

References MeasurementEstimator::maximalLocalDisplacement(), GeomDet::surface(), and x.

Referenced by groupedCompatibleDetsV().

343 {
344  return est.maximalLocalDisplacement(tsos, det->surface()).x();
345 }
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const
Definition: DDAxes.h:10
void PixelForwardLayerPhase1::groupedCompatibleDetsV ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
) const
virtual

Reimplemented from GeometricSearchDet.

Definition at line 81 of file PixelForwardLayerPhase1.cc.

References _num_innerpanels, Clusterizer1DCommons::add(), PeriodicBinFinderInPhi< T >::binIndex(), PixelForwardLayerPhase1::SubTurbineCrossings::closestIndex, computeCrossings(), computeHelicity(), computeWindowSize(), LayerCrossingSide::endcapSide(), PixelForwardLayerPhase1::SubTurbineCrossings::isValid, PixelForwardLayerPhase1::SubTurbineCrossings::nextIndex, DetGroupMerger::orderAndMergeTwoLevels(), Propagator::propagationDirection(), searchNeighbors(), theBinFinder_inner, theBinFinder_outer, theComps, and svgfig::window().

84  {
85  vector<DetGroup> closestResult_inner;
86  vector<DetGroup> closestResult_outer;
87  vector<DetGroup> nextResult_inner;
88  vector<DetGroup> nextResult_outer;
89  vector<DetGroup> result_inner;
90  vector<DetGroup> result_outer;
91  int frontindex_inner = 0;
92  int frontindex_outer = 0;
93  SubTurbineCrossings crossings_inner;
94  SubTurbineCrossings crossings_outer;
95 
96  crossings_inner = computeCrossings( tsos, prop.propagationDirection(), true);
97  crossings_outer = computeCrossings( tsos, prop.propagationDirection(), false);
98  if (!crossings_inner.isValid){
99  //edm::LogInfo("TkDetLayers") << "inner computeCrossings returns invalid in PixelForwardLayerPhase1::groupedCompatibleDets:";
100  return;
101  }
102  if (!crossings_outer.isValid){
103  //edm::LogInfo("TkDetLayers") << "outer computeCrossings returns invalid in PixelForwardLayerPhase1::groupedCompatibleDets:";
104  return;
105  }
106 
107  typedef CompatibleDetToGroupAdder Adder;
108  Adder::add( *theComps[theBinFinder_inner.binIndex(crossings_inner.closestIndex)],
109  tsos, prop, est, closestResult_inner);
110 
111  if(closestResult_inner.empty()){
112  Adder::add( *theComps[theBinFinder_inner.binIndex(crossings_inner.nextIndex)],
113  tsos, prop, est, result_inner);
114  frontindex_inner = crossings_inner.nextIndex;
115  } else {
116  if (Adder::add( *theComps[theBinFinder_inner.binIndex(crossings_inner.nextIndex)],
117  tsos, prop, est, nextResult_inner)) {
118  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
119  int theHelicity = computeHelicity(theComps[theBinFinder_inner.binIndex(crossings_inner.closestIndex)],
120  theComps[theBinFinder_inner.binIndex(crossings_inner.nextIndex)] );
121  DetGroupMerger::orderAndMergeTwoLevels( std::move(closestResult_inner), std::move(nextResult_inner), result_inner,
122  theHelicity, crossingSide);
123  if (theHelicity == crossingSide) frontindex_inner = crossings_inner.closestIndex;
124  else frontindex_inner = crossings_inner.nextIndex;
125  } else {
126  result_inner.swap(closestResult_inner);
127  frontindex_inner = crossings_inner.closestIndex;
128  }
129  }
130  if(!closestResult_inner.empty()){
131  DetGroupElement closestGel( closestResult_inner.front().front());
132  float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
133  searchNeighbors( tsos, prop, est, crossings_inner, window, result_inner, true);
134  }
135 
136  //DetGroupElement closestGel( closestResult.front().front());
137  //float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
138  //float detWidth = closestGel.det()->surface().bounds().width();
139  //if (crossings.nextDistance < detWidth + window) {
140 
141  Adder::add( *theComps[(theBinFinder_outer.binIndex(crossings_outer.closestIndex)) + _num_innerpanels],
142  tsos, prop, est, closestResult_outer);
143 
144  if(closestResult_outer.empty()){
145  Adder::add( *theComps[theBinFinder_outer.binIndex(crossings_outer.nextIndex) + _num_innerpanels],
146  tsos, prop, est, result_outer);
147  frontindex_outer = crossings_outer.nextIndex;
148  } else {
149  if (Adder::add( *theComps[theBinFinder_outer.binIndex(crossings_outer.nextIndex) + _num_innerpanels],
150  tsos, prop, est, nextResult_outer)) {
151  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
152  int theHelicity = computeHelicity(theComps[theBinFinder_outer.binIndex(crossings_outer.closestIndex) + _num_innerpanels],
153  theComps[theBinFinder_outer.binIndex(crossings_outer.nextIndex) + _num_innerpanels] );
154  DetGroupMerger::orderAndMergeTwoLevels( std::move(closestResult_outer), std::move(nextResult_outer), result_outer,
155  theHelicity, crossingSide);
156  if (theHelicity == crossingSide) frontindex_outer = crossings_outer.closestIndex;
157  else frontindex_outer = crossings_outer.nextIndex;
158  } else {
159  result_outer.swap(closestResult_outer);
160  frontindex_outer = crossings_outer.closestIndex;
161  }
162  }
163  if(!closestResult_outer.empty()){
164  DetGroupElement closestGel( closestResult_outer.front().front());
165  float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
166  searchNeighbors( tsos, prop, est, crossings_inner, window, result_outer, false);
167  }
168 
169  if(result_inner.empty() && result_outer.empty() ) return;
170  if(result_inner.empty()) result.swap(result_outer);
171  else if(result_outer.empty()) result.swap(result_inner);
172  else {
173  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
174  int theHelicity = computeHelicity(theComps[theBinFinder_inner.binIndex(frontindex_inner)],
175  theComps[theBinFinder_outer.binIndex(frontindex_outer) + _num_innerpanels] );
176  DetGroupMerger::orderAndMergeTwoLevels( std::move(result_inner), std::move(result_outer), result,
177  theHelicity, crossingSide);
178  }
179 }
def window
Definition: svgfig.py:642
virtual PropagationDirection propagationDirection() const
Definition: Propagator.h:155
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
std::vector< const GeometricSearchDet * > theComps
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade) const
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const
tuple result
Definition: query.py:137
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubTurbineCrossings &crossings, float window, std::vector< DetGroup > &result, bool innerDisk) const
SubTurbineCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir, bool innerDisk) const
void PixelForwardLayerPhase1::searchNeighbors ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
const SubTurbineCrossings crossings,
float  window,
std::vector< DetGroup > &  result,
bool  innerDisk 
) const
private

Definition at line 184 of file PixelForwardLayerPhase1.cc.

References _num_innerpanels, _num_outerpanels, Clusterizer1DCommons::add(), PeriodicBinFinderInPhi< T >::binIndex(), PixelForwardLayerPhase1::SubTurbineCrossings::closestIndex, computeHelicity(), LayerCrossingSide::endcapSide(), bookConverter::max, min(), PixelForwardLayerPhase1::SubTurbineCrossings::nextIndex, theBinFinder_inner, theBinFinder_outer, theComps, and tmp.

Referenced by groupedCompatibleDetsV().

191 {
192  typedef CompatibleDetToGroupAdder Adder;
193  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
194  typedef DetGroupMerger Merger;
195 
196  int negStart = min( crossings.closestIndex, crossings.nextIndex) - 1;
197  int posStart = max( crossings.closestIndex, crossings.nextIndex) + 1;
198 
199  int quarter = theComps.size()/4;
200  if(innerDisk) quarter = _num_innerpanels/4;
201  else quarter = _num_outerpanels/4;
202 
203  vector<DetGroup> tmp;
204  vector<DetGroup> newResult;
205  for (int idet=negStart; idet >= negStart - quarter+1; idet--) {
206  tmp.clear();
207  newResult.clear();
208  if(innerDisk) {
209  const GeometricSearchDet* neighbor = theComps[theBinFinder_inner.binIndex(idet)];
210  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
211  // maybe also add shallow crossing angle test here???
212  if (!Adder::add( *neighbor, tsos, prop, est, tmp)) break;
213  int theHelicity = computeHelicity(theComps[theBinFinder_inner.binIndex(idet)],
215  Merger::orderAndMergeTwoLevels( std::move(tmp), std::move(result), newResult, theHelicity, crossingSide);
216  } else {
218  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
219  // maybe also add shallow crossing angle test here???
220  if (!Adder::add( *neighbor, tsos, prop, est, tmp)) break;
223  Merger::orderAndMergeTwoLevels( std::move(tmp), std::move(result), newResult, theHelicity, crossingSide);
224  }
225  result.swap(newResult);
226  }
227  for (int idet=posStart; idet < posStart + quarter-1; idet++) {
228  tmp.clear();
229  newResult.clear();
230  if(innerDisk) {
231  const GeometricSearchDet* neighbor = theComps[theBinFinder_inner.binIndex(idet)];
232  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
233  // maybe also add shallow crossing angle test here???
234  if (!Adder::add( *neighbor, tsos, prop, est, tmp)) break;
235  int theHelicity = computeHelicity(theComps[theBinFinder_inner.binIndex(idet-1)],
237  Merger::orderAndMergeTwoLevels( std::move(result), std::move(tmp), newResult, theHelicity, crossingSide);
238  } else {
240  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
241  // maybe also add shallow crossing angle test here???
242  if (!Adder::add( *neighbor, tsos, prop, est, tmp)) break;
245  Merger::orderAndMergeTwoLevels( std::move(result), std::move(tmp), newResult, theHelicity, crossingSide);
246  }
247  result.swap(newResult);
248  }
249 }
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
std::vector< const GeometricSearchDet * > theComps
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade) const
tuple result
Definition: query.py:137
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
Definition: Merger.h:31
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
virtual SubDetector PixelForwardLayerPhase1::subDetector ( ) const
inlinevirtual

The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap)

Implements DetLayer.

Definition at line 33 of file PixelForwardLayerPhase1.h.

References GeomDetEnumerators::PixelEndcap.

Member Data Documentation

unsigned int PixelForwardLayerPhase1::_num_innerpanels
private
unsigned int PixelForwardLayerPhase1::_num_outerpanels
private

Definition at line 78 of file PixelForwardLayerPhase1.h.

Referenced by PixelForwardLayerPhase1(), and searchNeighbors().

std::vector<const GeomDet*> PixelForwardLayerPhase1::theBasicComps
private

Definition at line 81 of file PixelForwardLayerPhase1.h.

Referenced by basicComponents(), and PixelForwardLayerPhase1().

BinFinderType PixelForwardLayerPhase1::theBinFinder_inner
private
BinFinderType PixelForwardLayerPhase1::theBinFinder_outer
private
std::vector<const GeometricSearchDet*> PixelForwardLayerPhase1::theComps
private