CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
SiStripOverlapHit Class Reference

#include <CalibTracker/SiStripHitResolution/interface/SiStripOverlapHit.cc>

Public Types

using ConstRecHitPointer = TrackingRecHit::ConstRecHitPointer
 
using RecHitPointer = TrackingRecHit::RecHitPointer
 

Public Member Functions

double distance (bool fromTrajectory=false) const
 
double getTrackLocalAngle (unsigned int hit) const
 
ConstRecHitPointer const & hit (unsigned int hit) const
 
ConstRecHitPointer const & hitA () const
 
ConstRecHitPointer const & hitB () const
 
double offset (unsigned int hit) const
 
GlobalPoint position () const
 
double shift () const
 
 SiStripOverlapHit (TrajectoryMeasurement const &measA, TrajectoryMeasurement const &measB)
 
TrajectoryStateOnSurface const & trajectoryStateOnSurface (unsigned int hit=0, bool updated=true) const
 
virtual ~SiStripOverlapHit ()
 

Private Attributes

TrajectoryMeasurement measA_
 
TrajectoryMeasurement measB_
 

Detailed Description

Description: A pair of hits on overlaping modules

Implementation: Designed for CPE studies. Includes methods to compute residuals, etc.

Definition at line 27 of file SiStripOverlapHit.h.

Member Typedef Documentation

◆ ConstRecHitPointer

Definition at line 30 of file SiStripOverlapHit.h.

◆ RecHitPointer

Definition at line 29 of file SiStripOverlapHit.h.

Constructor & Destructor Documentation

◆ SiStripOverlapHit()

SiStripOverlapHit::SiStripOverlapHit ( TrajectoryMeasurement const &  measA,
TrajectoryMeasurement const &  measB 
)
explicit

Definition at line 4 of file SiStripOverlapHit.cc.

References measA_, measB_, and TrajectoryMeasurement::recHit().

4  {
5  // check which hit is closer to the IP
6  // assign it to hitA_, the other to hitB_
7  double rA = measA.recHit()->globalPosition().perp();
8  double rB = measB.recHit()->globalPosition().perp();
9  if (rA < rB) {
10  measA_ = measA;
11  measB_ = measB;
12  } else {
13  measA_ = measB;
14  measB_ = measA;
15  }
16 }
TrajectoryMeasurement measB_
TrajectoryMeasurement measA_

◆ ~SiStripOverlapHit()

virtual SiStripOverlapHit::~SiStripOverlapHit ( )
inlinevirtual

Definition at line 35 of file SiStripOverlapHit.h.

35 {}

Member Function Documentation

◆ distance()

double SiStripOverlapHit::distance ( bool  fromTrajectory = false) const

Definition at line 48 of file SiStripOverlapHit.cc.

References hitA(), hitB(), and trajectoryStateOnSurface().

48  {
49  if (fromTrajectory) {
50  return (trajectoryStateOnSurface(0, true).globalPosition().basicVector() -
51  trajectoryStateOnSurface(1, true).globalPosition().basicVector())
52  .mag();
53  } else {
54  return (hitA()->globalPosition().basicVector() - hitB()->globalPosition().basicVector()).mag();
55  }
56 }
ConstRecHitPointer const & hitB() const
ConstRecHitPointer const & hitA() const
TrajectoryStateOnSurface const & trajectoryStateOnSurface(unsigned int hit=0, bool updated=true) const

◆ getTrackLocalAngle()

double SiStripOverlapHit::getTrackLocalAngle ( unsigned int  hit) const

Definition at line 30 of file SiStripOverlapHit.cc.

References trajectoryStateOnSurface(), x, and z.

30  {
31  // since x is the precise coordinate and z is pointing out, we want the angle between z and x
32  return hit ? atan(trajectoryStateOnSurface(hit - 1).localDirection().x() /
33  trajectoryStateOnSurface(hit - 1).localDirection().z())
34  : (getTrackLocalAngle(1) + getTrackLocalAngle(2)) / 2.;
35 }
double getTrackLocalAngle(unsigned int hit) const
TrajectoryStateOnSurface const & trajectoryStateOnSurface(unsigned int hit=0, bool updated=true) const

◆ hit()

