CMS 3D CMS Logo

DTRecHit1DPair Class Reference

Composed recHit representing a pair of reconstructed hits. More...

#include <DataFormats/DTRecHit/interface/DTRecHit1DPair.h>

Inheritance diagram for DTRecHit1DPair:

RecHit1D TrackingRecHit

List of all members.

Public Member Functions

virtual DTRecHit1DPairclone () const
const DTRecHit1DcomponentRecHit (DTEnums::DTCellSide lrSide) const
 Return the left/right DTRecHit1D.
std::pair< const DTRecHit1D *,
const DTRecHit1D * > 
componentRecHits () const
 Get the left and right 1D rechits (first and second respectively).
float digiTime () const
 Return the digi time (ns) used to build the rechits.
 DTRecHit1DPair ()
 Default constructor. Needed to write the RecHit into a STL container.
 DTRecHit1DPair (const DTWireId &wireId, const DTDigi &digi)
 Constructor without components: must use setPos and Err!
virtual DetId geographicalId () const
 Return the detId of the Det (a DTLayer).
LocalPoint localPosition (DTEnums::DTCellSide lrside) const
 Return position in the local (layer) coordinate system for a certain hypothesis about the L/R cell side.
virtual LocalPoint localPosition () const
 Return the 3-dimensional local position.
LocalError localPositionError (DTEnums::DTCellSide lrside) const
 Return position error in the local (layer) coordinate system for a certain hypothesis about the L/R cell side.
virtual LocalError localPositionError () const
 Return the 3-dimensional error on the local position.
bool operator!= (const DTRecHit1DPair &hit) const
 Inequality operator, defined as the mirror image of the comparions operator.
bool operator== (const DTRecHit1DPair &hit) const
 Comparison operator, based on the wireId and the digi time.
virtual std::vector
< TrackingRecHit * > 
recHits ()
 Non-const access to component RecHits.
virtual std::vector< const
TrackingRecHit * > 
recHits () const
 Access to component RecHits.
void setPosition (DTEnums::DTCellSide lrside, const LocalPoint &point)
 Set the 3-dimensional local position for the component hit corresponding to the given cell side.
void setPositionAndError (DTEnums::DTCellSide lrside, const LocalPoint &point, const LocalError &err)
 Set the 3-dimensional local position and error for the component hit corresponding to the given cell side.
DTWireId wireId () const
virtual ~DTRecHit1DPair ()
 Destructor.

Private Member Functions

DTRecHit1DcomponentRecHit (DTEnums::DTCellSide lrSide)
 Non const access to left/right DTRecHit1D.

Private Attributes

DTRecHit1D theLeftHit
DTRecHit1D theRightHit


Detailed Description

Composed recHit representing a pair of reconstructed hits.

For each signal theLeftHit in the DT wire, two hits can be constructed, due to the Left/Right ambiguity, which can be solved only associating several hits together. This class describes the pair of points associated to a single TDC signal. The two hits can be accessed via recHits() method. The position is the average of the theLeftHit and theRightHit hits, namely the wire position.

Date
2006/04/05 16:43:55
Revision
1.4
Author:
S. Lacaprara & G. Cerminara

Definition at line 28 of file DTRecHit1DPair.h.


Constructor & Destructor Documentation

DTRecHit1DPair::DTRecHit1DPair ( const DTWireId wireId,
const DTDigi digi 
)

Constructor without components: must use setPos and Err!

Definition at line 20 of file DTRecHit1DPair.cc.

00021                                                    : theLeftHit(wireId, Left, digi.time()),
00022                                                      theRightHit(wireId, Right, digi.time()) {}

DTRecHit1DPair::DTRecHit1DPair (  ) 

Default constructor. Needed to write the RecHit into a STL container.

Definition at line 26 of file DTRecHit1DPair.cc.

Referenced by clone().

00026                                : theLeftHit(),
00027                                    theRightHit() {}

DTRecHit1DPair::~DTRecHit1DPair (  )  [virtual]

Destructor.

Definition at line 31 of file DTRecHit1DPair.cc.

00031 {}


Member Function Documentation

DTRecHit1DPair * DTRecHit1DPair::clone ( void   )  const [virtual]

Implements TrackingRecHit.

Definition at line 35 of file DTRecHit1DPair.cc.

References DTRecHit1DPair().

00035                                              {
00036   return new DTRecHit1DPair(*this);
00037 }

DTRecHit1D* DTRecHit1DPair::componentRecHit ( DTEnums::DTCellSide  lrSide  )  [private]

Non const access to left/right DTRecHit1D.

const DTRecHit1D* DTRecHit1DPair::componentRecHit ( DTEnums::DTCellSide  lrSide  )  const

Return the left/right DTRecHit1D.

Referenced by componentRecHits(), DTHitPairForFit::DTHitPairForFit(), and recHits().

pair< const DTRecHit1D *, const DTRecHit1D * > DTRecHit1DPair::componentRecHits (  )  const

Get the left and right 1D rechits (first and second respectively).

Definition at line 162 of file DTRecHit1DPair.cc.

References componentRecHit().

00162                                                                                   {
00163   return make_pair(componentRecHit(Left), componentRecHit(Right));
00164 }

float DTRecHit1DPair::digiTime (  )  const [inline]

Return the digi time (ns) used to build the rechits.

Definition at line 73 of file DTRecHit1DPair.h.

References DTRecHit1D::digiTime(), and theLeftHit.

