CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTRecHit1D.cc
Go to the documentation of this file.
1 
10 
11 
12 using namespace std;
13 using namespace DTEnums;
14 
15 
16 // Constructor from wireId and digi time only.
19  float digiTime) :
20  RecHit1D(wireId.layerId()), // the detId of the Det (a DTLayer).
21  theWireId(wireId),
22  theLRSide(lr),
23  theDigiTime(digiTime),
24  theLocalPosition(),
25  theLocalError() {}
26 
27 
28 // Default constructor
29 DTRecHit1D::DTRecHit1D() : theWireId(),
30  theLRSide(undefLR),
31  theDigiTime(-1),
32  theLocalPosition(),
33  theLocalError() {}
34 
35 // Constructor from a local position, wireId and digi time.
36 // The 3-dimensional local error is defined as
37 // resolution (the cell resolution) for the coordinate being measured
38 // and 0 for the two other coordinates
41  float digiTime,
42  const LocalPoint& pos) :
43  RecHit1D(wireId.layerId()), // the detId of the Det (a DTLayer).
44  theWireId(wireId),
45  theLRSide(lr),
46  theDigiTime(digiTime),
47  theLocalPosition(pos) {
48  float cellResolution = 0.02 ; //cm cell resolution = 200 um = 0.02 cm
50  LocalError(cellResolution*cellResolution, 0., 0.); //FIXME: is it really needed?
51  }
52 
53 
54 
55 // Constructor from a local position and error, wireId and digi time.
58  float digiTime,
59  const LocalPoint& pos,
60  const LocalError& err) :
61  RecHit1D(wireId.layerId()),
62  theWireId(wireId),
63  theLRSide(lr),
64  theDigiTime(digiTime),
65  theLocalPosition(pos),
66  theLocalError(err) {}
67 
68 
69 
70 
71 // Destructor
73 
74 
75 
77  return new DTRecHit1D(*this);
78 }
79 
80 
81 // Access to component RecHits.
82 // No components rechits: it returns a null vector
83 vector<const TrackingRecHit*> DTRecHit1D::recHits() const {
84  vector<const TrackingRecHit*> nullvector;
85  return nullvector;
86 }
87 
88 
89 
90 // Non-const access to component RecHits.
91 // No components rechits: it returns a null vector
92 vector<TrackingRecHit*> DTRecHit1D::recHits() {
93  vector<TrackingRecHit*> nullvector;
94  return nullvector;
95 }
96 
97 
98 // Comparison operator, based on the wireId and the digi time
100  return wireId() == hit.wireId() && fabs(digiTime() - hit.digiTime()) < 0.1;
101 }
102 
103 
104 // The ostream operator
105 ostream& operator<<(ostream& os, const DTRecHit1D& hit) {
106  os << "pos: " << hit.localPosition().x() ;
107  os << " +/- " << sqrt(hit.localPositionError().xx()) ;
108  return os;
109 }
float xx() const
Definition: LocalError.h:24
DTCellSide
Which side of the DT cell.
Definition: DTEnums.h:17
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
LocalError theLocalError
Definition: DTRecHit1D.h:135
virtual DTRecHit1D * clone() const
Definition: DTRecHit1D.cc:76
virtual ~DTRecHit1D()
Destructor.
Definition: DTRecHit1D.cc:72
DTRecHit1D()
Default constructor.
Definition: DTRecHit1D.cc:29
T sqrt(T t)
Definition: SSEVec.h:48
float digiTime() const
Return the time (ns) of the digi used to build the rechit.
Definition: DTRecHit1D.h:115
virtual LocalError localPositionError() const
Return the 3-dimensional error on the local position.
Definition: DTRecHit1D.h:68
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: DTRecHit1D.h:62
virtual std::vector< const TrackingRecHit * > recHits() const
No components rechits: it returns a null vector.
Definition: DTRecHit1D.cc:83
T x() const
Definition: PV3DBase.h:62
bool operator==(const DTRecHit1D &hit) const
Comparison operator, based on the wireId and the digi time.
Definition: DTRecHit1D.cc:99
DTWireId wireId() const
Return the wireId.
Definition: DTRecHit1D.h:109