CMS 3D CMS Logo

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 (TrackingRecHit::ConstRecHitPointer const &hit, TrajectoryStateOnSurface const &tsos) const
 
virtual TrackingRecHit::ConstRecHitPointer makeShared (VectorHit const &hit, TrajectoryStateOnSurface const &tsos) const=0
 
virtual TrackingRecHit::ConstRecHitPointer makeShared (SiPixelRecHit const &hit, TrajectoryStateOnSurface const &tsos) const=0
 
virtual TrackingRecHit::ConstRecHitPointer makeShared (SiStripRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const=0
 
virtual TrackingRecHit::ConstRecHitPointer makeShared (SiStripRecHit1D const &hit, TrajectoryStateOnSurface const &tsos) const=0
 
virtual TrackingRecHit::ConstRecHitPointer makeShared (SiStripMatchedRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const=0
 
virtual TrackingRecHit::ConstRecHitPointer makeShared (ProjectedSiStripRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const=0
 
virtual TrackingRecHit::ConstRecHitPointer makeShared (Phase2TrackerRecHit1D const &hit, TrajectoryStateOnSurface const &tsos) const=0
 
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
 
TrackingRecHitoperator ()(TrackingRecHit const &hit
 
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< SiStripMatchedRecHit2Doperator() (SiStripMatchedRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr< ProjectedSiStripRecHit2Doperator() (ProjectedSiStripRecHit2D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr< Phase2TrackerRecHit1Doperator() (Phase2TrackerRecHit1D const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr< VectorHitoperator() (VectorHit const &hit, TrajectoryStateOnSurface const &tsos) const override
 
std::unique_ptr< ProjectedSiStripRecHit2Dproject (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
 
TrackingRecHitoperator ()(TrackingRecHit const &hit
 
virtual ~TkCloner ()
 

Private Attributes

const ClusterParameterEstimator< Phase2TrackerCluster1D > * phase2TrackerCPE
 
const PixelClusterParameterEstimatorpixelCPE
 
const StripClusterParameterEstimatorstripCPE
 
const SiStripRecHitMatchertheMatcher
 

Additional Inherited Members

- Public Attributes inherited from TkCloner
TrackingRecHit TrajectoryStateOnSurface const &tsos const
 

Detailed Description

Definition at line 12 of file TkClonerImpl.h.

Constructor & Destructor Documentation

◆ TkClonerImpl() [1/3]

TkClonerImpl::TkClonerImpl ( )
inline

Definition at line 14 of file TkClonerImpl.h.

14 {}

◆ TkClonerImpl() [2/3]

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() [3/3]

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

◆ makeShared() [1/15]

TrackingRecHit::ConstRecHitPointer TkCloner::makeShared
inline

Definition at line 24 of file TkCloner.h.

25  {
26  return hit->canImproveWithTrack() ? hit->cloneSH_(*this, tsos) : hit;
27  // return hit->cloneSH(*this, tsos);
28  }

◆ makeShared() [2/15]

virtual TrackingRecHit::ConstRecHitPointer TkCloner::makeShared

◆ makeShared() [3/15]

virtual TrackingRecHit::ConstRecHitPointer TkCloner::makeShared

◆ makeShared() [4/15]

virtual TrackingRecHit::ConstRecHitPointer TkCloner::makeShared

◆ makeShared() [5/15]

virtual TrackingRecHit::ConstRecHitPointer TkCloner::makeShared

◆ makeShared() [6/15]

virtual TrackingRecHit::ConstRecHitPointer TkCloner::makeShared

◆ makeShared() [7/15]

virtual TrackingRecHit::ConstRecHitPointer TkCloner::makeShared

◆ makeShared() [8/15]

virtual TrackingRecHit::ConstRecHitPointer TkCloner::makeShared

◆ makeShared() [9/15]

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

Implements TkCloner.

Definition at line 64 of file TkClonerImpl.cc.

References 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.

◆ makeShared() [10/15]

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 StripClusterParameterEstimator::localParameters(), 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

◆ makeShared() [11/15]

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 StripClusterParameterEstimator::localParameters(), SiStripPI::max, 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

◆ makeShared() [12/15]

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

◆ makeShared() [13/15]

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

◆ makeShared() [14/15]

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

Implements TkCloner.

Definition at line 92 of file TkClonerImpl.cc.

References ClusterParameterEstimator< T >::localParameters(), submitPVValidationJobs::params, 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

◆ makeShared() [15/15]

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 }

◆ operator()

TrackingRecHit* TkCloner::operator

◆ operator()() [1/7]

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 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.

◆ operator()() [2/7]

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 StripClusterParameterEstimator::localParameters(), 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

◆ operator()() [3/7]

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 StripClusterParameterEstimator::localParameters(), SiStripPI::max, 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

◆ operator()() [4/7]

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 LocalTrajectoryParameters::directionNotNormalized(), TrajectoryStateOnSurface::isValid(), StripClusterParameterEstimator::localParameters(), TrajectoryStateOnSurface::localParameters(), SiStripRecHitMatcher::match(), GluedGeomDet::monoDet(), GeomDet::position(), 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
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
std::unique_ptr< SiStripMatchedRecHit2D > match(const SiStripRecHit2D *monoRH, const SiStripRecHit2D *stereoRH, const GluedGeomDet *gluedDet, LocalVector trackdirection, bool force) const
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
LocalPoint toLocal(const GlobalPoint &gp) const
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const SiStripRecHitMatcher * theMatcher
Definition: TkClonerImpl.h:61
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43

◆ operator()() [5/7]

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 dumpMFGeometry_cfg::delta, f, TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), StripClusterParameterEstimator::localParameters(), GeomDet::position(), LocalError::rotate(), 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
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
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
T z() const
Definition: PV3DBase.h:61
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
LocalPoint toLocal(const GlobalPoint &gp) const
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
double f[11][100]
float xy() const
Definition: LocalError.h:23
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
float xx() const
Definition: LocalError.h:22

◆ operator()() [6/7]

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 ClusterParameterEstimator< T >::localParameters(), submitPVValidationJobs::params, 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

◆ operator()() [7/7]

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 }

◆ project()

std::unique_ptr< ProjectedSiStripRecHit2D > TkClonerImpl::project ( SiStripMatchedRecHit2D const hit,
bool  mono,
TrajectoryStateOnSurface const tsos 
) const

Definition at line 202 of file TkClonerImpl.cc.

References dumpMFGeometry_cfg::delta, f, TrajectoryStateOnSurface::isValid(), TrajectoryStateOnSurface::localDirection(), StripClusterParameterEstimator::localParameters(), GluedGeomDet::monoDet(), GeomDet::position(), LocalError::rotate(), 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
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
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters &ltp) const
T z() const
Definition: PV3DBase.h:61
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
LocalPoint toLocal(const GlobalPoint &gp) const
float yy() const
Definition: LocalError.h:24
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
const StripClusterParameterEstimator * stripCPE
Definition: TkClonerImpl.h:60
double f[11][100]
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:19
float xy() const
Definition: LocalError.h:23
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:20
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
float xx() const
Definition: LocalError.h:22

Member Data Documentation

◆ phase2TrackerCPE

const ClusterParameterEstimator<Phase2TrackerCluster1D>* TkClonerImpl::phase2TrackerCPE
private

Definition at line 62 of file TkClonerImpl.h.

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

◆ pixelCPE

const PixelClusterParameterEstimator* TkClonerImpl::pixelCPE
private

Definition at line 59 of file TkClonerImpl.h.

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

◆ stripCPE

const StripClusterParameterEstimator* TkClonerImpl::stripCPE
private

Definition at line 60 of file TkClonerImpl.h.

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

◆ theMatcher

const SiStripRecHitMatcher* TkClonerImpl::theMatcher
private

Definition at line 61 of file TkClonerImpl.h.

Referenced by operator()().