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 | Static Private Member Functions | Private Attributes
PixelForwardLayerPhase1 Class Referencefinal

#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 Phase1PixelBlade * > &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 final
 Which part of the detector (barrel, endcap) More...
 
virtual const BoundDiskspecificSurface () const final
 
virtual const BoundSurfacesurface () const final
 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
< float > 
BinFinderType
 

Private Member Functions

SubTurbineCrossings computeCrossings (const TrajectoryStateOnSurface &startingState, PropagationDirection propDir, bool innerDisk) const __attribute__((hot))
 
void searchNeighbors (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubTurbineCrossings &crossings, float window, std::vector< DetGroup > &result, bool innerDisk) const __attribute__((hot))
 

Static Private Member Functions

static int computeHelicity (const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade)
 
static float computeWindowSize (const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
 

Private Attributes

unsigned int _num_innerpanels
 
unsigned int _num_outerpanels
 
std::vector< const GeomDet * > theBasicComps
 
std::vector< float > theBinFinder_byR
 
std::vector< unsigned int > theBinFinder_byR_index
 
std::vector< unsigned int > theBinFinder_byR_nextindex
 
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 ForwardPhase1PixelBlade

Definition at line 16 of file PixelForwardLayerPhase1.h.

Member Typedef Documentation

Definition at line 68 of file PixelForwardLayerPhase1.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file PixelForwardLayerPhase1.cc.

References _num_innerpanels, _num_outerpanels, ForwardDetLayer::computeSurface(), LogDebug, bookConverter::max, min(), PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), GeometricSearchDet::position(), GloballyPositioned< T >::position(), ForwardDetLayer::setSurface(), ForwardDetLayer::specificSurface(), ForwardDetLayer::surface(), theBasicComps, theBinFinder_inner, theBinFinder_outer, theComps, and PV3DBase< T, PVType, FrameType >::z().

25  :
26  ForwardDetLayer(true),
27  theComps(blades.begin(),blades.end())
28 {
29  // Assumes blades are ordered inner first then outer; and within each by phi
30  // where we go 0 -> pi, and then -pi -> 0
31  // we also need the number of inner blades for the offset in theComps vector
32  //
33  // this->specificSurface() not yet available so need to calculate average R
34  // we need some way to flag if FPIX is made of an inner and outer disk
35  // or probably need to change the way this is done, e.g. a smarter binFinder
36  float theRmin = (*(theComps.begin()))->surface().position().perp();
37  float theRmax = theRmin;
38  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
39  it!=theComps.end(); it++){
40  theRmin = std::min( theRmin, (*it)->surface().position().perp());
41  theRmax = std::max( theRmax, (*it)->surface().position().perp());
42  }
43  //float split_inner_outer_radius = 0.5 * (theRmin + theRmax);
44  // force the splitting rdius to be 10 cm to cope also with the FPIX disks with only the outer ring
45  float split_inner_outer_radius = 10.;
46  _num_innerpanels = 0;
47  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
48  it!=theComps.end();it++){
49  if((**it).surface().position().perp() <= split_inner_outer_radius) ++_num_innerpanels;
50  }
52  edm::LogInfo("TkDetLayers") << " Rmin, Rmax, R_average = " << theRmin << ", " << theRmax << ", "
53  << split_inner_outer_radius << std::endl
54  << " num inner, outer disks = "
56  << std::endl;
57 
58  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
59  it!=theComps.end();it++){
60  theBasicComps.insert(theBasicComps.end(),
61  (**it).basicComponents().begin(),
62  (**it).basicComponents().end());
63  }
64 
65  //They should be already phi-ordered. TO BE CHECKED!!
66  //sort( theBlades.begin(), theBlades.end(), PhiLess());
68 
69  theBinFinder_inner = BinFinderType( theComps.front()->surface().position().phi(),
73 
74  //--------- DEBUG INFO --------------
75  LogDebug("TkDetLayers") << "DEBUG INFO for PixelForwardLayerPhase1" << "\n"
76  << "Num of inner and outer panels = " << _num_innerpanels << ", " << _num_outerpanels << "\n"
77  << "Based on phi separation for inner: " << theComps.front()->surface().position().phi()
78  << " and on phi separation for outer: " << theComps[_num_innerpanels]->surface().position().phi()
79  << "PixelForwardLayerPhase1.surfcace.phi(): " << std::endl
80  << this->surface().position().phi() << "\n"
81  << "PixelForwardLayerPhase1.surfcace.z(): "
82  << this->surface().position().z() << "\n"
83  << "PixelForwardLayerPhase1.surfcace.innerR(): "
84  << this->specificSurface().innerRadius() << "\n"
85  << "PixelForwardLayerPhase1.surfcace.outerR(): "
86  << this->specificSurface().outerRadius() ;
87 
88  for(vector<const GeometricSearchDet*>::const_iterator it=theComps.begin();
89  it!=theComps.end(); it++){
90  LogDebug("TkDetLayers") << "blades phi,z,r: "
91  << (*it)->surface().position().phi() << " , "
92  << (*it)->surface().position().z() << " , "
93  << (*it)->surface().position().perp();
94  //for(vector<const GeomDet*>::const_iterator iu=(**it).basicComponents().begin();
95  // iu!=(**it).basicComponents().end();iu++){
96  // std::cout << " basic component rawId = " << hex << (**iu).geographicalId().rawId() << dec <<std::endl;
97  //}
98  }
99  //-----------------------------------
100 
101 
102 }
#define LogDebug(id)
PeriodicBinFinderInPhi< float > BinFinderType
virtual BoundDisk * computeSurface()
void setSurface(BoundDisk *cp)
ForwardDetLayer(bool doHaveGroups)
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
std::vector< const GeometricSearchDet * > theComps
std::vector< const GeomDet * > theBasicComps
T z() const
Definition: PV3DBase.h:64
T min(T a, T b)
Definition: MathUtil.h:58
virtual const Surface::PositionType & position() const
Returns position of the surface.
virtual const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
virtual const BoundDisk & specificSurface() const final
const PositionType & position() const
PixelForwardLayerPhase1::~PixelForwardLayerPhase1 ( )

