Skip to content

Commit 6ebe601

Browse files
authored
Merge pull request #47373 from woohyeonHeo/l1t_me0
ME0 L1Trigger Object and producer for CMSSW
2 parents 95e2d38 + 402690f commit 6ebe601

22 files changed

+1869
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#ifndef DataFormats_GEMDigi_ME0StubCollection_H
2+
#define DataFormats_GEMDigi_ME0StubCollection_H
3+
4+
/** \class ME0StubCollection
5+
*
6+
* The collection of ME0Stub's. See \ref CSCSegmentCollection.h for details from which is derived.
7+
*
8+
* \author Woohyeon Heo
9+
*/
10+
11+
#include "DataFormats/MuonDetId/interface/GEMDetId.h"
12+
#include "DataFormats/GEMDigi/interface/ME0Stub.h"
13+
14+
#include "DataFormats/Common/interface/RangeMap.h"
15+
#include "DataFormats/Common/interface/ClonePolicy.h"
16+
#include "DataFormats/Common/interface/OwnVector.h"
17+
18+
typedef edm::RangeMap<GEMDetId, edm::OwnVector<ME0Stub> > ME0StubCollection;
19+
20+
#include "DataFormats/Common/interface/Ref.h"
21+
typedef edm::Ref<ME0StubCollection> ME0StubRef;
22+
23+
#endif

DataFormats/GEMDigi/src/classes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,8 @@
3737
#include "DataFormats/GEMDigi/interface/ME0TriggerDigi.h"
3838
#include "DataFormats/GEMDigi/interface/ME0TriggerDigiCollection.h"
3939

40+
#include "DataFormats/GEMDigi/interface/ME0Stub.h"
41+
#include "DataFormats/GEMDigi/interface/ME0StubCollection.h"
42+
4043
#include "DataFormats/Common/interface/Wrapper.h"
4144
#include <vector>

DataFormats/GEMDigi/src/classes_def.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,21 @@
137137
<class name="MuonDigiCollection<ME0DetId,ME0TriggerDigi>"/>
138138
<class name="edm::Wrapper<MuonDigiCollection<ME0DetId,ME0TriggerDigi> >" splitLevel="0"/>
139139

140+
<class name="ME0Stub" ClassVersion="3">
141+
<version ClassVersion="3" checksum="1308525807"/>
142+
</class>
143+
<class name="std::vector<ME0Stub*>" splitLevel="0"/>
144+
<class name="edm::OwnVector<ME0Stub,edm::ClonePolicy<ME0Stub> >" splitLevel="0" rntupleSplit="false" />
145+
<class name="edm::RangeMap<GEMDetId,edm::OwnVector<ME0Stub,edm::ClonePolicy<ME0Stub> >,edm::ClonePolicy<ME0Stub> >" splitLevel="0"/>
146+
<class name="edm::Wrapper<edm::RangeMap<GEMDetId,edm::OwnVector<ME0Stub,edm::ClonePolicy<ME0Stub> >,edm::ClonePolicy<ME0Stub> > >" splitLevel="0"/>
147+
<class name="ME0StubRef" splitLevel="0"/>
148+
140149
<class name="std::map<GEMDetId,std::vector<ME0TriggerDigi> >"/>
141150
<class name="std::pair<GEMDetId,std::vector<ME0TriggerDigi> >"/>
142151
<class name="MuonDigiCollection<GEMDetId,ME0TriggerDigi>"/>
143152
<class name="edm::Wrapper<MuonDigiCollection<GEMDetId,ME0TriggerDigi> >" splitLevel="0"/>
153+
<class name="edm::OwnVector<ME0Stub, edm::ClonePolicy<ME0Stub> >">
154+
<method name="sort" splitLevel="0"/>
155+
</class>
144156

145157
</lcgdict>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#ifndef L1Trigger_L1TGEM_ME0StubAlgoChamber_H
2+
#define L1Trigger_L1TGEM_ME0StubAlgoChamber_H
3+
4+
#include "L1Trigger/L1TGEM/interface/ME0StubAlgoSubfunction.h"
5+
#include "L1Trigger/L1TGEM/interface/ME0StubAlgoPartition.h"
6+
#include "L1Trigger/L1TGEM/interface/ME0StubAlgoMask.h"
7+
#include <vector>
8+
#include <cstdint>
9+
#include <algorithm>
10+
11+
namespace l1t {
12+
namespace me0 {
13+
std::vector<std::vector<ME0StubPrimitive>> crossPartitionCancellation(
14+
std::vector<std::vector<ME0StubPrimitive>>& segments, int crossPartSegWidth);
15+
std::vector<ME0StubPrimitive> processChamber(const std::vector<std::vector<UInt192>>& chamberData,
16+
const std::vector<std::vector<std::vector<int>>>& chamberBxData,
17+
Config& config);
18+
} // namespace me0
19+
} // namespace l1t
20+
21+
#endif

0 commit comments

Comments
 (0)