Skip to content

Commit 55036b1

Browse files
authored
Merge pull request #50389 from Dr15Jones/evo_RPCRecHit
[EVO] Moved RPCRecHit to versioned namespace
2 parents f4cefea + af08461 commit 55036b1

4 files changed

Lines changed: 160 additions & 153 deletions

File tree

DataFormats/RPCRecHit/interface/RPCRecHit.h

Lines changed: 66 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -11,89 +11,92 @@
1111
#include "DataFormats/TrackingRecHit/interface/RecHit2DLocalPos.h"
1212
#include "DataFormats/MuonDetId/interface/RPCDetId.h"
1313

14-
class RPCRecHit : public RecHit2DLocalPos {
15-
public:
16-
RPCRecHit(const RPCDetId& rpcId, int bx);
14+
namespace io_v1 {
15+
class RPCRecHit : public RecHit2DLocalPos {
16+
public:
17+
RPCRecHit(const RPCDetId& rpcId, int bx);
1718

18-
/// Default constructor
19-
RPCRecHit();
19+
/// Default constructor
20+
RPCRecHit();
2021

21-
/// Constructor from a local position, rpcId and digi time.
22-
/// The 3-dimensional local error is defined as
23-
/// resolution (the cell resolution) for the coordinate being measured
24-
/// and 0 for the two other coordinates
25-
RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos);
22+
/// Constructor from a local position, rpcId and digi time.
23+
/// The 3-dimensional local error is defined as
24+
/// resolution (the cell resolution) for the coordinate being measured
25+
/// and 0 for the two other coordinates
26+
RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos);
2627

27-
/// Constructor from a local position and error, rpcId and bx.
28-
RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos, const LocalError& err);
28+
/// Constructor from a local position and error, rpcId and bx.
29+
RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos, const LocalError& err);
2930

30-
/// Constructor from a local position and error, rpcId, bx, frist strip of cluster and cluster size.
31-
RPCRecHit(const RPCDetId& rpcId, int bx, int firstStrip, int clustSize, const LocalPoint& pos, const LocalError& err);
31+
/// Constructor from a local position and error, rpcId, bx, frist strip of cluster and cluster size.
32+
RPCRecHit(
33+
const RPCDetId& rpcId, int bx, int firstStrip, int clustSize, const LocalPoint& pos, const LocalError& err);
3234

33-
/// Destructor
34-
~RPCRecHit() override;
35+
/// Destructor
36+
~RPCRecHit() override;
3537

36-
/// Return the 3-dimensional local position
37-
LocalPoint localPosition() const override { return theLocalPosition; }
38+
/// Return the 3-dimensional local position
39+
LocalPoint localPosition() const override { return theLocalPosition; }
3840

39-
/// Return the 3-dimensional error on the local position
40-
LocalError localPositionError() const override { return theLocalError; }
41+
/// Return the 3-dimensional error on the local position
42+
LocalError localPositionError() const override { return theLocalError; }
4143

42-
RPCRecHit* clone() const override;
44+
RPCRecHit* clone() const override;
4345

44-
/// Access to component RecHits.
45-
/// No components rechits: it returns a null vector
46-
std::vector<const TrackingRecHit*> recHits() const override;
46+
/// Access to component RecHits.
47+
/// No components rechits: it returns a null vector
48+
std::vector<const TrackingRecHit*> recHits() const override;
4749

48-
/// Non-const access to component RecHits.
49-
/// No components rechits: it returns a null vector
50-
std::vector<TrackingRecHit*> recHits() override;
50+
/// Non-const access to component RecHits.
51+
/// No components rechits: it returns a null vector
52+
std::vector<TrackingRecHit*> recHits() override;
5153

52-
/// Set local position
53-
void setPosition(LocalPoint pos) { theLocalPosition = pos; }
54+
/// Set local position
55+
void setPosition(LocalPoint pos) { theLocalPosition = pos; }
5456

55-
/// Set local position error
56-
void setError(LocalError err) { theLocalError = err; }
57+
/// Set local position error
58+
void setError(LocalError err) { theLocalError = err; }
5759

58-
/// Set the local position and its error
59-
void setPositionAndError(LocalPoint pos, LocalError err) {
60-
theLocalPosition = pos;
61-
theLocalError = err;
62-
}
60+
/// Set the local position and its error
61+
void setPositionAndError(LocalPoint pos, LocalError err) {
62+
theLocalPosition = pos;
63+
theLocalError = err;
64+
}
6365

64-
/// Set the time and its error
65-
void setTimeAndError(float time, float err) {
66-
theTime = time;
67-
theTimeError = err;
68-
}
66+
/// Set the time and its error
67+
void setTimeAndError(float time, float err) {
68+
theTime = time;
69+
theTimeError = err;
70+
}
6971

70-
/// Return the rpcId
71-
RPCDetId rpcId() const { return theRPCId; }
72+
/// Return the rpcId
73+
RPCDetId rpcId() const { return theRPCId; }
7274

