CMS 3D CMS Logo

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

#include <DTHitPairForFit.h>

Public Member Functions

float digiTime () const
 Returns the time of the corresponding digi. More...
 
 DTHitPairForFit (const DTRecHit1DPair &pair, const DTSuperLayer &sl, const edm::ESHandle< DTGeometry > &dtGeom)
 Constructor. More...
 
const DTWireIdid () const
 Returns the Id of the wire on which the rechit rely. More...
 
std::pair< bool, bool > isCompatible (const LocalPoint &posIni, const LocalVector &dirIni) const
 
LocalPoint leftPos () const
 Returns the position in the layer r.f. of the left rechit. More...
 
LocalPoint localPosition (DTEnums::DTCellSide s) const
 Returns the local position in the layer. More...
 
LocalError localPositionError () const
 
bool operator< (const DTHitPairForFit &hit) const
 define the order by increasing z More...
 
bool operator== (const DTHitPairForFit &hit) const
 
LocalPoint rightPos () const
 Returns the position in the layer r.f. of the right rechit. More...
 
 ~DTHitPairForFit ()
 Destructor. More...
 

Private Attributes

float theDigiTime
 
LocalError theError
 
LocalPoint theLeftPos
 
LocalPoint theRightPos
 
DTWireId theWireId
 

Detailed Description

Hit pair used for the segments fit

This class is useful for segment fitting, which is done in SL or Chamber reference frame, while the DT hits live on the layer.

Author
Stefano Lacaprara - INFN Legnaro stefa.nosp@m.no.l.nosp@m.acapr.nosp@m.ara@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t
Riccardo Bellan - INFN TO ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 31 of file DTHitPairForFit.h.

Constructor & Destructor Documentation

◆ DTHitPairForFit()

DTHitPairForFit::DTHitPairForFit ( const DTRecHit1DPair pair,
const DTSuperLayer sl,
const edm::ESHandle< DTGeometry > &  dtGeom 
)

Constructor.

Definition at line 20 of file DTHitPairForFit.cc.

22  {
23  theWireId = pair.wireId();
24  theDigiTime = pair.digiTime();
25 
26  const DTLayer* layer = dtGeom->layer(theWireId.layerId());
27 
28  // transform the Local position in Layer-rf in a SL local position
31 
32  // TODO how do I transform an error from local to global?
34  // theError =
35  // layer->surface().toLocal(sl.surface().toGlobal(pair.componentRecHit(DTEnums::Left)->localPositionError()));
36 }

References DTRecHit1DPair::componentRecHit(), DTRecHit1DPair::digiTime(), DTGeometry::layer(), phase1PixelTopology::layer, DTEnums::Left, DTRecHit1D::localPosition(), DTRecHit1D::localPositionError(), DTEnums::Right, GeomDet::toLocal(), and DTRecHit1DPair::wireId().

◆ ~DTHitPairForFit()

DTHitPairForFit::~DTHitPairForFit ( )

Destructor.

Definition at line 39 of file DTHitPairForFit.cc.

39 {}

Member Function Documentation

◆ digiTime()

float DTHitPairForFit::digiTime ( ) const
inline

Returns the time of the corresponding digi.

Definition at line 57 of file DTHitPairForFit.h.

57 { return theDigiTime; }

References theDigiTime.

◆ id()

const DTWireId& DTHitPairForFit::id ( void  ) const
inline

Returns the Id of the wire on which the rechit rely.

Definition at line 54 of file DTHitPairForFit.h.

54 { return theWireId; }

References theWireId.

◆ isCompatible()

pair< bool, bool > DTHitPairForFit::isCompatible ( const LocalPoint posIni,
const LocalVector dirIni 
) const

check for compatibility of the hit pair with a given position and direction: the first bool of the returned pair is for the left hit, the second for the right one

Definition at line 53 of file DTHitPairForFit.cc.

53  {
54  pair<bool, bool> ret;
55  LocalPoint segPosAtZLeft = posIni + dirIni * (theLeftPos.z() - posIni.z()) / dirIni.z();
56  LocalPoint segPosAtZRight = posIni + dirIni * (theRightPos.z() - posIni.z()) / dirIni.z();
57  float dxLeft = fabs(theLeftPos.x() - segPosAtZLeft.x());
58  float dxRight = fabs(theRightPos.x() - segPosAtZRight.x());
59  float exx = sqrt(theError.xx());
60  // if both below 3 sigma, return both
61  // if both at 10 sigma or above, return none
62  // if one is below N sigma and one above, for 10>=N>=3, match only that one, otherwise none
63  if (std::max(dxLeft, dxRight) < 3 * exx) {
64  ret = make_pair(true, true);
65  } else if (std::min(dxLeft, dxRight) >= 10 * exx) {
66  ret = make_pair(false, false);
67  } else {
68  float sigmasL = floorf(dxLeft / exx), sigmasR = floorf(dxRight / exx);
69  ret.first = (sigmasL < sigmasR);
70  ret.second = (sigmasR < sigmasL);
71  }
72  return ret;
73 }

