CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RPCRecHit.cc
Go to the documentation of this file.
1 /*
2  * See header file for a description of this class.
3  *
4  * $Date: 2007/08/02 05:48:27 $
5  * $Revision: 1.7 $
6  * \author M. Maggi -- INFN Bari
7  */
8 
9 
11 
12 
13 RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx) : RecHit2DLocalPos(rpcId),
14  theRPCId(rpcId), theBx(bx),theFirstStrip(99),theClusterSize(99), theLocalPosition(), theLocalError()
15 {
16 }
17 
19  theRPCId(), theBx(99),theFirstStrip(99),theClusterSize(99), theLocalPosition(), theLocalError()
20 {
21 }
22 
23 
24 RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos) : RecHit2DLocalPos(rpcId),
25  theRPCId(rpcId), 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(rpcId),
40  theRPCId(rpcId), 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(rpcId),
52  theRPCId(rpcId), 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 RPCRecHit(*this);
68 }
69 
70 
71 // Access to component RecHits.
72 // No components rechits: it returns a null vector
73 std::vector<const TrackingRecHit*> RPCRecHit::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*> RPCRecHit::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 RPCRecHit::operator==(const RPCRecHit& hit) const {
90  return this->geographicalId() == hit.geographicalId();
91 }
92 
93 
94 // The ostream operator
95 std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit) {
96  os << "pos: " << hit.localPosition().x() ;
97  os << " +/- " << sqrt(hit.localPositionError().xx()) ;
98  return os;
99 }
float xx() const
Definition: LocalError.h:24
bool operator==(const RPCRecHit &hit) const
Comparison operator, based on the rpcId and the digi time.
Definition: RPCRecHit.cc:89
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual ~RPCRecHit()
Destructor.
Definition: RPCRecHit.cc:60
T sqrt(T t)
Definition: SSEVec.h:46
LocalError theLocalError
Definition: RPCRecHit.h:125
virtual std::vector< const TrackingRecHit * > recHits() const
Definition: RPCRecHit.cc:73
RPCRecHit()
Default constructor.
Definition: RPCRecHit.cc:18
virtual LocalError localPositionError() const
Return the 3-dimensional error on the local position.
Definition: RPCRecHit.h:61
DetId geographicalId() const
virtual LocalPoint localPosition() const
Return the 3-dimensional local position.
Definition: RPCRecHit.h:55
T x() const
Definition: PV3DBase.h:61
virtual RPCRecHit * clone() const
Definition: RPCRecHit.cc:66