73-
int BunchX() const { return theBx; }
75+
int BunchX() const { return theBx; }
7476

75-
int firstClusterStrip() const { return theFirstStrip; }
77+
int firstClusterStrip() const { return theFirstStrip; }
7678

77-
int clusterSize() const { return theClusterSize; }
79+
int clusterSize() const { return theClusterSize; }
7880

79-
float time() const { return theTime; }
81+
float time() const { return theTime; }
8082

81-
float timeError() const { return theTimeError; }
83+
float timeError() const { return theTimeError; }
8284

83-
/// Comparison operator, based on the rpcId and the digi time
84-
bool operator==(const RPCRecHit& hit) const;
85+
/// Comparison operator, based on the rpcId and the digi time
86+
bool operator==(const RPCRecHit& hit) const;
8587

86-
private:
87-
RPCDetId theRPCId;
88-
int theBx;
89-
int theFirstStrip;
90-
int theClusterSize;
91-
// Position and error in the Local Ref. Frame of the RPCLayer
92-
LocalPoint theLocalPosition;
93-
LocalError theLocalError;
94-
float theTime, theTimeError;
95-
};
88+
private:
89+
RPCDetId theRPCId;
90+
int theBx;
91+
int theFirstStrip;
92+
int theClusterSize;
93+
// Position and error in the Local Ref. Frame of the RPCLayer
94+
LocalPoint theLocalPosition;
95+
LocalError theLocalError;
96+
float theTime, theTimeError;
97+
};
98+
/// The ostream operator
99+
std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit);
100+
} // namespace io_v1
101+
using RPCRecHit = io_v1::RPCRecHit;
96102
#endif
97-
98-
/// The ostream operator
99-
std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit);
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef DataFormats_RPCRecHit_RPCRecHitFwd_h
22
#define DataFormats_RPCRecHit_RPCRecHitFwd_h
33

4-
class RPCRecHit;
5-
4+
namespace io_v1 {
5+
class RPCRecHit;
6+
}
7+
using RPCRecHit = io_v1::RPCRecHit;
68
#endif

DataFormats/RPCRecHit/src/RPCRecHit.cc

Lines changed: 81 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -6,92 +6,94 @@
66

77
#include "DataFormats/RPCRecHit/interface/RPCRecHit.h"
88

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) {}
9+
namespace io_v1 {
10+
RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx)
11+
: RecHit2DLocalPos(rpcId),
12+
theRPCId(rpcId),
13+
theBx(bx),
14+
theFirstStrip(99),
15+
theClusterSize(99),
16+
theLocalPosition(),
17+
theLocalError(),
18+
theTime(0),
19+
theTimeError(-1) {}
1920

20-
RPCRecHit::RPCRecHit()
21-
: RecHit2DLocalPos(),
22-
theRPCId(),
23-
theBx(99),
24-
theFirstStrip(99),
25-
theClusterSize(99),
26-
theLocalPosition(),
27-
theLocalError(),
28-
theTime(0),
29-
theTimeError(-1) {}
21+
RPCRecHit::RPCRecHit()
22+
: RecHit2DLocalPos(),
23+
theRPCId(),
24+
theBx(99),
25+
theFirstStrip(99),
26+
theClusterSize(99),
27+
theLocalPosition(),
28+
theLocalError(),
29+
theTime(0),
30+
theTimeError(-1) {}
3031

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-
}
32+
RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos)
33+
: RecHit2DLocalPos(rpcId),
34+
theRPCId(rpcId),
35+
theBx(bx),
36+
theFirstStrip(99),
37+
theClusterSize(99),
38+
theLocalPosition(pos),
39+
theTime(0),
40+
theTimeError(-1) {
41+
float stripResolution = 3.0; //cm this sould be taken from trimmed cluster size times strip size
42+
// taken out from geometry service i.e. topology
43+
theLocalError = LocalError(stripResolution * stripResolution, 0., 0.); //FIXME: is it really needed?
44+
}
4445

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) {}
46+
// Constructor from a local position and error, wireId and digi time.
47+
RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos, const LocalError& err)
48+
: RecHit2DLocalPos(rpcId),
49+
theRPCId(rpcId),
50+
theBx(bx),
51+
theFirstStrip(99),
52+
theClusterSize(99),
53+
theLocalPosition(pos),
54+
theLocalError(err),
55+
theTime(0),
56+
theTimeError(-1) {}
5657

57-
// Constructor from a local position and error, wireId, bx and cluster size.
58-
RPCRecHit::RPCRecHit(
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) {}
58+
// Constructor from a local position and error, wireId, bx and cluster size.
59+
RPCRecHit::RPCRecHit(
60+
const RPCDetId& rpcId, int bx, int firstStrip, int clustSize, const LocalPoint& pos, const LocalError& err)
61+
: RecHit2DLocalPos(rpcId),
62+
theRPCId(rpcId),
63+
theBx(bx),
64+
theFirstStrip(firstStrip),
65+
theClusterSize(clustSize),
66+
theLocalPosition(pos),
67+
theLocalError(err),
68+
theTime(0),
69+
theTimeError(-1) {}
6970

