CMS 3D CMS Logo

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