Definition at line 104 of file PixelForwardLayerPhase1.cc.

References i, and theComps.

104  {
105  vector<const GeometricSearchDet*>::const_iterator i;
106  for (i=theComps.begin(); i!=theComps.end(); i++) {
107  delete *i;
108  }
109 }
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 296 of file PixelForwardLayerPhase1.cc.

References _num_innerpanels, funct::abs(), PeriodicBinFinderInPhi< T >::binIndex(), HelixArbitraryPlaneCrossing::direction(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), HelixArbitraryPlaneCrossing::pathLength(), HelixArbitraryPlaneCrossing2Order::pathLength(), HelixArbitraryPlaneCrossing::position(), HelixArbitraryPlaneCrossing2Order::position(), rho, ForwardDetLayer::specificSurface(), ForwardDetLayer::surface(), theBinFinder_inner, theBinFinder_outer, theComps, TrajectoryStateOnSurface::transverseCurvature(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by groupedCompatibleDetsV().

298 {
300 
301  HelixPlaneCrossing::PositionType startPos( startingState.globalPosition());
302  HelixPlaneCrossing::DirectionType startDir( startingState.globalMomentum());
303  auto rho = startingState.transverseCurvature();
304 
305  HelixArbitraryPlaneCrossing turbineCrossing( startPos, startDir, rho,
306  propDir);
307 
308  pair<bool,double> thePath = turbineCrossing.pathLength( specificSurface() );
309 
310  if (!thePath.first) {
311  return SubTurbineCrossings();
312  }
313 
314  HelixPlaneCrossing::PositionType turbinePoint( turbineCrossing.position(thePath.second));
315  HelixPlaneCrossing::DirectionType turbineDir( turbineCrossing.direction(thePath.second));
316  int closestIndex = 0;
317  int nextIndex = 0;
318  if(innerDisk)
319  closestIndex = theBinFinder_inner.binIndex(turbinePoint.barePhi());
320  else
321  closestIndex = theBinFinder_outer.binIndex(turbinePoint.barePhi());
322 
323  HelixArbitraryPlaneCrossing2Order theBladeCrossing(turbinePoint, turbineDir, rho);
324 
325  float closestDist = 0;
326  if(innerDisk) {
327  const BoundPlane& closestPlane( static_cast<const BoundPlane&>(
328  theComps[closestIndex]->surface()));
329 
330  pair<bool,double> theClosestBladePath = theBladeCrossing.pathLength( closestPlane );
331  LocalPoint closestPos = closestPlane.toLocal(GlobalPoint(theBladeCrossing.position(theClosestBladePath.second)) );
332  closestDist = closestPos.x();
333  // use fact that local X perp to global Y
334  nextIndex = PhiLess()( closestPlane.phi(), turbinePoint.barePhi()) ?
335  closestIndex+1 : closestIndex-1;
336  } else {
337  const BoundPlane& closestPlane( static_cast<const BoundPlane&>(
338  theComps[closestIndex + _num_innerpanels]->surface()));
339 
340  pair<bool,double> theClosestBladePath = theBladeCrossing.pathLength( closestPlane );
341  LocalPoint closestPos = closestPlane.toLocal(GlobalPoint(theBladeCrossing.position(theClosestBladePath.second)) );
342  closestDist = closestPos.x();
343  // use fact that local X perp to global Y
344  nextIndex = PhiLess()( closestPlane.phi(), turbinePoint.barePhi()) ?
345  closestIndex+1 : closestIndex-1;
346  }
347 
348  float nextDist = 0;
349  if(innerDisk) {
350  const BoundPlane& nextPlane( static_cast<const BoundPlane&>(
351  theComps[ theBinFinder_inner.binIndex(nextIndex)]->surface()));
352  pair<bool,double> theNextBladePath = theBladeCrossing.pathLength( nextPlane );
353  LocalPoint nextPos = nextPlane.toLocal(GlobalPoint(theBladeCrossing.position(theNextBladePath.second)) );
354  nextDist = nextPos.x();
355  } else {
356  const BoundPlane& nextPlane( static_cast<const BoundPlane&>(
357  theComps[ theBinFinder_outer.binIndex(nextIndex) + _num_innerpanels]->surface()));
358  pair<bool,double> theNextBladePath = theBladeCrossing.pathLength( nextPlane );
359  LocalPoint nextPos = nextPlane.toLocal(GlobalPoint(theBladeCrossing.position(theNextBladePath.second)) );
360  nextDist = nextPos.x();
361  }
362  if (std::abs(closestDist) < std::abs(nextDist)) {
363  return SubTurbineCrossings( closestIndex, nextIndex, nextDist);
364  }
365  else {
366  return SubTurbineCrossings( nextIndex, closestIndex, closestDist);
367  }
368 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
GlobalPoint globalPosition() const
Vector2DBase< float, LocalTag > Local2DVector
std::vector< const GeometricSearchDet * > theComps
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
GlobalVector globalMomentum() const
virtual const BoundDisk & specificSurface() const final
T x() const
Definition: PV3DBase.h:62
int PixelForwardLayerPhase1::computeHelicity ( const GeometricSearchDet firstBlade,
const GeometricSearchDet secondBlade 
)
staticprivate

Definition at line 290 of file PixelForwardLayerPhase1.cc.

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

Referenced by groupedCompatibleDetsV(), and searchNeighbors().

291 {
292  return std::abs(firstBlade->position().z()) < std::abs(secondBlade->position().z()) ? 0 : 1;
293 }
T z() const
Definition: PV3DBase.h:64
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual const Surface::PositionType & position() const
Returns position of the surface.
float PixelForwardLayerPhase1::computeWindowSize ( const GeomDet det,
const TrajectoryStateOnSurface tsos,
const MeasurementEstimator est 
)
staticprivate

Definition at line 371 of file PixelForwardLayerPhase1.cc.

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

Referenced by groupedCompatibleDetsV().

374 {
375  return est.maximalLocalDisplacement(tsos, det->surface()).x();
376 }
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
void PixelForwardLayerPhase1::groupedCompatibleDetsV ( const TrajectoryStateOnSurface tsos,
const Propagator prop,
const MeasurementEstimator est,
std::vector< DetGroup > &  result 
) const
virtual

Reimplemented from GeometricSearchDet.

Definition at line 112 of file PixelForwardLayerPhase1.cc.

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

115  {
116  std::vector<DetGroup> closestResult_inner;
117  std::vector<DetGroup> closestResult_outer;
118  std::vector<DetGroup> nextResult_inner;
119  std::vector<DetGroup> nextResult_outer;
120  std::vector<DetGroup> result_inner;
121  std::vector<DetGroup> result_outer;
122  int frontindex_inner = 0;
123  int frontindex_outer = 0;
124  SubTurbineCrossings crossings_inner;
125  SubTurbineCrossings crossings_outer;
126 
127  if(_num_innerpanels > 0) crossings_inner = computeCrossings( tsos, prop.propagationDirection(), true);
128  crossings_outer = computeCrossings( tsos, prop.propagationDirection(), false);
129  // if (!crossings_inner.isValid){
130  // edm::LogInfo("TkDetLayers") << "inner computeCrossings returns invalid in PixelForwardLayerPhase1::groupedCompatibleDets:";
131  // return;
132  // }
133  if (!crossings_outer.isValid){
134  edm::LogInfo("TkDetLayers") << "outer computeCrossings returns invalid in PixelForwardLayerPhase1::groupedCompatibleDets:";
135  return;
136  }
137 
138  typedef CompatibleDetToGroupAdder Adder;
139  if(crossings_inner.isValid) {
140  Adder::add( *theComps[theBinFinder_inner.binIndex(crossings_inner.closestIndex)],
141  tsos, prop, est, closestResult_inner);
142 
143  if(closestResult_inner.empty()){
144  Adder::add( *theComps[theBinFinder_inner.binIndex(crossings_inner.nextIndex)],
145  tsos, prop, est, result_inner);
146  frontindex_inner = crossings_inner.nextIndex;
147  } else {
148  if (Adder::add( *theComps[theBinFinder_inner.binIndex(crossings_inner.nextIndex)],
149  tsos, prop, est, nextResult_inner)) {
150  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
151  int theHelicity = computeHelicity(theComps[theBinFinder_inner.binIndex(crossings_inner.closestIndex)],
152  theComps[theBinFinder_inner.binIndex(crossings_inner.nextIndex)] );
153  std::vector<DetGroup> tmp99 = closestResult_inner;
154  DetGroupMerger::orderAndMergeTwoLevels( std::move(tmp99), std::move(nextResult_inner), result_inner,
155  theHelicity, crossingSide);
156  if (theHelicity == crossingSide) frontindex_inner = crossings_inner.closestIndex;
157  else frontindex_inner = crossings_inner.nextIndex;
158  } else {
159  result_inner.swap(closestResult_inner);
160  frontindex_inner = crossings_inner.closestIndex;
161  }
162  }
163  }
164  if(!closestResult_inner.empty()){
165  DetGroupElement closestGel( closestResult_inner.front().front());
166  float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
167  searchNeighbors( tsos, prop, est, crossings_inner, window, result_inner, true);
168  }
169 
170  //DetGroupElement closestGel( closestResult.front().front());
171  //float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
172  //float detWidth = closestGel.det()->surface().bounds().width();
173  //if (crossings.nextDistance < detWidth + window) {
174 
175  Adder::add( *theComps[(theBinFinder_outer.binIndex(crossings_outer.closestIndex)) + _num_innerpanels],
176  tsos, prop, est, closestResult_outer);
177 
178  if(closestResult_outer.empty()){
179  Adder::add( *theComps[theBinFinder_outer.binIndex(crossings_outer.nextIndex) + _num_innerpanels],
180  tsos, prop, est, result_outer);
181  frontindex_outer = crossings_outer.nextIndex;
182  } else {
183  if (Adder::add( *theComps[theBinFinder_outer.binIndex(crossings_outer.nextIndex) + _num_innerpanels],
184  tsos, prop, est, nextResult_outer)) {
185  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
186  int theHelicity = computeHelicity(theComps[theBinFinder_outer.binIndex(crossings_outer.closestIndex) + _num_innerpanels],
187  theComps[theBinFinder_outer.binIndex(crossings_outer.nextIndex) + _num_innerpanels] );
188  std::vector<DetGroup> tmp99 = closestResult_outer;
189  DetGroupMerger::orderAndMergeTwoLevels( std::move(tmp99), std::move(nextResult_outer), result_outer,
190  theHelicity, crossingSide);
191  if (theHelicity == crossingSide) frontindex_outer = crossings_outer.closestIndex;
192  else frontindex_outer = crossings_outer.nextIndex;
193  } else {
194  result_outer.swap(closestResult_outer);
195  frontindex_outer = crossings_outer.closestIndex;
196  }
197  }
198  if(!closestResult_outer.empty()){
199  DetGroupElement closestGel( closestResult_outer.front().front());
200  float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
201  searchNeighbors( tsos, prop, est, crossings_outer, window, result_outer, false);
202  }
203 
204  if(result_inner.empty() && result_outer.empty() ) return;
205  if(result_inner.empty()) result.swap(result_outer);
206  else if(result_outer.empty()) result.swap(result_inner);
207  else {
208  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
209  int theHelicity = computeHelicity(theComps[theBinFinder_inner.binIndex(frontindex_inner)],
210  theComps[theBinFinder_outer.binIndex(frontindex_outer) + _num_innerpanels] );
211  DetGroupMerger::orderAndMergeTwoLevels( std::move(result_inner), std::move(result_outer), result,
212  theHelicity, crossingSide);
213  }
214 
215 }
def window
Definition: svgfig.py:642
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
static int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade)
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:151
std::vector< const GeometricSearchDet * > theComps
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
tuple result
Definition: mps_fire.py:83
void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubTurbineCrossings &crossings, float window, std::vector< DetGroup > &result, bool innerDisk) const __attribute__((hot))
def move
Definition: eostools.py:510
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
static float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
SubTurbineCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir, bool innerDisk) const __attribute__((hot))
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 220 of file PixelForwardLayerPhase1.cc.

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

