CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
TkClonerImpl Class Referencefinal

#include <TkClonerImpl.h>

Inheritance diagram for TkClonerImpl:
TkCloner

Public Member Functions

TrackingRecHit::ConstRecHitPointer makeShared (SiPixelRecHit const &hit, TrajectoryStateOnSurface const &tsos) const override
 
TrackingRecHit::ConstRecHitPointer makeShared (SiStripRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
TrackingRecHit::ConstRecHitPointer makeShared (SiStripRecHit1D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
TrackingRecHit::ConstRecHitPointer makeShared (SiStripMatchedRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
TrackingRecHit::ConstRecHitPointer makeShared (ProjectedSiStripRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
TrackingRecHit::ConstRecHitPointer makeShared (Phase2TrackerRecHit1D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
TrackingRecHit::ConstRecHitPointer makeShared (VectorHit const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr< SiPixelRecHitoperator() (SiPixelRecHit const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr< SiStripRecHit2Doperator() (SiStripRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr< SiStripRecHit1Doperator() (SiStripRecHit1D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr
< SiStripMatchedRecHit2D
operator() (SiStripMatchedRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr
< ProjectedSiStripRecHit2D
operator() (ProjectedSiStripRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr
< Phase2TrackerRecHit1D
operator() (Phase2TrackerRecHit1D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr< VectorHitoperator() (VectorHit const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr
< ProjectedSiStripRecHit2D
project (SiStripMatchedRecHit2D const &hit, bool mono, TrajectoryStateOnSurface const &tsos) const
 
 TkClonerImpl ()
 
 TkClonerImpl (const PixelClusterParameterEstimator *ipixelCPE, const StripClusterParameterEstimator *istripCPE, const SiStripRecHitMatcher *iMatcher)
 
 TkClonerImpl (const PixelClusterParameterEstimator *ipixelCPE, const ClusterParameterEstimator< Phase2TrackerCluster1D > *iPhase2OTCPE)
 
- Public Member Functions inherited from TkCloner
TrackingRecHit::ConstRecHitPointer makeShared (TrackingRecHit::ConstRecHitPointer const &hit, TrajectoryStateOnSurface const &tsos) const
 
TrackingRecHit *virtual
operator()[[cms 
~TkCloner ()
 

Private Attributes

const
ClusterParameterEstimator
< Phase2TrackerCluster1D > * 
phase2TrackerCPE
 
const
PixelClusterParameterEstimator
pixelCPE
 
const
StripClusterParameterEstimator
stripCPE
 
const SiStripRecHitMatchertheMatcher
 

Detailed Description

Definition at line 12 of file TkClonerImpl.h.

Constructor & Destructor Documentation

TkClonerImpl::TkClonerImpl ( )
inline

Definition at line 14 of file TkClonerImpl.h.

14 {}
TkClonerImpl::TkClonerImpl ( const PixelClusterParameterEstimator ipixelCPE,
const StripClusterParameterEstimator istripCPE,
const SiStripRecHitMatcher iMatcher 
)
inline

Definition at line 15 of file TkClonerImpl.h.

18  : pixelCPE(ipixelCPE), stripCPE(istripCPE), theMatcher(iMatcher), phase2TrackerCPE(nullptr) {}
const PixelClusterParameterEstimator * pixelCPE
Definition: TkClonerImpl.h:59
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
const ClusterParameterEstimator< Phase2TrackerCluster1D > * phase2TrackerCPE
Definition: TkClonerImpl.h:62
const SiStripRecHitMatcher * theMatcher
Definition: TkClonerImpl.h:61
TkClonerImpl::TkClonerImpl ( const PixelClusterParameterEstimator ipixelCPE,
const ClusterParameterEstimator< Phase2TrackerCluster1D > *  iPhase2OTCPE 
)
inline

Definition at line 19 of file TkClonerImpl.h.

21  : pixelCPE(ipixelCPE), stripCPE(nullptr), theMatcher(nullptr), phase2TrackerCPE(iPhase2OTCPE) {}
const PixelClusterParameterEstimator * pixelCPE
Definition: TkClonerImpl.h:59
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
const ClusterParameterEstimator< Phase2TrackerCluster1D > * phase2TrackerCPE
Definition: TkClonerImpl.h:62
const SiStripRecHitMatcher * theMatcher
Definition: TkClonerImpl.h:61

Member Function Documentation

TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared ( SiPixelRecHit const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

Implements TkCloner.

Definition at line 64 of file TkClonerImpl.cc.

References SiPixelRecHit::cluster(), TrackingRecHit::det(), TrackerSingleRecHit::detUnit(), PixelClusterParameterEstimator::getParameters(), submitPVValidationJobs::params, and pixelCPE.

Referenced by DAFTrackProducerAlgorithm::filter(), TrackingRecHitPropagator::project(), and SiTrackerMultiRecHitUpdator::update().

65  {
66  // std::cout << "cloning " << typeid(hit).name() << std::endl;
67  const SiPixelCluster& clust = *hit.cluster();
68  auto&& params = pixelCPE->getParameters(clust, *hit.detUnit(), tsos);
69  return std::make_shared<SiPixelRecHit>(
70  std::get<0>(params), std::get<1>(params), std::get<2>(params), *hit.det(), hit.cluster());
71 }
const PixelClusterParameterEstimator * pixelCPE
Definition: TkClonerImpl.h:59
virtual ReturnType getParameters(const SiPixelCluster &cl, const GeomDetUnit &det) const =0
Pixel cluster – collection of neighboring pixels above threshold.
TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared ( SiStripRecHit2D const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

FIXME: this only uses the first cluster and ignores the others

Implements TkCloner.

Definition at line 73 of file TkClonerImpl.cc.

References TrackingRecHit::det(), TrackerSingleRecHit::detUnit(), StripClusterParameterEstimator::localParameters(), TrackerSingleRecHit::omniCluster(), TrackerSingleRecHit::stripCluster(), and stripCPE.

74  {
75  // std::cout << "cloning " << typeid(hit).name() << std::endl;
77  const SiStripCluster& clust = hit.stripCluster();
79  return std::make_shared<SiStripRecHit2D>(lv.first, lv.second, *hit.det(), hit.omniCluster());
80 }
std::pair< LocalPoint, LocalError > LocalValues
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared ( SiStripRecHit1D const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

FIXME: this only uses the first cluster and ignores the others

Implements TkCloner.

Definition at line 82 of file TkClonerImpl.cc.

References TrackingRecHit::det(), TrackerSingleRecHit::detUnit(), StripClusterParameterEstimator::localParameters(), SiStripPI::max, TrackerSingleRecHit::omniCluster(), TrackerSingleRecHit::stripCluster(), and stripCPE.

83  {
84  // std::cout << "cloning " << typeid(hit).name() << std::endl;
86  const SiStripCluster& clust = hit.stripCluster();
88  LocalError le(lv.second.xx(), 0., std::numeric_limits<float>::max()); //Correct??
89  return std::make_shared<SiStripRecHit1D>(lv.first, le, *hit.det(), hit.omniCluster());
90 }
std::pair< LocalPoint, LocalError > LocalValues
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared ( SiStripMatchedRecHit2D const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

std::cout << "cloning " << typeid(hit).name() << std::endl;

Implements TkCloner.

Definition at line 160 of file TkClonerImpl.cc.

161  {
163  return TrackingRecHit::ConstRecHitPointer((*this)(hit, tsos));
164 }
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared ( ProjectedSiStripRecHit2D const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

Implements TkCloner.

Definition at line 166 of file TkClonerImpl.cc.

167  {
168  // std::cout << "cloning " << typeid(hit).name() << std::endl;
169  return TrackingRecHit::ConstRecHitPointer((*this)(hit, tsos));
170 }
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared ( Phase2TrackerRecHit1D const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

Implements TkCloner.

Definition at line 92 of file TkClonerImpl.cc.

References Phase2TrackerRecHit1D::cluster(), TrackingRecHit::det(), TrackerSingleRecHit::detUnit(), ClusterParameterEstimator< T >::localParameters(), submitPVValidationJobs::params, TrackerSingleRecHit::phase2OTCluster(), and phase2TrackerCPE.

93  {
94  const Phase2TrackerCluster1D& clust = hit.phase2OTCluster();
95  const PixelGeomDetUnit& gdu = (const PixelGeomDetUnit&)*(hit.detUnit());
96  auto&& params = phase2TrackerCPE->localParameters(clust, gdu, tsos);
97  return std::make_unique<Phase2TrackerRecHit1D>(params.first, params.second, *hit.det(), hit.cluster());
98 }
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
const ClusterParameterEstimator< Phase2TrackerCluster1D > * phase2TrackerCPE
Definition: TkClonerImpl.h:62
TrackingRecHit::ConstRecHitPointer TkClonerImpl::makeShared ( VectorHit const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

Implements TkCloner.

Definition at line 100 of file TkClonerImpl.cc.

101  {
102  return std::make_shared<VectorHit>(hit);
103 }
std::unique_ptr< SiPixelRecHit > TkClonerImpl::operator() ( SiPixelRecHit const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

Implements TkCloner.

Definition at line 27 of file TkClonerImpl.cc.

References SiPixelRecHit::cluster(), TrackingRecHit::det(), TrackerSingleRecHit::detUnit(), PixelClusterParameterEstimator::getParameters(), submitPVValidationJobs::params, and pixelCPE.

28  {
29  const SiPixelCluster& clust = *hit.cluster();
30  auto&& params = pixelCPE->getParameters(clust, *hit.detUnit(), tsos);
31  return std::make_unique<SiPixelRecHit>(
32  std::get<0>(params), std::get<1>(params), std::get<2>(params), *hit.det(), hit.cluster());
33 }
const PixelClusterParameterEstimator * pixelCPE
Definition: TkClonerImpl.h:59
virtual ReturnType getParameters(const SiPixelCluster &cl, const GeomDetUnit &det) const =0
Pixel cluster – collection of neighboring pixels above threshold.
std::unique_ptr< SiStripRecHit2D > TkClonerImpl::operator() ( SiStripRecHit2D const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

FIXME: this only uses the first cluster and ignores the others

Implements TkCloner.

Definition at line 35 of file TkClonerImpl.cc.

References TrackingRecHit::det(), TrackerSingleRecHit::detUnit(), StripClusterParameterEstimator::localParameters(), TrackerSingleRecHit::omniCluster(), TrackerSingleRecHit::stripCluster(), and stripCPE.

36  {
38  const SiStripCluster& clust = hit.stripCluster();
40  return std::make_unique<SiStripRecHit2D>(lv.first, lv.second, *hit.det(), hit.omniCluster());
41 }
std::pair< LocalPoint, LocalError > LocalValues
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
std::unique_ptr< SiStripRecHit1D > TkClonerImpl::operator() ( SiStripRecHit1D const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

FIXME: this only uses the first cluster and ignores the others

Implements TkCloner.

Definition at line 43 of file TkClonerImpl.cc.

References TrackingRecHit::det(), TrackerSingleRecHit::detUnit(), StripClusterParameterEstimator::localParameters(), SiStripPI::max, TrackerSingleRecHit::omniCluster(), TrackerSingleRecHit::stripCluster(), and stripCPE.

44  {
46  const SiStripCluster& clust = hit.stripCluster();
48  LocalError le(lv.second.xx(), 0., std::numeric_limits<float>::max()); //Correct??
49  return std::make_unique<SiStripRecHit1D>(lv.first, le, *hit.det(), hit.omniCluster());
50 }
std::pair< LocalPoint, LocalError > LocalValues
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
std::unique_ptr< SiStripMatchedRecHit2D > TkClonerImpl::operator() ( SiStripMatchedRecHit2D const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

Implements TkCloner.

Definition at line 134 of file TkClonerImpl.cc.

References SiStripMatchedRecHit2D::clone(), TrackingRecHit::det(), LocalTrajectoryParameters::directionNotNormalized(), TrajectoryStateOnSurface::isValid(), StripClusterParameterEstimator::localParameters(), TrajectoryStateOnSurface::localParameters(), SiStripRecHitMatcher::match(), SiStripMatchedRecHit2D::monoCluster(), SiStripMatchedRecHit2D::monoClusterRef(), GluedGeomDet::monoDet(), GeomDet::position(), SiStripMatchedRecHit2D::stereoCluster(), SiStripMatchedRecHit2D::stereoClusterRef(), GluedGeomDet::stereoDet(), stripCPE, GeomDet::surface(), groupFilesInBlocks::temp, theMatcher, and GloballyPositioned< T >::toLocal().

135  {
136  const GeomDet* det = hit.det();
137  const GluedGeomDet* gdet = static_cast<const GluedGeomDet*>(det);
138  LocalVector tkDir = (tsos.isValid() ? tsos.localParameters().directionNotNormalized()
139  : det->surface().toLocal(det->position() - GlobalPoint(0, 0, 0)));
140 
141  const SiStripCluster& monoclust = hit.monoCluster();
142  const SiStripCluster& stereoclust = hit.stereoCluster();
143 
146  stripCPE->localParameters(stereoclust, *gdet->stereoDet(), gluedToStereo(tsos, gdet));
147 
148  SiStripRecHit2D monoHit = SiStripRecHit2D(lvMono.first, lvMono.second, *gdet->monoDet(), hit.monoClusterRef());
149  SiStripRecHit2D stereoHit =
150  SiStripRecHit2D(lvStereo.first, lvStereo.second, *gdet->stereoDet(), hit.stereoClusterRef());
151 
152  // return theMatcher->match(&monoHit,&stereoHit,gdet,tkDir,true);
153  std::unique_ptr<SiStripMatchedRecHit2D> temp = theMatcher->match(&monoHit, &stereoHit, gdet, tkDir, false);
154  if (temp.get() == nullptr) {
155  temp = std::unique_ptr<SiStripMatchedRecHit2D>(hit.clone());
156  }
157  return temp;
158 }
std::pair< LocalPoint, LocalError > LocalValues
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
LocalPoint toLocal(const GlobalPoint &gp) const
const SiStripRecHitMatcher * theMatcher
Definition: TkClonerImpl.h:61
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
std::unique_ptr< ProjectedSiStripRecHit2D > TkClonerImpl::operator() ( ProjectedSiStripRecHit2D const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

Implements TkCloner.

Definition at line 172 of file TkClonerImpl.cc.

References TrackingRecHit::det(), validate-o2o-wbm::f, TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), StripClusterParameterEstimator::localParameters(), TrackerSingleRecHit::omniCluster(), ProjectedSiStripRecHit2D::originalDet(), GeomDet::position(), LocalError::rotate(), TrackerSingleRecHit::stripCluster(), stripCPE, GeomDet::surface(), GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

173  {
174  const SiStripCluster& clust = hit.stripCluster();
175  const GeomDetUnit* gdu = reinterpret_cast<const GeomDetUnit*>(hit.originalDet());
176  //if (!gdu) std::cout<<"no luck dude"<<std::endl;
178 
179  // project...
180  const GeomDet& det = *hit.det();
181  const BoundPlane& gluedPlane = det.surface();
182  const BoundPlane& hitPlane = gdu->surface();
183  LocalVector tkDir =
184  (tsos.isValid() ? tsos.localDirection() : det.surface().toLocal(det.position() - GlobalPoint(0, 0, 0)));
185 
186  auto delta = gluedPlane.localZ(hitPlane.position());
187  const LocalVector& ldir = tkDir;
188  LocalPoint lhitPos = gluedPlane.toLocal(hitPlane.toGlobal(lv.first));
189  LocalPoint projectedHitPos = lhitPos - ldir * delta / ldir.z();
190 
191  LocalVector hitXAxis = gluedPlane.toLocal(hitPlane.toGlobal(LocalVector(1.f, 0, 0)));
192  LocalError hitErr = lv.second;
193  if (gluedPlane.normalVector().dot(hitPlane.normalVector()) < 0) {
194  // the two planes are inverted, and the correlation element must change sign
195  hitErr = LocalError(hitErr.xx(), -hitErr.xy(), hitErr.yy());
196  }
197  LocalError rotatedError = hitErr.rotate(hitXAxis.x(), hitXAxis.y());
198  return std::make_unique<ProjectedSiStripRecHit2D>(
199  projectedHitPos, rotatedError, *hit.det(), *hit.originalDet(), hit.omniCluster());
200 }
std::pair< LocalPoint, LocalError > LocalValues
float xx() const
Definition: LocalError.h:22
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:60
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
float xy() const
Definition: LocalError.h:23
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
float yy() const
Definition: LocalError.h:24
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:61
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
Definition: LocalError.h:37
T x() const
Definition: PV3DBase.h:59
std::unique_ptr< Phase2TrackerRecHit1D > TkClonerImpl::operator() ( Phase2TrackerRecHit1D const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

Implements TkCloner.

Definition at line 52 of file TkClonerImpl.cc.

References Phase2TrackerRecHit1D::cluster(), TrackingRecHit::det(), TrackerSingleRecHit::detUnit(), ClusterParameterEstimator< T >::localParameters(), submitPVValidationJobs::params, TrackerSingleRecHit::phase2OTCluster(), and phase2TrackerCPE.

53  {
54  const Phase2TrackerCluster1D& clust = hit.phase2OTCluster();
55  const PixelGeomDetUnit& gdu = (const PixelGeomDetUnit&)*(hit.detUnit());
56  auto&& params = phase2TrackerCPE->localParameters(clust, gdu, tsos);
57  return std::make_unique<Phase2TrackerRecHit1D>(params.first, params.second, *hit.det(), hit.cluster());
58 }
virtual LocalValues localParameters(const T &, const GeomDetUnit &) const =0
const ClusterParameterEstimator< Phase2TrackerCluster1D > * phase2TrackerCPE
Definition: TkClonerImpl.h:62
std::unique_ptr< VectorHit > TkClonerImpl::operator() ( VectorHit const &  hit,
TrajectoryStateOnSurface const &  tsos 
) const
overridevirtual

Implements TkCloner.

Definition at line 60 of file TkClonerImpl.cc.

60  {
61  return std::make_unique<VectorHit>(hit);
62 }
std::unique_ptr< ProjectedSiStripRecHit2D > TkClonerImpl::project ( SiStripMatchedRecHit2D const &  hit,
bool  mono,
TrajectoryStateOnSurface const &  tsos 
) const

Definition at line 202 of file TkClonerImpl.cc.

References TrackingRecHit::det(), validate-o2o-wbm::f, TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), StripClusterParameterEstimator::localParameters(), SiStripMatchedRecHit2D::monoCluster(), SiStripMatchedRecHit2D::monoClusterRef(), GluedGeomDet::monoDet(), GeomDet::position(), LocalError::rotate(), SiStripMatchedRecHit2D::stereoCluster(), SiStripMatchedRecHit2D::stereoClusterRef(), GluedGeomDet::stereoDet(), stripCPE, GeomDet::surface(), GloballyPositioned< T >::toLocal(), PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

204  {
205  const GeomDet& det = *hit.det();
206  const GluedGeomDet& gdet = static_cast<const GluedGeomDet&>(det);
207  const GeomDetUnit* odet = mono ? gdet.monoDet() : gdet.stereoDet();
208  const BoundPlane& gluedPlane = det.surface();
209  const BoundPlane& hitPlane = odet->surface();
210 
211  LocalVector tkDir =
212  (tsos.isValid() ? tsos.localDirection() : det.surface().toLocal(det.position() - GlobalPoint(0, 0, 0)));
213 
214  const SiStripCluster& monoclust = hit.monoCluster();
215  const SiStripCluster& stereoclust = hit.stereoCluster();
216 
218  if (tsos.isValid())
219  lv = mono ? stripCPE->localParameters(monoclust, *odet, tsos)
220  : stripCPE->localParameters(stereoclust, *odet, gluedToStereo(tsos, &gdet));
221  else
222  lv = stripCPE->localParameters(mono ? monoclust : stereoclust, *odet);
223 
224  auto delta = gluedPlane.localZ(hitPlane.position());
225  const LocalVector& ldir = tkDir;
226  LocalPoint lhitPos = gluedPlane.toLocal(hitPlane.toGlobal(lv.first));
227  LocalPoint projectedHitPos = lhitPos - ldir * delta / ldir.z();
228 
229  LocalVector hitXAxis = gluedPlane.toLocal(hitPlane.toGlobal(LocalVector(1.f, 0, 0)));
230  LocalError hitErr = lv.second;
231  if (gluedPlane.normalVector().dot(hitPlane.normalVector()) < 0) {
232  // the two planes are inverted, and the correlation element must change sign
233  hitErr = LocalError(hitErr.xx(), -hitErr.xy(), hitErr.yy());
234  }
235  LocalError rotatedError = hitErr.rotate(hitXAxis.x(), hitXAxis.y());
236  return std::make_unique<ProjectedSiStripRecHit2D>(
237  projectedHitPos, rotatedError, det, *odet, mono ? hit.monoClusterRef() : hit.stereoClusterRef());
238 }
std::pair< LocalPoint, LocalError > LocalValues
float xx() const
Definition: LocalError.h:22
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
T y() const
Definition: PV3DBase.h:60
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
float xy() const
Definition: LocalError.h:23
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
float yy() const
Definition: LocalError.h:24
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:61
LocalError rotate(float x, float y) const
Return a new LocalError, rotated by an angle defined by the direction (x,y)
Definition: LocalError.h:37
T x() const
Definition: PV3DBase.h:59
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20

Member Data Documentation

const ClusterParameterEstimator<Phase2TrackerCluster1D>* TkClonerImpl::phase2TrackerCPE
private

Definition at line 62 of file TkClonerImpl.h.

Referenced by makeShared(), and operator()().

const PixelClusterParameterEstimator* TkClonerImpl::pixelCPE
private

Definition at line 59 of file TkClonerImpl.h.

Referenced by makeShared(), and operator()().

const StripClusterParameterEstimator* TkClonerImpl::stripCPE
private

Definition at line 60 of file TkClonerImpl.h.

Referenced by makeShared(), operator()(), and project().

const SiStripRecHitMatcher* TkClonerImpl::theMatcher
private

Definition at line 61 of file TkClonerImpl.h.

Referenced by operator()().