test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TBLayer.cc
Go to the documentation of this file.
1 #include "TBLayer.h"
2 
3 #include "LayerCrossingSide.h"
4 #include "DetGroupMerger.h"
6 
9 
10 
12  for ( auto i : theComps) delete i;
13 }
14 
15 
16 
17 void
19  const Propagator& prop,
20  const MeasurementEstimator& est,
21  std::vector<DetGroup> & result) const {
22  SubLayerCrossings crossings;
23  crossings = computeCrossings( tsos, prop.propagationDirection());
24  if(! crossings.isValid()) return;
25 
26  std::vector<DetGroup> closestResult;
27  addClosest( tsos, prop, est, crossings.closest(), closestResult);
28  // for TIB this differs from compatibleDets logic, which checks next in such cases!!!
29  if (closestResult.empty()){
30  if (!isTIB()) addClosest( tsos, prop, est, crossings.other(), result);
31  return;
32  }
33 
34  DetGroupElement closestGel( closestResult.front().front());
35  float window = computeWindowSize( closestGel.det(), closestGel.trajectoryState(), est);
36 
37  searchNeighbors( tsos, prop, est, crossings.closest(), window,
38  closestResult, false);
39 
40  std::vector<DetGroup> nextResult;
41  searchNeighbors( tsos, prop, est, crossings.other(), window,
42  nextResult, true);
43 
44  int crossingSide = LayerCrossingSide().barrelSide( closestGel.trajectoryState(), prop);
45  DetGroupMerger::orderAndMergeTwoLevels( std::move(closestResult), std::move(nextResult), result,
46  crossings.closestIndex(), crossingSide);
47 }
48 
49 
51  PropagationDirection propDir) const
52 {
53  GlobalPoint startPos( startingState.globalPosition());
54  GlobalVector startDir( startingState.globalMomentum());
55  double rho( startingState.transverseCurvature());
56 
57  HelixBarrelCylinderCrossing innerCrossing( startPos, startDir, rho,
58  propDir,*theInnerCylinder,
60  if (!innerCrossing.hasSolution()) return SubLayerCrossings();
61 
62  HelixBarrelCylinderCrossing outerCrossing( startPos, startDir, rho,
63  propDir,*theOuterCylinder,
65  if (!outerCrossing.hasSolution()) return SubLayerCrossings();
66 
67 
68  GlobalPoint gInnerPoint( innerCrossing.position());
69  GlobalPoint gOuterPoint( outerCrossing.position());
70 
71 
72  int innerIndex, outerIndex; bool inLess;
73  std::tie(inLess,innerIndex, outerIndex) = computeIndexes(gInnerPoint,gOuterPoint);
74 
75  SubLayerCrossing innerSLC( 0, innerIndex, gInnerPoint);
76  SubLayerCrossing outerSLC( 1, outerIndex, gOuterPoint);
77 
78  if (inLess) {
79  return SubLayerCrossings( innerSLC, outerSLC, 0);
80  }
81  else {
82  return SubLayerCrossings( outerSLC, innerSLC, 1);
83  }
84 }
85 
87  const Propagator& prop,
88  const MeasurementEstimator& est,
89  const SubLayerCrossing& crossing,
90  std::vector<DetGroup>& result) const
91 {
92 
93  auto const & sub = subLayer( crossing.subLayerIndex());
94  auto det = sub[crossing.closestDetIndex()];
95  return CompatibleDetToGroupAdder().add( *det, tsos, prop, est, result);
96 }
ReferenceCountingPointer< BoundCylinder > theOuterCylinder
Definition: TBLayer.h:89
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir) const __attribute__((hot))
Definition: TBLayer.cc:50
int i
Definition: DBlmapReader.cc:9
def window
Definition: svgfig.py:642
static int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
returns 0 if barrel layer crossed from inside, 1 if from outside
int closestIndex() const
int closestDetIndex() const
std::vector< const GeometricSearchDet * > theComps
Definition: TBLayer.h:83
GlobalPoint globalPosition() const
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:151
PropagationDirection
bool addClosest(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, std::vector< DetGroup > &result) const __attribute__((hot))
Definition: TBLayer.cc:86
~TBLayer() __attribute__((cold))
Definition: TBLayer.cc:11
tuple result
Definition: mps_fire.py:83
virtual float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const =0
int subLayerIndex() const
def move
Definition: eostools.py:510
virtual std::tuple< bool, int, int > computeIndexes(GlobalPoint gInnerPoint, GlobalPoint gOuterPoint) const =0
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const final __attribute__((hot))
Definition: TBLayer.cc:18
const SubLayerCrossing & other() const
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
Definition: TBLayer.h:64
const SubLayerCrossing & closest() const
GlobalVector globalMomentum() const
bool isTIB() const
Definition: TBLayer.h:68
virtual void searchNeighbors(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, const SubLayerCrossing &crossing, float window, std::vector< DetGroup > &result, bool checkClosest) const =0
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
ReferenceCountingPointer< BoundCylinder > theInnerCylinder
Definition: TBLayer.h:88