CMS 3D CMS Logo

PixelRod.cc
Go to the documentation of this file.
1 #include "PixelRod.h"
2 
4 
7 
8 using namespace std;
9 
11 
12 PixelRod::PixelRod(vector<const GeomDet*>& theInputDets) : DetRodOneR(theInputDets.begin(), theInputDets.end()) {
13  theBinFinder = BinFinderType(theDets.begin(), theDets.end());
14 
15  //--------- DEBUG INFO --------------
16  LogDebug("TkDetLayers") << "==== DEBUG PixelRod =====";
17  for (vector<const GeomDet*>::const_iterator i = theDets.begin(); i != theDets.end(); i++) {
18  LogDebug("TkDetLayers") << "PixelRod's Det pos z,perp,eta,phi: " << (**i).position().z() << " , "
19  << (**i).position().perp() << " , " << (**i).position().eta() << " , "
20  << (**i).position().phi();
21  }
22  LogDebug("TkDetLayers") << "==== end DEBUG PixelRod =====";
23  //--------------------------------------
24 }
25 
27 
28 const vector<const GeometricSearchDet*>& PixelRod::components() const {
29  throw DetLayerException("PixelRod doesn't have GeometricSearchDet components");
30 }
31 
32 pair<bool, TrajectoryStateOnSurface> PixelRod::compatible(const TrajectoryStateOnSurface& ts,
33  const Propagator&,
34  const MeasurementEstimator&) const {
35  edm::LogError("TkDetLayers") << "temporary dummy implementation of PixelRod::compatible()!!";
36  return pair<bool, TrajectoryStateOnSurface>();
37 }
38 
40  const Propagator& prop,
41  const MeasurementEstimator& est,
42  std::vector<DetWithState>& result) const {
44  TrajectoryStateOnSurface ts = prop.propagate(startingState, specificSurface());
45  if (!ts.isValid())
46  return;
47 
48  GlobalPoint startPos = ts.globalPosition();
49 
50  int closest = theBinFinder.binIndex(startPos.z());
51  pair<bool, TrajectoryStateOnSurface> closestCompat =
52  theCompatibilityChecker.isCompatible(theDets[closest], startingState, prop, est);
53 
54  if (closestCompat.first) {
55  result.push_back(DetWithState(theDets[closest], closestCompat.second));
56  } else {
57  if (!closestCompat.second.isValid())
58  return; // to investigate why this happens
59  }
60 
61  const Plane& closestPlane(theDets[closest]->specificSurface());
62 
63  Local2DVector maxDistance = est.maximalLocalDisplacement(closestCompat.second, closestPlane);
64 
65  float detHalfLen = theDets[closest]->surface().bounds().length() / 2.;
66 
67  // explore neighbours
68  for (size_t idet = closest + 1; idet < theDets.size(); idet++) {
69  LocalPoint nextPos(theDets[idet]->surface().toLocal(closestCompat.second.globalPosition()));
70  if (std::abs(nextPos.y()) < detHalfLen + maxDistance.y()) {
71  if (!add(idet, result, startingState, prop, est))
72  break;
73  } else {
74  break;
75  }
76  }
77 
78  for (int idet = closest - 1; idet >= 0; idet--) {
79  LocalPoint nextPos(theDets[idet]->surface().toLocal(closestCompat.second.globalPosition()));
80  if (std::abs(nextPos.y()) < detHalfLen + maxDistance.y()) {
81  if (!add(idet, result, startingState, prop, est))
82  break;
83  } else {
84  break;
85  }
86  }
87 }
88 
90  const Propagator&,
91  const MeasurementEstimator&,
92  std::vector<DetGroup>&) const {
93  LogDebug("TkDetLayers") << "dummy implementation of PixelRod::groupedCompatibleDets()";
94 }
MeasurementEstimator
Definition: MeasurementEstimator.h:19
mps_fire.i
i
Definition: mps_fire.py:355
particleFlowClusterHGCal_cfi.maxDistance
maxDistance
Definition: particleFlowClusterHGCal_cfi.py:22
MessageLogger.h
GeometricSearchDet::theCompatibilityChecker
GeomDetCompatibilityChecker theCompatibilityChecker
Definition: GeometricSearchDet.h:102
PeriodicBinFinderInZ::binIndex
int binIndex(T z) const override
returns an index in the valid range for the bin that contains Z
Definition: PeriodicBinFinderInZ.h:26
TrajectoryStateOnSurface::globalPosition
GlobalPoint globalPosition() const
Definition: TrajectoryStateOnSurface.h:65
end
#define end
Definition: vmac.h:39
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Propagator
Definition: Propagator.h:44
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
PixelRod::~PixelRod
~PixelRod() override
Definition: PixelRod.cc:26
DetLayerException.h
PixelRod::BinFinderType
PeriodicBinFinderInZ< float > BinFinderType
Definition: PixelRod.h:13
PixelRod::theBinFinder
BinFinderType theBinFinder
Definition: PixelRod.h:37
MeasurementEstimator.h
Vector2DBase
Definition: Vector2DBase.h:8
Point3DBase< float, GlobalTag >
GeomDetCompatibilityChecker::isCompatible
static std::pair< bool, TrajectoryStateOnSurface > isCompatible(const GeomDet *theDet, const TrajectoryStateOnSurface &ts, const Propagator &prop, const MeasurementEstimator &est)
Definition: GeomDetCompatibilityChecker.cc:58
DetRod::specificSurface
virtual const Plane & specificSurface() const final
Return the rod surface as a Plane.
Definition: DetRod.h:24
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
DetRod::surface
const BoundSurface & surface() const final
The surface of the GeometricSearchDet.
Definition: DetRod.h:19
PixelRod.h
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
DetRodOneR::theDets
std::vector< const GeomDet * > theDets
Definition: DetRodOneR.h:37
DetRodOneR::add
bool add(int idet, std::vector< DetWithState > &result, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
Query detector idet for compatible and add the output to result.
Definition: DetRodOneR.cc:32
Local2DVector
Vector2DBase< float, LocalTag > Local2DVector
Definition: FourPointPlaneBounds.h:8
PixelRod::compatibleDetsV
void compatibleDetsV(const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est, std::vector< DetWithState > &result) const override __attribute__((hot))
Definition: PixelRod.cc:39
PixelRod::components
const std::vector< const GeometricSearchDet * > & components() const override __attribute__((cold))
Returns basic components, if any.
Definition: PixelRod.cc:28
DetWithState
GeometricSearchDet::DetWithState DetWithState
Definition: PixelRod.cc:10
Propagator::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
GeometricSearchDet::DetWithState
std::pair< const GeomDet *, TrajectoryStateOnSurface > DetWithState
Definition: GeometricSearchDet.h:19
DetRodOneR
Definition: DetRodOneR.h:14
PixelRod::PixelRod
PixelRod(std::vector< const GeomDet * > &theDets)
Definition: PixelRod.cc:12
DetLayerException
Common base class.
Definition: DetLayerException.h:15
std
Definition: JetResolutionObject.h:76
Plane
Definition: Plane.h:16
toLocal
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
Definition: ConversionProducer.h:192
PixelRod::compatible
std::pair< bool, TrajectoryStateOnSurface > compatible(const TrajectoryStateOnSurface &ts, const Propagator &, const MeasurementEstimator &) const override
Definition: PixelRod.cc:32
mps_fire.result
result
Definition: mps_fire.py:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PixelRod::groupedCompatibleDetsV
void groupedCompatibleDetsV(const TrajectoryStateOnSurface &, const Propagator &, const MeasurementEstimator &, std::vector< DetGroup > &) const override
Definition: PixelRod.cc:89
begin
#define begin
Definition: vmac.h:32
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
MeasurementEstimator::maximalLocalDisplacement
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0