1+ #ifndef DataFormats_GEMDigi_ME0Stub_H
2+ #define DataFormats_GEMDigi_ME0Stub_H
3+
4+ #include < vector>
5+ #include < cstdint>
6+ #include < string>
7+ #include < iostream>
8+ #include < iomanip>
9+
10+ #include " DataFormats/MuonDetId/interface/GEMDetId.h"
11+ #include " L1Trigger/L1TGEM/interface/ME0StubPrimitive.h"
12+
13+ class ME0Stub final {
14+ public:
15+ ME0Stub ()
16+ : detId_(), etaPartition_(0 ), padStrip_(0 ), bendingAngle_(0 ), layerCount_(0 ), quality_(0 ), patternId_(0 ), bx_(0 ) {}
17+ ME0Stub (const GEMDetId& id, const ME0StubPrimitive& stub)
18+ : detId_(id),
19+ etaPartition_ (stub.etaPartition()),
20+ padStrip_(stub.strip() + stub.subStrip()),
21+ bendingAngle_(stub.bendingAngle()),
22+ layerCount_(stub.layerCount()),
23+ quality_(stub.quality()),
24+ patternId_(stub.patternId()),
25+ bx_(stub.bx()) {}
26+ ME0Stub (const GEMDetId& id,
27+ int etaPartition,
28+ double padStrip,
29+ double bendingAngle,
30+ int layerCount,
31+ int quality,
32+ int patternId,
33+ double bx)
34+ : detId_(id),
35+ etaPartition_(etaPartition),
36+ padStrip_(padStrip),
37+ bendingAngle_(bendingAngle),
38+ layerCount_(layerCount),
39+ quality_(quality),
40+ patternId_(patternId),
41+ bx_(bx) {}
42+
43+ // clone
44+ ME0Stub* clone () const { return new ME0Stub (*this ); }
45+
46+ // Get private variable
47+ GEMDetId detId () const { return detId_; }
48+ int etaPartition () const { return etaPartition_; }
49+ double strip () const { return padStrip_; }
50+ double bendingAngle () const { return bendingAngle_; }
51+ int layerCount () const { return layerCount_; }
52+ int quality () const { return quality_; }
53+ int patternId () const { return patternId_; }
54+ double bx () const { return bx_; }
55+
56+ // operators
57+ bool operator ==(const ME0Stub& other) {
58+ if (layerCount_ == 0 && other.layerCount_ == 0 ) {
59+ return true ;
60+ }
61+ return (quality_ == other.quality_ );
62+ }
63+ bool operator >(const ME0Stub& other) { return (quality_ > other.quality_ ); }
64+ bool operator <(const ME0Stub& other) { return (quality_ < other.quality_ ); }
65+ bool operator >=(const ME0Stub& other) { return (quality_ >= other.quality_ ); }
66+ bool operator <=(const ME0Stub& other) { return (quality_ <= other.quality_ ); }
67+ // ostream
68+ friend std::ostream& operator <<(std::ostream& os, const ME0Stub& stub) {
69+ os << " id=" << stub.patternId () << " , lc=" << stub.layerCount () << " , strip=" << std::fixed << std::setprecision (3 )
70+ << stub.strip () << " , prt=" << stub.etaPartition () << " , quality=" << stub.quality ();
71+ return os;
72+ }
73+
74+ private:
75+ GEMDetId detId_;
76+ int etaPartition_;
77+ double padStrip_;
78+ double bendingAngle_;
79+ int layerCount_;
80+ int quality_;
81+ int patternId_;
82+ double bx_;
83+ };
84+
85+ #endif
0 commit comments