CMS 3D CMS Logo

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