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 }
Vector3DBase
Definition: Vector3DBase.h:8
MeasurementEstimator
Definition: MeasurementEstimator.h:19
SubLayerCrossings::isValid
bool isValid()
Definition: SubLayerCrossings.h:28
HelixBarrelCylinderCrossing.h
mps_fire.i
i
Definition: mps_fire.py:355
HelixBarrelCylinderCrossing::onlyPos
Definition: HelixBarrelCylinderCrossing.h:18
LayerCrossingSide
Definition: LayerCrossingSide.h:15
LayerCrossingSide.h
SubLayerCrossings::closestIndex
int closestIndex() const
Definition: SubLayerCrossings.h:31
HelixBarrelCylinderCrossing::hasSolution
bool hasSolution() const
Definition: HelixBarrelCylinderCrossing.h:34
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
svgfig.window
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::~TBLayer
~TBLayer() override __attribute__((cold))
Definition: TBLayer.cc:10
TrajectoryStateOnSurface::transverseCurvature
double transverseCurvature() const
Definition: TrajectoryStateOnSurface.h:70
TBLayer::theInnerCylinder
ReferenceCountingPointer< BoundCylinder > theInnerCylinder
Definition: TBLayer.h:74
TBLayer::groupedCompatibleDetsV
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) const override __attribute__((hot))
Definition: TBLayer.cc:15
TBLayer::searchNeighbors
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
Propagator
Definition: Propagator.h:44
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
TBLayer::computeIndexes
virtual std::tuple< bool, int, int > computeIndexes(GlobalPoint gInnerPoint, GlobalPoint gOuterPoint) const =0
MeasurementEstimator.h
Propagator::propagationDirection
virtual PropagationDirection propagationDirection() const final
Definition: Propagator.h:139
DetGroupMerger.h
Point3DBase< float, GlobalTag >
DDAxes::rho
DetGroupMerger::orderAndMergeTwoLevels
static void orderAndMergeTwoLevels(std::vector< DetGroup > &&one, std::vector< DetGroup > &&two, std::vector< DetGroup > &result, int firstIndex, int firstCrossed)
Definition: DetGroupMerger.cc:6
TBLayer::theComps
std::vector< const GeometricSearchDet * > theComps
Definition: TBLayer.h:69
CompatibleDetToGroupAdder::add
static bool add(const GeometricSearchDet &det, const TrajectoryStateOnSurface &tsos, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetGroup > &result) __attribute__((hot))
Definition: CompatibleDetToGroupAdder.cc:7
SubLayerCrossings::closest
const SubLayerCrossing & closest() const
Definition: SubLayerCrossings.h:29
TBLayer::addClosest
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
HelixBarrelCylinderCrossing::position
PositionType position() const
Definition: HelixBarrelCylinderCrossing.h:48
SubLayerCrossing::closestDetIndex
int closestDetIndex() const
Definition: SubLayerCrossings.h:13
DetGroupElement
Definition: DetGroup.h:10
TBLayer::subLayer
const std::vector< const GeometricSearchDet * > & subLayer(int ind) const
Definition: TBLayer.h:51
TBLayer::theOuterCylinder
ReferenceCountingPointer< BoundCylinder > theOuterCylinder
Definition: TBLayer.h:75
CompatibleDetToGroupAdder.h
TBLayer::computeWindowSize
virtual float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est) const =0
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
eostools.move
def move(src, dest)
Definition: eostools.py:511
TBLayer.h
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
CompatibleDetToGroupAdder
Definition: CompatibleDetToGroupAdder.h:13
LayerCrossingSide::barrelSide
static int barrelSide(const TrajectoryStateOnSurface &startingState, const Propagator &prop)
returns 0 if barrel layer crossed from inside, 1 if from outside
Definition: LayerCrossingSide.h:18
SubLayerCrossings::other
const SubLayerCrossing & other() const
Definition: SubLayerCrossings.h:30
SubLayerCrossing
Definition: SubLayerCrossings.h:7
SubLayerCrossing::subLayerIndex
int subLayerIndex() const
Definition: SubLayerCrossings.h:12
HelixBarrelCylinderCrossing
Definition: HelixBarrelCylinderCrossing.h:16
mps_fire.result
result
Definition: mps_fire.py:303
TBLayer::computeCrossings
SubLayerCrossings computeCrossings(const TrajectoryStateOnSurface &startingState, PropagationDirection propDir) const __attribute__((hot))
Definition: TBLayer.cc:46
TBLayer::isTIB
bool isTIB() const
Definition: TBLayer.h:55
SubLayerCrossings
Definition: SubLayerCrossings.h:22