From 216bbca51da30029436ad460c03a71f0e3c790d8 Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Tue, 17 Mar 2026 15:41:31 -0500 Subject: [PATCH] Moved Phase2TrackerCluster1D to versioned namespace --- .../interface/Phase2TrackerCluster1D.h | 64 ++++++++++--------- .../Phase2TrackerCluster/src/classes_def.xml | 28 ++++---- .../TrackerRecHit2D/src/classes_def.xml | 2 +- 3 files changed, 48 insertions(+), 46 deletions(-) diff --git a/DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h b/DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h index 79fa24da59ab1..11638f38915cd 100644 --- a/DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h +++ b/DataFormats/Phase2TrackerCluster/interface/Phase2TrackerCluster1D.h @@ -7,37 +7,39 @@ #include "DataFormats/Phase2TrackerDigi/interface/Phase2TrackerDigi.h" -class Phase2TrackerCluster1D { -public: - Phase2TrackerCluster1D() : data_(0) {} - Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size) - : firstDigi_(row, col), data_((size & 0x7fff)) {} - Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size, unsigned int threshold) - : firstDigi_(row, col), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) {} - Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size) - : firstDigi_(firstDigi), data_((size & 0x7fff)) {} - Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size, unsigned int threshold) - : firstDigi_(firstDigi), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) {} - - const Phase2TrackerDigi& firstDigi() const { return firstDigi_; } - unsigned int firstStrip() const { return firstDigi_.strip(); } - unsigned int firstRow() const { return firstDigi_.row(); } - unsigned int edge() const { return firstDigi_.edge(); } - unsigned int column() const { return firstDigi_.column(); } - uint16_t size() const { return (data_ & 0x7fff); } - uint16_t threshold() const { return ((data_ >> 15) & 0x1); } - float center() const { return float(firstStrip()) + 0.5f * size(); } - std::pair barycenter() const { return std::make_pair(column(), center()); } - -private: - Phase2TrackerDigi firstDigi_; - uint16_t data_; -}; - -inline bool operator<(const Phase2TrackerCluster1D& one, const Phase2TrackerCluster1D& other) { - return one.firstStrip() < other.firstStrip(); -} - +namespace io_v1 { + class Phase2TrackerCluster1D { + public: + Phase2TrackerCluster1D() : data_(0) {} + Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size) + : firstDigi_(row, col), data_((size & 0x7fff)) {} + Phase2TrackerCluster1D(unsigned int row, unsigned int col, unsigned int size, unsigned int threshold) + : firstDigi_(row, col), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) {} + Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size) + : firstDigi_(firstDigi), data_((size & 0x7fff)) {} + Phase2TrackerCluster1D(const Phase2TrackerDigi& firstDigi, unsigned int size, unsigned int threshold) + : firstDigi_(firstDigi), data_(((threshold & 0x1) << 15) | (size & 0x7fff)) {} + + const Phase2TrackerDigi& firstDigi() const { return firstDigi_; } + unsigned int firstStrip() const { return firstDigi_.strip(); } + unsigned int firstRow() const { return firstDigi_.row(); } + unsigned int edge() const { return firstDigi_.edge(); } + unsigned int column() const { return firstDigi_.column(); } + uint16_t size() const { return (data_ & 0x7fff); } + uint16_t threshold() const { return ((data_ >> 15) & 0x1); } + float center() const { return float(firstStrip()) + 0.5f * size(); } + std::pair barycenter() const { return std::make_pair(column(), center()); } + + private: + Phase2TrackerDigi firstDigi_; + uint16_t data_; + }; + + inline bool operator<(const Phase2TrackerCluster1D& one, const Phase2TrackerCluster1D& other) { + return one.firstStrip() < other.firstStrip(); + } +} // namespace io_v1 +using Phase2TrackerCluster1D = io_v1::Phase2TrackerCluster1D; typedef edmNew::DetSetVector Phase2TrackerCluster1DCollectionNew; #endif diff --git a/DataFormats/Phase2TrackerCluster/src/classes_def.xml b/DataFormats/Phase2TrackerCluster/src/classes_def.xml index 7190f41219402..0e42f187401dc 100644 --- a/DataFormats/Phase2TrackerCluster/src/classes_def.xml +++ b/DataFormats/Phase2TrackerCluster/src/classes_def.xml @@ -1,17 +1,17 @@ - - + + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/DataFormats/TrackerRecHit2D/src/classes_def.xml b/DataFormats/TrackerRecHit2D/src/classes_def.xml index 5ea82cfcd445d..fb812a69743a2 100644 --- a/DataFormats/TrackerRecHit2D/src/classes_def.xml +++ b/DataFormats/TrackerRecHit2D/src/classes_def.xml @@ -63,7 +63,7 @@ - +