CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
10 
11 ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof)
12  : RecHit2DLocalPos(me0Id), theME0Id(me0Id), theTOF(tof), theLocalPosition(), theLocalError() {}
13 
14 ME0RecHit::ME0RecHit() : RecHit2DLocalPos(), theME0Id(), theTOF(0.), theLocalPosition(), theLocalError() {}
15 
16 ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof, const LocalPoint& pos)
17  : RecHit2DLocalPos(me0Id), theME0Id(me0Id), theTOF(tof), theLocalPosition(pos), theLocalError() {}
18 
19 // Constructor from a local position and error, wireId and digi time.
20 ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof, const LocalPoint& pos, const LocalError& err)
21  : RecHit2DLocalPos(me0Id), theME0Id(me0Id), theTOF(tof), theLocalPosition(pos), theLocalError(err) {}
22 
23 // Destructor
25 
26 ME0RecHit* ME0RecHit::clone() const { return new ME0RecHit(*this); }
27 
28 // Access to component RecHits.
29 // No components rechits: it returns a null vector
30 std::vector<const TrackingRecHit*> ME0RecHit::recHits() const {
31  std::vector<const TrackingRecHit*> nullvector;
32  return nullvector;
33 }
34 // Non-const access to component RecHits.
35 // No components rechits: it returns a null vector
36 std::vector<TrackingRecHit*> ME0RecHit::recHits() {
37  std::vector<TrackingRecHit*> nullvector;
38  return nullvector;
39 }
40 
41 // Comparison operator, based on the wireId and the digi time
42 bool ME0RecHit::operator==(const ME0RecHit& hit) const { return this->geographicalId() == hit.geographicalId(); }
43 
44 // The ostream operator
45 std::ostream& operator<<(std::ostream& os, const ME0RecHit& hit) {
46  os << "pos: x = " << hit.localPosition().x();
47  os << " +/- " << sqrt(hit.localPositionError().xx()) << " cm";
48  os << " y = " << hit.localPosition().y();
49  os << " +/- " << sqrt(hit.localPositionError().yy()) << " cm";
50  return os;
51 }
float xx() const
Definition: LocalError.h:22
ME0RecHit()
Default constructor.
Definition: ME0RecHit.cc:14
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: ME0RecHit.h:36
~ME0RecHit() override
Destructor.
Definition: ME0RecHit.cc:24
bool operator==(const ME0RecHit &hit) const
Comparison operator, based on the gemId and the digi time.
Definition: ME0RecHit.cc:42
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
float yy() const
Definition: LocalError.h:24
T sqrt(T t)
Definition: SSEVec.h:19
ME0RecHit * clone() const override
Definition: ME0RecHit.cc:26
GloballyPositioned< float >::LocalPoint LocalPoint
DetId geographicalId() const
LocalError localPositionError() const override
Return the 3-dimensional error on the local position.
Definition: ME0RecHit.h:39
std::vector< const TrackingRecHit * > recHits() const override
Definition: ME0RecHit.cc:30