ConstRecHitPointer const& SiStripOverlapHit::hit ( unsigned int  hit) const
inline

Definition at line 40 of file SiStripOverlapHit.h.

References hitA(), and hitB().

Referenced by offset().

40 { return hit ? hitB() : hitA(); }
ConstRecHitPointer const & hitB() const
ConstRecHitPointer const & hitA() const

◆ hitA()

ConstRecHitPointer const& SiStripOverlapHit::hitA ( ) const
inline

Definition at line 38 of file SiStripOverlapHit.h.

References measA_, and TrajectoryMeasurement::recHit().

Referenced by distance(), hit(), and position().

38 { return measA_.recHit(); }
TrajectoryMeasurement measA_
ConstRecHitPointer const & recHit() const

◆ hitB()

ConstRecHitPointer const& SiStripOverlapHit::hitB ( ) const
inline

Definition at line 39 of file SiStripOverlapHit.h.

References measB_, and TrajectoryMeasurement::recHit().

Referenced by distance(), hit(), and position().

39 { return measB_.recHit(); }
TrajectoryMeasurement measB_
ConstRecHitPointer const & recHit() const

◆ offset()

double SiStripOverlapHit::offset ( unsigned int  hit) const

Definition at line 37 of file SiStripOverlapHit.cc.

References cms::cuda::assert(), hit(), TrajectoryStateOnSurface::localPosition(), trajectoryStateOnSurface(), and PV3DBase< T, PVType, FrameType >::x().

Referenced by shift().

37  {
38  assert(hit < 2);
39  // x is the precise coordinate
40  return this->hit(hit)->localPosition().x() - trajectoryStateOnSurface(hit, false).localPosition().x();
41 }
ConstRecHitPointer const & hit(unsigned int hit) const
assert(be >=bs)
T x() const
Definition: PV3DBase.h:59
TrajectoryStateOnSurface const & trajectoryStateOnSurface(unsigned int hit=0, bool updated=true) const

◆ position()

GlobalPoint SiStripOverlapHit::position ( ) const

Definition at line 58 of file SiStripOverlapHit.cc.

References hitA(), hitB(), and trackerHitRTTI::vector.

58  {
59  auto vector = (hitA()->globalPosition().basicVector() + hitB()->globalPosition().basicVector()) / 2.;
60  return GlobalPoint(vector);
61 }
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
ConstRecHitPointer const & hitB() const
ConstRecHitPointer const & hitA() const

◆ shift()

double SiStripOverlapHit::shift ( ) const

Definition at line 43 of file SiStripOverlapHit.cc.

References offset().

43  {
44  // so this is the double difference
45  return offset(0) - offset(1);
46 }
double offset(unsigned int hit) const

◆ trajectoryStateOnSurface()

TrajectoryStateOnSurface const & SiStripOverlapHit::trajectoryStateOnSurface ( unsigned int  hit = 0,
bool  updated = true 
) const

Definition at line 18 of file SiStripOverlapHit.cc.

References cms::cuda::assert(), measA_, measB_, TrajectoryMeasurement::predictedState(), and TrajectoryMeasurement::updatedState().

Referenced by distance(), getTrackLocalAngle(), and offset().

18  {
19  assert(hit < 2);
20  switch (hit) {
21  case 0:
22  return updated ? measA_.updatedState() : measA_.predictedState();
23  case 1:
24  return updated ? measB_.updatedState() : measB_.predictedState();
25  default:
26  return measA_.updatedState();
27  }
28 }
TrajectoryStateOnSurface const & predictedState() const
assert(be >=bs)
TrajectoryMeasurement measB_
TrajectoryMeasurement measA_
TrajectoryStateOnSurface const & updatedState() const

Member Data Documentation

◆ measA_

TrajectoryMeasurement SiStripOverlapHit::measA_
private

Definition at line 57 of file SiStripOverlapHit.h.

Referenced by hitA(), SiStripOverlapHit(), and trajectoryStateOnSurface().

◆ measB_

TrajectoryMeasurement SiStripOverlapHit::measB_
private

Definition at line 58 of file SiStripOverlapHit.h.

Referenced by hitB(), SiStripOverlapHit(), and trajectoryStateOnSurface().