CMS 3D CMS Logo

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