70-
// Destructor
71-
RPCRecHit::~RPCRecHit() {}
71+
// Destructor
72+
RPCRecHit::~RPCRecHit() {}
7273

73-
RPCRecHit* RPCRecHit::clone() const { return new RPCRecHit(*this); }
74+
RPCRecHit* RPCRecHit::clone() const { return new RPCRecHit(*this); }
7475

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-
}
76+
// Access to component RecHits.
77+
// No components rechits: it returns a null vector
78+
std::vector<const TrackingRecHit*> RPCRecHit::recHits() const {
79+
std::vector<const TrackingRecHit*> nullvector;
80+
return nullvector;
81+
}
8182

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-
}
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+
}
8889

89-
// Comparison operator, based on the wireId and the digi time
90-
bool RPCRecHit::operator==(const RPCRecHit& hit) const { return this->geographicalId() == hit.geographicalId(); }
90+
// Comparison operator, based on the wireId and the digi time
91+
bool RPCRecHit::operator==(const RPCRecHit& hit) const { return this->geographicalId() == hit.geographicalId(); }
9192

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-
}
93+
// The ostream operator
94+
std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit) {
95+
os << "pos: " << hit.localPosition().x();
96+
os << " +/- " << sqrt(hit.localPositionError().xx());
97+
return os;
98+
}
99+
} // namespace io_v1

DataFormats/RPCRecHit/src/classes_def.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<lcgdict>
22
<selection>
3-
<class name="RPCRecHit" splitLevel="0" ClassVersion="3">
4-
<version ClassVersion="3" checksum="2736272161"/>
3+
<class name="io_v1::RPCRecHit" splitLevel="0" ClassVersion="3">
4+
<version ClassVersion="3" checksum="3050022817"/>
55
</class>
6-
<class name="std::vector<RPCRecHit>" splitLevel="0"/>
7-
<class name="std::vector<RPCRecHit*>" splitLevel="0"/>
6+
<class name="std::vector<io_v1::RPCRecHit>" splitLevel="0"/>
7+
<class name="std::vector<io_v1::RPCRecHit*>" splitLevel="0"/>
88
<class name="std::map<RPCDetId, std::pair<unsigned int, unsigned int> >" splitLevel="0"/>
99
<class name="std::map<RPCDetId, std::pair<unsigned long, unsigned long> >" splitLevel="0"/>
1010
<class name="std::pair<RPCDetId, std::pair<unsigned int, unsigned int> >" splitLevel="0"/>
1111
<class name="std::pair<RPCDetId, std::pair<unsigned long, unsigned long> >" splitLevel="0"/>
12-
<class name="edm::OwnVector<RPCRecHit, edm::ClonePolicy<RPCRecHit> >" splitLevel="0" rntupleStreamerMode="true"/>
13-
<class name="edm::ClonePolicy<RPCRecHit>" /> <!-- Root6 -->
14-
<class name="edm::RangeMap<RPCDetId, edm::OwnVector<RPCRecHit, edm::ClonePolicy<RPCRecHit> >, edm::ClonePolicy<RPCRecHit> >" splitLevel="0"/>
15-
<class name="edm::Wrapper<edm::RangeMap<RPCDetId, edm::OwnVector<RPCRecHit, edm::ClonePolicy<RPCRecHit> >, edm::ClonePolicy<RPCRecHit> > >" splitLevel="0"/>
12+
<class name="edm::OwnVector<io_v1::RPCRecHit, edm::ClonePolicy<io_v1::RPCRecHit> >" splitLevel="0" rntupleStreamerMode="true"/>
13+
<class name="edm::ClonePolicy<io_v1::RPCRecHit>" /> <!-- Root6 -->
14+
<class name="edm::RangeMap<RPCDetId, edm::OwnVector<io_v1::RPCRecHit, edm::ClonePolicy<io_v1::RPCRecHit> >, edm::ClonePolicy<io_v1::RPCRecHit> >" splitLevel="0"/>
15+
<class name="edm::Wrapper<edm::RangeMap<RPCDetId, edm::OwnVector<io_v1::RPCRecHit, edm::ClonePolicy<io_v1::RPCRecHit> >, edm::ClonePolicy<io_v1::RPCRecHit> > >" splitLevel="0"/>
1616
</selection>
1717
<exclusion>
18-
<class name="edm::OwnVector<RPCRecHit, edm::ClonePolicy<RPCRecHit> >">
18+
<class name="edm::OwnVector<io_v1::RPCRecHit, edm::ClonePolicy<io_v1::RPCRecHit> >">
1919
<method name="sort" splitLevel="0"/>
2020
</class>
2121
</exclusion>

0 commit comments

Comments
 (0)