test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
19  theME0Id(), theTOF(0.), theLocalPosition(), theLocalError()
20 {
21 }
22 
23 
24 ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof, const LocalPoint& pos) : RecHit2DLocalPos(me0Id),
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 }
float xx() const
Definition: LocalError.h:24
virtual ME0RecHit * clone() const
Definition: ME0RecHit.cc:47
ME0RecHit()
Default constructor.
Definition: ME0RecHit.cc:18
bool operator==(const ME0RecHit &hit) const
Comparison operator, based on the gemId and the digi time.
Definition: ME0RecHit.cc:66
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
virtual LocalError localPositionError() const
Return the 3-dimensional error on the local position.
Definition: ME0RecHit.h:53
virtual ~ME0RecHit()
Destructor.
Definition: ME0RecHit.cc:41
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:18
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: ME0RecHit.h:47
GloballyPositioned< float >::LocalPoint LocalPoint
DetId geographicalId() const
virtual std::vector< const TrackingRecHit * > recHits() const
Definition: ME0RecHit.cc:54