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 
10 
11 ME0RecHit::ME0RecHit(const ME0DetId& me0Id, float tof)
12  : RecHit2DLocalPos(me0Id), theME0Id(me0Id), theTOF(tof), theLocalPosition(), theLocalError() {}
13 
15 
17  : RecHit2DLocalPos(me0Id), theME0Id(me0Id), theTOF(tof), theLocalPosition(pos), theLocalError() {}
18 
19 // Constructor from a local position and error, wireId and digi time.
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 }
LocalError localPositionError() const override
Return the 3-dimensional error on the local position.
Definition: ME0RecHit.h:39
float xx() const
Definition: LocalError.h:22
ME0RecHit()
Default constructor.
Definition: ME0RecHit.cc:14
float theTOF
Definition: ME0RecHit.h:73
~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
ME0DetId theME0Id
Definition: ME0RecHit.h:72
LocalPoint localPosition() const override
Return the 3-dimensional local position.
Definition: ME0RecHit.h:36
float tof() const
Definition: ME0RecHit.h:66
float yy() const
Definition: LocalError.h:24
T sqrt(T t)
Definition: SSEVec.h:19
LocalError theLocalError
Definition: ME0RecHit.h:76
LocalPoint theLocalPosition
Definition: ME0RecHit.h:75
ME0RecHit * clone() const override
Definition: ME0RecHit.cc:26
ME0DetId me0Id() const
Return the gemId.
Definition: ME0RecHit.h:64
std::vector< const TrackingRecHit * > recHits() const override
Definition: ME0RecHit.cc:30
GloballyPositioned< float >::LocalPoint LocalPoint
DetId geographicalId() const
std::ostream & operator<<(std::ostream &os, const ME0RecHit &hit)
The ostream operator.
Definition: ME0RecHit.cc:45