Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions DataFormats/TotemReco/interface/TotemT2Digi.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,36 @@
#ifndef DataFormats_TotemReco_TotemT2Digi_h
#define DataFormats_TotemReco_TotemT2Digi_h

class TotemT2Digi {
public:
TotemT2Digi() = default;
TotemT2Digi(unsigned short id, unsigned char marker, unsigned short le, unsigned short te, unsigned char status);
namespace io_v1 {
class TotemT2Digi {
public:
TotemT2Digi() = default;
TotemT2Digi(unsigned short id, unsigned char marker, unsigned short le, unsigned short te, unsigned char status);

void setLeadingEdge(unsigned short le) { lead_edge_ = le; }
unsigned short leadingEdge() const { return lead_edge_; }
void setTrailingEdge(unsigned short te) { trail_edge_ = te; }
unsigned short trailingEdge() const { return trail_edge_; }
unsigned char status() const { return status_ & 0xF; }
bool hasLE() const { return marker_ & 0x1; }
bool hasTE() const { return marker_ & 0x2; }
bool hasManyLE() const { return marker_ & 0x4; }
bool hasManyTE() const { return marker_ & 0x8; }
void setLeadingEdge(unsigned short le) { lead_edge_ = le; }
unsigned short leadingEdge() const { return lead_edge_; }
void setTrailingEdge(unsigned short te) { trail_edge_ = te; }
unsigned short trailingEdge() const { return trail_edge_; }
unsigned char status() const { return status_ & 0xF; }
bool hasLE() const { return marker_ & 0x1; }
bool hasTE() const { return marker_ & 0x2; }
bool hasManyLE() const { return marker_ & 0x4; }
bool hasManyTE() const { return marker_ & 0x8; }

private:
/// New HW ID in ver 2.2
unsigned short id_{0};
/// Channel marker
unsigned char marker_{0};
/// Leading edge time
unsigned short lead_edge_{0};
/// Trailing edge time
unsigned short trail_edge_{0};
/// Header status flags
unsigned char status_{0};
};

bool operator<(const TotemT2Digi& lhs, const TotemT2Digi& rhs);
private:
/// New HW ID in ver 2.2
unsigned short id_{0};
/// Channel marker
unsigned char marker_{0};
/// Leading edge time
unsigned short lead_edge_{0};
/// Trailing edge time
unsigned short trail_edge_{0};
/// Header status flags
unsigned char status_{0};
};

bool operator<(const TotemT2Digi& lhs, const TotemT2Digi& rhs);
} // namespace io_v1
using TotemT2Digi = io_v1::TotemT2Digi;
#endif
28 changes: 15 additions & 13 deletions DataFormats/TotemReco/src/TotemT2Digi.cc
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#include "DataFormats/TotemReco/interface/TotemT2Digi.h"

TotemT2Digi::TotemT2Digi(
unsigned short id, unsigned char marker, unsigned short le, unsigned short te, unsigned char status)
: id_(id), marker_(marker), lead_edge_(le), trail_edge_(te), status_(status) {}
namespace io_v1 {
TotemT2Digi::TotemT2Digi(
unsigned short id, unsigned char marker, unsigned short le, unsigned short te, unsigned char status)
: id_(id), marker_(marker), lead_edge_(le), trail_edge_(te), status_(status) {}

bool operator<(const TotemT2Digi& lhs, const TotemT2Digi& rhs) {
if (lhs.leadingEdge() < rhs.leadingEdge())
return true;
if (lhs.leadingEdge() > rhs.leadingEdge())
bool operator<(const TotemT2Digi& lhs, const TotemT2Digi& rhs) {
if (lhs.leadingEdge() < rhs.leadingEdge())
return true;
if (lhs.leadingEdge() > rhs.leadingEdge())
return false;
if (lhs.trailingEdge() < rhs.trailingEdge())
return true;
if (lhs.trailingEdge() > rhs.trailingEdge())
return false;
return false;
if (lhs.trailingEdge() < rhs.trailingEdge())
return true;
if (lhs.trailingEdge() > rhs.trailingEdge())
return false;
return false;
}
}
} // namespace io_v1
16 changes: 7 additions & 9 deletions DataFormats/TotemReco/src/classes_def.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<lcgdict>
<class name="TotemT2Digi" ClassVersion="5">
<version ClassVersion="5" checksum="1620670855"/>
<version ClassVersion="4" checksum="708922079"/>
<version ClassVersion="3" checksum="4024006040"/>
<class name="io_v1::TotemT2Digi" ClassVersion="3">
<version ClassVersion="3" checksum="246842887"/>
</class>
<class name="edmNew::DetSet<TotemT2Digi>"/>
<class name="edmNew::DetSetVector<TotemT2Digi>"/>
<class name="edm::Wrapper<edmNew::DetSetVector<TotemT2Digi> >"/>
<class name="std::vector<TotemT2Digi>"/>
<class name="std::vector<edmNew::DetSet<TotemT2Digi> >"/>
<class name="edmNew::DetSet<io_v1::TotemT2Digi>"/>
<class name="edmNew::DetSetVector<io_v1::TotemT2Digi>"/>
<class name="edm::Wrapper<edmNew::DetSetVector<io_v1::TotemT2Digi> >"/>
<class name="std::vector<io_v1::TotemT2Digi>"/>
<class name="std::vector<edmNew::DetSet<io_v1::TotemT2Digi> >"/>
<class name="TotemT2RecHit" ClassVersion="3">
<version ClassVersion="3" checksum="969691996"/>
</class>
Expand Down