1 #ifndef PHASE2GMT_TEMPORARY_ASSOCIATOR 2 #define PHASE2GMT_TEMPORARY_ASSOCIATOR 19 std::vector<MuonROI>
out;
22 if (
muons.size() > 0) {
23 for (
unsigned int i = 0;
i <
muons.size(
bx); ++
i) {
28 float eta =
mu->hwEta() * 0.010875;
32 globalPhi =
mu->processor() * 48 +
mu->hwPhi() - 24;
34 globalPhi =
mu->processor() * 96 +
mu->hwPhi() + 24;
37 float phi = globalPhi * 2 *
M_PI / 576.0;
40 else if (phi < (-
M_PI))
47 for (
unsigned int layer = 0; layer <= 4; ++layer) {
52 for (
uint i = 0;
i < selectedStubs.size(); ++
i) {
54 float deltaPhi = (stub->quality() & 0x1) ? stub->offline_coord1() - phi : stub->offline_coord2() - phi;
60 float deltaEta = (stub->etaQuality() == 0 || (stub->etaQuality() & 0x1))
61 ? fabs(stub->offline_eta1() -
eta)
62 : fabs(stub->offline_eta2() -
eta);
68 if (bestStubINT >= 0) {
69 roi.
addStub(selectedStubs[bestStubINT]);
70 usedStubs.push_back(selectedStubs[bestStubINT]);
73 if (
out.size() < 16 && !roi.
stubs().empty())
81 while (!cleanedStubs.empty()) {
84 usedStubs.push_back(cleanedStubs[0]);
85 for (
unsigned int layer = 0; layer <= 4; ++layer) {
86 if (layer == cleanedStubs[0]->tfLayer())
89 if (!selectedStubs.empty()) {
91 usedStubs.push_back(selectedStubs[0]);
94 if (!roi.
stubs().empty())
97 cleanedStubs =
clean(cleanedStubs, usedStubs);
105 for (
const auto& stub :
all) {
106 if (stub->bxNum() ==
bx && stub->tfLayer() == layer)
114 for (
const auto& stub :
all) {
116 for (
const auto& st : used) {
l1t::MuonStubRefVector selectLayerBX(const l1t::MuonStubRefVector &all, int bx, uint layer)
std::vector< MuonROI > associate(int bx, const l1t::ObjectRefBxCollection< l1t::RegionalMuonCand > &muons, const l1t::MuonStubRefVector &stubs)
static const double deltaEta
std::vector< edm::Ref< MuonStubCollection > > MuonStubRefVector
l1t::MuonStubRefVector clean(const l1t::MuonStubRefVector &all, const l1t::MuonStubRefVector &used)
ROITempAssociator(const edm::ParameterSet &iConfig)
const l1t::MuonStubRefVector & stubs() const
void addStub(const l1t::MuonStubRef &stub)
void setMuonRef(const l1t::RegionalMuonCandRef &ref)