test
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  * \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 {
14 }
15 
17  theRPCId(), theBx(99),theFirstStrip(99),theClusterSize(99), theLocalPosition(), theLocalError()
18 {
19 }
20 
21 
22 RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos) : RecHit2DLocalPos(rpcId),
23  theRPCId(rpcId), 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(rpcId),
38  theRPCId(rpcId), 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(rpcId),
50  theRPCId(rpcId), 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 RPCRecHit(*this);
66 }
67 
68 
69 // Access to component RecHits.
70 // No components rechits: it returns a null vector
71 std::vector<const TrackingRecHit*> RPCRecHit::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*> RPCRecHit::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 RPCRecHit::operator==(const RPCRecHit& hit) const {
88  return this->geographicalId() == hit.geographicalId();
89 }
90 
91 
92 // The ostream operator
93 std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit) {
94  os << "pos: " << hit.localPosition().x() ;
95  os << " +/- " << sqrt(hit.localPositionError().xx()) ;
96  return os;
97 }
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:87
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
virtual ~RPCRecHit()
Destructor.
Definition: RPCRecHit.cc:58
T sqrt(T t)
Definition: SSEVec.h:18
LocalError theLocalError
Definition: RPCRecHit.h:123
virtual std::vector< const TrackingRecHit * > recHits() const
Definition: RPCRecHit.cc:71
RPCRecHit()
Default constructor.
Definition: RPCRecHit.cc:16
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:64