Referenced by groupedCompatibleDetsV().

227 {
228  typedef CompatibleDetToGroupAdder Adder;
229  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
230  typedef DetGroupMerger Merger;
231 
232  int negStart = min( crossings.closestIndex, crossings.nextIndex) - 1;
233  int posStart = max( crossings.closestIndex, crossings.nextIndex) + 1;
234 
235  int quarter = theComps.size()/4;
236  if(innerDisk) quarter = _num_innerpanels/4;
237  else quarter = _num_outerpanels/4;
238 
239  for (int idet=negStart; idet >= negStart - quarter+1; idet--) {
240  std::vector<DetGroup> tmp1;
241  std::vector<DetGroup> newResult;
242  if(innerDisk) {
244  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
245  // maybe also add shallow crossing angle test here???
246  if (!Adder::add( *neighbor, tsos, prop, est, tmp1)) break;
247  int theHelicity = computeHelicity(theComps[theBinFinder_inner.binIndex(idet)],
249  std::vector<DetGroup> tmp2; tmp2.swap(result);
250  Merger::orderAndMergeTwoLevels( std::move(tmp1), std::move(tmp2), newResult, theHelicity, crossingSide);
251  } else {
253  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
254  // maybe also add shallow crossing angle test here???
255  if (!Adder::add( *neighbor, tsos, prop, est, tmp1)) break;
258  std::vector<DetGroup> tmp2; tmp2.swap(result);
259  Merger::orderAndMergeTwoLevels( std::move(tmp1), std::move(tmp2), newResult, theHelicity, crossingSide);
260  }
261  result.swap(newResult);
262  }
263  for (int idet=posStart; idet < posStart + quarter-1; idet++) {
264  std::vector<DetGroup> tmp1;
265  std::vector<DetGroup> newResult;
266  if(innerDisk) {
267  const GeometricSearchDet* neighbor = theComps[theBinFinder_inner.binIndex(idet)];
268  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
269  // maybe also add shallow crossing angle test here???
270  if (!Adder::add( *neighbor, tsos, prop, est, tmp1)) break;
271  int theHelicity = computeHelicity(theComps[theBinFinder_inner.binIndex(idet-1)],
273  std::vector<DetGroup> tmp2; tmp2.swap(result);
274  Merger::orderAndMergeTwoLevels(std::move(tmp2), std::move(tmp1), newResult, theHelicity, crossingSide);
275  } else {
277  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
278  // maybe also add shallow crossing angle test here???
279  if (!Adder::add( *neighbor, tsos, prop, est, tmp1)) break;
282  std::vector<DetGroup> tmp2; tmp2.swap(result);
283  Merger::orderAndMergeTwoLevels(std::move(tmp2), std::move(tmp1), newResult, theHelicity, crossingSide);
284  }
285  result.swap(newResult);
286  }
287 }
bool neighbor(int endcap, int sector, int SectIndex, int id, int sub, int station)
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
static int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade)
std::vector< const GeometricSearchDet * > theComps
virtual int binIndex(T phi) const
returns an index in the valid range for the bin that contains phi
tuple result
Definition: mps_fire.py:83
def move
Definition: eostools.py:510
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
T min(T a, T b)
Definition: MathUtil.h:58
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::P1PXEC, and GeomDetEnumerators::subDetGeom.

Member Data Documentation

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

Definition at line 74 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().

std::vector<float> PixelForwardLayerPhase1::theBinFinder_byR
private

Definition at line 76 of file PixelForwardLayerPhase1.h.

std::vector<unsigned int> PixelForwardLayerPhase1::theBinFinder_byR_index
private

Definition at line 77 of file PixelForwardLayerPhase1.h.

std::vector<unsigned int> PixelForwardLayerPhase1::theBinFinder_byR_nextindex
private

Definition at line 78 of file PixelForwardLayerPhase1.h.

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