CMS 3D CMS Logo

ME0RecHit.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2013/04/24 16:54:24 $
5  * $Revision: 1.1 $
6  * \author M. Maggi -- INFN Bari
7  */
8 
9 
11 
12 
13 ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof) : RecHit2DLocalPos(me0Id),
14  theME0Id(me0Id), theTOF(tof), theLocalPosition(), theLocalError()
15 {
16 }
17 
20 {
21 }
22 
23 
25  theME0Id(me0Id), theTOF(tof), theLocalPosition(pos), theLocalError()
26 {
27 }
28 
29 
30 
31 // Constructor from a local position and error, wireId and digi time.
33  float tof,
34  const LocalPoint& pos,
35  const LocalError& err) : RecHit2DLocalPos(me0Id),
36  theME0Id(me0Id), theTOF(tof), theLocalPosition(pos), theLocalError(err)
37 {
38 }
39 
40 // Destructor
42 {
43 }
44 
45 
46 
48  return new ME0RecHit(*this);
49 }
50 
51 
52 // Access to component RecHits.
53 // No components rechits: it returns a null vector
54 std::vector<const TrackingRecHit*> ME0RecHit::recHits() const {
55  std::vector<const TrackingRecHit*> nullvector;
56  return nullvector;
57 }
58 // Non-const access to component RecHits.
59 // No components rechits: it returns a null vector
60 std::vector<TrackingRecHit*> ME0RecHit::recHits() {
61  std::vector<TrackingRecHit*> nullvector;
62  return nullvector;
63 }
64 
65 // Comparison operator, based on the wireId and the digi time
66 bool ME0RecHit::operator==(const ME0RecHit& hit) const {
67  return this->geographicalId() == hit.geographicalId();
68 }
69 
70 
71 // The ostream operator
72 std::ostream& operator<<(std::ostream& os, const ME0RecHit& hit) {
73  os << "pos: x = " << hit.localPosition().x() ;
74  os << " +/- " << sqrt(hit.localPositionError().xx())<<" cm";
75  os<< " y = " << hit.localPosition().y() ;
76  os << " +/- " << sqrt(hit.localPositionError().yy())<<" cm";
77  return os;
78 }
LocalError localPositionError() const override
Return the 3-dimensional error on the local position.
Definition: ME0RecHit.h:53
float xx() const
Definition: LocalError.h:24
ME0RecHit()
Default constructor.
Definition: ME0RecHit.cc:18
float theTOF
Definition: ME0RecHit.h:104
~ME0RecHit() override
Destructor.
Definition: ME0RecHit.cc:41
bool operator==(const ME0RecHit &hit) const
Comparison operator, based on the gemId and the digi time.
Definition: ME0RecHit.cc:66
ME0DetId theME0Id
Definition: ME0RecHit.h:103
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: ME0RecHit.h:47
float tof() const
Definition: ME0RecHit.h:95
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
LocalError theLocalError
Definition: ME0RecHit.h:107
LocalPoint theLocalPosition
Definition: ME0RecHit.h:106
ME0RecHit * clone() const override
Definition: ME0RecHit.cc:47
ME0DetId me0Id() const
Return the gemId.
Definition: ME0RecHit.h:91
std::vector< const TrackingRecHit * > recHits() const override
Definition: ME0RecHit.cc:54
GloballyPositioned< float >::LocalPoint LocalPoint
DetId geographicalId() const
std::ostream & operator<<(std::ostream &os, const ME0RecHit &hit)
The ostream operator.
Definition: ME0RecHit.cc:72