CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GEMRecHit.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * \author M. Maggi -- INFN Bari
5  */
6 
7 
9 
10 
11 GEMRecHit::GEMRecHit(const GEMDetId& gemId, int bx) : RecHit2DLocalPos(gemId),
12  theGEMId(gemId), theBx(bx),theFirstStrip(99),theClusterSize(99), theLocalPosition(), theLocalError()
13 {
14 }
15 
17  theGEMId(), theBx(99),theFirstStrip(99),theClusterSize(99), theLocalPosition(), theLocalError()
18 {
19 }
20 
21 
22 GEMRecHit::GEMRecHit(const GEMDetId& gemId, int bx, const LocalPoint& pos) : RecHit2DLocalPos(gemId),
23  theGEMId(gemId), theBx(bx), theFirstStrip(99),theClusterSize(99), theLocalPosition(pos)
24 {
25  float stripResolution = 3.0 ; //cm this sould be taken from trimmed cluster size times strip size
26  // taken out from geometry service i.e. topology
28  LocalError(stripResolution*stripResolution, 0., 0.); //FIXME: is it really needed?
29 }
30 
31 
32 
33 // Constructor from a local position and error, wireId and digi time.
35  int bx,
36  const LocalPoint& pos,
37  const LocalError& err) : RecHit2DLocalPos(gemId),
38  theGEMId(gemId), theBx(bx),theFirstStrip(99), theClusterSize(99), theLocalPosition(pos), theLocalError(err)
39 {
40 }
41 
42 
43 // Constructor from a local position and error, wireId, bx and cluster size.
45  int bx,
46  int firstStrip,
47  int clustSize,
48  const LocalPoint& pos,
49  const LocalError& err) : RecHit2DLocalPos(gemId),
50  theGEMId(gemId), theBx(bx),theFirstStrip(firstStrip), theClusterSize(clustSize), theLocalPosition(pos), theLocalError(err)
51 {
52 }
53 
54 
55 
56 
57 // Destructor
59 {
60 }
61 
62 
63 
65  return new GEMRecHit(*this);
66 }
67 
68 
69 // Access to component RecHits.
70 // No components rechits: it returns a null vector
71 std::vector<const TrackingRecHit*> GEMRecHit::recHits() const {
72  std::vector<const TrackingRecHit*> nullvector;
73  return nullvector;
74 }
75 
76 
77 
78 // Non-const access to component RecHits.
79 // No components rechits: it returns a null vector
80 std::vector<TrackingRecHit*> GEMRecHit::recHits() {
81  std::vector<TrackingRecHit*> nullvector;
82  return nullvector;
83 }
84 
85 
86 // Comparison operator, based on the wireId and the digi time
87 bool GEMRecHit::operator==(const GEMRecHit& hit) const {
88  return this->geographicalId() == hit.geographicalId();
89 }
90 
91 
92 // The ostream operator
93 std::ostream& operator<<(std::ostream& os, const GEMRecHit& hit) {
94  os << "pos: " << hit.localPosition().x() ;
95  os << " +/- " << sqrt(hit.localPositionError().xx()) ;
96  return os;
97 }
float xx() const
Definition: LocalError.h:24
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: GEMRecHit.h:53
bool operator==(const GEMRecHit &hit) const
Comparison operator, based on the gemId and the digi time.
Definition: GEMRecHit.cc:87
virtual GEMRecHit * clone() const
Definition: GEMRecHit.cc:64
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual ~GEMRecHit()
Destructor.
Definition: GEMRecHit.cc:58
GEMRecHit()
Default constructor.
Definition: GEMRecHit.cc:16
virtual std::vector< const TrackingRecHit * > recHits() const
Definition: GEMRecHit.cc:71
T sqrt(T t)
Definition: SSEVec.h:48
virtual LocalError localPositionError() const
Return the 3-dimensional error on the local position.
Definition: GEMRecHit.h:59
LocalError theLocalError
Definition: GEMRecHit.h:123
string bx
Definition: rpc-layouts.py:13
GloballyPositioned< float >::LocalPoint LocalPoint
DetId geographicalId() const