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