CMS 3D CMS Logo

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

const std::vector< const GeomDet * > & basicComponents () const override
 
const std::vector< const GeometricSearchDet * > & components () const override __attribute__((cold))
 Returns basic components, if any. More...
 
void groupedCompatibleDetsV (const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
 
 PixelForwardLayerPhase1 (std::vector< const Phase1PixelBlade * > &blades)
 
SubDetector subDetector () const override
 The type of detector (PixelBarrel, PixelEndcap, TIB, TOB, TID, TEC, CSC, DT, RPCBarrel, RPCEndcap) More...
 
 ~PixelForwardLayerPhase1 () override
 
- Public Member Functions inherited from ForwardDetLayer
std::pair< bool, TrajectoryStateOnSurfacecompatible (const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &) const override
 
bool contains (const Local3DPoint &p) const
 
 ForwardDetLayer (bool doHaveGroups)
 
Location location () const final
 Which part of the detector (barrel, endcap) More...
 
virtual const BoundDiskspecificSurface () const final
 
const BoundSurfacesurface () const final
 The surface of the GeometricSearchDet. More...
 
 ~ForwardDetLayer () override
 
- Public Member Functions inherited from DetLayer
 DetLayer (bool doHaveGroup, bool ibar)
 
bool isBarrel () const
 
bool isForward () const
 
int seqNum () const
 
void setSeqNum (int sq)
 
 ~DetLayer () override
 
- 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::PositionTypeposition () 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 *, TrajectoryStateOnSurfaceDetWithState
 
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 26 of file PixelForwardLayerPhase1.cc.

References _num_innerpanels, _num_outerpanels, ForwardDetLayer::computeSurface(), LogDebug, SiStripPI::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().

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

Definition at line 105 of file PixelForwardLayerPhase1.cc.

References mps_fire::i, and theComps.

105  {
106  vector<const GeometricSearchDet*>::const_iterator i;
107  for (i=theComps.begin(); i!=theComps.end(); i++) {
108  delete *i;
109  }
110 }
std::vector< const GeometricSearchDet * > theComps

Member Function Documentation

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

Implements GeometricSearchDet.

Definition at line 23 of file PixelForwardLayerPhase1.h.

References theBasicComps.

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

Returns basic components, if any.

Returns direct components, if any

Implements GeometricSearchDet.

Definition at line 25 of file PixelForwardLayerPhase1.h.

References groupedCompatibleDetsV(), mps_fire::result, and 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 297 of file PixelForwardLayerPhase1.cc.

References _num_innerpanels, funct::abs(), PeriodicBinFinderInPhi< T >::binIndex(), HelixArbitraryPlaneCrossing::direction(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), HelixArbitraryPlaneCrossing::pathLength(), HelixArbitraryPlaneCrossing2Order::pathLength(), Geom::phiLess(), 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().

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

Definition at line 291 of file PixelForwardLayerPhase1.cc.

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

Referenced by groupedCompatibleDetsV(), searchNeighbors(), and subDetector().

292 {
293  return std::abs(firstBlade->position().z()) < std::abs(secondBlade->position().z()) ? 0 : 1;
294 }
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 372 of file PixelForwardLayerPhase1.cc.

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

Referenced by groupedCompatibleDetsV().

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

Reimplemented from GeometricSearchDet.

Definition at line 113 of file PixelForwardLayerPhase1.cc.

References _num_innerpanels, PVValHelper::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().

Referenced by components().

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

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

Referenced by groupedCompatibleDetsV().

228 {
229  typedef CompatibleDetToGroupAdder Adder;
230  int crossingSide = LayerCrossingSide().endcapSide( tsos, prop);
231  typedef DetGroupMerger Merger;
232 
233  int negStart = min( crossings.closestIndex, crossings.nextIndex) - 1;
234  int posStart = max( crossings.closestIndex, crossings.nextIndex) + 1;
235 
236  int quarter = theComps.size()/4;
237  if(innerDisk) quarter = _num_innerpanels/4;
238  else quarter = _num_outerpanels/4;
239 
240  for (int idet=negStart; idet >= negStart - quarter+1; idet--) {
241  std::vector<DetGroup> tmp1;
242  std::vector<DetGroup> newResult;
243  if(innerDisk) {
244  const GeometricSearchDet* neighbor = theComps[theBinFinder_inner.binIndex(idet)];
245  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
246  // maybe also add shallow crossing angle test here???
247  if (!Adder::add( *neighbor, tsos, prop, est, tmp1)) break;
248  int theHelicity = computeHelicity(theComps[theBinFinder_inner.binIndex(idet)],
250  std::vector<DetGroup> tmp2; tmp2.swap(result);
251  Merger::orderAndMergeTwoLevels( std::move(tmp1), std::move(tmp2), newResult, theHelicity, crossingSide);
252  } else {
254  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
255  // maybe also add shallow crossing angle test here???
256  if (!Adder::add( *neighbor, tsos, prop, est, tmp1)) break;
259  std::vector<DetGroup> tmp2; tmp2.swap(result);
260  Merger::orderAndMergeTwoLevels( std::move(tmp1), std::move(tmp2), newResult, theHelicity, crossingSide);
261  }
262  result.swap(newResult);
263  }
264  for (int idet=posStart; idet < posStart + quarter-1; idet++) {
265  std::vector<DetGroup> tmp1;
266  std::vector<DetGroup> newResult;
267  if(innerDisk) {
268  const GeometricSearchDet* neighbor = theComps[theBinFinder_inner.binIndex(idet)];
269  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
270  // maybe also add shallow crossing angle test here???
271  if (!Adder::add( *neighbor, tsos, prop, est, tmp1)) break;
272  int theHelicity = computeHelicity(theComps[theBinFinder_inner.binIndex(idet-1)],
274  std::vector<DetGroup> tmp2; tmp2.swap(result);
275  Merger::orderAndMergeTwoLevels(std::move(tmp2), std::move(tmp1), newResult, theHelicity, crossingSide);
276  } else {
278  // if (!overlap( gCrossingPos, *neighbor, window)) break; // mybe not needed?
279  // maybe also add shallow crossing angle test here???
280  if (!Adder::add( *neighbor, tsos, prop, est, tmp1)) break;
283  std::vector<DetGroup> tmp2; tmp2.swap(result);
284  Merger::orderAndMergeTwoLevels(std::move(tmp2), std::move(tmp1), newResult, theHelicity, crossingSide);
285  }
286  result.swap(newResult);
287  }
288 }
int binIndex(T phi) const override
returns an index in the valid range for the bin that contains phi
static int computeHelicity(const GeometricSearchDet *firstBlade, const GeometricSearchDet *secondBlade)
std::vector< const GeometricSearchDet * > theComps
static int endcapSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
T min(T a, T b)
Definition: MathUtil.h:58
void add(std::map< std::string, TH1 * > &h, TH1 *hist)
def move(src, dest)
Definition: eostools.py:511
SubDetector PixelForwardLayerPhase1::subDetector ( ) const
inlineoverridevirtual

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 computeHelicity(), 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