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