From af08461687857efae660250b6bf3f208109500c6 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Thu, 12 Mar 2026 10:42:07 -0500 Subject: [PATCH] Moved RPCRecHit to versioned namespace --- DataFormats/RPCRecHit/interface/RPCRecHit.h | 129 +++++++------- .../RPCRecHit/interface/RPCRecHitFwd.h | 6 +- DataFormats/RPCRecHit/src/RPCRecHit.cc | 160 +++++++++--------- DataFormats/RPCRecHit/src/classes_def.xml | 18 +- 4 files changed, 160 insertions(+), 153 deletions(-) diff --git a/DataFormats/RPCRecHit/interface/RPCRecHit.h b/DataFormats/RPCRecHit/interface/RPCRecHit.h index 1b1d26bde526e..85d742ba3e747 100644 --- a/DataFormats/RPCRecHit/interface/RPCRecHit.h +++ b/DataFormats/RPCRecHit/interface/RPCRecHit.h @@ -11,89 +11,92 @@ #include "DataFormats/TrackingRecHit/interface/RecHit2DLocalPos.h" #include "DataFormats/MuonDetId/interface/RPCDetId.h" -class RPCRecHit : public RecHit2DLocalPos { -public: - RPCRecHit(const RPCDetId& rpcId, int bx); +namespace io_v1 { + class RPCRecHit : public RecHit2DLocalPos { + public: + RPCRecHit(const RPCDetId& rpcId, int bx); - /// Default constructor - RPCRecHit(); + /// Default constructor + RPCRecHit(); - /// Constructor from a local position, rpcId and digi time. - /// The 3-dimensional local error is defined as - /// resolution (the cell resolution) for the coordinate being measured - /// and 0 for the two other coordinates - RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos); + /// Constructor from a local position, rpcId and digi time. + /// The 3-dimensional local error is defined as + /// resolution (the cell resolution) for the coordinate being measured + /// and 0 for the two other coordinates + RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos); - /// Constructor from a local position and error, rpcId and bx. - RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos, const LocalError& err); + /// Constructor from a local position and error, rpcId and bx. + RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos, const LocalError& err); - /// Constructor from a local position and error, rpcId, bx, frist strip of cluster and cluster size. - RPCRecHit(const RPCDetId& rpcId, int bx, int firstStrip, int clustSize, const LocalPoint& pos, const LocalError& err); + /// Constructor from a local position and error, rpcId, bx, frist strip of cluster and cluster size. + RPCRecHit( + const RPCDetId& rpcId, int bx, int firstStrip, int clustSize, const LocalPoint& pos, const LocalError& err); - /// Destructor - ~RPCRecHit() override; + /// Destructor + ~RPCRecHit() override; - /// Return the 3-dimensional local position - LocalPoint localPosition() const override { return theLocalPosition; } + /// Return the 3-dimensional local position + LocalPoint localPosition() const override { return theLocalPosition; } - /// Return the 3-dimensional error on the local position - LocalError localPositionError() const override { return theLocalError; } + /// Return the 3-dimensional error on the local position + LocalError localPositionError() const override { return theLocalError; } - RPCRecHit* clone() const override; + RPCRecHit* clone() const override; - /// Access to component RecHits. - /// No components rechits: it returns a null vector - std::vector recHits() const override; + /// Access to component RecHits. + /// No components rechits: it returns a null vector + std::vector recHits() const override; - /// Non-const access to component RecHits. - /// No components rechits: it returns a null vector - std::vector recHits() override; + /// Non-const access to component RecHits. + /// No components rechits: it returns a null vector + std::vector recHits() override; - /// Set local position - void setPosition(LocalPoint pos) { theLocalPosition = pos; } + /// Set local position + void setPosition(LocalPoint pos) { theLocalPosition = pos; } - /// Set local position error - void setError(LocalError err) { theLocalError = err; } + /// Set local position error + void setError(LocalError err) { theLocalError = err; } - /// Set the local position and its error - void setPositionAndError(LocalPoint pos, LocalError err) { - theLocalPosition = pos; - theLocalError = err; - } + /// Set the local position and its error + void setPositionAndError(LocalPoint pos, LocalError err) { + theLocalPosition = pos; + theLocalError = err; + } - /// Set the time and its error - void setTimeAndError(float time, float err) { - theTime = time; - theTimeError = err; - } + /// Set the time and its error + void setTimeAndError(float time, float err) { + theTime = time; + theTimeError = err; + } - /// Return the rpcId - RPCDetId rpcId() const { return theRPCId; } + /// Return the rpcId + RPCDetId rpcId() const { return theRPCId; } - int BunchX() const { return theBx; } + int BunchX() const { return theBx; } - int firstClusterStrip() const { return theFirstStrip; } + int firstClusterStrip() const { return theFirstStrip; } - int clusterSize() const { return theClusterSize; } + int clusterSize() const { return theClusterSize; } - float time() const { return theTime; } + float time() const { return theTime; } - float timeError() const { return theTimeError; } + float timeError() const { return theTimeError; } - /// Comparison operator, based on the rpcId and the digi time - bool operator==(const RPCRecHit& hit) const; + /// Comparison operator, based on the rpcId and the digi time + bool operator==(const RPCRecHit& hit) const; -private: - RPCDetId theRPCId; - int theBx; - int theFirstStrip; - int theClusterSize; - // Position and error in the Local Ref. Frame of the RPCLayer - LocalPoint theLocalPosition; - LocalError theLocalError; - float theTime, theTimeError; -}; + private: + RPCDetId theRPCId; + int theBx; + int theFirstStrip; + int theClusterSize; + // Position and error in the Local Ref. Frame of the RPCLayer + LocalPoint theLocalPosition; + LocalError theLocalError; + float theTime, theTimeError; + }; + /// The ostream operator + std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit); +} // namespace io_v1 +using RPCRecHit = io_v1::RPCRecHit; #endif - -/// The ostream operator -std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit); diff --git a/DataFormats/RPCRecHit/interface/RPCRecHitFwd.h b/DataFormats/RPCRecHit/interface/RPCRecHitFwd.h index 9f9abf58842ee..20306d9af6381 100644 --- a/DataFormats/RPCRecHit/interface/RPCRecHitFwd.h +++ b/DataFormats/RPCRecHit/interface/RPCRecHitFwd.h @@ -1,6 +1,8 @@ #ifndef DataFormats_RPCRecHit_RPCRecHitFwd_h #define DataFormats_RPCRecHit_RPCRecHitFwd_h -class RPCRecHit; - +namespace io_v1 { + class RPCRecHit; +} +using RPCRecHit = io_v1::RPCRecHit; #endif diff --git a/DataFormats/RPCRecHit/src/RPCRecHit.cc b/DataFormats/RPCRecHit/src/RPCRecHit.cc index 49272446736fe..63a9edd8447ce 100644 --- a/DataFormats/RPCRecHit/src/RPCRecHit.cc +++ b/DataFormats/RPCRecHit/src/RPCRecHit.cc @@ -6,92 +6,94 @@ #include "DataFormats/RPCRecHit/interface/RPCRecHit.h" -RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx) - : RecHit2DLocalPos(rpcId), - theRPCId(rpcId), - theBx(bx), - theFirstStrip(99), - theClusterSize(99), - theLocalPosition(), - theLocalError(), - theTime(0), - theTimeError(-1) {} +namespace io_v1 { + RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx) + : RecHit2DLocalPos(rpcId), + theRPCId(rpcId), + theBx(bx), + theFirstStrip(99), + theClusterSize(99), + theLocalPosition(), + theLocalError(), + theTime(0), + theTimeError(-1) {} -RPCRecHit::RPCRecHit() - : RecHit2DLocalPos(), - theRPCId(), - theBx(99), - theFirstStrip(99), - theClusterSize(99), - theLocalPosition(), - theLocalError(), - theTime(0), - theTimeError(-1) {} + RPCRecHit::RPCRecHit() + : RecHit2DLocalPos(), + theRPCId(), + theBx(99), + theFirstStrip(99), + theClusterSize(99), + theLocalPosition(), + theLocalError(), + theTime(0), + theTimeError(-1) {} -RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos) - : RecHit2DLocalPos(rpcId), - theRPCId(rpcId), - theBx(bx), - theFirstStrip(99), - theClusterSize(99), - theLocalPosition(pos), - theTime(0), - theTimeError(-1) { - float stripResolution = 3.0; //cm this sould be taken from trimmed cluster size times strip size - // taken out from geometry service i.e. topology - theLocalError = LocalError(stripResolution * stripResolution, 0., 0.); //FIXME: is it really needed? -} + RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos) + : RecHit2DLocalPos(rpcId), + theRPCId(rpcId), + theBx(bx), + theFirstStrip(99), + theClusterSize(99), + theLocalPosition(pos), + theTime(0), + theTimeError(-1) { + float stripResolution = 3.0; //cm this sould be taken from trimmed cluster size times strip size + // taken out from geometry service i.e. topology + theLocalError = LocalError(stripResolution * stripResolution, 0., 0.); //FIXME: is it really needed? + } -// Constructor from a local position and error, wireId and digi time. -RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos, const LocalError& err) - : RecHit2DLocalPos(rpcId), - theRPCId(rpcId), - theBx(bx), - theFirstStrip(99), - theClusterSize(99), - theLocalPosition(pos), - theLocalError(err), - theTime(0), - theTimeError(-1) {} + // Constructor from a local position and error, wireId and digi time. + RPCRecHit::RPCRecHit(const RPCDetId& rpcId, int bx, const LocalPoint& pos, const LocalError& err) + : RecHit2DLocalPos(rpcId), + theRPCId(rpcId), + theBx(bx), + theFirstStrip(99), + theClusterSize(99), + theLocalPosition(pos), + theLocalError(err), + theTime(0), + theTimeError(-1) {} -// Constructor from a local position and error, wireId, bx and cluster size. -RPCRecHit::RPCRecHit( - const RPCDetId& rpcId, int bx, int firstStrip, int clustSize, const LocalPoint& pos, const LocalError& err) - : RecHit2DLocalPos(rpcId), - theRPCId(rpcId), - theBx(bx), - theFirstStrip(firstStrip), - theClusterSize(clustSize), - theLocalPosition(pos), - theLocalError(err), - theTime(0), - theTimeError(-1) {} + // Constructor from a local position and error, wireId, bx and cluster size. + RPCRecHit::RPCRecHit( + const RPCDetId& rpcId, int bx, int firstStrip, int clustSize, const LocalPoint& pos, const LocalError& err) + : RecHit2DLocalPos(rpcId), + theRPCId(rpcId), + theBx(bx), + theFirstStrip(firstStrip), + theClusterSize(clustSize), + theLocalPosition(pos), + theLocalError(err), + theTime(0), + theTimeError(-1) {} -// Destructor -RPCRecHit::~RPCRecHit() {} + // Destructor + RPCRecHit::~RPCRecHit() {} -RPCRecHit* RPCRecHit::clone() const { return new RPCRecHit(*this); } + RPCRecHit* RPCRecHit::clone() const { return new RPCRecHit(*this); } -// Access to component RecHits. -// No components rechits: it returns a null vector -std::vector RPCRecHit::recHits() const { - std::vector nullvector; - return nullvector; -} + // Access to component RecHits. + // No components rechits: it returns a null vector + std::vector RPCRecHit::recHits() const { + std::vector nullvector; + return nullvector; + } -// Non-const access to component RecHits. -// No components rechits: it returns a null vector -std::vector RPCRecHit::recHits() { - std::vector nullvector; - return nullvector; -} + // Non-const access to component RecHits. + // No components rechits: it returns a null vector + std::vector RPCRecHit::recHits() { + std::vector nullvector; + return nullvector; + } -// Comparison operator, based on the wireId and the digi time -bool RPCRecHit::operator==(const RPCRecHit& hit) const { return this->geographicalId() == hit.geographicalId(); } + // Comparison operator, based on the wireId and the digi time + bool RPCRecHit::operator==(const RPCRecHit& hit) const { return this->geographicalId() == hit.geographicalId(); } -// The ostream operator -std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit) { - os << "pos: " << hit.localPosition().x(); - os << " +/- " << sqrt(hit.localPositionError().xx()); - return os; -} + // The ostream operator + std::ostream& operator<<(std::ostream& os, const RPCRecHit& hit) { + os << "pos: " << hit.localPosition().x(); + os << " +/- " << sqrt(hit.localPositionError().xx()); + return os; + } +} // namespace io_v1 diff --git a/DataFormats/RPCRecHit/src/classes_def.xml b/DataFormats/RPCRecHit/src/classes_def.xml index 701f78e409874..b9b6a53f09ff0 100644 --- a/DataFormats/RPCRecHit/src/classes_def.xml +++ b/DataFormats/RPCRecHit/src/classes_def.xml @@ -1,21 +1,21 @@ - - + + - - + + - - - - + + + + - +