Referenced by DTHitPairForFit::DTHitPairForFit(), and operator==().

00073                          {
00074     return theLeftHit.digiTime();
00075   }

DetId DTRecHit1DPair::geographicalId (  )  const [virtual]

Return the detId of the Det (a DTLayer).

Reimplemented from TrackingRecHit.

Definition at line 82 of file DTRecHit1DPair.cc.

References DTWireId::layerId(), and wireId().

00082                                            { 
00083   return wireId().layerId();
00084 }

LocalPoint DTRecHit1DPair::localPosition ( DTEnums::DTCellSide  lrside  )  const

Return position in the local (layer) coordinate system for a certain hypothesis about the L/R cell side.

LocalPoint DTRecHit1DPair::localPosition (  )  const [virtual]

Return the 3-dimensional local position.

The average theLeftHit/theRightHit hits position, namely the wire position is returned.

Implements RecHit1D.

Definition at line 44 of file DTRecHit1DPair.cc.

References DTRecHit1D::localPosition(), theLeftHit, and theRightHit.

Referenced by operator<<(), DTRecHitQuality::recHitDistFromWire(), GlobalRecHitsProducer::recHitDistFromWire(), GlobalRecHitsAnalyzer::recHitDistFromWire(), DTCalibValidation::recHitDistFromWire(), and DTCalibValidation::recHitPosition().

00044                                                {
00045   return theLeftHit.localPosition() + 
00046     (theRightHit.localPosition()-theLeftHit.localPosition())/2.;
00047 }

LocalError DTRecHit1DPair::localPositionError ( DTEnums::DTCellSide  lrside  )  const

Return position error in the local (layer) coordinate system for a certain hypothesis about the L/R cell side.

LocalError DTRecHit1DPair::localPositionError (  )  const [virtual]

Return the 3-dimensional error on the local position.

The error is defiened as half the distance between theLeftHit and theRightHit pos

Implements RecHit1D.

Definition at line 54 of file DTRecHit1DPair.cc.

References DTRecHit1D::localPosition(), theLeftHit, theRightHit, and PV3DBase< T, PVType, FrameType >::x().

Referenced by DTRecHitQuality::recHitPositionError().

00054                                                     {
00055   return LocalError((theRightHit.localPosition().x()-
00056                      theLeftHit.localPosition().x())/2.,0.,0.);
00057 }

bool DTRecHit1DPair::operator!= ( const DTRecHit1DPair hit  )  const [inline]

Inequality operator, defined as the mirror image of the comparions operator.

Definition at line 84 of file DTRecHit1DPair.h.

00084                                                    {
00085     return !(*this==hit);
00086   }

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

Comparison operator, based on the wireId and the digi time.

Definition at line 89 of file DTRecHit1DPair.cc.

References digiTime(), and wireId().

00089                                                                {
00090   return wireId() == hit.wireId() && fabs(digiTime() - hit.digiTime()) < 0.1;
00091 }

vector< TrackingRecHit * > DTRecHit1DPair::recHits (  )  [virtual]

Non-const access to component RecHits.

Return the two recHits (L/R)

Implements TrackingRecHit.

Definition at line 72 of file DTRecHit1DPair.cc.

References componentRecHit(), and HLT_VtxMuL3::result.

00072                                                 {
00073   vector<TrackingRecHit*> result;
00074   result.push_back(const_cast<DTRecHit1D*>(componentRecHit(Left)));
00075   result.push_back(const_cast<DTRecHit1D*>(componentRecHit(Right)));
00076   return result;
00077 }

vector< const TrackingRecHit * > DTRecHit1DPair::recHits (  )  const [virtual]

Access to component RecHits.

Return the two recHits (L/R)

Implements TrackingRecHit.

Definition at line 62 of file DTRecHit1DPair.cc.

References componentRecHit(), and HLT_VtxMuL3::result.

00062                                                             {
00063   vector<const TrackingRecHit*> result;
00064   result.push_back(componentRecHit(Left));
00065   result.push_back(componentRecHit(Right));
00066   return result;
00067 }

void DTRecHit1DPair::setPosition ( DTEnums::DTCellSide  lrside,
const LocalPoint point 
)

Set the 3-dimensional local position for the component hit corresponding to the given cell side.

Default value is assumed for the error.

void DTRecHit1DPair::setPositionAndError ( DTEnums::DTCellSide  lrside,
const LocalPoint point,
const LocalError err 
)

Set the 3-dimensional local position and error for the component hit corresponding to the given cell side.

Default value is assumed for the error.

Referenced by DTRecHitBaseAlgo::reconstruct(), and DTNoDriftAlgo::reconstruct().

DTWireId DTRecHit1DPair::wireId (  )  const [inline]

Definition at line 112 of file DTRecHit1DPair.h.

References theLeftHit, and DTRecHit1D::wireId().

Referenced by VisDTRecHitsTwig::addWire(), DTHitPairForFit::DTHitPairForFit(), geographicalId(), and operator==().

00112                           {
00113     return theLeftHit.wireId();
00114   }


Member Data Documentation

DTRecHit1D DTRecHit1DPair::theLeftHit [private]

Definition at line 131 of file DTRecHit1DPair.h.

Referenced by digiTime(), localPosition(), localPositionError(), and wireId().

DTRecHit1D DTRecHit1DPair::theRightHit [private]

Definition at line 132 of file DTRecHit1DPair.h.

Referenced by localPosition(), and localPositionError().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:18:59 2009 for CMSSW by  doxygen 1.5.4