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