diff --git a/DataFormats/DTDigi/interface/DTDigi.h b/DataFormats/DTDigi/interface/DTDigi.h index 455a8ccaebf4e..9fcc648856d16 100644 --- a/DataFormats/DTDigi/interface/DTDigi.h +++ b/DataFormats/DTDigi/interface/DTDigi.h @@ -14,67 +14,72 @@ #include -class DTDigi { -public: - // typedef uint32_t ChannelType; +namespace io_v1 { + class DTDigi { + public: + // typedef uint32_t ChannelType; - /// Construct from the wire#, the TDC counts and the digi number. - /// number should identify uniquely multiple digis in the same cell. - explicit DTDigi(int wire, int nTDC, int number = 0, int base = 32); + /// Construct from the wire#, the TDC counts and the digi number. + /// number should identify uniquely multiple digis in the same cell. + explicit DTDigi(int wire, int nTDC, int number = 0, int base = 32); - // Construct from the wire#, the time (ns) and the digi number. - // time is converted in TDC counts (1 TDC = 25./base ns) - // number should identify uniquely multiple digis in the same cell. - explicit DTDigi(int wire, double tdrift, int number = 0, int base = 32); + // Construct from the wire#, the time (ns) and the digi number. + // time is converted in TDC counts (1 TDC = 25./base ns) + // number should identify uniquely multiple digis in the same cell. + explicit DTDigi(int wire, double tdrift, int number = 0, int base = 32); - // Construct from channel and counts. - // explicit DTDigi (ChannelType channel, int nTDC); + // Construct from channel and counts. + // explicit DTDigi (ChannelType channel, int nTDC); - /// Default construction. - DTDigi(); + /// Default construction. + DTDigi(); - /// Digis are equal if they are on the same cell and have same TDC count - bool operator==(const DTDigi& digi) const; + /// Digis are equal if they are on the same cell and have same TDC count + bool operator==(const DTDigi& digi) const; - // The channel identifier and the digi number packed together - // ChannelType channel() const ; + // The channel identifier and the digi number packed together + // ChannelType channel() const ; - /// Return wire number - int wire() const; + /// Return wire number + int wire() const; - /// Identifies different digis within the same cell - int number() const; + /// Identifies different digis within the same cell + int number() const; - /// Get time in ns - double time() const; + /// Get time in ns + double time() const; - /// Get raw TDC count - int32_t countsTDC() const; + /// Get raw TDC count + int32_t countsTDC() const; - /// Get the TDC unit value in ns - double tdcUnit() const; + /// Get the TDC unit value in ns + double tdcUnit() const; - /// Get the TDC base (counts per BX) - int tdcBase() const; + /// Get the TDC base (counts per BX) + int tdcBase() const; - /// Print content of digi - void print() const; + /// Print content of digi + void print() const; -private: - friend class testDTDigis; + private: + friend class testDTDigis; - // The value of one TDC count in ns - static const double reso; + // The value of one TDC count in ns + static const double reso; - int32_t theCounts; // TDC count, in units given by 1/theTDCBase - uint16_t theWire; // channel number - uint8_t theNumber; // counter for digis in the same cell - uint8_t theTDCBase; // TDC base (counts per BX; 32 in Ph1 or 30 in Ph2) -}; + int32_t theCounts; // TDC count, in units given by 1/theTDCBase + uint16_t theWire; // channel number + uint8_t theNumber; // counter for digis in the same cell + uint8_t theTDCBase; // TDC base (counts per BX; 32 in Ph1 or 30 in Ph2) + }; +} // namespace io_v1 +using DTDigi = io_v1::DTDigi; #include #include -inline std::ostream& operator<<(std::ostream& o, const DTDigi& digi) { - return o << " " << digi.wire() << " " << digi.time() << " " << digi.number(); -} +namespace io_v1 { + inline std::ostream& operator<<(std::ostream& o, const DTDigi& digi) { + return o << " " << digi.wire() << " " << digi.time() << " " << digi.number(); + } +} // namespace io_v1 #endif diff --git a/DataFormats/DTDigi/interface/DTDigiFwd.h b/DataFormats/DTDigi/interface/DTDigiFwd.h index 901a82ab798b2..28125e22b41c7 100644 --- a/DataFormats/DTDigi/interface/DTDigiFwd.h +++ b/DataFormats/DTDigi/interface/DTDigiFwd.h @@ -1,6 +1,9 @@ #ifndef DataFormats_DTDigi_DTDigiFwd_h #define DataFormats_DTDigi_DTDigiFwd_h -class DTDigi; +namespace io_v1 { + class DTDigi; +} +using DTDigi = io_v1::DTDigi; #endif diff --git a/DataFormats/DTDigi/interface/DTuROSControlData.h b/DataFormats/DTDigi/interface/DTuROSControlData.h index 78f7e1f1507af..36feaa37af3ec 100644 --- a/DataFormats/DTDigi/interface/DTuROSControlData.h +++ b/DataFormats/DTDigi/interface/DTuROSControlData.h @@ -100,60 +100,63 @@ class DTuROSROSData { std::vector error_; }; -class DTuROSFEDData { -public: - /// Constructor - DTuROSFEDData() : header1_(0), header2_(0), trailer_(0), fed_(-1), nslots_(0), evtLgth_(0) { - for (int i = 0; i < DOCESLOTS; i++) - rsize_[i] = 0; - } +namespace io_v1 { + class DTuROSFEDData { + public: + /// Constructor + DTuROSFEDData() : header1_(0), header2_(0), trailer_(0), fed_(-1), nslots_(0), evtLgth_(0) { + for (int i = 0; i < DOCESLOTS; i++) + rsize_[i] = 0; + } - /// Destructor - ~DTuROSFEDData() {} + /// Destructor + ~DTuROSFEDData() {} - void setfed(int fed) { fed_ = fed; } + void setfed(int fed) { fed_ = fed; } - void setheader1(long dword) { header1_ = dword; } + void setheader1(long dword) { header1_ = dword; } - void setheader2(long dword) { header2_ = dword; } + void setheader2(long dword) { header2_ = dword; } - void settrailer(long dword) { trailer_ = dword; } + void settrailer(long dword) { trailer_ = dword; } - void setnslots(int nslots) { nslots_ = nslots; } + void setnslots(int nslots) { nslots_ = nslots; } - void setevtlgth(int evtLgth) { evtLgth_ = evtLgth; } + void setevtlgth(int evtLgth) { evtLgth_ = evtLgth; } - void setslotsize(int slot, int size) { rsize_[slot - 1] = size; } + void setslotsize(int slot, int size) { rsize_[slot - 1] = size; } - void setuROS(int slot, DTuROSROSData rwords) { rdata_[slot - 1] = rwords; } + void setuROS(int slot, DTuROSROSData rwords) { rdata_[slot - 1] = rwords; } - int getfed() const { return fed_; } + int getfed() const { return fed_; } - long getheader1() const { return header1_; } + long getheader1() const { return header1_; } - long getheader2() const { return header2_; } + long getheader2() const { return header2_; } - long gettrailer() const { return trailer_; } + long gettrailer() const { return trailer_; } - int getnslots() const { return nslots_; } + int getnslots() const { return nslots_; } - int getevtlgth() const { return evtLgth_; } + int getevtlgth() const { return evtLgth_; } - int getslotsize(int slot) const { return rsize_[slot - 1]; } + int getslotsize(int slot) const { return rsize_[slot - 1]; } - int getBXId() const { return (getheader1() >> 20) & 0xFFF; } + int getBXId() const { return (getheader1() >> 20) & 0xFFF; } - int getTTS() const { return (gettrailer() >> 4) & 0xF; } + int getTTS() const { return (gettrailer() >> 4) & 0xF; } - DTuROSROSData getuROS(int slot) const { return rdata_[slot - 1]; } + DTuROSROSData getuROS(int slot) const { return rdata_[slot - 1]; } -private: - long header1_, header2_, trailer_; + private: + long header1_, header2_, trailer_; - int fed_, nslots_, evtLgth_, rsize_[DOCESLOTS]; + int fed_, nslots_, evtLgth_, rsize_[DOCESLOTS]; - DTuROSROSData rdata_[DOCESLOTS]; -}; + DTuROSROSData rdata_[DOCESLOTS]; + }; +} // namespace io_v1 +using DTuROSFEDData = io_v1::DTuROSFEDData; typedef std::vector DTuROSFEDDataCollection; #endif diff --git a/DataFormats/DTDigi/interface/DTuROSFEDDataFwd.h b/DataFormats/DTDigi/interface/DTuROSFEDDataFwd.h index be27d9c2b9e20..fa3de688e5ff1 100644 --- a/DataFormats/DTDigi/interface/DTuROSFEDDataFwd.h +++ b/DataFormats/DTDigi/interface/DTuROSFEDDataFwd.h @@ -1,6 +1,9 @@ #ifndef DataFormats_DTDigi_DTuROSFEDDataFwd_h #define DataFormats_DTDigi_DTuROSFEDDataFwd_h -class DTuROSFEDData; +namespace io_v1 { + class DTuROSFEDData; +} +using DTuROSFEDData = io_v1::DTuROSFEDData; #endif diff --git a/DataFormats/DTDigi/src/DTDigi.cc b/DataFormats/DTDigi/src/DTDigi.cc index e5a79999db807..a436db3cf2c02 100644 --- a/DataFormats/DTDigi/src/DTDigi.cc +++ b/DataFormats/DTDigi/src/DTDigi.cc @@ -9,43 +9,45 @@ using namespace std; -DTDigi::DTDigi(int wire, int nTDC, int number, int base) - : theCounts(nTDC), theWire(wire), theNumber(number), theTDCBase(base) { - if (number > 255 || number < 0 || !(base == 30 || base == 32)) { - throw cms::Exception("BadConfig") << "DTDigi ctor: invalid parameters: number: " << number << " base: " << base; +namespace io_v1 { + DTDigi::DTDigi(int wire, int nTDC, int number, int base) + : theCounts(nTDC), theWire(wire), theNumber(number), theTDCBase(base) { + if (number > 255 || number < 0 || !(base == 30 || base == 32)) { + throw cms::Exception("BadConfig") << "DTDigi ctor: invalid parameters: number: " << number << " base: " << base; + } } -} -DTDigi::DTDigi(int wire, double tdrift, int number, int base) - : theCounts(static_cast(tdrift / 25. * base)), theWire(wire), theNumber(number), theTDCBase(base) { - if (number > 255 || number < 0 || !(base == 30 || base == 32)) { - throw cms::Exception("BadConfig") << "DTDigi ctor: invalid parameters: number: " << number << " base: " << base; + DTDigi::DTDigi(int wire, double tdrift, int number, int base) + : theCounts(static_cast(tdrift / 25. * base)), theWire(wire), theNumber(number), theTDCBase(base) { + if (number > 255 || number < 0 || !(base == 30 || base == 32)) { + throw cms::Exception("BadConfig") << "DTDigi ctor: invalid parameters: number: " << number << " base: " << base; + } } -} -DTDigi::DTDigi() : theCounts(0), theWire(0), theNumber(0), theTDCBase(32) {} + DTDigi::DTDigi() : theCounts(0), theWire(0), theNumber(0), theTDCBase(32) {} -// Comparison -bool DTDigi::operator==(const DTDigi& digi) const { - if (theWire != digi.wire() || - // theNumber != digi.number() || //FIXME required ?? - theCounts != digi.countsTDC()) - return false; - return true; -} + // Comparison + bool DTDigi::operator==(const DTDigi& digi) const { + if (theWire != digi.wire() || + // theNumber != digi.number() || //FIXME required ?? + theCounts != digi.countsTDC()) + return false; + return true; + } -double DTDigi::time() const { return theCounts * 25. / theTDCBase; } + double DTDigi::time() const { return theCounts * 25. / theTDCBase; } -int32_t DTDigi::countsTDC() const { return theCounts; } + int32_t DTDigi::countsTDC() const { return theCounts; } -int DTDigi::wire() const { return theWire; } + int DTDigi::wire() const { return theWire; } -int DTDigi::number() const { return theNumber; } + int DTDigi::number() const { return theNumber; } -double DTDigi::tdcUnit() const { return 25. / theTDCBase; } + double DTDigi::tdcUnit() const { return 25. / theTDCBase; } -int DTDigi::tdcBase() const { return theTDCBase; } + int DTDigi::tdcBase() const { return theTDCBase; } -void DTDigi::print() const { - cout << "Wire " << wire() << " Digi # " << number() << " Drift time (ns) " << time() << endl; -} + void DTDigi::print() const { + cout << "Wire " << wire() << " Digi # " << number() << " Drift time (ns) " << time() << endl; + } +} // namespace io_v1 diff --git a/DataFormats/DTDigi/src/classes_def.xml b/DataFormats/DTDigi/src/classes_def.xml index 79433e25c8d8e..1f80234085ba8 100644 --- a/DataFormats/DTDigi/src/classes_def.xml +++ b/DataFormats/DTDigi/src/classes_def.xml @@ -1,13 +1,12 @@ - - - - - - - - - + + + + + + + + @@ -22,11 +21,11 @@ - - + + - - + + diff --git a/DataFormats/RPCDigi/interface/RPCDigi.h b/DataFormats/RPCDigi/interface/RPCDigi.h index 8125e8433a10b..c5d4b56c6f208 100644 --- a/DataFormats/RPCDigi/interface/RPCDigi.h +++ b/DataFormats/RPCDigi/interface/RPCDigi.h @@ -16,50 +16,52 @@ #include #include -class RPCDigi { -public: - explicit RPCDigi(int strip, int bx); - RPCDigi(); +namespace io_v1 { + class RPCDigi { + public: + explicit RPCDigi(int strip, int bx); + RPCDigi(); - bool operator==(const RPCDigi& digi) const; - bool operator<(const RPCDigi& digi) const; - void print() const; - int strip() const { return strip_; } - int bx() const { return bx_; } - double time() const { return time_; } - double coordinateX() const { return coordinateX_; } - double coordinateY() const { return coordinateY_; } - bool hasTime() const { return hasTime_; } - bool hasX() const { return hasX_; } - bool hasY() const { return hasY_; } - void hasTime(bool has) { hasTime_ = has; } - void hasX(bool has) { hasX_ = has; } - void hasY(bool has) { hasY_ = has; } - double deltaTime() const { return deltaTime_; } - double deltaX() const { return deltaX_; } - double deltaY() const { return deltaY_; } - void setTime(double time) { time_ = time; } - void setDeltaTime(double dt) { deltaTime_ = dt; } - void setX(double x) { coordinateX_ = x; } - void setY(double y) { coordinateY_ = y; } - void setDeltaX(double dx) { deltaX_ = dx; } - void setDeltaY(double dy) { deltaY_ = dy; } - bool isPseudoDigi() const { return hasX_ || hasY_; } + bool operator==(const RPCDigi& digi) const; + bool operator<(const RPCDigi& digi) const; + void print() const; + int strip() const { return strip_; } + int bx() const { return bx_; } + double time() const { return time_; } + double coordinateX() const { return coordinateX_; } + double coordinateY() const { return coordinateY_; } + bool hasTime() const { return hasTime_; } + bool hasX() const { return hasX_; } + bool hasY() const { return hasY_; } + void hasTime(bool has) { hasTime_ = has; } + void hasX(bool has) { hasX_ = has; } + void hasY(bool has) { hasY_ = has; } + double deltaTime() const { return deltaTime_; } + double deltaX() const { return deltaX_; } + double deltaY() const { return deltaY_; } + void setTime(double time) { time_ = time; } + void setDeltaTime(double dt) { deltaTime_ = dt; } + void setX(double x) { coordinateX_ = x; } + void setY(double y) { coordinateY_ = y; } + void setDeltaX(double dx) { deltaX_ = dx; } + void setDeltaY(double dy) { deltaY_ = dy; } + bool isPseudoDigi() const { return hasX_ || hasY_; } -private: - uint16_t strip_; - int32_t bx_; - double time_; - double coordinateX_; - double coordinateY_; - double deltaTime_; - double deltaX_; - double deltaY_; - bool hasTime_; - bool hasX_; - bool hasY_; -}; - -std::ostream& operator<<(std::ostream& o, const RPCDigi& digi); + private: + uint16_t strip_; + int32_t bx_; + double time_; + double coordinateX_; + double coordinateY_; + double deltaTime_; + double deltaX_; + double deltaY_; + bool hasTime_; + bool hasX_; + bool hasY_; + }; + std::ostream& operator<<(std::ostream& o, const RPCDigi& digi); +} // namespace io_v1 +using RPCDigi = io_v1::RPCDigi; #endif diff --git a/DataFormats/RPCDigi/interface/RPCDigiFwd.h b/DataFormats/RPCDigi/interface/RPCDigiFwd.h index a688f045cbb3d..5277a26c807f0 100644 --- a/DataFormats/RPCDigi/interface/RPCDigiFwd.h +++ b/DataFormats/RPCDigi/interface/RPCDigiFwd.h @@ -1,6 +1,8 @@ #ifndef DataFormats_RPCDigi_RPCDigiFwd_h #define DataFormats_RPCDigi_RPCDigiFwd_h -class RPCDigi; - +namespace io_v1 { + class RPCDigi; +} +using RPCDigi = io_v1::RPCDigi; #endif diff --git a/DataFormats/RPCDigi/src/RPCDigi.cc b/DataFormats/RPCDigi/src/RPCDigi.cc index ad546042214ef..b1e8832c35da8 100644 --- a/DataFormats/RPCDigi/src/RPCDigi.cc +++ b/DataFormats/RPCDigi/src/RPCDigi.cc @@ -12,47 +12,51 @@ #include "DataFormats/RPCDigi/interface/RPCDigi.h" #include -RPCDigi::RPCDigi(int strip, int bx) - : strip_(strip), - bx_(bx), - time_(0), - coordinateX_(0), - coordinateY_(0), - deltaTime_(0), - deltaX_(0), - deltaY_(0), - hasTime_(false), - hasX_(false), - hasY_(false) {} +namespace io_v1 { + RPCDigi::RPCDigi(int strip, int bx) + : strip_(strip), + bx_(bx), + time_(0), + coordinateX_(0), + coordinateY_(0), + deltaTime_(0), + deltaX_(0), + deltaY_(0), + hasTime_(false), + hasX_(false), + hasY_(false) {} -RPCDigi::RPCDigi() - : strip_(0), - bx_(0), - time_(0), - coordinateX_(0), - coordinateY_(0), - deltaTime_(0), - deltaX_(0), - deltaY_(0), - hasTime_(false), - hasX_(false), - hasY_(false) {} + RPCDigi::RPCDigi() + : strip_(0), + bx_(0), + time_(0), + coordinateX_(0), + coordinateY_(0), + deltaTime_(0), + deltaX_(0), + deltaY_(0), + hasTime_(false), + hasX_(false), + hasY_(false) {} -// Comparison -bool RPCDigi::operator==(const RPCDigi& digi) const { - if (strip_ != digi.strip() || bx_ != digi.bx()) - return false; - return true; -} + // Comparison + bool RPCDigi::operator==(const RPCDigi& digi) const { + if (strip_ != digi.strip() || bx_ != digi.bx()) + return false; + return true; + } -///Precedence operator -bool RPCDigi::operator<(const RPCDigi& digi) const { - if (digi.bx() == this->bx()) - return digi.strip() < this->strip(); - else - return digi.bx() < this->bx(); -} + ///Precedence operator + bool RPCDigi::operator<(const RPCDigi& digi) const { + if (digi.bx() == this->bx()) + return digi.strip() < this->strip(); + else + return digi.bx() < this->bx(); + } -std::ostream& operator<<(std::ostream& o, const RPCDigi& digi) { return o << " " << digi.strip() << " " << digi.bx(); } + std::ostream& operator<<(std::ostream& o, const RPCDigi& digi) { + return o << " " << digi.strip() << " " << digi.bx(); + } -void RPCDigi::print() const { std::cout << "Strip " << strip() << " bx " << bx() << std::endl; } + void RPCDigi::print() const { std::cout << "Strip " << strip() << " bx " << bx() << std::endl; } +} // namespace io_v1 diff --git a/DataFormats/RPCDigi/src/classes_def.xml b/DataFormats/RPCDigi/src/classes_def.xml index 5f5842115f977..ca32a2e92ec53 100644 --- a/DataFormats/RPCDigi/src/classes_def.xml +++ b/DataFormats/RPCDigi/src/classes_def.xml @@ -1,12 +1,12 @@ - - + + - - - - - + + + + +