References SiStripPI::max, min(), runTheMatrix::ret, mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::z().

◆ leftPos()

LocalPoint DTHitPairForFit::leftPos ( ) const
inline

Returns the position in the layer r.f. of the left rechit.

Definition at line 45 of file DTHitPairForFit.h.

45 { return theLeftPos; }

References theLeftPos.

◆ localPosition()

LocalPoint DTHitPairForFit::localPosition ( DTEnums::DTCellSide  s) const

Returns the local position in the layer.

Definition at line 42 of file DTHitPairForFit.cc.

42  {
43  if (s == DTEnums::Left)
44  return theLeftPos;
45  else if (s == DTEnums::Right)
46  return theRightPos;
47  else {
48  throw cms::Exception("DTHitPairForFit") << " localPosition called with undef LR code" << endl;
49  return LocalPoint();
50  }
51 }

References Exception, DTEnums::Left, DTEnums::Right, and alignCSCRings::s.

◆ localPositionError()

LocalError DTHitPairForFit::localPositionError ( ) const
inline

Definition at line 51 of file DTHitPairForFit.h.

51 { return theError; }

References theError.

◆ operator<()

bool DTHitPairForFit::operator< ( const DTHitPairForFit hit) const

define the order by increasing z

Definition at line 75 of file DTHitPairForFit.cc.

75  {
76  //SL if same layer use x() for strict ordering
77  if (id() == hit.id())
78  return (theLeftPos.x() < hit.localPosition(DTEnums::Left).x());
79  return (id() < hit.id());
80 }

References hit::id, DTEnums::Left, and hit::x.

◆ operator==()

bool DTHitPairForFit::operator== ( const DTHitPairForFit hit) const

Definition at line 82 of file DTHitPairForFit.cc.

82  {
83  return (id() == hit.id() && fabs(digiTime() - hit.digiTime()) < 0.1);
84 }

References hit::id.

◆ rightPos()

LocalPoint DTHitPairForFit::rightPos ( ) const
inline

Returns the position in the layer r.f. of the right rechit.

Definition at line 48 of file DTHitPairForFit.h.

48 { return theRightPos; }

References theRightPos.

Member Data Documentation

◆ theDigiTime

float DTHitPairForFit::theDigiTime
private

Definition at line 75 of file DTHitPairForFit.h.

Referenced by digiTime().

◆ theError

LocalError DTHitPairForFit::theError
private

Definition at line 73 of file DTHitPairForFit.h.

Referenced by localPositionError().

◆ theLeftPos

LocalPoint DTHitPairForFit::theLeftPos
private

Definition at line 71 of file DTHitPairForFit.h.

Referenced by leftPos().

◆ theRightPos

LocalPoint DTHitPairForFit::theRightPos
private

Definition at line 72 of file DTHitPairForFit.h.

Referenced by rightPos().

◆ theWireId

DTWireId DTHitPairForFit::theWireId
private

Definition at line 74 of file DTHitPairForFit.h.

Referenced by id().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
DTHitPairForFit::theRightPos
LocalPoint theRightPos
Definition: DTHitPairForFit.h:72
DTRecHit1DPair::componentRecHit
const DTRecHit1D * componentRecHit(DTEnums::DTCellSide lrSide) const
Return the left/right DTRecHit1D.
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
min
T min(T a, T b)
Definition: MathUtil.h:58
align::LocalPoint
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
DTRecHit1D::localPositionError
LocalError localPositionError() const override
Return the 3-dimensional error on the local position.
Definition: DTRecHit1D.h:50
DTRecHit1DPair::digiTime
float digiTime() const
Return the digi time (ns) used to build the rechits.
Definition: DTRecHit1DPair.h:63
hit::x
double x
Definition: SiStripHitEffFromCalibTree.cc:89
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
alignCSCRings.s
s
Definition: alignCSCRings.py:92
DTEnums::Left
Definition: DTEnums.h:15
DTHitPairForFit::theDigiTime
float theDigiTime
Definition: DTHitPairForFit.h:75
LocalError::xx
float xx() const
Definition: LocalError.h:22
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Point3DBase< float, LocalTag >
GeomDet::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
DTRecHit1D::localPosition
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:47
DTHitPairForFit::theLeftPos
LocalPoint theLeftPos
Definition: DTHitPairForFit.h:71
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
DTRecHit1DPair::wireId
DTWireId wireId() const
Definition: DTRecHit1DPair.h:89
DTHitPairForFit::theWireId
DTWireId theWireId
Definition: DTHitPairForFit.h:74
DTLayer
Definition: DTLayer.h:25
DTEnums::Right
Definition: DTEnums.h:15
Exception
Definition: hltDiff.cc:245
DTWireId::layerId
DTLayerId layerId() const
Return the corresponding LayerId.
Definition: DTWireId.h:45
DTHitPairForFit::theError
LocalError theError
Definition: DTHitPairForFit.h:73
hit
Definition: SiStripHitEffFromCalibTree.cc:88
DTHitPairForFit::digiTime
float digiTime() const
Returns the time of the corresponding digi.
Definition: DTHitPairForFit.h:57